{"version":3,"sources":["../node_modules/whatwg-fetch/fetch.js","../node_modules/@firebase/polyfill/dist/index.esm.js","../node_modules/tslib/tslib.es6.js","../node_modules/@firebase/util/dist/index.cjs.js","../node_modules/@firebase/app/dist/index.cjs.js","../node_modules/firebase/app/dist/index.cjs.js","../node_modules/@firebase/logger/dist/index.esm.js","../node_modules/@firebase/webchannel-wrapper/dist/index.esm.js","../node_modules/@firebase/firestore/dist/index.cjs.js","../node_modules/firebase/firestore/dist/index.esm.js","utils/firebase.ts","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/isarray/index.js","../node_modules/buffer/index.js","../node_modules/lodash/lodash.js","exhibitors/exhibitors.ts"],"names":["setTimeoutFunc","setTimeout","noop","bind","fn","thisArg","apply","arguments","Promise","TypeError","_state","_handled","_value","undefined","_deferreds","doResolve","handle","self","deferred","_immediateFn","cb","onFulfilled","onRejected","ret","e","reject","promise","resolve","push","newValue","then","finale","length","_unhandledRejectionFn","i","len","Handler","done","value","reason","ex","prototype","prom","constructor","callback","all","arr","args","Array","slice","call","remaining","res","val","race","values","setImmediate","err","console","warn","globalNS","window","global","Error","createCommonjsModule","module","exports","_global","Math","Function","__g","_core","core","version","__e","_core_1","_isObject","it","_anObject","_fails","exec","_descriptors","Object","defineProperty","get","a","document","is","createElement","_domCreate","_ie8DomDefine","_toPrimitive","S","toString","valueOf","dP","f","O","P","Attributes","_objectDp","_propertyDesc","bitmap","enumerable","configurable","writable","_hide","object","key","hasOwnProperty","_has","id","px","random","_uid","concat","_redefine","SRC","$toString","TPL","split","inspectSource","safe","isFunction","join","String","_aFunction","_ctx","that","b","c","PROTOTYPE","$export","type","name","source","IS_FORCED","own","out","exp","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","target","expProto","U","W","R","_export","_cof","_iobject","propertyIsEnumerable","_defined","_toObject","ceil","floor","_toInteger","isNaN","min","_toLength","_isArray","isArray","arg","SHARED","store","_shared","_wks","Symbol","USE_SYMBOL","SPECIES","_arraySpeciesConstructor","original","C","_arraySpeciesCreate","_arrayMethods","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","$this","callbackfn","index","result","UNSCOPABLES","ArrayProto","_addToUnscopables","$find","KEY","forced","find","$find$1","KEY$1","forced$1","findIndex","_toIobject","max","min$1","_toAbsoluteIndex","_arrayIncludes","IS_INCLUDES","el","fromIndex","shared","_sharedKey","arrayIndexOf","IE_PROTO","_objectKeysInternal","names","_enumBugKeys","_objectKeys","keys","f$1","getOwnPropertySymbols","_objectGops","f$2","_objectPie","$assign","assign","_objectAssign","A","K","forEach","k","aLen","T","getSymbols","isEnum","j","MATCH","_isRegexp","isRegExp","_stringContext","searchString","NAME","MATCH$1","_failsIsRegexp","re","STARTS_WITH","$startsWith","startsWith","search","_stringRepeat","count","str","n","Infinity","RangeError","repeat","_meta","META","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","w","meta","NEED","fastKey","getWeak","onFreeze","_meta_1","_meta_2","_meta_3","_meta_4","_meta_5","def","TAG","_setToStringTag","tag","stat","f$3","_wksExt","_library","_wksDefine","$Symbol","charAt","_enumKeys","symbols","_objectDps","defineProperties","Properties","document$1","_html","documentElement","IE_PROTO$1","Empty","PROTOTYPE$1","createDict","iframe","iframeDocument","style","display","appendChild","src","contentWindow","open","write","lt","close","_objectCreate","hiddenKeys","f$4","getOwnPropertyNames","_objectGopn","gOPN","toString$1","windowNames","getWindowNames","f$5","_objectGopnExt","gOPD","getOwnPropertyDescriptor","f$6","_objectGopd","gOPD$1","dP$1","gOPN$1","$JSON","JSON","_stringify","stringify","PROTOTYPE$2","HIDDEN","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","ObjectProto","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","D","protoDesc","wrap","sym","_k","isSymbol","iterator","$defineProperty","$defineProperties","l","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","$set","set","es6Symbols","wellKnownSymbols","keyFor","useSetter","useSimple","replacer","$replacer","TAG$1","ARG","tryGet","_classof","callee","test","symbol","_stringAt","TO_STRING","pos","s","charCodeAt","_iterators","IteratorPrototype","_iterCreate","Constructor","next","IE_PROTO$2","ObjectProto$1","_objectGpo","getPrototypeOf","ITERATOR","BUGGY","FF_ITERATOR","KEYS","VALUES","returnThis","_iterDefine","Base","DEFAULT","IS_SET","FORCED","getMethod","methods","kind","proto","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","entries","$at","iterated","_t","_i","point","_iterStep","es6_array_iterator","Arguments","ITERATOR$1","TO_STRING_TAG","ArrayValues","DOMIterables","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","collections","explicit","Collection","extendStatics","setPrototypeOf","__proto__","d","p","__extends","__","__assign","t","__rest","indexOf","__decorate","decorators","desc","r","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","_arguments","generator","fulfilled","step","rejected","__generator","body","_","y","g","label","sent","trys","ops","verb","v","op","pop","__exportStar","m","__values","o","__read","ar","error","__spread","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","mod","__esModule","default","__importDefault","LogLevel","instances","defaultLogLevel","INFO","defaultLogHandler","instance","logType","logLevel","now","Date","toISOString","DEBUG","VERBOSE","log","info","WARN","ERROR","Logger","_logLevel","_logHandler","debug","setLogLevel","level","inst","commonjsGlobal","goog","h","aa","ba","splice","ca","da","ea","fa","unshift","u","x","L","mh","captureStackTrace","stack","message","ha","ia","z","ja","ka","Ka","Qa","bb","la","ma","lastIndexOf","na","oa","some","pa","qa","ra","sa","ta","ua","va","wa","trim","xa","ya","navigator","za","userAgent","Aa","Ba","Ca","Da","Ea","Fa","Ga","Ha","Ia","Pa","Ja","La","Ma","toLowerCase","Na","Oa","documentMode","Ra","Sa","parseFloat","Ua","Ta","parseInt","Va","compatMode","Wa","freeze","Xa","Number","Ya","Za","addEventListener","removeEventListener","currentTarget","defaultPrevented","Be","relatedTarget","button","screenY","screenX","clientY","clientX","offsetY","offsetX","charCode","keyCode","metaKey","shiftKey","altKey","ctrlKey","state","pointerId","pointerType","fb","Kf","stopPropagation","preventDefault","$a","changedTouches","srcElement","nodeName","fromElement","toElement","layerX","layerY","pageX","pageY","cancelBubble","returnValue","ab","listener","proxy","capture","Ob","Eb","db","J","xb","eb","Vb","add","remove","ye","pb","jb","gb","ib","once","kb","nb","lb","mb","attachEvent","addListener","removeListener","ob","Oc","ed","qb","Le","detachEvent","rb","sb","parentNode","tb","handleEvent","H","Pe","Uc","dispatchEvent","Lb","pg","ub","vb","Sf","ef","ug","Zb","Pb","I","lc","put","zb","Bb","wb","reset","scope","Gc","yb","Ab","MessageChannel","postMessage","location","protocol","host","origin","data","port1","onmessage","port2","rd","onreadystatechange","removeChild","Cb","Db","Window","Af","wg","Fb","Gb","nd","Rg","ie","Hb","Ib","Uf","Xe","fg","qc","Jb","enabled","setInterval","stop","start","clearTimeout","ff","mf","Cc","pause","Kb","Mb","pe","Zd","uc","$b","Tf","je","Md","Bg","Ge","Nb","Qb","Rb","getName","getParent","pf","Qd","Pf","gf","uf","lf","We","Fg","Qe","Sb","Tb","substr","Wb","Xb","Wc","Id","Tg","Xf","Ug","ng","Sg","parse","Wf","M","Yb","N","size","rtt","ac","bc","NO_ERROR","Vg","bh","ah","Yg","$g","dh","Ne","TIMEOUT","gh","cc","Xg","kh","Oe","ih","jh","eh","hh","Zg","lh","dc","ec","pd","Vd","Mf","hc","Q","OPEN","Wg","fh","fc","gc","ic","Xc","Fc","jc","Vc","hd","Ed","yc","Dd","Wd","ActiveXObject","XMLHttpRequest","be","kc","mc","nc","oc","addAll","ga","He","Gg","kd","clone","Ub","Ce","jd","Me","mg","send","hg","Ud","Ig","sf","Yc","Fd","Ng","Tc","Ag","vf","kg","substring","yg","sendBeacon","Image","cancel","tg","Ke","gg","Df","de","abort","Hc","ue","wc","X","clear","pc","decodeURIComponent","replace","Qf","cd","bd","$c","match","rc","Ac","Bc","decodeURI","sc","encodeURI","tc","encodeURIComponent","Ic","Rd","xc","Hf","If","Ff","ae","Gf","Ef","ad","zc","getQuery","Ie","abs","removeParameter","Ad","od","$d","Jc","Kc","Lc","Pc","map","context","Mc","me","Nc","PerformanceNavigationTiming","performance","getEntriesByType","nextHopProtocol","vc","ke","nh","$","extend","connect","Sd","xd","Pd","dd","Ze","Fe","contains","xg","rg","jg","Qc","onload","Rc","onerror","onabort","ontimeout","ld","ee","xf","ze","Re","$e","hf","jf","md","Sc","V","headers","ge","Ec","Ae","lg","timeout","lengthComputable","loaded","total","Zc","Bd","De","hb","Te","ag","kf","fd","Se","he","Ve","vg","nf","Od","oh","supportsCrossDomainXhr","concurrentRequestLimit","backgroundChannelTest","Nd","fastHandshake","Qg","testUrl","messageUrlParams","messageHeaders","clientProtocolHeaderRequired","initMessageHeaders","messageContentType","zd","Eg","httpHeadersOverwriteParam","Cg","Og","zg","sendRawJson","httpSessionIdParam","Dg","vd","__sm__","ne","status","errorCode","Je","toUpperCase","df","te","onprogress","upload","Ld","FormData","setRequestHeader","responseType","withCredentials","yd","Jd","se","eg","Rf","Yd","Of","readyState","statusText","responseText","yf","getResponseHeader","getAllResponseHeaders","OSID","OAID","bf","disconnect","qd","qe","af","Dc","Hg","Ee","Nf","qf","getState","we","Yf","Xd","Mg","ig","le","Hd","sg","round","Ue","Kd","ve","Kg","Cf","dg","Bf","Jg","bg","wd","Lg","ud","Pg","cg","td","sd","Cd","hostname","port","cf","__data__","gd","Z","oe","Vf","reverse","enqueue","fe","Y","Lf","Gd","Jf","qg","og","Td","Ye","rf","getKey","ce","$f","Zf","tf","zf","wf","createWebChannel","HTTP_ERROR","COMPLETE","EventType","CLOSE","MESSAGE","listen","getObject","releaseObject","listenOnce","getLastError","getLastErrorCode","getStatus","getStatusText","getResponseJson","getResponseText","createWebChannelTransport","ErrorCode","WebChannel","XhrIoPool","src_1","src_2","src_3","src_4","src_5","_interopDefault","firebase","require","logger","tslib_1","webchannelWrapper","SDK_VERSION","logClient","getLogLevel","SILENT","newLevel","msg","obj","argToString","platform","PlatformSupport","getPlatform","formatJSON","fail","failure","assert","assertion","setPlatform","emptyByteString","Code","OK","CANCELLED","UNKNOWN","INVALID_ARGUMENT","DEADLINE_EXCEEDED","NOT_FOUND","ALREADY_EXISTS","PERMISSION_DENIED","UNAUTHENTICATED","RESOURCE_EXHAUSTED","FAILED_PRECONDITION","ABORTED","OUT_OF_RANGE","UNIMPLEMENTED","INTERNAL","UNAVAILABLE","DATA_LOSS","FirestoreError","_super","code","_this","makeConstructorPrivate","cls","optionalMessage","PublicConstructor","staticProperty","defaulted","defaultValue","forEachNumber","num","vs","isEmpty","shallowCopy","validateExactNumberOfArgs","functionName","numberOfArgs","formatPlural","validateAtLeastNumberOfArgs","minNumberOfArgs","validateBetweenNumberOfArgs","maxNumberOfArgs","validateNamedArrayAtLeastNumberOfElements","minNumberOfElements","validateArgType","position","argument","validateType","ordinal","validateOptionalArgType","validateNamedType","optionName","validateNamedOptionalType","validateArrayElements","typeDescription","validator","valueDescription","validateOptionalArrayElements","validateNamedPropertyEquals","inputName","input","expected","expectedDescription","expected_1","actualDescription","validateNamedOptionalPropertyEquals","isPlainObject","description","customObjectName","tryGetCustomObjectType","funcNameRegex","results","validateDefined","validateOptionNames","options","optionNames","invalidClassError","AutoId","newId","chars","autoId","primitiveComparator","left","right","equals","isEqual","arrayEquals","immediateSuccessor","assertUint8ArrayAvailable","Uint8Array","assertBase64Available","base64Available","TypeOrder","ServerTimestampBehavior","Blob","binaryString","_binaryString","fromBase64String","base64","atob","fromUint8Array","array","char","fromCharCode","toBase64","btoa","toUint8Array","buffer","other","_compareTo","PublicBlob","GeoPoint","latitude","longitude","isFinite","_lat","_long","Timestamp","seconds","nanoseconds","fromMillis","fromDate","date","getTime","milliseconds","toDate","toMillis","DatabaseInfo","databaseId","persistenceKey","ssl","DEFAULT_DATABASE_NAME","DatabaseId","projectId","database","compareTo","DOCUMENT_KEY_NAME","Path","segments","offset","init","construct","path","comparator","child","nameOrPath","limit","segment","popFirst","popLast","firstSegment","lastSegment","isPrefixOf","isImmediateParentOf","potentialChild","end","toArray","p1","p2","ResourcePath","canonicalString","fromString","filter","EMPTY_PATH","identifierRegExp","FieldPath","isValidIdentifier","isKeyField","keyField","fromServerFormat","current","addCurrentSegment","inBackticks","DocumentKey","isDocumentKey","k1","k2","fromSegments","fromPathString","EMPTY","MaybeDocument","compareByKey","d1","d2","Document","hasLocalMutations","hasCommittedMutations","field","fieldValue","compareByField","v1","v2","NoDocument","UnknownDocument","SortedMap","root","LLRBNode","insert","copy","BLACK","node","cmp","prunedNodes","minKey","maxKey","inorderTraversal","action","reverseTraversal","getIterator","SortedMapIterator","getIteratorFrom","getReverseIterator","getReverseIteratorFrom","hasNext","getNext","startKey","isReverse","nodeStack","peek","color","RED","fixUp","removeMin","isRed","moveRedLeft","smallest","rotateRight","moveRedRight","rotateLeft","colorFlip","nl","nr","checkMaxDepth","blackDepth","check","pow","LLRBEmptyNode","FieldValueOptions","serverTimestampBehavior","timestampsInSnapshots","fromSnapshotOptions","serverTimestamps","Estimate","Previous","Default","FieldValue","defaultCompareTo","typeOrder","NullValue","internalValue","INSTANCE","BooleanValue","of","TRUE","FALSE","NumberValue","numericComparator","numericEquals","IntegerValue","DoubleValue","NAN","NaN","POSITIVE_INFINITY","NEGATIVE_INFINITY","StringValue","TimestampValue","ServerTimestampValue","localWriteTime","previousValue","BlobValue","RefValue","GeoPointValue","ObjectValue","it1","it2","next1","next2","to","setChild","newChild","delete","pathSegment","childName","ArrayValue","minLength","NumberAsAny","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","isInteger","isNullOrUndefined","isSafeInteger","QueryPurpose","Query","explicitOrderBy","filters","startAt","endAt","memoizedCanonicalId","memoizedOrderBy","assertValidBound","atPath","inequalityField","getInequalityFilterField","firstOrderByField","getFirstOrderByField","KEY_ORDERING_ASC","OrderBy","foundKeyOrdering","_a","orderBy","lastDirection","dir","Direction","ASCENDING","KEY_ORDERING_DESC","addFilter","RelationFilter","isInequality","newFilters","addOrderBy","newOrderBy","withLimit","withStartAt","bound","withEndAt","canonicalId","_b","_c","docComparator","comparedOnKeyField","comp","compare","matches","doc","matchesAncestor","matchesOrderBy","matchesFilters","matchesBounds","hasLimit","hasArrayContainsFilter","RelationOp","ARRAY_CONTAINS","isDocumentQuery","docPath","sortsBeforeDocument","Filter","EQUAL","NullFilter","NanFilter","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN_OR_EQUAL","GREATER_THAN","refValue","comparison","matchesComparison","matchesValue","element","DESCENDING","Bound","before","orderByComponent","component","docValue","thisPosition","otherPosition","isKeyOrderBy","SnapshotVersion","timestamp","fromMicroseconds","fromTimestamp","forDeletedDoc","MIN","toMicroseconds","toTimestamp","MutationType","QueryData","query","targetId","purpose","sequenceNumber","snapshotVersion","resumeToken","overwrite","FieldMask","fields","covers","fieldPath","fieldMaskPath","FieldTransform","transform","MutationResult","transformResults","Precondition","updateTime","exists","isValidFor","maybeDoc","isNone","NONE","Mutation","verifyKeyMatches","getPostMutationVersion","SetMutation","precondition","Set","applyToRemoteDocument","mutationResult","applyToLocalView","baseDoc","PatchMutation","fieldMask","Patch","newData","patchDocument","patchObject","TransformMutation","fieldTransforms","Transform","requireDocument","serverTransformResults","transformObject","localTransformResults","fieldTransform","DeleteMutation","Delete","ServerTimestampTransform","transformResult","ArrayUnionTransformOperation","elements","coercedFieldValuesArray","_loop_1","toUnion","ArrayRemoveTransformOperation","_loop_2","toRemove","RpcCode","ExistenceFilter","isPermanentError","mapCodeFromRpcStatus","mapCodeFromRpcCode","mapRpcCodeFromCode","mapCodeFromHttpStatus","SortedSet","fromMapKeys","has","elem","first","last","forEachInRange","range","iter","forEachWhile","firstAfterOrEqual","unionWith","thisIt","otherIt","thisElem","otherElem","EMPTY_MAYBE_DOCUMENT_MAP","maybeDocumentMap","EMPTY_DOCUMENT_MAP","documentMap","EMPTY_DOCUMENT_VERSION_MAP","documentVersionMap","EMPTY_DOCUMENT_KEY_SET","documentKeySet","EMPTY_TARGET_ID_SET","targetIdSet","ChangeType","SyncState","DocumentSet","keyedMap","sortedSet","emptySet","oldSet","thisDoc","otherDoc","docStrings","newSet","WatchTargetChangeState","DocumentChangeSet","changeMap","track","change","oldChange","Added","Metadata","Removed","Modified","getChanges","changes","ViewSnapshot","docs","oldDocs","docChanges","mutatedKeys","fromCache","syncStateChanged","excludesMetadataChanges","fromInitialDocuments","documents","otherChanges","RemoteEvent","targetChanges","targetMismatches","documentUpdates","resolvedLimboDocuments","createSynthesizedRemoteEventForCurrentChange","TargetChange","createSynthesizedTargetChangeForCurrentChange","addedDocuments","modifiedDocuments","removedDocuments","DocumentWatchChange","updatedTargetIds","removedTargetIds","newDoc","ExistenceFilterChange","existenceFilter","WatchTargetChange","targetIds","cause","TargetState","pendingResponses","documentChanges","snapshotChangesMap","_resumeToken","_current","_hasPendingChanges","updateResumeToken","toTargetChange","changeType","clearPendingChanges","addDocumentChange","removeDocumentChange","recordPendingTargetRequest","recordTargetResponse","markCurrent","WatchChangeAggregator","metadataProvider","targetStates","pendingDocumentUpdates","pendingDocumentTargetMapping","documentTargetMap","pendingTargetResets","handleDocumentChange","docChange","addDocumentToTarget","removeDocumentFromTarget","handleTargetChange","targetChange","forEachTarget","targetState","ensureTargetState","NoChange","isActiveTarget","isPending","removeTarget","Current","Reset","resetTarget","handleExistenceFilter","watchChange","expectedCount","queryData","queryDataForActiveTarget","getCurrentDocumentCountForTarget","createRemoteEvent","targetContainsDocument","hasPendingChanges","targets","isOnlyLimboTarget","LimboResolution","remoteEvent","ensureDocumentTargetMapping","updatedDocument","getRemoteKeysForTarget","targetMapping","getQueryDataForTarget","existingKeys","DIRECTIONS","dirs","OPERATORS","ISO_REG_EXP","RegExp","assertPresent","parseInt64","JsonProtoSerializer","useProto3Json","unsafeCastProtoByteString","byteString","fromRpcStatus","toInt32Value","fromInt32Value","nanos","fromIso8601String","utc","fraction","nanoStr","toBytes","bytes","fromBlob","blob","toVersion","fromVersion","toResourceName","fullyQualifiedPrefixPath","fromResourceName","resource","isValidResourceName","toName","fromName","extractLocalPathFromResourceName","toQueryPath","encodedDatabaseId","fromQueryPath","resourceName","toValue","nullValue","booleanValue","integerValue","doubleValue","stringValue","mapValue","toMapValue","arrayValue","toArrayValue","timestampValue","geoPointValue","bytesValue","referenceValue","fromValue","hasTag","fromFields","values$$1","dbId","toMutationDocument","toFields","toDocument","fromDocument","fromFound","found","fromMissing","missing","readTime","fromMaybeDocument","toWatchTargetChangeState","toTestWatchChange","documentChange","documentDelete","documentRemove","targetChangeType","fromWatchChange","fromWatchTargetChangeState","causeProto","entityChange","docDelete","docRemove","versionFromListenResponse","toMutation","mutation","update","updateMask","toDocumentMask","toFieldTransform","currentDocument","toPrecondition","fromMutation","fromPrecondition","fromDocumentMask","fromFieldTransform","fromWriteResult","commitTime","fromWriteResults","protos","setToServerValue","appendMissingElements","removeAllFromArray","toDocumentsTarget","fromDocumentsTarget","documentsTarget","toQueryTarget","structuredQuery","parent","from","collectionId","where","toFilter","toOrder","toCursor","fromQueryTarget","fromCount","filterBy","fromFilter","fromOrder","fromCursor","toListenRequestLabels","toLabel","Listen","ExistenceFilterMismatch","toTarget","toRelationFilter","toUnaryFilter","compositeFilter","unaryFilter","fromUnaryFilter","fieldFilter","fromRelationFilter","reduce","accum","orderBys","order","toPropertyOrder","fromPropertyOrder","cursor","toDirection","fromDirection","toOperatorName","fromOperatorName","toFieldPathReference","fromFieldPathReference","fieldReference","direction","nanField","nullField","fieldPaths","paths","isReactNative","ERROR_NAME","FirebaseError","ErrorFactory","service","serviceName","errors","pattern","template","fullCode","prop","Hash","blockSize","Sha1","chain_","buf_","W_","pad_","inbuf_","total_","compress_","buf","opt_offset","opt_length","lengthMinusBlock","inbuf","digest","totalBits","StreamBridge","sendFn","closeFn","onOpen","wrappedOnOpen","onClose","wrappedOnClose","onMessage","wrappedOnMessage","callOnOpen","callOnClose","callOnMessage","LOG_TAG","RPC_STREAM_SERVICE","RPC_URL_VERSION","RPC_NAME_REST_MAPPING","BatchGetDocuments","Commit","X_GOOG_API_CLIENT_VALUE","XHR_TIMEOUT_SECS","WebChannelConnection","pool","baseUrl","modifyHeadersForRequest","token","header","authHeaders","invokeRPC","rpcName","request","url","makeUrl","xhr","json","status_1","requestString","invokeStreamingRPC","openStream","urlParts","webchannelTransport","channel","opened","closed","streamBridge","unguardedEventListen","param","msgData","error$$1","status_2","urlRpcName","BrowserPlatform","loadConnection","databaseInfo","newSerializer","encoded","TimerId","ListenSequence","sequenceNumberSyncer","sequenceNumberHandler","setPreviousValue","writeNewSequenceNumber","writeSequenceNumber","externalPreviousValue","nextValue","INVALID","Deferred$1","Deferred","DelayedOperation","asyncQueue","timerId","targetTimeMs","removalCallback","catch","createAndSchedule","delayMs","targetTime","delayedOp","timerHandle","handleDelayElapsed","skipDelay","enqueueAndForget","AsyncQueue","tail","delayedOperations","operationInProgress","verifyNotFailed","newTail","enqueueAfterDelay","containsDelayedOperation","removeDelayedOperation","verifyOperationInProgress","drain","runDelayedOperationsEarly","lastTimerId","All","sort","escapeChar","encodedSeparatorChar","encodedNul","encodedEscape","encode","encodeSeparator","encodeSegment","resultBuf","decode$1","lastReasonableEscapeIndex","segmentBuilder","currentPiece","BATCHID_UNKNOWN","MutationBatch","batchId","mutations","docKey","batchResult","mutationResults","keySet","isTombstone","toTombstone","MutationBatchResult","batch","commitVersion","streamToken","docVersions","versionMap","PersistencePromise","nextCallback","catchCallback","isDone","callbackAttached","nextFn","catchFn","wrapFailure","wrapSuccess","toPromise","wrapUserFunction","waitFor","resolvedCount","promises","or","predicates","predicate","isTrue","predicates_1","collection","SCHEMA_VERSION","SchemaConverter","serializer","createOrUpgrade","txn","createPrimaryClientStore","createMutationQueue","createQueryCache","createRemoteDocumentCache","dropQueryCache","writeEmptyTargetGlobalEntry","upgradeMutationBatchSchemaAndMigrateData","createClientMetadataStore","createRemoteDocumentChangesStore","removeAcknowledgedMutations","queuesStore","DbMutationQueue","mutationsStore","DbMutationBatch","loadAll","queues","queue","IDBKeyRange","userId","lastAcknowledgedBatchId","userMutationsIndex","dbBatches","dbBatch","fromDbMutationBatch","removeMutationBatch","DbTimestamp","DbPrimaryClient","ownerId","allowTabSynchronization","leaseTimestampMs","createObjectStore","lastStreamToken","keyPath","localWriteTimeMs","userMutationsKeyPath","autoIncrement","createIndex","unique","DbDocumentMutation","v1MutationsStore","existingMutations","deleteObjectStore","v3MutationsStore","writeAll","prefixForUser","prefixForPath","PLACEHOLDER","DbRemoteDocument","DbNoDocument","DbUnknownDocument","unknownDocument","noDocument","DbTarget","lastListenSequenceNumber","queryTargetsIndexName","queryTargetsKeyPath","DbTargetDocument","documentTargetsIndex","documentTargetsKeyPath","DbTargetGlobal","highestTargetId","highestListenSequenceNumber","lastRemoteSnapshotVersion","targetCount","globalStore","DbRemoteDocumentChanges","DbClientMetadata","clientId","updateTimeMs","networkEnabled","inForeground","lastProcessedDocumentChangeId","V1_STORES","V3_STORES","V4_STORES","ALL_STORES","IndexedDbMutationQueue","referenceDelegate","documentKeysByBatchId","forUser","user","uid","isAuthenticated","checkEmpty","transaction","empty","iterate","control","acknowledgeBatch","getMutationQueueMetadata","mutationQueuesStore","convertStreamToken","getLastStreamToken","setLastStreamToken","addMutationBatch","documentStore","documentMutationsStore","mutationStore","toDbMutationBatch","mutations_1","indexKey","lookupMutationBatch","lookupMutationKeys","getNextMutationBatchAfterBatchId","nextBatchId","lowerBound","foundBatch","getAllMutationBatches","getAllMutationBatchesAffectingDocumentKey","documentKey","indexPrefix","indexStart","userID","encodedPath","getAllMutationBatchesAffectingDocumentKeys","documentKeys","uniqueBatchIDs","batchID","lookupMutationBatches","getAllMutationBatchesAffectingQuery","queryPath","immediateChildrenLength","batchIDs","simpleDbTransaction","removeCachedMutationKeys","removeMutationReference","performConsistencyCheck","startRange","danglingMutationReferences","containsKey","mutationQueueContainsKey","keysOnly","mutationQueuesContainKey","iterateSerial","indexTxn","only","numDeleted","removePromise","IndexedDbPersistence","getStore","GeneratorIds","RESERVED_BITS","TargetIdGenerator","generatorId","seed","seek","nextId","after","forQueryCache","targetIdGenerator","QueryCache","forSyncEngine","SyncEngine","LOG_TAG$1","SimpleDb","openOrCreate","schemaConverter","isAvailable","indexedDB","onsuccess","event","onblocked","onupgradeneeded","oldVersion","SimpleDbTransaction","wrapRequest","deleteDatabase","runTransaction","mode","objectStores","transactionFn","transactionFnResult","completionPromise","IterationController","dbCursor","shouldStop","nextKey","skip","aborted","completionDeferred","oncomplete","objectStoreNames","storeName","objectStore","SimpleDbStore","keyOrValue","indexOrRange","iterateCursor","deleteAll","optionsOrCallback","cursorRequest","primaryKey","shouldContinue","continue","controller","userResult","userPromise","skipToKey","indexName","openKeyCursor","openCursor","IndexedDbQueryCache","allocateTargetId","retrieveMetadata","saveMetadata","getLastRemoteSnapshotVersion","getHighestSequenceNumber","getHighestListenSequenceNumber","setTargetsMetadata","addQueryData","saveQueryData","updateMetadataFromQueryData","updateQueryData","removeQueryData","removeMatchingKeysForTargetId","targetsStore","removeTargets","upperBound","activeTargetIds","fromDbTarget","globalTargetStore","toDbTarget","updated","getQueryCount","getQueryData","addMatchingKeys","documentTargetStore","addReference","removeMatchingKeys","removeReference","getMatchingKeysForTargetId","targetGlobal","REMOTE_DOCUMENT_CHANGE_MISSING_ERR_MSG","IndexedDbRemoteDocumentCache","keepDocumentChangeLog","_lastProcessedDocumentChangeId","synchronizeLastDocumentChangeId","addEntries","maybeDocuments","remoteDocumentsStore","changedKeys","maybeDocuments_1","maybeDocument","dbKey","toDbRemoteDocument","documentChangesStore","toDbResourcePaths","removeEntry","getEntry","dbRemoteDoc","fromDbRemoteDocument","getDocumentsMatchingQuery","getNewDocumentChanges","changedDocs","firstIteration","changesStore","fromDbResourcePaths","documentPromises","removeDocumentChangesThroughChangeId","changeId","isDocumentChangeMissingError","LocalSerializer","remoteSerializer","remoteDoc","fromDbTimestamp","toDbTimestamp","dbTimestamp","serializedMutations","encodedKeys","encodedPaths","encodedPaths_1","dbTarget","queryProto","dbQuery","bufferEntryComparator","aSequence","aIndex","bSequence","bIndex","seqCmp","RollingSequenceNumberBuffer","maxElements","previousIndex","nextIndex","addElement","entry","highestValue","LruGarbageCollector","delegate","calculateTargetCount","percentile","getTargetCount","nthSequenceNumber","forEachOrphanedDocumentSequenceNumber","maxValue","removeOrphanedDocuments","PersistenceTransaction","LOG_TAG$2","MAX_CLIENT_AGE_MS","MAX_PRIMARY_ELIGIBLE_AGE_MS","CLIENT_METADATA_REFRESH_INTERVAL_MS","PRIMARY_LEASE_LOST_ERROR_MSG","PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG","UNSUPPORTED_PLATFORM_ERROR_MSG","ZOMBIED_CLIENTS_KEY_PREFIX","IndexedDbTransaction","currentSequenceNumber","multiClientParams","_started","isPrimary","lastGarbageCollectionTime","primaryStateListener","IndexedDbLruDelegate","dbName","MAIN_DATABASE","queryCache","remoteDocumentCache","localStorage","webStorage","createIndexedDbPersistence","persistence","createMultiClientIndexedDbPersistence","started","simpleDb","startRemoteDocumentCache","attachVisibilityHandler","attachWindowUnloadHook","updateClientMetadataAndTryBecomePrimary","scheduleClientMetadataAndPrimaryLeaseRefreshes","listenSequence","setPrimaryStateListener","primaryState","setNetworkEnabled","metadataStore","clientMetadataStore","verifyPrimaryLease","success","canActAsPrimary","wasPrimary","releasePrimaryLeaseIfHeld","acquireOrExtendPrimaryLease","primaryClientStore","primaryClient","isLocalClient","removeClientMetadata","maybeGarbageCollectMultiClientState","activeClients_1","inactiveClients_1","isWithinAge","existingClients","filterActiveClients","client","inactiveClient","processedChangeIds","oldestChangeId","removeItem","zombiedClientLocalStorageKey","clientMetadataRefresher","ClientMetadataRefresh","currentPrimary","currentLeaseIsValid","isClientZombied","preferredCandidate","otherClient","otherClientHasBetterNetworkState","otherClientHasBetterVisibility","otherClientHasSameNetworkState","shutdown","deleteData","markClientZombied","detachVisibilityHandler","detachWindowUnloadHook","removeClientZombiedEntry","clients","activityThresholdMs","getActiveClients","clientMetadata","getMutationQueue","getQueryCache","getRemoteDocumentCache","transactionOperation","simpleDbTxn","verifyAllowTabSynchronization","newPrimary","buildStoragePrefix","isDefaultDatabase","maxAgeMs","documentVisibilityHandler","visibilityState","windowUnloadHandler","isZombied","getItem","setItem","isPrimaryLeaseLostError","garbageCollector","forEachOrphanedDocument","setInMemoryPins","inMemoryPins","writeSentinelKey","isPinned","iteration","removeOrphanedDocument","sentinelKey","updateLimboDocument","nextPath","nextToReport","sentinelRow","PersistentStreamState","LocalDocumentsView","mutationQueue","getDocument","batches","getDocumentInternal","inBatches","inBatches_1","getDocuments","getDocumentsMatchingDocumentQuery","getDocumentsMatchingCollectionQuery","queryResults","matchingMutationBatches","matchingMutationBatches_1","mutatedDoc","ReferenceSet","refsByKey","DocReference","refsByTarget","compareByTargetId","ref","addReferences","removeRef","removeReferences","removeReferencesForId","emptyKey","startRef","endRef","removeAllReferences","referencesForId","firstRef","targetOrBatchId","RemoteDocumentChangeBuffer","addEntry","assertChanges","bufferedEntry","LOG_TAG$3","LocalStore","initialUser","localViewReferences","queryDataByTarget","remoteDocuments","localDocuments","handleUserChange","oldBatches","promisedOldBatches","newBatches","removedBatchIds","addedBatchIds","oldBatches_1","newBatches_1","_d","_e","affectedDocuments","localWrite","promisedBatch","changedDocuments","lookupMutationDocuments","affected","documentBuffer","applyWriteToRemoteDocuments","rejectBatch","affectedKeys","applyRemoteEvent","authoritativeUpdates","oldQueryData","shouldPersistQueryData","changedDocKeys","existingDoc","hasPendingWrites","remoteVersion","updateRemoteVersion","lastRemoteVersion","newQueryData","RESUME_TOKEN_MAX_AGE_MICROS","notifyLocalViewChanges","viewChanges","viewChange","addedKeys","removedKeys","nextMutationBatch","afterBatchId","readDocument","allocateQuery","cached","releaseQuery","keepPersistedQueryData","cachedQueryData","removed","executeQuery","remoteDocumentKeys","removeCachedMutationBatchMetadata","docKeys","promiseChain","ackVersion","getQueryForTarget","ObjectMap","mapKeyFn","inner","matches_1","otherKey","entries_1","MemoryMutationQueue","highestAcknowledgedBatchId","batchesByDocumentKey","batchIndex","indexOfExistingBatchId","findMutationBatch","mutationBatch","rawIndex","indexOfBatchId","getAllLiveMutationBatchesBeforeIndex","findMutationBatches","prefix","immediateChildrenPathLength","startPath","rowKeyPath","endIndex","references","MemoryQueryCache","queries","highestSequenceNumber","nextTargetId","removals","matchingKeys","MemoryRemoteDocumentCache","newDocumentChanges","forEachDocumentKey","LOG_TAG$4","MemoryPersistence","isEager","mutationQueues","MemoryEagerDelegate","MemoryLruDelegate","createLruPersistence","createEagerPersistence","toKey","MemoryTransaction","onTransactionStarted","onTransactionCommitted","orphanedDocuments","cache","isReferenced","orphanedSequenceNumbers","orphanedAt","LOG_TAG$5","ExponentialBackoff","initialDelayMs","backoffFactor","maxDelayMs","timerPromise","lastAttemptTime","currentBaseMs","resetToMax","backoffAndRun","desiredDelayWithJitterMs","jitterDelayMs","delaySoFarMs","remainingDelayMs","LOG_TAG$6","OnlineState","OnlineStateSource","BACKOFF_INITIAL_DELAY_MS","BACKOFF_MAX_DELAY_MS","BACKOFF_FACTOR","IDLE_TIMEOUT_MS","PersistentStream","connectionTimerId","idleTimerId","connection","credentialsProvider","Initial","closeCount","idleTimer","stream","backoff","isStarted","Starting","Open","Backoff","isOpen","auth","performBackoff","inhibitBackoff","markIdle","handleIdleCloseTimer","sendRequest","cancelIdleCheck","finalState","invalidateToken","tearDown","dispatchIfNotClosed","getCloseGuardedDispatcher","getToken","startStream","rpcError","handleStreamClose","startRpc","startCloseCount","PersistentListenStream","credentials","ListenStreamConnectionBackoff","ListenStreamIdle","watchChangeProto","snapshot","onWatchChange","watch","addTarget","labels","unwatch","PersistentWriteStream","WriteStreamConnectionBackoff","WriteStreamIdle","handshakeComplete_","writeMutations","responseProto","writeResults","onMutationResult","onHandshakeComplete","writeHandshake","writes","Datastore","newPersistentWriteStream","newPersistentWatchStream","commit","params","response","lookup","Transaction","datastore","readVersions","committed","recordVersion","docVersion","existingVersion","preconditionForUpdate","toMutations","unwritten","LOG_TAG$7","MAX_WATCH_STREAM_FAILURES","ONLINE_STATE_TIMEOUT_MS","OnlineStateTracker","onlineStateHandler","Unknown","watchStreamFailures","onlineStateTimer","shouldWarnClientIsOffline","handleWatchStreamStart","setAndBroadcast","OnlineStateTimeout","logClientOfflineWarningIfNecessary","Offline","handleWatchStreamFailure","Online","clearOnlineStateTimer","newState","details","LOG_TAG$8","MAX_PENDING_WRITES","RemoteStore","localStore","writePipeline","listenTargets","watchChangeAggregator","onlineStateTracker","watchStream","onWatchStreamOpen","onWatchStreamClose","onWatchStreamChange","writeStream","onWriteStreamOpen","onWriteStreamClose","onWriteHandshakeComplete","enableNetwork","canUseNetwork","shouldStartWatchStream","startWatchStream","fillWritePipeline","disableNetwork","disableNetworkInternal","cleanUpWatchStreamState","sendWatchRequest","unlisten","sendUnwatchRequest","syncEngine","handleTargetError","raiseWatchSnapshot","requestQueryData","rejectListen","lastBatchIdRetrieved","canAddToWritePipeline","addToWritePipeline","shouldStartWriteStream","startWriteStream","outstandingWrites","handshakeComplete","ignoreIfPrimaryLeaseLoss","applySuccessfulWrite","handleWriteError","handleHandshakeError","rejectFailedWrite","createTransaction","handleCredentialChange","applyPrimaryState","QueryListenersInfo","listeners","EventManager","onlineState","subscribe","firstListen","queryInfo","applyOnlineStateChange","viewSnap","onViewSnapshot","lastListen","viewSnaps","viewSnaps_1","onWatchError","onError","onOnlineStateChange","QueryListener","queryObserver","raisedInitialEvent","snap","includeMetadataChanges","shouldRaiseEvent","shouldRaiseInitialEvent","raiseInitialEvent","maybeOnline","waitForSyncWhenOnline","hasPendingWritesChanged","LocalViewChanges","fromSnapshot","viewSnapshot","AddedLimboDocument","RemovedLimboDocument","View","_syncedDocuments","syncState","limboDocuments","documentSet","computeDocChanges","previousChanges","changeSet","oldDocumentSet","newMutatedKeys","newDocumentSet","needsRefill","lastDocInLimit","newMaybeDoc","oldDoc","oldDocHadPendingMutations","newDocHasPendingMutations","changeApplied","shouldWaitForSyncedDocument","applyChanges","updateLimboDocuments","c1","c2","compareChangeType","applyTargetChange","limboChanges","newSyncState","Synced","Local","shouldBeInLimbo","oldLimboDocuments","synchronizeWithPersistedState","localDocs","remoteKeys","computeInitialSnapshot","LOG_TAG$9","QueryView","view","remoteStore","sharedClientState","currentUser","syncEngineListener","queryViewsByQuery","queryViewsByTarget","limboTargetsByKey","limboResolutionsByTarget","limboDocumentRefs","mutationUserCallbacks","limboTargetIdGenerator","queryView","assertSubscribed","addLocalQueryTarget","initializeViewAndComputeSnapshot","viewDocChanges","synthesizedTargetChange","synchronizeViewAndComputeSnapshot","updateTrackedLimbos","removeLocalQueryTarget","isActiveQueryTarget","clearQueryState","removeAndCleanupQuery","userCallback","addPendingMutation","addMutationCallback","emitNewSnapsAndNotifyLocalStore","wrapUpdateFunctionError","updateFunction","retries","wrappedUpdateFunction","limboResolution","receivedDocument","SharedClientState","newViewSnapshots_1","setOnlineState","limboKey","event_1","queryView_1","updateQueryState","applyBatchState","batchState","processUserCallback","mutationBatchResult","updateMutationState","newCallbacks","limboKeys","removeLimboTarget","limboTargetId","limboChanges_1","limboChange","trackLimboChange","currentLimboDocs","newSnaps","docChangesInAllViews","queriesProcessed","fnName","userChanged","activeTargets","activeQueries","activeQueries_1","activeTargets_1","p_1","getAllActiveQueryTargets","synchronizeQueryViewsAndRaiseSnapshots","isLocalQueryTarget","resetLimboDocuments","newViewSnapshots","targets_1","applyTargetState","synthesizedRemoteEvent","activeTargets_2","applyActiveTargetsChange","added","added_1","this_1","removed_1","syncedDocuments","User","otherUser","GOOGLE_CREDENTIALS","FIRST_PARTY","LOG_TAG$10","CLIENT_STATE_KEY_PREFIX","MUTATION_BATCH_KEY_PREFIX","QUERY_TARGET_KEY_PREFIX","ONLINE_STATE_KEY_PREFIX","SEQUENCE_NUMBER_KEY_PREFIX","MutationMetadata","fromWebStorageEntry","validData","firestoreError","toWebStorageJSON","batchMetadata","QueryTargetMetadata","RemoteClientState","clientState","activeTargetIdsSet","SharedOnlineState","LocalClientState","addQueryTarget","removeQueryTarget","WebStorageSharedClientState","localClientId","activeClients","storageListener","handleWebStorageEvent","earlyEvents","escapedPersistenceKey","storage","localClientStorageKey","toWebStorageClientStateKey","sequenceNumberKey","clientStateKeyRe","mutationBatchKeyRe","queryTargetKeyRe","onlineStateKey","existingClients_1","storageItem","onlineStateJSON","persistClientState","fromWebStorageOnlineState","handleOnlineStateEvent","persistMutationState","removeMutationState","queryState","toWebStorageQueryTargetMetadataKey","localClientState","persistQueryTargetState","persistOnlineState","storageArea","mutationMetadata","queryTargetMetadata","fromWebStorageClientStateKey","handleClientStateEvent","fromWebStorageClientState","fromWebStorageMutationMetadata","handleMutationBatchEvent","fromWebStorageQueryTargetMetadata","handleQueryTargetEvent","fromWebStorageSequenceNumber","mutationState","mutationKey","toWebStorageMutationBatchKey","targetKey","targetMetadata","existingTargets","newTargets","addedTargets","removedTargets","seqString","parsed","MemorySharedClientState","localState","LOG_TAG$11","DOM_EXCEPTION_ABORTED","DOM_EXCEPTION_QUOTA_EXCEEDED","FirestoreClient","persistenceSettings","initializationDone","persistenceResult","initialized","setChangeListener","initializePersistence","initializeRest","startIndexedDbPersistence","canFallback","startMemoryPersistence","DOMException","settings","storagePrefix","experimentalTabSynchronization","remoteStoreOnlineStateChangedHandler","sharedClientStateOnlineStateChangedHandler","eventMgr","purgePersistenceWithDataLoss","removeChangeListener","observer","getDocumentFromLocalCache","getDocumentsFromLocalCache","AsyncObserver","muted","scheduleEvent","mute","eventHandler","FieldPath$1","FieldPath$$1","fieldNames","_internalPath","documentId","_DOCUMENT_ID","RESERVED","fromDotSeparatedString","OAuthToken","Authorization","EmptyCredentialsProvider","changeListener","FirebaseCredentialsProvider","app","tokenListener","tokenCounter","forceRefresh","getUser","addAuthTokenListener","initialTokenCounter","tokenData","accessToken","removeAuthTokenListener","currentUid","getUid","FirstPartyToken","gapi","sessionIndex","FirstPartyCredentialsProvider","makeCredentialsProvider","isPartialObserver","implementsAnyMethods$1","methods_1","method","UserDataSource","FieldValueImpl","_methodName","DeleteFieldValueImpl","serverTimestamp","ServerTimestampFieldValueImpl","arrayUnion","ArrayUnionFieldValueImpl","arrayRemove","ArrayRemoveFieldValueImpl","_elements","PublicFieldValue","RESERVED_FIELD_REGEX","ParsedSetData","ParsedUpdateData","isWrite","dataSource","MergeSet","Update","Argument","ParseContext","methodName","arrayElement","validatePath","childContextForField","childPath","validatePathSegment","childContextForFieldPath","childContextForArray","createError","fieldDescription","DocumentKeyReference","UserDataConverter","preConverter","parseSetData","validatePlainObject","updateData","parseData","parseMergeData","validatedFieldPaths","fieldPaths_1","stringOrFieldPath","fieldPathFromDotSeparatedString","parseUpdateData","fieldMaskPaths","childContext","runPreConverter","parsedValue","mask","parseUpdateVarargs","moreFieldsAndValues","fieldPathFromArgument","value_1","parseQueryValue","errorMessage","looksLikeJsonObject","parseObject","parseSentinelFieldValue","parseArray","parseScalarValue","entryIndex","array_1","parsedEntry","parsedElements","parseArrayTransformElements","DEFAULT_HOST","DEFAULT_SSL","DEFAULT_TIMESTAMPS_IN_SNAPSHOTS","DEFAULT_SYNCHRONIZE_TABS","FirestoreSettings","FirestoreConfig","PersistenceSettings","Firestore","databaseIdOrApp","_queue","_firestoreClient","config","firebaseApp","databaseIdFromApp","external_1","_config","_databaseId","settingsLiteral","newSettings","ensureClientConfigured","enablePersistence","configureClient","_dataConverter","DocumentReference","thisDb","otherDb","firestore","_key","pathString","CollectionReference","forPath","Transaction$1","WriteBatch","_areTimestampsInSnapshotsEnabled","_firestore","_transaction","documentRef","validateReference","DocumentSnapshot","validateSetOptions","merge","mergeFields","fieldOrUpdateData","_mutations","_committed","verifyNotCommitted","onSnapshot","currArg","internalOptions","complete","onSnapshotInternal","errHandler","asyncObserver","internalListener","validateGetOptions","getViaSnapshotListener","SnapshotMetadata","_document","_fromCache","_hasPendingWrites","validateSnapshotOptions","convertObject","convertValue","convertArray","QueryDocumentSnapshot","Query$1","Query$$1","_query","opStr","relationOp","validateNewFilter","directionStr","validateNewOrderBy","docOrField","boundFromDocOrFields","startAfter","endBefore","boundFromDocument","allFields","boundFromFields","components","rawValue","wrapped","QuerySnapshot","firestoreClient","existingField","validateOrderByAndInequalityMatch","inequality","_originalQuery","_snapshot","_cachedChanges","_cachedChangesIncludeMetadataChanges","convertToDocumentImpl","changesFromSnapshot","throwDocChangesMethodError","docChangesPropertiesToOverride","property","parentPath","docRef","lastDoc_1","index_1","oldIndex","newIndex","indexTracker_1","resultChangeType","PublicFirestore","PublicTransaction","PublicWriteBatch","PublicDocumentReference","PublicDocumentSnapshot","PublicQueryDocumentSnapshot","PublicQuery","PublicQuerySnapshot","PublicCollectionReference","firestoreNamespace","configureForFirebase","firebase$$1","registerService","registerFirestore"],"mappings":";CAAA,SAAA,GACA,aAEA,IAAA,EAAA,MAAA,CAIA,IAAA,EAAA,CACA,aAAA,oBAAA,EACA,SAAA,WAAA,GAAA,aAAA,OACA,KAAA,eAAA,GAAA,SAAA,GAAA,WACA,IAEA,OADA,IAAA,MACA,EACA,MAAA,GACA,OAAA,GALA,GAQA,SAAA,aAAA,EACA,YAAA,gBAAA,GAGA,GAAA,EAAA,YACA,IAAA,EAAA,CACA,qBACA,sBACA,6BACA,sBACA,uBACA,sBACA,uBACA,wBACA,yBAGA,EAAA,SAAA,GACA,OAAA,GAAA,SAAA,UAAA,cAAA,IAGA,EAAA,YAAA,QAAA,SAAA,GACA,OAAA,GAAA,EAAA,QAAA,OAAA,UAAA,SAAA,KAAA,KAAA,GAyDA,EA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,EAAA,OAAA,IAAkB,CAApC,IAAA,EAAc,EAAA,GACrB,EAAY,EAAA,MAAM,EAAW,EAAe,YAMvC,OAHM,EAAW,OAAO,SAAC,GAC9B,OAAA,EAAU,KAAK,SAAC,GAAe,OAAA,EAAK,KAAO,MAK/C,SAAS,EAAgB,GACnB,IAAA,EAAS,qPAOX,EAAU,QACN,mKAKA,IAAE,UAGN,EAAU,MACN,4JAKA,IAAE,iEAIN,EAAU,MAAQ,YAAc,KAAG,2BAsB9B,OAlBH,EAAU,OACZ,EAAS,EAAO,QAAQ,WAAY,EAAU,OAE5C,EAAU,cACZ,EAAS,EAAO,QAAQ,kBAAmB,EAAU,cAEvD,EAAS,EAAO,QAAQ,YAAa,EAAU,OAAS,IACpD,EAAU,QACZ,EAAS,EAAO,QAAQ,YAAa,EAAU,QAE7C,EAAU,UACZ,EAAS,EAAO,QAAQ,cAAe,EAAU,UAGjD,EADE,EAAU,MAAQ,EAAU,KAAK,OAC1B,EAAO,QAAQ,WAAY,EAAU,KAAK,GAAG,KAE7C,EAAO,QAAQ,WAAY,EAAc,EAAU,WAAW,KAK3E,SAAS,EAAc,GACf,IAAA,EAAW,EAAW,OAAO,SAAC,GAAkB,OAAA,EAAI,KAAO,IAAI,GAC9D,OAAA,EAAS,YAAY,OACxB,EAAS,YAAY,GAAG,WAAW,MAAM,IACzC,KAON,IAAI,EAAoC,GAExC,SAAS,EAAgB,GACnB,EAAiB,KAAK,SAAC,GAAmB,OAAA,EAAK,KAAO,EAAS,KACjE,EAAmB,EAAiB,OAClC,SAAC,GAAmB,OAAA,EAAK,KAAO,EAAS,KAG3C,EAAiB,KAAK,GAExB,IACA,IAGF,SAAS,IACP,EAAmB,GACnB,IACA","file":"exhibitors.1dbf3f11.map","sourceRoot":"../src","sourcesContent":["(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isDataView = function(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n var isArrayBufferView = ArrayBuffer.isView || function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue+','+value : value\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this, { body: this._bodyInit })\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : 'OK'\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n var xhr = new XMLHttpRequest()\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import 'whatwg-fetch';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n this._state = 0;\n this._handled = false;\n this._value = undefined;\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = function(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n return constructor.resolve(callback()).then(function() {\n return constructor.reject(reason);\n });\n }\n );\n};\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!arr || typeof arr.length === 'undefined')\n throw new TypeError('Promise.all accepts an array');\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(values) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, len = values.length; i < len; i++) {\n values[i].then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n (typeof setImmediate === 'function' &&\n function(fn) {\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nvar globalNS = (function() {\n // the only reliable means to get the global object is\n // `Function('return this')()`\n // However, this causes CSP violations in Chrome apps.\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n})();\n\nif (!globalNS.Promise) {\n globalNS.Promise = Promise;\n}\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar _global = createCommonjsModule(function (module) {\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n});\n\nvar _core = createCommonjsModule(function (module) {\nvar core = module.exports = { version: '2.5.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n});\nvar _core_1 = _core.version;\n\nvar _isObject = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\nvar _anObject = function (it) {\n if (!_isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\nvar _fails = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n// Thank's IE8 for his funny defineProperty\nvar _descriptors = !_fails(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\nvar document = _global.document;\n// typeof document.createElement is 'object' in old IE\nvar is = _isObject(document) && _isObject(document.createElement);\nvar _domCreate = function (it) {\n return is ? document.createElement(it) : {};\n};\n\nvar _ie8DomDefine = !_descriptors && !_fails(function () {\n return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n// 7.1.1 ToPrimitive(input [, PreferredType])\n\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nvar _toPrimitive = function (it, S) {\n if (!_isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\nvar dP = Object.defineProperty;\n\nvar f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n _anObject(O);\n P = _toPrimitive(P, true);\n _anObject(Attributes);\n if (_ie8DomDefine) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\nvar _objectDp = {\n\tf: f\n};\n\nvar _propertyDesc = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\nvar _hide = _descriptors ? function (object, key, value) {\n return _objectDp.f(object, key, _propertyDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar _has = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\nvar id = 0;\nvar px = Math.random();\nvar _uid = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\nvar _redefine = createCommonjsModule(function (module) {\nvar SRC = _uid('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\n_core.inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) _has(val, 'name') || _hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === _global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n _hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n _hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n});\n\nvar _aFunction = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n// optional / simple context binding\n\nvar _ctx = function (fn, that, length) {\n _aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;\n // extend global\n if (target) _redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) _hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\n_global.core = _core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nvar _export = $export;\n\nvar toString = {}.toString;\n\nvar _cof = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\n\n// eslint-disable-next-line no-prototype-builtins\nvar _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return _cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n// 7.2.1 RequireObjectCoercible(argument)\nvar _defined = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n// 7.1.13 ToObject(argument)\n\nvar _toObject = function (it) {\n return Object(_defined(it));\n};\n\n// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nvar _toInteger = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n// 7.1.15 ToLength\n\nvar min = Math.min;\nvar _toLength = function (it) {\n return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n// 7.2.2 IsArray(argument)\n\nvar _isArray = Array.isArray || function isArray(arg) {\n return _cof(arg) == 'Array';\n};\n\nvar SHARED = '__core-js_shared__';\nvar store = _global[SHARED] || (_global[SHARED] = {});\nvar _shared = function (key) {\n return store[key] || (store[key] = {});\n};\n\nvar _wks = createCommonjsModule(function (module) {\nvar store = _shared('wks');\n\nvar Symbol = _global.Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n});\n\nvar SPECIES = _wks('species');\n\nvar _arraySpeciesConstructor = function (original) {\n var C;\n if (_isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined;\n if (_isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n\n// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\n\n\nvar _arraySpeciesCreate = function (original, length) {\n return new (_arraySpeciesConstructor(original))(length);\n};\n\n// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\n\n\n\n\n\nvar _arrayMethods = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || _arraySpeciesCreate;\n return function ($this, callbackfn, that) {\n var O = _toObject($this);\n var self = _iobject(O);\n var f = _ctx(callbackfn, that, 3);\n var length = _toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n\n// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = _wks('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) _hide(ArrayProto, UNSCOPABLES, {});\nvar _addToUnscopables = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\n\nvar $find = _arrayMethods(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n_export(_export.P + _export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n_addToUnscopables(KEY);\n\nvar find = _core.Array.find;\n\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\n\nvar $find$1 = _arrayMethods(6);\nvar KEY$1 = 'findIndex';\nvar forced$1 = true;\n// Shouldn't skip holes\nif (KEY$1 in []) Array(1)[KEY$1](function () { forced$1 = false; });\n_export(_export.P + _export.F * forced$1, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n_addToUnscopables(KEY$1);\n\nvar findIndex = _core.Array.findIndex;\n\n// to indexed object, toObject with fallback for non-array-like ES3 strings\n\n\nvar _toIobject = function (it) {\n return _iobject(_defined(it));\n};\n\nvar max = Math.max;\nvar min$1 = Math.min;\nvar _toAbsoluteIndex = function (index, length) {\n index = _toInteger(index);\n return index < 0 ? max(index + length, 0) : min$1(index, length);\n};\n\n// false -> Array#indexOf\n// true -> Array#includes\n\n\n\nvar _arrayIncludes = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = _toIobject($this);\n var length = _toLength(O.length);\n var index = _toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nvar shared = _shared('keys');\n\nvar _sharedKey = function (key) {\n return shared[key] || (shared[key] = _uid(key));\n};\n\nvar arrayIndexOf = _arrayIncludes(false);\nvar IE_PROTO = _sharedKey('IE_PROTO');\n\nvar _objectKeysInternal = function (object, names) {\n var O = _toIobject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (_has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n// IE 8- don't enum bug keys\nvar _enumBugKeys = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n// 19.1.2.14 / 15.2.3.14 Object.keys(O)\n\n\n\nvar _objectKeys = Object.keys || function keys(O) {\n return _objectKeysInternal(O, _enumBugKeys);\n};\n\nvar f$1 = Object.getOwnPropertySymbols;\n\nvar _objectGops = {\n\tf: f$1\n};\n\nvar f$2 = {}.propertyIsEnumerable;\n\nvar _objectPie = {\n\tf: f$2\n};\n\n// 19.1.2.1 Object.assign(target, source, ...)\n\n\n\n\n\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nvar _objectAssign = !$assign || _fails(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = _toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = _objectGops.f;\n var isEnum = _objectPie.f;\n while (aLen > index) {\n var S = _iobject(arguments[index++]);\n var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n\n// 19.1.3.1 Object.assign(target, source)\n\n\n_export(_export.S + _export.F, 'Object', { assign: _objectAssign });\n\nvar assign = _core.Object.assign;\n\n// 7.2.8 IsRegExp(argument)\n\n\nvar MATCH = _wks('match');\nvar _isRegexp = function (it) {\n var isRegExp;\n return _isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : _cof(it) == 'RegExp');\n};\n\n// helper for String#{startsWith, endsWith, includes}\n\n\n\nvar _stringContext = function (that, searchString, NAME) {\n if (_isRegexp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(_defined(that));\n};\n\nvar MATCH$1 = _wks('match');\nvar _failsIsRegexp = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH$1] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n_export(_export.P + _export.F * _failsIsRegexp(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = _stringContext(this, searchString, STARTS_WITH);\n var index = _toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n\nvar startsWith = _core.String.startsWith;\n\nvar _stringRepeat = function repeat(count) {\n var str = String(_defined(this));\n var res = '';\n var n = _toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n\n_export(_export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: _stringRepeat\n});\n\nvar repeat = _core.String.repeat;\n\nvar _meta = createCommonjsModule(function (module) {\nvar META = _uid('meta');\n\n\nvar setDesc = _objectDp.f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !_fails(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!_has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!_has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n});\nvar _meta_1 = _meta.KEY;\nvar _meta_2 = _meta.NEED;\nvar _meta_3 = _meta.fastKey;\nvar _meta_4 = _meta.getWeak;\nvar _meta_5 = _meta.onFreeze;\n\nvar def = _objectDp.f;\n\nvar TAG = _wks('toStringTag');\n\nvar _setToStringTag = function (it, tag, stat) {\n if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n\nvar f$3 = _wks;\n\nvar _wksExt = {\n\tf: f$3\n};\n\nvar _library = false;\n\nvar defineProperty = _objectDp.f;\nvar _wksDefine = function (name) {\n var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) });\n};\n\n// all enumerable object keys, includes symbols\n\n\n\nvar _enumKeys = function (it) {\n var result = _objectKeys(it);\n var getSymbols = _objectGops.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = _objectPie.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n\nvar _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {\n _anObject(O);\n var keys = _objectKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\nvar document$1 = _global.document;\nvar _html = document$1 && document$1.documentElement;\n\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n\n\n\nvar IE_PROTO$1 = _sharedKey('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE$1 = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = _domCreate('iframe');\n var i = _enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n _html.appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]];\n return createDict();\n};\n\nvar _objectCreate = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE$1] = _anObject(O);\n result = new Empty();\n Empty[PROTOTYPE$1] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO$1] = O;\n } else result = createDict();\n return Properties === undefined ? result : _objectDps(result, Properties);\n};\n\n// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\n\nvar hiddenKeys = _enumBugKeys.concat('length', 'prototype');\n\nvar f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return _objectKeysInternal(O, hiddenKeys);\n};\n\nvar _objectGopn = {\n\tf: f$4\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\n\nvar gOPN = _objectGopn.f;\nvar toString$1 = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nvar f$5 = function getOwnPropertyNames(it) {\n return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(_toIobject(it));\n};\n\nvar _objectGopnExt = {\n\tf: f$5\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar f$6 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = _toIobject(O);\n P = _toPrimitive(P, true);\n if (_ie8DomDefine) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]);\n};\n\nvar _objectGopd = {\n\tf: f$6\n};\n\n// ECMAScript 6 symbols shim\n\n\n\n\n\nvar META = _meta.KEY;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar gOPD$1 = _objectGopd.f;\nvar dP$1 = _objectDp.f;\nvar gOPN$1 = _objectGopnExt.f;\nvar $Symbol = _global.Symbol;\nvar $JSON = _global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE$2 = 'prototype';\nvar HIDDEN = _wks('_hidden');\nvar TO_PRIMITIVE = _wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = _shared('symbol-registry');\nvar AllSymbols = _shared('symbols');\nvar OPSymbols = _shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE$2];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = _global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = _descriptors && _fails(function () {\n return _objectCreate(dP$1({}, 'a', {\n get: function () { return dP$1(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD$1(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP$1(it, key, D);\n if (protoDesc && it !== ObjectProto) dP$1(ObjectProto, key, protoDesc);\n} : dP$1;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n _anObject(it);\n key = _toPrimitive(key, true);\n _anObject(D);\n if (_has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!_has(it, HIDDEN)) dP$1(it, HIDDEN, _propertyDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _objectCreate(D, { enumerable: _propertyDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP$1(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n _anObject(it);\n var keys = _enumKeys(P = _toIobject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = _toPrimitive(key, true));\n if (this === ObjectProto && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false;\n return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = _toIobject(it);\n key = _toPrimitive(key, true);\n if (it === ObjectProto && _has(AllSymbols, key) && !_has(OPSymbols, key)) return;\n var D = gOPD$1(it, key);\n if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN$1(_toIobject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN$1(IS_OP ? OPSymbols : _toIobject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = _uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, _propertyDesc(1, value));\n };\n if (_descriptors && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n _redefine($Symbol[PROTOTYPE$2], 'toString', function toString() {\n return this._k;\n });\n\n _objectGopd.f = $getOwnPropertyDescriptor;\n _objectDp.f = $defineProperty;\n _objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames;\n _objectPie.f = $propertyIsEnumerable;\n _objectGops.f = $getOwnPropertySymbols;\n\n if (_descriptors && !_library) {\n _redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n _wksExt.f = function (name) {\n return wrap(_wks(name));\n };\n}\n\n_export(_export.G + _export.W + _export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]);\n\n_export(_export.S + _export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return _has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n_export(_export.S + _export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && _export(_export.S + _export.F * (!USE_NATIVE || _fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!_isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!_isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\n_setToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\n_setToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\n_setToStringTag(_global.JSON, 'JSON', true);\n\n// getting tag from 19.1.3.6 Object.prototype.toString()\n\nvar TAG$1 = _wks('toStringTag');\n// ES3 wrong here\nvar ARG = _cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nvar _classof = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T\n // builtinTag case\n : ARG ? _cof(O)\n // ES3 arguments fallback\n : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n// 19.1.3.6 Object.prototype.toString()\n\nvar test = {};\ntest[_wks('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n _redefine(Object.prototype, 'toString', function toString() {\n return '[object ' + _classof(this) + ']';\n }, true);\n}\n\n_wksDefine('asyncIterator');\n\n_wksDefine('observable');\n\nvar symbol = _core.Symbol;\n\n// true -> String#at\n// false -> String#codePointAt\nvar _stringAt = function (TO_STRING) {\n return function (that, pos) {\n var s = String(_defined(that));\n var i = _toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\nvar _iterators = {};\n\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n_hide(IteratorPrototype, _wks('iterator'), function () { return this; });\n\nvar _iterCreate = function (Constructor, NAME, next) {\n Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) });\n _setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\n\n\nvar IE_PROTO$2 = _sharedKey('IE_PROTO');\nvar ObjectProto$1 = Object.prototype;\n\nvar _objectGpo = Object.getPrototypeOf || function (O) {\n O = _toObject(O);\n if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto$1 : null;\n};\n\nvar ITERATOR = _wks('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nvar _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n _iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = _objectGpo($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n _setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!_library && typeof IteratorPrototype[ITERATOR] != 'function') _hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n _hide(proto, ITERATOR, $default);\n }\n // Plug for library\n _iterators[NAME] = $default;\n _iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) _redefine(proto, key, methods[key]);\n } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\nvar $at = _stringAt(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n_iterDefine(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n\nvar _iterStep = function (done, value) {\n return { value: value, done: !!done };\n};\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nvar es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {\n this._t = _toIobject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return _iterStep(1);\n }\n if (kind == 'keys') return _iterStep(0, index);\n if (kind == 'values') return _iterStep(0, O[index]);\n return _iterStep(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\n_iterators.Arguments = _iterators.Array;\n\n_addToUnscopables('keys');\n_addToUnscopables('values');\n_addToUnscopables('entries');\n\nvar ITERATOR$1 = _wks('iterator');\nvar TO_STRING_TAG = _wks('toStringTag');\nvar ArrayValues = _iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = _objectKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = _global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR$1]) _hide(proto, ITERATOR$1, ArrayValues);\n if (!proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME);\n _iterators[NAME] = ArrayValues;\n if (explicit) for (key in es6_array_iterator) if (!proto[key]) _redefine(proto, key, es6_array_iterator[key], true);\n }\n}\n\nvar iterator = _wksExt.f('iterator');\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [0, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator];\r\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib_1 = require('tslib');\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.\r\n */\r\nvar CONSTANTS = {\r\n /**\r\n * @define {boolean} Whether this is the client Node.js SDK.\r\n */\r\n NODE_CLIENT: false,\r\n /**\r\n * @define {boolean} Whether this is the Admin Node.js SDK.\r\n */\r\n NODE_ADMIN: false,\r\n /**\r\n * Firebase SDK Version\r\n */\r\n SDK_VERSION: '${JSCORE_VERSION}'\r\n};\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Throws an error if the provided assertion is falsy\r\n * @param {*} assertion The assertion to be tested for falsiness\r\n * @param {!string} message The message to display if the check fails\r\n */\r\nvar assert = function (assertion, message) {\r\n if (!assertion) {\r\n throw assertionError(message);\r\n }\r\n};\r\n/**\r\n * Returns an Error object suitable for throwing.\r\n * @param {string} message\r\n * @return {!Error}\r\n */\r\nvar assertionError = function (message) {\r\n return new Error('Firebase Database (' +\r\n CONSTANTS.SDK_VERSION +\r\n ') INTERNAL ASSERT FAILED: ' +\r\n message);\r\n};\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar stringToByteArray = function (str) {\r\n // TODO(user): Use native implementations if/when available\r\n var out = [], p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n if (c < 128) {\r\n out[p++] = c;\r\n }\r\n else if (c < 2048) {\r\n out[p++] = (c >> 6) | 192;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else if ((c & 0xfc00) == 0xd800 &&\r\n i + 1 < str.length &&\r\n (str.charCodeAt(i + 1) & 0xfc00) == 0xdc00) {\r\n // Surrogate Pair\r\n c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\r\n out[p++] = (c >> 18) | 240;\r\n out[p++] = ((c >> 12) & 63) | 128;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else {\r\n out[p++] = (c >> 12) | 224;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n }\r\n return out;\r\n};\r\n/**\r\n * Turns an array of numbers into the string given by the concatenation of the\r\n * characters to which the numbers correspond.\r\n * @param {Array} bytes Array of numbers representing characters.\r\n * @return {string} Stringification of the array.\r\n */\r\nvar byteArrayToString = function (bytes) {\r\n // TODO(user): Use native implementations if/when available\r\n var out = [], pos = 0, c = 0;\r\n while (pos < bytes.length) {\r\n var c1 = bytes[pos++];\r\n if (c1 < 128) {\r\n out[c++] = String.fromCharCode(c1);\r\n }\r\n else if (c1 > 191 && c1 < 224) {\r\n var c2 = bytes[pos++];\r\n out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\r\n }\r\n else if (c1 > 239 && c1 < 365) {\r\n // Surrogate Pair\r\n var c2 = bytes[pos++];\r\n var c3 = bytes[pos++];\r\n var c4 = bytes[pos++];\r\n var u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\r\n 0x10000;\r\n out[c++] = String.fromCharCode(0xd800 + (u >> 10));\r\n out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\r\n }\r\n else {\r\n var c2 = bytes[pos++];\r\n var c3 = bytes[pos++];\r\n out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n }\r\n }\r\n return out.join('');\r\n};\r\n// Static lookup maps, lazily populated by init_()\r\nvar base64 = {\r\n /**\r\n * Maps bytes to characters.\r\n * @type {Object}\r\n * @private\r\n */\r\n byteToCharMap_: null,\r\n /**\r\n * Maps characters to bytes.\r\n * @type {Object}\r\n * @private\r\n */\r\n charToByteMap_: null,\r\n /**\r\n * Maps bytes to websafe characters.\r\n * @type {Object}\r\n * @private\r\n */\r\n byteToCharMapWebSafe_: null,\r\n /**\r\n * Maps websafe characters to bytes.\r\n * @type {Object}\r\n * @private\r\n */\r\n charToByteMapWebSafe_: null,\r\n /**\r\n * Our default alphabet, shared between\r\n * ENCODED_VALS and ENCODED_VALS_WEBSAFE\r\n * @type {string}\r\n */\r\n ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\r\n /**\r\n * Our default alphabet. Value 64 (=) is special; it means \"nothing.\"\r\n * @type {string}\r\n */\r\n get ENCODED_VALS() {\r\n return this.ENCODED_VALS_BASE + '+/=';\r\n },\r\n /**\r\n * Our websafe alphabet.\r\n * @type {string}\r\n */\r\n get ENCODED_VALS_WEBSAFE() {\r\n return this.ENCODED_VALS_BASE + '-_.';\r\n },\r\n /**\r\n * Whether this browser supports the atob and btoa functions. This extension\r\n * started at Mozilla but is now implemented by many browsers. We use the\r\n * ASSUME_* variables to avoid pulling in the full useragent detection library\r\n * but still allowing the standard per-browser compilations.\r\n *\r\n * @type {boolean}\r\n */\r\n HAS_NATIVE_SUPPORT: typeof atob === 'function',\r\n /**\r\n * Base64-encode an array of bytes.\r\n *\r\n * @param {Array|Uint8Array} input An array of bytes (numbers with\r\n * value in [0, 255]) to encode.\r\n * @param {boolean=} opt_webSafe Boolean indicating we should use the\r\n * alternative alphabet.\r\n * @return {string} The base64 encoded string.\r\n */\r\n encodeByteArray: function (input, opt_webSafe) {\r\n if (!Array.isArray(input)) {\r\n throw Error('encodeByteArray takes an array as a parameter');\r\n }\r\n this.init_();\r\n var byteToCharMap = opt_webSafe\r\n ? this.byteToCharMapWebSafe_\r\n : this.byteToCharMap_;\r\n var output = [];\r\n for (var i = 0; i < input.length; i += 3) {\r\n var byte1 = input[i];\r\n var haveByte2 = i + 1 < input.length;\r\n var byte2 = haveByte2 ? input[i + 1] : 0;\r\n var haveByte3 = i + 2 < input.length;\r\n var byte3 = haveByte3 ? input[i + 2] : 0;\r\n var outByte1 = byte1 >> 2;\r\n var outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\r\n var outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\r\n var outByte4 = byte3 & 0x3f;\r\n if (!haveByte3) {\r\n outByte4 = 64;\r\n if (!haveByte2) {\r\n outByte3 = 64;\r\n }\r\n }\r\n output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\r\n }\r\n return output.join('');\r\n },\r\n /**\r\n * Base64-encode a string.\r\n *\r\n * @param {string} input A string to encode.\r\n * @param {boolean=} opt_webSafe If true, we should use the\r\n * alternative alphabet.\r\n * @return {string} The base64 encoded string.\r\n */\r\n encodeString: function (input, opt_webSafe) {\r\n // Shortcut for Mozilla browsers that implement\r\n // a native base64 encoder in the form of \"btoa/atob\"\r\n if (this.HAS_NATIVE_SUPPORT && !opt_webSafe) {\r\n return btoa(input);\r\n }\r\n return this.encodeByteArray(stringToByteArray(input), opt_webSafe);\r\n },\r\n /**\r\n * Base64-decode a string.\r\n *\r\n * @param {string} input to decode.\r\n * @param {boolean=} opt_webSafe True if we should use the\r\n * alternative alphabet.\r\n * @return {string} string representing the decoded value.\r\n */\r\n decodeString: function (input, opt_webSafe) {\r\n // Shortcut for Mozilla browsers that implement\r\n // a native base64 encoder in the form of \"btoa/atob\"\r\n if (this.HAS_NATIVE_SUPPORT && !opt_webSafe) {\r\n return atob(input);\r\n }\r\n return byteArrayToString(this.decodeStringToByteArray(input, opt_webSafe));\r\n },\r\n /**\r\n * Base64-decode a string.\r\n *\r\n * In base-64 decoding, groups of four characters are converted into three\r\n * bytes. If the encoder did not apply padding, the input length may not\r\n * be a multiple of 4.\r\n *\r\n * In this case, the last group will have fewer than 4 characters, and\r\n * padding will be inferred. If the group has one or two characters, it decodes\r\n * to one byte. If the group has three characters, it decodes to two bytes.\r\n *\r\n * @param {string} input Input to decode.\r\n * @param {boolean=} opt_webSafe True if we should use the web-safe alphabet.\r\n * @return {!Array} bytes representing the decoded value.\r\n */\r\n decodeStringToByteArray: function (input, opt_webSafe) {\r\n this.init_();\r\n var charToByteMap = opt_webSafe\r\n ? this.charToByteMapWebSafe_\r\n : this.charToByteMap_;\r\n var output = [];\r\n for (var i = 0; i < input.length;) {\r\n var byte1 = charToByteMap[input.charAt(i++)];\r\n var haveByte2 = i < input.length;\r\n var byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\r\n ++i;\r\n var haveByte3 = i < input.length;\r\n var byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n var haveByte4 = i < input.length;\r\n var byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\r\n throw Error();\r\n }\r\n var outByte1 = (byte1 << 2) | (byte2 >> 4);\r\n output.push(outByte1);\r\n if (byte3 != 64) {\r\n var outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\r\n output.push(outByte2);\r\n if (byte4 != 64) {\r\n var outByte3 = ((byte3 << 6) & 0xc0) | byte4;\r\n output.push(outByte3);\r\n }\r\n }\r\n }\r\n return output;\r\n },\r\n /**\r\n * Lazy static initialization function. Called before\r\n * accessing any of the static map variables.\r\n * @private\r\n */\r\n init_: function () {\r\n if (!this.byteToCharMap_) {\r\n this.byteToCharMap_ = {};\r\n this.charToByteMap_ = {};\r\n this.byteToCharMapWebSafe_ = {};\r\n this.charToByteMapWebSafe_ = {};\r\n // We want quick mappings back and forth, so we precompute two maps.\r\n for (var i = 0; i < this.ENCODED_VALS.length; i++) {\r\n this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\r\n this.charToByteMap_[this.byteToCharMap_[i]] = i;\r\n this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\r\n this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\r\n // Be forgiving when decoding and correctly decode both encodings.\r\n if (i >= this.ENCODED_VALS_BASE.length) {\r\n this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\r\n this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\r\n }\r\n }\r\n }\r\n }\r\n};\r\n/**\r\n * URL-safe base64 encoding\r\n * @param {!string} str\r\n * @return {!string}\r\n */\r\nvar base64Encode = function (str) {\r\n var utf8Bytes = stringToByteArray(str);\r\n return base64.encodeByteArray(utf8Bytes, true);\r\n};\r\n/**\r\n * URL-safe base64 decoding\r\n *\r\n * NOTE: DO NOT use the global atob() function - it does NOT support the\r\n * base64Url variant encoding.\r\n *\r\n * @param {string} str To be decoded\r\n * @return {?string} Decoded result, if possible\r\n */\r\nvar base64Decode = function (str) {\r\n try {\r\n return base64.decodeString(str, true);\r\n }\r\n catch (e) {\r\n console.error('base64Decode failed: ', e);\r\n }\r\n return null;\r\n};\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Do a deep-copy of basic JavaScript Objects or Arrays.\r\n */\r\nfunction deepCopy(value) {\r\n return deepExtend(undefined, value);\r\n}\r\n/**\r\n * Copy properties from source to target (recursively allows extension\r\n * of Objects and Arrays). Scalar values in the target are over-written.\r\n * If target is undefined, an object of the appropriate type will be created\r\n * (and returned).\r\n *\r\n * We recursively copy all child properties of plain Objects in the source- so\r\n * that namespace- like dictionaries are merged.\r\n *\r\n * Note that the target can be a function, in which case the properties in\r\n * the source Object are copied onto it as static properties of the Function.\r\n */\r\nfunction deepExtend(target, source) {\r\n if (!(source instanceof Object)) {\r\n return source;\r\n }\r\n switch (source.constructor) {\r\n case Date:\r\n // Treat Dates like scalars; if the target date object had any child\r\n // properties - they will be lost!\r\n var dateValue = source;\r\n return new Date(dateValue.getTime());\r\n case Object:\r\n if (target === undefined) {\r\n target = {};\r\n }\r\n break;\r\n case Array:\r\n // Always copy the array source and overwrite the target.\r\n target = [];\r\n break;\r\n default:\r\n // Not a plain Object - treat it as a scalar.\r\n return source;\r\n }\r\n for (var prop in source) {\r\n if (!source.hasOwnProperty(prop)) {\r\n continue;\r\n }\r\n target[prop] = deepExtend(target[prop], source[prop]);\r\n }\r\n return target;\r\n}\r\n// TODO: Really needed (for JSCompiler type checking)?\r\nfunction patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Deferred = /** @class */ (function () {\r\n function Deferred() {\r\n var _this = this;\r\n this.promise = new Promise(function (resolve, reject) {\r\n _this.resolve = resolve;\r\n _this.reject = reject;\r\n });\r\n }\r\n /**\r\n * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\r\n * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\r\n * and returns a node-style callback which will resolve or reject the Deferred's promise.\r\n * @param {((?function(?(Error)): (?|undefined))| (?function(?(Error),?=): (?|undefined)))=} callback\r\n * @return {!function(?(Error), ?=)}\r\n */\r\n Deferred.prototype.wrapCallback = function (callback) {\r\n var _this = this;\r\n return function (error, value) {\r\n if (error) {\r\n _this.reject(error);\r\n }\r\n else {\r\n _this.resolve(value);\r\n }\r\n if (typeof callback === 'function') {\r\n // Attaching noop handler just in case developer wasn't expecting\r\n // promises\r\n _this.promise.catch(function () { });\r\n // Some of our callbacks don't expect a value and our own tests\r\n // assert that the parameter length is 1\r\n if (callback.length === 1) {\r\n callback(error);\r\n }\r\n else {\r\n callback(error, value);\r\n }\r\n }\r\n };\r\n };\r\n return Deferred;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns navigator.userAgent string or '' if it's not defined.\r\n * @return {string} user agent string\r\n */\r\nvar getUA = function () {\r\n if (typeof navigator !== 'undefined' &&\r\n typeof navigator['userAgent'] === 'string') {\r\n return navigator['userAgent'];\r\n }\r\n else {\r\n return '';\r\n }\r\n};\r\n/**\r\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\r\n *\r\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap in the Ripple emulator) nor\r\n * Cordova `onDeviceReady`, which would normally wait for a callback.\r\n *\r\n * @return {boolean} isMobileCordova\r\n */\r\nvar isMobileCordova = function () {\r\n return (typeof window !== 'undefined' &&\r\n !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\r\n /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\r\n};\r\n/**\r\n * Detect React Native.\r\n *\r\n * @return {boolean} True if ReactNative environment is detected.\r\n */\r\nvar isReactNative = function () {\r\n return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\r\n};\r\n/**\r\n * Detect Node.js.\r\n *\r\n * @return {boolean} True if Node.js environment is detected.\r\n */\r\nvar isNodeSdk = function () {\r\n return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\r\n};\n\nvar ERROR_NAME = 'FirebaseError';\r\nvar captureStackTrace = Error\r\n .captureStackTrace;\r\n// Export for faking in tests\r\nfunction patchCapture(captureFake) {\r\n var result = captureStackTrace;\r\n captureStackTrace = captureFake;\r\n return result;\r\n}\r\nvar FirebaseError = /** @class */ (function () {\r\n function FirebaseError(code, message) {\r\n this.code = code;\r\n this.message = message;\r\n // We want the stack value, if implemented by Error\r\n if (captureStackTrace) {\r\n // Patches this.stack, omitted calls above ErrorFactory#create\r\n captureStackTrace(this, ErrorFactory.prototype.create);\r\n }\r\n else {\r\n try {\r\n // In case of IE11, stack will be set only after error is raised.\r\n // https://docs.microsoft.com/en-us/scripting/javascript/reference/stack-property-error-javascript\r\n throw Error.apply(this, arguments);\r\n }\r\n catch (err) {\r\n this.name = ERROR_NAME;\r\n // Make non-enumerable getter for the property.\r\n Object.defineProperty(this, 'stack', {\r\n get: function () {\r\n return err.stack;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n return FirebaseError;\r\n}());\r\n// Back-door inheritance\r\nFirebaseError.prototype = Object.create(Error.prototype);\r\nFirebaseError.prototype.constructor = FirebaseError;\r\nFirebaseError.prototype.name = ERROR_NAME;\r\nvar ErrorFactory = /** @class */ (function () {\r\n function ErrorFactory(service, serviceName, errors) {\r\n this.service = service;\r\n this.serviceName = serviceName;\r\n this.errors = errors;\r\n // Matches {$name}, by default.\r\n this.pattern = /\\{\\$([^}]+)}/g;\r\n // empty\r\n }\r\n ErrorFactory.prototype.create = function (code, data) {\r\n if (data === undefined) {\r\n data = {};\r\n }\r\n var template = this.errors[code];\r\n var fullCode = this.service + '/' + code;\r\n var message;\r\n if (template === undefined) {\r\n message = 'Error';\r\n }\r\n else {\r\n message = template.replace(this.pattern, function (match, key) {\r\n var value = data[key];\r\n return value !== undefined ? value.toString() : '<' + key + '?>';\r\n });\r\n }\r\n // Service: Error message (service/code).\r\n message = this.serviceName + ': ' + message + ' (' + fullCode + ').';\r\n var err = new FirebaseError(fullCode, message);\r\n // Populate the Error object with message parts for programmatic\r\n // accesses (e.g., e.file).\r\n for (var prop in data) {\r\n if (!data.hasOwnProperty(prop) || prop.slice(-1) === '_') {\r\n continue;\r\n }\r\n err[prop] = data[prop];\r\n }\r\n return err;\r\n };\r\n return ErrorFactory;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Evaluates a JSON string into a javascript object.\r\n *\r\n * @param {string} str A string containing JSON.\r\n * @return {*} The javascript object representing the specified JSON.\r\n */\r\nfunction jsonEval(str) {\r\n return JSON.parse(str);\r\n}\r\n/**\r\n * Returns JSON representing a javascript object.\r\n * @param {*} data Javascript object to be stringified.\r\n * @return {string} The JSON contents of the object.\r\n */\r\nfunction stringify(data) {\r\n return JSON.stringify(data);\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Decodes a Firebase auth. token into constituent parts.\r\n *\r\n * Notes:\r\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n *\r\n * @param {?string} token\r\n * @return {{header: *, claims: *, data: *, signature: string}}\r\n */\r\nvar decode = function (token) {\r\n var header = {}, claims = {}, data = {}, signature = '';\r\n try {\r\n var parts = token.split('.');\r\n header = jsonEval(base64Decode(parts[0]) || '');\r\n claims = jsonEval(base64Decode(parts[1]) || '');\r\n signature = parts[2];\r\n data = claims['d'] || {};\r\n delete claims['d'];\r\n }\r\n catch (e) { }\r\n return {\r\n header: header,\r\n claims: claims,\r\n data: data,\r\n signature: signature\r\n };\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\r\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n *\r\n * @param {?string} token\r\n * @return {boolean}\r\n */\r\nvar isValidTimestamp = function (token) {\r\n var claims = decode(token).claims, now = Math.floor(new Date().getTime() / 1000), validSince, validUntil;\r\n if (typeof claims === 'object') {\r\n if (claims.hasOwnProperty('nbf')) {\r\n validSince = claims['nbf'];\r\n }\r\n else if (claims.hasOwnProperty('iat')) {\r\n validSince = claims['iat'];\r\n }\r\n if (claims.hasOwnProperty('exp')) {\r\n validUntil = claims['exp'];\r\n }\r\n else {\r\n // token will expire after 24h by default\r\n validUntil = validSince + 86400;\r\n }\r\n }\r\n return (now && validSince && validUntil && now >= validSince && now <= validUntil);\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\r\n *\r\n * Notes:\r\n * - May return null if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n *\r\n * @param {?string} token\r\n * @return {?number}\r\n */\r\nvar issuedAtTime = function (token) {\r\n var claims = decode(token).claims;\r\n if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\r\n return claims['iat'];\r\n }\r\n return null;\r\n};\r\n/**\r\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n *\r\n * @param {?string} token\r\n * @return {boolean}\r\n */\r\nvar isValidFormat = function (token) {\r\n var decoded = decode(token), claims = decoded.claims;\r\n return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\r\n};\r\n/**\r\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\r\n *\r\n * Notes:\r\n * - May return a false negative if there's no native base64 decoding support.\r\n * - Doesn't check if the token is actually valid.\r\n *\r\n * @param {?string} token\r\n * @return {boolean}\r\n */\r\nvar isAdmin = function (token) {\r\n var claims = decode(token).claims;\r\n return typeof claims === 'object' && claims['admin'] === true;\r\n};\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// See http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/\r\nvar contains = function (obj, key) {\r\n return Object.prototype.hasOwnProperty.call(obj, key);\r\n};\r\nvar safeGet = function (obj, key) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key))\r\n return obj[key];\r\n // else return undefined.\r\n};\r\n/**\r\n * Enumerates the keys/values in an object, excluding keys defined on the prototype.\r\n *\r\n * @param {?Object.} obj Object to enumerate.\r\n * @param {!function(K, V)} fn Function to call for each key and value.\r\n * @template K,V\r\n */\r\nvar forEach = function (obj, fn) {\r\n for (var key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n fn(key, obj[key]);\r\n }\r\n }\r\n};\r\n/**\r\n * Copies all the (own) properties from one object to another.\r\n * @param {!Object} objTo\r\n * @param {!Object} objFrom\r\n * @return {!Object} objTo\r\n */\r\nvar extend = function (objTo, objFrom) {\r\n forEach(objFrom, function (key, value) {\r\n objTo[key] = value;\r\n });\r\n return objTo;\r\n};\r\n/**\r\n * Returns a clone of the specified object.\r\n * @param {!Object} obj\r\n * @return {!Object} cloned obj.\r\n */\r\nvar clone = function (obj) {\r\n return extend({}, obj);\r\n};\r\n/**\r\n * Returns true if obj has typeof \"object\" and is not null. Unlike goog.isObject(), does not return true\r\n * for functions.\r\n *\r\n * @param obj {*} A potential object.\r\n * @returns {boolean} True if it's an object.\r\n */\r\nvar isNonNullObject = function (obj) {\r\n return typeof obj === 'object' && obj !== null;\r\n};\r\nvar isEmpty = function (obj) {\r\n for (var key in obj) {\r\n return false;\r\n }\r\n return true;\r\n};\r\nvar getCount = function (obj) {\r\n var rv = 0;\r\n for (var key in obj) {\r\n rv++;\r\n }\r\n return rv;\r\n};\r\nvar map = function (obj, f, opt_obj) {\r\n var res = {};\r\n for (var key in obj) {\r\n res[key] = f.call(opt_obj, obj[key], key, obj);\r\n }\r\n return res;\r\n};\r\nvar findKey = function (obj, fn, opt_this) {\r\n for (var key in obj) {\r\n if (fn.call(opt_this, obj[key], key, obj)) {\r\n return key;\r\n }\r\n }\r\n return undefined;\r\n};\r\nvar findValue = function (obj, fn, opt_this) {\r\n var key = findKey(obj, fn, opt_this);\r\n return key && obj[key];\r\n};\r\nvar getAnyKey = function (obj) {\r\n for (var key in obj) {\r\n return key;\r\n }\r\n};\r\nvar getValues = function (obj) {\r\n var res = [];\r\n var i = 0;\r\n for (var key in obj) {\r\n res[i++] = obj[key];\r\n }\r\n return res;\r\n};\r\n/**\r\n * Tests whether every key/value pair in an object pass the test implemented\r\n * by the provided function\r\n *\r\n * @param {?Object.} obj Object to test.\r\n * @param {!function(K, V)} fn Function to call for each key and value.\r\n * @template K,V\r\n */\r\nvar every = function (obj, fn) {\r\n for (var key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n if (!fn(key, obj[key])) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n};\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a params\r\n * object (e.g. {arg: 'val', arg2: 'val2'})\r\n * Note: You must prepend it with ? when adding it to a URL.\r\n *\r\n * @param {!Object} querystringParams\r\n * @return {string}\r\n */\r\nvar querystring = function (querystringParams) {\r\n var params = [];\r\n forEach(querystringParams, function (key, value) {\r\n if (Array.isArray(value)) {\r\n value.forEach(function (arrayVal) {\r\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\r\n });\r\n }\r\n else {\r\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\r\n }\r\n });\r\n return params.length ? '&' + params.join('&') : '';\r\n};\r\n/**\r\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object (e.g. {arg: 'val', arg2: 'val2'})\r\n *\r\n * @param {string} querystring\r\n * @return {!Object}\r\n */\r\nvar querystringDecode = function (querystring) {\r\n var obj = {};\r\n var tokens = querystring.replace(/^\\?/, '').split('&');\r\n tokens.forEach(function (token) {\r\n if (token) {\r\n var key = token.split('=');\r\n obj[key[0]] = key[1];\r\n }\r\n });\r\n return obj;\r\n};\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Copyright 2011 The Closure Library Authors. All Rights Reserved.\r\n//\r\n// Licensed under the Apache License, Version 2.0 (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.apache.org/licenses/LICENSE-2.0\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n/**\r\n * @fileoverview Abstract cryptographic hash interface.\r\n *\r\n * See Sha1 and Md5 for sample implementations.\r\n *\r\n */\r\n/**\r\n * Create a cryptographic hash instance.\r\n *\r\n * @constructor\r\n * @struct\r\n */\r\nvar Hash = /** @class */ (function () {\r\n function Hash() {\r\n /**\r\n * The block size for the hasher.\r\n * @type {number}\r\n */\r\n this.blockSize = -1;\r\n }\r\n return Hash;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview SHA-1 cryptographic hash.\r\n * Variable names follow the notation in FIPS PUB 180-3:\r\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\r\n *\r\n * Usage:\r\n * var sha1 = new sha1();\r\n * sha1.update(bytes);\r\n * var hash = sha1.digest();\r\n *\r\n * Performance:\r\n * Chrome 23: ~400 Mbit/s\r\n * Firefox 16: ~250 Mbit/s\r\n *\r\n */\r\n/**\r\n * SHA-1 cryptographic hash constructor.\r\n *\r\n * The properties declared here are discussed in the above algorithm document.\r\n * @constructor\r\n * @extends {Hash}\r\n * @final\r\n * @struct\r\n */\r\nvar Sha1 = /** @class */ (function (_super) {\r\n tslib_1.__extends(Sha1, _super);\r\n function Sha1() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Holds the previous values of accumulated variables a-e in the compress_\r\n * function.\r\n * @type {!Array}\r\n * @private\r\n */\r\n _this.chain_ = [];\r\n /**\r\n * A buffer holding the partially computed hash result.\r\n * @type {!Array}\r\n * @private\r\n */\r\n _this.buf_ = [];\r\n /**\r\n * An array of 80 bytes, each a part of the message to be hashed. Referred to\r\n * as the message schedule in the docs.\r\n * @type {!Array}\r\n * @private\r\n */\r\n _this.W_ = [];\r\n /**\r\n * Contains data needed to pad messages less than 64 bytes.\r\n * @type {!Array}\r\n * @private\r\n */\r\n _this.pad_ = [];\r\n /**\r\n * @private {number}\r\n */\r\n _this.inbuf_ = 0;\r\n /**\r\n * @private {number}\r\n */\r\n _this.total_ = 0;\r\n _this.blockSize = 512 / 8;\r\n _this.pad_[0] = 128;\r\n for (var i = 1; i < _this.blockSize; ++i) {\r\n _this.pad_[i] = 0;\r\n }\r\n _this.reset();\r\n return _this;\r\n }\r\n Sha1.prototype.reset = function () {\r\n this.chain_[0] = 0x67452301;\r\n this.chain_[1] = 0xefcdab89;\r\n this.chain_[2] = 0x98badcfe;\r\n this.chain_[3] = 0x10325476;\r\n this.chain_[4] = 0xc3d2e1f0;\r\n this.inbuf_ = 0;\r\n this.total_ = 0;\r\n };\r\n /**\r\n * Internal compress helper function.\r\n * @param {!Array|!Uint8Array|string} buf Block to compress.\r\n * @param {number=} opt_offset Offset of the block in the buffer.\r\n * @private\r\n */\r\n Sha1.prototype.compress_ = function (buf, opt_offset) {\r\n if (!opt_offset) {\r\n opt_offset = 0;\r\n }\r\n var W = this.W_;\r\n // get 16 big endian words\r\n if (typeof buf === 'string') {\r\n for (var i = 0; i < 16; i++) {\r\n // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\r\n // have a bug that turns the post-increment ++ operator into pre-increment\r\n // during JIT compilation. We have code that depends heavily on SHA-1 for\r\n // correctness and which is affected by this bug, so I've removed all uses\r\n // of post-increment ++ in which the result value is used. We can revert\r\n // this change once the Safari bug\r\n // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\r\n // most clients have been updated.\r\n W[i] =\r\n (buf.charCodeAt(opt_offset) << 24) |\r\n (buf.charCodeAt(opt_offset + 1) << 16) |\r\n (buf.charCodeAt(opt_offset + 2) << 8) |\r\n buf.charCodeAt(opt_offset + 3);\r\n opt_offset += 4;\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < 16; i++) {\r\n W[i] =\r\n (buf[opt_offset] << 24) |\r\n (buf[opt_offset + 1] << 16) |\r\n (buf[opt_offset + 2] << 8) |\r\n buf[opt_offset + 3];\r\n opt_offset += 4;\r\n }\r\n }\r\n // expand to 80 words\r\n for (var i = 16; i < 80; i++) {\r\n var t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\r\n W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\r\n }\r\n var a = this.chain_[0];\r\n var b = this.chain_[1];\r\n var c = this.chain_[2];\r\n var d = this.chain_[3];\r\n var e = this.chain_[4];\r\n var f, k;\r\n // TODO(user): Try to unroll this loop to speed up the computation.\r\n for (var i = 0; i < 80; i++) {\r\n if (i < 40) {\r\n if (i < 20) {\r\n f = d ^ (b & (c ^ d));\r\n k = 0x5a827999;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0x6ed9eba1;\r\n }\r\n }\r\n else {\r\n if (i < 60) {\r\n f = (b & c) | (d & (b | c));\r\n k = 0x8f1bbcdc;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0xca62c1d6;\r\n }\r\n }\r\n var t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\r\n e = d;\r\n d = c;\r\n c = ((b << 30) | (b >>> 2)) & 0xffffffff;\r\n b = a;\r\n a = t;\r\n }\r\n this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\r\n this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\r\n this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\r\n this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\r\n this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\r\n };\r\n Sha1.prototype.update = function (bytes, opt_length) {\r\n // TODO(johnlenz): tighten the function signature and remove this check\r\n if (bytes == null) {\r\n return;\r\n }\r\n if (opt_length === undefined) {\r\n opt_length = bytes.length;\r\n }\r\n var lengthMinusBlock = opt_length - this.blockSize;\r\n var n = 0;\r\n // Using local instead of member variables gives ~5% speedup on Firefox 16.\r\n var buf = this.buf_;\r\n var inbuf = this.inbuf_;\r\n // The outer while loop should execute at most twice.\r\n while (n < opt_length) {\r\n // When we have no data in the block to top up, we can directly process the\r\n // input buffer (assuming it contains sufficient data). This gives ~25%\r\n // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\r\n // the data is provided in large chunks (or in multiples of 64 bytes).\r\n if (inbuf == 0) {\r\n while (n <= lengthMinusBlock) {\r\n this.compress_(bytes, n);\r\n n += this.blockSize;\r\n }\r\n }\r\n if (typeof bytes === 'string') {\r\n while (n < opt_length) {\r\n buf[inbuf] = bytes.charCodeAt(n);\r\n ++inbuf;\r\n ++n;\r\n if (inbuf == this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n while (n < opt_length) {\r\n buf[inbuf] = bytes[n];\r\n ++inbuf;\r\n ++n;\r\n if (inbuf == this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n this.inbuf_ = inbuf;\r\n this.total_ += opt_length;\r\n };\r\n /** @override */\r\n Sha1.prototype.digest = function () {\r\n var digest = [];\r\n var totalBits = this.total_ * 8;\r\n // Add pad 0x80 0x00*.\r\n if (this.inbuf_ < 56) {\r\n this.update(this.pad_, 56 - this.inbuf_);\r\n }\r\n else {\r\n this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\r\n }\r\n // Add # bits.\r\n for (var i = this.blockSize - 1; i >= 56; i--) {\r\n this.buf_[i] = totalBits & 255;\r\n totalBits /= 256; // Don't use bit-shifting here!\r\n }\r\n this.compress_(this.buf_);\r\n var n = 0;\r\n for (var i = 0; i < 5; i++) {\r\n for (var j = 24; j >= 0; j -= 8) {\r\n digest[n] = (this.chain_[i] >> j) & 255;\r\n ++n;\r\n }\r\n }\r\n return digest;\r\n };\r\n return Sha1;\r\n}(Hash));\n\n/**\r\n * Helper to make a Subscribe function (just like Promise helps make a\r\n * Thenable).\r\n *\r\n * @param executor Function which can make calls to a single Observer\r\n * as a proxy.\r\n * @param onNoObservers Callback when count of Observers goes to zero.\r\n */\r\nfunction createSubscribe(executor, onNoObservers) {\r\n var proxy = new ObserverProxy(executor, onNoObservers);\r\n return proxy.subscribe.bind(proxy);\r\n}\r\n/**\r\n * Implement fan-out for any number of Observers attached via a subscribe\r\n * function.\r\n */\r\nvar ObserverProxy = /** @class */ (function () {\r\n /**\r\n * @param executor Function which can make calls to a single Observer\r\n * as a proxy.\r\n * @param onNoObservers Callback when count of Observers goes to zero.\r\n */\r\n function ObserverProxy(executor, onNoObservers) {\r\n var _this = this;\r\n this.observers = [];\r\n this.unsubscribes = [];\r\n this.observerCount = 0;\r\n // Micro-task scheduling by calling task.then().\r\n this.task = Promise.resolve();\r\n this.finalized = false;\r\n this.onNoObservers = onNoObservers;\r\n // Call the executor asynchronously so subscribers that are called\r\n // synchronously after the creation of the subscribe function\r\n // can still receive the very first value generated in the executor.\r\n this.task\r\n .then(function () {\r\n executor(_this);\r\n })\r\n .catch(function (e) {\r\n _this.error(e);\r\n });\r\n }\r\n ObserverProxy.prototype.next = function (value) {\r\n this.forEachObserver(function (observer) {\r\n observer.next(value);\r\n });\r\n };\r\n ObserverProxy.prototype.error = function (error) {\r\n this.forEachObserver(function (observer) {\r\n observer.error(error);\r\n });\r\n this.close(error);\r\n };\r\n ObserverProxy.prototype.complete = function () {\r\n this.forEachObserver(function (observer) {\r\n observer.complete();\r\n });\r\n this.close();\r\n };\r\n /**\r\n * Subscribe function that can be used to add an Observer to the fan-out list.\r\n *\r\n * - We require that no event is sent to a subscriber sychronously to their\r\n * call to subscribe().\r\n */\r\n ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) {\r\n var _this = this;\r\n var observer;\r\n if (nextOrObserver === undefined &&\r\n error === undefined &&\r\n complete === undefined) {\r\n throw new Error('Missing Observer.');\r\n }\r\n // Assemble an Observer object when passed as callback functions.\r\n if (implementsAnyMethods(nextOrObserver, ['next', 'error', 'complete'])) {\r\n observer = nextOrObserver;\r\n }\r\n else {\r\n observer = {\r\n next: nextOrObserver,\r\n error: error,\r\n complete: complete\r\n };\r\n }\r\n if (observer.next === undefined) {\r\n observer.next = noop;\r\n }\r\n if (observer.error === undefined) {\r\n observer.error = noop;\r\n }\r\n if (observer.complete === undefined) {\r\n observer.complete = noop;\r\n }\r\n var unsub = this.unsubscribeOne.bind(this, this.observers.length);\r\n // Attempt to subscribe to a terminated Observable - we\r\n // just respond to the Observer with the final error or complete\r\n // event.\r\n if (this.finalized) {\r\n this.task.then(function () {\r\n try {\r\n if (_this.finalError) {\r\n observer.error(_this.finalError);\r\n }\r\n else {\r\n observer.complete();\r\n }\r\n }\r\n catch (e) {\r\n // nothing\r\n }\r\n return;\r\n });\r\n }\r\n this.observers.push(observer);\r\n return unsub;\r\n };\r\n // Unsubscribe is synchronous - we guarantee that no events are sent to\r\n // any unsubscribed Observer.\r\n ObserverProxy.prototype.unsubscribeOne = function (i) {\r\n if (this.observers === undefined || this.observers[i] === undefined) {\r\n return;\r\n }\r\n delete this.observers[i];\r\n this.observerCount -= 1;\r\n if (this.observerCount === 0 && this.onNoObservers !== undefined) {\r\n this.onNoObservers(this);\r\n }\r\n };\r\n ObserverProxy.prototype.forEachObserver = function (fn) {\r\n if (this.finalized) {\r\n // Already closed by previous event....just eat the additional values.\r\n return;\r\n }\r\n // Since sendOne calls asynchronously - there is no chance that\r\n // this.observers will become undefined.\r\n for (var i = 0; i < this.observers.length; i++) {\r\n this.sendOne(i, fn);\r\n }\r\n };\r\n // Call the Observer via one of it's callback function. We are careful to\r\n // confirm that the observe has not been unsubscribed since this asynchronous\r\n // function had been queued.\r\n ObserverProxy.prototype.sendOne = function (i, fn) {\r\n var _this = this;\r\n // Execute the callback asynchronously\r\n this.task.then(function () {\r\n if (_this.observers !== undefined && _this.observers[i] !== undefined) {\r\n try {\r\n fn(_this.observers[i]);\r\n }\r\n catch (e) {\r\n // Ignore exceptions raised in Observers or missing methods of an\r\n // Observer.\r\n // Log error to console. b/31404806\r\n if (typeof console !== 'undefined' && console.error) {\r\n console.error(e);\r\n }\r\n }\r\n }\r\n });\r\n };\r\n ObserverProxy.prototype.close = function (err) {\r\n var _this = this;\r\n if (this.finalized) {\r\n return;\r\n }\r\n this.finalized = true;\r\n if (err !== undefined) {\r\n this.finalError = err;\r\n }\r\n // Proxy is no longer needed - garbage collect references\r\n this.task.then(function () {\r\n _this.observers = undefined;\r\n _this.onNoObservers = undefined;\r\n });\r\n };\r\n return ObserverProxy;\r\n}());\r\n/** Turn synchronous function into one called asynchronously. */\r\nfunction async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}\r\n/**\r\n * Return true if the object passed in implements any of the named methods.\r\n */\r\nfunction implementsAnyMethods(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) {\r\n var method = methods_1[_i];\r\n if (method in obj && typeof obj[method] === 'function') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction noop() {\r\n // do nothing\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Check to make sure the appropriate number of arguments are provided for a public function.\r\n * Throws an error if it fails.\r\n *\r\n * @param {!string} fnName The function name\r\n * @param {!number} minCount The minimum number of arguments to allow for the function call\r\n * @param {!number} maxCount The maximum number of argument to allow for the function call\r\n * @param {!number} argCount The actual number of arguments provided.\r\n */\r\nvar validateArgCount = function (fnName, minCount, maxCount, argCount) {\r\n var argError;\r\n if (argCount < minCount) {\r\n argError = 'at least ' + minCount;\r\n }\r\n else if (argCount > maxCount) {\r\n argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\r\n }\r\n if (argError) {\r\n var error = fnName +\r\n ' failed: Was called with ' +\r\n argCount +\r\n (argCount === 1 ? ' argument.' : ' arguments.') +\r\n ' Expects ' +\r\n argError +\r\n '.';\r\n throw new Error(error);\r\n }\r\n};\r\n/**\r\n * Generates a string to prefix an error message about failed argument validation\r\n *\r\n * @param {!string} fnName The function name\r\n * @param {!number} argumentNumber The index of the argument\r\n * @param {boolean} optional Whether or not the argument is optional\r\n * @return {!string} The prefix to add to the error thrown for validation.\r\n */\r\nfunction errorPrefix(fnName, argumentNumber, optional) {\r\n var argName = '';\r\n switch (argumentNumber) {\r\n case 1:\r\n argName = optional ? 'first' : 'First';\r\n break;\r\n case 2:\r\n argName = optional ? 'second' : 'Second';\r\n break;\r\n case 3:\r\n argName = optional ? 'third' : 'Third';\r\n break;\r\n case 4:\r\n argName = optional ? 'fourth' : 'Fourth';\r\n break;\r\n default:\r\n throw new Error('errorPrefix called with argumentNumber > 4. Need to update it?');\r\n }\r\n var error = fnName + ' failed: ';\r\n error += argName + ' argument ';\r\n return error;\r\n}\r\n/**\r\n * @param {!string} fnName\r\n * @param {!number} argumentNumber\r\n * @param {!string} namespace\r\n * @param {boolean} optional\r\n */\r\nfunction validateNamespace(fnName, argumentNumber, namespace, optional) {\r\n if (optional && !namespace)\r\n return;\r\n if (typeof namespace !== 'string') {\r\n //TODO: I should do more validation here. We only allow certain chars in namespaces.\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid firebase namespace.');\r\n }\r\n}\r\nfunction validateCallback(fnName, argumentNumber, callback, optional) {\r\n if (optional && !callback)\r\n return;\r\n if (typeof callback !== 'function')\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid function.');\r\n}\r\nfunction validateContextObject(fnName, argumentNumber, context, optional) {\r\n if (optional && !context)\r\n return;\r\n if (typeof context !== 'object' || context === null)\r\n throw new Error(errorPrefix(fnName, argumentNumber, optional) +\r\n 'must be a valid context object.');\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\r\n// automatically replaced '\\r\\n' with '\\n', and they didn't handle surrogate pairs,\r\n// so it's been modified.\r\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\r\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\r\n// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first\r\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\r\n// pair).\r\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\r\n/**\r\n * @param {string} str\r\n * @return {Array}\r\n */\r\nvar stringToByteArray$1 = function (str) {\r\n var out = [], p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n // Is this the lead surrogate in a surrogate pair?\r\n if (c >= 0xd800 && c <= 0xdbff) {\r\n var high = c - 0xd800; // the high 10 bits.\r\n i++;\r\n assert(i < str.length, 'Surrogate pair missing trail surrogate.');\r\n var low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\r\n c = 0x10000 + (high << 10) + low;\r\n }\r\n if (c < 128) {\r\n out[p++] = c;\r\n }\r\n else if (c < 2048) {\r\n out[p++] = (c >> 6) | 192;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else if (c < 65536) {\r\n out[p++] = (c >> 12) | 224;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n else {\r\n out[p++] = (c >> 18) | 240;\r\n out[p++] = ((c >> 12) & 63) | 128;\r\n out[p++] = ((c >> 6) & 63) | 128;\r\n out[p++] = (c & 63) | 128;\r\n }\r\n }\r\n return out;\r\n};\r\n/**\r\n * Calculate length without actually converting; useful for doing cheaper validation.\r\n * @param {string} str\r\n * @return {number}\r\n */\r\nvar stringLength = function (str) {\r\n var p = 0;\r\n for (var i = 0; i < str.length; i++) {\r\n var c = str.charCodeAt(i);\r\n if (c < 128) {\r\n p++;\r\n }\r\n else if (c < 2048) {\r\n p += 2;\r\n }\r\n else if (c >= 0xd800 && c <= 0xdbff) {\r\n // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent.\r\n p += 4;\r\n i++; // skip trail surrogate.\r\n }\r\n else {\r\n p += 3;\r\n }\r\n }\r\n return p;\r\n};\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n\nexports.assert = assert;\nexports.assertionError = assertionError;\nexports.base64 = base64;\nexports.base64Decode = base64Decode;\nexports.base64Encode = base64Encode;\nexports.CONSTANTS = CONSTANTS;\nexports.deepCopy = deepCopy;\nexports.deepExtend = deepExtend;\nexports.patchProperty = patchProperty;\nexports.Deferred = Deferred;\nexports.getUA = getUA;\nexports.isMobileCordova = isMobileCordova;\nexports.isNodeSdk = isNodeSdk;\nexports.isReactNative = isReactNative;\nexports.ErrorFactory = ErrorFactory;\nexports.FirebaseError = FirebaseError;\nexports.patchCapture = patchCapture;\nexports.jsonEval = jsonEval;\nexports.stringify = stringify;\nexports.decode = decode;\nexports.isAdmin = isAdmin;\nexports.issuedAtTime = issuedAtTime;\nexports.isValidFormat = isValidFormat;\nexports.isValidTimestamp = isValidTimestamp;\nexports.clone = clone;\nexports.contains = contains;\nexports.every = every;\nexports.extend = extend;\nexports.findKey = findKey;\nexports.findValue = findValue;\nexports.forEach = forEach;\nexports.getAnyKey = getAnyKey;\nexports.getCount = getCount;\nexports.getValues = getValues;\nexports.isEmpty = isEmpty;\nexports.isNonNullObject = isNonNullObject;\nexports.map = map;\nexports.safeGet = safeGet;\nexports.querystring = querystring;\nexports.querystringDecode = querystringDecode;\nexports.Sha1 = Sha1;\nexports.async = async;\nexports.createSubscribe = createSubscribe;\nexports.errorPrefix = errorPrefix;\nexports.validateArgCount = validateArgCount;\nexports.validateCallback = validateCallback;\nexports.validateContextObject = validateContextObject;\nexports.validateNamespace = validateNamespace;\nexports.stringLength = stringLength;\nexports.stringToByteArray = stringToByteArray$1;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar util = require('@firebase/util');\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar contains = function (obj, key) {\r\n return Object.prototype.hasOwnProperty.call(obj, key);\r\n};\r\nvar DEFAULT_ENTRY_NAME = '[DEFAULT]';\r\n// An array to capture listeners before the true auth functions\r\n// exist\r\nvar tokenListeners = [];\r\n/**\r\n * Global context object for a collection of services using\r\n * a shared authentication state.\r\n */\r\nvar FirebaseAppImpl = /** @class */ (function () {\r\n function FirebaseAppImpl(options, config, firebase_) {\r\n this.firebase_ = firebase_;\r\n this.isDeleted_ = false;\r\n this.services_ = {};\r\n this.name_ = config.name;\r\n this._automaticDataCollectionEnabled =\r\n config.automaticDataCollectionEnabled || false;\r\n this.options_ = util.deepCopy(options);\r\n this.INTERNAL = {\r\n getUid: function () { return null; },\r\n getToken: function () { return Promise.resolve(null); },\r\n addAuthTokenListener: function (callback) {\r\n tokenListeners.push(callback);\r\n // Make sure callback is called, asynchronously, in the absence of the auth module\r\n setTimeout(function () { return callback(null); }, 0);\r\n },\r\n removeAuthTokenListener: function (callback) {\r\n tokenListeners = tokenListeners.filter(function (listener) { return listener !== callback; });\r\n }\r\n };\r\n }\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"automaticDataCollectionEnabled\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this._automaticDataCollectionEnabled;\r\n },\r\n set: function (val) {\r\n this.checkDestroyed_();\r\n this._automaticDataCollectionEnabled = val;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"name\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this.name_;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FirebaseAppImpl.prototype, \"options\", {\r\n get: function () {\r\n this.checkDestroyed_();\r\n return this.options_;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n FirebaseAppImpl.prototype.delete = function () {\r\n var _this = this;\r\n return new Promise(function (resolve) {\r\n _this.checkDestroyed_();\r\n resolve();\r\n })\r\n .then(function () {\r\n _this.firebase_.INTERNAL.removeApp(_this.name_);\r\n var services = [];\r\n Object.keys(_this.services_).forEach(function (serviceKey) {\r\n Object.keys(_this.services_[serviceKey]).forEach(function (instanceKey) {\r\n services.push(_this.services_[serviceKey][instanceKey]);\r\n });\r\n });\r\n return Promise.all(services.map(function (service) {\r\n return service.INTERNAL.delete();\r\n }));\r\n })\r\n .then(function () {\r\n _this.isDeleted_ = true;\r\n _this.services_ = {};\r\n });\r\n };\r\n /**\r\n * Return a service instance associated with this app (creating it\r\n * on demand), identified by the passed instanceIdentifier.\r\n *\r\n * NOTE: Currently storage is the only one that is leveraging this\r\n * functionality. They invoke it by calling:\r\n *\r\n * ```javascript\r\n * firebase.app().storage('STORAGE BUCKET ID')\r\n * ```\r\n *\r\n * The service name is passed to this already\r\n * @internal\r\n */\r\n FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {\r\n if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }\r\n this.checkDestroyed_();\r\n if (!this.services_[name]) {\r\n this.services_[name] = {};\r\n }\r\n if (!this.services_[name][instanceIdentifier]) {\r\n /**\r\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\r\n * then we will pass that instance on, otherwise we pass `null`\r\n */\r\n var instanceSpecifier = instanceIdentifier !== DEFAULT_ENTRY_NAME\r\n ? instanceIdentifier\r\n : undefined;\r\n var service = this.firebase_.INTERNAL.factories[name](this, this.extendApp.bind(this), instanceSpecifier);\r\n this.services_[name][instanceIdentifier] = service;\r\n }\r\n return this.services_[name][instanceIdentifier];\r\n };\r\n /**\r\n * Callback function used to extend an App instance at the time\r\n * of service instance creation.\r\n */\r\n FirebaseAppImpl.prototype.extendApp = function (props) {\r\n var _this = this;\r\n // Copy the object onto the FirebaseAppImpl prototype\r\n util.deepExtend(this, props);\r\n /**\r\n * If the app has overwritten the addAuthTokenListener stub, forward\r\n * the active token listeners on to the true fxn.\r\n *\r\n * TODO: This function is required due to our current module\r\n * structure. Once we are able to rely strictly upon a single module\r\n * implementation, this code should be refactored and Auth should\r\n * provide these stubs and the upgrade logic\r\n */\r\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\r\n tokenListeners.forEach(function (listener) {\r\n _this.INTERNAL.addAuthTokenListener(listener);\r\n });\r\n tokenListeners = [];\r\n }\r\n };\r\n /**\r\n * This function will throw an Error if the App has already been deleted -\r\n * use before performing API actions on the App.\r\n */\r\n FirebaseAppImpl.prototype.checkDestroyed_ = function () {\r\n if (this.isDeleted_) {\r\n error('app-deleted', { name: this.name_ });\r\n }\r\n };\r\n return FirebaseAppImpl;\r\n}());\r\n// Prevent dead-code elimination of these methods w/o invalid property\r\n// copying.\r\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\r\n FirebaseAppImpl.prototype.delete ||\r\n console.log('dc');\r\n/**\r\n * Return a firebase namespace object.\r\n *\r\n * In production, this will be called exactly once and the result\r\n * assigned to the 'firebase' global. It may be called multiple times\r\n * in unit tests.\r\n */\r\nfunction createFirebaseNamespace() {\r\n var apps_ = {};\r\n var factories = {};\r\n var appHooks = {};\r\n // A namespace is a plain JavaScript Object.\r\n var namespace = {\r\n // Hack to prevent Babel from modifying the object returned\r\n // as the firebase namespace.\r\n __esModule: true,\r\n initializeApp: initializeApp,\r\n app: app,\r\n apps: null,\r\n Promise: Promise,\r\n SDK_VERSION: '5.5.0',\r\n INTERNAL: {\r\n registerService: registerService,\r\n createFirebaseNamespace: createFirebaseNamespace,\r\n extendNamespace: extendNamespace,\r\n createSubscribe: util.createSubscribe,\r\n ErrorFactory: util.ErrorFactory,\r\n removeApp: removeApp,\r\n factories: factories,\r\n useAsService: useAsService,\r\n Promise: Promise,\r\n deepExtend: util.deepExtend\r\n }\r\n };\r\n // Inject a circular default export to allow Babel users who were previously\r\n // using:\r\n //\r\n // import firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase').default;\r\n //\r\n // instead of\r\n //\r\n // import * as firebase from 'firebase';\r\n // which becomes: var firebase = require('firebase');\r\n util.patchProperty(namespace, 'default', namespace);\r\n // firebase.apps is a read-only getter.\r\n Object.defineProperty(namespace, 'apps', {\r\n get: getApps\r\n });\r\n /**\r\n * Called by App.delete() - but before any services associated with the App\r\n * are deleted.\r\n */\r\n function removeApp(name) {\r\n var app = apps_[name];\r\n callAppHooks(app, 'delete');\r\n delete apps_[name];\r\n }\r\n /**\r\n * Get the App object for a given name (or DEFAULT).\r\n */\r\n function app(name) {\r\n name = name || DEFAULT_ENTRY_NAME;\r\n if (!contains(apps_, name)) {\r\n error('no-app', { name: name });\r\n }\r\n return apps_[name];\r\n }\r\n util.patchProperty(app, 'App', FirebaseAppImpl);\r\n function initializeApp(options, rawConfig) {\r\n if (rawConfig === void 0) { rawConfig = {}; }\r\n if (typeof rawConfig !== 'object' || rawConfig === null) {\r\n var name_1 = rawConfig;\r\n rawConfig = { name: name_1 };\r\n }\r\n var config = rawConfig;\r\n if (config.name === undefined) {\r\n config.name = DEFAULT_ENTRY_NAME;\r\n }\r\n var name = config.name;\r\n if (typeof name !== 'string' || !name) {\r\n error('bad-app-name', { name: name + '' });\r\n }\r\n if (contains(apps_, name)) {\r\n error('duplicate-app', { name: name });\r\n }\r\n var app = new FirebaseAppImpl(options, config, namespace);\r\n apps_[name] = app;\r\n callAppHooks(app, 'create');\r\n return app;\r\n }\r\n /*\r\n * Return an array of all the non-deleted FirebaseApps.\r\n */\r\n function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\r\n }\r\n /*\r\n * Register a Firebase Service.\r\n *\r\n * firebase.INTERNAL.registerService()\r\n *\r\n * TODO: Implement serviceProperties.\r\n */\r\n function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\r\n // Cannot re-register a service that already exists\r\n if (factories[name]) {\r\n error('duplicate-service', { name: name });\r\n }\r\n // Capture the service factory for later service instantiation\r\n factories[name] = createService;\r\n // Capture the appHook, if passed\r\n if (appHook) {\r\n appHooks[name] = appHook;\r\n // Run the **new** app hook on all existing apps\r\n getApps().forEach(function (app) {\r\n appHook('create', app);\r\n });\r\n }\r\n // The Service namespace is an accessor function ...\r\n var serviceNamespace = function (appArg) {\r\n if (appArg === void 0) { appArg = app(); }\r\n if (typeof appArg[name] !== 'function') {\r\n // Invalid argument.\r\n // This happens in the following case: firebase.storage('gs:/')\r\n error('invalid-app-argument', { name: name });\r\n }\r\n // Forward service instance lookup to the FirebaseApp.\r\n return appArg[name]();\r\n };\r\n // ... and a container for service-level properties.\r\n if (serviceProperties !== undefined) {\r\n util.deepExtend(serviceNamespace, serviceProperties);\r\n }\r\n // Monkey-patch the serviceNamespace onto the firebase namespace\r\n namespace[name] = serviceNamespace;\r\n // Patch the FirebaseAppImpl prototype\r\n FirebaseAppImpl.prototype[name] = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var serviceFxn = this._getService.bind(this, name);\r\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\r\n };\r\n return serviceNamespace;\r\n }\r\n /**\r\n * Patch the top-level firebase namespace with additional properties.\r\n *\r\n * firebase.INTERNAL.extendNamespace()\r\n */\r\n function extendNamespace(props) {\r\n util.deepExtend(namespace, props);\r\n }\r\n function callAppHooks(app, eventName) {\r\n Object.keys(factories).forEach(function (serviceName) {\r\n // Ignore virtual services\r\n var factoryName = useAsService(app, serviceName);\r\n if (factoryName === null) {\r\n return;\r\n }\r\n if (appHooks[factoryName]) {\r\n appHooks[factoryName](eventName, app);\r\n }\r\n });\r\n }\r\n // Map the requested service to a registered service name\r\n // (used to map auth to serverAuth service when needed).\r\n function useAsService(app, name) {\r\n if (name === 'serverAuth') {\r\n return null;\r\n }\r\n var useService = name;\r\n var options = app.options;\r\n return useService;\r\n }\r\n return namespace;\r\n}\r\nfunction error(code, args) {\r\n throw appErrors.create(code, args);\r\n}\r\n// TypeScript does not support non-string indexes!\r\n// let errors: {[code: AppError: string} = {\r\nvar errors = {\r\n 'no-app': \"No Firebase App '{$name}' has been created - \" +\r\n 'call Firebase App.initializeApp()',\r\n 'bad-app-name': \"Illegal App name: '{$name}\",\r\n 'duplicate-app': \"Firebase App named '{$name}' already exists\",\r\n 'app-deleted': \"Firebase App named '{$name}' already deleted\",\r\n 'duplicate-service': \"Firebase service named '{$name}' already registered\",\r\n 'sa-not-supported': 'Initializing the Firebase SDK with a service ' +\r\n 'account is only allowed in a Node.js environment. On client ' +\r\n 'devices, you should instead initialize the SDK with an api key and ' +\r\n 'auth domain',\r\n 'invalid-app-argument': 'firebase.{$name}() takes either no argument or a ' +\r\n 'Firebase App instance.'\r\n};\r\nvar appErrors = new util.ErrorFactory('app', 'Firebase', errors);\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar firebase = createFirebaseNamespace();\n\nexports.firebase = firebase;\nexports.default = firebase;\n","'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nrequire('@firebase/polyfill');\nvar firebase = _interopDefault(require('@firebase/app'));\n\n/**\r\n * Copyright 2018 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n\nmodule.exports = firebase;\n","/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A container for all of the Logger instances\r\n */\r\nvar instances = [];\r\n/**\r\n * The JS SDK supports 5 log levels and also allows a user the ability to\r\n * silence the logs altogether.\r\n *\r\n * The order is a follows:\r\n * DEBUG < VERBOSE < INFO < WARN < ERROR\r\n *\r\n * All of the log types above the current log level will be captured (i.e. if\r\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\r\n * `VERBOSE` logs will not)\r\n */\r\nvar LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"DEBUG\"] = 0] = \"DEBUG\";\r\n LogLevel[LogLevel[\"VERBOSE\"] = 1] = \"VERBOSE\";\r\n LogLevel[LogLevel[\"INFO\"] = 2] = \"INFO\";\r\n LogLevel[LogLevel[\"WARN\"] = 3] = \"WARN\";\r\n LogLevel[LogLevel[\"ERROR\"] = 4] = \"ERROR\";\r\n LogLevel[LogLevel[\"SILENT\"] = 5] = \"SILENT\";\r\n})(LogLevel || (LogLevel = {}));\r\n/**\r\n * The default log level\r\n */\r\nvar defaultLogLevel = LogLevel.INFO;\r\n/**\r\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\r\n * messages on to their corresponding console counterparts (if the log method\r\n * is supported by the current log level)\r\n */\r\nvar defaultLogHandler = function (instance, logType) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n if (logType < instance.logLevel)\r\n return;\r\n var now = new Date().toISOString();\r\n switch (logType) {\r\n /**\r\n * By default, `console.debug` is not displayed in the developer console (in\r\n * chrome). To avoid forcing users to have to opt-in to these logs twice\r\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\r\n * logs to the `console.log` function.\r\n */\r\n case LogLevel.DEBUG:\r\n console.log.apply(console, [\"[\" + now + \"] \" + instance.name + \":\"].concat(args));\r\n break;\r\n case LogLevel.VERBOSE:\r\n console.log.apply(console, [\"[\" + now + \"] \" + instance.name + \":\"].concat(args));\r\n break;\r\n case LogLevel.INFO:\r\n console.info.apply(console, [\"[\" + now + \"] \" + instance.name + \":\"].concat(args));\r\n break;\r\n case LogLevel.WARN:\r\n console.warn.apply(console, [\"[\" + now + \"] \" + instance.name + \":\"].concat(args));\r\n break;\r\n case LogLevel.ERROR:\r\n console.error.apply(console, [\"[\" + now + \"] \" + instance.name + \":\"].concat(args));\r\n break;\r\n default:\r\n throw new Error(\"Attempted to log a message with an invalid logType (value: \" + logType + \")\");\r\n }\r\n};\r\nvar Logger = /** @class */ (function () {\r\n /**\r\n * Gives you an instance of a Logger to capture messages according to\r\n * Firebase's logging scheme.\r\n *\r\n * @param name The name that the logs will be associated with\r\n */\r\n function Logger(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The log handler for the Logger instance.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }\r\n Object.defineProperty(Logger.prototype, \"logLevel\", {\r\n get: function () {\r\n return this._logLevel;\r\n },\r\n set: function (val) {\r\n if (!(val in LogLevel)) {\r\n throw new TypeError('Invalid value assigned to `logLevel`');\r\n }\r\n this._logLevel = val;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Logger.prototype, \"logHandler\", {\r\n get: function () {\r\n return this._logHandler;\r\n },\r\n set: function (val) {\r\n if (typeof val !== 'function') {\r\n throw new TypeError('Value assigned to `logHandler` must be a function');\r\n }\r\n this._logHandler = val;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * The functions below are all based on the `console` interface\r\n */\r\n Logger.prototype.debug = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, [this, LogLevel.DEBUG].concat(args));\r\n };\r\n Logger.prototype.log = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, [this, LogLevel.VERBOSE].concat(args));\r\n };\r\n Logger.prototype.info = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, [this, LogLevel.INFO].concat(args));\r\n };\r\n Logger.prototype.warn = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, [this, LogLevel.WARN].concat(args));\r\n };\r\n Logger.prototype.error = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, [this, LogLevel.ERROR].concat(args));\r\n };\r\n return Logger;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction setLogLevel(level) {\r\n instances.forEach(function (inst) {\r\n inst.logLevel = level;\r\n });\r\n}\n\nexport { setLogLevel, Logger, LogLevel };\n","var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nvar e,goog=goog||{},h=commonjsGlobal;function l(a){return\"string\"==typeof a}function m(a,b){a=a.split(\".\");b=b||h;for(var c=0;c>>0),da=0;function ea(a,b,c){return a.call.apply(a.bind,arguments)}\nfunction fa(a,b,c){if(!a)throw Error();if(2c&&(c=Math.max(0,a.length+c));if(l(a))return l(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1},na=\nArray.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){for(var d=a.length,f=l(a)?a.split(\"\"):a,g=0;gb?null:l(a)?a.charAt(b):a[b]}function ra(a){if(!n(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0;}function sa(a,b){b=la(a,b);var c;(c=0<=b)&&Array.prototype.splice.call(a,b,1);return c}function ta(a){return Array.prototype.concat.apply([],arguments)}function ua(a){var b=a.length;if(0b?1:0}var A;a:{var ya=h.navigator;if(ya){var za=ya.userAgent;if(za){A=za;break a}}A=\"\";}function B(a){return-1!=A.indexOf(a)}function Aa(a,b,c){for(var d in a)b.call(c,a[d],d,a);}function Ba(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ca(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function Da(a){var b={},c;for(c in a)b[c]=a[c];return b}var Ea=\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\".split(\" \");\nfunction Fa(a,b){for(var c,d,f=1;fparseFloat(Qa)){Pa=String(Sa);break a}}Pa=Qa;}var Ia={};\nfunction Ta(a){return Ha(a,function(){for(var b=0,c=wa(String(Pa)).split(\".\"),d=wa(String(a)).split(\".\"),f=Math.max(c.length,d.length),g=0;0==b&&g=a.keyCode)a.keyCode=-1;}catch(b){}};var ab=\"closure_listenable_\"+(1E6*Math.random()|0);function F(a){return!(!a||!a[ab])}var bb=0;function cb(a,b,c,d,f){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.Ob=f;this.key=++bb;this.Sa=this.Eb=!1;}cb.prototype.Vb=function(){this.Sa=!0;this.Ob=this.src=this.proxy=this.listener=null;};function db(a){this.src=a;this.J={};this.xb=0;}e=db.prototype;e.add=function(a,b,c,d,f){var g=a.toString();a=this.J[g];a||(a=this.J[g]=[], this.xb++);var k=eb(a,b,d,f);-1c.keyCode||void 0!=c.returnValue)){a:{var f=!1;if(0==c.keyCode)try{c.keyCode=-1;break a}catch(k){f=!0;}if(f||void 0==c.returnValue)c.returnValue=!0;}c=[];for(f=b.currentTarget;f;f=f.parentNode)c.push(f);a=a.type;for(f=c.length-1;!b.Ea&&0<=f;f--){b.currentTarget=c[f];var g=rb(c[f],a,!0,b);d=d&&g;}for(f=0;!b.Ea&&f>>0);function kb(a){if(q(a))return a;a[tb]||(a[tb]=function(b){return a.handleEvent(b)});return a[tb]}function H(){z.call(this);this.ka=new db(this);this.Pe=this;this.Uc=null;}x(H,z);H.prototype[ab]=!0;e=H.prototype;e.addEventListener=function(a,b,c,d){ib(this,a,b,c,d);};e.removeEventListener=function(a,b,c,d){pb(this,a,b,c,d);};\ne.dispatchEvent=function(a){var b,c=this.Uc;if(c)for(b=[];c;c=c.Uc)b.push(c);c=this.Pe;var d=a.type||a;if(l(a))a=new D(a,c);else if(a instanceof D)a.target=a.target||c;else{var f=a;a=new D(d,c);Fa(a,f);}f=!0;if(b)for(var g=b.length-1;!a.Ea&&0<=g;g--){var k=a.currentTarget=b[g];f=k.Lb(d,!0,a)&&f;}a.Ea||(k=a.currentTarget=c, f=k.Lb(d,!0,a)&&f, a.Ea||(f=k.Lb(d,!1,a)&&f));if(b)for(g=0;!a.Ea&&g=this.Qd().value};e.log=function(a,b,c){this.Pf(a)&&(q(b)&&(b=b()), this.gf(this.uf(a,b,c)));};e.uf=function(a,b,c){a=new J(a,String(b),this.pe);c&&a.Bg(c);return a};e.ca=function(a,b){this.log(Nb,a,b);};e.T=function(a,b){this.log(Ob,a,b);};e.info=function(a,b){this.log(Pb,a,b);};e.lf=function(a){this.log(Rb,a,void 0);};\ne.gf=function(a){for(var b=this;b;)b.We(a), b=b.getParent();};e.We=function(a){if(this.Zd)for(var b=0,c;c=this.Zd[b];b++)c(a);};e.Fg=function(a){this.$b=a;};e.Qe=function(a,b){this.pf()[a]=b;};var Sb={},Tb=null;function Vb(a){Tb||(Tb=new Mb(\"\"), Sb[\"\"]=Tb, Tb.Ge(Qb));var b;if(!(b=Sb[a])){b=new Mb(a);var c=a.lastIndexOf(\".\"),d=a.substr(c+1);c=Vb(a.substr(0,c));c.Qe(d,b);b.Fg(c);Sb[a]=b;}return b}function Wb(a,b){a&&a.info(b,void 0);}function L(a,b){a&&a.lf(b);}function Xb(){this.s=Vb(\"goog.labs.net.webChannel.WebChannelDebug\");this.Wc=!0;}e=Xb.prototype;e.Id=function(){this.Wc=!1;};e.Tg=function(a,b,c,d,f){var g=this;this.info(function(){return\"XMLHTTP REQ (\"+c+\") [attempt \"+d+\"]: \"+a+\"\\n\"+b+\"\\n\"+g.Xf(f)});};e.Ug=function(a,b,c,d,f,g){this.info(function(){return\"XMLHTTP RESP (\"+c+\") [ attempt \"+d+\"]: \"+a+\"\\n\"+b+\"\\n\"+f+\" \"+g});};e.Wa=function(a,b,c){var d=this;this.info(function(){return\"XMLHTTP TEXT (\"+a+\"): \"+d.ng(b)+(c?\" \"+c:\"\")});};\ne.Sg=function(a){this.info(function(){return\"TIMEOUT: \"+a});};e.debug=function(a){L(this.s,a);};e.cb=function(a,b){var c=this.s;c&&c.ca(b||\"Exception\",a);};e.info=function(a){Wb(this.s,a);};e.T=function(a){var b=this.s;b&&b.T(a,void 0);};e.ca=function(a){var b=this.s;b&&b.ca(a,void 0);};\ne.ng=function(a){if(!this.Wc)return a;if(!a)return null;try{var b=JSON.parse(a);if(b)for(var c=0;ca.length||(a=a[1], !n(a)||1>a.length))){var b=a[0];if(\"noop\"!=b&&\"stop\"!=b&&\"close\"!=b)for(b=1;ba||3==a&&!La&&!this.h.ya())){this.Za||4!=a||7==b||(8==b||0>=c?N(3):N(2));this.Fb();var d=this.h.za();this.w=d;b=this.h.ya();if(!b){var f=this;this.a.debug(function(){return\"No response text for uri \"+f.pa+\" status \"+d});}this.S=200==d;this.a.Ug(this.Fa,this.pa,this.R,this.Xc,a,d);if(this.S){if(this.Ig())if(c=this.sf())this.a.Wa(this.R,c,\"Initial handshake response via X-HTTP-Initial-Response\"), this.lb=!0, this.Yc(c);else{this.S=!1;\nthis.I=3;O(12);this.a.T(\"XMLHTTP Missing X_HTTP_INITIAL_RESPONSE (\"+this.R+\")\");this.Ia();this.Kb();return}this.yc?(this.Fd(a,b), La&&this.S&&3==a&&this.Ng()):(this.a.Wa(this.R,b,null), this.Yc(b));4==a&&this.Ia();this.S&&!this.Za&&(4==a?this.b.Tc(this):(this.S=!1, this.eb()));}else 400==d&&0a.length)return mc;a=a.substr(c,b);this.Bb=c+b;return a};\ne.yg=function(a){this.ic=2;this.ua=a.clone().Ub();a=!1;h.navigator&&h.navigator.sendBeacon&&(a=h.navigator.sendBeacon(this.ua.toString(),\"\"));!a&&h.Image&&((new Image).src=this.ua, a=!0);a||(this.h=this.b.Jb(null), this.h.send(this.ua));this.qb=w();this.eb();};e.cancel=function(){this.Za=!0;this.Ia();};e.tg=function(a){a&&this.setTimeout(a);this.Ga&&(this.Fb(), this.eb());};e.eb=function(){this.hd=w()+this.Ua;this.Ke(this.Ua);};\ne.Ke=function(a){if(null!=this.Ga)throw Error(\"WatchDog timer not null\");this.Ga=P(u(this.gg,this),a);};e.Fb=function(){this.Ga&&(h.clearTimeout(this.Ga), this.Ga=null);};e.gg=function(){this.Ga=null;var a=w();0<=a-this.hd?this.Df():(this.a.T(\"WatchDog timer called too early\"), this.Ke(this.hd-a));};e.Df=function(){this.S&&this.a.ca(\"Received watchdog timeout even though request loaded successfully\");this.a.Sg(this.pa);2!=this.ic&&(N(3), O(17));this.Ia();this.I=2;this.Kb();};\ne.Kb=function(){this.b.de()||this.Za||this.b.Tc(this);};e.Ia=function(){this.Fb();var a=this.ac;a&&\"function\"==typeof a.bb&&a.bb();this.ac=null;this.Vc.stop();this.Fc.pb();this.h&&(a=this.h, this.h=null, a.abort(), a.bb());};e.Hc=function(){return this.I};e.Yc=function(a){try{this.b.ue(this,a), N(4);}catch(b){this.a.cb(b,\"Error in httprequest callback\");}};function nc(a){if(a.H&&\"function\"==typeof a.H)return a.H();if(l(a))return a.split(\"\");if(ca(a)){for(var b=[],c=a.length,d=0;d2*this.j&&this.wc(), !0):!1};e.wc=function(){if(this.j!=this.o.length){for(var a=0,b=0;aa)throw Error(\"Bad port number \"+a);this.Ca=a;}else this.Ca=null;};e.Ff=function(){return null!=this.Ca};e.ec=function(a,b){this.U();this.K=b?yc(a,!0):a;};e.ae=function(){return!!this.K};e.Gf=function(){return\"\"!==this.P.toString()};e.bd=function(a,b){this.U();a instanceof rc?(this.P=a, this.P.ad(this.O)):(b||(a=sc(a,zc)), this.P=new rc(a,this.O));};e.Rd=function(){return this.P.toString()};e.getQuery=function(){return this.Rd()};\ne.l=function(a,b){this.U();this.P.set(a,b);};e.dc=function(a,b){this.U();n(b)||(b=[String(b)]);this.P.Ie(a,b);};e.$c=function(a,b){this.U();this.ib=b?yc(a):a;};e.Ef=function(){return!!this.ib};e.Ub=function(){this.U();this.l(\"zx\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^w()).toString(36));return this};e.removeParameter=function(a){this.U();this.P.remove(a);return this};e.U=function(){if(this.Qf)throw Error(\"Tried to modify a read-only Uri\");};\ne.ad=function(a){this.O=a;this.P&&this.P.ad(a);};function Ac(a){return a instanceof U?a.clone():new U(a,void 0)}function Bc(a,b,c,d){var f=new U(null,void 0);a&&f.tb(a);b&&f.rb(b);c&&f.sb(c);d&&f.ec(d);return f}function yc(a,b){return a?b?decodeURI(a.replace(/%25/g,\"%2525\")):decodeURIComponent(a):\"\"}function sc(a,b,c){return l(a)?(a=encodeURI(a).replace(b,Cc), c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")), a):null}\nfunction Cc(a){a=a.charCodeAt(0);return\"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}var tc=/[#\\/\\?@]/g,wc=/[#\\?:]/g,uc=/[#\\?]/g,zc=/[#\\?@]/g,xc=/#/g;function rc(a,b){this.j=this.m=null;this.ja=a||null;this.O=!!b;}e=rc.prototype;e.$=function(){if(!this.m&&(this.m=new S, this.j=0, this.ja)){var a=this;qc(this.ja,function(b,c){a.add(decodeURIComponent(b.replace(/\\+/g,\" \")),c);});}};e.C=function(){this.$();return this.j};\ne.add=function(a,b){this.$();this.Oa();a=this.Ma(a);var c=this.m.get(a);c||this.m.set(a,c=[]);c.push(b);this.j+=1;return this};e.remove=function(a){this.$();a=this.Ma(a);return this.m.va(a)?(this.Oa(), this.j-=this.m.get(a).length, this.m.remove(a)):!1};e.clear=function(){this.Oa();this.m=null;this.j=0;};e.X=function(){this.$();return 0==this.j};e.va=function(a){this.$();a=this.Ma(a);return this.m.va(a)};\ne.forEach=function(a,b){this.$();this.m.forEach(function(c,d){na(c,function(c){a.call(b,c,d,this);},this);},this);};e.W=function(){this.$();for(var a=this.m.H(),b=this.m.W(),c=[],d=0;d=this.Xb:!1};e.xf=function(){return this.f?1:this.v?this.v.C():0};e.Jc=function(a){return this.f?this.f==a:this.v?this.v.contains(a):!1};e.oc=function(a){this.v?this.v.add(a):this.f=a;};e.ze=function(a){this.f&&this.f==a?this.f=null:this.v&&this.v.contains(a)&&this.v.remove(a);};e.cancel=function(){this.ba=this.la();this.f?(this.f.cancel(), this.f=null):this.v&&!this.v.X()&&(na(this.v.H(),function(a){a.cancel();}), this.v.clear());};\ne.la=function(){if(null!=this.f)return this.ba.concat(this.f.la());if(null!=this.v&&!this.v.X()){var a=this.ba;na(this.v.H(),function(b){a=a.concat(b.la());});return a}return ua(this.ba)};e.Re=function(a){this.ba=this.ba.concat(a);};e.$e=function(){this.ba.length=0;};function Oc(){this.xg=this.rg=void 0;}Oc.prototype.stringify=function(a){return h.JSON.stringify(a,this.rg)};Oc.prototype.parse=function(a){return h.JSON.parse(a,this.xg)};function Pc(){this.jg=new Oc;}Pc.prototype.hf=function(a,b,c){var d=c||\"\";try{oc(a,function(a,c){var f=a;r(a)&&(f=ub(a));b.push(d+c+\"=\"+encodeURIComponent(f));});}catch(f){throw b.push(d+\"type=\"+encodeURIComponent(\"_badmap\")), f;}};Pc.prototype.jf=function(a,b,c){for(var d=-1;;){var f=[\"count=\"+b];-1==d?0p)d=Math.max(0,a[k].Pc-100), g=!1;else try{this.hf(Ub,f,\"req\"+p+\"_\");}catch(md){c&&c(Ub);}}if(g)return f.join(\"&\")}};\nPc.prototype.zc=function(a){return this.jg.parse(a)};function Qc(a,b){var c=new Xb;c.debug(\"TestLoadImage: loading \"+a);var d=new Image;d.onload=v(Rc,c,d,\"TestLoadImage: loaded\",!0,b);d.onerror=v(Rc,c,d,\"TestLoadImage: error\",!1,b);d.onabort=v(Rc,c,d,\"TestLoadImage: abort\",!1,b);d.ontimeout=v(Rc,c,d,\"TestLoadImage: timeout\",!1,b);h.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}function Rc(a,b,c,d,f){try{a.debug(c), b.onload=null, b.onerror=null, b.onabort=null, b.ontimeout=null, f(d);}catch(g){a.cb(g);}}var Sc=h.JSON.parse;function V(a){H.call(this);this.headers=new S;this.Xa=a||null;this.ha=!1;this.mc=this.c=null;this.ge=this.Tb=\"\";this.Pa=0;this.I=\"\";this.Aa=this.Lc=this.Qb=this.Ec=!1;this.vb=0;this.hc=null;this.Ae=Tc;this.jc=this.lg=this.Ab=!1;}x(V,H);var Tc=\"\";V.prototype.s=Vb(\"goog.net.XhrIo\");var Uc=/^https?$/i,Vc=[\"POST\",\"PUT\"];e=V.prototype;e.Je=function(a){this.Ab=a;};\ne.send=function(a,b,c,d){if(this.c)throw Error(\"[goog.net.XhrIo] Object is active with another request=\"+this.Tb+\"; newUri=\"+a);b=b?b.toUpperCase():\"GET\";this.Tb=a;this.I=\"\";this.Pa=0;this.ge=b;this.Ec=!1;this.ha=!0;this.c=this.df();this.mc=this.Xa?this.Xa.Vd():hc.Vd();this.c.onreadystatechange=u(this.te,this);this.lg&&\"onprogress\"in this.c&&(this.c.onprogress=u(function(a){this.re(a,!0);},this), this.c.upload&&(this.c.upload.onprogress=u(this.re,this)));try{L(this.s,this.da(\"Opening Xhr\")), this.Lc=\n!0, this.c.open(b,String(a),!0), this.Lc=!1;}catch(g){L(this.s,this.da(\"Error opening Xhr: \"+g.message));this.Ld(g);return}a=c||\"\";var f=this.headers.clone();d&&oc(d,function(a,b){f.set(b,a);});d=pa(f.W());c=h.FormData&&a instanceof h.FormData;!(0<=la(Vc,b))||d||c||f.set(\"Content-Type\",\"application/x-www-form-urlencoded;charset=utf-8\");f.forEach(function(a,b){this.c.setRequestHeader(b,a);},this);this.Ae&&(this.c.responseType=this.Ae);\"withCredentials\"in this.c&&this.c.withCredentials!==this.Ab&&(this.c.withCredentials=\nthis.Ab);try{this.yd(), 0c&&(c=a.length);d=a.indexOf(\"?\");if(0>d||d>c){d=c;var f=\"\";}else f=a.substring(d+1,c);a=[a.substr(0,d),f,a.substr(c)];c=a[1];a[1]=b?c?c+\"&\"+b:b:c;a=a[0]+(a[1]?\"?\"+a[1]:\"\")+a[2];}return a}a.l(b,c);return a}function $c(a){this.Bd=22;this.De=0;this.M=[];this.a=new Xb;this.Ib=new Ic;this.na=this.md=this.hb=this.K=this.u=this.Kc=this.aa=this.gb=this.N=this.Rb=this.A=null;this.Te=!0;this.ag=this.Yb=0;this.kf=!!m(\"internalChannelParams.failFast\",a);this.fd=this.Ja=this.wa=this.ia=this.ea=this.i=null;this.Se=!0;this.w=this.he=this.Sb=-1;this.rc=this.Ha=this.La=0;this.Ve=m(\"internalChannelParams.baseRetryDelayMs\",a)||5E3;this.vg=m(\"internalChannelParams.retryDelaySeedMs\",a)||1E4;this.nf=m(\"internalChannelParams.forwardChannelMaxRetries\",\na)||2;this.Od=m(\"internalChannelParams.forwardChannelRequestTimeoutMs\",a)||2E4;this.Xa=a&&a.oh||void 0;this.Db=void 0;this.Ra=0;this.gc=a&&a.supportsCrossDomainXhr||!1;this.ra=\"\";this.G=new Mc(a&&a.concurrentRequestLimit);this.kc=new Pc;this.ta=a&&void 0!==a.backgroundChannelTest?a.backgroundChannelTest:!0;(this.Nd=a&&a.fastHandshake||!1)&&!this.ta&&(this.a.T(\"Force backgroundChannelTest when fastHandshake is enabled.\"), this.ta=!0);a&&a.Id&&this.a.Id();}e=$c.prototype;e.tc=8;e.g=1;\ne.connect=function(a,b,c,d,f){this.a.debug(\"connect()\");O(0);this.K=b;this.gb=c||{};d&&void 0!==f&&(this.gb.OSID=d, this.gb.OAID=f);this.ta&&(this.a.debug(\"connect() bypassed channel-test.\"), this.Ib.$d=[], this.Ib.od=!1);this.bf(a);};e.disconnect=function(){this.a.debug(\"disconnect()\");this.qd();if(3==this.g){var a=this.Yb++,b=this.hb.clone();b.l(\"SID\",this.ra);b.l(\"RID\",a);b.l(\"TYPE\",\"terminate\");this.Ya(b);(new R(this,this.a,this.ra,a,void 0)).yg(b);}this.qe();};\ne.bf=function(a){this.a.debug(\"connectTest_()\");this.Ja=new Hc(this,this.a);null===this.N&&this.Ja.ga(this.A);var b=a;this.N&&this.A&&(b=Zc(a,this.N,this.A));this.Ja.connect(b);};e.af=function(){this.a.debug(\"connectChannel_()\");this.hb=this.Sd(this.K);this.Dc();};e.qd=function(){this.Ja&&(this.Ja.abort(), this.Ja=null);this.u&&(this.u.cancel(), this.u=null);this.ia&&(h.clearTimeout(this.ia), this.ia=null);this.Hb();this.G.cancel();this.ea&&(h.clearTimeout(this.ea), this.ea=null);};\ne.ga=function(a){this.A=a;};e.Eg=function(a){this.Rb=a;};e.Cg=function(a){this.N=a;};e.Dg=function(a){this.aa=a;};e.Fe=function(a){this.Kc=a;};e.He=function(a){this.Ra=a;};e.Hg=function(){this.gc=!0;};e.Ee=function(a){this.i=a;};e.Nf=function(){return!this.fd};e.Zc=function(a){1E3==this.M.length&&this.a.ca(function(){return\"Already have 1000 queued maps upon queueing \"+ub(a)});this.M.push(new Lc(this.ag++,a));3==this.g&&this.Dc();};e.qf=function(){return this.kf?0:this.nf};e.de=function(){return 0==this.g};\ne.getState=function(){return this.g};e.Dc=function(){this.G.ee()||this.ea||(this.ea=P(u(this.we,this),0), this.La=0);};e.Yf=function(a){if(this.G.xf()>=this.G.Xb-(this.ea?1:0))return this.a.ca(\"Unexpected retry request is scheduled.\"), !1;if(this.ea)return this.a.debug(\"Use the retry request that is already scheduled.\"), this.M=a.la().concat(this.M), !0;if(1==this.g||2==this.g||this.La>=this.qf())return!1;this.a.debug(\"Going to retry POST\");this.ea=P(u(this.we,this,a),this.Xd(this.La));this.La++;return!0};\ne.we=function(a){this.ea=null;this.Mg(a);};e.Mg=function(a){this.a.debug(\"startForwardChannel_\");1==this.g?a?this.a.ca(\"Not supposed to retry the open\"):(this.ig(), this.g=2):3==this.g&&(a?this.le(a):0==this.M.length?this.a.debug(\"startForwardChannel_ returned: nothing to send\"):this.G.ee()?this.a.ca(\"startForwardChannel_ returned: connection already in progress\"):(this.le(), this.a.debug(\"startForwardChannel_ finished, sent request\")));};\ne.ig=function(){this.a.debug(\"open_()\");this.Yb=Math.floor(1E5*Math.random());var a=this.Yb++,b=new R(this,this.a,\"\",a,void 0),c=this.A;this.Rb&&(c?(c=Da(c), Fa(c,this.Rb)):c=this.Rb);null===this.N&&b.ga(c);var d=this.Hd(b),f=this.hb.clone();f.l(\"RID\",a);0a&&!this.Nf()&&0==this.Ha};e.$a=function(a){return this.Te?this.i?this.i.$a(a):a:null};\ne.bg=function(){null!=this.wa&&(this.wa=null, this.u.cancel(), this.u=null, this.Qc(), O(19));};e.Hb=function(){null!=this.wa&&(h.clearTimeout(this.wa), this.wa=null);};\ne.Tc=function(a){this.a.debug(\"Request complete\");var b=null;if(this.u==a){this.Hb();this.u=null;var c=2;}else if(this.G.Jc(a))b=a.la(), this.G.ze(a), c=1;else return;this.w=a.w;if(0!=this.g)if(a.S)1==c?(ac(a.Da?a.Da.length:0,w()-a.qb,this.La), this.Dc()):this.Kd();else{var d=a.Hc();if(3==d||0==d&&0this.Wb)throw Error(id);this.fa=new gd;this.oa=new Jc;this.Ac=0;this.Nc=null;this.Cb();}x(hd,z);var id=\"[goog.structs.Pool] Min can not be greater than max\";e=hd.prototype;e.Mb=function(){var a=w();if(!(null!=this.Nc&&a-this.Ncthis.Wb&&0=this.C()){for(var c=this.Y,d=0;d=b))return 1==b?ra(a):(a[0]=a.pop(), this.Zf()), c.gd};\ne.Zf=function(){for(var a=0,b=this.Y,c=b.length,d=b[a];a>1;){var f=this.tf(a),g=this.zf(a);f=gd.getKey())break;b[a]=b[f];a=f;}b[a]=d;};e.$f=function(a){for(var b=this.Y,c=b[a];0c.getKey())b[a]=b[d], a=d;else break}b[a]=c;};e.tf=function(a){return 2*a+1};e.zf=function(a){return 2*a+2};e.wf=function(a){return a-1>>1};e.H=function(){for(var a=this.Y,b=[],c=a.length,d=0;d maxNumberOfArgs) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires between \" + minNumberOfArgs + \" and \" +\r\n (maxNumberOfArgs + \" arguments, but was called with \") +\r\n formatPlural(args.length, 'argument') +\r\n '.');\r\n }\r\n}\r\n/**\r\n * Validates the provided argument is an array and has as least the expected\r\n * number of elements.\r\n */\r\nfunction validateNamedArrayAtLeastNumberOfElements(functionName, value, name, minNumberOfElements) {\r\n if (!(value instanceof Array) || value.length < minNumberOfElements) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires its \" + name + \" argument to be an \" +\r\n 'array with at least ' +\r\n (formatPlural(minNumberOfElements, 'element') + \".\"));\r\n }\r\n}\r\n/**\r\n * Validates the provided positional argument has the native JavaScript type\r\n * using typeof checks.\r\n */\r\nfunction validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}\r\n/**\r\n * Validates the provided argument has the native JavaScript type using\r\n * typeof checks or is undefined.\r\n */\r\nfunction validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}\r\n/**\r\n * Validates the provided named option has the native JavaScript type using\r\n * typeof checks.\r\n */\r\nfunction validateNamedType(functionName, type, optionName, argument) {\r\n validateType(functionName, type, optionName + \" option\", argument);\r\n}\r\n/**\r\n * Validates the provided named option has the native JavaScript type using\r\n * typeof checks or is undefined.\r\n */\r\nfunction validateNamedOptionalType(functionName, type, optionName, argument) {\r\n if (argument !== undefined) {\r\n validateNamedType(functionName, type, optionName, argument);\r\n }\r\n}\r\nfunction validateArrayElements(functionName, optionName, typeDescription, argument, validator) {\r\n if (!(argument instanceof Array)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires its \" + optionName + \" \" +\r\n (\"option to be an array, but it was: \" + valueDescription(argument)));\r\n }\r\n for (var i = 0; i < argument.length; ++i) {\r\n if (!validator(argument[i])) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires all \" + optionName + \" \" +\r\n (\"elements to be \" + typeDescription + \", but the value at index \" + i + \" \") +\r\n (\"was: \" + valueDescription(argument[i])));\r\n }\r\n }\r\n}\r\nfunction validateOptionalArrayElements(functionName, optionName, typeDescription, argument, validator) {\r\n if (argument !== undefined) {\r\n validateArrayElements(functionName, optionName, typeDescription, argument, validator);\r\n }\r\n}\r\n/**\r\n * Validates that the provided named option equals one of the expected values.\r\n */\r\nfunction validateNamedPropertyEquals(functionName, inputName, optionName, input, expected) {\r\n var expectedDescription = [];\r\n for (var _i = 0, expected_1 = expected; _i < expected_1.length; _i++) {\r\n var val = expected_1[_i];\r\n if (val === input) {\r\n return;\r\n }\r\n expectedDescription.push(valueDescription(val));\r\n }\r\n var actualDescription = valueDescription(input);\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid value \" + actualDescription + \" provided to function \" + functionName + \"() for option \" +\r\n (\"\\\"\" + optionName + \"\\\". Acceptable values: \" + expectedDescription.join(', ')));\r\n}\r\n/**\r\n * Validates that the provided named option equals one of the expected values or\r\n * is undefined.\r\n */\r\nfunction validateNamedOptionalPropertyEquals(functionName, inputName, optionName, input, expected) {\r\n if (input !== undefined) {\r\n validateNamedPropertyEquals(functionName, inputName, optionName, input, expected);\r\n }\r\n}\r\n/** Helper to validate the type of a provided input. */\r\nfunction validateType(functionName, type, inputName, input) {\r\n var valid = false;\r\n if (type === 'object') {\r\n valid = isPlainObject(input);\r\n }\r\n else if (type === 'non-empty string') {\r\n valid = typeof input === 'string' && input !== '';\r\n }\r\n else {\r\n valid = typeof input === type;\r\n }\r\n if (!valid) {\r\n var description = valueDescription(input);\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires its \" + inputName + \" \" +\r\n (\"to be of type \" + type + \", but it was: \" + description));\r\n }\r\n}\r\n/**\r\n * Returns true if it's a non-null object without a custom prototype\r\n * (i.e. excludes Array, Date, etc.).\r\n */\r\nfunction isPlainObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n (Object.getPrototypeOf(input) === Object.prototype ||\r\n Object.getPrototypeOf(input) === null));\r\n}\r\n/** Returns a string describing the type / value of the provided input. */\r\nfunction valueDescription(input) {\r\n if (input === undefined) {\r\n return 'undefined';\r\n }\r\n else if (input === null) {\r\n return 'null';\r\n }\r\n else if (typeof input === 'string') {\r\n if (input.length > 20) {\r\n input = input.substring(0, 20) + \"...\";\r\n }\r\n return JSON.stringify(input);\r\n }\r\n else if (typeof input === 'number' || typeof input === 'boolean') {\r\n return '' + input;\r\n }\r\n else if (typeof input === 'object') {\r\n if (input instanceof Array) {\r\n return 'an array';\r\n }\r\n else {\r\n var customObjectName = tryGetCustomObjectType(input);\r\n if (customObjectName) {\r\n return \"a custom \" + customObjectName + \" object\";\r\n }\r\n else {\r\n return 'an object';\r\n }\r\n }\r\n }\r\n else if (typeof input === 'function') {\r\n return 'a function';\r\n }\r\n else {\r\n return fail('Unknown wrong type: ' + typeof input);\r\n }\r\n}\r\n/** Hacky method to try to get the constructor name for an object. */\r\nfunction tryGetCustomObjectType(input) {\r\n if (input.constructor) {\r\n var funcNameRegex = /function\\s+([^\\s(]+)\\s*\\(/;\r\n var results = funcNameRegex.exec(input.constructor.toString());\r\n if (results && results.length > 1) {\r\n return results[1];\r\n }\r\n }\r\n return null;\r\n}\r\n/** Validates the provided argument is defined. */\r\nfunction validateDefined(functionName, position, argument) {\r\n if (argument === undefined) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires a valid \" + ordinal(position) + \" \" +\r\n \"argument, but it was undefined.\");\r\n }\r\n}\r\n/**\r\n * Validates the provided positional argument is an object, and its keys and\r\n * values match the expected keys and types provided in optionTypes.\r\n */\r\nfunction validateOptionNames(functionName, options, optionNames) {\r\n forEach(options, function (key, _) {\r\n if (optionNames.indexOf(key) < 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Unknown option '\" + key + \"' passed to function \" + functionName + \"(). \" +\r\n 'Available options: ' +\r\n optionNames.join(', '));\r\n }\r\n });\r\n}\r\n/**\r\n * Helper method to throw an error that the provided argument did not pass\r\n * an instanceof check.\r\n */\r\nfunction invalidClassError(functionName, type, position, argument) {\r\n var description = valueDescription(argument);\r\n return new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires its \" + ordinal(position) + \" \" +\r\n (\"argument to be a \" + type + \", but it was: \" + description));\r\n}\r\n/** Converts a number to its english word representation */\r\nfunction ordinal(num) {\r\n switch (num) {\r\n case 1:\r\n return 'first';\r\n case 2:\r\n return 'second';\r\n case 3:\r\n return 'third';\r\n default:\r\n return num + 'th';\r\n }\r\n}\r\n/**\r\n * Formats the given word as plural conditionally given the preceding number.\r\n */\r\nfunction formatPlural(num, str) {\r\n return num + \" \" + str + (num === 1 ? '' : 's');\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// tslint:disable-next-line:class-as-namespace\r\nvar AutoId = /** @class */ (function () {\r\n function AutoId() {\r\n }\r\n AutoId.newId = function () {\r\n // Alphanumeric characters\r\n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n var autoId = '';\r\n for (var i = 0; i < 20; i++) {\r\n autoId += chars.charAt(Math.floor(Math.random() * chars.length));\r\n }\r\n assert(autoId.length === 20, 'Invalid auto ID: ' + autoId);\r\n return autoId;\r\n };\r\n return AutoId;\r\n}());\r\nfunction primitiveComparator(left, right) {\r\n if (left < right)\r\n return -1;\r\n if (left > right)\r\n return 1;\r\n return 0;\r\n}\r\n/** Helper to compare nullable (or undefined-able) objects using isEqual(). */\r\nfunction equals(left, right) {\r\n if (left !== null && left !== undefined) {\r\n return !!(right && left.isEqual(right));\r\n }\r\n else {\r\n // HACK: Explicitly cast since TypeScript's type narrowing apparently isn't\r\n // smart enough.\r\n return left === right;\r\n }\r\n}\r\n/** Helper to compare arrays using isEqual(). */\r\nfunction arrayEquals(left, right) {\r\n if (left.length !== right.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < left.length; i++) {\r\n if (!left[i].isEqual(right[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n/**\r\n * Returns the immediate lexicographically-following string. This is useful to\r\n * construct an inclusive range for indexeddb iterators.\r\n */\r\nfunction immediateSuccessor(s) {\r\n // Return the input string, with an additional NUL byte appended.\r\n return s + '\\0';\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Helper function to assert Uint8Array is available at runtime. */\r\nfunction assertUint8ArrayAvailable() {\r\n if (typeof Uint8Array === 'undefined') {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, 'Uint8Arrays are not available in this environment.');\r\n }\r\n}\r\n/** Helper function to assert Base64 functions are available at runtime. */\r\nfunction assertBase64Available() {\r\n if (!PlatformSupport.getPlatform().base64Available) {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, 'Blobs are unavailable in Firestore in this environment.');\r\n }\r\n}\r\n/**\r\n * Immutable class holding a blob (binary data).\r\n * This class is directly exposed in the public API.\r\n *\r\n * Note that while you can't hide the constructor in JavaScript code, we are\r\n * using the hack above to make sure no-one outside this module can call it.\r\n */\r\nvar Blob = /** @class */ (function () {\r\n function Blob(binaryString) {\r\n assertBase64Available();\r\n this._binaryString = binaryString;\r\n }\r\n Blob.fromBase64String = function (base64) {\r\n validateExactNumberOfArgs('Blob.fromBase64String', arguments, 1);\r\n validateArgType('Blob.fromBase64String', 'string', 1, base64);\r\n assertBase64Available();\r\n try {\r\n var binaryString = PlatformSupport.getPlatform().atob(base64);\r\n return new Blob(binaryString);\r\n }\r\n catch (e) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Failed to construct Blob from Base64 string: ' + e);\r\n }\r\n };\r\n Blob.fromUint8Array = function (array) {\r\n validateExactNumberOfArgs('Blob.fromUint8Array', arguments, 1);\r\n assertUint8ArrayAvailable();\r\n if (!(array instanceof Uint8Array)) {\r\n throw invalidClassError('Blob.fromUint8Array', 'Uint8Array', 1, array);\r\n }\r\n // We can't call array.map directly because it expects the return type to\r\n // be a Uint8Array, whereas we can convert it to a regular array by invoking\r\n // map on the Array prototype.\r\n var binaryString = Array.prototype.map\r\n .call(array, function (char) {\r\n return String.fromCharCode(char);\r\n })\r\n .join('');\r\n return new Blob(binaryString);\r\n };\r\n Blob.prototype.toBase64 = function () {\r\n validateExactNumberOfArgs('Blob.toBase64', arguments, 0);\r\n assertBase64Available();\r\n return PlatformSupport.getPlatform().btoa(this._binaryString);\r\n };\r\n Blob.prototype.toUint8Array = function () {\r\n validateExactNumberOfArgs('Blob.toUint8Array', arguments, 0);\r\n assertUint8ArrayAvailable();\r\n var buffer = new Uint8Array(this._binaryString.length);\r\n for (var i = 0; i < this._binaryString.length; i++) {\r\n buffer[i] = this._binaryString.charCodeAt(i);\r\n }\r\n return buffer;\r\n };\r\n Blob.prototype.toString = function () {\r\n return 'Blob(base64: ' + this.toBase64() + ')';\r\n };\r\n Blob.prototype.isEqual = function (other) {\r\n return this._binaryString === other._binaryString;\r\n };\r\n /**\r\n * Actually private to JS consumers of our API, so this function is prefixed\r\n * with an underscore.\r\n */\r\n Blob.prototype._compareTo = function (other) {\r\n return primitiveComparator(this._binaryString, other._binaryString);\r\n };\r\n return Blob;\r\n}());\r\n// Public instance that disallows construction at runtime. This constructor is\r\n// used when exporting Blob on firebase.firestore.Blob and will be called Blob\r\n// publicly. Internally we still use Blob which has a type checked private\r\n// constructor. Note that Blob and PublicBlob can be used interchangeably in\r\n// instanceof checks.\r\n// For our internal TypeScript code PublicBlob doesn't exist as a type, and so\r\n// we need to use Blob as type and export it too.\r\n// tslint:disable-next-line:variable-name We're treating this as a class name.\r\nvar PublicBlob = makeConstructorPrivate(Blob, 'Use Blob.fromUint8Array() or Blob.fromBase64String() instead.');\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Immutable class representing a geo point as latitude-longitude pair.\r\n * This class is directly exposed in the public API, including its constructor.\r\n */\r\nvar GeoPoint = /** @class */ (function () {\r\n function GeoPoint(latitude, longitude) {\r\n validateExactNumberOfArgs('GeoPoint', arguments, 2);\r\n validateArgType('GeoPoint', 'number', 1, latitude);\r\n validateArgType('GeoPoint', 'number', 2, longitude);\r\n if (!isFinite(latitude) || latitude < -90 || latitude > 90) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Latitude must be a number between -90 and 90, but was: ' + latitude);\r\n }\r\n if (!isFinite(longitude) || longitude < -180 || longitude > 180) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Longitude must be a number between -180 and 180, but was: ' + longitude);\r\n }\r\n this._lat = latitude;\r\n this._long = longitude;\r\n }\r\n Object.defineProperty(GeoPoint.prototype, \"latitude\", {\r\n /**\r\n * Returns the latitude of this geo point, a number between -90 and 90.\r\n */\r\n get: function () {\r\n return this._lat;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GeoPoint.prototype, \"longitude\", {\r\n /**\r\n * Returns the longitude of this geo point, a number between -180 and 180.\r\n */\r\n get: function () {\r\n return this._long;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n GeoPoint.prototype.isEqual = function (other) {\r\n return this._lat === other._lat && this._long === other._long;\r\n };\r\n /**\r\n * Actually private to JS consumers of our API, so this function is prefixed\r\n * with an underscore.\r\n */\r\n GeoPoint.prototype._compareTo = function (other) {\r\n return (primitiveComparator(this._lat, other._lat) ||\r\n primitiveComparator(this._long, other._long));\r\n };\r\n return GeoPoint;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Timestamp = /** @class */ (function () {\r\n function Timestamp(seconds, nanoseconds) {\r\n this.seconds = seconds;\r\n this.nanoseconds = nanoseconds;\r\n if (nanoseconds < 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Timestamp nanoseconds out of range: ' + nanoseconds);\r\n }\r\n if (nanoseconds >= 1e9) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Timestamp nanoseconds out of range: ' + nanoseconds);\r\n }\r\n // Midnight at the beginning of 1/1/1 is the earliest Firestore supports.\r\n if (seconds < -62135596800) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Timestamp seconds out of range: ' + seconds);\r\n }\r\n // This will break in the year 10,000.\r\n if (seconds >= 253402300800) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Timestamp seconds out of range: ' + seconds);\r\n }\r\n }\r\n Timestamp.now = function () {\r\n return Timestamp.fromMillis(Date.now());\r\n };\r\n Timestamp.fromDate = function (date) {\r\n return Timestamp.fromMillis(date.getTime());\r\n };\r\n Timestamp.fromMillis = function (milliseconds) {\r\n var seconds = Math.floor(milliseconds / 1000);\r\n var nanos = (milliseconds - seconds * 1000) * 1e6;\r\n return new Timestamp(seconds, nanos);\r\n };\r\n Timestamp.prototype.toDate = function () {\r\n return new Date(this.toMillis());\r\n };\r\n Timestamp.prototype.toMillis = function () {\r\n return this.seconds * 1000 + this.nanoseconds / 1e6;\r\n };\r\n Timestamp.prototype._compareTo = function (other) {\r\n if (this.seconds === other.seconds) {\r\n return primitiveComparator(this.nanoseconds, other.nanoseconds);\r\n }\r\n return primitiveComparator(this.seconds, other.seconds);\r\n };\r\n Timestamp.prototype.isEqual = function (other) {\r\n return (other.seconds === this.seconds && other.nanoseconds === this.nanoseconds);\r\n };\r\n Timestamp.prototype.toString = function () {\r\n return ('Timestamp(seconds=' +\r\n this.seconds +\r\n ', nanoseconds=' +\r\n this.nanoseconds +\r\n ')');\r\n };\r\n return Timestamp;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DatabaseInfo = /** @class */ (function () {\r\n /**\r\n * Constructs a DatabaseInfo using the provided host, databaseId and\r\n * persistenceKey.\r\n *\r\n * @param databaseId The database to use.\r\n * @param persistenceKey A unique identifier for this Firestore's local\r\n * storage (used in conjunction with the databaseId).\r\n * @param host The Firestore backend host to connect to.\r\n * @param ssl Whether to use SSL when connecting.\r\n */\r\n function DatabaseInfo(databaseId, persistenceKey, host, ssl) {\r\n this.databaseId = databaseId;\r\n this.persistenceKey = persistenceKey;\r\n this.host = host;\r\n this.ssl = ssl;\r\n }\r\n return DatabaseInfo;\r\n}());\r\n/** The default database name for a project. */\r\nvar DEFAULT_DATABASE_NAME = '(default)';\r\n/** Represents the database ID a Firestore client is associated with. */\r\nvar DatabaseId = /** @class */ (function () {\r\n function DatabaseId(projectId, database) {\r\n this.projectId = projectId;\r\n this.database = database ? database : DEFAULT_DATABASE_NAME;\r\n }\r\n Object.defineProperty(DatabaseId.prototype, \"isDefaultDatabase\", {\r\n get: function () {\r\n return this.database === DEFAULT_DATABASE_NAME;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DatabaseId.prototype.isEqual = function (other) {\r\n return (other instanceof DatabaseId &&\r\n other.projectId === this.projectId &&\r\n other.database === this.database);\r\n };\r\n DatabaseId.prototype.compareTo = function (other) {\r\n return (primitiveComparator(this.projectId, other.projectId) ||\r\n primitiveComparator(this.database, other.database));\r\n };\r\n return DatabaseId;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DOCUMENT_KEY_NAME = '__name__';\r\n/**\r\n * Path represents an ordered sequence of string segments.\r\n */\r\nvar Path = /** @class */ (function () {\r\n function Path(segments, offset, length) {\r\n this.init(segments, offset, length);\r\n }\r\n /**\r\n * An initialization method that can be called from outside the constructor.\r\n * We need this so that we can have a non-static construct method that returns\r\n * the polymorphic `this` type.\r\n */\r\n Path.prototype.init = function (segments, offset, length) {\r\n if (offset === undefined) {\r\n offset = 0;\r\n }\r\n else if (offset > segments.length) {\r\n fail('offset ' + offset + ' out of range ' + segments.length);\r\n }\r\n if (length === undefined) {\r\n length = segments.length - offset;\r\n }\r\n else if (length > segments.length - offset) {\r\n fail('length ' + length + ' out of range ' + (segments.length - offset));\r\n }\r\n this.segments = segments;\r\n this.offset = offset;\r\n this.len = length;\r\n };\r\n /**\r\n * Constructs a new instance of Path using the same concrete type as `this`.\r\n * We need this instead of using the normal constructor, because polymorphic\r\n * `this` doesn't work on static methods.\r\n */\r\n Path.prototype.construct = function (segments, offset, length) {\r\n var path = Object.create(Object.getPrototypeOf(this));\r\n path.init(segments, offset, length);\r\n return path;\r\n };\r\n Object.defineProperty(Path.prototype, \"length\", {\r\n get: function () {\r\n return this.len;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Path.prototype.isEqual = function (other) {\r\n return Path.comparator(this, other) === 0;\r\n };\r\n Path.prototype.child = function (nameOrPath) {\r\n var segments = this.segments.slice(this.offset, this.limit());\r\n if (nameOrPath instanceof Path) {\r\n nameOrPath.forEach(function (segment) {\r\n segments.push(segment);\r\n });\r\n }\r\n else if (typeof nameOrPath === 'string') {\r\n segments.push(nameOrPath);\r\n }\r\n else {\r\n fail('Unknown parameter type for Path.child(): ' + nameOrPath);\r\n }\r\n return this.construct(segments);\r\n };\r\n /** The index of one past the last segment of the path. */\r\n Path.prototype.limit = function () {\r\n return this.offset + this.length;\r\n };\r\n Path.prototype.popFirst = function (size) {\r\n size = size === undefined ? 1 : size;\r\n assert(this.length >= size, \"Can't call popFirst() with less segments\");\r\n return this.construct(this.segments, this.offset + size, this.length - size);\r\n };\r\n Path.prototype.popLast = function () {\r\n assert(!this.isEmpty(), \"Can't call popLast() on empty path\");\r\n return this.construct(this.segments, this.offset, this.length - 1);\r\n };\r\n Path.prototype.firstSegment = function () {\r\n assert(!this.isEmpty(), \"Can't call firstSegment() on empty path\");\r\n return this.segments[this.offset];\r\n };\r\n Path.prototype.lastSegment = function () {\r\n assert(!this.isEmpty(), \"Can't call lastSegment() on empty path\");\r\n return this.segments[this.limit() - 1];\r\n };\r\n Path.prototype.get = function (index) {\r\n assert(index < this.length, 'Index out of range');\r\n return this.segments[this.offset + index];\r\n };\r\n Path.prototype.isEmpty = function () {\r\n return this.length === 0;\r\n };\r\n Path.prototype.isPrefixOf = function (other) {\r\n if (other.length < this.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < this.length; i++) {\r\n if (this.get(i) !== other.get(i)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Path.prototype.isImmediateParentOf = function (potentialChild) {\r\n if (this.length + 1 !== potentialChild.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < this.length; i++) {\r\n if (this.get(i) !== potentialChild.get(i)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Path.prototype.forEach = function (fn) {\r\n for (var i = this.offset, end = this.limit(); i < end; i++) {\r\n fn(this.segments[i]);\r\n }\r\n };\r\n Path.prototype.toArray = function () {\r\n return this.segments.slice(this.offset, this.limit());\r\n };\r\n Path.comparator = function (p1, p2) {\r\n var len = Math.min(p1.length, p2.length);\r\n for (var i = 0; i < len; i++) {\r\n var left = p1.get(i);\r\n var right = p2.get(i);\r\n if (left < right)\r\n return -1;\r\n if (left > right)\r\n return 1;\r\n }\r\n if (p1.length < p2.length)\r\n return -1;\r\n if (p1.length > p2.length)\r\n return 1;\r\n return 0;\r\n };\r\n return Path;\r\n}());\r\n/**\r\n * A slash-separated path for navigating resources (documents and collections)\r\n * within Firestore.\r\n */\r\nvar ResourcePath = /** @class */ (function (_super) {\r\n tslib_1.__extends(ResourcePath, _super);\r\n function ResourcePath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ResourcePath.prototype.canonicalString = function () {\r\n // NOTE: The client is ignorant of any path segments containing escape\r\n // sequences (e.g. __id123__) and just passes them through raw (they exist\r\n // for legacy reasons and should not be used frequently).\r\n return this.toArray().join('/');\r\n };\r\n ResourcePath.prototype.toString = function () {\r\n return this.canonicalString();\r\n };\r\n /**\r\n * Creates a resource path from the given slash-delimited string.\r\n */\r\n ResourcePath.fromString = function (path) {\r\n // NOTE: The client is ignorant of any path segments containing escape\r\n // sequences (e.g. __id123__) and just passes them through raw (they exist\r\n // for legacy reasons and should not be used frequently).\r\n if (path.indexOf('//') >= 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid path (\" + path + \"). Paths must not contain // in them.\");\r\n }\r\n // We may still have an empty segment at the beginning or end if they had a\r\n // leading or trailing slash (which we allow).\r\n var segments = path.split('/').filter(function (segment) { return segment.length > 0; });\r\n return new ResourcePath(segments);\r\n };\r\n ResourcePath.EMPTY_PATH = new ResourcePath([]);\r\n return ResourcePath;\r\n}(Path));\r\nvar identifierRegExp = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\r\n/** A dot-separated path for navigating sub-objects within a document. */\r\nvar FieldPath = /** @class */ (function (_super) {\r\n tslib_1.__extends(FieldPath, _super);\r\n function FieldPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Returns true if the string could be used as a segment in a field path\r\n * without escaping.\r\n */\r\n FieldPath.isValidIdentifier = function (segment) {\r\n return identifierRegExp.test(segment);\r\n };\r\n FieldPath.prototype.canonicalString = function () {\r\n return this.toArray()\r\n .map(function (str) {\r\n str = str.replace('\\\\', '\\\\\\\\').replace('`', '\\\\`');\r\n if (!FieldPath.isValidIdentifier(str)) {\r\n str = '`' + str + '`';\r\n }\r\n return str;\r\n })\r\n .join('.');\r\n };\r\n FieldPath.prototype.toString = function () {\r\n return this.canonicalString();\r\n };\r\n /**\r\n * Returns true if this field references the key of a document.\r\n */\r\n FieldPath.prototype.isKeyField = function () {\r\n return this.length === 1 && this.get(0) === DOCUMENT_KEY_NAME;\r\n };\r\n /**\r\n * The field designating the key of a document.\r\n */\r\n FieldPath.keyField = function () {\r\n return new FieldPath([DOCUMENT_KEY_NAME]);\r\n };\r\n /**\r\n * Parses a field string from the given server-formatted string.\r\n *\r\n * - Splitting the empty string is not allowed (for now at least).\r\n * - Empty segments within the string (e.g. if there are two consecutive\r\n * separators) are not allowed.\r\n *\r\n * TODO(b/37244157): we should make this more strict. Right now, it allows\r\n * non-identifier path components, even if they aren't escaped.\r\n */\r\n FieldPath.fromServerFormat = function (path) {\r\n var segments = [];\r\n var current = '';\r\n var i = 0;\r\n var addCurrentSegment = function () {\r\n if (current.length === 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not be empty, begin \" +\r\n \"with '.', end with '.', or contain '..'\");\r\n }\r\n segments.push(current);\r\n current = '';\r\n };\r\n var inBackticks = false;\r\n while (i < path.length) {\r\n var c = path[i];\r\n if (c === '\\\\') {\r\n if (i + 1 === path.length) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Path has trailing escape character: ' + path);\r\n }\r\n var next = path[i + 1];\r\n if (!(next === '\\\\' || next === '.' || next === '`')) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Path has invalid escape sequence: ' + path);\r\n }\r\n current += next;\r\n i += 2;\r\n }\r\n else if (c === '`') {\r\n inBackticks = !inBackticks;\r\n i++;\r\n }\r\n else if (c === '.' && !inBackticks) {\r\n addCurrentSegment();\r\n i++;\r\n }\r\n else {\r\n current += c;\r\n i++;\r\n }\r\n }\r\n addCurrentSegment();\r\n if (inBackticks) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Unterminated ` in path: ' + path);\r\n }\r\n return new FieldPath(segments);\r\n };\r\n FieldPath.EMPTY_PATH = new FieldPath([]);\r\n return FieldPath;\r\n}(Path));\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DocumentKey = /** @class */ (function () {\r\n function DocumentKey(path) {\r\n this.path = path;\r\n assert(DocumentKey.isDocumentKey(path), 'Invalid DocumentKey with an odd number of segments: ' +\r\n path.toArray().join('/'));\r\n }\r\n DocumentKey.prototype.isEqual = function (other) {\r\n return (other !== null && ResourcePath.comparator(this.path, other.path) === 0);\r\n };\r\n DocumentKey.prototype.toString = function () {\r\n return this.path.toString();\r\n };\r\n DocumentKey.comparator = function (k1, k2) {\r\n return ResourcePath.comparator(k1.path, k2.path);\r\n };\r\n DocumentKey.isDocumentKey = function (path) {\r\n return path.length % 2 === 0;\r\n };\r\n /**\r\n * Creates and returns a new document key with the given segments.\r\n *\r\n * @param path The segments of the path to the document\r\n * @return A new instance of DocumentKey\r\n */\r\n DocumentKey.fromSegments = function (segments) {\r\n return new DocumentKey(new ResourcePath(segments.slice()));\r\n };\r\n /**\r\n * Creates and returns a new document key using '/' to split the string into\r\n * segments.\r\n *\r\n * @param path The slash-separated path string to the document\r\n * @return A new instance of DocumentKey\r\n */\r\n DocumentKey.fromPathString = function (path) {\r\n return new DocumentKey(ResourcePath.fromString(path));\r\n };\r\n DocumentKey.EMPTY = new DocumentKey(new ResourcePath([]));\r\n return DocumentKey;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The result of a lookup for a given path may be an existing document or a\r\n * marker that this document does not exist at a given version.\r\n */\r\nvar MaybeDocument = /** @class */ (function () {\r\n function MaybeDocument(key, version) {\r\n this.key = key;\r\n this.version = version;\r\n }\r\n MaybeDocument.compareByKey = function (d1, d2) {\r\n return DocumentKey.comparator(d1.key, d2.key);\r\n };\r\n return MaybeDocument;\r\n}());\r\n/**\r\n * Represents a document in Firestore with a key, version, data and whether the\r\n * data has local mutations applied to it.\r\n */\r\nvar Document = /** @class */ (function (_super) {\r\n tslib_1.__extends(Document, _super);\r\n function Document(key, version, data, options) {\r\n var _this = _super.call(this, key, version) || this;\r\n _this.data = data;\r\n _this.hasLocalMutations = !!options.hasLocalMutations;\r\n _this.hasCommittedMutations = !!options.hasCommittedMutations;\r\n return _this;\r\n }\r\n Document.prototype.field = function (path) {\r\n return this.data.field(path);\r\n };\r\n Document.prototype.fieldValue = function (path) {\r\n var field = this.field(path);\r\n return field ? field.value() : undefined;\r\n };\r\n Document.prototype.value = function () {\r\n return this.data.value();\r\n };\r\n Document.prototype.isEqual = function (other) {\r\n return (other instanceof Document &&\r\n this.key.isEqual(other.key) &&\r\n this.version.isEqual(other.version) &&\r\n this.data.isEqual(other.data) &&\r\n this.hasLocalMutations === other.hasLocalMutations &&\r\n this.hasCommittedMutations === other.hasCommittedMutations);\r\n };\r\n Document.prototype.toString = function () {\r\n return (\"Document(\" + this.key + \", \" + this.version + \", \" + this.data.toString() + \", \" +\r\n (\"{hasLocalMutations: \" + this.hasLocalMutations + \"}), \") +\r\n (\"{hasCommittedMutations: \" + this.hasCommittedMutations + \"})\"));\r\n };\r\n Object.defineProperty(Document.prototype, \"hasPendingWrites\", {\r\n get: function () {\r\n return this.hasLocalMutations || this.hasCommittedMutations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Document.compareByField = function (field, d1, d2) {\r\n var v1 = d1.field(field);\r\n var v2 = d2.field(field);\r\n if (v1 !== undefined && v2 !== undefined) {\r\n return v1.compareTo(v2);\r\n }\r\n else {\r\n return fail(\"Trying to compare documents on fields that don't exist\");\r\n }\r\n };\r\n return Document;\r\n}(MaybeDocument));\r\n/**\r\n * A class representing a deleted document.\r\n * Version is set to 0 if we don't point to any specific time, otherwise it\r\n * denotes time we know it didn't exist at.\r\n */\r\nvar NoDocument = /** @class */ (function (_super) {\r\n tslib_1.__extends(NoDocument, _super);\r\n function NoDocument(key, version, options) {\r\n var _this = _super.call(this, key, version) || this;\r\n _this.hasCommittedMutations = !!(options && options.hasCommittedMutations);\r\n return _this;\r\n }\r\n NoDocument.prototype.toString = function () {\r\n return \"NoDocument(\" + this.key + \", \" + this.version + \")\";\r\n };\r\n Object.defineProperty(NoDocument.prototype, \"hasPendingWrites\", {\r\n get: function () {\r\n return this.hasCommittedMutations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n NoDocument.prototype.isEqual = function (other) {\r\n return (other instanceof NoDocument &&\r\n other.hasCommittedMutations === this.hasCommittedMutations &&\r\n other.version.isEqual(this.version) &&\r\n other.key.isEqual(this.key));\r\n };\r\n return NoDocument;\r\n}(MaybeDocument));\r\n/**\r\n * A class representing an existing document whose data is unknown (e.g. a\r\n * document that was updated without a known base document).\r\n */\r\nvar UnknownDocument = /** @class */ (function (_super) {\r\n tslib_1.__extends(UnknownDocument, _super);\r\n function UnknownDocument(key, version) {\r\n return _super.call(this, key, version) || this;\r\n }\r\n UnknownDocument.prototype.toString = function () {\r\n return \"UnknownDocument(\" + this.key + \", \" + this.version + \")\";\r\n };\r\n Object.defineProperty(UnknownDocument.prototype, \"hasPendingWrites\", {\r\n get: function () {\r\n return true;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n UnknownDocument.prototype.isEqual = function (other) {\r\n return (other instanceof UnknownDocument &&\r\n other.version.isEqual(this.version) &&\r\n other.key.isEqual(this.key));\r\n };\r\n return UnknownDocument;\r\n}(MaybeDocument));\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\r\n// tree.\r\nvar SortedMap = /** @class */ (function () {\r\n function SortedMap(comparator, root) {\r\n this.comparator = comparator;\r\n this.root = root ? root : LLRBNode.EMPTY;\r\n }\r\n // Returns a copy of the map, with the specified key/value added or replaced.\r\n SortedMap.prototype.insert = function (key, value) {\r\n return new SortedMap(this.comparator, this.root\r\n .insert(key, value, this.comparator)\r\n .copy(null, null, LLRBNode.BLACK, null, null));\r\n };\r\n // Returns a copy of the map, with the specified key removed.\r\n SortedMap.prototype.remove = function (key) {\r\n return new SortedMap(this.comparator, this.root\r\n .remove(key, this.comparator)\r\n .copy(null, null, LLRBNode.BLACK, null, null));\r\n };\r\n // Returns the value of the node with the given key, or null.\r\n SortedMap.prototype.get = function (key) {\r\n var node = this.root;\r\n while (!node.isEmpty()) {\r\n var cmp = this.comparator(key, node.key);\r\n if (cmp === 0) {\r\n return node.value;\r\n }\r\n else if (cmp < 0) {\r\n node = node.left;\r\n }\r\n else if (cmp > 0) {\r\n node = node.right;\r\n }\r\n }\r\n return null;\r\n };\r\n // Returns the index of the element in this sorted map, or -1 if it doesn't\r\n // exist.\r\n SortedMap.prototype.indexOf = function (key) {\r\n // Number of nodes that were pruned when descending right\r\n var prunedNodes = 0;\r\n var node = this.root;\r\n while (!node.isEmpty()) {\r\n var cmp = this.comparator(key, node.key);\r\n if (cmp === 0) {\r\n return prunedNodes + node.left.size;\r\n }\r\n else if (cmp < 0) {\r\n node = node.left;\r\n }\r\n else {\r\n // Count all nodes left of the node plus the node itself\r\n prunedNodes += node.left.size + 1;\r\n node = node.right;\r\n }\r\n }\r\n // Node not found\r\n return -1;\r\n };\r\n SortedMap.prototype.isEmpty = function () {\r\n return this.root.isEmpty();\r\n };\r\n Object.defineProperty(SortedMap.prototype, \"size\", {\r\n // Returns the total number of nodes in the map.\r\n get: function () {\r\n return this.root.size;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n // Returns the minimum key in the map.\r\n SortedMap.prototype.minKey = function () {\r\n return this.root.minKey();\r\n };\r\n // Returns the maximum key in the map.\r\n SortedMap.prototype.maxKey = function () {\r\n return this.root.maxKey();\r\n };\r\n // Traverses the map in key order and calls the specified action function\r\n // for each key/value pair. If action returns true, traversal is aborted.\r\n // Returns the first truthy value returned by action, or the last falsey\r\n // value returned by action.\r\n SortedMap.prototype.inorderTraversal = function (action) {\r\n return this.root.inorderTraversal(action);\r\n };\r\n SortedMap.prototype.forEach = function (fn) {\r\n this.inorderTraversal(function (k, v) {\r\n fn(k, v);\r\n return false;\r\n });\r\n };\r\n // Traverses the map in reverse key order and calls the specified action\r\n // function for each key/value pair. If action returns true, traversal is\r\n // aborted.\r\n // Returns the first truthy value returned by action, or the last falsey\r\n // value returned by action.\r\n SortedMap.prototype.reverseTraversal = function (action) {\r\n return this.root.reverseTraversal(action);\r\n };\r\n // Returns an iterator over the SortedMap.\r\n SortedMap.prototype.getIterator = function () {\r\n return new SortedMapIterator(this.root, null, this.comparator, false);\r\n };\r\n SortedMap.prototype.getIteratorFrom = function (key) {\r\n return new SortedMapIterator(this.root, key, this.comparator, false);\r\n };\r\n SortedMap.prototype.getReverseIterator = function () {\r\n return new SortedMapIterator(this.root, null, this.comparator, true);\r\n };\r\n SortedMap.prototype.getReverseIteratorFrom = function (key) {\r\n return new SortedMapIterator(this.root, key, this.comparator, true);\r\n };\r\n SortedMap.prototype[Symbol.iterator] = function () {\r\n var it = this.getIterator();\r\n return {\r\n next: function () {\r\n if (it.hasNext()) {\r\n return { done: false, value: it.getNext() };\r\n }\r\n else {\r\n // The TypeScript typings don't allow `undefined` for Iterator,\r\n // so we return an empty object instead.\r\n return { done: true, value: {} };\r\n }\r\n }\r\n };\r\n };\r\n return SortedMap;\r\n}()); // end SortedMap\r\n// An iterator over an LLRBNode.\r\nvar SortedMapIterator = /** @class */ (function () {\r\n function SortedMapIterator(node, startKey, comparator, isReverse) {\r\n this.isReverse = isReverse;\r\n this.nodeStack = [];\r\n var cmp = 1;\r\n while (!node.isEmpty()) {\r\n cmp = startKey ? comparator(node.key, startKey) : 1;\r\n // flip the comparison if we're going in reverse\r\n if (isReverse)\r\n cmp *= -1;\r\n if (cmp < 0) {\r\n // This node is less than our start key. ignore it\r\n if (this.isReverse) {\r\n node = node.left;\r\n }\r\n else {\r\n node = node.right;\r\n }\r\n }\r\n else if (cmp === 0) {\r\n // This node is exactly equal to our start key. Push it on the stack,\r\n // but stop iterating;\r\n this.nodeStack.push(node);\r\n break;\r\n }\r\n else {\r\n // This node is greater than our start key, add it to the stack and move\r\n // to the next one\r\n this.nodeStack.push(node);\r\n if (this.isReverse) {\r\n node = node.right;\r\n }\r\n else {\r\n node = node.left;\r\n }\r\n }\r\n }\r\n }\r\n SortedMapIterator.prototype.getNext = function () {\r\n assert(this.nodeStack.length > 0, 'getNext() called on iterator when hasNext() is false.');\r\n var node = this.nodeStack.pop();\r\n var result = { key: node.key, value: node.value };\r\n if (this.isReverse) {\r\n node = node.left;\r\n while (!node.isEmpty()) {\r\n this.nodeStack.push(node);\r\n node = node.right;\r\n }\r\n }\r\n else {\r\n node = node.right;\r\n while (!node.isEmpty()) {\r\n this.nodeStack.push(node);\r\n node = node.left;\r\n }\r\n }\r\n return result;\r\n };\r\n SortedMapIterator.prototype.hasNext = function () {\r\n return this.nodeStack.length > 0;\r\n };\r\n SortedMapIterator.prototype.peek = function () {\r\n if (this.nodeStack.length === 0)\r\n return null;\r\n var node = this.nodeStack[this.nodeStack.length - 1];\r\n return { key: node.key, value: node.value };\r\n };\r\n return SortedMapIterator;\r\n}()); // end SortedMapIterator\r\n// Represents a node in a Left-leaning Red-Black tree.\r\nvar LLRBNode = /** @class */ (function () {\r\n function LLRBNode(key, value, color, left, right) {\r\n this.key = key;\r\n this.value = value;\r\n this.color = color != null ? color : LLRBNode.RED;\r\n this.left = left != null ? left : LLRBNode.EMPTY;\r\n this.right = right != null ? right : LLRBNode.EMPTY;\r\n this.size = this.left.size + 1 + this.right.size;\r\n }\r\n // Returns a copy of the current node, optionally replacing pieces of it.\r\n LLRBNode.prototype.copy = function (key, value, color, left, right) {\r\n return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right);\r\n };\r\n LLRBNode.prototype.isEmpty = function () {\r\n return false;\r\n };\r\n // Traverses the tree in key order and calls the specified action function\r\n // for each node. If action returns true, traversal is aborted.\r\n // Returns the first truthy value returned by action, or the last falsey\r\n // value returned by action.\r\n LLRBNode.prototype.inorderTraversal = function (action) {\r\n return (this.left.inorderTraversal(action) ||\r\n action(this.key, this.value) ||\r\n this.right.inorderTraversal(action));\r\n };\r\n // Traverses the tree in reverse key order and calls the specified action\r\n // function for each node. If action returns true, traversal is aborted.\r\n // Returns the first truthy value returned by action, or the last falsey\r\n // value returned by action.\r\n LLRBNode.prototype.reverseTraversal = function (action) {\r\n return (this.right.reverseTraversal(action) ||\r\n action(this.key, this.value) ||\r\n this.left.reverseTraversal(action));\r\n };\r\n // Returns the minimum node in the tree.\r\n LLRBNode.prototype.min = function () {\r\n if (this.left.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n return this.left.min();\r\n }\r\n };\r\n // Returns the maximum key in the tree.\r\n LLRBNode.prototype.minKey = function () {\r\n return this.min().key;\r\n };\r\n // Returns the maximum key in the tree.\r\n LLRBNode.prototype.maxKey = function () {\r\n if (this.right.isEmpty()) {\r\n return this.key;\r\n }\r\n else {\r\n return this.right.maxKey();\r\n }\r\n };\r\n // Returns new tree, with the key/value added.\r\n LLRBNode.prototype.insert = function (key, value, comparator) {\r\n var n = this;\r\n var cmp = comparator(key, n.key);\r\n if (cmp < 0) {\r\n n = n.copy(null, null, null, n.left.insert(key, value, comparator), null);\r\n }\r\n else if (cmp === 0) {\r\n n = n.copy(null, value, null, null, null);\r\n }\r\n else {\r\n n = n.copy(null, null, null, null, n.right.insert(key, value, comparator));\r\n }\r\n return n.fixUp();\r\n };\r\n LLRBNode.prototype.removeMin = function () {\r\n if (this.left.isEmpty()) {\r\n return LLRBNode.EMPTY;\r\n }\r\n var n = this;\r\n if (!n.left.isRed() && !n.left.left.isRed())\r\n n = n.moveRedLeft();\r\n n = n.copy(null, null, null, n.left.removeMin(), null);\r\n return n.fixUp();\r\n };\r\n // Returns new tree, with the specified item removed.\r\n LLRBNode.prototype.remove = function (key, comparator) {\r\n var smallest;\r\n var n = this;\r\n if (comparator(key, n.key) < 0) {\r\n if (!n.left.isEmpty() && !n.left.isRed() && !n.left.left.isRed()) {\r\n n = n.moveRedLeft();\r\n }\r\n n = n.copy(null, null, null, n.left.remove(key, comparator), null);\r\n }\r\n else {\r\n if (n.left.isRed())\r\n n = n.rotateRight();\r\n if (!n.right.isEmpty() && !n.right.isRed() && !n.right.left.isRed()) {\r\n n = n.moveRedRight();\r\n }\r\n if (comparator(key, n.key) === 0) {\r\n if (n.right.isEmpty()) {\r\n return LLRBNode.EMPTY;\r\n }\r\n else {\r\n smallest = n.right.min();\r\n n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin());\r\n }\r\n }\r\n n = n.copy(null, null, null, null, n.right.remove(key, comparator));\r\n }\r\n return n.fixUp();\r\n };\r\n LLRBNode.prototype.isRed = function () {\r\n return this.color;\r\n };\r\n // Returns new tree after performing any needed rotations.\r\n LLRBNode.prototype.fixUp = function () {\r\n var n = this;\r\n if (n.right.isRed() && !n.left.isRed())\r\n n = n.rotateLeft();\r\n if (n.left.isRed() && n.left.left.isRed())\r\n n = n.rotateRight();\r\n if (n.left.isRed() && n.right.isRed())\r\n n = n.colorFlip();\r\n return n;\r\n };\r\n LLRBNode.prototype.moveRedLeft = function () {\r\n var n = this.colorFlip();\r\n if (n.right.left.isRed()) {\r\n n = n.copy(null, null, null, null, n.right.rotateRight());\r\n n = n.rotateLeft();\r\n n = n.colorFlip();\r\n }\r\n return n;\r\n };\r\n LLRBNode.prototype.moveRedRight = function () {\r\n var n = this.colorFlip();\r\n if (n.left.left.isRed()) {\r\n n = n.rotateRight();\r\n n = n.colorFlip();\r\n }\r\n return n;\r\n };\r\n LLRBNode.prototype.rotateLeft = function () {\r\n var nl = this.copy(null, null, LLRBNode.RED, null, this.right.left);\r\n return this.right.copy(null, null, this.color, nl, null);\r\n };\r\n LLRBNode.prototype.rotateRight = function () {\r\n var nr = this.copy(null, null, LLRBNode.RED, this.left.right, null);\r\n return this.left.copy(null, null, this.color, null, nr);\r\n };\r\n LLRBNode.prototype.colorFlip = function () {\r\n var left = this.left.copy(null, null, !this.left.color, null, null);\r\n var right = this.right.copy(null, null, !this.right.color, null, null);\r\n return this.copy(null, null, !this.color, left, right);\r\n };\r\n // For testing.\r\n LLRBNode.prototype.checkMaxDepth = function () {\r\n var blackDepth = this.check();\r\n if (Math.pow(2.0, blackDepth) <= this.size + 1) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n // In a balanced RB tree, the black-depth (number of black nodes) from root to\r\n // leaves is equal on both sides. This function verifies that or asserts.\r\n LLRBNode.prototype.check = function () {\r\n if (this.isRed() && this.left.isRed()) {\r\n throw fail('Red node has red child(' + this.key + ',' + this.value + ')');\r\n }\r\n if (this.right.isRed()) {\r\n throw fail('Right child of (' + this.key + ',' + this.value + ') is red');\r\n }\r\n var blackDepth = this.left.check();\r\n if (blackDepth !== this.right.check()) {\r\n throw fail('Black depths differ');\r\n }\r\n else {\r\n return blackDepth + (this.isRed() ? 0 : 1);\r\n }\r\n };\r\n // tslint:disable-next-line:no-any Empty node is shared between all LLRB trees.\r\n LLRBNode.EMPTY = null;\r\n LLRBNode.RED = true;\r\n LLRBNode.BLACK = false;\r\n return LLRBNode;\r\n}()); // end LLRBNode\r\n// Represents an empty node (a leaf node in the Red-Black Tree).\r\nvar LLRBEmptyNode = /** @class */ (function () {\r\n function LLRBEmptyNode() {\r\n this.size = 0;\r\n }\r\n // Returns a copy of the current node.\r\n LLRBEmptyNode.prototype.copy = function (key, value, color, left, right) {\r\n return this;\r\n };\r\n // Returns a copy of the tree, with the specified key/value added.\r\n LLRBEmptyNode.prototype.insert = function (key, value, comparator) {\r\n return new LLRBNode(key, value);\r\n };\r\n // Returns a copy of the tree, with the specified key removed.\r\n LLRBEmptyNode.prototype.remove = function (key, comparator) {\r\n return this;\r\n };\r\n LLRBEmptyNode.prototype.isEmpty = function () {\r\n return true;\r\n };\r\n LLRBEmptyNode.prototype.inorderTraversal = function (action) {\r\n return false;\r\n };\r\n LLRBEmptyNode.prototype.reverseTraversal = function (action) {\r\n return false;\r\n };\r\n LLRBEmptyNode.prototype.minKey = function () {\r\n return null;\r\n };\r\n LLRBEmptyNode.prototype.maxKey = function () {\r\n return null;\r\n };\r\n LLRBEmptyNode.prototype.isRed = function () {\r\n return false;\r\n };\r\n // For testing.\r\n LLRBEmptyNode.prototype.checkMaxDepth = function () {\r\n return true;\r\n };\r\n LLRBEmptyNode.prototype.check = function () {\r\n return 0;\r\n };\r\n return LLRBEmptyNode;\r\n}()); // end LLRBEmptyNode\r\nLLRBNode.EMPTY = new LLRBEmptyNode();\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar TypeOrder;\r\n(function (TypeOrder) {\r\n // This order is defined by the backend.\r\n TypeOrder[TypeOrder[\"NullValue\"] = 0] = \"NullValue\";\r\n TypeOrder[TypeOrder[\"BooleanValue\"] = 1] = \"BooleanValue\";\r\n TypeOrder[TypeOrder[\"NumberValue\"] = 2] = \"NumberValue\";\r\n TypeOrder[TypeOrder[\"TimestampValue\"] = 3] = \"TimestampValue\";\r\n TypeOrder[TypeOrder[\"StringValue\"] = 4] = \"StringValue\";\r\n TypeOrder[TypeOrder[\"BlobValue\"] = 5] = \"BlobValue\";\r\n TypeOrder[TypeOrder[\"RefValue\"] = 6] = \"RefValue\";\r\n TypeOrder[TypeOrder[\"GeoPointValue\"] = 7] = \"GeoPointValue\";\r\n TypeOrder[TypeOrder[\"ArrayValue\"] = 8] = \"ArrayValue\";\r\n TypeOrder[TypeOrder[\"ObjectValue\"] = 9] = \"ObjectValue\";\r\n})(TypeOrder || (TypeOrder = {}));\r\n/** Defines the return value for pending server timestamps. */\r\nvar ServerTimestampBehavior;\r\n(function (ServerTimestampBehavior) {\r\n ServerTimestampBehavior[ServerTimestampBehavior[\"Default\"] = 0] = \"Default\";\r\n ServerTimestampBehavior[ServerTimestampBehavior[\"Estimate\"] = 1] = \"Estimate\";\r\n ServerTimestampBehavior[ServerTimestampBehavior[\"Previous\"] = 2] = \"Previous\";\r\n})(ServerTimestampBehavior || (ServerTimestampBehavior = {}));\r\n/** Holds properties that define field value deserialization options. */\r\nvar FieldValueOptions = /** @class */ (function () {\r\n function FieldValueOptions(serverTimestampBehavior, timestampsInSnapshots) {\r\n this.serverTimestampBehavior = serverTimestampBehavior;\r\n this.timestampsInSnapshots = timestampsInSnapshots;\r\n }\r\n FieldValueOptions.fromSnapshotOptions = function (options, timestampsInSnapshots) {\r\n switch (options.serverTimestamps) {\r\n case 'estimate':\r\n return new FieldValueOptions(ServerTimestampBehavior.Estimate, timestampsInSnapshots);\r\n case 'previous':\r\n return new FieldValueOptions(ServerTimestampBehavior.Previous, timestampsInSnapshots);\r\n case 'none': // Fall-through intended.\r\n case undefined:\r\n return new FieldValueOptions(ServerTimestampBehavior.Default, timestampsInSnapshots);\r\n default:\r\n return fail('fromSnapshotOptions() called with invalid options.');\r\n }\r\n };\r\n return FieldValueOptions;\r\n}());\r\n/**\r\n * A field value represents a datatype as stored by Firestore.\r\n */\r\nvar FieldValue = /** @class */ (function () {\r\n function FieldValue() {\r\n }\r\n FieldValue.prototype.toString = function () {\r\n var val = this.value();\r\n return val === null ? 'null' : val.toString();\r\n };\r\n FieldValue.prototype.defaultCompareTo = function (other) {\r\n assert(this.typeOrder !== other.typeOrder, 'Default compareTo should not be used for values of same type.');\r\n var cmp = primitiveComparator(this.typeOrder, other.typeOrder);\r\n return cmp;\r\n };\r\n return FieldValue;\r\n}());\r\nvar NullValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(NullValue, _super);\r\n function NullValue() {\r\n var _this = _super.call(this) || this;\r\n _this.typeOrder = TypeOrder.NullValue;\r\n // internalValue is unused but we add it to work around\r\n // https://github.com/Microsoft/TypeScript/issues/15585\r\n _this.internalValue = null;\r\n return _this;\r\n }\r\n NullValue.prototype.value = function (options) {\r\n return null;\r\n };\r\n NullValue.prototype.isEqual = function (other) {\r\n return other instanceof NullValue;\r\n };\r\n NullValue.prototype.compareTo = function (other) {\r\n if (other instanceof NullValue) {\r\n return 0;\r\n }\r\n return this.defaultCompareTo(other);\r\n };\r\n NullValue.INSTANCE = new NullValue();\r\n return NullValue;\r\n}(FieldValue));\r\nvar BooleanValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(BooleanValue, _super);\r\n function BooleanValue(internalValue) {\r\n var _this = _super.call(this) || this;\r\n _this.internalValue = internalValue;\r\n _this.typeOrder = TypeOrder.BooleanValue;\r\n return _this;\r\n }\r\n BooleanValue.prototype.value = function (options) {\r\n return this.internalValue;\r\n };\r\n BooleanValue.prototype.isEqual = function (other) {\r\n return (other instanceof BooleanValue &&\r\n this.internalValue === other.internalValue);\r\n };\r\n BooleanValue.prototype.compareTo = function (other) {\r\n if (other instanceof BooleanValue) {\r\n return primitiveComparator(this, other);\r\n }\r\n return this.defaultCompareTo(other);\r\n };\r\n BooleanValue.of = function (value) {\r\n return value ? BooleanValue.TRUE : BooleanValue.FALSE;\r\n };\r\n BooleanValue.TRUE = new BooleanValue(true);\r\n BooleanValue.FALSE = new BooleanValue(false);\r\n return BooleanValue;\r\n}(FieldValue));\r\n/** Base class for IntegerValue and DoubleValue. */\r\nvar NumberValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(NumberValue, _super);\r\n function NumberValue(internalValue) {\r\n var _this = _super.call(this) || this;\r\n _this.internalValue = internalValue;\r\n _this.typeOrder = TypeOrder.NumberValue;\r\n return _this;\r\n }\r\n NumberValue.prototype.value = function (options) {\r\n return this.internalValue;\r\n };\r\n NumberValue.prototype.compareTo = function (other) {\r\n if (other instanceof NumberValue) {\r\n return numericComparator(this.internalValue, other.internalValue);\r\n }\r\n return this.defaultCompareTo(other);\r\n };\r\n return NumberValue;\r\n}(FieldValue));\r\n/** Utility function to compare doubles (using Firestore semantics for NaN). */\r\nfunction numericComparator(left, right) {\r\n if (left < right) {\r\n return -1;\r\n }\r\n else if (left > right) {\r\n return 1;\r\n }\r\n else if (left === right) {\r\n return 0;\r\n }\r\n else {\r\n // one or both are NaN.\r\n if (isNaN(left)) {\r\n return isNaN(right) ? 0 : -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n}\r\n/**\r\n * Utility function to check numbers for equality using Firestore semantics\r\n * (NaN === NaN, -0.0 !== 0.0).\r\n */\r\nfunction numericEquals(left, right) {\r\n // Implemented based on Object.is() polyfill from\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\r\n if (left === right) {\r\n // +0 != -0\r\n return left !== 0 || 1 / left === 1 / right;\r\n }\r\n else {\r\n // NaN == NaN\r\n return left !== left && right !== right;\r\n }\r\n}\r\nvar IntegerValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(IntegerValue, _super);\r\n function IntegerValue(internalValue) {\r\n return _super.call(this, internalValue) || this;\r\n }\r\n IntegerValue.prototype.isEqual = function (other) {\r\n // NOTE: DoubleValue and IntegerValue instances may compareTo() the same,\r\n // but that doesn't make them equal via isEqual().\r\n if (other instanceof IntegerValue) {\r\n return numericEquals(this.internalValue, other.internalValue);\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n return IntegerValue;\r\n}(NumberValue));\r\nvar DoubleValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(DoubleValue, _super);\r\n function DoubleValue(internalValue) {\r\n var _this = _super.call(this, internalValue) || this;\r\n _this.internalValue = internalValue;\r\n return _this;\r\n }\r\n DoubleValue.prototype.isEqual = function (other) {\r\n // NOTE: DoubleValue and IntegerValue instances may compareTo() the same,\r\n // but that doesn't make them equal via isEqual().\r\n if (other instanceof DoubleValue) {\r\n return numericEquals(this.internalValue, other.internalValue);\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n DoubleValue.NAN = new DoubleValue(NaN);\r\n DoubleValue.POSITIVE_INFINITY = new DoubleValue(Infinity);\r\n DoubleValue.NEGATIVE_INFINITY = new DoubleValue(-Infinity);\r\n return DoubleValue;\r\n}(NumberValue));\r\n// TODO(b/37267885): Add truncation support\r\nvar StringValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(StringValue, _super);\r\n function StringValue(internalValue) {\r\n var _this = _super.call(this) || this;\r\n _this.internalValue = internalValue;\r\n _this.typeOrder = TypeOrder.StringValue;\r\n return _this;\r\n }\r\n StringValue.prototype.value = function (options) {\r\n return this.internalValue;\r\n };\r\n StringValue.prototype.isEqual = function (other) {\r\n return (other instanceof StringValue && this.internalValue === other.internalValue);\r\n };\r\n StringValue.prototype.compareTo = function (other) {\r\n if (other instanceof StringValue) {\r\n return primitiveComparator(this.internalValue, other.internalValue);\r\n }\r\n return this.defaultCompareTo(other);\r\n };\r\n return StringValue;\r\n}(FieldValue));\r\nvar TimestampValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(TimestampValue, _super);\r\n function TimestampValue(internalValue) {\r\n var _this = _super.call(this) || this;\r\n _this.internalValue = internalValue;\r\n _this.typeOrder = TypeOrder.TimestampValue;\r\n return _this;\r\n }\r\n TimestampValue.prototype.value = function (options) {\r\n if (options && options.timestampsInSnapshots) {\r\n return this.internalValue;\r\n }\r\n else {\r\n return this.internalValue.toDate();\r\n }\r\n };\r\n TimestampValue.prototype.isEqual = function (other) {\r\n return (other instanceof TimestampValue &&\r\n this.internalValue.isEqual(other.internalValue));\r\n };\r\n TimestampValue.prototype.compareTo = function (other) {\r\n if (other instanceof TimestampValue) {\r\n return this.internalValue._compareTo(other.internalValue);\r\n }\r\n else if (other instanceof ServerTimestampValue) {\r\n // Concrete timestamps come before server timestamps.\r\n return -1;\r\n }\r\n else {\r\n return this.defaultCompareTo(other);\r\n }\r\n };\r\n return TimestampValue;\r\n}(FieldValue));\r\n/**\r\n * Represents a locally-applied ServerTimestamp.\r\n *\r\n * Notes:\r\n * - ServerTimestampValue instances are created as the result of applying a\r\n * TransformMutation (see TransformMutation.applyTo()). They can only exist in\r\n * the local view of a document. Therefore they do not need to be parsed or\r\n * serialized.\r\n * - When evaluated locally (e.g. for snapshot.data()), they by default\r\n * evaluate to `null`. This behavior can be configured by passing custom\r\n * FieldValueOptions to value().\r\n * - With respect to other ServerTimestampValues, they sort by their\r\n * localWriteTime.\r\n */\r\nvar ServerTimestampValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(ServerTimestampValue, _super);\r\n function ServerTimestampValue(localWriteTime, previousValue) {\r\n var _this = _super.call(this) || this;\r\n _this.localWriteTime = localWriteTime;\r\n _this.previousValue = previousValue;\r\n _this.typeOrder = TypeOrder.TimestampValue;\r\n return _this;\r\n }\r\n ServerTimestampValue.prototype.value = function (options) {\r\n if (options &&\r\n options.serverTimestampBehavior === ServerTimestampBehavior.Estimate) {\r\n return new TimestampValue(this.localWriteTime).value(options);\r\n }\r\n else if (options &&\r\n options.serverTimestampBehavior === ServerTimestampBehavior.Previous) {\r\n return this.previousValue ? this.previousValue.value(options) : null;\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n ServerTimestampValue.prototype.isEqual = function (other) {\r\n return (other instanceof ServerTimestampValue &&\r\n this.localWriteTime.isEqual(other.localWriteTime));\r\n };\r\n ServerTimestampValue.prototype.compareTo = function (other) {\r\n if (other instanceof ServerTimestampValue) {\r\n return this.localWriteTime._compareTo(other.localWriteTime);\r\n }\r\n else if (other instanceof TimestampValue) {\r\n // Server timestamps come after all concrete timestamps.\r\n return 1;\r\n }\r\n else {\r\n return this.defaultCompareTo(other);\r\n }\r\n };\r\n ServerTimestampValue.prototype.toString = function () {\r\n return '';\r\n };\r\n return ServerTimestampValue;\r\n}(FieldValue));\r\nvar BlobValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(BlobValue, _super);\r\n function BlobValue(internalValue) {\r\n var _this = _super.call(this) || this;\r\n _this.internalValue = internalValue;\r\n _this.typeOrder = TypeOrder.BlobValue;\r\n return _this;\r\n }\r\n BlobValue.prototype.value = function (options) {\r\n return this.internalValue;\r\n };\r\n BlobValue.prototype.isEqual = function (other) {\r\n return (other instanceof BlobValue &&\r\n this.internalValue.isEqual(other.internalValue));\r\n };\r\n BlobValue.prototype.compareTo = function (other) {\r\n if (other instanceof BlobValue) {\r\n return this.internalValue._compareTo(other.internalValue);\r\n }\r\n return this.defaultCompareTo(other);\r\n };\r\n return BlobValue;\r\n}(FieldValue));\r\nvar RefValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(RefValue, _super);\r\n function RefValue(databaseId, key) {\r\n var _this = _super.call(this) || this;\r\n _this.databaseId = databaseId;\r\n _this.key = key;\r\n _this.typeOrder = TypeOrder.RefValue;\r\n return _this;\r\n }\r\n RefValue.prototype.value = function (options) {\r\n return this.key;\r\n };\r\n RefValue.prototype.isEqual = function (other) {\r\n if (other instanceof RefValue) {\r\n return (this.key.isEqual(other.key) && this.databaseId.isEqual(other.databaseId));\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n RefValue.prototype.compareTo = function (other) {\r\n if (other instanceof RefValue) {\r\n var cmp = this.databaseId.compareTo(other.databaseId);\r\n return cmp !== 0 ? cmp : DocumentKey.comparator(this.key, other.key);\r\n }\r\n return this.defaultCompareTo(other);\r\n };\r\n return RefValue;\r\n}(FieldValue));\r\nvar GeoPointValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(GeoPointValue, _super);\r\n function GeoPointValue(internalValue) {\r\n var _this = _super.call(this) || this;\r\n _this.internalValue = internalValue;\r\n _this.typeOrder = TypeOrder.GeoPointValue;\r\n return _this;\r\n }\r\n GeoPointValue.prototype.value = function (options) {\r\n return this.internalValue;\r\n };\r\n GeoPointValue.prototype.isEqual = function (other) {\r\n return (other instanceof GeoPointValue &&\r\n this.internalValue.isEqual(other.internalValue));\r\n };\r\n GeoPointValue.prototype.compareTo = function (other) {\r\n if (other instanceof GeoPointValue) {\r\n return this.internalValue._compareTo(other.internalValue);\r\n }\r\n return this.defaultCompareTo(other);\r\n };\r\n return GeoPointValue;\r\n}(FieldValue));\r\nvar ObjectValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(ObjectValue, _super);\r\n function ObjectValue(internalValue) {\r\n var _this = _super.call(this) || this;\r\n _this.internalValue = internalValue;\r\n _this.typeOrder = TypeOrder.ObjectValue;\r\n return _this;\r\n }\r\n ObjectValue.prototype.value = function (options) {\r\n var result = {};\r\n this.internalValue.inorderTraversal(function (key, val) {\r\n result[key] = val.value(options);\r\n });\r\n return result;\r\n };\r\n ObjectValue.prototype.forEach = function (action) {\r\n this.internalValue.inorderTraversal(action);\r\n };\r\n ObjectValue.prototype.isEqual = function (other) {\r\n if (other instanceof ObjectValue) {\r\n var it1 = this.internalValue.getIterator();\r\n var it2 = other.internalValue.getIterator();\r\n while (it1.hasNext() && it2.hasNext()) {\r\n var next1 = it1.getNext();\r\n var next2 = it2.getNext();\r\n if (next1.key !== next2.key || !next1.value.isEqual(next2.value)) {\r\n return false;\r\n }\r\n }\r\n return !it1.hasNext() && !it2.hasNext();\r\n }\r\n return false;\r\n };\r\n ObjectValue.prototype.compareTo = function (other) {\r\n if (other instanceof ObjectValue) {\r\n var it1 = this.internalValue.getIterator();\r\n var it2 = other.internalValue.getIterator();\r\n while (it1.hasNext() && it2.hasNext()) {\r\n var next1 = it1.getNext();\r\n var next2 = it2.getNext();\r\n var cmp = primitiveComparator(next1.key, next2.key) ||\r\n next1.value.compareTo(next2.value);\r\n if (cmp) {\r\n return cmp;\r\n }\r\n }\r\n // Only equal if both iterators are exhausted\r\n return primitiveComparator(it1.hasNext(), it2.hasNext());\r\n }\r\n else {\r\n return this.defaultCompareTo(other);\r\n }\r\n };\r\n ObjectValue.prototype.set = function (path, to) {\r\n assert(!path.isEmpty(), 'Cannot set field for empty path on ObjectValue');\r\n if (path.length === 1) {\r\n return this.setChild(path.firstSegment(), to);\r\n }\r\n else {\r\n var child = this.child(path.firstSegment());\r\n if (!(child instanceof ObjectValue)) {\r\n child = ObjectValue.EMPTY;\r\n }\r\n var newChild = child.set(path.popFirst(), to);\r\n return this.setChild(path.firstSegment(), newChild);\r\n }\r\n };\r\n ObjectValue.prototype.delete = function (path) {\r\n assert(!path.isEmpty(), 'Cannot delete field for empty path on ObjectValue');\r\n if (path.length === 1) {\r\n return new ObjectValue(this.internalValue.remove(path.firstSegment()));\r\n }\r\n else {\r\n // nested field\r\n var child = this.child(path.firstSegment());\r\n if (child instanceof ObjectValue) {\r\n var newChild = child.delete(path.popFirst());\r\n return new ObjectValue(this.internalValue.insert(path.firstSegment(), newChild));\r\n }\r\n else {\r\n // Don't actually change a primitive value to an object for a delete\r\n return this;\r\n }\r\n }\r\n };\r\n ObjectValue.prototype.contains = function (path) {\r\n return this.field(path) !== undefined;\r\n };\r\n ObjectValue.prototype.field = function (path) {\r\n assert(!path.isEmpty(), \"Can't get field of empty path\");\r\n var field = this;\r\n path.forEach(function (pathSegment) {\r\n if (field instanceof ObjectValue) {\r\n field = field.internalValue.get(pathSegment) || undefined;\r\n }\r\n else {\r\n field = undefined;\r\n }\r\n });\r\n return field;\r\n };\r\n ObjectValue.prototype.toString = function () {\r\n return JSON.stringify(this.value());\r\n };\r\n ObjectValue.prototype.child = function (childName) {\r\n return this.internalValue.get(childName) || undefined;\r\n };\r\n ObjectValue.prototype.setChild = function (childName, value) {\r\n return new ObjectValue(this.internalValue.insert(childName, value));\r\n };\r\n ObjectValue.EMPTY = new ObjectValue(new SortedMap(primitiveComparator));\r\n return ObjectValue;\r\n}(FieldValue));\r\nvar ArrayValue = /** @class */ (function (_super) {\r\n tslib_1.__extends(ArrayValue, _super);\r\n function ArrayValue(internalValue) {\r\n var _this = _super.call(this) || this;\r\n _this.internalValue = internalValue;\r\n _this.typeOrder = TypeOrder.ArrayValue;\r\n return _this;\r\n }\r\n ArrayValue.prototype.value = function (options) {\r\n return this.internalValue.map(function (v) { return v.value(options); });\r\n };\r\n ArrayValue.prototype.forEach = function (action) {\r\n this.internalValue.forEach(action);\r\n };\r\n ArrayValue.prototype.isEqual = function (other) {\r\n if (other instanceof ArrayValue) {\r\n if (this.internalValue.length !== other.internalValue.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < this.internalValue.length; i++) {\r\n if (!this.internalValue[i].isEqual(other.internalValue[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n ArrayValue.prototype.compareTo = function (other) {\r\n if (other instanceof ArrayValue) {\r\n var minLength = Math.min(this.internalValue.length, other.internalValue.length);\r\n for (var i = 0; i < minLength; i++) {\r\n var cmp = this.internalValue[i].compareTo(other.internalValue[i]);\r\n if (cmp) {\r\n return cmp;\r\n }\r\n }\r\n return primitiveComparator(this.internalValue.length, other.internalValue.length);\r\n }\r\n else {\r\n return this.defaultCompareTo(other);\r\n }\r\n };\r\n ArrayValue.prototype.toString = function () {\r\n return JSON.stringify(this.value());\r\n };\r\n return ArrayValue;\r\n}(FieldValue));\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Untyped Number alias we can use to check for ES6 methods / properties.\r\n// tslint:disable-next-line:no-any variable-name\r\nvar NumberAsAny = Number;\r\n/**\r\n * Minimum safe integer in Javascript because of floating point precision.\r\n * Added to not rely on ES6 features.\r\n */\r\nvar MIN_SAFE_INTEGER = NumberAsAny.MIN_SAFE_INTEGER || -(Math.pow(2, 53) - 1);\r\n/**\r\n * Maximum safe integer in Javascript because of floating point precision.\r\n * Added to not rely on ES6 features.\r\n */\r\nvar MAX_SAFE_INTEGER = NumberAsAny.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;\r\n/**\r\n * Returns whether an number is an integer, uses native implementation if\r\n * available.\r\n * Added to not rely on ES6 features.\r\n * @param value The value to test for being an integer\r\n */\r\nvar isInteger = NumberAsAny.isInteger ||\r\n (function (value) {\r\n return typeof value === 'number' &&\r\n isFinite(value) &&\r\n Math.floor(value) === value;\r\n });\r\n/**\r\n * Returns whether a variable is either undefined or null.\r\n */\r\nfunction isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}\r\n/**\r\n * Returns whether a value is an integer and in the safe integer range\r\n * @param value The value to test for being an integer and in the safe range\r\n */\r\nfunction isSafeInteger(value) {\r\n return (isInteger(value) &&\r\n value <= MAX_SAFE_INTEGER &&\r\n value >= MIN_SAFE_INTEGER);\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Query = /** @class */ (function () {\r\n function Query(path, explicitOrderBy, filters, limit, startAt, endAt) {\r\n if (explicitOrderBy === void 0) { explicitOrderBy = []; }\r\n if (filters === void 0) { filters = []; }\r\n if (limit === void 0) { limit = null; }\r\n if (startAt === void 0) { startAt = null; }\r\n if (endAt === void 0) { endAt = null; }\r\n this.path = path;\r\n this.explicitOrderBy = explicitOrderBy;\r\n this.filters = filters;\r\n this.limit = limit;\r\n this.startAt = startAt;\r\n this.endAt = endAt;\r\n this.memoizedCanonicalId = null;\r\n this.memoizedOrderBy = null;\r\n if (this.startAt) {\r\n this.assertValidBound(this.startAt);\r\n }\r\n if (this.endAt) {\r\n this.assertValidBound(this.endAt);\r\n }\r\n }\r\n Query.atPath = function (path) {\r\n return new Query(path);\r\n };\r\n Object.defineProperty(Query.prototype, \"orderBy\", {\r\n get: function () {\r\n if (this.memoizedOrderBy === null) {\r\n var inequalityField = this.getInequalityFilterField();\r\n var firstOrderByField = this.getFirstOrderByField();\r\n if (inequalityField !== null && firstOrderByField === null) {\r\n // In order to implicitly add key ordering, we must also add the\r\n // inequality filter field for it to be a valid query.\r\n // Note that the default inequality field and key ordering is ascending.\r\n if (inequalityField.isKeyField()) {\r\n this.memoizedOrderBy = [KEY_ORDERING_ASC];\r\n }\r\n else {\r\n this.memoizedOrderBy = [\r\n new OrderBy(inequalityField),\r\n KEY_ORDERING_ASC\r\n ];\r\n }\r\n }\r\n else {\r\n assert(inequalityField === null ||\r\n (firstOrderByField !== null &&\r\n inequalityField.isEqual(firstOrderByField)), 'First orderBy should match inequality field.');\r\n this.memoizedOrderBy = [];\r\n var foundKeyOrdering = false;\r\n for (var _i = 0, _a = this.explicitOrderBy; _i < _a.length; _i++) {\r\n var orderBy = _a[_i];\r\n this.memoizedOrderBy.push(orderBy);\r\n if (orderBy.field.isKeyField()) {\r\n foundKeyOrdering = true;\r\n }\r\n }\r\n if (!foundKeyOrdering) {\r\n // The order of the implicit key ordering always matches the last\r\n // explicit order by\r\n var lastDirection = this.explicitOrderBy.length > 0\r\n ? this.explicitOrderBy[this.explicitOrderBy.length - 1].dir\r\n : Direction.ASCENDING;\r\n this.memoizedOrderBy.push(lastDirection === Direction.ASCENDING\r\n ? KEY_ORDERING_ASC\r\n : KEY_ORDERING_DESC);\r\n }\r\n }\r\n }\r\n return this.memoizedOrderBy;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Query.prototype.addFilter = function (filter) {\r\n assert(this.getInequalityFilterField() == null ||\r\n !(filter instanceof RelationFilter) ||\r\n !filter.isInequality() ||\r\n filter.field.isEqual(this.getInequalityFilterField()), 'Query must only have one inequality field.');\r\n assert(!DocumentKey.isDocumentKey(this.path), 'No filtering allowed for document query');\r\n var newFilters = this.filters.concat([filter]);\r\n return new Query(this.path, this.explicitOrderBy.slice(), newFilters, this.limit, this.startAt, this.endAt);\r\n };\r\n Query.prototype.addOrderBy = function (orderBy) {\r\n assert(!DocumentKey.isDocumentKey(this.path), 'No ordering allowed for document query');\r\n assert(!this.startAt && !this.endAt, 'Bounds must be set after orderBy');\r\n // TODO(dimond): validate that orderBy does not list the same key twice.\r\n var newOrderBy = this.explicitOrderBy.concat([orderBy]);\r\n return new Query(this.path, newOrderBy, this.filters.slice(), this.limit, this.startAt, this.endAt);\r\n };\r\n Query.prototype.withLimit = function (limit) {\r\n return new Query(this.path, this.explicitOrderBy.slice(), this.filters.slice(), limit, this.startAt, this.endAt);\r\n };\r\n Query.prototype.withStartAt = function (bound) {\r\n return new Query(this.path, this.explicitOrderBy.slice(), this.filters.slice(), this.limit, bound, this.endAt);\r\n };\r\n Query.prototype.withEndAt = function (bound) {\r\n return new Query(this.path, this.explicitOrderBy.slice(), this.filters.slice(), this.limit, this.startAt, bound);\r\n };\r\n // TODO(b/29183165): This is used to get a unique string from a query to, for\r\n // example, use as a dictionary key, but the implementation is subject to\r\n // collisions. Make it collision-free.\r\n Query.prototype.canonicalId = function () {\r\n if (this.memoizedCanonicalId === null) {\r\n var canonicalId = this.path.canonicalString();\r\n canonicalId += '|f:';\r\n for (var _i = 0, _a = this.filters; _i < _a.length; _i++) {\r\n var filter = _a[_i];\r\n canonicalId += filter.canonicalId();\r\n canonicalId += ',';\r\n }\r\n canonicalId += '|ob:';\r\n // TODO(dimond): make this collision resistant\r\n for (var _b = 0, _c = this.orderBy; _b < _c.length; _b++) {\r\n var orderBy = _c[_b];\r\n canonicalId += orderBy.canonicalId();\r\n canonicalId += ',';\r\n }\r\n if (!isNullOrUndefined(this.limit)) {\r\n canonicalId += '|l:';\r\n canonicalId += this.limit;\r\n }\r\n if (this.startAt) {\r\n canonicalId += '|lb:';\r\n canonicalId += this.startAt.canonicalId();\r\n }\r\n if (this.endAt) {\r\n canonicalId += '|ub:';\r\n canonicalId += this.endAt.canonicalId();\r\n }\r\n this.memoizedCanonicalId = canonicalId;\r\n }\r\n return this.memoizedCanonicalId;\r\n };\r\n Query.prototype.toString = function () {\r\n var str = 'Query(' + this.path.canonicalString();\r\n if (this.filters.length > 0) {\r\n str += \", filters: [\" + this.filters.join(', ') + \"]\";\r\n }\r\n if (!isNullOrUndefined(this.limit)) {\r\n str += ', limit: ' + this.limit;\r\n }\r\n if (this.explicitOrderBy.length > 0) {\r\n str += \", orderBy: [\" + this.explicitOrderBy.join(', ') + \"]\";\r\n }\r\n if (this.startAt) {\r\n str += ', startAt: ' + this.startAt.canonicalId();\r\n }\r\n if (this.endAt) {\r\n str += ', endAt: ' + this.endAt.canonicalId();\r\n }\r\n return str + ')';\r\n };\r\n Query.prototype.isEqual = function (other) {\r\n if (this.limit !== other.limit) {\r\n return false;\r\n }\r\n if (this.orderBy.length !== other.orderBy.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < this.orderBy.length; i++) {\r\n if (!this.orderBy[i].isEqual(other.orderBy[i])) {\r\n return false;\r\n }\r\n }\r\n if (this.filters.length !== other.filters.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < this.filters.length; i++) {\r\n if (!this.filters[i].isEqual(other.filters[i])) {\r\n return false;\r\n }\r\n }\r\n if (!this.path.isEqual(other.path)) {\r\n return false;\r\n }\r\n if (this.startAt !== null\r\n ? !this.startAt.isEqual(other.startAt)\r\n : other.startAt !== null) {\r\n return false;\r\n }\r\n return this.endAt !== null\r\n ? this.endAt.isEqual(other.endAt)\r\n : other.endAt === null;\r\n };\r\n Query.prototype.docComparator = function (d1, d2) {\r\n var comparedOnKeyField = false;\r\n for (var _i = 0, _a = this.orderBy; _i < _a.length; _i++) {\r\n var orderBy = _a[_i];\r\n var comp = orderBy.compare(d1, d2);\r\n if (comp !== 0)\r\n return comp;\r\n comparedOnKeyField = comparedOnKeyField || orderBy.field.isKeyField();\r\n }\r\n // Assert that we actually compared by key\r\n assert(comparedOnKeyField, \"orderBy used that doesn't compare on key field\");\r\n return 0;\r\n };\r\n Query.prototype.matches = function (doc) {\r\n return (this.matchesAncestor(doc) &&\r\n this.matchesOrderBy(doc) &&\r\n this.matchesFilters(doc) &&\r\n this.matchesBounds(doc));\r\n };\r\n Query.prototype.hasLimit = function () {\r\n return !isNullOrUndefined(this.limit);\r\n };\r\n Query.prototype.getFirstOrderByField = function () {\r\n return this.explicitOrderBy.length > 0\r\n ? this.explicitOrderBy[0].field\r\n : null;\r\n };\r\n Query.prototype.getInequalityFilterField = function () {\r\n for (var _i = 0, _a = this.filters; _i < _a.length; _i++) {\r\n var filter = _a[_i];\r\n if (filter instanceof RelationFilter && filter.isInequality()) {\r\n return filter.field;\r\n }\r\n }\r\n return null;\r\n };\r\n Query.prototype.hasArrayContainsFilter = function () {\r\n return (this.filters.find(function (filter) {\r\n return filter instanceof RelationFilter &&\r\n filter.op === RelationOp.ARRAY_CONTAINS;\r\n }) !== undefined);\r\n };\r\n Query.prototype.isDocumentQuery = function () {\r\n return DocumentKey.isDocumentKey(this.path) && this.filters.length === 0;\r\n };\r\n Query.prototype.matchesAncestor = function (doc) {\r\n var docPath = doc.key.path;\r\n if (DocumentKey.isDocumentKey(this.path)) {\r\n // exact match for document queries\r\n return this.path.isEqual(docPath);\r\n }\r\n else {\r\n // shallow ancestor queries by default\r\n return (this.path.isPrefixOf(docPath) && this.path.length === docPath.length - 1);\r\n }\r\n };\r\n /**\r\n * A document must have a value for every ordering clause in order to show up\r\n * in the results.\r\n */\r\n Query.prototype.matchesOrderBy = function (doc) {\r\n for (var _i = 0, _a = this.explicitOrderBy; _i < _a.length; _i++) {\r\n var orderBy = _a[_i];\r\n // order by key always matches\r\n if (!orderBy.field.isKeyField() &&\r\n doc.field(orderBy.field) === undefined) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Query.prototype.matchesFilters = function (doc) {\r\n for (var _i = 0, _a = this.filters; _i < _a.length; _i++) {\r\n var filter = _a[_i];\r\n if (!filter.matches(doc)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Makes sure a document is within the bounds, if provided.\r\n */\r\n Query.prototype.matchesBounds = function (doc) {\r\n if (this.startAt && !this.startAt.sortsBeforeDocument(this.orderBy, doc)) {\r\n return false;\r\n }\r\n if (this.endAt && this.endAt.sortsBeforeDocument(this.orderBy, doc)) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n Query.prototype.assertValidBound = function (bound) {\r\n assert(bound.position.length <= this.orderBy.length, 'Bound is longer than orderBy');\r\n };\r\n return Query;\r\n}());\r\nvar Filter = /** @class */ (function () {\r\n function Filter() {\r\n }\r\n /**\r\n * Creates a filter based on the provided arguments.\r\n */\r\n Filter.create = function (field, op, value) {\r\n if (value.isEqual(NullValue.INSTANCE)) {\r\n if (op !== RelationOp.EQUAL) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. You can only perform equals comparisons on null.');\r\n }\r\n return new NullFilter(field);\r\n }\r\n else if (value.isEqual(DoubleValue.NAN)) {\r\n if (op !== RelationOp.EQUAL) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. You can only perform equals comparisons on NaN.');\r\n }\r\n return new NanFilter(field);\r\n }\r\n else {\r\n return new RelationFilter(field, op, value);\r\n }\r\n };\r\n return Filter;\r\n}());\r\nvar RelationOp = /** @class */ (function () {\r\n function RelationOp(name) {\r\n this.name = name;\r\n }\r\n RelationOp.fromString = function (op) {\r\n switch (op) {\r\n case '<':\r\n return RelationOp.LESS_THAN;\r\n case '<=':\r\n return RelationOp.LESS_THAN_OR_EQUAL;\r\n case '==':\r\n return RelationOp.EQUAL;\r\n case '>=':\r\n return RelationOp.GREATER_THAN_OR_EQUAL;\r\n case '>':\r\n return RelationOp.GREATER_THAN;\r\n case 'array-contains':\r\n return RelationOp.ARRAY_CONTAINS;\r\n default:\r\n return fail('Unknown relation: ' + op);\r\n }\r\n };\r\n RelationOp.prototype.toString = function () {\r\n return this.name;\r\n };\r\n RelationOp.prototype.isEqual = function (other) {\r\n return this.name === other.name;\r\n };\r\n RelationOp.LESS_THAN = new RelationOp('<');\r\n RelationOp.LESS_THAN_OR_EQUAL = new RelationOp('<=');\r\n RelationOp.EQUAL = new RelationOp('==');\r\n RelationOp.GREATER_THAN = new RelationOp('>');\r\n RelationOp.GREATER_THAN_OR_EQUAL = new RelationOp('>=');\r\n RelationOp.ARRAY_CONTAINS = new RelationOp('array-contains');\r\n return RelationOp;\r\n}());\r\nvar RelationFilter = /** @class */ (function (_super) {\r\n tslib_1.__extends(RelationFilter, _super);\r\n function RelationFilter(field, op, value) {\r\n var _this = _super.call(this) || this;\r\n _this.field = field;\r\n _this.op = op;\r\n _this.value = value;\r\n return _this;\r\n }\r\n RelationFilter.prototype.matches = function (doc) {\r\n if (this.field.isKeyField()) {\r\n assert(this.value instanceof RefValue, 'Comparing on key, but filter value not a RefValue');\r\n assert(this.op !== RelationOp.ARRAY_CONTAINS, \"array-contains queries don't make sense on document keys.\");\r\n var refValue = this.value;\r\n var comparison = DocumentKey.comparator(doc.key, refValue.key);\r\n return this.matchesComparison(comparison);\r\n }\r\n else {\r\n var val = doc.field(this.field);\r\n return val !== undefined && this.matchesValue(val);\r\n }\r\n };\r\n RelationFilter.prototype.matchesValue = function (value) {\r\n var _this = this;\r\n if (this.op === RelationOp.ARRAY_CONTAINS) {\r\n return (value instanceof ArrayValue &&\r\n value.internalValue.find(function (element) { return element.isEqual(_this.value); }) !==\r\n undefined);\r\n }\r\n else {\r\n // Only compare types with matching backend order (such as double and int).\r\n return (this.value.typeOrder === value.typeOrder &&\r\n this.matchesComparison(value.compareTo(this.value)));\r\n }\r\n };\r\n RelationFilter.prototype.matchesComparison = function (comparison) {\r\n switch (this.op) {\r\n case RelationOp.LESS_THAN:\r\n return comparison < 0;\r\n case RelationOp.LESS_THAN_OR_EQUAL:\r\n return comparison <= 0;\r\n case RelationOp.EQUAL:\r\n return comparison === 0;\r\n case RelationOp.GREATER_THAN:\r\n return comparison > 0;\r\n case RelationOp.GREATER_THAN_OR_EQUAL:\r\n return comparison >= 0;\r\n default:\r\n return fail('Unknown relation op' + this.op);\r\n }\r\n };\r\n RelationFilter.prototype.isInequality = function () {\r\n return (this.op !== RelationOp.EQUAL && this.op !== RelationOp.ARRAY_CONTAINS);\r\n };\r\n RelationFilter.prototype.canonicalId = function () {\r\n // TODO(b/29183165): Technically, this won't be unique if two values have\r\n // the same description, such as the int 3 and the string \"3\". So we should\r\n // add the types in here somehow, too.\r\n return (this.field.canonicalString() + this.op.toString() + this.value.toString());\r\n };\r\n RelationFilter.prototype.isEqual = function (other) {\r\n if (other instanceof RelationFilter) {\r\n return (this.op.isEqual(other.op) &&\r\n this.field.isEqual(other.field) &&\r\n this.value.isEqual(other.value));\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n RelationFilter.prototype.toString = function () {\r\n return this.field.canonicalString() + \" \" + this.op + \" \" + this.value.value();\r\n };\r\n return RelationFilter;\r\n}(Filter));\r\n/**\r\n * Filter that matches 'null' values.\r\n */\r\nvar NullFilter = /** @class */ (function (_super) {\r\n tslib_1.__extends(NullFilter, _super);\r\n function NullFilter(field) {\r\n var _this = _super.call(this) || this;\r\n _this.field = field;\r\n return _this;\r\n }\r\n NullFilter.prototype.matches = function (doc) {\r\n var val = doc.field(this.field);\r\n return val !== undefined && val.value() === null;\r\n };\r\n NullFilter.prototype.canonicalId = function () {\r\n return this.field.canonicalString() + ' IS null';\r\n };\r\n NullFilter.prototype.toString = function () {\r\n return this.field.canonicalString() + \" IS null\";\r\n };\r\n NullFilter.prototype.isEqual = function (other) {\r\n if (other instanceof NullFilter) {\r\n return this.field.isEqual(other.field);\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n return NullFilter;\r\n}(Filter));\r\n/**\r\n * Filter that matches 'NaN' values.\r\n */\r\nvar NanFilter = /** @class */ (function (_super) {\r\n tslib_1.__extends(NanFilter, _super);\r\n function NanFilter(field) {\r\n var _this = _super.call(this) || this;\r\n _this.field = field;\r\n return _this;\r\n }\r\n NanFilter.prototype.matches = function (doc) {\r\n var field = doc.field(this.field);\r\n var val = field && field.value();\r\n return typeof val === 'number' && isNaN(val);\r\n };\r\n NanFilter.prototype.canonicalId = function () {\r\n return this.field.canonicalString() + ' IS NaN';\r\n };\r\n NanFilter.prototype.toString = function () {\r\n return this.field.canonicalString() + \" IS NaN\";\r\n };\r\n NanFilter.prototype.isEqual = function (other) {\r\n if (other instanceof NanFilter) {\r\n return this.field.isEqual(other.field);\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n return NanFilter;\r\n}(Filter));\r\n/**\r\n * The direction of sorting in an order by.\r\n */\r\nvar Direction = /** @class */ (function () {\r\n function Direction(name) {\r\n this.name = name;\r\n }\r\n Direction.prototype.toString = function () {\r\n return this.name;\r\n };\r\n Direction.ASCENDING = new Direction('asc');\r\n Direction.DESCENDING = new Direction('desc');\r\n return Direction;\r\n}());\r\n/**\r\n * Represents a bound of a query.\r\n *\r\n * The bound is specified with the given components representing a position and\r\n * whether it's just before or just after the position (relative to whatever the\r\n * query order is).\r\n *\r\n * The position represents a logical index position for a query. It's a prefix\r\n * of values for the (potentially implicit) order by clauses of a query.\r\n *\r\n * Bound provides a function to determine whether a document comes before or\r\n * after a bound. This is influenced by whether the position is just before or\r\n * just after the provided values.\r\n */\r\nvar Bound = /** @class */ (function () {\r\n function Bound(position, before) {\r\n this.position = position;\r\n this.before = before;\r\n }\r\n Bound.prototype.canonicalId = function () {\r\n // TODO(b/29183165): Make this collision robust.\r\n var canonicalId = this.before ? 'b:' : 'a:';\r\n for (var _i = 0, _a = this.position; _i < _a.length; _i++) {\r\n var component = _a[_i];\r\n canonicalId += component.toString();\r\n }\r\n return canonicalId;\r\n };\r\n /**\r\n * Returns true if a document sorts before a bound using the provided sort\r\n * order.\r\n */\r\n Bound.prototype.sortsBeforeDocument = function (orderBy, doc) {\r\n assert(this.position.length <= orderBy.length, \"Bound has more components than query's orderBy\");\r\n var comparison = 0;\r\n for (var i = 0; i < this.position.length; i++) {\r\n var orderByComponent = orderBy[i];\r\n var component = this.position[i];\r\n if (orderByComponent.field.isKeyField()) {\r\n assert(component instanceof RefValue, 'Bound has a non-key value where the key path is being used.');\r\n comparison = DocumentKey.comparator(component.key, doc.key);\r\n }\r\n else {\r\n var docValue = doc.field(orderByComponent.field);\r\n assert(docValue !== undefined, 'Field should exist since document matched the orderBy already.');\r\n comparison = component.compareTo(docValue);\r\n }\r\n if (orderByComponent.dir === Direction.DESCENDING) {\r\n comparison = comparison * -1;\r\n }\r\n if (comparison !== 0) {\r\n break;\r\n }\r\n }\r\n return this.before ? comparison <= 0 : comparison < 0;\r\n };\r\n Bound.prototype.isEqual = function (other) {\r\n if (other === null) {\r\n return false;\r\n }\r\n if (this.before !== other.before ||\r\n this.position.length !== other.position.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < this.position.length; i++) {\r\n var thisPosition = this.position[i];\r\n var otherPosition = other.position[i];\r\n return thisPosition.isEqual(otherPosition);\r\n }\r\n return true;\r\n };\r\n return Bound;\r\n}());\r\n/**\r\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\r\n */\r\nvar OrderBy = /** @class */ (function () {\r\n function OrderBy(field, dir) {\r\n this.field = field;\r\n if (dir === undefined) {\r\n dir = Direction.ASCENDING;\r\n }\r\n this.dir = dir;\r\n this.isKeyOrderBy = field.isKeyField();\r\n }\r\n OrderBy.prototype.compare = function (d1, d2) {\r\n var comparison = this.isKeyOrderBy\r\n ? Document.compareByKey(d1, d2)\r\n : Document.compareByField(this.field, d1, d2);\r\n switch (this.dir) {\r\n case Direction.ASCENDING:\r\n return comparison;\r\n case Direction.DESCENDING:\r\n return -1 * comparison;\r\n default:\r\n return fail('Unknown direction: ' + this.dir);\r\n }\r\n };\r\n OrderBy.prototype.canonicalId = function () {\r\n // TODO(b/29183165): Make this collision robust.\r\n return this.field.canonicalString() + this.dir.toString();\r\n };\r\n OrderBy.prototype.toString = function () {\r\n return this.field.canonicalString() + \" (\" + this.dir + \")\";\r\n };\r\n OrderBy.prototype.isEqual = function (other) {\r\n return this.dir === other.dir && this.field.isEqual(other.field);\r\n };\r\n return OrderBy;\r\n}());\r\nvar KEY_ORDERING_ASC = new OrderBy(FieldPath.keyField(), Direction.ASCENDING);\r\nvar KEY_ORDERING_DESC = new OrderBy(FieldPath.keyField(), Direction.DESCENDING);\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A version of a document in Firestore. This corresponds to the version\r\n * timestamp, such as update_time or read_time.\r\n */\r\nvar SnapshotVersion = /** @class */ (function () {\r\n function SnapshotVersion(timestamp) {\r\n this.timestamp = timestamp;\r\n }\r\n // TODO(b/34176344): Once we no longer need to use the old alpha protos,\r\n // delete this constructor and use a timestamp-backed version everywhere.\r\n SnapshotVersion.fromMicroseconds = function (value) {\r\n var seconds = Math.floor(value / 1e6);\r\n var nanos = (value % 1e6) * 1e3;\r\n return new SnapshotVersion(new Timestamp(seconds, nanos));\r\n };\r\n SnapshotVersion.fromTimestamp = function (value) {\r\n return new SnapshotVersion(value);\r\n };\r\n SnapshotVersion.forDeletedDoc = function () {\r\n return SnapshotVersion.MIN;\r\n };\r\n SnapshotVersion.prototype.compareTo = function (other) {\r\n return this.timestamp._compareTo(other.timestamp);\r\n };\r\n SnapshotVersion.prototype.isEqual = function (other) {\r\n return this.timestamp.isEqual(other.timestamp);\r\n };\r\n /** Returns a number representation of the version for use in spec tests. */\r\n SnapshotVersion.prototype.toMicroseconds = function () {\r\n // Convert to microseconds.\r\n return this.timestamp.seconds * 1e6 + this.timestamp.nanoseconds / 1000;\r\n };\r\n SnapshotVersion.prototype.toString = function () {\r\n return 'SnapshotVersion(' + this.timestamp.toString() + ')';\r\n };\r\n SnapshotVersion.prototype.toTimestamp = function () {\r\n return this.timestamp;\r\n };\r\n SnapshotVersion.MIN = new SnapshotVersion(new Timestamp(0, 0));\r\n return SnapshotVersion;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** An enumeration of the different purposes we have for queries. */\r\nvar QueryPurpose;\r\n(function (QueryPurpose) {\r\n /** A regular, normal query. */\r\n QueryPurpose[QueryPurpose[\"Listen\"] = 0] = \"Listen\";\r\n /**\r\n * The query was used to refill a query after an existence filter mismatch.\r\n */\r\n QueryPurpose[QueryPurpose[\"ExistenceFilterMismatch\"] = 1] = \"ExistenceFilterMismatch\";\r\n /** The query was used to resolve a limbo document. */\r\n QueryPurpose[QueryPurpose[\"LimboResolution\"] = 2] = \"LimboResolution\";\r\n})(QueryPurpose || (QueryPurpose = {}));\r\n/**\r\n * An immutable set of metadata that the local store tracks for each query.\r\n */\r\nvar QueryData = /** @class */ (function () {\r\n function QueryData(\r\n /** The query being listened to. */\r\n query, \r\n /**\r\n * The target ID to which the query corresponds; Assigned by the\r\n * LocalStore for user listens and by the SyncEngine for limbo watches.\r\n */\r\n targetId, \r\n /** The purpose of the query. */\r\n purpose, \r\n /** The sequence number of the last transaction during which this query data was modified */\r\n sequenceNumber, \r\n /** The latest snapshot version seen for this target. */\r\n snapshotVersion, \r\n /**\r\n * An opaque, server-assigned token that allows watching a query to be\r\n * resumed after disconnecting without retransmitting all the data that\r\n * matches the query. The resume token essentially identifies a point in\r\n * time from which the server should resume sending results.\r\n */\r\n resumeToken) {\r\n if (snapshotVersion === void 0) { snapshotVersion = SnapshotVersion.MIN; }\r\n if (resumeToken === void 0) { resumeToken = emptyByteString(); }\r\n this.query = query;\r\n this.targetId = targetId;\r\n this.purpose = purpose;\r\n this.sequenceNumber = sequenceNumber;\r\n this.snapshotVersion = snapshotVersion;\r\n this.resumeToken = resumeToken;\r\n }\r\n /**\r\n * Creates a new query data instance with an updated snapshot version and\r\n * resume token.\r\n */\r\n QueryData.prototype.copy = function (overwrite) {\r\n return new QueryData(this.query, this.targetId, this.purpose, overwrite.sequenceNumber === undefined\r\n ? this.sequenceNumber\r\n : overwrite.sequenceNumber, overwrite.snapshotVersion === undefined\r\n ? this.snapshotVersion\r\n : overwrite.snapshotVersion, overwrite.resumeToken === undefined\r\n ? this.resumeToken\r\n : overwrite.resumeToken);\r\n };\r\n QueryData.prototype.isEqual = function (other) {\r\n return (this.targetId === other.targetId &&\r\n this.purpose === other.purpose &&\r\n this.sequenceNumber === other.sequenceNumber &&\r\n this.snapshotVersion.isEqual(other.snapshotVersion) &&\r\n this.resumeToken === other.resumeToken &&\r\n this.query.isEqual(other.query));\r\n };\r\n return QueryData;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provides a set of fields that can be used to partially patch a document.\r\n * FieldMask is used in conjunction with ObjectValue.\r\n * Examples:\r\n * foo - Overwrites foo entirely with the provided value. If foo is not\r\n * present in the companion ObjectValue, the field is deleted.\r\n * foo.bar - Overwrites only the field bar of the object foo.\r\n * If foo is not an object, foo is replaced with an object\r\n * containing foo\r\n */\r\nvar FieldMask = /** @class */ (function () {\r\n function FieldMask(fields) {\r\n this.fields = fields;\r\n // TODO(dimond): validation of FieldMask\r\n }\r\n /**\r\n * Verifies that `fieldPath` is included by at least one field in this field\r\n * mask.\r\n *\r\n * This is an O(n) operation, where `n` is the size of the field mask.\r\n */\r\n FieldMask.prototype.covers = function (fieldPath) {\r\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\r\n var fieldMaskPath = _a[_i];\r\n if (fieldMaskPath.isPrefixOf(fieldPath)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n FieldMask.prototype.isEqual = function (other) {\r\n return arrayEquals(this.fields, other.fields);\r\n };\r\n return FieldMask;\r\n}());\r\n/** A field path and the TransformOperation to perform upon it. */\r\nvar FieldTransform = /** @class */ (function () {\r\n function FieldTransform(field, transform) {\r\n this.field = field;\r\n this.transform = transform;\r\n }\r\n FieldTransform.prototype.isEqual = function (other) {\r\n return (this.field.isEqual(other.field) && this.transform.isEqual(other.transform));\r\n };\r\n return FieldTransform;\r\n}());\r\n/** The result of successfully applying a mutation to the backend. */\r\nvar MutationResult = /** @class */ (function () {\r\n function MutationResult(\r\n /**\r\n * The version at which the mutation was committed:\r\n *\r\n * - For most operations, this is the updateTime in the WriteResult.\r\n * - For deletes, the commitTime of the WriteResponse (because deletes are\r\n * not stored and have no updateTime).\r\n *\r\n * Note that these versions can be different: No-op writes will not change\r\n * the updateTime even though the commitTime advances.\r\n */\r\n version, \r\n /**\r\n * The resulting fields returned from the backend after a\r\n * TransformMutation has been committed. Contains one FieldValue for each\r\n * FieldTransform that was in the mutation.\r\n *\r\n * Will be null if the mutation was not a TransformMutation.\r\n */\r\n transformResults) {\r\n this.version = version;\r\n this.transformResults = transformResults;\r\n }\r\n return MutationResult;\r\n}());\r\nvar MutationType;\r\n(function (MutationType) {\r\n MutationType[MutationType[\"Set\"] = 0] = \"Set\";\r\n MutationType[MutationType[\"Patch\"] = 1] = \"Patch\";\r\n MutationType[MutationType[\"Transform\"] = 2] = \"Transform\";\r\n MutationType[MutationType[\"Delete\"] = 3] = \"Delete\";\r\n})(MutationType || (MutationType = {}));\r\n/**\r\n * Encodes a precondition for a mutation. This follows the model that the\r\n * backend accepts with the special case of an explicit \"empty\" precondition\r\n * (meaning no precondition).\r\n */\r\nvar Precondition = /** @class */ (function () {\r\n function Precondition(updateTime, exists) {\r\n this.updateTime = updateTime;\r\n this.exists = exists;\r\n assert(updateTime === undefined || exists === undefined, 'Precondition can specify \"exists\" or \"updateTime\" but not both');\r\n }\r\n /** Creates a new Precondition with an exists flag. */\r\n Precondition.exists = function (exists) {\r\n return new Precondition(undefined, exists);\r\n };\r\n /** Creates a new Precondition based on a version a document exists at. */\r\n Precondition.updateTime = function (version) {\r\n return new Precondition(version);\r\n };\r\n Object.defineProperty(Precondition.prototype, \"isNone\", {\r\n /** Returns whether this Precondition is empty. */\r\n get: function () {\r\n return this.updateTime === undefined && this.exists === undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns true if the preconditions is valid for the given document\r\n * (or null if no document is available).\r\n */\r\n Precondition.prototype.isValidFor = function (maybeDoc) {\r\n if (this.updateTime !== undefined) {\r\n return (maybeDoc instanceof Document &&\r\n maybeDoc.version.isEqual(this.updateTime));\r\n }\r\n else if (this.exists !== undefined) {\r\n return this.exists === maybeDoc instanceof Document;\r\n }\r\n else {\r\n assert(this.isNone, 'Precondition should be empty');\r\n return true;\r\n }\r\n };\r\n Precondition.prototype.isEqual = function (other) {\r\n return (equals(this.updateTime, other.updateTime) &&\r\n this.exists === other.exists);\r\n };\r\n Precondition.NONE = new Precondition();\r\n return Precondition;\r\n}());\r\n/**\r\n * A mutation describes a self-contained change to a document. Mutations can\r\n * create, replace, delete, and update subsets of documents.\r\n *\r\n * Mutations not only act on the value of the document but also it version.\r\n *\r\n * For local mutations (mutations that haven't been committed yet), we preserve\r\n * the existing version for Set, Patch, and Transform mutations. For Delete\r\n * mutations, we reset the version to 0.\r\n *\r\n * Here's the expected transition table.\r\n *\r\n * MUTATION APPLIED TO RESULTS IN\r\n *\r\n * SetMutation Document(v3) Document(v3)\r\n * SetMutation NoDocument(v3) Document(v0)\r\n * SetMutation null Document(v0)\r\n * PatchMutation Document(v3) Document(v3)\r\n * PatchMutation NoDocument(v3) NoDocument(v3)\r\n * PatchMutation null null\r\n * TransformMutation Document(v3) Document(v3)\r\n * TransformMutation NoDocument(v3) NoDocument(v3)\r\n * TransformMutation null null\r\n * DeleteMutation Document(v3) NoDocument(v0)\r\n * DeleteMutation NoDocument(v3) NoDocument(v0)\r\n * DeleteMutation null NoDocument(v0)\r\n *\r\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\r\n * the resulting version for Set, Patch, and Transform mutations. As deletes\r\n * have no explicit update time, we use the commitTime of the WriteResponse for\r\n * Delete mutations.\r\n *\r\n * If a mutation is acknowledged by the backend but fails the precondition check\r\n * locally, we return an `UnknownDocument` and rely on Watch to send us the\r\n * updated version.\r\n *\r\n * Note that TransformMutations don't create Documents (in the case of being\r\n * applied to a NoDocument), even though they would on the backend. This is\r\n * because the client always combines the TransformMutation with a SetMutation\r\n * or PatchMutation and we only want to apply the transform if the prior\r\n * mutation resulted in a Document (always true for a SetMutation, but not\r\n * necessarily for a PatchMutation).\r\n *\r\n * ## Subclassing Notes\r\n *\r\n * Subclasses of Mutation need to implement applyToRemoteDocument() and\r\n * applyToLocalView() to implement the actual behavior of applying the mutation\r\n * to some source document.\r\n */\r\nvar Mutation = /** @class */ (function () {\r\n function Mutation() {\r\n }\r\n Mutation.prototype.verifyKeyMatches = function (maybeDoc) {\r\n if (maybeDoc != null) {\r\n assert(maybeDoc.key.isEqual(this.key), 'Can only apply a mutation to a document with the same key');\r\n }\r\n };\r\n /**\r\n * Returns the version from the given document for use as the result of a\r\n * mutation. Mutations are defined to return the version of the base document\r\n * only if it is an existing document. Deleted and unknown documents have a\r\n * post-mutation version of SnapshotVersion.MIN.\r\n */\r\n Mutation.getPostMutationVersion = function (maybeDoc) {\r\n if (maybeDoc instanceof Document) {\r\n return maybeDoc.version;\r\n }\r\n else {\r\n return SnapshotVersion.MIN;\r\n }\r\n };\r\n return Mutation;\r\n}());\r\n/**\r\n * A mutation that creates or replaces the document at the given key with the\r\n * object value contents.\r\n */\r\nvar SetMutation = /** @class */ (function (_super) {\r\n tslib_1.__extends(SetMutation, _super);\r\n function SetMutation(key, value, precondition) {\r\n var _this = _super.call(this) || this;\r\n _this.key = key;\r\n _this.value = value;\r\n _this.precondition = precondition;\r\n _this.type = MutationType.Set;\r\n return _this;\r\n }\r\n SetMutation.prototype.applyToRemoteDocument = function (maybeDoc, mutationResult) {\r\n this.verifyKeyMatches(maybeDoc);\r\n assert(mutationResult.transformResults == null, 'Transform results received by SetMutation.');\r\n // Unlike applyToLocalView, if we're applying a mutation to a remote\r\n // document the server has accepted the mutation so the precondition must\r\n // have held.\r\n var version = mutationResult.version;\r\n return new Document(this.key, version, this.value, {\r\n hasCommittedMutations: true\r\n });\r\n };\r\n SetMutation.prototype.applyToLocalView = function (maybeDoc, baseDoc, localWriteTime) {\r\n this.verifyKeyMatches(maybeDoc);\r\n if (!this.precondition.isValidFor(maybeDoc)) {\r\n return maybeDoc;\r\n }\r\n var version = Mutation.getPostMutationVersion(maybeDoc);\r\n return new Document(this.key, version, this.value, {\r\n hasLocalMutations: true\r\n });\r\n };\r\n SetMutation.prototype.isEqual = function (other) {\r\n return (other instanceof SetMutation &&\r\n this.key.isEqual(other.key) &&\r\n this.value.isEqual(other.value) &&\r\n this.precondition.isEqual(other.precondition));\r\n };\r\n return SetMutation;\r\n}(Mutation));\r\n/**\r\n * A mutation that modifies fields of the document at the given key with the\r\n * given values. The values are applied through a field mask:\r\n *\r\n * * When a field is in both the mask and the values, the corresponding field\r\n * is updated.\r\n * * When a field is in neither the mask nor the values, the corresponding\r\n * field is unmodified.\r\n * * When a field is in the mask but not in the values, the corresponding field\r\n * is deleted.\r\n * * When a field is not in the mask but is in the values, the values map is\r\n * ignored.\r\n */\r\nvar PatchMutation = /** @class */ (function (_super) {\r\n tslib_1.__extends(PatchMutation, _super);\r\n function PatchMutation(key, data, fieldMask, precondition) {\r\n var _this = _super.call(this) || this;\r\n _this.key = key;\r\n _this.data = data;\r\n _this.fieldMask = fieldMask;\r\n _this.precondition = precondition;\r\n _this.type = MutationType.Patch;\r\n return _this;\r\n }\r\n PatchMutation.prototype.applyToRemoteDocument = function (maybeDoc, mutationResult) {\r\n this.verifyKeyMatches(maybeDoc);\r\n assert(mutationResult.transformResults == null, 'Transform results received by PatchMutation.');\r\n if (!this.precondition.isValidFor(maybeDoc)) {\r\n // Since the mutation was not rejected, we know that the precondition\r\n // matched on the backend. We therefore must not have the expected version\r\n // of the document in our cache and return an UnknownDocument with the\r\n // known updateTime.\r\n return new UnknownDocument(this.key, mutationResult.version);\r\n }\r\n var newData = this.patchDocument(maybeDoc);\r\n return new Document(this.key, mutationResult.version, newData, {\r\n hasCommittedMutations: true\r\n });\r\n };\r\n PatchMutation.prototype.applyToLocalView = function (maybeDoc, baseDoc, localWriteTime) {\r\n this.verifyKeyMatches(maybeDoc);\r\n if (!this.precondition.isValidFor(maybeDoc)) {\r\n return maybeDoc;\r\n }\r\n var version = Mutation.getPostMutationVersion(maybeDoc);\r\n var newData = this.patchDocument(maybeDoc);\r\n return new Document(this.key, version, newData, {\r\n hasLocalMutations: true\r\n });\r\n };\r\n PatchMutation.prototype.isEqual = function (other) {\r\n return (other instanceof PatchMutation &&\r\n this.key.isEqual(other.key) &&\r\n this.fieldMask.isEqual(other.fieldMask) &&\r\n this.precondition.isEqual(other.precondition));\r\n };\r\n /**\r\n * Patches the data of document if available or creates a new document. Note\r\n * that this does not check whether or not the precondition of this patch\r\n * holds.\r\n */\r\n PatchMutation.prototype.patchDocument = function (maybeDoc) {\r\n var data;\r\n if (maybeDoc instanceof Document) {\r\n data = maybeDoc.data;\r\n }\r\n else {\r\n data = ObjectValue.EMPTY;\r\n }\r\n return this.patchObject(data);\r\n };\r\n PatchMutation.prototype.patchObject = function (data) {\r\n for (var _i = 0, _a = this.fieldMask.fields; _i < _a.length; _i++) {\r\n var fieldPath = _a[_i];\r\n if (!fieldPath.isEmpty()) {\r\n var newValue = this.data.field(fieldPath);\r\n if (newValue !== undefined) {\r\n data = data.set(fieldPath, newValue);\r\n }\r\n else {\r\n data = data.delete(fieldPath);\r\n }\r\n }\r\n }\r\n return data;\r\n };\r\n return PatchMutation;\r\n}(Mutation));\r\n/**\r\n * A mutation that modifies specific fields of the document with transform\r\n * operations. Currently the only supported transform is a server timestamp, but\r\n * IP Address, increment(n), etc. could be supported in the future.\r\n *\r\n * It is somewhat similar to a PatchMutation in that it patches specific fields\r\n * and has no effect when applied to a null or NoDocument (see comment on\r\n * Mutation for rationale).\r\n */\r\nvar TransformMutation = /** @class */ (function (_super) {\r\n tslib_1.__extends(TransformMutation, _super);\r\n function TransformMutation(key, fieldTransforms) {\r\n var _this = _super.call(this) || this;\r\n _this.key = key;\r\n _this.fieldTransforms = fieldTransforms;\r\n _this.type = MutationType.Transform;\r\n // NOTE: We set a precondition of exists: true as a safety-check, since we\r\n // always combine TransformMutations with a SetMutation or PatchMutation which\r\n // (if successful) should end up with an existing document.\r\n _this.precondition = Precondition.exists(true);\r\n return _this;\r\n }\r\n TransformMutation.prototype.applyToRemoteDocument = function (maybeDoc, mutationResult) {\r\n this.verifyKeyMatches(maybeDoc);\r\n assert(mutationResult.transformResults != null, 'Transform results missing for TransformMutation.');\r\n if (!this.precondition.isValidFor(maybeDoc)) {\r\n // Since the mutation was not rejected, we know that the precondition\r\n // matched on the backend. We therefore must not have the expected version\r\n // of the document in our cache and return an UnknownDocument with the\r\n // known updateTime.\r\n return new UnknownDocument(this.key, mutationResult.version);\r\n }\r\n var doc = this.requireDocument(maybeDoc);\r\n var transformResults = this.serverTransformResults(maybeDoc, mutationResult.transformResults);\r\n var version = mutationResult.version;\r\n var newData = this.transformObject(doc.data, transformResults);\r\n return new Document(this.key, version, newData, {\r\n hasCommittedMutations: true\r\n });\r\n };\r\n TransformMutation.prototype.applyToLocalView = function (maybeDoc, baseDoc, localWriteTime) {\r\n this.verifyKeyMatches(maybeDoc);\r\n if (!this.precondition.isValidFor(maybeDoc)) {\r\n return maybeDoc;\r\n }\r\n var doc = this.requireDocument(maybeDoc);\r\n var transformResults = this.localTransformResults(localWriteTime, baseDoc);\r\n var newData = this.transformObject(doc.data, transformResults);\r\n return new Document(this.key, doc.version, newData, {\r\n hasLocalMutations: true\r\n });\r\n };\r\n TransformMutation.prototype.isEqual = function (other) {\r\n return (other instanceof TransformMutation &&\r\n this.key.isEqual(other.key) &&\r\n arrayEquals(this.fieldTransforms, other.fieldTransforms) &&\r\n this.precondition.isEqual(other.precondition));\r\n };\r\n /**\r\n * Asserts that the given MaybeDocument is actually a Document and verifies\r\n * that it matches the key for this mutation. Since we only support\r\n * transformations with precondition exists this method is guaranteed to be\r\n * safe.\r\n */\r\n TransformMutation.prototype.requireDocument = function (maybeDoc) {\r\n assert(maybeDoc instanceof Document, 'Unknown MaybeDocument type ' + maybeDoc);\r\n var doc = maybeDoc;\r\n assert(doc.key.isEqual(this.key), 'Can only transform a document with the same key');\r\n return doc;\r\n };\r\n /**\r\n * Creates a list of \"transform results\" (a transform result is a field value\r\n * representing the result of applying a transform) for use after a\r\n * TransformMutation has been acknowledged by the server.\r\n *\r\n * @param baseDoc The document prior to applying this mutation batch.\r\n * @param serverTransformResults The transform results received by the server.\r\n * @return The transform results list.\r\n */\r\n TransformMutation.prototype.serverTransformResults = function (baseDoc, serverTransformResults) {\r\n var transformResults = [];\r\n assert(this.fieldTransforms.length === serverTransformResults.length, \"server transform result count (\" + serverTransformResults.length + \") \" +\r\n (\"should match field transform count (\" + this.fieldTransforms.length + \")\"));\r\n for (var i = 0; i < serverTransformResults.length; i++) {\r\n var fieldTransform = this.fieldTransforms[i];\r\n var transform = fieldTransform.transform;\r\n var previousValue = null;\r\n if (baseDoc instanceof Document) {\r\n previousValue = baseDoc.field(fieldTransform.field) || null;\r\n }\r\n transformResults.push(transform.applyToRemoteDocument(previousValue, serverTransformResults[i]));\r\n }\r\n return transformResults;\r\n };\r\n /**\r\n * Creates a list of \"transform results\" (a transform result is a field value\r\n * representing the result of applying a transform) for use when applying a\r\n * TransformMutation locally.\r\n *\r\n * @param localWriteTime The local time of the transform mutation (used to\r\n * generate ServerTimestampValues).\r\n * @param baseDoc The document prior to applying this mutation batch.\r\n * @return The transform results list.\r\n */\r\n TransformMutation.prototype.localTransformResults = function (localWriteTime, baseDoc) {\r\n var transformResults = [];\r\n for (var _i = 0, _a = this.fieldTransforms; _i < _a.length; _i++) {\r\n var fieldTransform = _a[_i];\r\n var transform = fieldTransform.transform;\r\n var previousValue = null;\r\n if (baseDoc instanceof Document) {\r\n previousValue = baseDoc.field(fieldTransform.field) || null;\r\n }\r\n transformResults.push(transform.applyToLocalView(previousValue, localWriteTime));\r\n }\r\n return transformResults;\r\n };\r\n TransformMutation.prototype.transformObject = function (data, transformResults) {\r\n assert(transformResults.length === this.fieldTransforms.length, 'TransformResults length mismatch.');\r\n for (var i = 0; i < this.fieldTransforms.length; i++) {\r\n var fieldTransform = this.fieldTransforms[i];\r\n var fieldPath = fieldTransform.field;\r\n data = data.set(fieldPath, transformResults[i]);\r\n }\r\n return data;\r\n };\r\n return TransformMutation;\r\n}(Mutation));\r\n/** A mutation that deletes the document at the given key. */\r\nvar DeleteMutation = /** @class */ (function (_super) {\r\n tslib_1.__extends(DeleteMutation, _super);\r\n function DeleteMutation(key, precondition) {\r\n var _this = _super.call(this) || this;\r\n _this.key = key;\r\n _this.precondition = precondition;\r\n _this.type = MutationType.Delete;\r\n return _this;\r\n }\r\n DeleteMutation.prototype.applyToRemoteDocument = function (maybeDoc, mutationResult) {\r\n this.verifyKeyMatches(maybeDoc);\r\n assert(mutationResult.transformResults == null, 'Transform results received by DeleteMutation.');\r\n // Unlike applyToLocalView, if we're applying a mutation to a remote\r\n // document the server has accepted the mutation so the precondition must\r\n // have held.\r\n return new NoDocument(this.key, mutationResult.version, {\r\n hasCommittedMutations: true\r\n });\r\n };\r\n DeleteMutation.prototype.applyToLocalView = function (maybeDoc, baseDoc, localWriteTime) {\r\n this.verifyKeyMatches(maybeDoc);\r\n if (!this.precondition.isValidFor(maybeDoc)) {\r\n return maybeDoc;\r\n }\r\n if (maybeDoc) {\r\n assert(maybeDoc.key.isEqual(this.key), 'Can only apply mutation to document with same key');\r\n }\r\n return new NoDocument(this.key, SnapshotVersion.forDeletedDoc());\r\n };\r\n DeleteMutation.prototype.isEqual = function (other) {\r\n return (other instanceof DeleteMutation &&\r\n this.key.isEqual(other.key) &&\r\n this.precondition.isEqual(other.precondition));\r\n };\r\n return DeleteMutation;\r\n}(Mutation));\n\n/**\r\n * Copyright 2018 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Transforms a value into a server-generated timestamp. */\r\nvar ServerTimestampTransform = /** @class */ (function () {\r\n function ServerTimestampTransform() {\r\n }\r\n ServerTimestampTransform.prototype.applyToLocalView = function (previousValue, localWriteTime) {\r\n return new ServerTimestampValue(localWriteTime, previousValue);\r\n };\r\n ServerTimestampTransform.prototype.applyToRemoteDocument = function (previousValue, transformResult) {\r\n return transformResult;\r\n };\r\n ServerTimestampTransform.prototype.isEqual = function (other) {\r\n return other instanceof ServerTimestampTransform;\r\n };\r\n ServerTimestampTransform.instance = new ServerTimestampTransform();\r\n return ServerTimestampTransform;\r\n}());\r\n/** Transforms an array value via a union operation. */\r\nvar ArrayUnionTransformOperation = /** @class */ (function () {\r\n function ArrayUnionTransformOperation(elements) {\r\n this.elements = elements;\r\n }\r\n ArrayUnionTransformOperation.prototype.applyToLocalView = function (previousValue, localWriteTime) {\r\n return this.apply(previousValue);\r\n };\r\n ArrayUnionTransformOperation.prototype.applyToRemoteDocument = function (previousValue, transformResult) {\r\n // The server just sends null as the transform result for array operations,\r\n // so we have to calculate a result the same as we do for local\r\n // applications.\r\n return this.apply(previousValue);\r\n };\r\n ArrayUnionTransformOperation.prototype.apply = function (previousValue) {\r\n var result = coercedFieldValuesArray(previousValue);\r\n var _loop_1 = function (toUnion) {\r\n if (!result.find(function (element) { return element.isEqual(toUnion); })) {\r\n result.push(toUnion);\r\n }\r\n };\r\n for (var _i = 0, _a = this.elements; _i < _a.length; _i++) {\r\n var toUnion = _a[_i];\r\n _loop_1(toUnion);\r\n }\r\n return new ArrayValue(result);\r\n };\r\n ArrayUnionTransformOperation.prototype.isEqual = function (other) {\r\n return (other instanceof ArrayUnionTransformOperation &&\r\n arrayEquals(other.elements, this.elements));\r\n };\r\n return ArrayUnionTransformOperation;\r\n}());\r\n/** Transforms an array value via a remove operation. */\r\nvar ArrayRemoveTransformOperation = /** @class */ (function () {\r\n function ArrayRemoveTransformOperation(elements) {\r\n this.elements = elements;\r\n }\r\n ArrayRemoveTransformOperation.prototype.applyToLocalView = function (previousValue, localWriteTime) {\r\n return this.apply(previousValue);\r\n };\r\n ArrayRemoveTransformOperation.prototype.applyToRemoteDocument = function (previousValue, transformResult) {\r\n // The server just sends null as the transform result for array operations,\r\n // so we have to calculate a result the same as we do for local\r\n // applications.\r\n return this.apply(previousValue);\r\n };\r\n ArrayRemoveTransformOperation.prototype.apply = function (previousValue) {\r\n var result = coercedFieldValuesArray(previousValue);\r\n var _loop_2 = function (toRemove) {\r\n result = result.filter(function (element) { return !element.isEqual(toRemove); });\r\n };\r\n for (var _i = 0, _a = this.elements; _i < _a.length; _i++) {\r\n var toRemove = _a[_i];\r\n _loop_2(toRemove);\r\n }\r\n return new ArrayValue(result);\r\n };\r\n ArrayRemoveTransformOperation.prototype.isEqual = function (other) {\r\n return (other instanceof ArrayRemoveTransformOperation &&\r\n arrayEquals(other.elements, this.elements));\r\n };\r\n return ArrayRemoveTransformOperation;\r\n}());\r\nfunction coercedFieldValuesArray(value) {\r\n if (value instanceof ArrayValue) {\r\n return value.internalValue.slice();\r\n }\r\n else {\r\n // coerce to empty array.\r\n return [];\r\n }\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ExistenceFilter = /** @class */ (function () {\r\n // TODO(b/33078163): just use simplest form of existence filter for now\r\n function ExistenceFilter(count) {\r\n this.count = count;\r\n }\r\n ExistenceFilter.prototype.isEqual = function (other) {\r\n return other && other.count === this.count;\r\n };\r\n return ExistenceFilter;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Error Codes describing the different ways GRPC can fail. These are copied\r\n * directly from GRPC's sources here:\r\n *\r\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\r\n *\r\n * Important! The names of these identifiers matter because the string forms\r\n * are used for reverse lookups from the webchannel stream. Do NOT change the\r\n * names of these identifiers.\r\n */\r\nvar RpcCode;\r\n(function (RpcCode) {\r\n RpcCode[RpcCode[\"OK\"] = 0] = \"OK\";\r\n RpcCode[RpcCode[\"CANCELLED\"] = 1] = \"CANCELLED\";\r\n RpcCode[RpcCode[\"UNKNOWN\"] = 2] = \"UNKNOWN\";\r\n RpcCode[RpcCode[\"INVALID_ARGUMENT\"] = 3] = \"INVALID_ARGUMENT\";\r\n RpcCode[RpcCode[\"DEADLINE_EXCEEDED\"] = 4] = \"DEADLINE_EXCEEDED\";\r\n RpcCode[RpcCode[\"NOT_FOUND\"] = 5] = \"NOT_FOUND\";\r\n RpcCode[RpcCode[\"ALREADY_EXISTS\"] = 6] = \"ALREADY_EXISTS\";\r\n RpcCode[RpcCode[\"PERMISSION_DENIED\"] = 7] = \"PERMISSION_DENIED\";\r\n RpcCode[RpcCode[\"UNAUTHENTICATED\"] = 16] = \"UNAUTHENTICATED\";\r\n RpcCode[RpcCode[\"RESOURCE_EXHAUSTED\"] = 8] = \"RESOURCE_EXHAUSTED\";\r\n RpcCode[RpcCode[\"FAILED_PRECONDITION\"] = 9] = \"FAILED_PRECONDITION\";\r\n RpcCode[RpcCode[\"ABORTED\"] = 10] = \"ABORTED\";\r\n RpcCode[RpcCode[\"OUT_OF_RANGE\"] = 11] = \"OUT_OF_RANGE\";\r\n RpcCode[RpcCode[\"UNIMPLEMENTED\"] = 12] = \"UNIMPLEMENTED\";\r\n RpcCode[RpcCode[\"INTERNAL\"] = 13] = \"INTERNAL\";\r\n RpcCode[RpcCode[\"UNAVAILABLE\"] = 14] = \"UNAVAILABLE\";\r\n RpcCode[RpcCode[\"DATA_LOSS\"] = 15] = \"DATA_LOSS\";\r\n})(RpcCode || (RpcCode = {}));\r\nfunction isPermanentError(code) {\r\n switch (code) {\r\n case Code.OK:\r\n return fail('Treated status OK as error');\r\n case Code.CANCELLED:\r\n case Code.UNKNOWN:\r\n case Code.DEADLINE_EXCEEDED:\r\n case Code.RESOURCE_EXHAUSTED:\r\n case Code.INTERNAL:\r\n case Code.UNAVAILABLE:\r\n // Unauthenticated means something went wrong with our token and we need\r\n // to retry with new credentials which will happen automatically.\r\n case Code.UNAUTHENTICATED:\r\n return false;\r\n case Code.INVALID_ARGUMENT:\r\n case Code.NOT_FOUND:\r\n case Code.ALREADY_EXISTS:\r\n case Code.PERMISSION_DENIED:\r\n case Code.FAILED_PRECONDITION:\r\n // Aborted might be retried in some scenarios, but that is dependant on\r\n // the context and should handled individually by the calling code.\r\n // See https://cloud.google.com/apis/design/errors.\r\n case Code.ABORTED:\r\n case Code.OUT_OF_RANGE:\r\n case Code.UNIMPLEMENTED:\r\n case Code.DATA_LOSS:\r\n return true;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}\r\n/**\r\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\r\n *\r\n * @returns The Code equivalent to the given status string or undefined if\r\n * there is no match.\r\n */\r\nfunction mapCodeFromRpcStatus(status) {\r\n // tslint:disable-next-line:no-any lookup by string\r\n var code = RpcCode[status];\r\n if (code === undefined) {\r\n return undefined;\r\n }\r\n return mapCodeFromRpcCode(code);\r\n}\r\n/**\r\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\r\n * are not the same as HTTP status codes.\r\n *\r\n * @returns The Code equivalent to the given GRPC status code. Fails if there\r\n * is no match.\r\n */\r\nfunction mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}\r\n/**\r\n * Maps an RPC code from a Code. This is the reverse operation from\r\n * mapCodeFromRpcCode and should really only be used in tests.\r\n */\r\nfunction mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}\r\n/**\r\n * Converts an HTTP Status Code to the equivalent error code.\r\n *\r\n * @param status An HTTP Status Code, like 200, 404, 503, etc.\r\n * @returns The equivalent Code. Unknown status codes are mapped to\r\n * Code.UNKNOWN.\r\n */\r\nfunction mapCodeFromHttpStatus(status) {\r\n // The canonical error codes for Google APIs [1] specify mapping onto HTTP\r\n // status codes but the mapping is not bijective. In each case of ambiguity\r\n // this function chooses a primary error.\r\n //\r\n // [1]\r\n // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n switch (status) {\r\n case 200: // OK\r\n return Code.OK;\r\n case 400: // Bad Request\r\n return Code.INVALID_ARGUMENT;\r\n // Other possibilities based on the forward mapping\r\n // return Code.FAILED_PRECONDITION;\r\n // return Code.OUT_OF_RANGE;\r\n case 401: // Unauthorized\r\n return Code.UNAUTHENTICATED;\r\n case 403: // Forbidden\r\n return Code.PERMISSION_DENIED;\r\n case 404: // Not Found\r\n return Code.NOT_FOUND;\r\n case 409: // Conflict\r\n return Code.ABORTED;\r\n // Other possibilities:\r\n // return Code.ALREADY_EXISTS;\r\n case 416: // Range Not Satisfiable\r\n return Code.OUT_OF_RANGE;\r\n case 429: // Too Many Requests\r\n return Code.RESOURCE_EXHAUSTED;\r\n case 499: // Client Closed Request\r\n return Code.CANCELLED;\r\n case 500: // Internal Server Error\r\n return Code.UNKNOWN;\r\n // Other possibilities:\r\n // return Code.INTERNAL;\r\n // return Code.DATA_LOSS;\r\n case 501: // Unimplemented\r\n return Code.UNIMPLEMENTED;\r\n case 503: // Service Unavailable\r\n return Code.UNAVAILABLE;\r\n case 504: // Gateway Timeout\r\n return Code.DEADLINE_EXCEEDED;\r\n default:\r\n if (status >= 200 && status < 300)\r\n return Code.OK;\r\n if (status >= 400 && status < 500)\r\n return Code.FAILED_PRECONDITION;\r\n if (status >= 500 && status < 600)\r\n return Code.INTERNAL;\r\n return Code.UNKNOWN;\r\n }\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * SortedSet is an immutable (copy-on-write) collection that holds elements\r\n * in order specified by the provided comparator.\r\n *\r\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\r\n * be equal!\r\n */\r\nvar SortedSet = /** @class */ (function () {\r\n function SortedSet(comparator) {\r\n this.comparator = comparator;\r\n this.data = new SortedMap(this.comparator);\r\n }\r\n /**\r\n * Creates a SortedSet from the keys of the map.\r\n * This is currently implemented as an O(n) copy.\r\n */\r\n SortedSet.fromMapKeys = function (map) {\r\n var keys = new SortedSet(map.comparator);\r\n map.forEach(function (key) {\r\n keys = keys.add(key);\r\n });\r\n return keys;\r\n };\r\n SortedSet.prototype.has = function (elem) {\r\n return this.data.get(elem) !== null;\r\n };\r\n SortedSet.prototype.first = function () {\r\n return this.data.minKey();\r\n };\r\n SortedSet.prototype.last = function () {\r\n return this.data.maxKey();\r\n };\r\n Object.defineProperty(SortedSet.prototype, \"size\", {\r\n get: function () {\r\n return this.data.size;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n SortedSet.prototype.indexOf = function (elem) {\r\n return this.data.indexOf(elem);\r\n };\r\n /** Iterates elements in order defined by \"comparator\" */\r\n SortedSet.prototype.forEach = function (cb) {\r\n this.data.inorderTraversal(function (k, v) {\r\n cb(k);\r\n return false;\r\n });\r\n };\r\n /** Iterates over `elem`s such that: range[0] <= elem < range[1]. */\r\n SortedSet.prototype.forEachInRange = function (range, cb) {\r\n var iter = this.data.getIteratorFrom(range[0]);\r\n while (iter.hasNext()) {\r\n var elem = iter.getNext();\r\n if (this.comparator(elem.key, range[1]) >= 0)\r\n return;\r\n cb(elem.key);\r\n }\r\n };\r\n /**\r\n * Iterates over `elem`s such that: start <= elem until false is returned.\r\n */\r\n SortedSet.prototype.forEachWhile = function (cb, start) {\r\n var iter;\r\n if (start !== undefined) {\r\n iter = this.data.getIteratorFrom(start);\r\n }\r\n else {\r\n iter = this.data.getIterator();\r\n }\r\n while (iter.hasNext()) {\r\n var elem = iter.getNext();\r\n var result = cb(elem.key);\r\n if (!result)\r\n return;\r\n }\r\n };\r\n /** Finds the least element greater than or equal to `elem`. */\r\n SortedSet.prototype.firstAfterOrEqual = function (elem) {\r\n var iter = this.data.getIteratorFrom(elem);\r\n return iter.hasNext() ? iter.getNext().key : null;\r\n };\r\n /** Inserts or updates an element */\r\n SortedSet.prototype.add = function (elem) {\r\n return this.copy(this.data.remove(elem).insert(elem, true));\r\n };\r\n /** Deletes an element */\r\n SortedSet.prototype.delete = function (elem) {\r\n if (!this.has(elem))\r\n return this;\r\n return this.copy(this.data.remove(elem));\r\n };\r\n SortedSet.prototype.isEmpty = function () {\r\n return this.data.isEmpty();\r\n };\r\n SortedSet.prototype.unionWith = function (other) {\r\n var result = this;\r\n other.forEach(function (elem) {\r\n result = result.add(elem);\r\n });\r\n return result;\r\n };\r\n SortedSet.prototype.isEqual = function (other) {\r\n if (!(other instanceof SortedSet))\r\n return false;\r\n if (this.size !== other.size)\r\n return false;\r\n var thisIt = this.data.getIterator();\r\n var otherIt = other.data.getIterator();\r\n while (thisIt.hasNext()) {\r\n var thisElem = thisIt.getNext().key;\r\n var otherElem = otherIt.getNext().key;\r\n if (this.comparator(thisElem, otherElem) !== 0)\r\n return false;\r\n }\r\n return true;\r\n };\r\n SortedSet.prototype.toArray = function () {\r\n var res = [];\r\n this.forEach(function (targetId) {\r\n res.push(targetId);\r\n });\r\n return res;\r\n };\r\n SortedSet.prototype.toString = function () {\r\n var result = [];\r\n this.forEach(function (elem) { return result.push(elem); });\r\n return 'SortedSet(' + result.toString() + ')';\r\n };\r\n SortedSet.prototype[Symbol.iterator] = function () {\r\n var it = this.data.getIterator();\r\n return {\r\n next: function () {\r\n if (it.hasNext()) {\r\n return { done: false, value: it.getNext().key };\r\n }\r\n else {\r\n // The TypeScript typings don't allow `undefined` for Iterator,\r\n // so we return an empty object instead.\r\n return { done: true, value: {} };\r\n }\r\n }\r\n };\r\n };\r\n SortedSet.prototype.copy = function (data) {\r\n var result = new SortedSet(this.comparator);\r\n result.data = data;\r\n return result;\r\n };\r\n return SortedSet;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar EMPTY_MAYBE_DOCUMENT_MAP = new SortedMap(DocumentKey.comparator);\r\nfunction maybeDocumentMap() {\r\n return EMPTY_MAYBE_DOCUMENT_MAP;\r\n}\r\nvar EMPTY_DOCUMENT_MAP = new SortedMap(DocumentKey.comparator);\r\nfunction documentMap() {\r\n return EMPTY_DOCUMENT_MAP;\r\n}\r\nvar EMPTY_DOCUMENT_VERSION_MAP = new SortedMap(DocumentKey.comparator);\r\nfunction documentVersionMap() {\r\n return EMPTY_DOCUMENT_VERSION_MAP;\r\n}\r\nvar EMPTY_DOCUMENT_KEY_SET = new SortedSet(DocumentKey.comparator);\r\nfunction documentKeySet() {\r\n return EMPTY_DOCUMENT_KEY_SET;\r\n}\r\nvar EMPTY_TARGET_ID_SET = new SortedSet(primitiveComparator);\r\nfunction targetIdSet() {\r\n return EMPTY_TARGET_ID_SET;\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\r\n * in order specified by the provided comparator. We always add a document key\r\n * comparator on top of what is provided to guarantee document equality based on\r\n * the key.\r\n */\r\nvar DocumentSet = /** @class */ (function () {\r\n /** The default ordering is by key if the comparator is omitted */\r\n function DocumentSet(comp) {\r\n // We are adding document key comparator to the end as it's the only\r\n // guaranteed unique property of a document.\r\n if (comp) {\r\n this.comparator = function (d1, d2) {\r\n return comp(d1, d2) || DocumentKey.comparator(d1.key, d2.key);\r\n };\r\n }\r\n else {\r\n this.comparator = function (d1, d2) {\r\n return DocumentKey.comparator(d1.key, d2.key);\r\n };\r\n }\r\n this.keyedMap = documentMap();\r\n this.sortedSet = new SortedMap(this.comparator);\r\n }\r\n /**\r\n * Returns an empty copy of the existing DocumentSet, using the same\r\n * comparator.\r\n */\r\n DocumentSet.emptySet = function (oldSet) {\r\n return new DocumentSet(oldSet.comparator);\r\n };\r\n DocumentSet.prototype.has = function (key) {\r\n return this.keyedMap.get(key) != null;\r\n };\r\n DocumentSet.prototype.get = function (key) {\r\n return this.keyedMap.get(key);\r\n };\r\n DocumentSet.prototype.first = function () {\r\n return this.sortedSet.minKey();\r\n };\r\n DocumentSet.prototype.last = function () {\r\n return this.sortedSet.maxKey();\r\n };\r\n DocumentSet.prototype.isEmpty = function () {\r\n return this.sortedSet.isEmpty();\r\n };\r\n /**\r\n * Returns the index of the provided key in the document set, or -1 if the\r\n * document key is not present in the set;\r\n */\r\n DocumentSet.prototype.indexOf = function (key) {\r\n var doc = this.keyedMap.get(key);\r\n return doc ? this.sortedSet.indexOf(doc) : -1;\r\n };\r\n Object.defineProperty(DocumentSet.prototype, \"size\", {\r\n get: function () {\r\n return this.sortedSet.size;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /** Iterates documents in order defined by \"comparator\" */\r\n DocumentSet.prototype.forEach = function (cb) {\r\n this.sortedSet.inorderTraversal(function (k, v) {\r\n cb(k);\r\n return false;\r\n });\r\n };\r\n /** Inserts or updates a document with the same key */\r\n DocumentSet.prototype.add = function (doc) {\r\n // First remove the element if we have it.\r\n var set = this.delete(doc.key);\r\n return set.copy(set.keyedMap.insert(doc.key, doc), set.sortedSet.insert(doc, null));\r\n };\r\n /** Deletes a document with a given key */\r\n DocumentSet.prototype.delete = function (key) {\r\n var doc = this.get(key);\r\n if (!doc) {\r\n return this;\r\n }\r\n return this.copy(this.keyedMap.remove(key), this.sortedSet.remove(doc));\r\n };\r\n DocumentSet.prototype.isEqual = function (other) {\r\n if (!(other instanceof DocumentSet))\r\n return false;\r\n if (this.size !== other.size)\r\n return false;\r\n var thisIt = this.sortedSet.getIterator();\r\n var otherIt = other.sortedSet.getIterator();\r\n while (thisIt.hasNext()) {\r\n var thisDoc = thisIt.getNext().key;\r\n var otherDoc = otherIt.getNext().key;\r\n if (!thisDoc.isEqual(otherDoc))\r\n return false;\r\n }\r\n return true;\r\n };\r\n DocumentSet.prototype.toString = function () {\r\n var docStrings = [];\r\n this.forEach(function (doc) {\r\n docStrings.push(doc.toString());\r\n });\r\n if (docStrings.length === 0) {\r\n return 'DocumentSet ()';\r\n }\r\n else {\r\n return 'DocumentSet (\\n ' + docStrings.join(' \\n') + '\\n)';\r\n }\r\n };\r\n DocumentSet.prototype.copy = function (keyedMap, sortedSet) {\r\n var newSet = new DocumentSet();\r\n newSet.comparator = this.comparator;\r\n newSet.keyedMap = keyedMap;\r\n newSet.sortedSet = sortedSet;\r\n return newSet;\r\n };\r\n return DocumentSet;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar ChangeType;\r\n(function (ChangeType) {\r\n ChangeType[ChangeType[\"Added\"] = 0] = \"Added\";\r\n ChangeType[ChangeType[\"Removed\"] = 1] = \"Removed\";\r\n ChangeType[ChangeType[\"Modified\"] = 2] = \"Modified\";\r\n ChangeType[ChangeType[\"Metadata\"] = 3] = \"Metadata\";\r\n})(ChangeType || (ChangeType = {}));\r\nvar SyncState;\r\n(function (SyncState) {\r\n SyncState[SyncState[\"Local\"] = 0] = \"Local\";\r\n SyncState[SyncState[\"Synced\"] = 1] = \"Synced\";\r\n})(SyncState || (SyncState = {}));\r\n/**\r\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\r\n * duplicate events for the same doc.\r\n */\r\nvar DocumentChangeSet = /** @class */ (function () {\r\n function DocumentChangeSet() {\r\n this.changeMap = new SortedMap(DocumentKey.comparator);\r\n }\r\n DocumentChangeSet.prototype.track = function (change) {\r\n var key = change.doc.key;\r\n var oldChange = this.changeMap.get(key);\r\n if (!oldChange) {\r\n this.changeMap = this.changeMap.insert(key, change);\r\n return;\r\n }\r\n // Merge the new change with the existing change.\r\n if (change.type !== ChangeType.Added &&\r\n oldChange.type === ChangeType.Metadata) {\r\n this.changeMap = this.changeMap.insert(key, change);\r\n }\r\n else if (change.type === ChangeType.Metadata &&\r\n oldChange.type !== ChangeType.Removed) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: oldChange.type,\r\n doc: change.doc\r\n });\r\n }\r\n else if (change.type === ChangeType.Modified &&\r\n oldChange.type === ChangeType.Modified) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: ChangeType.Modified,\r\n doc: change.doc\r\n });\r\n }\r\n else if (change.type === ChangeType.Modified &&\r\n oldChange.type === ChangeType.Added) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: ChangeType.Added,\r\n doc: change.doc\r\n });\r\n }\r\n else if (change.type === ChangeType.Removed &&\r\n oldChange.type === ChangeType.Added) {\r\n this.changeMap = this.changeMap.remove(key);\r\n }\r\n else if (change.type === ChangeType.Removed &&\r\n oldChange.type === ChangeType.Modified) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: ChangeType.Removed,\r\n doc: oldChange.doc\r\n });\r\n }\r\n else if (change.type === ChangeType.Added &&\r\n oldChange.type === ChangeType.Removed) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: ChangeType.Modified,\r\n doc: change.doc\r\n });\r\n }\r\n else {\r\n // This includes these cases, which don't make sense:\r\n // Added->Added\r\n // Removed->Removed\r\n // Modified->Added\r\n // Removed->Modified\r\n // Metadata->Added\r\n // Removed->Metadata\r\n fail('unsupported combination of changes: ' +\r\n JSON.stringify(change) +\r\n ' after ' +\r\n JSON.stringify(oldChange));\r\n }\r\n };\r\n DocumentChangeSet.prototype.getChanges = function () {\r\n var changes = [];\r\n this.changeMap.inorderTraversal(function (key, change) {\r\n changes.push(change);\r\n });\r\n return changes;\r\n };\r\n return DocumentChangeSet;\r\n}());\r\nvar ViewSnapshot = /** @class */ (function () {\r\n function ViewSnapshot(query, docs, oldDocs, docChanges, mutatedKeys, fromCache, syncStateChanged, excludesMetadataChanges) {\r\n this.query = query;\r\n this.docs = docs;\r\n this.oldDocs = oldDocs;\r\n this.docChanges = docChanges;\r\n this.mutatedKeys = mutatedKeys;\r\n this.fromCache = fromCache;\r\n this.syncStateChanged = syncStateChanged;\r\n this.excludesMetadataChanges = excludesMetadataChanges;\r\n }\r\n /** Returns a view snapshot as if all documents in the snapshot were added. */\r\n ViewSnapshot.fromInitialDocuments = function (query, documents, mutatedKeys, fromCache) {\r\n var changes = [];\r\n documents.forEach(function (doc) {\r\n changes.push({ type: ChangeType.Added, doc: doc });\r\n });\r\n return new ViewSnapshot(query, documents, DocumentSet.emptySet(documents), changes, mutatedKeys, fromCache, true, false);\r\n };\r\n Object.defineProperty(ViewSnapshot.prototype, \"hasPendingWrites\", {\r\n get: function () {\r\n return !this.mutatedKeys.isEmpty();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ViewSnapshot.prototype.isEqual = function (other) {\r\n if (this.fromCache !== other.fromCache ||\r\n this.syncStateChanged !== other.syncStateChanged ||\r\n !this.mutatedKeys.isEqual(other.mutatedKeys) ||\r\n !this.query.isEqual(other.query) ||\r\n !this.docs.isEqual(other.docs) ||\r\n !this.oldDocs.isEqual(other.oldDocs)) {\r\n return false;\r\n }\r\n var changes = this.docChanges;\r\n var otherChanges = other.docChanges;\r\n if (changes.length !== otherChanges.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < changes.length; i++) {\r\n if (changes[i].type !== otherChanges[i].type ||\r\n !changes[i].doc.isEqual(otherChanges[i].doc)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return ViewSnapshot;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An event from the RemoteStore. It is split into targetChanges (changes to the\r\n * state or the set of documents in our watched targets) and documentUpdates\r\n * (changes to the actual documents).\r\n */\r\nvar RemoteEvent = /** @class */ (function () {\r\n function RemoteEvent(\r\n /**\r\n * The snapshot version this event brings us up to, or MIN if not set.\r\n */\r\n snapshotVersion, \r\n /**\r\n * A map from target to changes to the target. See TargetChange.\r\n */\r\n targetChanges, \r\n /**\r\n * A set of targets that is known to be inconsistent. Listens for these\r\n * targets should be re-established without resume tokens.\r\n */\r\n targetMismatches, \r\n /**\r\n * A set of which documents have changed or been deleted, along with the\r\n * doc's new values (if not deleted).\r\n */\r\n documentUpdates, \r\n /**\r\n * A set of which document updates are due only to limbo resolution targets.\r\n */\r\n resolvedLimboDocuments) {\r\n this.snapshotVersion = snapshotVersion;\r\n this.targetChanges = targetChanges;\r\n this.targetMismatches = targetMismatches;\r\n this.documentUpdates = documentUpdates;\r\n this.resolvedLimboDocuments = resolvedLimboDocuments;\r\n }\r\n /**\r\n * HACK: Views require RemoteEvents in order to determine whether the view is\r\n * CURRENT, but secondary tabs don't receive remote events. So this method is\r\n * used to create a synthesized RemoteEvent that can be used to apply a\r\n * CURRENT status change to a View, for queries executed in a different tab.\r\n */\r\n // PORTING NOTE: Multi-tab only\r\n RemoteEvent.createSynthesizedRemoteEventForCurrentChange = function (targetId, current) {\r\n var targetChanges = (_a = {}, _a[targetId] = TargetChange.createSynthesizedTargetChangeForCurrentChange(targetId, current), _a);\r\n return new RemoteEvent(SnapshotVersion.MIN, targetChanges, targetIdSet(), maybeDocumentMap(), documentKeySet());\r\n var _a;\r\n };\r\n return RemoteEvent;\r\n}());\r\n/**\r\n * A TargetChange specifies the set of changes for a specific target as part of\r\n * a RemoteEvent. These changes track which documents are added, modified or\r\n * removed, as well as the target's resume token and whether the target is\r\n * marked CURRENT.\r\n * The actual changes *to* documents are not part of the TargetChange since\r\n * documents may be part of multiple targets.\r\n */\r\nvar TargetChange = /** @class */ (function () {\r\n function TargetChange(\r\n /**\r\n * An opaque, server-assigned token that allows watching a query to be resumed\r\n * after disconnecting without retransmitting all the data that matches the\r\n * query. The resume token essentially identifies a point in time from which\r\n * the server should resume sending results.\r\n */\r\n resumeToken, \r\n /**\r\n * The \"current\" (synced) status of this target. Note that \"current\"\r\n * has special meaning in the RPC protocol that implies that a target is\r\n * both up-to-date and consistent with the rest of the watch stream.\r\n */\r\n current, \r\n /**\r\n * The set of documents that were newly assigned to this target as part of\r\n * this remote event.\r\n */\r\n addedDocuments, \r\n /**\r\n * The set of documents that were already assigned to this target but received\r\n * an update during this remote event.\r\n */\r\n modifiedDocuments, \r\n /**\r\n * The set of documents that were removed from this target as part of this\r\n * remote event.\r\n */\r\n removedDocuments) {\r\n this.resumeToken = resumeToken;\r\n this.current = current;\r\n this.addedDocuments = addedDocuments;\r\n this.modifiedDocuments = modifiedDocuments;\r\n this.removedDocuments = removedDocuments;\r\n }\r\n /**\r\n * HACK: Views require TargetChanges in order to determine whether the view is\r\n * CURRENT, but secondary tabs don't receive remote events. So this method is\r\n * used to create a synthesized TargetChanges that can be used to apply a\r\n * CURRENT status change to a View, for queries executed in a different tab.\r\n */\r\n // PORTING NOTE: Multi-tab only\r\n TargetChange.createSynthesizedTargetChangeForCurrentChange = function (targetId, current) {\r\n return new TargetChange(emptyByteString(), current, documentKeySet(), documentKeySet(), documentKeySet());\r\n };\r\n return TargetChange;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents a changed document and a list of target ids to which this change\r\n * applies.\r\n *\r\n * If document has been deleted NoDocument will be provided.\r\n */\r\nvar DocumentWatchChange = /** @class */ (function () {\r\n function DocumentWatchChange(\r\n /** The new document applies to all of these targets. */\r\n updatedTargetIds, \r\n /** The new document is removed from all of these targets. */\r\n removedTargetIds, \r\n /** The key of the document for this change. */\r\n key, \r\n /**\r\n * The new document or NoDocument if it was deleted. Is null if the\r\n * document went out of view without the server sending a new document.\r\n */\r\n newDoc) {\r\n this.updatedTargetIds = updatedTargetIds;\r\n this.removedTargetIds = removedTargetIds;\r\n this.key = key;\r\n this.newDoc = newDoc;\r\n }\r\n return DocumentWatchChange;\r\n}());\r\nvar ExistenceFilterChange = /** @class */ (function () {\r\n function ExistenceFilterChange(targetId, existenceFilter) {\r\n this.targetId = targetId;\r\n this.existenceFilter = existenceFilter;\r\n }\r\n return ExistenceFilterChange;\r\n}());\r\nvar WatchTargetChangeState;\r\n(function (WatchTargetChangeState) {\r\n WatchTargetChangeState[WatchTargetChangeState[\"NoChange\"] = 0] = \"NoChange\";\r\n WatchTargetChangeState[WatchTargetChangeState[\"Added\"] = 1] = \"Added\";\r\n WatchTargetChangeState[WatchTargetChangeState[\"Removed\"] = 2] = \"Removed\";\r\n WatchTargetChangeState[WatchTargetChangeState[\"Current\"] = 3] = \"Current\";\r\n WatchTargetChangeState[WatchTargetChangeState[\"Reset\"] = 4] = \"Reset\";\r\n})(WatchTargetChangeState || (WatchTargetChangeState = {}));\r\nvar WatchTargetChange = /** @class */ (function () {\r\n function WatchTargetChange(\r\n /** What kind of change occurred to the watch target. */\r\n state, \r\n /** The target IDs that were added/removed/set. */\r\n targetIds, \r\n /**\r\n * An opaque, server-assigned token that allows watching a query to be\r\n * resumed after disconnecting without retransmitting all the data that\r\n * matches the query. The resume token essentially identifies a point in\r\n * time from which the server should resume sending results.\r\n */\r\n resumeToken, \r\n /** An RPC error indicating why the watch failed. */\r\n cause) {\r\n if (resumeToken === void 0) { resumeToken = emptyByteString(); }\r\n if (cause === void 0) { cause = null; }\r\n this.state = state;\r\n this.targetIds = targetIds;\r\n this.resumeToken = resumeToken;\r\n this.cause = cause;\r\n }\r\n return WatchTargetChange;\r\n}());\r\n/** Tracks the internal state of a Watch target. */\r\nvar TargetState = /** @class */ (function () {\r\n function TargetState() {\r\n /**\r\n * The number of pending responses (adds or removes) that we are waiting on.\r\n * We only consider targets active that have no pending responses.\r\n */\r\n this.pendingResponses = 0;\r\n /**\r\n * Keeps track of the document changes since the last raised snapshot.\r\n *\r\n * These changes are continuously updated as we receive document updates and\r\n * always reflect the current set of changes against the last issued snapshot.\r\n */\r\n this.documentChanges = snapshotChangesMap();\r\n /** See public getters for explanations of these fields. */\r\n this._resumeToken = emptyByteString();\r\n this._current = false;\r\n /**\r\n * Whether this target state should be included in the next snapshot. We\r\n * initialize to true so that newly-added targets are included in the next\r\n * RemoteEvent.\r\n */\r\n this._hasPendingChanges = true;\r\n }\r\n Object.defineProperty(TargetState.prototype, \"current\", {\r\n /**\r\n * Whether this target has been marked 'current'.\r\n *\r\n * 'Current' has special meaning in the RPC protocol: It implies that the\r\n * Watch backend has sent us all changes up to the point at which the target\r\n * was added and that the target is consistent with the rest of the watch\r\n * stream.\r\n */\r\n get: function () {\r\n return this._current;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TargetState.prototype, \"resumeToken\", {\r\n /** The last resume token sent to us for this target. */\r\n get: function () {\r\n return this._resumeToken;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TargetState.prototype, \"isPending\", {\r\n /** Whether this target has pending target adds or target removes. */\r\n get: function () {\r\n return this.pendingResponses !== 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TargetState.prototype, \"hasPendingChanges\", {\r\n /** Whether we have modified any state that should trigger a snapshot. */\r\n get: function () {\r\n return this._hasPendingChanges;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Applies the resume token to the TargetChange, but only when it has a new\r\n * value. Empty resumeTokens are discarded.\r\n */\r\n TargetState.prototype.updateResumeToken = function (resumeToken) {\r\n if (resumeToken.length > 0) {\r\n this._hasPendingChanges = true;\r\n this._resumeToken = resumeToken;\r\n }\r\n };\r\n /**\r\n * Creates a target change from the current set of changes.\r\n *\r\n * To reset the document changes after raising this snapshot, call\r\n * `clearPendingChanges()`.\r\n */\r\n TargetState.prototype.toTargetChange = function () {\r\n var addedDocuments = documentKeySet();\r\n var modifiedDocuments = documentKeySet();\r\n var removedDocuments = documentKeySet();\r\n this.documentChanges.forEach(function (key, changeType) {\r\n switch (changeType) {\r\n case ChangeType.Added:\r\n addedDocuments = addedDocuments.add(key);\r\n break;\r\n case ChangeType.Modified:\r\n modifiedDocuments = modifiedDocuments.add(key);\r\n break;\r\n case ChangeType.Removed:\r\n removedDocuments = removedDocuments.add(key);\r\n break;\r\n default:\r\n fail('Encountered invalid change type: ' + changeType);\r\n }\r\n });\r\n return new TargetChange(this._resumeToken, this._current, addedDocuments, modifiedDocuments, removedDocuments);\r\n };\r\n /**\r\n * Resets the document changes and sets `hasPendingChanges` to false.\r\n */\r\n TargetState.prototype.clearPendingChanges = function () {\r\n this._hasPendingChanges = false;\r\n this.documentChanges = snapshotChangesMap();\r\n };\r\n TargetState.prototype.addDocumentChange = function (key, changeType) {\r\n this._hasPendingChanges = true;\r\n this.documentChanges = this.documentChanges.insert(key, changeType);\r\n };\r\n TargetState.prototype.removeDocumentChange = function (key) {\r\n this._hasPendingChanges = true;\r\n this.documentChanges = this.documentChanges.remove(key);\r\n };\r\n TargetState.prototype.recordPendingTargetRequest = function () {\r\n this.pendingResponses += 1;\r\n };\r\n TargetState.prototype.recordTargetResponse = function () {\r\n this.pendingResponses -= 1;\r\n };\r\n TargetState.prototype.markCurrent = function () {\r\n this._hasPendingChanges = true;\r\n this._current = true;\r\n };\r\n return TargetState;\r\n}());\r\n/**\r\n * A helper class to accumulate watch changes into a RemoteEvent.\r\n */\r\nvar WatchChangeAggregator = /** @class */ (function () {\r\n function WatchChangeAggregator(metadataProvider) {\r\n this.metadataProvider = metadataProvider;\r\n /** The internal state of all tracked targets. */\r\n this.targetStates = {};\r\n /** Keeps track of the documents to update since the last raised snapshot. */\r\n this.pendingDocumentUpdates = maybeDocumentMap();\r\n /** A mapping of document keys to their set of target IDs. */\r\n this.pendingDocumentTargetMapping = documentTargetMap();\r\n /**\r\n * A list of targets with existence filter mismatches. These targets are\r\n * known to be inconsistent and their listens needs to be re-established by\r\n * RemoteStore.\r\n */\r\n this.pendingTargetResets = new SortedSet(primitiveComparator);\r\n }\r\n /**\r\n * Processes and adds the DocumentWatchChange to the current set of changes.\r\n */\r\n WatchChangeAggregator.prototype.handleDocumentChange = function (docChange) {\r\n for (var _i = 0, _a = docChange.updatedTargetIds; _i < _a.length; _i++) {\r\n var targetId = _a[_i];\r\n if (docChange.newDoc instanceof Document) {\r\n this.addDocumentToTarget(targetId, docChange.newDoc);\r\n }\r\n else if (docChange.newDoc instanceof NoDocument) {\r\n this.removeDocumentFromTarget(targetId, docChange.key, docChange.newDoc);\r\n }\r\n }\r\n for (var _b = 0, _c = docChange.removedTargetIds; _b < _c.length; _b++) {\r\n var targetId = _c[_b];\r\n this.removeDocumentFromTarget(targetId, docChange.key, docChange.newDoc);\r\n }\r\n };\r\n /** Processes and adds the WatchTargetChange to the current set of changes. */\r\n WatchChangeAggregator.prototype.handleTargetChange = function (targetChange) {\r\n var _this = this;\r\n this.forEachTarget(targetChange, function (targetId) {\r\n var targetState = _this.ensureTargetState(targetId);\r\n switch (targetChange.state) {\r\n case WatchTargetChangeState.NoChange:\r\n if (_this.isActiveTarget(targetId)) {\r\n targetState.updateResumeToken(targetChange.resumeToken);\r\n }\r\n break;\r\n case WatchTargetChangeState.Added:\r\n // We need to decrement the number of pending acks needed from watch\r\n // for this targetId.\r\n targetState.recordTargetResponse();\r\n if (!targetState.isPending) {\r\n // We have a freshly added target, so we need to reset any state\r\n // that we had previously. This can happen e.g. when remove and add\r\n // back a target for existence filter mismatches.\r\n targetState.clearPendingChanges();\r\n }\r\n targetState.updateResumeToken(targetChange.resumeToken);\r\n break;\r\n case WatchTargetChangeState.Removed:\r\n // We need to keep track of removed targets to we can post-filter and\r\n // remove any target changes.\r\n // We need to decrement the number of pending acks needed from watch\r\n // for this targetId.\r\n targetState.recordTargetResponse();\r\n if (!targetState.isPending) {\r\n _this.removeTarget(targetId);\r\n }\r\n assert(!targetChange.cause, 'WatchChangeAggregator does not handle errored targets');\r\n break;\r\n case WatchTargetChangeState.Current:\r\n if (_this.isActiveTarget(targetId)) {\r\n targetState.markCurrent();\r\n targetState.updateResumeToken(targetChange.resumeToken);\r\n }\r\n break;\r\n case WatchTargetChangeState.Reset:\r\n if (_this.isActiveTarget(targetId)) {\r\n // Reset the target and synthesizes removes for all existing\r\n // documents. The backend will re-add any documents that still\r\n // match the target before it sends the next global snapshot.\r\n _this.resetTarget(targetId);\r\n targetState.updateResumeToken(targetChange.resumeToken);\r\n }\r\n break;\r\n default:\r\n fail('Unknown target watch change state: ' + targetChange.state);\r\n }\r\n });\r\n };\r\n /**\r\n * Iterates over all targetIds that the watch change applies to: either the\r\n * targetIds explicitly listed in the change or the targetIds of all currently\r\n * active targets.\r\n */\r\n WatchChangeAggregator.prototype.forEachTarget = function (targetChange, fn) {\r\n if (targetChange.targetIds.length > 0) {\r\n targetChange.targetIds.forEach(fn);\r\n }\r\n else {\r\n forEachNumber(this.targetStates, fn);\r\n }\r\n };\r\n /**\r\n * Handles existence filters and synthesizes deletes for filter mismatches.\r\n * Targets that are invalidated by filter mismatches are added to\r\n * `pendingTargetResets`.\r\n */\r\n WatchChangeAggregator.prototype.handleExistenceFilter = function (watchChange) {\r\n var targetId = watchChange.targetId;\r\n var expectedCount = watchChange.existenceFilter.count;\r\n var queryData = this.queryDataForActiveTarget(targetId);\r\n if (queryData) {\r\n var query = queryData.query;\r\n if (query.isDocumentQuery()) {\r\n if (expectedCount === 0) {\r\n // The existence filter told us the document does not exist. We deduce\r\n // that this document does not exist and apply a deleted document to\r\n // our updates. Without applying this deleted document there might be\r\n // another query that will raise this document as part of a snapshot\r\n // until it is resolved, essentially exposing inconsistency between\r\n // queries.\r\n var key = new DocumentKey(query.path);\r\n this.removeDocumentFromTarget(targetId, key, new NoDocument(key, SnapshotVersion.forDeletedDoc()));\r\n }\r\n else {\r\n assert(expectedCount === 1, 'Single document existence filter with count: ' + expectedCount);\r\n }\r\n }\r\n else {\r\n var currentSize = this.getCurrentDocumentCountForTarget(targetId);\r\n if (currentSize !== expectedCount) {\r\n // Existence filter mismatch: We reset the mapping and raise a new\r\n // snapshot with `isFromCache:true`.\r\n this.resetTarget(targetId);\r\n this.pendingTargetResets = this.pendingTargetResets.add(targetId);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Converts the currently accumulated state into a remote event at the\r\n * provided snapshot version. Resets the accumulated changes before returning.\r\n */\r\n WatchChangeAggregator.prototype.createRemoteEvent = function (snapshotVersion) {\r\n var _this = this;\r\n var targetChanges = {};\r\n forEachNumber(this.targetStates, function (targetId, targetState) {\r\n var queryData = _this.queryDataForActiveTarget(targetId);\r\n if (queryData) {\r\n if (targetState.current && queryData.query.isDocumentQuery()) {\r\n // Document queries for document that don't exist can produce an empty\r\n // result set. To update our local cache, we synthesize a document\r\n // delete if we have not previously received the document. This\r\n // resolves the limbo state of the document, removing it from\r\n // limboDocumentRefs.\r\n //\r\n // TODO(dimond): Ideally we would have an explicit lookup query\r\n // instead resulting in an explicit delete message and we could\r\n // remove this special logic.\r\n var key = new DocumentKey(queryData.query.path);\r\n if (_this.pendingDocumentUpdates.get(key) === null &&\r\n !_this.targetContainsDocument(targetId, key)) {\r\n _this.removeDocumentFromTarget(targetId, key, new NoDocument(key, snapshotVersion));\r\n }\r\n }\r\n if (targetState.hasPendingChanges) {\r\n targetChanges[targetId] = targetState.toTargetChange();\r\n targetState.clearPendingChanges();\r\n }\r\n }\r\n });\r\n var resolvedLimboDocuments = documentKeySet();\r\n // We extract the set of limbo-only document updates as the GC logic\r\n // special-cases documents that do not appear in the query cache.\r\n //\r\n // TODO(gsoltis): Expand on this comment once GC is available in the JS\r\n // client.\r\n this.pendingDocumentTargetMapping.forEach(function (key, targets) {\r\n var isOnlyLimboTarget = true;\r\n targets.forEachWhile(function (targetId) {\r\n var queryData = _this.queryDataForActiveTarget(targetId);\r\n if (queryData && queryData.purpose !== QueryPurpose.LimboResolution) {\r\n isOnlyLimboTarget = false;\r\n return false;\r\n }\r\n return true;\r\n });\r\n if (isOnlyLimboTarget) {\r\n resolvedLimboDocuments = resolvedLimboDocuments.add(key);\r\n }\r\n });\r\n var remoteEvent = new RemoteEvent(snapshotVersion, targetChanges, this.pendingTargetResets, this.pendingDocumentUpdates, resolvedLimboDocuments);\r\n this.pendingDocumentUpdates = maybeDocumentMap();\r\n this.pendingDocumentTargetMapping = documentTargetMap();\r\n this.pendingTargetResets = new SortedSet(primitiveComparator);\r\n return remoteEvent;\r\n };\r\n /**\r\n * Adds the provided document to the internal list of document updates and\r\n * its document key to the given target's mapping.\r\n */\r\n // Visible for testing.\r\n WatchChangeAggregator.prototype.addDocumentToTarget = function (targetId, document) {\r\n if (!this.isActiveTarget(targetId)) {\r\n return;\r\n }\r\n var changeType = this.targetContainsDocument(targetId, document.key)\r\n ? ChangeType.Modified\r\n : ChangeType.Added;\r\n var targetState = this.ensureTargetState(targetId);\r\n targetState.addDocumentChange(document.key, changeType);\r\n this.pendingDocumentUpdates = this.pendingDocumentUpdates.insert(document.key, document);\r\n this.pendingDocumentTargetMapping = this.pendingDocumentTargetMapping.insert(document.key, this.ensureDocumentTargetMapping(document.key).add(targetId));\r\n };\r\n /**\r\n * Removes the provided document from the target mapping. If the\r\n * document no longer matches the target, but the document's state is still\r\n * known (e.g. we know that the document was deleted or we received the change\r\n * that caused the filter mismatch), the new document can be provided\r\n * to update the remote document cache.\r\n */\r\n // Visible for testing.\r\n WatchChangeAggregator.prototype.removeDocumentFromTarget = function (targetId, key, updatedDocument) {\r\n if (!this.isActiveTarget(targetId)) {\r\n return;\r\n }\r\n var targetState = this.ensureTargetState(targetId);\r\n if (this.targetContainsDocument(targetId, key)) {\r\n targetState.addDocumentChange(key, ChangeType.Removed);\r\n }\r\n else {\r\n // The document may have entered and left the target before we raised a\r\n // snapshot, so we can just ignore the change.\r\n targetState.removeDocumentChange(key);\r\n }\r\n this.pendingDocumentTargetMapping = this.pendingDocumentTargetMapping.insert(key, this.ensureDocumentTargetMapping(key).delete(targetId));\r\n if (updatedDocument) {\r\n this.pendingDocumentUpdates = this.pendingDocumentUpdates.insert(key, updatedDocument);\r\n }\r\n };\r\n WatchChangeAggregator.prototype.removeTarget = function (targetId) {\r\n delete this.targetStates[targetId];\r\n };\r\n /**\r\n * Returns the current count of documents in the target. This includes both\r\n * the number of documents that the LocalStore considers to be part of the\r\n * target as well as any accumulated changes.\r\n */\r\n WatchChangeAggregator.prototype.getCurrentDocumentCountForTarget = function (targetId) {\r\n var targetState = this.ensureTargetState(targetId);\r\n var targetChange = targetState.toTargetChange();\r\n return (this.metadataProvider.getRemoteKeysForTarget(targetId).size +\r\n targetChange.addedDocuments.size -\r\n targetChange.removedDocuments.size);\r\n };\r\n /**\r\n * Increment the number of acks needed from watch before we can consider the\r\n * server to be 'in-sync' with the client's active targets.\r\n */\r\n WatchChangeAggregator.prototype.recordPendingTargetRequest = function (targetId) {\r\n // For each request we get we need to record we need a response for it.\r\n var targetState = this.ensureTargetState(targetId);\r\n targetState.recordPendingTargetRequest();\r\n };\r\n WatchChangeAggregator.prototype.ensureTargetState = function (targetId) {\r\n if (!this.targetStates[targetId]) {\r\n this.targetStates[targetId] = new TargetState();\r\n }\r\n return this.targetStates[targetId];\r\n };\r\n WatchChangeAggregator.prototype.ensureDocumentTargetMapping = function (key) {\r\n var targetMapping = this.pendingDocumentTargetMapping.get(key);\r\n if (!targetMapping) {\r\n targetMapping = new SortedSet(primitiveComparator);\r\n this.pendingDocumentTargetMapping = this.pendingDocumentTargetMapping.insert(key, targetMapping);\r\n }\r\n return targetMapping;\r\n };\r\n /**\r\n * Verifies that the user is still interested in this target (by calling\r\n * `getQueryDataForTarget()`) and that we are not waiting for pending ADDs\r\n * from watch.\r\n */\r\n WatchChangeAggregator.prototype.isActiveTarget = function (targetId) {\r\n return this.queryDataForActiveTarget(targetId) !== null;\r\n };\r\n /**\r\n * Returns the QueryData for an active target (i.e. a target that the user\r\n * is still interested in that has no outstanding target change requests).\r\n */\r\n WatchChangeAggregator.prototype.queryDataForActiveTarget = function (targetId) {\r\n var targetState = this.targetStates[targetId];\r\n return targetState && targetState.isPending\r\n ? null\r\n : this.metadataProvider.getQueryDataForTarget(targetId);\r\n };\r\n /**\r\n * Resets the state of a Watch target to its initial state (e.g. sets\r\n * 'current' to false, clears the resume token and removes its target mapping\r\n * from all documents).\r\n */\r\n WatchChangeAggregator.prototype.resetTarget = function (targetId) {\r\n var _this = this;\r\n assert(!this.targetStates[targetId].isPending, 'Should only reset active targets');\r\n this.targetStates[targetId] = new TargetState();\r\n // Trigger removal for any documents currently mapped to this target.\r\n // These removals will be part of the initial snapshot if Watch does not\r\n // resend these documents.\r\n var existingKeys = this.metadataProvider.getRemoteKeysForTarget(targetId);\r\n existingKeys.forEach(function (key) {\r\n _this.removeDocumentFromTarget(targetId, key, /*updatedDocument=*/ null);\r\n });\r\n };\r\n /**\r\n * Returns whether the LocalStore considers the document to be part of the\r\n * specified target.\r\n */\r\n WatchChangeAggregator.prototype.targetContainsDocument = function (targetId, key) {\r\n var existingKeys = this.metadataProvider.getRemoteKeysForTarget(targetId);\r\n return existingKeys.has(key);\r\n };\r\n return WatchChangeAggregator;\r\n}());\r\nfunction documentTargetMap() {\r\n return new SortedMap(DocumentKey.comparator);\r\n}\r\nfunction snapshotChangesMap() {\r\n return new SortedMap(DocumentKey.comparator);\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DIRECTIONS = (function () {\r\n var dirs = {};\r\n dirs[Direction.ASCENDING.name] = 'ASCENDING';\r\n dirs[Direction.DESCENDING.name] = 'DESCENDING';\r\n return dirs;\r\n})();\r\nvar OPERATORS = (function () {\r\n var ops = {};\r\n ops[RelationOp.LESS_THAN.name] = 'LESS_THAN';\r\n ops[RelationOp.LESS_THAN_OR_EQUAL.name] = 'LESS_THAN_OR_EQUAL';\r\n ops[RelationOp.GREATER_THAN.name] = 'GREATER_THAN';\r\n ops[RelationOp.GREATER_THAN_OR_EQUAL.name] = 'GREATER_THAN_OR_EQUAL';\r\n ops[RelationOp.EQUAL.name] = 'EQUAL';\r\n ops[RelationOp.ARRAY_CONTAINS.name] = 'ARRAY_CONTAINS';\r\n return ops;\r\n})();\r\n// A RegExp matching ISO 8601 UTC timestamps with optional fraction.\r\nvar ISO_REG_EXP = new RegExp(/^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.(\\d+))?Z$/);\r\nfunction assertPresent(value, description) {\r\n assert(!isNullOrUndefined(value), description + ' is missing');\r\n}\r\nfunction parseInt64(value) {\r\n // TODO(bjornick): Handle int64 greater than 53 bits.\r\n if (typeof value === 'number') {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n return Number(value);\r\n }\r\n else {\r\n return fail(\"can't parse \" + value);\r\n }\r\n}\r\n/**\r\n * Generates JsonObject values for the Datastore API suitable for sending to\r\n * either GRPC stub methods or via the JSON/HTTP REST API.\r\n * TODO(klimt): We can remove the databaseId argument if we keep the full\r\n * resource name in documents.\r\n */\r\nvar JsonProtoSerializer = /** @class */ (function () {\r\n function JsonProtoSerializer(databaseId, options) {\r\n this.databaseId = databaseId;\r\n this.options = options;\r\n }\r\n JsonProtoSerializer.prototype.emptyByteString = function () {\r\n if (this.options.useProto3Json) {\r\n return '';\r\n }\r\n else {\r\n return new Uint8Array(0);\r\n }\r\n };\r\n JsonProtoSerializer.prototype.unsafeCastProtoByteString = function (byteString) {\r\n // byteStrings can be either string or UInt8Array, but the typings say\r\n // it's always a string. Cast as string to avoid type check failing\r\n return byteString;\r\n };\r\n JsonProtoSerializer.prototype.fromRpcStatus = function (status) {\r\n var code = status.code === undefined\r\n ? Code.UNKNOWN\r\n : mapCodeFromRpcCode(status.code);\r\n return new FirestoreError(code, status.message || '');\r\n };\r\n /**\r\n * Returns a value for a number (or undefined) that's appropriate to put into\r\n * a google.protobuf.Int32Value proto.\r\n * DO NOT USE THIS FOR ANYTHING ELSE.\r\n * This method cheats. It's typed as returning \"number\" because that's what\r\n * our generated proto interfaces say Int32Value must be. But GRPC actually\r\n * expects a { value: } struct.\r\n */\r\n JsonProtoSerializer.prototype.toInt32Value = function (val) {\r\n if (!isNullOrUndefined(val)) {\r\n // tslint:disable-next-line:no-any We need to match generated Proto types.\r\n return { value: val };\r\n }\r\n else {\r\n return undefined;\r\n }\r\n };\r\n /**\r\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\r\n * DO NOT USE THIS FOR ANYTHING ELSE.\r\n * This method cheats. It's typed as accepting \"number\" because that's what\r\n * our generated proto interfaces say Int32Value must be, but it actually\r\n * accepts { value: number } to match our serialization in toInt32Value().\r\n */\r\n JsonProtoSerializer.prototype.fromInt32Value = function (val) {\r\n var result;\r\n if (typeof val === 'object') {\r\n // tslint:disable-next-line:no-any We need to match generated Proto types.\r\n result = val.value;\r\n }\r\n else {\r\n // We accept raw numbers (without the {value: ... } wrapper) for\r\n // compatibility with legacy persisted data.\r\n result = val;\r\n }\r\n return isNullOrUndefined(result) ? null : result;\r\n };\r\n /**\r\n * Returns a value for a Date that's appropriate to put into a proto.\r\n * DO NOT USE THIS FOR ANYTHING ELSE.\r\n * This method cheats. It's typed as returning \"string\" because that's what\r\n * our generated proto interfaces say dates must be. But it's easier and safer\r\n * to actually return a Timestamp proto.\r\n */\r\n JsonProtoSerializer.prototype.toTimestamp = function (timestamp) {\r\n return {\r\n seconds: timestamp.seconds,\r\n nanos: timestamp.nanoseconds\r\n // tslint:disable-next-line:no-any\r\n };\r\n };\r\n JsonProtoSerializer.prototype.fromTimestamp = function (date) {\r\n // The json interface (for the browser) will return an iso timestamp string,\r\n // while the proto js library (for node) will return a\r\n // google.protobuf.Timestamp instance.\r\n if (typeof date === 'string') {\r\n // TODO(b/37282237): Use strings for Proto3 timestamps\r\n // assert(this.options.useProto3Json,\r\n // 'The timestamp string format requires Proto3.');\r\n return this.fromIso8601String(date);\r\n }\r\n else {\r\n assert(!!date, 'Cannot deserialize null or undefined timestamp.');\r\n // TODO(b/37282237): Use strings for Proto3 timestamps\r\n // assert(!this.options.useProto3Json,\r\n // 'The timestamp instance format requires Proto JS.');\r\n var seconds = parseInt64(date.seconds || '0');\r\n var nanos = date.nanos || 0;\r\n return new Timestamp(seconds, nanos);\r\n }\r\n };\r\n JsonProtoSerializer.prototype.fromIso8601String = function (utc) {\r\n // The date string can have higher precision (nanos) than the Date class\r\n // (millis), so we do some custom parsing here.\r\n // Parse the nanos right out of the string.\r\n var nanos = 0;\r\n var fraction = ISO_REG_EXP.exec(utc);\r\n assert(!!fraction, 'invalid timestamp: ' + utc);\r\n if (fraction[1]) {\r\n // Pad the fraction out to 9 digits (nanos).\r\n var nanoStr = fraction[1];\r\n nanoStr = (nanoStr + '000000000').substr(0, 9);\r\n nanos = Number(nanoStr);\r\n }\r\n // Parse the date to get the seconds.\r\n var date = new Date(utc);\r\n var seconds = Math.floor(date.getTime() / 1000);\r\n return new Timestamp(seconds, nanos);\r\n };\r\n /**\r\n * Returns a value for bytes that's appropriate to put in a proto.\r\n * DO NOT USE THIS FOR ANYTHING ELSE.\r\n * This method cheats. It's typed as returning \"string\" because that's what\r\n * our generated proto interfaces say bytes must be. But it should return\r\n * an Uint8Array in Node.\r\n */\r\n JsonProtoSerializer.prototype.toBytes = function (bytes) {\r\n if (this.options.useProto3Json) {\r\n return bytes.toBase64();\r\n }\r\n else {\r\n // The typings say it's a string, but it needs to be a Uint8Array in Node.\r\n return this.unsafeCastProtoByteString(bytes.toUint8Array());\r\n }\r\n };\r\n /**\r\n * Parse the blob from the protos into the internal Blob class. Note that the\r\n * typings assume all blobs are strings, but they are actually Uint8Arrays\r\n * on Node.\r\n */\r\n JsonProtoSerializer.prototype.fromBlob = function (blob) {\r\n if (typeof blob === 'string') {\r\n assert(this.options.useProto3Json, 'Expected bytes to be passed in as Uint8Array, but got a string instead.');\r\n return Blob.fromBase64String(blob);\r\n }\r\n else {\r\n assert(!this.options.useProto3Json, 'Expected bytes to be passed in as string, but got something else instead.');\r\n return Blob.fromUint8Array(blob);\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toVersion = function (version) {\r\n return this.toTimestamp(version.toTimestamp());\r\n };\r\n JsonProtoSerializer.prototype.fromVersion = function (version) {\r\n assert(!!version, \"Trying to deserialize version that isn't set\");\r\n return SnapshotVersion.fromTimestamp(this.fromTimestamp(version));\r\n };\r\n JsonProtoSerializer.prototype.toResourceName = function (databaseId, path) {\r\n return this.fullyQualifiedPrefixPath(databaseId)\r\n .child('documents')\r\n .child(path)\r\n .canonicalString();\r\n };\r\n JsonProtoSerializer.prototype.fromResourceName = function (name) {\r\n var resource = ResourcePath.fromString(name);\r\n assert(this.isValidResourceName(resource), 'Tried to deserialize invalid key ' + resource.toString());\r\n return resource;\r\n };\r\n JsonProtoSerializer.prototype.toName = function (key) {\r\n return this.toResourceName(this.databaseId, key.path);\r\n };\r\n JsonProtoSerializer.prototype.fromName = function (name) {\r\n var resource = this.fromResourceName(name);\r\n assert(resource.get(1) === this.databaseId.projectId, 'Tried to deserialize key from different project: ' +\r\n resource.get(1) +\r\n ' vs ' +\r\n this.databaseId.projectId);\r\n assert((!resource.get(3) && !this.databaseId.database) ||\r\n resource.get(3) === this.databaseId.database, 'Tried to deserialize key from different database: ' +\r\n resource.get(3) +\r\n ' vs ' +\r\n this.databaseId.database);\r\n return new DocumentKey(this.extractLocalPathFromResourceName(resource));\r\n };\r\n JsonProtoSerializer.prototype.toQueryPath = function (path) {\r\n if (path.length === 0) {\r\n // If the path is empty, the backend requires we leave off the /documents\r\n // at the end.\r\n return this.encodedDatabaseId;\r\n }\r\n return this.toResourceName(this.databaseId, path);\r\n };\r\n JsonProtoSerializer.prototype.fromQueryPath = function (name) {\r\n var resourceName = this.fromResourceName(name);\r\n if (resourceName.length === 4) {\r\n return ResourcePath.EMPTY_PATH;\r\n }\r\n return this.extractLocalPathFromResourceName(resourceName);\r\n };\r\n Object.defineProperty(JsonProtoSerializer.prototype, \"encodedDatabaseId\", {\r\n get: function () {\r\n var path = new ResourcePath([\r\n 'projects',\r\n this.databaseId.projectId,\r\n 'databases',\r\n this.databaseId.database\r\n ]);\r\n return path.canonicalString();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n JsonProtoSerializer.prototype.fullyQualifiedPrefixPath = function (databaseId) {\r\n return new ResourcePath([\r\n 'projects',\r\n databaseId.projectId,\r\n 'databases',\r\n databaseId.database\r\n ]);\r\n };\r\n JsonProtoSerializer.prototype.extractLocalPathFromResourceName = function (resourceName) {\r\n assert(resourceName.length > 4 && resourceName.get(4) === 'documents', 'tried to deserialize invalid key ' + resourceName.toString());\r\n return resourceName.popFirst(5);\r\n };\r\n JsonProtoSerializer.prototype.isValidResourceName = function (path) {\r\n // Resource names have at least 4 components (project ID, database ID)\r\n return (path.length >= 4 &&\r\n path.get(0) === 'projects' &&\r\n path.get(2) === 'databases');\r\n };\r\n JsonProtoSerializer.prototype.toValue = function (val) {\r\n if (val instanceof NullValue) {\r\n return { nullValue: 'NULL_VALUE' };\r\n }\r\n else if (val instanceof BooleanValue) {\r\n return { booleanValue: val.value() };\r\n }\r\n else if (val instanceof IntegerValue) {\r\n return { integerValue: '' + val.value() };\r\n }\r\n else if (val instanceof DoubleValue) {\r\n var doubleValue = val.value();\r\n if (this.options.useProto3Json) {\r\n // Proto 3 let's us encode NaN and Infinity as string values as\r\n // expected by the backend. This is currently not checked by our unit\r\n // tests because they rely on protobuf.js.\r\n if (isNaN(doubleValue)) {\r\n return { doubleValue: 'NaN' };\r\n }\r\n else if (doubleValue === Infinity) {\r\n return { doubleValue: 'Infinity' };\r\n }\r\n else if (doubleValue === -Infinity) {\r\n return { doubleValue: '-Infinity' };\r\n }\r\n }\r\n return { doubleValue: val.value() };\r\n }\r\n else if (val instanceof StringValue) {\r\n return { stringValue: val.value() };\r\n }\r\n else if (val instanceof ObjectValue) {\r\n return { mapValue: this.toMapValue(val) };\r\n }\r\n else if (val instanceof ArrayValue) {\r\n return { arrayValue: this.toArrayValue(val) };\r\n }\r\n else if (val instanceof TimestampValue) {\r\n return {\r\n timestampValue: this.toTimestamp(val.internalValue)\r\n };\r\n }\r\n else if (val instanceof GeoPointValue) {\r\n return {\r\n geoPointValue: {\r\n latitude: val.value().latitude,\r\n longitude: val.value().longitude\r\n }\r\n };\r\n }\r\n else if (val instanceof BlobValue) {\r\n return {\r\n bytesValue: this.toBytes(val.value())\r\n };\r\n }\r\n else if (val instanceof RefValue) {\r\n return {\r\n referenceValue: this.toResourceName(val.databaseId, val.key.path)\r\n };\r\n }\r\n else {\r\n return fail('Unknown FieldValue ' + JSON.stringify(val));\r\n }\r\n };\r\n JsonProtoSerializer.prototype.fromValue = function (obj) {\r\n var _this = this;\r\n // tslint:disable-next-line:no-any\r\n var type = obj['value_type'];\r\n if (hasTag(obj, type, 'nullValue')) {\r\n return NullValue.INSTANCE;\r\n }\r\n else if (hasTag(obj, type, 'booleanValue')) {\r\n return BooleanValue.of(obj.booleanValue);\r\n }\r\n else if (hasTag(obj, type, 'integerValue')) {\r\n return new IntegerValue(parseInt64(obj.integerValue));\r\n }\r\n else if (hasTag(obj, type, 'doubleValue')) {\r\n if (this.options.useProto3Json) {\r\n // Proto 3 uses the string values 'NaN' and 'Infinity'.\r\n if (obj.doubleValue === 'NaN') {\r\n return DoubleValue.NAN;\r\n }\r\n else if (obj.doubleValue === 'Infinity') {\r\n return DoubleValue.POSITIVE_INFINITY;\r\n }\r\n else if (obj.doubleValue === '-Infinity') {\r\n return DoubleValue.NEGATIVE_INFINITY;\r\n }\r\n }\r\n return new DoubleValue(obj.doubleValue);\r\n }\r\n else if (hasTag(obj, type, 'stringValue')) {\r\n return new StringValue(obj.stringValue);\r\n }\r\n else if (hasTag(obj, type, 'mapValue')) {\r\n return this.fromFields(obj.mapValue.fields || {});\r\n }\r\n else if (hasTag(obj, type, 'arrayValue')) {\r\n // \"values\" is not present if the array is empty\r\n assertPresent(obj.arrayValue, 'arrayValue');\r\n var values$$1 = obj.arrayValue.values || [];\r\n return new ArrayValue(values$$1.map(function (v) { return _this.fromValue(v); }));\r\n }\r\n else if (hasTag(obj, type, 'timestampValue')) {\r\n assertPresent(obj.timestampValue, 'timestampValue');\r\n return new TimestampValue(this.fromTimestamp(obj.timestampValue));\r\n }\r\n else if (hasTag(obj, type, 'geoPointValue')) {\r\n assertPresent(obj.geoPointValue, 'geoPointValue');\r\n var latitude = obj.geoPointValue.latitude || 0;\r\n var longitude = obj.geoPointValue.longitude || 0;\r\n return new GeoPointValue(new GeoPoint(latitude, longitude));\r\n }\r\n else if (hasTag(obj, type, 'bytesValue')) {\r\n assertPresent(obj.bytesValue, 'bytesValue');\r\n var blob = this.fromBlob(obj.bytesValue);\r\n return new BlobValue(blob);\r\n }\r\n else if (hasTag(obj, type, 'referenceValue')) {\r\n assertPresent(obj.referenceValue, 'referenceValue');\r\n var resourceName = this.fromResourceName(obj.referenceValue);\r\n var dbId = new DatabaseId(resourceName.get(1), resourceName.get(3));\r\n var key = new DocumentKey(this.extractLocalPathFromResourceName(resourceName));\r\n return new RefValue(dbId, key);\r\n }\r\n else {\r\n return fail('Unknown Value proto ' + JSON.stringify(obj));\r\n }\r\n };\r\n /** Creates an api.Document from key and fields (but no create/update time) */\r\n JsonProtoSerializer.prototype.toMutationDocument = function (key, fields) {\r\n return {\r\n name: this.toName(key),\r\n fields: this.toFields(fields)\r\n };\r\n };\r\n JsonProtoSerializer.prototype.toDocument = function (document) {\r\n assert(!document.hasLocalMutations, \"Can't serialize documents with mutations.\");\r\n return {\r\n name: this.toName(document.key),\r\n fields: this.toFields(document.data),\r\n updateTime: this.toTimestamp(document.version.toTimestamp())\r\n };\r\n };\r\n JsonProtoSerializer.prototype.fromDocument = function (document, hasCommittedMutations) {\r\n return new Document(this.fromName(document.name), this.fromVersion(document.updateTime), this.fromFields(document.fields || {}), { hasCommittedMutations: !!hasCommittedMutations });\r\n };\r\n JsonProtoSerializer.prototype.toFields = function (fields) {\r\n var _this = this;\r\n var result = {};\r\n fields.forEach(function (key, value) {\r\n result[key] = _this.toValue(value);\r\n });\r\n return result;\r\n };\r\n JsonProtoSerializer.prototype.fromFields = function (object) {\r\n var _this = this;\r\n // Proto map gets mapped to Object, so cast it.\r\n var map = object;\r\n var result = ObjectValue.EMPTY;\r\n forEach(map, function (key, value) {\r\n result = result.set(new FieldPath([key]), _this.fromValue(value));\r\n });\r\n return result;\r\n };\r\n JsonProtoSerializer.prototype.toMapValue = function (map) {\r\n return {\r\n fields: this.toFields(map)\r\n };\r\n };\r\n JsonProtoSerializer.prototype.toArrayValue = function (array) {\r\n var _this = this;\r\n var result = [];\r\n array.forEach(function (value) {\r\n result.push(_this.toValue(value));\r\n });\r\n return { values: result };\r\n };\r\n JsonProtoSerializer.prototype.fromFound = function (doc) {\r\n assert(!!doc.found, 'Tried to deserialize a found document from a missing document.');\r\n assertPresent(doc.found.name, 'doc.found.name');\r\n assertPresent(doc.found.updateTime, 'doc.found.updateTime');\r\n var key = this.fromName(doc.found.name);\r\n var version = this.fromVersion(doc.found.updateTime);\r\n var fields = this.fromFields(doc.found.fields || {});\r\n return new Document(key, version, fields, {});\r\n };\r\n JsonProtoSerializer.prototype.fromMissing = function (result) {\r\n assert(!!result.missing, 'Tried to deserialize a missing document from a found document.');\r\n assert(!!result.readTime, 'Tried to deserialize a missing document without a read time.');\r\n var key = this.fromName(result.missing);\r\n var version = this.fromVersion(result.readTime);\r\n return new NoDocument(key, version);\r\n };\r\n JsonProtoSerializer.prototype.fromMaybeDocument = function (result) {\r\n // tslint:disable-next-line:no-any\r\n var type = result['result'];\r\n if (hasTag(result, type, 'found')) {\r\n return this.fromFound(result);\r\n }\r\n else if (hasTag(result, type, 'missing')) {\r\n return this.fromMissing(result);\r\n }\r\n return fail('invalid batch get response: ' + JSON.stringify(result));\r\n };\r\n JsonProtoSerializer.prototype.toWatchTargetChangeState = function (state) {\r\n switch (state) {\r\n case WatchTargetChangeState.Added:\r\n return 'ADD';\r\n case WatchTargetChangeState.Current:\r\n return 'CURRENT';\r\n case WatchTargetChangeState.NoChange:\r\n return 'NO_CHANGE';\r\n case WatchTargetChangeState.Removed:\r\n return 'REMOVE';\r\n case WatchTargetChangeState.Reset:\r\n return 'RESET';\r\n default:\r\n return fail('Unknown WatchTargetChangeState: ' + state);\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toTestWatchChange = function (watchChange) {\r\n if (watchChange instanceof ExistenceFilterChange) {\r\n return {\r\n filter: {\r\n count: watchChange.existenceFilter.count,\r\n targetId: watchChange.targetId\r\n }\r\n };\r\n }\r\n if (watchChange instanceof DocumentWatchChange) {\r\n if (watchChange.newDoc instanceof Document) {\r\n var doc = watchChange.newDoc;\r\n return {\r\n documentChange: {\r\n document: {\r\n name: this.toName(doc.key),\r\n fields: this.toFields(doc.data),\r\n updateTime: this.toVersion(doc.version)\r\n },\r\n targetIds: watchChange.updatedTargetIds,\r\n removedTargetIds: watchChange.removedTargetIds\r\n }\r\n };\r\n }\r\n else if (watchChange.newDoc instanceof NoDocument) {\r\n var doc = watchChange.newDoc;\r\n return {\r\n documentDelete: {\r\n document: this.toName(doc.key),\r\n readTime: this.toVersion(doc.version),\r\n removedTargetIds: watchChange.removedTargetIds\r\n }\r\n };\r\n }\r\n else if (watchChange.newDoc === null) {\r\n return {\r\n documentRemove: {\r\n document: this.toName(watchChange.key),\r\n removedTargetIds: watchChange.removedTargetIds\r\n }\r\n };\r\n }\r\n }\r\n if (watchChange instanceof WatchTargetChange) {\r\n var cause = undefined;\r\n if (watchChange.cause) {\r\n cause = {\r\n code: mapRpcCodeFromCode(watchChange.cause.code),\r\n message: watchChange.cause.message\r\n };\r\n }\r\n return {\r\n targetChange: {\r\n targetChangeType: this.toWatchTargetChangeState(watchChange.state),\r\n targetIds: watchChange.targetIds,\r\n resumeToken: this.unsafeCastProtoByteString(watchChange.resumeToken),\r\n cause: cause\r\n }\r\n };\r\n }\r\n return fail('Unrecognized watch change: ' + JSON.stringify(watchChange));\r\n };\r\n JsonProtoSerializer.prototype.fromWatchChange = function (change) {\r\n // tslint:disable-next-line:no-any\r\n var type = change['response_type'];\r\n var watchChange;\r\n if (hasTag(change, type, 'targetChange')) {\r\n assertPresent(change.targetChange, 'targetChange');\r\n // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\r\n // if unset\r\n var state = this.fromWatchTargetChangeState(change.targetChange.targetChangeType || 'NO_CHANGE');\r\n var targetIds = change.targetChange.targetIds || [];\r\n var resumeToken = change.targetChange.resumeToken || this.emptyByteString();\r\n var causeProto = change.targetChange.cause;\r\n var cause = causeProto && this.fromRpcStatus(causeProto);\r\n watchChange = new WatchTargetChange(state, targetIds, resumeToken, cause || null);\r\n }\r\n else if (hasTag(change, type, 'documentChange')) {\r\n assertPresent(change.documentChange, 'documentChange');\r\n assertPresent(change.documentChange.document, 'documentChange.name');\r\n assertPresent(change.documentChange.document.name, 'documentChange.document.name');\r\n assertPresent(change.documentChange.document.updateTime, 'documentChange.document.updateTime');\r\n var entityChange = change.documentChange;\r\n var key = this.fromName(entityChange.document.name);\r\n var version = this.fromVersion(entityChange.document.updateTime);\r\n var fields = this.fromFields(entityChange.document.fields || {});\r\n var doc = new Document(key, version, fields, {});\r\n var updatedTargetIds = entityChange.targetIds || [];\r\n var removedTargetIds = entityChange.removedTargetIds || [];\r\n watchChange = new DocumentWatchChange(updatedTargetIds, removedTargetIds, doc.key, doc);\r\n }\r\n else if (hasTag(change, type, 'documentDelete')) {\r\n assertPresent(change.documentDelete, 'documentDelete');\r\n assertPresent(change.documentDelete.document, 'documentDelete.document');\r\n var docDelete = change.documentDelete;\r\n var key = this.fromName(docDelete.document);\r\n var version = docDelete.readTime\r\n ? this.fromVersion(docDelete.readTime)\r\n : SnapshotVersion.forDeletedDoc();\r\n var doc = new NoDocument(key, version);\r\n var removedTargetIds = docDelete.removedTargetIds || [];\r\n watchChange = new DocumentWatchChange([], removedTargetIds, doc.key, doc);\r\n }\r\n else if (hasTag(change, type, 'documentRemove')) {\r\n assertPresent(change.documentRemove, 'documentRemove');\r\n assertPresent(change.documentRemove.document, 'documentRemove');\r\n var docRemove = change.documentRemove;\r\n var key = this.fromName(docRemove.document);\r\n var removedTargetIds = docRemove.removedTargetIds || [];\r\n watchChange = new DocumentWatchChange([], removedTargetIds, key, null);\r\n }\r\n else if (hasTag(change, type, 'filter')) {\r\n // TODO(dimond): implement existence filter parsing with strategy.\r\n assertPresent(change.filter, 'filter');\r\n assertPresent(change.filter.targetId, 'filter.targetId');\r\n var filter = change.filter;\r\n var count = filter.count || 0;\r\n var existenceFilter = new ExistenceFilter(count);\r\n var targetId = filter.targetId;\r\n watchChange = new ExistenceFilterChange(targetId, existenceFilter);\r\n }\r\n else {\r\n return fail('Unknown change type ' + JSON.stringify(change));\r\n }\r\n return watchChange;\r\n };\r\n JsonProtoSerializer.prototype.fromWatchTargetChangeState = function (state) {\r\n if (state === 'NO_CHANGE') {\r\n return WatchTargetChangeState.NoChange;\r\n }\r\n else if (state === 'ADD') {\r\n return WatchTargetChangeState.Added;\r\n }\r\n else if (state === 'REMOVE') {\r\n return WatchTargetChangeState.Removed;\r\n }\r\n else if (state === 'CURRENT') {\r\n return WatchTargetChangeState.Current;\r\n }\r\n else if (state === 'RESET') {\r\n return WatchTargetChangeState.Reset;\r\n }\r\n else {\r\n return fail('Got unexpected TargetChange.state: ' + state);\r\n }\r\n };\r\n JsonProtoSerializer.prototype.versionFromListenResponse = function (change) {\r\n // We have only reached a consistent snapshot for the entire stream if there\r\n // is a read_time set and it applies to all targets (i.e. the list of\r\n // targets is empty). The backend is guaranteed to send such responses.\r\n // tslint:disable-next-line:no-any\r\n var type = change['response_type'];\r\n if (!hasTag(change, type, 'targetChange')) {\r\n return SnapshotVersion.MIN;\r\n }\r\n var targetChange = change.targetChange;\r\n if (targetChange.targetIds && targetChange.targetIds.length) {\r\n return SnapshotVersion.MIN;\r\n }\r\n if (!targetChange.readTime) {\r\n return SnapshotVersion.MIN;\r\n }\r\n return this.fromVersion(targetChange.readTime);\r\n };\r\n JsonProtoSerializer.prototype.toMutation = function (mutation) {\r\n var _this = this;\r\n var result;\r\n if (mutation instanceof SetMutation) {\r\n result = {\r\n update: this.toMutationDocument(mutation.key, mutation.value)\r\n };\r\n }\r\n else if (mutation instanceof DeleteMutation) {\r\n result = { delete: this.toName(mutation.key) };\r\n }\r\n else if (mutation instanceof PatchMutation) {\r\n result = {\r\n update: this.toMutationDocument(mutation.key, mutation.data),\r\n updateMask: this.toDocumentMask(mutation.fieldMask)\r\n };\r\n }\r\n else if (mutation instanceof TransformMutation) {\r\n result = {\r\n transform: {\r\n document: this.toName(mutation.key),\r\n fieldTransforms: mutation.fieldTransforms.map(function (transform) {\r\n return _this.toFieldTransform(transform);\r\n })\r\n }\r\n };\r\n }\r\n else {\r\n return fail('Unknown mutation type ' + mutation.type);\r\n }\r\n if (!mutation.precondition.isNone) {\r\n result.currentDocument = this.toPrecondition(mutation.precondition);\r\n }\r\n return result;\r\n };\r\n JsonProtoSerializer.prototype.fromMutation = function (proto) {\r\n var _this = this;\r\n var precondition = proto.currentDocument\r\n ? this.fromPrecondition(proto.currentDocument)\r\n : Precondition.NONE;\r\n if (proto.update) {\r\n assertPresent(proto.update.name, 'name');\r\n var key = this.fromName(proto.update.name);\r\n var value = this.fromFields(proto.update.fields || {});\r\n if (proto.updateMask) {\r\n var fieldMask = this.fromDocumentMask(proto.updateMask);\r\n return new PatchMutation(key, value, fieldMask, precondition);\r\n }\r\n else {\r\n return new SetMutation(key, value, precondition);\r\n }\r\n }\r\n else if (proto.delete) {\r\n var key = this.fromName(proto.delete);\r\n return new DeleteMutation(key, precondition);\r\n }\r\n else if (proto.transform) {\r\n var key = this.fromName(proto.transform.document);\r\n var fieldTransforms = proto.transform.fieldTransforms.map(function (transform) {\r\n return _this.fromFieldTransform(transform);\r\n });\r\n assert(precondition.exists === true, 'Transforms only support precondition \"exists == true\"');\r\n return new TransformMutation(key, fieldTransforms);\r\n }\r\n else {\r\n return fail('unknown mutation proto: ' + JSON.stringify(proto));\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toPrecondition = function (precondition) {\r\n assert(!precondition.isNone, \"Can't serialize an empty precondition\");\r\n if (precondition.updateTime !== undefined) {\r\n return {\r\n updateTime: this.toVersion(precondition.updateTime)\r\n };\r\n }\r\n else if (precondition.exists !== undefined) {\r\n return { exists: precondition.exists };\r\n }\r\n else {\r\n return fail('Unknown precondition');\r\n }\r\n };\r\n JsonProtoSerializer.prototype.fromPrecondition = function (precondition) {\r\n if (precondition.updateTime !== undefined) {\r\n return Precondition.updateTime(this.fromVersion(precondition.updateTime));\r\n }\r\n else if (precondition.exists !== undefined) {\r\n return Precondition.exists(precondition.exists);\r\n }\r\n else {\r\n return Precondition.NONE;\r\n }\r\n };\r\n JsonProtoSerializer.prototype.fromWriteResult = function (proto, commitTime) {\r\n var _this = this;\r\n // NOTE: Deletes don't have an updateTime.\r\n var version = proto.updateTime\r\n ? this.fromVersion(proto.updateTime)\r\n : this.fromVersion(commitTime);\r\n var transformResults = null;\r\n if (proto.transformResults && proto.transformResults.length > 0) {\r\n transformResults = proto.transformResults.map(function (result) {\r\n return _this.fromValue(result);\r\n });\r\n }\r\n return new MutationResult(version, transformResults);\r\n };\r\n JsonProtoSerializer.prototype.fromWriteResults = function (protos, commitTime) {\r\n var _this = this;\r\n if (protos && protos.length > 0) {\r\n assert(commitTime !== undefined, 'Received a write result without a commit time');\r\n return protos.map(function (proto) { return _this.fromWriteResult(proto, commitTime); });\r\n }\r\n else {\r\n return [];\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toFieldTransform = function (fieldTransform) {\r\n var _this = this;\r\n var transform = fieldTransform.transform;\r\n if (transform instanceof ServerTimestampTransform) {\r\n return {\r\n fieldPath: fieldTransform.field.canonicalString(),\r\n setToServerValue: 'REQUEST_TIME'\r\n };\r\n }\r\n else if (transform instanceof ArrayUnionTransformOperation) {\r\n return {\r\n fieldPath: fieldTransform.field.canonicalString(),\r\n appendMissingElements: {\r\n values: transform.elements.map(function (v) { return _this.toValue(v); })\r\n }\r\n };\r\n }\r\n else if (transform instanceof ArrayRemoveTransformOperation) {\r\n return {\r\n fieldPath: fieldTransform.field.canonicalString(),\r\n removeAllFromArray: {\r\n values: transform.elements.map(function (v) { return _this.toValue(v); })\r\n }\r\n };\r\n }\r\n else {\r\n throw fail('Unknown transform: ' + fieldTransform.transform);\r\n }\r\n };\r\n JsonProtoSerializer.prototype.fromFieldTransform = function (proto) {\r\n var _this = this;\r\n // tslint:disable-next-line:no-any We need to match generated Proto types.\r\n var type = proto['transform_type'];\r\n var transform = null;\r\n if (hasTag(proto, type, 'setToServerValue')) {\r\n assert(proto.setToServerValue === 'REQUEST_TIME', 'Unknown server value transform proto: ' + JSON.stringify(proto));\r\n transform = ServerTimestampTransform.instance;\r\n }\r\n else if (hasTag(proto, type, 'appendMissingElements')) {\r\n var values$$1 = proto.appendMissingElements.values || [];\r\n transform = new ArrayUnionTransformOperation(values$$1.map(function (v) { return _this.fromValue(v); }));\r\n }\r\n else if (hasTag(proto, type, 'removeAllFromArray')) {\r\n var values$$1 = proto.removeAllFromArray.values || [];\r\n transform = new ArrayRemoveTransformOperation(values$$1.map(function (v) { return _this.fromValue(v); }));\r\n }\r\n else {\r\n fail('Unknown transform proto: ' + JSON.stringify(proto));\r\n }\r\n var fieldPath = FieldPath.fromServerFormat(proto.fieldPath);\r\n return new FieldTransform(fieldPath, transform);\r\n };\r\n JsonProtoSerializer.prototype.toDocumentsTarget = function (query) {\r\n return { documents: [this.toQueryPath(query.path)] };\r\n };\r\n JsonProtoSerializer.prototype.fromDocumentsTarget = function (documentsTarget) {\r\n var count = documentsTarget.documents.length;\r\n assert(count === 1, 'DocumentsTarget contained other than 1 document: ' + count);\r\n var name = documentsTarget.documents[0];\r\n return Query.atPath(this.fromQueryPath(name));\r\n };\r\n JsonProtoSerializer.prototype.toQueryTarget = function (query) {\r\n // Dissect the path into parent, collectionId, and optional key filter.\r\n var result = { structuredQuery: {} };\r\n if (query.path.isEmpty()) {\r\n result.parent = this.toQueryPath(ResourcePath.EMPTY_PATH);\r\n }\r\n else {\r\n var path = query.path;\r\n assert(path.length % 2 !== 0, 'Document queries with filters are not supported.');\r\n result.parent = this.toQueryPath(path.popLast());\r\n result.structuredQuery.from = [{ collectionId: path.lastSegment() }];\r\n }\r\n var where = this.toFilter(query.filters);\r\n if (where) {\r\n result.structuredQuery.where = where;\r\n }\r\n var orderBy = this.toOrder(query.orderBy);\r\n if (orderBy) {\r\n result.structuredQuery.orderBy = orderBy;\r\n }\r\n var limit = this.toInt32Value(query.limit);\r\n if (limit !== undefined) {\r\n result.structuredQuery.limit = limit;\r\n }\r\n if (query.startAt) {\r\n result.structuredQuery.startAt = this.toCursor(query.startAt);\r\n }\r\n if (query.endAt) {\r\n result.structuredQuery.endAt = this.toCursor(query.endAt);\r\n }\r\n return result;\r\n };\r\n JsonProtoSerializer.prototype.fromQueryTarget = function (target) {\r\n var path = this.fromQueryPath(target.parent);\r\n var query = target.structuredQuery;\r\n var fromCount = query.from ? query.from.length : 0;\r\n if (fromCount > 0) {\r\n assert(fromCount === 1, 'StructuredQuery.from with more than one collection is not supported.');\r\n var from = query.from[0];\r\n path = path.child(from.collectionId);\r\n }\r\n var filterBy = [];\r\n if (query.where) {\r\n filterBy = this.fromFilter(query.where);\r\n }\r\n var orderBy = [];\r\n if (query.orderBy) {\r\n orderBy = this.fromOrder(query.orderBy);\r\n }\r\n var limit = null;\r\n if (query.limit) {\r\n limit = this.fromInt32Value(query.limit);\r\n }\r\n var startAt = null;\r\n if (query.startAt) {\r\n startAt = this.fromCursor(query.startAt);\r\n }\r\n var endAt = null;\r\n if (query.endAt) {\r\n endAt = this.fromCursor(query.endAt);\r\n }\r\n return new Query(path, orderBy, filterBy, limit, startAt, endAt);\r\n };\r\n JsonProtoSerializer.prototype.toListenRequestLabels = function (queryData) {\r\n var value = this.toLabel(queryData.purpose);\r\n if (value == null) {\r\n return null;\r\n }\r\n else {\r\n return {\r\n 'goog-listen-tags': value\r\n };\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toLabel = function (purpose) {\r\n switch (purpose) {\r\n case QueryPurpose.Listen:\r\n return null;\r\n case QueryPurpose.ExistenceFilterMismatch:\r\n return 'existence-filter-mismatch';\r\n case QueryPurpose.LimboResolution:\r\n return 'limbo-document';\r\n default:\r\n return fail('Unrecognized query purpose: ' + purpose);\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toTarget = function (queryData) {\r\n var result;\r\n var query = queryData.query;\r\n if (query.isDocumentQuery()) {\r\n result = { documents: this.toDocumentsTarget(query) };\r\n }\r\n else {\r\n result = { query: this.toQueryTarget(query) };\r\n }\r\n result.targetId = queryData.targetId;\r\n if (queryData.resumeToken.length > 0) {\r\n result.resumeToken = this.unsafeCastProtoByteString(queryData.resumeToken);\r\n }\r\n return result;\r\n };\r\n JsonProtoSerializer.prototype.toFilter = function (filters) {\r\n var _this = this;\r\n if (filters.length === 0)\r\n return;\r\n var protos = filters.map(function (filter) {\r\n return filter instanceof RelationFilter\r\n ? _this.toRelationFilter(filter)\r\n : _this.toUnaryFilter(filter);\r\n });\r\n if (protos.length === 1) {\r\n return protos[0];\r\n }\r\n return { compositeFilter: { op: 'AND', filters: protos } };\r\n };\r\n JsonProtoSerializer.prototype.fromFilter = function (filter) {\r\n var _this = this;\r\n if (!filter) {\r\n return [];\r\n }\r\n else if (filter.unaryFilter !== undefined) {\r\n return [this.fromUnaryFilter(filter)];\r\n }\r\n else if (filter.fieldFilter !== undefined) {\r\n return [this.fromRelationFilter(filter)];\r\n }\r\n else if (filter.compositeFilter !== undefined) {\r\n return filter.compositeFilter\r\n .filters.map(function (f) { return _this.fromFilter(f); })\r\n .reduce(function (accum, current) { return accum.concat(current); });\r\n }\r\n else {\r\n return fail('Unknown filter: ' + JSON.stringify(filter));\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toOrder = function (orderBys) {\r\n var _this = this;\r\n if (orderBys.length === 0)\r\n return;\r\n return orderBys.map(function (order) { return _this.toPropertyOrder(order); });\r\n };\r\n JsonProtoSerializer.prototype.fromOrder = function (orderBys) {\r\n var _this = this;\r\n return orderBys.map(function (order) { return _this.fromPropertyOrder(order); });\r\n };\r\n JsonProtoSerializer.prototype.toCursor = function (cursor) {\r\n var _this = this;\r\n return {\r\n before: cursor.before,\r\n values: cursor.position.map(function (component) { return _this.toValue(component); })\r\n };\r\n };\r\n JsonProtoSerializer.prototype.fromCursor = function (cursor) {\r\n var _this = this;\r\n var before = !!cursor.before;\r\n var position = cursor.values.map(function (component) { return _this.fromValue(component); });\r\n return new Bound(position, before);\r\n };\r\n // visible for testing\r\n JsonProtoSerializer.prototype.toDirection = function (dir) {\r\n return DIRECTIONS[dir.name];\r\n };\r\n // visible for testing\r\n JsonProtoSerializer.prototype.fromDirection = function (dir) {\r\n switch (dir) {\r\n case 'ASCENDING':\r\n return Direction.ASCENDING;\r\n case 'DESCENDING':\r\n return Direction.DESCENDING;\r\n default:\r\n return undefined;\r\n }\r\n };\r\n // visible for testing\r\n JsonProtoSerializer.prototype.toOperatorName = function (op) {\r\n return OPERATORS[op.name];\r\n };\r\n JsonProtoSerializer.prototype.fromOperatorName = function (op) {\r\n switch (op) {\r\n case 'EQUAL':\r\n return RelationOp.EQUAL;\r\n case 'GREATER_THAN':\r\n return RelationOp.GREATER_THAN;\r\n case 'GREATER_THAN_OR_EQUAL':\r\n return RelationOp.GREATER_THAN_OR_EQUAL;\r\n case 'LESS_THAN':\r\n return RelationOp.LESS_THAN;\r\n case 'LESS_THAN_OR_EQUAL':\r\n return RelationOp.LESS_THAN_OR_EQUAL;\r\n case 'ARRAY_CONTAINS':\r\n return RelationOp.ARRAY_CONTAINS;\r\n case 'OPERATOR_UNSPECIFIED':\r\n return fail('Unspecified relation');\r\n default:\r\n return fail('Unknown relation');\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toFieldPathReference = function (path) {\r\n return { fieldPath: path.canonicalString() };\r\n };\r\n JsonProtoSerializer.prototype.fromFieldPathReference = function (fieldReference) {\r\n return FieldPath.fromServerFormat(fieldReference.fieldPath);\r\n };\r\n // visible for testing\r\n JsonProtoSerializer.prototype.toPropertyOrder = function (orderBy) {\r\n return {\r\n field: this.toFieldPathReference(orderBy.field),\r\n direction: this.toDirection(orderBy.dir)\r\n };\r\n };\r\n JsonProtoSerializer.prototype.fromPropertyOrder = function (orderBy) {\r\n return new OrderBy(this.fromFieldPathReference(orderBy.field), this.fromDirection(orderBy.direction));\r\n };\r\n // visible for testing\r\n JsonProtoSerializer.prototype.toRelationFilter = function (filter) {\r\n if (filter instanceof RelationFilter) {\r\n return {\r\n fieldFilter: {\r\n field: this.toFieldPathReference(filter.field),\r\n op: this.toOperatorName(filter.op),\r\n value: this.toValue(filter.value)\r\n }\r\n };\r\n }\r\n else {\r\n return fail('Unrecognized filter: ' + JSON.stringify(filter));\r\n }\r\n };\r\n JsonProtoSerializer.prototype.fromRelationFilter = function (filter) {\r\n return new RelationFilter(this.fromFieldPathReference(filter.fieldFilter.field), this.fromOperatorName(filter.fieldFilter.op), this.fromValue(filter.fieldFilter.value));\r\n };\r\n // visible for testing\r\n JsonProtoSerializer.prototype.toUnaryFilter = function (filter) {\r\n if (filter instanceof NanFilter) {\r\n return {\r\n unaryFilter: {\r\n field: this.toFieldPathReference(filter.field),\r\n op: 'IS_NAN'\r\n }\r\n };\r\n }\r\n else if (filter instanceof NullFilter) {\r\n return {\r\n unaryFilter: {\r\n field: this.toFieldPathReference(filter.field),\r\n op: 'IS_NULL'\r\n }\r\n };\r\n }\r\n else {\r\n return fail('Unrecognized filter: ' + JSON.stringify(filter));\r\n }\r\n };\r\n JsonProtoSerializer.prototype.fromUnaryFilter = function (filter) {\r\n switch (filter.unaryFilter.op) {\r\n case 'IS_NAN':\r\n var nanField = this.fromFieldPathReference(filter.unaryFilter.field);\r\n return new NanFilter(nanField);\r\n case 'IS_NULL':\r\n var nullField = this.fromFieldPathReference(filter.unaryFilter.field);\r\n return new NullFilter(nullField);\r\n case 'OPERATOR_UNSPECIFIED':\r\n return fail('Unspecified filter');\r\n default:\r\n return fail('Unknown filter');\r\n }\r\n };\r\n JsonProtoSerializer.prototype.toDocumentMask = function (fieldMask) {\r\n return {\r\n fieldPaths: fieldMask.fields.map(function (field) { return field.canonicalString(); })\r\n };\r\n };\r\n JsonProtoSerializer.prototype.fromDocumentMask = function (proto) {\r\n var paths = proto.fieldPaths || [];\r\n var fields = paths.map(function (path) { return FieldPath.fromServerFormat(path); });\r\n return new FieldMask(fields);\r\n };\r\n return JsonProtoSerializer;\r\n}());\r\n/**\r\n * Checks for a specific oneof tag in a protocol buffer message.\r\n *\r\n * This intentionally accommodates two distinct cases:\r\n *\r\n * 1) Messages containing a type tag: these are the format produced by GRPC in\r\n * return values. These may contain default-value mappings for all tags in the\r\n * oneof but the type tag specifies which one was actually set.\r\n *\r\n * 2) Messages that don't contain a type tag: these are the format required by\r\n * GRPC as inputs. If we emitted objects with type tags, ProtoBuf.js would\r\n * choke claiming that the tags aren't fields in the Message.\r\n *\r\n * Allowing both formats here makes the serializer able to consume the outputs\r\n * it produces: for all messages it supports, fromX(toX(value)) == value.\r\n *\r\n * Note that case 2 suffers from ambiguity: if multiple tags are present\r\n * without a type tag then the callers are structured in such a way that the\r\n * first invocation will win. Since we only parse in this mode when parsing\r\n * the output of a serialize method this works, but it's not a general\r\n * solution.\r\n *\r\n * Unfortunately there is no general solution here because proto3 makes it\r\n * impossible to distinguish unset from explicitly set fields: both have the\r\n * default value for the type. Without the type tag but multiple value tags\r\n * it's possible to have default values for each tag in the oneof and not be\r\n * able to know which was actually in effect.\r\n */\r\nfunction hasTag(obj, type, tag) {\r\n return type === tag || (!type && tag in obj);\r\n}\n\n/**\r\n * Detect React Native.\r\n *\r\n * @return {boolean} True if ReactNative environment is detected.\r\n */\r\nvar isReactNative = function () {\r\n return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\r\n};\r\n\nvar ERROR_NAME = 'FirebaseError';\r\nvar captureStackTrace = Error\r\n .captureStackTrace;\r\nvar FirebaseError = /** @class */ (function () {\r\n function FirebaseError(code, message) {\r\n this.code = code;\r\n this.message = message;\r\n // We want the stack value, if implemented by Error\r\n if (captureStackTrace) {\r\n // Patches this.stack, omitted calls above ErrorFactory#create\r\n captureStackTrace(this, ErrorFactory.prototype.create);\r\n }\r\n else {\r\n try {\r\n // In case of IE11, stack will be set only after error is raised.\r\n // https://docs.microsoft.com/en-us/scripting/javascript/reference/stack-property-error-javascript\r\n throw Error.apply(this, arguments);\r\n }\r\n catch (err) {\r\n this.name = ERROR_NAME;\r\n // Make non-enumerable getter for the property.\r\n Object.defineProperty(this, 'stack', {\r\n get: function () {\r\n return err.stack;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n return FirebaseError;\r\n}());\r\n// Back-door inheritance\r\nFirebaseError.prototype = Object.create(Error.prototype);\r\nFirebaseError.prototype.constructor = FirebaseError;\r\nFirebaseError.prototype.name = ERROR_NAME;\r\nvar ErrorFactory = /** @class */ (function () {\r\n function ErrorFactory(service, serviceName, errors) {\r\n this.service = service;\r\n this.serviceName = serviceName;\r\n this.errors = errors;\r\n // Matches {$name}, by default.\r\n this.pattern = /\\{\\$([^}]+)}/g;\r\n // empty\r\n }\r\n ErrorFactory.prototype.create = function (code, data) {\r\n if (data === undefined) {\r\n data = {};\r\n }\r\n var template = this.errors[code];\r\n var fullCode = this.service + '/' + code;\r\n var message;\r\n if (template === undefined) {\r\n message = 'Error';\r\n }\r\n else {\r\n message = template.replace(this.pattern, function (match, key) {\r\n var value = data[key];\r\n return value !== undefined ? value.toString() : '<' + key + '?>';\r\n });\r\n }\r\n // Service: Error message (service/code).\r\n message = this.serviceName + ': ' + message + ' (' + fullCode + ').';\r\n var err = new FirebaseError(fullCode, message);\r\n // Populate the Error object with message parts for programmatic\r\n // accesses (e.g., e.file).\r\n for (var prop in data) {\r\n if (!data.hasOwnProperty(prop) || prop.slice(-1) === '_') {\r\n continue;\r\n }\r\n err[prop] = data[prop];\r\n }\r\n return err;\r\n };\r\n return ErrorFactory;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Copyright 2011 The Closure Library Authors. All Rights Reserved.\r\n//\r\n// Licensed under the Apache License, Version 2.0 (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.apache.org/licenses/LICENSE-2.0\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n/**\r\n * @fileoverview Abstract cryptographic hash interface.\r\n *\r\n * See Sha1 and Md5 for sample implementations.\r\n *\r\n */\r\n/**\r\n * Create a cryptographic hash instance.\r\n *\r\n * @constructor\r\n * @struct\r\n */\r\nvar Hash = /** @class */ (function () {\r\n function Hash() {\r\n /**\r\n * The block size for the hasher.\r\n * @type {number}\r\n */\r\n this.blockSize = -1;\r\n }\r\n return Hash;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @fileoverview SHA-1 cryptographic hash.\r\n * Variable names follow the notation in FIPS PUB 180-3:\r\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\r\n *\r\n * Usage:\r\n * var sha1 = new sha1();\r\n * sha1.update(bytes);\r\n * var hash = sha1.digest();\r\n *\r\n * Performance:\r\n * Chrome 23: ~400 Mbit/s\r\n * Firefox 16: ~250 Mbit/s\r\n *\r\n */\r\n/**\r\n * SHA-1 cryptographic hash constructor.\r\n *\r\n * The properties declared here are discussed in the above algorithm document.\r\n * @constructor\r\n * @extends {Hash}\r\n * @final\r\n * @struct\r\n */\r\nvar Sha1 = /** @class */ (function (_super) {\r\n tslib_1.__extends(Sha1, _super);\r\n function Sha1() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Holds the previous values of accumulated variables a-e in the compress_\r\n * function.\r\n * @type {!Array}\r\n * @private\r\n */\r\n _this.chain_ = [];\r\n /**\r\n * A buffer holding the partially computed hash result.\r\n * @type {!Array}\r\n * @private\r\n */\r\n _this.buf_ = [];\r\n /**\r\n * An array of 80 bytes, each a part of the message to be hashed. Referred to\r\n * as the message schedule in the docs.\r\n * @type {!Array}\r\n * @private\r\n */\r\n _this.W_ = [];\r\n /**\r\n * Contains data needed to pad messages less than 64 bytes.\r\n * @type {!Array}\r\n * @private\r\n */\r\n _this.pad_ = [];\r\n /**\r\n * @private {number}\r\n */\r\n _this.inbuf_ = 0;\r\n /**\r\n * @private {number}\r\n */\r\n _this.total_ = 0;\r\n _this.blockSize = 512 / 8;\r\n _this.pad_[0] = 128;\r\n for (var i = 1; i < _this.blockSize; ++i) {\r\n _this.pad_[i] = 0;\r\n }\r\n _this.reset();\r\n return _this;\r\n }\r\n Sha1.prototype.reset = function () {\r\n this.chain_[0] = 0x67452301;\r\n this.chain_[1] = 0xefcdab89;\r\n this.chain_[2] = 0x98badcfe;\r\n this.chain_[3] = 0x10325476;\r\n this.chain_[4] = 0xc3d2e1f0;\r\n this.inbuf_ = 0;\r\n this.total_ = 0;\r\n };\r\n /**\r\n * Internal compress helper function.\r\n * @param {!Array|!Uint8Array|string} buf Block to compress.\r\n * @param {number=} opt_offset Offset of the block in the buffer.\r\n * @private\r\n */\r\n Sha1.prototype.compress_ = function (buf, opt_offset) {\r\n if (!opt_offset) {\r\n opt_offset = 0;\r\n }\r\n var W = this.W_;\r\n // get 16 big endian words\r\n if (typeof buf === 'string') {\r\n for (var i = 0; i < 16; i++) {\r\n // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\r\n // have a bug that turns the post-increment ++ operator into pre-increment\r\n // during JIT compilation. We have code that depends heavily on SHA-1 for\r\n // correctness and which is affected by this bug, so I've removed all uses\r\n // of post-increment ++ in which the result value is used. We can revert\r\n // this change once the Safari bug\r\n // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\r\n // most clients have been updated.\r\n W[i] =\r\n (buf.charCodeAt(opt_offset) << 24) |\r\n (buf.charCodeAt(opt_offset + 1) << 16) |\r\n (buf.charCodeAt(opt_offset + 2) << 8) |\r\n buf.charCodeAt(opt_offset + 3);\r\n opt_offset += 4;\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < 16; i++) {\r\n W[i] =\r\n (buf[opt_offset] << 24) |\r\n (buf[opt_offset + 1] << 16) |\r\n (buf[opt_offset + 2] << 8) |\r\n buf[opt_offset + 3];\r\n opt_offset += 4;\r\n }\r\n }\r\n // expand to 80 words\r\n for (var i = 16; i < 80; i++) {\r\n var t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\r\n W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\r\n }\r\n var a = this.chain_[0];\r\n var b = this.chain_[1];\r\n var c = this.chain_[2];\r\n var d = this.chain_[3];\r\n var e = this.chain_[4];\r\n var f, k;\r\n // TODO(user): Try to unroll this loop to speed up the computation.\r\n for (var i = 0; i < 80; i++) {\r\n if (i < 40) {\r\n if (i < 20) {\r\n f = d ^ (b & (c ^ d));\r\n k = 0x5a827999;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0x6ed9eba1;\r\n }\r\n }\r\n else {\r\n if (i < 60) {\r\n f = (b & c) | (d & (b | c));\r\n k = 0x8f1bbcdc;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0xca62c1d6;\r\n }\r\n }\r\n var t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\r\n e = d;\r\n d = c;\r\n c = ((b << 30) | (b >>> 2)) & 0xffffffff;\r\n b = a;\r\n a = t;\r\n }\r\n this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\r\n this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\r\n this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\r\n this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\r\n this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\r\n };\r\n Sha1.prototype.update = function (bytes, opt_length) {\r\n // TODO(johnlenz): tighten the function signature and remove this check\r\n if (bytes == null) {\r\n return;\r\n }\r\n if (opt_length === undefined) {\r\n opt_length = bytes.length;\r\n }\r\n var lengthMinusBlock = opt_length - this.blockSize;\r\n var n = 0;\r\n // Using local instead of member variables gives ~5% speedup on Firefox 16.\r\n var buf = this.buf_;\r\n var inbuf = this.inbuf_;\r\n // The outer while loop should execute at most twice.\r\n while (n < opt_length) {\r\n // When we have no data in the block to top up, we can directly process the\r\n // input buffer (assuming it contains sufficient data). This gives ~25%\r\n // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\r\n // the data is provided in large chunks (or in multiples of 64 bytes).\r\n if (inbuf == 0) {\r\n while (n <= lengthMinusBlock) {\r\n this.compress_(bytes, n);\r\n n += this.blockSize;\r\n }\r\n }\r\n if (typeof bytes === 'string') {\r\n while (n < opt_length) {\r\n buf[inbuf] = bytes.charCodeAt(n);\r\n ++inbuf;\r\n ++n;\r\n if (inbuf == this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n while (n < opt_length) {\r\n buf[inbuf] = bytes[n];\r\n ++inbuf;\r\n ++n;\r\n if (inbuf == this.blockSize) {\r\n this.compress_(buf);\r\n inbuf = 0;\r\n // Jump to the outer loop so we use the full-block optimization.\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n this.inbuf_ = inbuf;\r\n this.total_ += opt_length;\r\n };\r\n /** @override */\r\n Sha1.prototype.digest = function () {\r\n var digest = [];\r\n var totalBits = this.total_ * 8;\r\n // Add pad 0x80 0x00*.\r\n if (this.inbuf_ < 56) {\r\n this.update(this.pad_, 56 - this.inbuf_);\r\n }\r\n else {\r\n this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\r\n }\r\n // Add # bits.\r\n for (var i = this.blockSize - 1; i >= 56; i--) {\r\n this.buf_[i] = totalBits & 255;\r\n totalBits /= 256; // Don't use bit-shifting here!\r\n }\r\n this.compress_(this.buf_);\r\n var n = 0;\r\n for (var i = 0; i < 5; i++) {\r\n for (var j = 24; j >= 0; j -= 8) {\r\n digest[n] = (this.chain_[i] >> j) & 255;\r\n ++n;\r\n }\r\n }\r\n return digest;\r\n };\r\n return Sha1;\r\n}(Hash));\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provides a simple helper class that implements the Stream interface to\r\n * bridge to other implementations that are streams but do not implement the\r\n * interface. The stream callbacks are invoked with the callOn... methods.\r\n */\r\nvar StreamBridge = /** @class */ (function () {\r\n function StreamBridge(args) {\r\n this.sendFn = args.sendFn;\r\n this.closeFn = args.closeFn;\r\n }\r\n StreamBridge.prototype.onOpen = function (callback) {\r\n assert(!this.wrappedOnOpen, 'Called onOpen on stream twice!');\r\n this.wrappedOnOpen = callback;\r\n };\r\n StreamBridge.prototype.onClose = function (callback) {\r\n assert(!this.wrappedOnClose, 'Called onClose on stream twice!');\r\n this.wrappedOnClose = callback;\r\n };\r\n StreamBridge.prototype.onMessage = function (callback) {\r\n assert(!this.wrappedOnMessage, 'Called onMessage on stream twice!');\r\n this.wrappedOnMessage = callback;\r\n };\r\n StreamBridge.prototype.close = function () {\r\n this.closeFn();\r\n };\r\n StreamBridge.prototype.send = function (msg) {\r\n this.sendFn(msg);\r\n };\r\n StreamBridge.prototype.callOnOpen = function () {\r\n assert(this.wrappedOnOpen !== undefined, 'Cannot call onOpen because no callback was set');\r\n this.wrappedOnOpen();\r\n };\r\n StreamBridge.prototype.callOnClose = function (err) {\r\n assert(this.wrappedOnClose !== undefined, 'Cannot call onClose because no callback was set');\r\n this.wrappedOnClose(err);\r\n };\r\n StreamBridge.prototype.callOnMessage = function (msg) {\r\n assert(this.wrappedOnMessage !== undefined, 'Cannot call onMessage because no callback was set');\r\n this.wrappedOnMessage(msg);\r\n };\r\n return StreamBridge;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG = 'Connection';\r\nvar RPC_STREAM_SERVICE = 'google.firestore.v1beta1.Firestore';\r\nvar RPC_URL_VERSION = 'v1beta1';\r\n/** Maps RPC names to the corresponding REST endpoint name. */\r\nvar RPC_NAME_REST_MAPPING = {\r\n BatchGetDocuments: 'batchGet',\r\n Commit: 'commit'\r\n};\r\n// TODO(b/38203344): The SDK_VERSION is set independently from Firebase because\r\n// we are doing out-of-band releases. Once we release as part of Firebase, we\r\n// should use the Firebase version instead.\r\nvar X_GOOG_API_CLIENT_VALUE = 'gl-js/ fire/' + SDK_VERSION;\r\nvar XHR_TIMEOUT_SECS = 15;\r\nvar WebChannelConnection = /** @class */ (function () {\r\n function WebChannelConnection(info) {\r\n this.databaseId = info.databaseId;\r\n this.pool = new webchannelWrapper.XhrIoPool();\r\n var proto = info.ssl ? 'https' : 'http';\r\n this.baseUrl = proto + '://' + info.host;\r\n }\r\n /**\r\n * Modifies the headers for a request, adding any authorization token if\r\n * present and any additional headers for the request.\r\n */\r\n WebChannelConnection.prototype.modifyHeadersForRequest = function (headers, token) {\r\n if (token) {\r\n for (var header in token.authHeaders) {\r\n if (token.authHeaders.hasOwnProperty(header)) {\r\n headers[header] = token.authHeaders[header];\r\n }\r\n }\r\n }\r\n headers['X-Goog-Api-Client'] = X_GOOG_API_CLIENT_VALUE;\r\n };\r\n WebChannelConnection.prototype.invokeRPC = function (rpcName, request, token) {\r\n var _this = this;\r\n var url = this.makeUrl(rpcName);\r\n return new Promise(function (resolve, reject) {\r\n // tslint:disable-next-line:no-any XhrIoPool doesn't have TS typings.\r\n _this.pool.getObject(function (xhr) {\r\n xhr.listenOnce(webchannelWrapper.EventType.COMPLETE, function () {\r\n try {\r\n switch (xhr.getLastErrorCode()) {\r\n case webchannelWrapper.ErrorCode.NO_ERROR:\r\n var json = xhr.getResponseJson();\r\n debug(LOG_TAG, 'XHR received:', JSON.stringify(json));\r\n resolve(json);\r\n break;\r\n case webchannelWrapper.ErrorCode.TIMEOUT:\r\n debug(LOG_TAG, 'RPC \"' + rpcName + '\" timed out');\r\n reject(new FirestoreError(Code.DEADLINE_EXCEEDED, 'Request time out'));\r\n break;\r\n case webchannelWrapper.ErrorCode.HTTP_ERROR:\r\n var status_1 = xhr.getStatus();\r\n debug(LOG_TAG, 'RPC \"' + rpcName + '\" failed with status:', status_1, 'response text:', xhr.getResponseText());\r\n if (status_1 > 0) {\r\n reject(new FirestoreError(mapCodeFromHttpStatus(status_1), 'Server responded with status ' + xhr.getStatusText()));\r\n }\r\n else {\r\n // If we received an HTTP_ERROR but there's no status code,\r\n // it's most probably a connection issue\r\n debug(LOG_TAG, 'RPC \"' + rpcName + '\" failed');\r\n reject(new FirestoreError(Code.UNAVAILABLE, 'Connection failed.'));\r\n }\r\n break;\r\n default:\r\n fail('RPC \"' +\r\n rpcName +\r\n '\" failed with unanticipated ' +\r\n 'webchannel error ' +\r\n xhr.getLastErrorCode() +\r\n ': ' +\r\n xhr.getLastError() +\r\n ', giving up.');\r\n }\r\n }\r\n finally {\r\n debug(LOG_TAG, 'RPC \"' + rpcName + '\" completed.');\r\n _this.pool.releaseObject(xhr);\r\n }\r\n });\r\n var requestString = JSON.stringify(request);\r\n debug(LOG_TAG, 'XHR sending: ', url + ' ' + requestString);\r\n // Content-Type: text/plain will avoid preflight requests which might\r\n // mess with CORS and redirects by proxies. If we add custom headers\r\n // we will need to change this code to potentially use the\r\n // $httpOverwrite parameter supported by ESF to avoid\r\n // triggering preflight requests.\r\n var headers = { 'Content-Type': 'text/plain' };\r\n _this.modifyHeadersForRequest(headers, token);\r\n xhr.send(url, 'POST', requestString, headers, XHR_TIMEOUT_SECS);\r\n });\r\n });\r\n };\r\n WebChannelConnection.prototype.invokeStreamingRPC = function (rpcName, request, token) {\r\n // The REST API automatically aggregates all of the streamed results, so we\r\n // can just use the normal invoke() method.\r\n return this.invokeRPC(rpcName, request, token);\r\n };\r\n WebChannelConnection.prototype.openStream = function (rpcName, token) {\r\n var urlParts = [\r\n this.baseUrl,\r\n '/',\r\n RPC_STREAM_SERVICE,\r\n '/',\r\n rpcName,\r\n '/channel'\r\n ];\r\n var webchannelTransport = webchannelWrapper.createWebChannelTransport();\r\n var request = {\r\n // Background channel test avoids the initial two test calls and decreases\r\n // initial cold start time.\r\n // TODO(dimond): wenboz@ mentioned this might affect use with proxies and\r\n // we should monitor closely for any reports.\r\n backgroundChannelTest: true,\r\n // Required for backend stickiness, routing behavior is based on this\r\n // parameter.\r\n httpSessionIdParam: 'gsessionid',\r\n initMessageHeaders: {},\r\n messageUrlParams: {\r\n // This param is used to improve routing and project isolation by the\r\n // backend and must be included in every request.\r\n database: \"projects/\" + this.databaseId.projectId + \"/databases/\" + this.databaseId.database\r\n },\r\n sendRawJson: true,\r\n supportsCrossDomainXhr: true\r\n };\r\n this.modifyHeadersForRequest(request.initMessageHeaders, token);\r\n // Sending the custom headers we just added to request.initMessageHeaders\r\n // (Authorization, etc.) will trigger the browser to make a CORS preflight\r\n // request because the XHR will no longer meet the criteria for a \"simple\"\r\n // CORS request:\r\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\r\n //\r\n // Therefore to avoid the CORS preflight request (an extra network\r\n // roundtrip), we use the httpHeadersOverwriteParam option to specify that\r\n // the headers should instead be encoded into a special \"$httpHeaders\" query\r\n // parameter, which is recognized by the webchannel backend. This is\r\n // formally defined here:\r\n // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\r\n //\r\n // But for some unclear reason (see\r\n // https://github.com/firebase/firebase-js-sdk/issues/703), this breaks\r\n // ReactNative and so we exclude it, which just means ReactNative may be\r\n // subject to the extra network roundtrip for CORS preflight.\r\n if (!isReactNative()) {\r\n request['httpHeadersOverwriteParam'] = '$httpHeaders';\r\n }\r\n var url = urlParts.join('');\r\n debug(LOG_TAG, 'Creating WebChannel: ' + url + ' ' + request);\r\n // tslint:disable-next-line:no-any Because listen isn't defined on it.\r\n var channel = webchannelTransport.createWebChannel(url, request);\r\n // WebChannel supports sending the first message with the handshake - saving\r\n // a network round trip. However, it will have to call send in the same\r\n // JS event loop as open. In order to enforce this, we delay actually\r\n // opening the WebChannel until send is called. Whether we have called\r\n // open is tracked with this variable.\r\n var opened = false;\r\n // A flag to determine whether the stream was closed (by us or through an\r\n // error/close event) to avoid delivering multiple close events or sending\r\n // on a closed stream\r\n var closed = false;\r\n var streamBridge = new StreamBridge({\r\n sendFn: function (msg) {\r\n if (!closed) {\r\n if (!opened) {\r\n debug(LOG_TAG, 'Opening WebChannel transport.');\r\n channel.open();\r\n opened = true;\r\n }\r\n debug(LOG_TAG, 'WebChannel sending:', msg);\r\n channel.send(msg);\r\n }\r\n else {\r\n debug(LOG_TAG, 'Not sending because WebChannel is closed:', msg);\r\n }\r\n },\r\n closeFn: function () { return channel.close(); }\r\n });\r\n // Closure events are guarded and exceptions are swallowed, so catch any\r\n // exception and rethrow using a setTimeout so they become visible again.\r\n // Note that eventually this function could go away if we are confident\r\n // enough the code is exception free.\r\n var unguardedEventListen = function (type, fn) {\r\n // TODO(dimond): closure typing seems broken because WebChannel does\r\n // not implement goog.events.Listenable\r\n channel.listen(type, function (param) {\r\n try {\r\n fn(param);\r\n }\r\n catch (e) {\r\n setTimeout(function () {\r\n throw e;\r\n }, 0);\r\n }\r\n });\r\n };\r\n unguardedEventListen(webchannelWrapper.WebChannel.EventType.OPEN, function () {\r\n if (!closed) {\r\n debug(LOG_TAG, 'WebChannel transport opened.');\r\n }\r\n });\r\n unguardedEventListen(webchannelWrapper.WebChannel.EventType.CLOSE, function () {\r\n if (!closed) {\r\n closed = true;\r\n debug(LOG_TAG, 'WebChannel transport closed');\r\n streamBridge.callOnClose();\r\n }\r\n });\r\n unguardedEventListen(webchannelWrapper.WebChannel.EventType.ERROR, function (err) {\r\n if (!closed) {\r\n closed = true;\r\n debug(LOG_TAG, 'WebChannel transport errored:', err);\r\n streamBridge.callOnClose(new FirestoreError(Code.UNAVAILABLE, 'The operation could not be completed'));\r\n }\r\n });\r\n unguardedEventListen(webchannelWrapper.WebChannel.EventType.MESSAGE, function (msg) {\r\n if (!closed) {\r\n var msgData = msg.data[0];\r\n assert(!!msgData, 'Got a webchannel message without data.');\r\n // TODO(b/35143891): There is a bug in One Platform that caused errors\r\n // (and only errors) to be wrapped in an extra array. To be forward\r\n // compatible with the bug we need to check either condition. The latter\r\n // can be removed once the fix has been rolled out.\r\n var error$$1 = \r\n // tslint:disable-next-line:no-any msgData.error is not typed.\r\n msgData.error || (msgData[0] && msgData[0].error);\r\n if (error$$1) {\r\n debug(LOG_TAG, 'WebChannel received error:', error$$1);\r\n // error.status will be a string like 'OK' or 'NOT_FOUND'.\r\n var status_2 = error$$1.status;\r\n var code = mapCodeFromRpcStatus(status_2);\r\n var message = error$$1.message;\r\n if (code === undefined) {\r\n code = Code.INTERNAL;\r\n message =\r\n 'Unknown error status: ' +\r\n status_2 +\r\n ' with message ' +\r\n error$$1.message;\r\n }\r\n // Mark closed so no further events are propagated\r\n closed = true;\r\n streamBridge.callOnClose(new FirestoreError(code, message));\r\n channel.close();\r\n }\r\n else {\r\n debug(LOG_TAG, 'WebChannel received:', msgData);\r\n streamBridge.callOnMessage(msgData);\r\n }\r\n }\r\n });\r\n setTimeout(function () {\r\n // Technically we could/should wait for the WebChannel opened event,\r\n // but because we want to send the first message with the WebChannel\r\n // handshake we pretend the channel opened here (asynchronously), and\r\n // then delay the actual open until the first message is sent.\r\n streamBridge.callOnOpen();\r\n }, 0);\r\n return streamBridge;\r\n };\r\n // visible for testing\r\n WebChannelConnection.prototype.makeUrl = function (rpcName) {\r\n var urlRpcName = RPC_NAME_REST_MAPPING[rpcName];\r\n assert(urlRpcName !== undefined, 'Unknown REST mapping for: ' + rpcName);\r\n var url = [this.baseUrl, '/', RPC_URL_VERSION];\r\n url.push('/projects/');\r\n url.push(this.databaseId.projectId);\r\n url.push('/databases/');\r\n url.push(this.databaseId.database);\r\n url.push('/documents');\r\n url.push(':');\r\n url.push(urlRpcName);\r\n return url.join('');\r\n };\r\n return WebChannelConnection;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar BrowserPlatform = /** @class */ (function () {\r\n function BrowserPlatform() {\r\n this.emptyByteString = '';\r\n this.base64Available = typeof atob !== 'undefined';\r\n }\r\n Object.defineProperty(BrowserPlatform.prototype, \"document\", {\r\n get: function () {\r\n return typeof document !== 'undefined' ? document : null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BrowserPlatform.prototype, \"window\", {\r\n get: function () {\r\n return typeof window !== 'undefined' ? window : null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n BrowserPlatform.prototype.loadConnection = function (databaseInfo) {\r\n return Promise.resolve(new WebChannelConnection(databaseInfo));\r\n };\r\n BrowserPlatform.prototype.newSerializer = function (databaseId) {\r\n return new JsonProtoSerializer(databaseId, { useProto3Json: true });\r\n };\r\n BrowserPlatform.prototype.formatJSON = function (value) {\r\n return JSON.stringify(value);\r\n };\r\n BrowserPlatform.prototype.atob = function (encoded) {\r\n return atob(encoded);\r\n };\r\n BrowserPlatform.prototype.btoa = function (raw) {\r\n return btoa(raw);\r\n };\r\n return BrowserPlatform;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * This code needs to run before Firestore is used. This can be achieved in\r\n * several ways:\r\n * 1) Through the JSCompiler compiling this code and then (automatically)\r\n * executing it before exporting the Firestore symbols.\r\n * 2) Through importing this module first in a Firestore main module\r\n */\r\nPlatformSupport.setPlatform(new BrowserPlatform());\n\n/**\r\n * Copyright 2018 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\r\n * exceed. All subsequent calls to next will return increasing values. If provided with a\r\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\r\n * well as write out sequence numbers that it produces via `next()`.\r\n */\r\nvar ListenSequence = /** @class */ (function () {\r\n function ListenSequence(previousValue, sequenceNumberSyncer) {\r\n var _this = this;\r\n this.previousValue = previousValue;\r\n if (sequenceNumberSyncer) {\r\n sequenceNumberSyncer.sequenceNumberHandler = function (sequenceNumber) {\r\n return _this.setPreviousValue(sequenceNumber);\r\n };\r\n this.writeNewSequenceNumber = function (sequenceNumber) {\r\n return sequenceNumberSyncer.writeSequenceNumber(sequenceNumber);\r\n };\r\n }\r\n }\r\n ListenSequence.prototype.setPreviousValue = function (externalPreviousValue) {\r\n this.previousValue = Math.max(externalPreviousValue, this.previousValue);\r\n return this.previousValue;\r\n };\r\n ListenSequence.prototype.next = function () {\r\n var nextValue = ++this.previousValue;\r\n if (this.writeNewSequenceNumber) {\r\n this.writeNewSequenceNumber(nextValue);\r\n }\r\n return nextValue;\r\n };\r\n ListenSequence.INVALID = -1;\r\n return ListenSequence;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar Deferred$1 = /** @class */ (function () {\r\n function Deferred() {\r\n var _this = this;\r\n this.promise = new Promise(function (resolve, reject) {\r\n _this.resolve = resolve;\r\n _this.reject = reject;\r\n });\r\n }\r\n return Deferred;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Wellknown \"timer\" IDs used when scheduling delayed operations on the\r\n * AsyncQueue. These IDs can then be used from tests to check for the presence\r\n * of operations or to run them early.\r\n *\r\n * The string values are used when encoding these timer IDs in JSON spec tests.\r\n */\r\nvar TimerId;\r\n(function (TimerId) {\r\n /** All can be used with runDelayedOperationsEarly() to run all timers. */\r\n TimerId[\"All\"] = \"all\";\r\n /**\r\n * The following 4 timers are used in persistent_stream.ts for the listen and\r\n * write streams. The \"Idle\" timer is used to close the stream due to\r\n * inactivity. The \"ConnectionBackoff\" timer is used to restart a stream once\r\n * the appropriate backoff delay has elapsed.\r\n */\r\n TimerId[\"ListenStreamIdle\"] = \"listen_stream_idle\";\r\n TimerId[\"ListenStreamConnectionBackoff\"] = \"listen_stream_connection_backoff\";\r\n TimerId[\"WriteStreamIdle\"] = \"write_stream_idle\";\r\n TimerId[\"WriteStreamConnectionBackoff\"] = \"write_stream_connection_backoff\";\r\n /**\r\n * A timer used in online_state_tracker.ts to transition from\r\n * OnlineState.Unknown to Offline after a set timeout, rather than waiting\r\n * indefinitely for success or failure.\r\n */\r\n TimerId[\"OnlineStateTimeout\"] = \"online_state_timeout\";\r\n /**\r\n * A timer used to update the client metadata in IndexedDb, which is used\r\n * to determine the primary leaseholder.\r\n */\r\n TimerId[\"ClientMetadataRefresh\"] = \"client_metadata_refresh\";\r\n})(TimerId || (TimerId = {}));\r\n/**\r\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\r\n *\r\n * It is created via DelayedOperation.createAndSchedule().\r\n *\r\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\r\n */\r\nvar DelayedOperation = /** @class */ (function () {\r\n function DelayedOperation(asyncQueue, timerId, targetTimeMs, op, removalCallback) {\r\n this.asyncQueue = asyncQueue;\r\n this.timerId = timerId;\r\n this.targetTimeMs = targetTimeMs;\r\n this.op = op;\r\n this.removalCallback = removalCallback;\r\n this.deferred = new Deferred$1();\r\n this.then = this.deferred.promise.then.bind(this.deferred.promise);\r\n this.catch = this.deferred.promise.catch.bind(this.deferred.promise);\r\n // It's normal for the deferred promise to be canceled (due to cancellation)\r\n // and so we attach a dummy catch callback to avoid\r\n // 'UnhandledPromiseRejectionWarning' log spam.\r\n this.deferred.promise.catch(function (err) { });\r\n }\r\n /**\r\n * Creates and returns a DelayedOperation that has been scheduled to be\r\n * executed on the provided asyncQueue after the provided delayMs.\r\n *\r\n * @param asyncQueue The queue to schedule the operation on.\r\n * @param id A Timer ID identifying the type of operation this is.\r\n * @param delayMs The delay (ms) before the operation should be scheduled.\r\n * @param op The operation to run.\r\n * @param removalCallback A callback to be called synchronously once the\r\n * operation is executed or canceled, notifying the AsyncQueue to remove it\r\n * from its delayedOperations list.\r\n * PORTING NOTE: This exists to prevent making removeDelayedOperation() and\r\n * the DelayedOperation class public.\r\n */\r\n DelayedOperation.createAndSchedule = function (asyncQueue, timerId, delayMs, op, removalCallback) {\r\n var targetTime = Date.now() + delayMs;\r\n var delayedOp = new DelayedOperation(asyncQueue, timerId, targetTime, op, removalCallback);\r\n delayedOp.start(delayMs);\r\n return delayedOp;\r\n };\r\n /**\r\n * Starts the timer. This is called immediately after construction by\r\n * createAndSchedule().\r\n */\r\n DelayedOperation.prototype.start = function (delayMs) {\r\n var _this = this;\r\n this.timerHandle = setTimeout(function () { return _this.handleDelayElapsed(); }, delayMs);\r\n };\r\n /**\r\n * Queues the operation to run immediately (if it hasn't already been run or\r\n * canceled).\r\n */\r\n DelayedOperation.prototype.skipDelay = function () {\r\n return this.handleDelayElapsed();\r\n };\r\n /**\r\n * Cancels the operation if it hasn't already been executed or canceled. The\r\n * promise will be rejected.\r\n *\r\n * As long as the operation has not yet been run, calling cancel() provides a\r\n * guarantee that the operation will not be run.\r\n */\r\n DelayedOperation.prototype.cancel = function (reason) {\r\n if (this.timerHandle !== null) {\r\n this.clearTimeout();\r\n this.deferred.reject(new FirestoreError(Code.CANCELLED, 'Operation cancelled' + (reason ? ': ' + reason : '')));\r\n }\r\n };\r\n DelayedOperation.prototype.handleDelayElapsed = function () {\r\n var _this = this;\r\n this.asyncQueue.enqueueAndForget(function () {\r\n if (_this.timerHandle !== null) {\r\n _this.clearTimeout();\r\n return _this.op().then(function (result) {\r\n return _this.deferred.resolve(result);\r\n });\r\n }\r\n else {\r\n return Promise.resolve();\r\n }\r\n });\r\n };\r\n DelayedOperation.prototype.clearTimeout = function () {\r\n if (this.timerHandle !== null) {\r\n this.removalCallback(this);\r\n clearTimeout(this.timerHandle);\r\n this.timerHandle = null;\r\n }\r\n };\r\n return DelayedOperation;\r\n}());\r\nvar AsyncQueue = /** @class */ (function () {\r\n function AsyncQueue() {\r\n // The last promise in the queue.\r\n this.tail = Promise.resolve();\r\n // Operations scheduled to be queued in the future. Operations are\r\n // automatically removed after they are run or canceled.\r\n this.delayedOperations = [];\r\n // Flag set while there's an outstanding AsyncQueue operation, used for\r\n // assertion sanity-checks.\r\n this.operationInProgress = false;\r\n }\r\n /**\r\n * Adds a new operation to the queue without waiting for it to complete (i.e.\r\n * we ignore the Promise result).\r\n */\r\n AsyncQueue.prototype.enqueueAndForget = function (op) {\r\n // tslint:disable-next-line:no-floating-promises\r\n this.enqueue(op);\r\n };\r\n /**\r\n * Adds a new operation to the queue. Returns a promise that will be resolved\r\n * when the promise returned by the new operation is (with its value).\r\n */\r\n AsyncQueue.prototype.enqueue = function (op) {\r\n var _this = this;\r\n this.verifyNotFailed();\r\n var newTail = this.tail.then(function () {\r\n _this.operationInProgress = true;\r\n return op()\r\n .catch(function (error$$1) {\r\n _this.failure = error$$1;\r\n _this.operationInProgress = false;\r\n var message = error$$1.stack || error$$1.message || '';\r\n error('INTERNAL UNHANDLED ERROR: ', message);\r\n // Escape the promise chain and throw the error globally so that\r\n // e.g. any global crash reporting library detects and reports it.\r\n // (but not for simulated errors in our tests since this breaks mocha)\r\n if (message.indexOf('Firestore Test Simulated Error') < 0) {\r\n setTimeout(function () {\r\n throw error$$1;\r\n }, 0);\r\n }\r\n // Re-throw the error so that this.tail becomes a rejected Promise and\r\n // all further attempts to chain (via .then) will just short-circuit\r\n // and return the rejected Promise.\r\n throw error$$1;\r\n })\r\n .then(function (result) {\r\n _this.operationInProgress = false;\r\n return result;\r\n });\r\n });\r\n this.tail = newTail;\r\n return newTail;\r\n };\r\n /**\r\n * Schedules an operation to be queued on the AsyncQueue once the specified\r\n * `delayMs` has elapsed. The returned CancelablePromise can be used to cancel\r\n * the operation prior to its running.\r\n */\r\n AsyncQueue.prototype.enqueueAfterDelay = function (timerId, delayMs, op) {\r\n var _this = this;\r\n this.verifyNotFailed();\r\n assert(delayMs >= 0, \"Attempted to schedule an operation with a negative delay of \" + delayMs);\r\n // While not necessarily harmful, we currently don't expect to have multiple\r\n // ops with the same timer id in the queue, so defensively reject them.\r\n assert(!this.containsDelayedOperation(timerId), \"Attempted to schedule multiple operations with timer id \" + timerId + \".\");\r\n var delayedOp = DelayedOperation.createAndSchedule(this, timerId, delayMs, op, function (op) { return _this.removeDelayedOperation(op); });\r\n this.delayedOperations.push(delayedOp);\r\n return delayedOp;\r\n };\r\n AsyncQueue.prototype.verifyNotFailed = function () {\r\n if (this.failure) {\r\n fail('AsyncQueue is already failed: ' +\r\n (this.failure.stack || this.failure.message));\r\n }\r\n };\r\n /**\r\n * Verifies there's an operation currently in-progress on the AsyncQueue.\r\n * Unfortunately we can't verify that the running code is in the promise chain\r\n * of that operation, so this isn't a foolproof check, but it should be enough\r\n * to catch some bugs.\r\n */\r\n AsyncQueue.prototype.verifyOperationInProgress = function () {\r\n assert(this.operationInProgress, 'verifyOpInProgress() called when no op in progress on this queue.');\r\n };\r\n /**\r\n * Waits until all currently queued tasks are finished executing. Delayed\r\n * operations are not run.\r\n */\r\n AsyncQueue.prototype.drain = function () {\r\n return this.enqueue(function () { return Promise.resolve(); });\r\n };\r\n /**\r\n * For Tests: Determine if a delayed operation with a particular TimerId\r\n * exists.\r\n */\r\n AsyncQueue.prototype.containsDelayedOperation = function (timerId) {\r\n return this.delayedOperations.findIndex(function (op) { return op.timerId === timerId; }) >= 0;\r\n };\r\n /**\r\n * For Tests: Runs some or all delayed operations early.\r\n *\r\n * @param lastTimerId Delayed operations up to and including this TimerId will\r\n * be drained. Throws if no such operation exists. Pass TimerId.All to run\r\n * all delayed operations.\r\n * @returns a Promise that resolves once all operations have been run.\r\n */\r\n AsyncQueue.prototype.runDelayedOperationsEarly = function (lastTimerId) {\r\n var _this = this;\r\n // Note that draining may generate more delayed ops, so we do that first.\r\n return this.drain().then(function () {\r\n assert(lastTimerId === TimerId.All ||\r\n _this.containsDelayedOperation(lastTimerId), \"Attempted to drain to missing operation \" + lastTimerId);\r\n // Run ops in the same order they'd run if they ran naturally.\r\n _this.delayedOperations.sort(function (a, b) { return a.targetTimeMs - b.targetTimeMs; });\r\n for (var _i = 0, _a = _this.delayedOperations; _i < _a.length; _i++) {\r\n var op = _a[_i];\r\n op.skipDelay();\r\n if (lastTimerId !== TimerId.All && op.timerId === lastTimerId) {\r\n break;\r\n }\r\n }\r\n return _this.drain();\r\n });\r\n };\r\n /** Called once a DelayedOperation is run or canceled. */\r\n AsyncQueue.prototype.removeDelayedOperation = function (op) {\r\n // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\r\n var index = this.delayedOperations.indexOf(op);\r\n assert(index >= 0, 'Delayed operation not found.');\r\n this.delayedOperations.splice(index, 1);\r\n };\r\n return AsyncQueue;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar escapeChar = '\\u0001';\r\nvar encodedSeparatorChar = '\\u0001';\r\nvar encodedNul = '\\u0010';\r\nvar encodedEscape = '\\u0011';\r\n/**\r\n * Encodes a resource path into a IndexedDb-compatible string form.\r\n */\r\nfunction encode(path) {\r\n var result = '';\r\n for (var i = 0; i < path.length; i++) {\r\n if (result.length > 0) {\r\n result = encodeSeparator(result);\r\n }\r\n result = encodeSegment(path.get(i), result);\r\n }\r\n return encodeSeparator(result);\r\n}\r\n/** Encodes a single segment of a resource path into the given result */\r\nfunction encodeSegment(segment, resultBuf) {\r\n var result = resultBuf;\r\n var length = segment.length;\r\n for (var i = 0; i < length; i++) {\r\n var c = segment.charAt(i);\r\n switch (c) {\r\n case '\\0':\r\n result += escapeChar + encodedNul;\r\n break;\r\n case escapeChar:\r\n result += escapeChar + encodedEscape;\r\n break;\r\n default:\r\n result += c;\r\n }\r\n }\r\n return result;\r\n}\r\n/** Encodes a path separator into the given result */\r\nfunction encodeSeparator(result) {\r\n return result + escapeChar + encodedSeparatorChar;\r\n}\r\n/**\r\n * Decodes the given IndexedDb-compatible string form of a resource path into\r\n * a ResourcePath instance. Note that this method is not suitable for use with\r\n * decoding resource names from the server; those are One Platform format\r\n * strings.\r\n */\r\nfunction decode$1(path) {\r\n // Event the empty path must encode as a path of at least length 2. A path\r\n // with exactly 2 must be the empty path.\r\n var length = path.length;\r\n assert(length >= 2, 'Invalid path ' + path);\r\n if (length === 2) {\r\n assert(path.charAt(0) === escapeChar && path.charAt(1) === encodedSeparatorChar, 'Non-empty path ' + path + ' had length 2');\r\n return ResourcePath.EMPTY_PATH;\r\n }\r\n // Escape characters cannot exist past the second-to-last position in the\r\n // source value.\r\n var lastReasonableEscapeIndex = length - 2;\r\n var segments = [];\r\n var segmentBuilder = '';\r\n for (var start = 0; start < length;) {\r\n // The last two characters of a valid encoded path must be a separator, so\r\n // there must be an end to this segment.\r\n var end = path.indexOf(escapeChar, start);\r\n if (end < 0 || end > lastReasonableEscapeIndex) {\r\n fail('Invalid encoded resource path: \"' + path + '\"');\r\n }\r\n var next = path.charAt(end + 1);\r\n switch (next) {\r\n case encodedSeparatorChar:\r\n var currentPiece = path.substring(start, end);\r\n var segment = void 0;\r\n if (segmentBuilder.length === 0) {\r\n // Avoid copying for the common case of a segment that excludes \\0\r\n // and \\001\r\n segment = currentPiece;\r\n }\r\n else {\r\n segmentBuilder += currentPiece;\r\n segment = segmentBuilder;\r\n segmentBuilder = '';\r\n }\r\n segments.push(segment);\r\n break;\r\n case encodedNul:\r\n segmentBuilder += path.substring(start, end);\r\n segmentBuilder += '\\0';\r\n break;\r\n case encodedEscape:\r\n // The escape character can be used in the output to encode itself.\r\n segmentBuilder += path.substring(start, end + 1);\r\n break;\r\n default:\r\n fail('Invalid encoded resource path: \"' + path + '\"');\r\n }\r\n start = end + 2;\r\n }\r\n return new ResourcePath(segments);\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar BATCHID_UNKNOWN = -1;\r\n/**\r\n * A batch of mutations that will be sent as one unit to the backend.\r\n */\r\nvar MutationBatch = /** @class */ (function () {\r\n function MutationBatch(batchId, localWriteTime, mutations) {\r\n this.batchId = batchId;\r\n this.localWriteTime = localWriteTime;\r\n this.mutations = mutations;\r\n }\r\n /**\r\n * Applies all the mutations in this MutationBatch to the specified document\r\n * to create a new remote document\r\n *\r\n * @param docKey The key of the document to apply mutations to.\r\n * @param maybeDoc The document to apply mutations to.\r\n * @param batchResult The result of applying the MutationBatch to the\r\n * backend.\r\n */\r\n MutationBatch.prototype.applyToRemoteDocument = function (docKey, maybeDoc, batchResult) {\r\n if (maybeDoc) {\r\n assert(maybeDoc.key.isEqual(docKey), \"applyToRemoteDocument: key \" + docKey + \" should match maybeDoc key\\n \" + maybeDoc.key);\r\n }\r\n var mutationResults = batchResult.mutationResults;\r\n assert(mutationResults.length === this.mutations.length, \"Mismatch between mutations length\\n (\" + this.mutations.length + \") and mutation results length\\n (\" + mutationResults.length + \").\");\r\n for (var i = 0; i < this.mutations.length; i++) {\r\n var mutation = this.mutations[i];\r\n if (mutation.key.isEqual(docKey)) {\r\n var mutationResult = mutationResults[i];\r\n maybeDoc = mutation.applyToRemoteDocument(maybeDoc, mutationResult);\r\n }\r\n }\r\n return maybeDoc;\r\n };\r\n /**\r\n * Computes the local view of a document given all the mutations in this\r\n * batch.\r\n *\r\n * @param docKey The key of the document to apply mutations to.\r\n * @param maybeDoc The document to apply mutations to.\r\n */\r\n MutationBatch.prototype.applyToLocalView = function (docKey, maybeDoc) {\r\n if (maybeDoc) {\r\n assert(maybeDoc.key.isEqual(docKey), \"applyToLocalDocument: key \" + docKey + \" should match maybeDoc key\\n \" + maybeDoc.key);\r\n }\r\n var baseDoc = maybeDoc;\r\n for (var i = 0; i < this.mutations.length; i++) {\r\n var mutation = this.mutations[i];\r\n if (mutation.key.isEqual(docKey)) {\r\n maybeDoc = mutation.applyToLocalView(maybeDoc, baseDoc, this.localWriteTime);\r\n }\r\n }\r\n return maybeDoc;\r\n };\r\n MutationBatch.prototype.keys = function () {\r\n var keySet = documentKeySet();\r\n for (var _i = 0, _a = this.mutations; _i < _a.length; _i++) {\r\n var mutation = _a[_i];\r\n keySet = keySet.add(mutation.key);\r\n }\r\n return keySet;\r\n };\r\n MutationBatch.prototype.isEqual = function (other) {\r\n return (this.batchId === other.batchId &&\r\n arrayEquals(this.mutations, other.mutations));\r\n };\r\n /**\r\n * Returns true if this mutation batch has already been removed from the\r\n * mutation queue.\r\n *\r\n * Note that not all implementations of the MutationQueue necessarily use\r\n * tombstones as part of their implementation and generally speaking no code\r\n * outside the mutation queues should really care about this.\r\n */\r\n MutationBatch.prototype.isTombstone = function () {\r\n return this.mutations.length === 0;\r\n };\r\n /** Converts this batch into a tombstone */\r\n MutationBatch.prototype.toTombstone = function () {\r\n return new MutationBatch(this.batchId, this.localWriteTime, []);\r\n };\r\n return MutationBatch;\r\n}());\r\n/** The result of applying a mutation batch to the backend. */\r\nvar MutationBatchResult = /** @class */ (function () {\r\n function MutationBatchResult(batch, commitVersion, mutationResults, streamToken, \r\n /**\r\n * A pre-computed mapping from each mutated document to the resulting\r\n * version.\r\n */\r\n docVersions) {\r\n this.batch = batch;\r\n this.commitVersion = commitVersion;\r\n this.mutationResults = mutationResults;\r\n this.streamToken = streamToken;\r\n this.docVersions = docVersions;\r\n }\r\n /**\r\n * Creates a new MutationBatchResult for the given batch and results. There\r\n * must be one result for each mutation in the batch. This static factory\r\n * caches a document=>version mapping (docVersions).\r\n */\r\n MutationBatchResult.from = function (batch, commitVersion, results, streamToken) {\r\n assert(batch.mutations.length === results.length, 'Mutations sent ' +\r\n batch.mutations.length +\r\n ' must equal results received ' +\r\n results.length);\r\n var versionMap = documentVersionMap();\r\n var mutations = batch.mutations;\r\n for (var i = 0; i < mutations.length; i++) {\r\n versionMap = versionMap.insert(mutations[i].key, results[i].version);\r\n }\r\n return new MutationBatchResult(batch, commitVersion, results, streamToken, versionMap);\r\n };\r\n return MutationBatchResult;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * PersistencePromise<> is essentially a re-implementation of Promise<> except\r\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\r\n * are executed synchronously when a PersistencePromise resolves rather than\r\n * asynchronously (Promise<> implementations use setImmediate() or similar).\r\n *\r\n * This is necessary to interoperate with IndexedDB which will automatically\r\n * commit transactions if control is returned to the event loop without\r\n * synchronously initiating another operation on the transaction.\r\n *\r\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\r\n * Promises.\r\n */\r\nvar PersistencePromise = /** @class */ (function () {\r\n function PersistencePromise(callback) {\r\n var _this = this;\r\n // NOTE: next/catchCallback will always point to our own wrapper functions,\r\n // not the user's raw next() or catch() callbacks.\r\n // tslint:disable-next-line:no-any Accept any result type for the next call in the Promise chain.\r\n this.nextCallback = null;\r\n // tslint:disable-next-line:no-any Accept any result type for the error handler.\r\n this.catchCallback = null;\r\n // When the operation resolves, we'll set result or error and mark isDone.\r\n this.result = undefined;\r\n this.error = undefined;\r\n this.isDone = false;\r\n // Set to true when .then() or .catch() are called and prevents additional\r\n // chaining.\r\n this.callbackAttached = false;\r\n callback(function (value) {\r\n _this.isDone = true;\r\n _this.result = value;\r\n if (_this.nextCallback) {\r\n // value should be defined unless T is Void, but we can't express\r\n // that in the type system.\r\n _this.nextCallback(value);\r\n }\r\n }, function (error) {\r\n _this.isDone = true;\r\n _this.error = error;\r\n if (_this.catchCallback) {\r\n _this.catchCallback(error);\r\n }\r\n });\r\n }\r\n PersistencePromise.prototype.catch = function (fn) {\r\n return this.next(undefined, fn);\r\n };\r\n PersistencePromise.prototype.next = function (nextFn, catchFn) {\r\n var _this = this;\r\n if (this.callbackAttached) {\r\n fail('Called next() or catch() twice for PersistencePromise');\r\n }\r\n this.callbackAttached = true;\r\n if (this.isDone) {\r\n if (!this.error) {\r\n return this.wrapSuccess(nextFn, this.result);\r\n }\r\n else {\r\n return this.wrapFailure(catchFn, this.error);\r\n }\r\n }\r\n else {\r\n return new PersistencePromise(function (resolve, reject) {\r\n _this.nextCallback = function (value) {\r\n _this.wrapSuccess(nextFn, value).next(resolve, reject);\r\n };\r\n _this.catchCallback = function (error) {\r\n _this.wrapFailure(catchFn, error).next(resolve, reject);\r\n };\r\n });\r\n }\r\n };\r\n PersistencePromise.prototype.toPromise = function () {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n _this.next(resolve, reject);\r\n });\r\n };\r\n PersistencePromise.prototype.wrapUserFunction = function (fn) {\r\n try {\r\n var result = fn();\r\n if (result instanceof PersistencePromise) {\r\n return result;\r\n }\r\n else {\r\n return PersistencePromise.resolve(result);\r\n }\r\n }\r\n catch (e) {\r\n return PersistencePromise.reject(e);\r\n }\r\n };\r\n PersistencePromise.prototype.wrapSuccess = function (nextFn, value) {\r\n if (nextFn) {\r\n return this.wrapUserFunction(function () { return nextFn(value); });\r\n }\r\n else {\r\n // If there's no nextFn, then R must be the same as T but we\r\n // can't express that in the type system.\r\n // tslint:disable-next-line:no-any\r\n return PersistencePromise.resolve(value);\r\n }\r\n };\r\n PersistencePromise.prototype.wrapFailure = function (catchFn, error) {\r\n if (catchFn) {\r\n return this.wrapUserFunction(function () { return catchFn(error); });\r\n }\r\n else {\r\n return PersistencePromise.reject(error);\r\n }\r\n };\r\n PersistencePromise.resolve = function (result) {\r\n return new PersistencePromise(function (resolve, reject) {\r\n resolve(result);\r\n });\r\n };\r\n PersistencePromise.reject = function (error) {\r\n return new PersistencePromise(function (resolve, reject) {\r\n reject(error);\r\n });\r\n };\r\n PersistencePromise.waitFor = function (\r\n // tslint:disable-next-line:no-any Accept all Promise types in waitFor().\r\n all) {\r\n var it = all[Symbol.iterator]();\r\n return new PersistencePromise(function (resolve, reject) {\r\n var expectedCount = 0;\r\n var resolvedCount = 0;\r\n var result = it.next();\r\n while (!result.done) {\r\n ++expectedCount;\r\n result.value.next(function () {\r\n ++resolvedCount;\r\n if (result.done && resolvedCount === expectedCount) {\r\n resolve();\r\n }\r\n }, function (err) { return reject(err); });\r\n result = it.next();\r\n }\r\n if (resolvedCount === expectedCount) {\r\n resolve();\r\n }\r\n });\r\n };\r\n PersistencePromise.map = function (all) {\r\n var results = [];\r\n var promises = [];\r\n var it = all[Symbol.iterator]();\r\n var result = it.next();\r\n var count = 0;\r\n var _loop_1 = function () {\r\n var value = result.value;\r\n var index = count;\r\n promises.push(value.next(function (val) {\r\n results[index] = val;\r\n }));\r\n result = it.next();\r\n ++count;\r\n };\r\n while (!result.done) {\r\n _loop_1();\r\n }\r\n return PersistencePromise.waitFor(promises).next(function () { return results; });\r\n };\r\n /**\r\n * Given an array of predicate functions that asynchronously evaluate to a\r\n * boolean, implements a short-circuiting `or` between the results. Predicates\r\n * will be evaluated until one of them returns `true`, then stop. The final\r\n * result will be whether any of them returned `true`.\r\n */\r\n PersistencePromise.or = function (predicates) {\r\n var p = PersistencePromise.resolve(false);\r\n var _loop_2 = function (predicate) {\r\n p = p.next(function (isTrue) {\r\n if (isTrue) {\r\n return PersistencePromise.resolve(isTrue);\r\n }\r\n else {\r\n return predicate();\r\n }\r\n });\r\n };\r\n for (var _i = 0, predicates_1 = predicates; _i < predicates_1.length; _i++) {\r\n var predicate = predicates_1[_i];\r\n _loop_2(predicate);\r\n }\r\n return p;\r\n };\r\n /**\r\n * Given an iterable, call the given function on each element in the\r\n * collection and wait for all of the resulting concurrent\r\n * PersistencePromises to resolve.\r\n */\r\n PersistencePromise.forEach = function (collection, f) {\r\n var it = collection[Symbol.iterator]();\r\n var promises = [];\r\n var result = it.next();\r\n while (!result.done) {\r\n var value = result.value;\r\n promises.push(f(value));\r\n result = it.next();\r\n }\r\n return this.waitFor(promises);\r\n };\r\n return PersistencePromise;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Schema Version for the Web client:\r\n * 1. Initial version including Mutation Queue, Query Cache, and Remote Document\r\n * Cache\r\n * 2. Used to ensure a targetGlobal object exists and add targetCount to it. No\r\n * longer required because migration 3 unconditionally clears it.\r\n * 3. Dropped and re-created Query Cache to deal with cache corruption related\r\n * to limbo resolution. Addresses\r\n * https://github.com/firebase/firebase-ios-sdk/issues/1548\r\n * 4. Multi-Tab Support.\r\n * 5. Removal of held write acks.\r\n */\r\nvar SCHEMA_VERSION = 5;\r\n/** Performs database creation and schema upgrades. */\r\nvar SchemaConverter = /** @class */ (function () {\r\n function SchemaConverter(serializer) {\r\n this.serializer = serializer;\r\n }\r\n /**\r\n * Performs database creation and schema upgrades.\r\n *\r\n * Note that in production, this method is only ever used to upgrade the schema\r\n * to SCHEMA_VERSION. Different values of toVersion are only used for testing\r\n * and local feature development.\r\n */\r\n SchemaConverter.prototype.createOrUpgrade = function (db, txn, fromVersion, toVersion) {\r\n var _this = this;\r\n assert(fromVersion < toVersion &&\r\n fromVersion >= 0 &&\r\n toVersion <= SCHEMA_VERSION, \"Unexpected schema upgrade from v\" + fromVersion + \" to v{toVersion}.\");\r\n if (fromVersion < 1 && toVersion >= 1) {\r\n createPrimaryClientStore(db);\r\n createMutationQueue(db);\r\n createQueryCache(db);\r\n createRemoteDocumentCache(db);\r\n }\r\n // Migration 2 to populate the targetGlobal object no longer needed since\r\n // migration 3 unconditionally clears it.\r\n var p = PersistencePromise.resolve();\r\n if (fromVersion < 3 && toVersion >= 3) {\r\n // Brand new clients don't need to drop and recreate--only clients that\r\n // potentially have corrupt data.\r\n if (fromVersion !== 0) {\r\n dropQueryCache(db);\r\n createQueryCache(db);\r\n }\r\n p = p.next(function () { return writeEmptyTargetGlobalEntry(txn); });\r\n }\r\n if (fromVersion < 4 && toVersion >= 4) {\r\n if (fromVersion !== 0) {\r\n // Schema version 3 uses auto-generated keys to generate globally unique\r\n // mutation batch IDs (this was previously ensured internally by the\r\n // client). To migrate to the new schema, we have to read all mutations\r\n // and write them back out. We preserve the existing batch IDs to guarantee\r\n // consistency with other object stores. Any further mutation batch IDs will\r\n // be auto-generated.\r\n p = p.next(function () { return upgradeMutationBatchSchemaAndMigrateData(db, txn); });\r\n }\r\n p = p.next(function () {\r\n createClientMetadataStore(db);\r\n createRemoteDocumentChangesStore(db);\r\n });\r\n }\r\n if (fromVersion < 5 && toVersion >= 5) {\r\n p = p.next(function () { return _this.removeAcknowledgedMutations(txn); });\r\n }\r\n return p;\r\n };\r\n SchemaConverter.prototype.removeAcknowledgedMutations = function (txn) {\r\n var _this = this;\r\n var queuesStore = txn.store(DbMutationQueue.store);\r\n var mutationsStore = txn.store(DbMutationBatch.store);\r\n return queuesStore.loadAll().next(function (queues) {\r\n return PersistencePromise.forEach(queues, function (queue) {\r\n var range = IDBKeyRange.bound([queue.userId, BATCHID_UNKNOWN], [queue.userId, queue.lastAcknowledgedBatchId]);\r\n return mutationsStore\r\n .loadAll(DbMutationBatch.userMutationsIndex, range)\r\n .next(function (dbBatches) {\r\n return PersistencePromise.forEach(dbBatches, function (dbBatch) {\r\n assert(dbBatch.userId === queue.userId, \"Cannot process batch \" + dbBatch.batchId + \" from unexpected user\");\r\n var batch = _this.serializer.fromDbMutationBatch(dbBatch);\r\n return removeMutationBatch(txn, queue.userId, batch).next();\r\n });\r\n });\r\n });\r\n });\r\n };\r\n return SchemaConverter;\r\n}());\r\n/**\r\n * Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.\r\n */\r\nvar DbTimestamp = /** @class */ (function () {\r\n function DbTimestamp(seconds, nanoseconds) {\r\n this.seconds = seconds;\r\n this.nanoseconds = nanoseconds;\r\n }\r\n return DbTimestamp;\r\n}());\r\n/**\r\n * A singleton object to be stored in the 'owner' store in IndexedDb.\r\n *\r\n * A given database can have a single primary tab assigned at a given time. That\r\n * tab must validate that it is still holding the primary lease before every\r\n * operation that requires locked access. The primary tab should regularly\r\n * write an updated timestamp to this lease to prevent other tabs from\r\n * \"stealing\" the primary lease\r\n */\r\nvar DbPrimaryClient = /** @class */ (function () {\r\n function DbPrimaryClient(ownerId, \r\n /** Whether to allow shared access from multiple tabs. */\r\n allowTabSynchronization, leaseTimestampMs) {\r\n this.ownerId = ownerId;\r\n this.allowTabSynchronization = allowTabSynchronization;\r\n this.leaseTimestampMs = leaseTimestampMs;\r\n }\r\n /**\r\n * Name of the IndexedDb object store.\r\n *\r\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\r\n * older clients that only supported single locked access to the persistence\r\n * layer.\r\n */\r\n DbPrimaryClient.store = 'owner';\r\n /**\r\n * The key string used for the single object that exists in the\r\n * DbPrimaryClient store.\r\n */\r\n DbPrimaryClient.key = 'owner';\r\n return DbPrimaryClient;\r\n}());\r\nfunction createPrimaryClientStore(db) {\r\n db.createObjectStore(DbPrimaryClient.store);\r\n}\r\n/**\r\n * An object to be stored in the 'mutationQueues' store in IndexedDb.\r\n *\r\n * Each user gets a single queue of MutationBatches to apply to the server.\r\n * DbMutationQueue tracks the metadata about the queue.\r\n */\r\nvar DbMutationQueue = /** @class */ (function () {\r\n function DbMutationQueue(\r\n /**\r\n * The normalized user ID to which this queue belongs.\r\n */\r\n userId, \r\n /**\r\n * An identifier for the highest numbered batch that has been acknowledged\r\n * by the server. All MutationBatches in this queue with batchIds less\r\n * than or equal to this value are considered to have been acknowledged by\r\n * the server.\r\n */\r\n lastAcknowledgedBatchId, \r\n /**\r\n * A stream token that was previously sent by the server.\r\n *\r\n * See StreamingWriteRequest in datastore.proto for more details about\r\n * usage.\r\n *\r\n * After sending this token, earlier tokens may not be used anymore so\r\n * only a single stream token is retained.\r\n */\r\n lastStreamToken) {\r\n this.userId = userId;\r\n this.lastAcknowledgedBatchId = lastAcknowledgedBatchId;\r\n this.lastStreamToken = lastStreamToken;\r\n }\r\n /** Name of the IndexedDb object store. */\r\n DbMutationQueue.store = 'mutationQueues';\r\n /** Keys are automatically assigned via the userId property. */\r\n DbMutationQueue.keyPath = 'userId';\r\n return DbMutationQueue;\r\n}());\r\n/**\r\n * An object to be stored in the 'mutations' store in IndexedDb.\r\n *\r\n * Represents a batch of user-level mutations intended to be sent to the server\r\n * in a single write. Each user-level batch gets a separate DbMutationBatch\r\n * with a new batchId.\r\n */\r\nvar DbMutationBatch = /** @class */ (function () {\r\n function DbMutationBatch(\r\n /**\r\n * The normalized user ID to which this batch belongs.\r\n */\r\n userId, \r\n /**\r\n * An identifier for this batch, allocated using an auto-generated key.\r\n */\r\n batchId, \r\n /**\r\n * The local write time of the batch, stored as milliseconds since the\r\n * epoch.\r\n */\r\n localWriteTimeMs, \r\n /**\r\n * A list of mutations to apply. All mutations will be applied atomically.\r\n *\r\n * Mutations are serialized via JsonProtoSerializer.toMutation().\r\n */\r\n mutations) {\r\n this.userId = userId;\r\n this.batchId = batchId;\r\n this.localWriteTimeMs = localWriteTimeMs;\r\n this.mutations = mutations;\r\n }\r\n /** Name of the IndexedDb object store. */\r\n DbMutationBatch.store = 'mutations';\r\n /** Keys are automatically assigned via the userId, batchId properties. */\r\n DbMutationBatch.keyPath = 'batchId';\r\n /** The index name for lookup of mutations by user. */\r\n DbMutationBatch.userMutationsIndex = 'userMutationsIndex';\r\n /** The user mutations index is keyed by [userId, batchId] pairs. */\r\n DbMutationBatch.userMutationsKeyPath = ['userId', 'batchId'];\r\n return DbMutationBatch;\r\n}());\r\nfunction createMutationQueue(db) {\r\n db.createObjectStore(DbMutationQueue.store, {\r\n keyPath: DbMutationQueue.keyPath\r\n });\r\n var mutationBatchesStore = db.createObjectStore(DbMutationBatch.store, {\r\n keyPath: DbMutationBatch.keyPath,\r\n autoIncrement: true\r\n });\r\n mutationBatchesStore.createIndex(DbMutationBatch.userMutationsIndex, DbMutationBatch.userMutationsKeyPath, { unique: true });\r\n db.createObjectStore(DbDocumentMutation.store);\r\n}\r\n/**\r\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\r\n * and rewrites all data.\r\n */\r\nfunction upgradeMutationBatchSchemaAndMigrateData(db, txn) {\r\n var v1MutationsStore = txn.store(DbMutationBatch.store);\r\n return v1MutationsStore.loadAll().next(function (existingMutations) {\r\n db.deleteObjectStore(DbMutationBatch.store);\r\n var mutationsStore = db.createObjectStore(DbMutationBatch.store, {\r\n keyPath: DbMutationBatch.keyPath,\r\n autoIncrement: true\r\n });\r\n mutationsStore.createIndex(DbMutationBatch.userMutationsIndex, DbMutationBatch.userMutationsKeyPath, { unique: true });\r\n var v3MutationsStore = txn.store(DbMutationBatch.store);\r\n var writeAll = existingMutations.map(function (mutation) {\r\n return v3MutationsStore.put(mutation);\r\n });\r\n return PersistencePromise.waitFor(writeAll);\r\n });\r\n}\r\n/**\r\n * An object to be stored in the 'documentMutations' store in IndexedDb.\r\n *\r\n * A manually maintained index of all the mutation batches that affect a given\r\n * document key. The rows in this table are references based on the contents of\r\n * DbMutationBatch.mutations.\r\n */\r\nvar DbDocumentMutation = /** @class */ (function () {\r\n function DbDocumentMutation() {\r\n }\r\n /**\r\n * Creates a [userId] key for use in the DbDocumentMutations index to iterate\r\n * over all of a user's document mutations.\r\n */\r\n DbDocumentMutation.prefixForUser = function (userId) {\r\n return [userId];\r\n };\r\n /**\r\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\r\n * index to iterate over all at document mutations for a given path or lower.\r\n */\r\n DbDocumentMutation.prefixForPath = function (userId, path) {\r\n return [userId, encode(path)];\r\n };\r\n /**\r\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\r\n * and deleting into the DbDocumentMutations index.\r\n */\r\n DbDocumentMutation.key = function (userId, path, batchId) {\r\n return [userId, encode(path), batchId];\r\n };\r\n DbDocumentMutation.store = 'documentMutations';\r\n /**\r\n * Because we store all the useful information for this store in the key,\r\n * there is no useful information to store as the value. The raw (unencoded)\r\n * path cannot be stored because IndexedDb doesn't store prototype\r\n * information.\r\n */\r\n DbDocumentMutation.PLACEHOLDER = new DbDocumentMutation();\r\n return DbDocumentMutation;\r\n}());\r\nfunction createRemoteDocumentCache(db) {\r\n db.createObjectStore(DbRemoteDocument.store);\r\n}\r\n/**\r\n * Represents the known absence of a document at a particular version.\r\n * Stored in IndexedDb as part of a DbRemoteDocument object.\r\n */\r\nvar DbNoDocument = /** @class */ (function () {\r\n function DbNoDocument(path, readTime) {\r\n this.path = path;\r\n this.readTime = readTime;\r\n }\r\n return DbNoDocument;\r\n}());\r\n/**\r\n * Represents a document that is known to exist but whose data is unknown.\r\n * Stored in IndexedDb as part of a DbRemoteDocument object.\r\n */\r\nvar DbUnknownDocument = /** @class */ (function () {\r\n function DbUnknownDocument(path, version) {\r\n this.path = path;\r\n this.version = version;\r\n }\r\n return DbUnknownDocument;\r\n}());\r\n/**\r\n * An object to be stored in the 'remoteDocuments' store in IndexedDb.\r\n * It represents either:\r\n *\r\n * - A complete document.\r\n * - A \"no document\" representing a document that is known not to exist (at\r\n * some version).\r\n * - An \"unknown document\" representing a document that is known to exist (at\r\n * some version) but whose contents are unknown.\r\n *\r\n * Note: This is the persisted equivalent of a MaybeDocument and could perhaps\r\n * be made more general if necessary.\r\n */\r\nvar DbRemoteDocument = /** @class */ (function () {\r\n function DbRemoteDocument(\r\n /**\r\n * Set to an instance of DbUnknownDocument if the data for a document is\r\n * not known, but it is known that a document exists at the specified\r\n * version (e.g. it had a successful update applied to it)\r\n */\r\n unknownDocument, \r\n /**\r\n * Set to an instance of a DbNoDocument if it is known that no document\r\n * exists.\r\n */\r\n noDocument, \r\n /**\r\n * Set to an instance of a Document if there's a cached version of the\r\n * document.\r\n */\r\n document, \r\n /**\r\n * Documents that were written to the remote document store based on\r\n * a write acknowledgment are marked with `hasCommittedMutations`. These\r\n * documents are potentially inconsistent with the backend's copy and use\r\n * the write's commit version as their document version.\r\n */\r\n hasCommittedMutations) {\r\n this.unknownDocument = unknownDocument;\r\n this.noDocument = noDocument;\r\n this.document = document;\r\n this.hasCommittedMutations = hasCommittedMutations;\r\n }\r\n DbRemoteDocument.store = 'remoteDocuments';\r\n return DbRemoteDocument;\r\n}());\r\n/**\r\n * An object to be stored in the 'targets' store in IndexedDb.\r\n *\r\n * This is based on and should be kept in sync with the proto used in the iOS\r\n * client.\r\n *\r\n * Each query the client listens to against the server is tracked on disk so\r\n * that the query can be efficiently resumed on restart.\r\n */\r\nvar DbTarget = /** @class */ (function () {\r\n function DbTarget(\r\n /**\r\n * An auto-generated sequential numeric identifier for the query.\r\n *\r\n * Queries are stored using their canonicalId as the key, but these\r\n * canonicalIds can be quite long so we additionally assign a unique\r\n * queryId which can be used by referenced data structures (e.g.\r\n * indexes) to minimize the on-disk cost.\r\n */\r\n targetId, \r\n /**\r\n * The canonical string representing this query. This is not unique.\r\n */\r\n canonicalId, \r\n /**\r\n * The last readTime received from the Watch Service for this query.\r\n *\r\n * This is the same value as TargetChange.read_time in the protos.\r\n */\r\n readTime, \r\n /**\r\n * An opaque, server-assigned token that allows watching a query to be\r\n * resumed after disconnecting without retransmitting all the data\r\n * that matches the query. The resume token essentially identifies a\r\n * point in time from which the server should resume sending results.\r\n *\r\n * This is related to the snapshotVersion in that the resumeToken\r\n * effectively also encodes that value, but the resumeToken is opaque\r\n * and sometimes encodes additional information.\r\n *\r\n * A consequence of this is that the resumeToken should be used when\r\n * asking the server to reason about where this client is in the watch\r\n * stream, but the client should use the snapshotVersion for its own\r\n * purposes.\r\n *\r\n * This is the same value as TargetChange.resume_token in the protos.\r\n */\r\n resumeToken, \r\n /**\r\n * A sequence number representing the last time this query was\r\n * listened to, used for garbage collection purposes.\r\n *\r\n * Conventionally this would be a timestamp value, but device-local\r\n * clocks are unreliable and they must be able to create new listens\r\n * even while disconnected. Instead this should be a monotonically\r\n * increasing number that's incremented on each listen call.\r\n *\r\n * This is different from the queryId since the queryId is an\r\n * immutable identifier assigned to the Query on first use while\r\n * lastListenSequenceNumber is updated every time the query is\r\n * listened to.\r\n */\r\n lastListenSequenceNumber, \r\n /**\r\n * The query for this target.\r\n *\r\n * Because canonical ids are not unique we must store the actual query. We\r\n * use the proto to have an object we can persist without having to\r\n * duplicate translation logic to and from a `Query` object.\r\n */\r\n query) {\r\n this.targetId = targetId;\r\n this.canonicalId = canonicalId;\r\n this.readTime = readTime;\r\n this.resumeToken = resumeToken;\r\n this.lastListenSequenceNumber = lastListenSequenceNumber;\r\n this.query = query;\r\n }\r\n DbTarget.store = 'targets';\r\n /** Keys are automatically assigned via the targetId property. */\r\n DbTarget.keyPath = 'targetId';\r\n /** The name of the queryTargets index. */\r\n DbTarget.queryTargetsIndexName = 'queryTargetsIndex';\r\n /**\r\n * The index of all canonicalIds to the targets that they match. This is not\r\n * a unique mapping because canonicalId does not promise a unique name for all\r\n * possible queries, so we append the targetId to make the mapping unique.\r\n */\r\n DbTarget.queryTargetsKeyPath = ['canonicalId', 'targetId'];\r\n return DbTarget;\r\n}());\r\n/**\r\n * An object representing an association between a target and a document, or a\r\n * sentinel row marking the last sequence number at which a document was used.\r\n * Each document cached must have a corresponding sentinel row before lru\r\n * garbage collection is enabled.\r\n *\r\n * The target associations and sentinel rows are co-located so that orphaned\r\n * documents and their sequence numbers can be identified efficiently via a scan\r\n * of this store.\r\n */\r\nvar DbTargetDocument = /** @class */ (function () {\r\n function DbTargetDocument(\r\n /**\r\n * The targetId identifying a target or 0 for a sentinel row.\r\n */\r\n targetId, \r\n /**\r\n * The path to the document, as encoded in the key.\r\n */\r\n path, \r\n /**\r\n * If this is a sentinel row, this should be the sequence number of the last\r\n * time the document specified by `path` was used. Otherwise, it should be\r\n * `undefined`.\r\n */\r\n sequenceNumber) {\r\n this.targetId = targetId;\r\n this.path = path;\r\n this.sequenceNumber = sequenceNumber;\r\n assert((targetId === 0) === (sequenceNumber !== undefined), \r\n // tslint:disable-next-line:max-line-length\r\n 'A target-document row must either have targetId == 0 and a defined sequence number, or a non-zero targetId and no sequence number');\r\n }\r\n /** Name of the IndexedDb object store. */\r\n DbTargetDocument.store = 'targetDocuments';\r\n /** Keys are automatically assigned via the targetId, path properties. */\r\n DbTargetDocument.keyPath = ['targetId', 'path'];\r\n /** The index name for the reverse index. */\r\n DbTargetDocument.documentTargetsIndex = 'documentTargetsIndex';\r\n /** We also need to create the reverse index for these properties. */\r\n DbTargetDocument.documentTargetsKeyPath = ['path', 'targetId'];\r\n return DbTargetDocument;\r\n}());\r\n/**\r\n * A record of global state tracked across all Targets, tracked separately\r\n * to avoid the need for extra indexes.\r\n *\r\n * This should be kept in-sync with the proto used in the iOS client.\r\n */\r\nvar DbTargetGlobal = /** @class */ (function () {\r\n function DbTargetGlobal(\r\n /**\r\n * The highest numbered target id across all targets.\r\n *\r\n * See DbTarget.targetId.\r\n */\r\n highestTargetId, \r\n /**\r\n * The highest numbered lastListenSequenceNumber across all targets.\r\n *\r\n * See DbTarget.lastListenSequenceNumber.\r\n */\r\n highestListenSequenceNumber, \r\n /**\r\n * A global snapshot version representing the last consistent snapshot we\r\n * received from the backend. This is monotonically increasing and any\r\n * snapshots received from the backend prior to this version (e.g. for\r\n * targets resumed with a resumeToken) should be suppressed (buffered)\r\n * until the backend has caught up to this snapshot version again. This\r\n * prevents our cache from ever going backwards in time.\r\n */\r\n lastRemoteSnapshotVersion, \r\n /**\r\n * The number of targets persisted.\r\n */\r\n targetCount) {\r\n this.highestTargetId = highestTargetId;\r\n this.highestListenSequenceNumber = highestListenSequenceNumber;\r\n this.lastRemoteSnapshotVersion = lastRemoteSnapshotVersion;\r\n this.targetCount = targetCount;\r\n }\r\n /**\r\n * The key string used for the single object that exists in the\r\n * DbTargetGlobal store.\r\n */\r\n DbTargetGlobal.key = 'targetGlobalKey';\r\n DbTargetGlobal.store = 'targetGlobal';\r\n return DbTargetGlobal;\r\n}());\r\nfunction createQueryCache(db) {\r\n var targetDocumentsStore = db.createObjectStore(DbTargetDocument.store, {\r\n keyPath: DbTargetDocument.keyPath\r\n });\r\n targetDocumentsStore.createIndex(DbTargetDocument.documentTargetsIndex, DbTargetDocument.documentTargetsKeyPath, { unique: true });\r\n var targetStore = db.createObjectStore(DbTarget.store, {\r\n keyPath: DbTarget.keyPath\r\n });\r\n // NOTE: This is unique only because the TargetId is the suffix.\r\n targetStore.createIndex(DbTarget.queryTargetsIndexName, DbTarget.queryTargetsKeyPath, { unique: true });\r\n db.createObjectStore(DbTargetGlobal.store);\r\n}\r\nfunction dropQueryCache(db) {\r\n db.deleteObjectStore(DbTargetDocument.store);\r\n db.deleteObjectStore(DbTarget.store);\r\n db.deleteObjectStore(DbTargetGlobal.store);\r\n}\r\n/**\r\n * Creates the target global singleton row.\r\n *\r\n * @param {IDBTransaction} txn The version upgrade transaction for indexeddb\r\n */\r\nfunction writeEmptyTargetGlobalEntry(txn) {\r\n var globalStore = txn.store(DbTargetGlobal.store);\r\n var metadata = new DbTargetGlobal(\r\n /*highestTargetId=*/ 0, \r\n /*lastListenSequenceNumber=*/ 0, SnapshotVersion.MIN.toTimestamp(), \r\n /*targetCount=*/ 0);\r\n return globalStore.put(DbTargetGlobal.key, metadata);\r\n}\r\n/**\r\n * An object store to store the keys of changed documents. This is used to\r\n * facilitate storing document changelogs in the Remote Document Cache.\r\n *\r\n * PORTING NOTE: This is used for change propagation during multi-tab syncing\r\n * and not needed on iOS and Android.\r\n */\r\nvar DbRemoteDocumentChanges = /** @class */ (function () {\r\n function DbRemoteDocumentChanges(\r\n /** The keys of the changed documents. */\r\n changes) {\r\n this.changes = changes;\r\n }\r\n /** Name of the IndexedDb object store. */\r\n DbRemoteDocumentChanges.store = 'remoteDocumentChanges';\r\n /** Keys are auto-generated via the `id` property. */\r\n DbRemoteDocumentChanges.keyPath = 'id';\r\n return DbRemoteDocumentChanges;\r\n}());\r\nfunction createRemoteDocumentChangesStore(db) {\r\n db.createObjectStore(DbRemoteDocumentChanges.store, {\r\n keyPath: 'id',\r\n autoIncrement: true\r\n });\r\n}\r\n/**\r\n * A record of the metadata state of each client.\r\n *\r\n * PORTING NOTE: This is used to synchronize multi-tab state and does not need\r\n * to be ported to iOS or Android.\r\n */\r\nvar DbClientMetadata = /** @class */ (function () {\r\n function DbClientMetadata(\r\n /** The auto-generated client id assigned at client startup. */\r\n clientId, \r\n /** The last time this state was updated. */\r\n updateTimeMs, \r\n /** Whether the client's network connection is enabled. */\r\n networkEnabled, \r\n /** Whether this client is running in a foreground tab. */\r\n inForeground, \r\n /**\r\n * The last change read from the DbRemoteDocumentChanges store.\r\n * Can be undefined for backwards compatibility.\r\n */\r\n lastProcessedDocumentChangeId) {\r\n this.clientId = clientId;\r\n this.updateTimeMs = updateTimeMs;\r\n this.networkEnabled = networkEnabled;\r\n this.inForeground = inForeground;\r\n this.lastProcessedDocumentChangeId = lastProcessedDocumentChangeId;\r\n }\r\n /** Name of the IndexedDb object store. */\r\n DbClientMetadata.store = 'clientMetadata';\r\n /** Keys are automatically assigned via the clientId properties. */\r\n DbClientMetadata.keyPath = 'clientId';\r\n return DbClientMetadata;\r\n}());\r\nfunction createClientMetadataStore(db) {\r\n db.createObjectStore(DbClientMetadata.store, {\r\n keyPath: DbClientMetadata.keyPath\r\n });\r\n}\r\n// Visible for testing\r\nvar V1_STORES = [\r\n DbMutationQueue.store,\r\n DbMutationBatch.store,\r\n DbDocumentMutation.store,\r\n DbRemoteDocument.store,\r\n DbTarget.store,\r\n DbPrimaryClient.store,\r\n DbTargetGlobal.store,\r\n DbTargetDocument.store\r\n];\r\n// V2 is no longer usable (see comment at top of file)\r\n// Visible for testing\r\nvar V3_STORES = V1_STORES;\r\n// Visible for testing\r\nvar V4_STORES = V3_STORES.concat([\r\n DbClientMetadata.store,\r\n DbRemoteDocumentChanges.store\r\n]);\r\n/**\r\n * The list of all default IndexedDB stores used throughout the SDK. This is\r\n * used when creating transactions so that access across all stores is done\r\n * atomically.\r\n */\r\nvar ALL_STORES = V4_STORES;\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** A mutation queue for a specific user, backed by IndexedDB. */\r\nvar IndexedDbMutationQueue = /** @class */ (function () {\r\n function IndexedDbMutationQueue(\r\n /**\r\n * The normalized userId (e.g. null UID => \"\" userId) used to store /\r\n * retrieve mutations.\r\n */\r\n userId, serializer, referenceDelegate) {\r\n this.userId = userId;\r\n this.serializer = serializer;\r\n this.referenceDelegate = referenceDelegate;\r\n /**\r\n * Caches the document keys for pending mutation batches. If the mutation\r\n * has been removed from IndexedDb, the cached value may continue to\r\n * be used to retrieve the batch's document keys. To remove a cached value\r\n * locally, `removeCachedMutationKeys()` should be invoked either directly\r\n * or through `removeMutationBatches()`.\r\n *\r\n * With multi-tab, when the primary client acknowledges or rejects a mutation,\r\n * this cache is used by secondary clients to invalidate the local\r\n * view of the documents that were previously affected by the mutation.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n this.documentKeysByBatchId = {};\r\n }\r\n /**\r\n * Creates a new mutation queue for the given user.\r\n * @param user The user for which to create a mutation queue.\r\n * @param serializer The serializer to use when persisting to IndexedDb.\r\n */\r\n IndexedDbMutationQueue.forUser = function (user, serializer, referenceDelegate) {\r\n // TODO(mcg): Figure out what constraints there are on userIDs\r\n // In particular, are there any reserved characters? are empty ids allowed?\r\n // For the moment store these together in the same mutations table assuming\r\n // that empty userIDs aren't allowed.\r\n assert(user.uid !== '', 'UserID must not be an empty string.');\r\n var userId = user.isAuthenticated() ? user.uid : '';\r\n return new IndexedDbMutationQueue(userId, serializer, referenceDelegate);\r\n };\r\n IndexedDbMutationQueue.prototype.checkEmpty = function (transaction) {\r\n var empty = true;\r\n var range = IDBKeyRange.bound([this.userId, Number.NEGATIVE_INFINITY], [this.userId, Number.POSITIVE_INFINITY]);\r\n return mutationsStore(transaction)\r\n .iterate({ index: DbMutationBatch.userMutationsIndex, range: range }, function (key, value, control) {\r\n empty = false;\r\n control.done();\r\n })\r\n .next(function () { return empty; });\r\n };\r\n IndexedDbMutationQueue.prototype.acknowledgeBatch = function (transaction, batch, streamToken) {\r\n return this.getMutationQueueMetadata(transaction).next(function (metadata) {\r\n var batchId = batch.batchId;\r\n assert(batchId > metadata.lastAcknowledgedBatchId, 'Mutation batchIDs must be acknowledged in order');\r\n metadata.lastAcknowledgedBatchId = batchId;\r\n metadata.lastStreamToken = convertStreamToken(streamToken);\r\n return mutationQueuesStore(transaction).put(metadata);\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.getLastStreamToken = function (transaction) {\r\n return this.getMutationQueueMetadata(transaction).next(function (metadata) { return metadata.lastStreamToken; });\r\n };\r\n IndexedDbMutationQueue.prototype.setLastStreamToken = function (transaction, streamToken) {\r\n return this.getMutationQueueMetadata(transaction).next(function (metadata) {\r\n metadata.lastStreamToken = convertStreamToken(streamToken);\r\n return mutationQueuesStore(transaction).put(metadata);\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.addMutationBatch = function (transaction, localWriteTime, mutations) {\r\n var _this = this;\r\n var documentStore = documentMutationsStore(transaction);\r\n var mutationStore = mutationsStore(transaction);\r\n // The IndexedDb implementation in Chrome (and Firefox) does not handle\r\n // compound indices that include auto-generated keys correctly. To ensure\r\n // that the index entry is added correctly in all browsers, we perform two\r\n // writes: The first write is used to retrieve the next auto-generated Batch\r\n // ID, and the second write populates the index and stores the actual\r\n // mutation batch.\r\n // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\r\n // tslint:disable-next-line:no-any We write an empty object to obtain key\r\n return mutationStore.add({}).next(function (batchId) {\r\n assert(typeof batchId === 'number', 'Auto-generated key is not a number');\r\n var batch = new MutationBatch(batchId, localWriteTime, mutations);\r\n var dbBatch = _this.serializer.toDbMutationBatch(_this.userId, batch);\r\n _this.documentKeysByBatchId[batchId] = batch.keys();\r\n var promises = [];\r\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\r\n var mutation = mutations_1[_i];\r\n var indexKey = DbDocumentMutation.key(_this.userId, mutation.key.path, batchId);\r\n promises.push(mutationStore.put(dbBatch));\r\n promises.push(documentStore.put(indexKey, DbDocumentMutation.PLACEHOLDER));\r\n }\r\n return PersistencePromise.waitFor(promises).next(function () { return batch; });\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.lookupMutationBatch = function (transaction, batchId) {\r\n var _this = this;\r\n return mutationsStore(transaction)\r\n .get(batchId)\r\n .next(function (dbBatch) {\r\n if (dbBatch) {\r\n assert(dbBatch.userId === _this.userId, \"Unexpected user '\" + dbBatch.userId + \"' for mutation batch \" + batchId);\r\n return _this.serializer.fromDbMutationBatch(dbBatch);\r\n }\r\n return null;\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.lookupMutationKeys = function (transaction, batchId) {\r\n var _this = this;\r\n if (this.documentKeysByBatchId[batchId]) {\r\n return PersistencePromise.resolve(this.documentKeysByBatchId[batchId]);\r\n }\r\n else {\r\n return this.lookupMutationBatch(transaction, batchId).next(function (batch) {\r\n if (batch) {\r\n var keys = batch.keys();\r\n _this.documentKeysByBatchId[batchId] = keys;\r\n return keys;\r\n }\r\n else {\r\n return null;\r\n }\r\n });\r\n }\r\n };\r\n IndexedDbMutationQueue.prototype.getNextMutationBatchAfterBatchId = function (transaction, batchId) {\r\n var _this = this;\r\n return this.getMutationQueueMetadata(transaction).next(function (metadata) {\r\n // All batches with batchId <= this.metadata.lastAcknowledgedBatchId have\r\n // been acknowledged so the first unacknowledged batch after batchID will\r\n // have a batchID larger than both of these values.\r\n var nextBatchId = Math.max(batchId, metadata.lastAcknowledgedBatchId) + 1;\r\n var range = IDBKeyRange.lowerBound([_this.userId, nextBatchId]);\r\n var foundBatch = null;\r\n return mutationsStore(transaction)\r\n .iterate({ index: DbMutationBatch.userMutationsIndex, range: range }, function (key, dbBatch, control) {\r\n if (dbBatch.userId === _this.userId) {\r\n assert(dbBatch.batchId >= nextBatchId, 'Should have found mutation after ' + nextBatchId);\r\n foundBatch = _this.serializer.fromDbMutationBatch(dbBatch);\r\n }\r\n control.done();\r\n })\r\n .next(function () { return foundBatch; });\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.getAllMutationBatches = function (transaction) {\r\n var _this = this;\r\n var range = IDBKeyRange.bound([this.userId, BATCHID_UNKNOWN], [this.userId, Number.POSITIVE_INFINITY]);\r\n return mutationsStore(transaction)\r\n .loadAll(DbMutationBatch.userMutationsIndex, range)\r\n .next(function (dbBatches) {\r\n return dbBatches.map(function (dbBatch) { return _this.serializer.fromDbMutationBatch(dbBatch); });\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.getAllMutationBatchesAffectingDocumentKey = function (transaction, documentKey) {\r\n var _this = this;\r\n // Scan the document-mutation index starting with a prefix starting with\r\n // the given documentKey.\r\n var indexPrefix = DbDocumentMutation.prefixForPath(this.userId, documentKey.path);\r\n var indexStart = IDBKeyRange.lowerBound(indexPrefix);\r\n var results = [];\r\n return documentMutationsStore(transaction)\r\n .iterate({ range: indexStart }, function (indexKey, _, control) {\r\n var userID = indexKey[0], encodedPath = indexKey[1], batchId = indexKey[2];\r\n // Only consider rows matching exactly the specific key of\r\n // interest. Note that because we order by path first, and we\r\n // order terminators before path separators, we'll encounter all\r\n // the index rows for documentKey contiguously. In particular, all\r\n // the rows for documentKey will occur before any rows for\r\n // documents nested in a subcollection beneath documentKey so we\r\n // can stop as soon as we hit any such row.\r\n var path = decode$1(encodedPath);\r\n if (userID !== _this.userId || !documentKey.path.isEqual(path)) {\r\n control.done();\r\n return;\r\n }\r\n // Look up the mutation batch in the store.\r\n return mutationsStore(transaction)\r\n .get(batchId)\r\n .next(function (mutation) {\r\n if (!mutation) {\r\n throw fail('Dangling document-mutation reference found: ' +\r\n indexKey +\r\n ' which points to ' +\r\n batchId);\r\n }\r\n assert(mutation.userId === _this.userId, \"Unexpected user '\" + mutation.userId + \"' for mutation batch \" + batchId);\r\n results.push(_this.serializer.fromDbMutationBatch(mutation));\r\n });\r\n })\r\n .next(function () { return results; });\r\n };\r\n IndexedDbMutationQueue.prototype.getAllMutationBatchesAffectingDocumentKeys = function (transaction, documentKeys) {\r\n var _this = this;\r\n var uniqueBatchIDs = new SortedSet(primitiveComparator);\r\n var promises = [];\r\n documentKeys.forEach(function (documentKey) {\r\n var indexStart = DbDocumentMutation.prefixForPath(_this.userId, documentKey.path);\r\n var range = IDBKeyRange.lowerBound(indexStart);\r\n var promise = documentMutationsStore(transaction).iterate({ range: range }, function (indexKey, _, control) {\r\n var userID = indexKey[0], encodedPath = indexKey[1], batchID = indexKey[2];\r\n // Only consider rows matching exactly the specific key of\r\n // interest. Note that because we order by path first, and we\r\n // order terminators before path separators, we'll encounter all\r\n // the index rows for documentKey contiguously. In particular, all\r\n // the rows for documentKey will occur before any rows for\r\n // documents nested in a subcollection beneath documentKey so we\r\n // can stop as soon as we hit any such row.\r\n var path = decode$1(encodedPath);\r\n if (userID !== _this.userId || !documentKey.path.isEqual(path)) {\r\n control.done();\r\n return;\r\n }\r\n uniqueBatchIDs = uniqueBatchIDs.add(batchID);\r\n });\r\n promises.push(promise);\r\n });\r\n return PersistencePromise.waitFor(promises).next(function () {\r\n return _this.lookupMutationBatches(transaction, uniqueBatchIDs);\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.getAllMutationBatchesAffectingQuery = function (transaction, query) {\r\n var _this = this;\r\n assert(!query.isDocumentQuery(), \"Document queries shouldn't go down this path\");\r\n var queryPath = query.path;\r\n var immediateChildrenLength = queryPath.length + 1;\r\n // TODO(mcg): Actually implement a single-collection query\r\n //\r\n // This is actually executing an ancestor query, traversing the whole\r\n // subtree below the collection which can be horrifically inefficient for\r\n // some structures. The right way to solve this is to implement the full\r\n // value index, but that's not in the cards in the near future so this is\r\n // the best we can do for the moment.\r\n //\r\n // Since we don't yet index the actual properties in the mutations, our\r\n // current approach is to just return all mutation batches that affect\r\n // documents in the collection being queried.\r\n var indexPrefix = DbDocumentMutation.prefixForPath(this.userId, queryPath);\r\n var indexStart = IDBKeyRange.lowerBound(indexPrefix);\r\n // Collect up unique batchIDs encountered during a scan of the index. Use a\r\n // SortedSet to accumulate batch IDs so they can be traversed in order in a\r\n // scan of the main table.\r\n var uniqueBatchIDs = new SortedSet(primitiveComparator);\r\n return documentMutationsStore(transaction)\r\n .iterate({ range: indexStart }, function (indexKey, _, control) {\r\n var userID = indexKey[0], encodedPath = indexKey[1], batchID = indexKey[2];\r\n var path = decode$1(encodedPath);\r\n if (userID !== _this.userId || !queryPath.isPrefixOf(path)) {\r\n control.done();\r\n return;\r\n }\r\n // Rows with document keys more than one segment longer than the\r\n // query path can't be matches. For example, a query on 'rooms'\r\n // can't match the document /rooms/abc/messages/xyx.\r\n // TODO(mcg): we'll need a different scanner when we implement\r\n // ancestor queries.\r\n if (path.length !== immediateChildrenLength) {\r\n return;\r\n }\r\n uniqueBatchIDs = uniqueBatchIDs.add(batchID);\r\n })\r\n .next(function () { return _this.lookupMutationBatches(transaction, uniqueBatchIDs); });\r\n };\r\n IndexedDbMutationQueue.prototype.lookupMutationBatches = function (transaction, batchIDs) {\r\n var _this = this;\r\n var results = [];\r\n var promises = [];\r\n // TODO(rockwood): Implement this using iterate.\r\n batchIDs.forEach(function (batchId) {\r\n promises.push(mutationsStore(transaction)\r\n .get(batchId)\r\n .next(function (mutation) {\r\n if (mutation === null) {\r\n throw fail('Dangling document-mutation reference found, ' +\r\n 'which points to ' +\r\n batchId);\r\n }\r\n assert(mutation.userId === _this.userId, \"Unexpected user '\" + mutation.userId + \"' for mutation batch \" + batchId);\r\n results.push(_this.serializer.fromDbMutationBatch(mutation));\r\n }));\r\n });\r\n return PersistencePromise.waitFor(promises).next(function () { return results; });\r\n };\r\n IndexedDbMutationQueue.prototype.removeMutationBatch = function (transaction, batch) {\r\n var _this = this;\r\n return removeMutationBatch(transaction.simpleDbTransaction, this.userId, batch).next(function (removedDocuments) {\r\n _this.removeCachedMutationKeys(batch.batchId);\r\n return PersistencePromise.forEach(removedDocuments, function (key) {\r\n return _this.referenceDelegate.removeMutationReference(transaction, key);\r\n });\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.removeCachedMutationKeys = function (batchId) {\r\n delete this.documentKeysByBatchId[batchId];\r\n };\r\n IndexedDbMutationQueue.prototype.performConsistencyCheck = function (txn) {\r\n var _this = this;\r\n return this.checkEmpty(txn).next(function (empty) {\r\n if (!empty) {\r\n return PersistencePromise.resolve();\r\n }\r\n // Verify that there are no entries in the documentMutations index if\r\n // the queue is empty.\r\n var startRange = IDBKeyRange.lowerBound(DbDocumentMutation.prefixForUser(_this.userId));\r\n var danglingMutationReferences = [];\r\n return documentMutationsStore(txn)\r\n .iterate({ range: startRange }, function (key, _, control) {\r\n var userID = key[0];\r\n if (userID !== _this.userId) {\r\n control.done();\r\n return;\r\n }\r\n else {\r\n var path = decode$1(key[1]);\r\n danglingMutationReferences.push(path);\r\n }\r\n })\r\n .next(function () {\r\n assert(danglingMutationReferences.length === 0, 'Document leak -- detected dangling mutation references when queue is empty. ' +\r\n 'Dangling keys: ' +\r\n danglingMutationReferences.map(function (p) { return p.canonicalString(); }));\r\n });\r\n });\r\n };\r\n IndexedDbMutationQueue.prototype.containsKey = function (txn, key) {\r\n return mutationQueueContainsKey(txn, this.userId, key);\r\n };\r\n // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\r\n /** Returns the mutation queue's metadata from IndexedDb. */\r\n IndexedDbMutationQueue.prototype.getMutationQueueMetadata = function (transaction) {\r\n var _this = this;\r\n return mutationQueuesStore(transaction)\r\n .get(this.userId)\r\n .next(function (metadata) {\r\n return (metadata ||\r\n new DbMutationQueue(_this.userId, BATCHID_UNKNOWN, \r\n /*lastStreamToken=*/ ''));\r\n });\r\n };\r\n return IndexedDbMutationQueue;\r\n}());\r\n/**\r\n * @return true if the mutation queue for the given user contains a pending\r\n * mutation for the given key.\r\n */\r\nfunction mutationQueueContainsKey(txn, userId, key) {\r\n var indexKey = DbDocumentMutation.prefixForPath(userId, key.path);\r\n var encodedPath = indexKey[1];\r\n var startRange = IDBKeyRange.lowerBound(indexKey);\r\n var containsKey = false;\r\n return documentMutationsStore(txn)\r\n .iterate({ range: startRange, keysOnly: true }, function (key, value, control) {\r\n var userID = key[0], keyPath = key[1], /*batchID*/ _ = key[2];\r\n if (userID === userId && keyPath === encodedPath) {\r\n containsKey = true;\r\n }\r\n control.done();\r\n })\r\n .next(function () { return containsKey; });\r\n}\r\n/** Returns true if any mutation queue contains the given document. */\r\nfunction mutationQueuesContainKey(txn, docKey) {\r\n var found = false;\r\n return mutationQueuesStore(txn)\r\n .iterateSerial(function (userId) {\r\n return mutationQueueContainsKey(txn, userId, docKey).next(function (containsKey) {\r\n if (containsKey) {\r\n found = true;\r\n }\r\n return PersistencePromise.resolve(!containsKey);\r\n });\r\n })\r\n .next(function () { return found; });\r\n}\r\n/**\r\n * Delete a mutation batch and the associated document mutations.\r\n * @return A PersistencePromise of the document mutations that were removed.\r\n */\r\nfunction removeMutationBatch(txn, userId, batch) {\r\n var mutationStore = txn.store(DbMutationBatch.store);\r\n var indexTxn = txn.store(DbDocumentMutation.store);\r\n var promises = [];\r\n var range = IDBKeyRange.only(batch.batchId);\r\n var numDeleted = 0;\r\n var removePromise = mutationStore.iterate({ range: range }, function (key, value, control) {\r\n numDeleted++;\r\n return control.delete();\r\n });\r\n promises.push(removePromise.next(function () {\r\n assert(numDeleted === 1, 'Dangling document-mutation reference found: Missing batch ' +\r\n batch.batchId);\r\n }));\r\n var removedDocuments = [];\r\n for (var _i = 0, _a = batch.mutations; _i < _a.length; _i++) {\r\n var mutation = _a[_i];\r\n var indexKey = DbDocumentMutation.key(userId, mutation.key.path, batch.batchId);\r\n promises.push(indexTxn.delete(indexKey));\r\n removedDocuments.push(mutation.key);\r\n }\r\n return PersistencePromise.waitFor(promises).next(function () { return removedDocuments; });\r\n}\r\nfunction convertStreamToken(token) {\r\n if (token instanceof Uint8Array) {\r\n // TODO(b/78771403): Convert tokens to strings during deserialization\r\n assert(process.env.USE_MOCK_PERSISTENCE === 'YES', 'Persisting non-string stream tokens is only supported with mock persistence.');\r\n return token.toString();\r\n }\r\n else {\r\n return token;\r\n }\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the mutations object store.\r\n */\r\nfunction mutationsStore(txn) {\r\n return IndexedDbPersistence.getStore(txn, DbMutationBatch.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\r\n */\r\nfunction documentMutationsStore(txn) {\r\n return IndexedDbPersistence.getStore(txn, DbDocumentMutation.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\r\n */\r\nfunction mutationQueuesStore(txn) {\r\n return IndexedDbPersistence.getStore(txn, DbMutationQueue.store);\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar RESERVED_BITS = 1;\r\nvar GeneratorIds;\r\n(function (GeneratorIds) {\r\n GeneratorIds[GeneratorIds[\"QueryCache\"] = 0] = \"QueryCache\";\r\n GeneratorIds[GeneratorIds[\"SyncEngine\"] = 1] = \"SyncEngine\"; // The target IDs for limbo detection are odd (end in 1).\r\n})(GeneratorIds || (GeneratorIds = {}));\r\n/**\r\n * Generates monotonically increasing target IDs for sending targets to the\r\n * watch stream.\r\n *\r\n * The client constructs two generators, one for the query cache (via\r\n * forQueryCache()), and one for limbo documents (via forSyncEngine()). These\r\n * two generators produce non-overlapping IDs (by using even and odd IDs\r\n * respectively).\r\n *\r\n * By separating the target ID space, the query cache can generate target IDs\r\n * that persist across client restarts, while sync engine can independently\r\n * generate in-memory target IDs that are transient and can be reused after a\r\n * restart.\r\n */\r\n// TODO(mrschmidt): Explore removing this class in favor of generating these IDs\r\n// directly in SyncEngine and LocalStore.\r\nvar TargetIdGenerator = /** @class */ (function () {\r\n /**\r\n * Instantiates a new TargetIdGenerator. If a seed is provided, the generator\r\n * will use the seed value as the next target ID.\r\n */\r\n function TargetIdGenerator(generatorId, seed) {\r\n this.generatorId = generatorId;\r\n assert((generatorId & RESERVED_BITS) === generatorId, \"Generator ID \" + generatorId + \" contains more than \" + RESERVED_BITS + \" reserved bits\");\r\n this.seek(seed !== undefined ? seed : this.generatorId);\r\n }\r\n TargetIdGenerator.prototype.next = function () {\r\n var nextId = this.nextId;\r\n this.nextId += 1 << RESERVED_BITS;\r\n return nextId;\r\n };\r\n /**\r\n * Returns the ID that follows the given ID. Subsequent calls to `next()`\r\n * use the newly returned target ID as their base.\r\n */\r\n TargetIdGenerator.prototype.after = function (targetId) {\r\n this.seek(targetId + (1 << RESERVED_BITS));\r\n return this.next();\r\n };\r\n TargetIdGenerator.prototype.seek = function (targetId) {\r\n assert((targetId & RESERVED_BITS) === this.generatorId, 'Cannot supply target ID from different generator ID');\r\n this.nextId = targetId;\r\n };\r\n TargetIdGenerator.forQueryCache = function () {\r\n // We seed the query cache generator to return '2' as its first ID, as there\r\n // is no differentiation in the protocol layer between an unset number and\r\n // the number '0'. If we were to sent a target with target ID '0', the\r\n // backend would consider it unset and replace it with its own ID.\r\n var targetIdGenerator = new TargetIdGenerator(GeneratorIds.QueryCache, 2);\r\n return targetIdGenerator;\r\n };\r\n TargetIdGenerator.forSyncEngine = function () {\r\n // Sync engine assigns target IDs for limbo document detection.\r\n return new TargetIdGenerator(GeneratorIds.SyncEngine);\r\n };\r\n return TargetIdGenerator;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$1 = 'SimpleDb';\r\n/**\r\n * Provides a wrapper around IndexedDb with a simplified interface that uses\r\n * Promise-like return values to chain operations. Real promises cannot be used\r\n * since .then() continuations are executed asynchronously (e.g. via\r\n * .setImmediate), which would cause IndexedDB to end the transaction.\r\n * See PersistencePromise for more details.\r\n */\r\nvar SimpleDb = /** @class */ (function () {\r\n function SimpleDb(db) {\r\n this.db = db;\r\n }\r\n /** Opens the specified database, creating or upgrading it if necessary. */\r\n SimpleDb.openOrCreate = function (name, version, schemaConverter) {\r\n assert(SimpleDb.isAvailable(), 'IndexedDB not supported in current environment.');\r\n debug(LOG_TAG$1, 'Opening database:', name);\r\n return new PersistencePromise(function (resolve, reject) {\r\n // TODO(mikelehen): Investigate browser compatibility.\r\n // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\r\n // suggests IE9 and older WebKit browsers handle upgrade\r\n // differently. They expect setVersion, as described here:\r\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\r\n var request = window.indexedDB.open(name, version);\r\n request.onsuccess = function (event) {\r\n var db = event.target.result;\r\n resolve(new SimpleDb(db));\r\n };\r\n request.onblocked = function () {\r\n reject(new FirestoreError(Code.FAILED_PRECONDITION, 'Cannot upgrade IndexedDB schema while another tab is open. ' +\r\n 'Close all tabs that access Firestore and reload this page to proceed.'));\r\n };\r\n request.onerror = function (event) {\r\n reject(event.target.error);\r\n };\r\n request.onupgradeneeded = function (event) {\r\n debug(LOG_TAG$1, 'Database \"' + name + '\" requires upgrade from version:', event.oldVersion);\r\n var db = event.target.result;\r\n // We are provided a version upgrade transaction from the request, so\r\n // we wrap that in a SimpleDbTransaction to allow use of our friendlier\r\n // API for schema migration operations.\r\n var txn = new SimpleDbTransaction(request.transaction);\r\n schemaConverter\r\n .createOrUpgrade(db, txn, event.oldVersion, SCHEMA_VERSION)\r\n .next(function () {\r\n debug(LOG_TAG$1, 'Database upgrade to version ' + SCHEMA_VERSION + ' complete');\r\n });\r\n };\r\n }).toPromise();\r\n };\r\n /** Deletes the specified database. */\r\n SimpleDb.delete = function (name) {\r\n debug(LOG_TAG$1, 'Removing database:', name);\r\n return wrapRequest(window.indexedDB.deleteDatabase(name)).toPromise();\r\n };\r\n /** Returns true if IndexedDB is available in the current environment. */\r\n SimpleDb.isAvailable = function () {\r\n if (typeof window === 'undefined' || window.indexedDB == null) {\r\n return false;\r\n }\r\n // We extensively use indexed array values and compound keys,\r\n // which IE and Edge do not support. However, they still have indexedDB\r\n // defined on the window, so we need to check for them here and make sure\r\n // to return that persistence is not enabled for those browsers.\r\n // For tracking support of this feature, see here:\r\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\r\n // If we are running in Node using the IndexedDBShim, `window` is defined,\r\n // but `window.navigator` is not. In this case, we support IndexedDB and\r\n // return `true`.\r\n if (window.navigator === undefined) {\r\n return process.env.USE_MOCK_PERSISTENCE === 'YES';\r\n }\r\n // Check the UA string to find out the browser.\r\n // TODO(mikelehen): Move this logic into packages/util/environment.ts\r\n var ua = window.navigator.userAgent;\r\n // IE 10\r\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\r\n // IE 11\r\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\r\n // Edge\r\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\r\n // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\r\n if (ua.indexOf('MSIE ') > 0 ||\r\n ua.indexOf('Trident/') > 0 ||\r\n ua.indexOf('Edge/') > 0) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n };\r\n /** Helper to get a typed SimpleDbStore from a transaction. */\r\n SimpleDb.getStore = function (txn, store) {\r\n return txn.store(store);\r\n };\r\n SimpleDb.prototype.runTransaction = function (mode, objectStores, transactionFn) {\r\n var transaction = SimpleDbTransaction.open(this.db, mode, objectStores);\r\n var transactionFnResult = transactionFn(transaction)\r\n .catch(function (error$$1) {\r\n // Abort the transaction if there was an error.\r\n transaction.abort(error$$1);\r\n })\r\n .toPromise();\r\n // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\r\n // fire), but still return the original transactionFnResult back to the\r\n // caller.\r\n return transaction.completionPromise.then(function () { return transactionFnResult; });\r\n };\r\n SimpleDb.prototype.close = function () {\r\n this.db.close();\r\n };\r\n return SimpleDb;\r\n}());\r\n/**\r\n * A controller for iterating over a key range or index. It allows an iterate\r\n * callback to delete the currently-referenced object, or jump to a new key\r\n * within the key range or index.\r\n */\r\nvar IterationController = /** @class */ (function () {\r\n function IterationController(dbCursor) {\r\n this.dbCursor = dbCursor;\r\n this.shouldStop = false;\r\n this.nextKey = null;\r\n }\r\n Object.defineProperty(IterationController.prototype, \"isDone\", {\r\n get: function () {\r\n return this.shouldStop;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(IterationController.prototype, \"skipToKey\", {\r\n get: function () {\r\n return this.nextKey;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(IterationController.prototype, \"cursor\", {\r\n set: function (value) {\r\n this.dbCursor = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * This function can be called to stop iteration at any point.\r\n */\r\n IterationController.prototype.done = function () {\r\n this.shouldStop = true;\r\n };\r\n /**\r\n * This function can be called to skip to that next key, which could be\r\n * an index or a primary key.\r\n */\r\n IterationController.prototype.skip = function (key) {\r\n this.nextKey = key;\r\n };\r\n /**\r\n * Delete the current cursor value from the object store.\r\n *\r\n * NOTE: You CANNOT do this with a keysOnly query.\r\n */\r\n IterationController.prototype.delete = function () {\r\n return wrapRequest(this.dbCursor.delete());\r\n };\r\n return IterationController;\r\n}());\r\n/**\r\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\r\n * specific object store.\r\n */\r\nvar SimpleDbTransaction = /** @class */ (function () {\r\n function SimpleDbTransaction(transaction) {\r\n var _this = this;\r\n this.transaction = transaction;\r\n this.aborted = false;\r\n /**\r\n * A promise that resolves with the result of the IndexedDb transaction.\r\n */\r\n this.completionDeferred = new Deferred$1();\r\n this.transaction.oncomplete = function () {\r\n _this.completionDeferred.resolve();\r\n };\r\n this.transaction.onabort = function () {\r\n if (transaction.error) {\r\n _this.completionDeferred.reject(transaction.error);\r\n }\r\n else {\r\n _this.completionDeferred.resolve();\r\n }\r\n };\r\n this.transaction.onerror = function (event) {\r\n _this.completionDeferred.reject(event.target.error);\r\n };\r\n }\r\n SimpleDbTransaction.open = function (db, mode, objectStoreNames) {\r\n return new SimpleDbTransaction(db.transaction(objectStoreNames, mode));\r\n };\r\n Object.defineProperty(SimpleDbTransaction.prototype, \"completionPromise\", {\r\n get: function () {\r\n return this.completionDeferred.promise;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n SimpleDbTransaction.prototype.abort = function (error$$1) {\r\n if (error$$1) {\r\n this.completionDeferred.reject(error$$1);\r\n }\r\n if (!this.aborted) {\r\n debug(LOG_TAG$1, 'Aborting transaction:', error$$1 ? error$$1.message : 'Client-initiated abort');\r\n this.aborted = true;\r\n this.transaction.abort();\r\n }\r\n };\r\n /**\r\n * Returns a SimpleDbStore for the specified store. All\r\n * operations performed on the SimpleDbStore happen within the context of this\r\n * transaction and it cannot be used anymore once the transaction is\r\n * completed.\r\n *\r\n * Note that we can't actually enforce that the KeyType and ValueType are\r\n * correct, but they allow type safety through the rest of the consuming code.\r\n */\r\n SimpleDbTransaction.prototype.store = function (storeName) {\r\n var store = this.transaction.objectStore(storeName);\r\n assert(!!store, 'Object store not part of transaction: ' + storeName);\r\n return new SimpleDbStore(store);\r\n };\r\n return SimpleDbTransaction;\r\n}());\r\n/**\r\n * A wrapper around an IDBObjectStore providing an API that:\r\n *\r\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\r\n * methods for acting against the object store.\r\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\r\n * method return a PersistencePromise instead.\r\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\r\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\r\n */\r\nvar SimpleDbStore = /** @class */ (function () {\r\n function SimpleDbStore(store) {\r\n this.store = store;\r\n }\r\n SimpleDbStore.prototype.put = function (keyOrValue, value) {\r\n var request;\r\n if (value !== undefined) {\r\n debug(LOG_TAG$1, 'PUT', this.store.name, keyOrValue, value);\r\n request = this.store.put(value, keyOrValue);\r\n }\r\n else {\r\n debug(LOG_TAG$1, 'PUT', this.store.name, '', keyOrValue);\r\n request = this.store.put(keyOrValue);\r\n }\r\n return wrapRequest(request);\r\n };\r\n /**\r\n * Adds a new value into an Object Store and returns the new key. Similar to\r\n * IndexedDb's `add()`, this method will fail on primary key collisions.\r\n *\r\n * @param value The object to write.\r\n * @return The key of the value to add.\r\n */\r\n SimpleDbStore.prototype.add = function (value) {\r\n debug(LOG_TAG$1, 'ADD', this.store.name, value, value);\r\n var request = this.store.add(value);\r\n return wrapRequest(request);\r\n };\r\n /**\r\n * Gets the object with the specified key from the specified store, or null\r\n * if no object exists with the specified key.\r\n *\r\n * @key The key of the object to get.\r\n * @return The object with the specified key or null if no object exists.\r\n */\r\n SimpleDbStore.prototype.get = function (key) {\r\n var _this = this;\r\n var request = this.store.get(key);\r\n // tslint:disable-next-line:no-any We're doing an unsafe cast to ValueType.\r\n return wrapRequest(request).next(function (result) {\r\n // Normalize nonexistence to null.\r\n if (result === undefined) {\r\n result = null;\r\n }\r\n debug(LOG_TAG$1, 'GET', _this.store.name, key, result);\r\n return result;\r\n });\r\n };\r\n SimpleDbStore.prototype.delete = function (key) {\r\n debug(LOG_TAG$1, 'DELETE', this.store.name, key);\r\n var request = this.store.delete(key);\r\n return wrapRequest(request);\r\n };\r\n /**\r\n * If we ever need more of the count variants, we can add overloads. For now,\r\n * all we need is to count everything in a store.\r\n *\r\n * Returns the number of rows in the store.\r\n */\r\n SimpleDbStore.prototype.count = function () {\r\n debug(LOG_TAG$1, 'COUNT', this.store.name);\r\n var request = this.store.count();\r\n return wrapRequest(request);\r\n };\r\n SimpleDbStore.prototype.loadAll = function (indexOrRange, range) {\r\n var cursor = this.cursor(this.options(indexOrRange, range));\r\n var results = [];\r\n return this.iterateCursor(cursor, function (key, value) {\r\n results.push(value);\r\n }).next(function () {\r\n return results;\r\n });\r\n };\r\n SimpleDbStore.prototype.deleteAll = function (indexOrRange, range) {\r\n debug(LOG_TAG$1, 'DELETE ALL', this.store.name);\r\n var options = this.options(indexOrRange, range);\r\n options.keysOnly = false;\r\n var cursor = this.cursor(options);\r\n return this.iterateCursor(cursor, function (key, value, control) {\r\n // NOTE: Calling delete() on a cursor is documented as more efficient than\r\n // calling delete() on an object store with a single key\r\n // (https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/delete),\r\n // however, this requires us *not* to use a keysOnly cursor\r\n // (https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/delete). We\r\n // may want to compare the performance of each method.\r\n return control.delete();\r\n });\r\n };\r\n SimpleDbStore.prototype.iterate = function (optionsOrCallback, callback) {\r\n var options;\r\n if (!callback) {\r\n options = {};\r\n callback = optionsOrCallback;\r\n }\r\n else {\r\n options = optionsOrCallback;\r\n }\r\n var cursor = this.cursor(options);\r\n return this.iterateCursor(cursor, callback);\r\n };\r\n /**\r\n * Iterates over a store, but waits for the given callback to complete for\r\n * each entry before iterating the next entry. This allows the callback to do\r\n * asynchronous work to determine if this iteration should continue.\r\n *\r\n * The provided callback should return `true` to continue iteration, and\r\n * `false` otherwise.\r\n */\r\n SimpleDbStore.prototype.iterateSerial = function (callback) {\r\n var cursorRequest = this.cursor({});\r\n return new PersistencePromise(function (resolve, reject) {\r\n cursorRequest.onerror = function (event) {\r\n reject(event.target.error);\r\n };\r\n cursorRequest.onsuccess = function (event) {\r\n var cursor = event.target.result;\r\n if (!cursor) {\r\n resolve();\r\n return;\r\n }\r\n callback(cursor.primaryKey, cursor.value).next(function (shouldContinue) {\r\n if (shouldContinue) {\r\n cursor.continue();\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n };\r\n });\r\n };\r\n SimpleDbStore.prototype.iterateCursor = function (cursorRequest, fn) {\r\n var results = [];\r\n return new PersistencePromise(function (resolve, reject) {\r\n cursorRequest.onerror = function (event) {\r\n reject(event.target.error);\r\n };\r\n cursorRequest.onsuccess = function (event) {\r\n var cursor = event.target.result;\r\n if (!cursor) {\r\n resolve();\r\n return;\r\n }\r\n var controller = new IterationController(cursor);\r\n var userResult = fn(cursor.primaryKey, cursor.value, controller);\r\n if (userResult instanceof PersistencePromise) {\r\n var userPromise = userResult.catch(function (err) {\r\n controller.done();\r\n return PersistencePromise.reject(err);\r\n });\r\n results.push(userPromise);\r\n }\r\n if (controller.isDone) {\r\n resolve();\r\n }\r\n else if (controller.skipToKey === null) {\r\n cursor.continue();\r\n }\r\n else {\r\n cursor.continue(controller.skipToKey);\r\n }\r\n };\r\n }).next(function () {\r\n return PersistencePromise.waitFor(results);\r\n });\r\n };\r\n SimpleDbStore.prototype.options = function (indexOrRange, range) {\r\n var indexName = undefined;\r\n if (indexOrRange !== undefined) {\r\n if (typeof indexOrRange === 'string') {\r\n indexName = indexOrRange;\r\n }\r\n else {\r\n assert(range === undefined, '3rd argument must not be defined if 2nd is a range.');\r\n range = indexOrRange;\r\n }\r\n }\r\n return { index: indexName, range: range };\r\n };\r\n SimpleDbStore.prototype.cursor = function (options) {\r\n var direction = 'next';\r\n if (options.reverse) {\r\n direction = 'prev';\r\n }\r\n if (options.index) {\r\n var index = this.store.index(options.index);\r\n if (options.keysOnly) {\r\n return index.openKeyCursor(options.range, direction);\r\n }\r\n else {\r\n return index.openCursor(options.range, direction);\r\n }\r\n }\r\n else {\r\n return this.store.openCursor(options.range, direction);\r\n }\r\n };\r\n return SimpleDbStore;\r\n}());\r\n/**\r\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\r\n * handlers to resolve / reject the PersistencePromise as appropriate.\r\n */\r\nfunction wrapRequest(request) {\r\n return new PersistencePromise(function (resolve, reject) {\r\n request.onsuccess = function (event) {\r\n var result = event.target.result;\r\n resolve(result);\r\n };\r\n request.onerror = function (event) {\r\n reject(event.target.error);\r\n };\r\n });\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar IndexedDbQueryCache = /** @class */ (function () {\r\n function IndexedDbQueryCache(referenceDelegate, serializer) {\r\n this.referenceDelegate = referenceDelegate;\r\n this.serializer = serializer;\r\n // PORTING NOTE: We don't cache global metadata for the query cache, since\r\n // some of it (in particular `highestTargetId`) can be modified by secondary\r\n // tabs. We could perhaps be more granular (and e.g. still cache\r\n // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\r\n // to IndexedDb whenever we need to read metadata. We can revisit if it turns\r\n // out to have a meaningful performance impact.\r\n this.targetIdGenerator = TargetIdGenerator.forQueryCache();\r\n }\r\n IndexedDbQueryCache.prototype.allocateTargetId = function (transaction) {\r\n var _this = this;\r\n return this.retrieveMetadata(transaction).next(function (metadata) {\r\n metadata.highestTargetId = _this.targetIdGenerator.after(metadata.highestTargetId);\r\n return _this.saveMetadata(transaction, metadata).next(function () { return metadata.highestTargetId; });\r\n });\r\n };\r\n IndexedDbQueryCache.prototype.getLastRemoteSnapshotVersion = function (transaction) {\r\n return this.retrieveMetadata(transaction).next(function (metadata) {\r\n return SnapshotVersion.fromTimestamp(new Timestamp(metadata.lastRemoteSnapshotVersion.seconds, metadata.lastRemoteSnapshotVersion.nanoseconds));\r\n });\r\n };\r\n IndexedDbQueryCache.prototype.getHighestSequenceNumber = function (transaction) {\r\n return getHighestListenSequenceNumber(transaction.simpleDbTransaction);\r\n };\r\n IndexedDbQueryCache.prototype.setTargetsMetadata = function (transaction, highestListenSequenceNumber, lastRemoteSnapshotVersion) {\r\n var _this = this;\r\n return this.retrieveMetadata(transaction).next(function (metadata) {\r\n metadata.highestListenSequenceNumber = highestListenSequenceNumber;\r\n if (lastRemoteSnapshotVersion) {\r\n metadata.lastRemoteSnapshotVersion = lastRemoteSnapshotVersion.toTimestamp();\r\n }\r\n if (highestListenSequenceNumber > metadata.highestListenSequenceNumber) {\r\n metadata.highestListenSequenceNumber = highestListenSequenceNumber;\r\n }\r\n return _this.saveMetadata(transaction, metadata);\r\n });\r\n };\r\n IndexedDbQueryCache.prototype.addQueryData = function (transaction, queryData) {\r\n var _this = this;\r\n return this.saveQueryData(transaction, queryData).next(function () {\r\n return _this.retrieveMetadata(transaction).next(function (metadata) {\r\n metadata.targetCount += 1;\r\n _this.updateMetadataFromQueryData(queryData, metadata);\r\n return _this.saveMetadata(transaction, metadata);\r\n });\r\n });\r\n };\r\n IndexedDbQueryCache.prototype.updateQueryData = function (transaction, queryData) {\r\n return this.saveQueryData(transaction, queryData);\r\n };\r\n IndexedDbQueryCache.prototype.removeQueryData = function (transaction, queryData) {\r\n var _this = this;\r\n return this.removeMatchingKeysForTargetId(transaction, queryData.targetId)\r\n .next(function () { return targetsStore(transaction).delete(queryData.targetId); })\r\n .next(function () { return _this.retrieveMetadata(transaction); })\r\n .next(function (metadata) {\r\n assert(metadata.targetCount > 0, 'Removing from an empty query cache');\r\n metadata.targetCount -= 1;\r\n return _this.saveMetadata(transaction, metadata);\r\n });\r\n };\r\n /**\r\n * Drops any targets with sequence number less than or equal to the upper bound, excepting those\r\n * present in `activeTargetIds`. Document associations for the removed targets are also removed.\r\n * Returns the number of targets removed.\r\n */\r\n IndexedDbQueryCache.prototype.removeTargets = function (txn, upperBound, activeTargetIds) {\r\n var _this = this;\r\n var count = 0;\r\n var promises = [];\r\n return targetsStore(txn)\r\n .iterate(function (key, value) {\r\n var queryData = _this.serializer.fromDbTarget(value);\r\n if (queryData.sequenceNumber <= upperBound &&\r\n activeTargetIds[queryData.targetId] === undefined) {\r\n count++;\r\n promises.push(_this.removeQueryData(txn, queryData));\r\n }\r\n })\r\n .next(function () { return PersistencePromise.waitFor(promises); })\r\n .next(function () { return count; });\r\n };\r\n /**\r\n * Call provided function with each `QueryData` that we have cached.\r\n */\r\n IndexedDbQueryCache.prototype.forEachTarget = function (txn, f) {\r\n var _this = this;\r\n return targetsStore(txn).iterate(function (key, value) {\r\n var queryData = _this.serializer.fromDbTarget(value);\r\n f(queryData);\r\n });\r\n };\r\n IndexedDbQueryCache.prototype.retrieveMetadata = function (transaction) {\r\n return retrieveMetadata(transaction.simpleDbTransaction);\r\n };\r\n IndexedDbQueryCache.prototype.saveMetadata = function (transaction, metadata) {\r\n return globalTargetStore(transaction).put(DbTargetGlobal.key, metadata);\r\n };\r\n IndexedDbQueryCache.prototype.saveQueryData = function (transaction, queryData) {\r\n return targetsStore(transaction).put(this.serializer.toDbTarget(queryData));\r\n };\r\n /**\r\n * In-place updates the provided metadata to account for values in the given\r\n * QueryData. Saving is done separately. Returns true if there were any\r\n * changes to the metadata.\r\n */\r\n IndexedDbQueryCache.prototype.updateMetadataFromQueryData = function (queryData, metadata) {\r\n var updated = false;\r\n if (queryData.targetId > metadata.highestTargetId) {\r\n metadata.highestTargetId = queryData.targetId;\r\n updated = true;\r\n }\r\n if (queryData.sequenceNumber > metadata.highestListenSequenceNumber) {\r\n metadata.highestListenSequenceNumber = queryData.sequenceNumber;\r\n updated = true;\r\n }\r\n return updated;\r\n };\r\n IndexedDbQueryCache.prototype.getQueryCount = function (transaction) {\r\n return this.retrieveMetadata(transaction).next(function (metadata) { return metadata.targetCount; });\r\n };\r\n IndexedDbQueryCache.prototype.getQueryData = function (transaction, query) {\r\n var _this = this;\r\n // Iterating by the canonicalId may yield more than one result because\r\n // canonicalId values are not required to be unique per target. This query\r\n // depends on the queryTargets index to be efficient.\r\n var canonicalId = query.canonicalId();\r\n var range = IDBKeyRange.bound([canonicalId, Number.NEGATIVE_INFINITY], [canonicalId, Number.POSITIVE_INFINITY]);\r\n var result = null;\r\n return targetsStore(transaction)\r\n .iterate({ range: range, index: DbTarget.queryTargetsIndexName }, function (key, value, control) {\r\n var found = _this.serializer.fromDbTarget(value);\r\n // After finding a potential match, check that the query is\r\n // actually equal to the requested query.\r\n if (query.isEqual(found.query)) {\r\n result = found;\r\n control.done();\r\n }\r\n })\r\n .next(function () { return result; });\r\n };\r\n IndexedDbQueryCache.prototype.addMatchingKeys = function (txn, keys, targetId) {\r\n var _this = this;\r\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\r\n // IndexedDb.\r\n var promises = [];\r\n var store = documentTargetStore(txn);\r\n keys.forEach(function (key) {\r\n var path = encode(key.path);\r\n promises.push(store.put(new DbTargetDocument(targetId, path)));\r\n promises.push(_this.referenceDelegate.addReference(txn, key));\r\n });\r\n return PersistencePromise.waitFor(promises);\r\n };\r\n IndexedDbQueryCache.prototype.removeMatchingKeys = function (txn, keys, targetId) {\r\n var _this = this;\r\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\r\n // IndexedDb.\r\n var store = documentTargetStore(txn);\r\n return PersistencePromise.forEach(keys, function (key) {\r\n var path = encode(key.path);\r\n return PersistencePromise.waitFor([\r\n store.delete([targetId, path]),\r\n _this.referenceDelegate.removeReference(txn, key)\r\n ]);\r\n });\r\n };\r\n IndexedDbQueryCache.prototype.removeMatchingKeysForTargetId = function (txn, targetId) {\r\n var store = documentTargetStore(txn);\r\n var range = IDBKeyRange.bound([targetId], [targetId + 1], \r\n /*lowerOpen=*/ false, \r\n /*upperOpen=*/ true);\r\n return store.delete(range);\r\n };\r\n IndexedDbQueryCache.prototype.getMatchingKeysForTargetId = function (txn, targetId) {\r\n var range = IDBKeyRange.bound([targetId], [targetId + 1], \r\n /*lowerOpen=*/ false, \r\n /*upperOpen=*/ true);\r\n var store = documentTargetStore(txn);\r\n var result = documentKeySet();\r\n return store\r\n .iterate({ range: range, keysOnly: true }, function (key, _, control) {\r\n var path = decode$1(key[1]);\r\n var docKey = new DocumentKey(path);\r\n result = result.add(docKey);\r\n })\r\n .next(function () { return result; });\r\n };\r\n IndexedDbQueryCache.prototype.containsKey = function (txn, key) {\r\n var path = encode(key.path);\r\n var range = IDBKeyRange.bound([path], [immediateSuccessor(path)], \r\n /*lowerOpen=*/ false, \r\n /*upperOpen=*/ true);\r\n var count = 0;\r\n return documentTargetStore(txn)\r\n .iterate({\r\n index: DbTargetDocument.documentTargetsIndex,\r\n keysOnly: true,\r\n range: range\r\n }, function (_a, _, control) {\r\n var targetId = _a[0], path = _a[1];\r\n // Having a sentinel row for a document does not count as containing that document;\r\n // For the query cache, containing the document means the document is part of some\r\n // target.\r\n if (targetId !== 0) {\r\n count++;\r\n control.done();\r\n }\r\n })\r\n .next(function () { return count > 0; });\r\n };\r\n IndexedDbQueryCache.prototype.getQueryDataForTarget = function (transaction, targetId) {\r\n var _this = this;\r\n return targetsStore(transaction)\r\n .get(targetId)\r\n .next(function (found) {\r\n if (found) {\r\n return _this.serializer.fromDbTarget(found);\r\n }\r\n else {\r\n return null;\r\n }\r\n });\r\n };\r\n return IndexedDbQueryCache;\r\n}());\r\n/**\r\n * Helper to get a typed SimpleDbStore for the queries object store.\r\n */\r\nfunction targetsStore(txn) {\r\n return IndexedDbPersistence.getStore(txn, DbTarget.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the target globals object store.\r\n */\r\nfunction globalTargetStore(txn) {\r\n return IndexedDbPersistence.getStore(txn, DbTargetGlobal.store);\r\n}\r\nfunction retrieveMetadata(txn) {\r\n var globalStore = SimpleDb.getStore(txn, DbTargetGlobal.store);\r\n return globalStore.get(DbTargetGlobal.key).next(function (metadata) {\r\n assert(metadata !== null, 'Missing metadata row.');\r\n return metadata;\r\n });\r\n}\r\nfunction getHighestListenSequenceNumber(txn) {\r\n return retrieveMetadata(txn).next(function (targetGlobal) { return targetGlobal.highestListenSequenceNumber; });\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the document target object store.\r\n */\r\nfunction documentTargetStore(txn) {\r\n return IndexedDbPersistence.getStore(txn, DbTargetDocument.store);\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar REMOTE_DOCUMENT_CHANGE_MISSING_ERR_MSG = 'The remote document changelog no longer contains all changes for all ' +\r\n 'local query views. It may be necessary to rebuild these views.';\r\nvar IndexedDbRemoteDocumentCache = /** @class */ (function () {\r\n /**\r\n * @param {LocalSerializer} serializer The document serializer.\r\n * @param keepDocumentChangeLog Whether to keep a document change log in\r\n * IndexedDb. This change log is required for Multi-Tab synchronization, but\r\n * not needed in clients that don't share access to their remote document\r\n * cache.\r\n */\r\n function IndexedDbRemoteDocumentCache(serializer, keepDocumentChangeLog) {\r\n this.serializer = serializer;\r\n this.keepDocumentChangeLog = keepDocumentChangeLog;\r\n /** The last id read by `getNewDocumentChanges()`. */\r\n this._lastProcessedDocumentChangeId = 0;\r\n }\r\n Object.defineProperty(IndexedDbRemoteDocumentCache.prototype, \"lastProcessedDocumentChangeId\", {\r\n get: function () {\r\n return this._lastProcessedDocumentChangeId;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Starts up the remote document cache.\r\n *\r\n * Reads the ID of the last document change from the documentChanges store.\r\n * Existing changes will not be returned as part of\r\n * `getNewDocumentChanges()`.\r\n */\r\n // PORTING NOTE: This is only used for multi-tab synchronization.\r\n IndexedDbRemoteDocumentCache.prototype.start = function (transaction) {\r\n var store = SimpleDb.getStore(transaction, DbRemoteDocumentChanges.store);\r\n return this.synchronizeLastDocumentChangeId(store);\r\n };\r\n IndexedDbRemoteDocumentCache.prototype.addEntries = function (transaction, maybeDocuments) {\r\n var promises = [];\r\n if (maybeDocuments.length > 0) {\r\n var documentStore = remoteDocumentsStore(transaction);\r\n var changedKeys = documentKeySet();\r\n for (var _i = 0, maybeDocuments_1 = maybeDocuments; _i < maybeDocuments_1.length; _i++) {\r\n var maybeDocument = maybeDocuments_1[_i];\r\n promises.push(documentStore.put(dbKey(maybeDocument.key), this.serializer.toDbRemoteDocument(maybeDocument)));\r\n changedKeys = changedKeys.add(maybeDocument.key);\r\n }\r\n if (this.keepDocumentChangeLog) {\r\n promises.push(documentChangesStore(transaction).put({\r\n changes: this.serializer.toDbResourcePaths(changedKeys)\r\n }));\r\n }\r\n }\r\n return PersistencePromise.waitFor(promises);\r\n };\r\n IndexedDbRemoteDocumentCache.prototype.removeEntry = function (transaction, documentKey) {\r\n // We don't need to keep changelog for these removals since `removeEntry` is\r\n // only used for garbage collection.\r\n return remoteDocumentsStore(transaction).delete(dbKey(documentKey));\r\n };\r\n IndexedDbRemoteDocumentCache.prototype.getEntry = function (transaction, documentKey) {\r\n var _this = this;\r\n return remoteDocumentsStore(transaction)\r\n .get(dbKey(documentKey))\r\n .next(function (dbRemoteDoc) {\r\n return dbRemoteDoc\r\n ? _this.serializer.fromDbRemoteDocument(dbRemoteDoc)\r\n : null;\r\n });\r\n };\r\n IndexedDbRemoteDocumentCache.prototype.getDocumentsMatchingQuery = function (transaction, query) {\r\n var _this = this;\r\n var results = documentMap();\r\n // Documents are ordered by key, so we can use a prefix scan to narrow down\r\n // the documents we need to match the query against.\r\n var startKey = query.path.toArray();\r\n var range = IDBKeyRange.lowerBound(startKey);\r\n return remoteDocumentsStore(transaction)\r\n .iterate({ range: range }, function (key, dbRemoteDoc, control) {\r\n var maybeDoc = _this.serializer.fromDbRemoteDocument(dbRemoteDoc);\r\n if (!query.path.isPrefixOf(maybeDoc.key.path)) {\r\n control.done();\r\n }\r\n else if (maybeDoc instanceof Document && query.matches(maybeDoc)) {\r\n results = results.insert(maybeDoc.key, maybeDoc);\r\n }\r\n })\r\n .next(function () { return results; });\r\n };\r\n IndexedDbRemoteDocumentCache.prototype.getNewDocumentChanges = function (transaction) {\r\n var _this = this;\r\n assert(this.keepDocumentChangeLog, 'Can only call getNewDocumentChanges() when document change log is enabled');\r\n var changedKeys = documentKeySet();\r\n var changedDocs = maybeDocumentMap();\r\n var range = IDBKeyRange.lowerBound(this._lastProcessedDocumentChangeId + 1);\r\n var firstIteration = true;\r\n var changesStore = documentChangesStore(transaction);\r\n return changesStore\r\n .iterate({ range: range }, function (_, documentChange) {\r\n if (firstIteration) {\r\n firstIteration = false;\r\n // If our client was throttled for more than 30 minutes, another\r\n // client may have garbage collected the remote document changelog.\r\n if (_this._lastProcessedDocumentChangeId + 1 !== documentChange.id) {\r\n // Reset the `lastProcessedDocumentChangeId` to allow further\r\n // invocations to successfully return the changes after this\r\n // rejection.\r\n return _this.synchronizeLastDocumentChangeId(changesStore).next(function () {\r\n return PersistencePromise.reject(new FirestoreError(Code.DATA_LOSS, REMOTE_DOCUMENT_CHANGE_MISSING_ERR_MSG));\r\n });\r\n }\r\n }\r\n changedKeys = changedKeys.unionWith(_this.serializer.fromDbResourcePaths(documentChange.changes));\r\n _this._lastProcessedDocumentChangeId = documentChange.id;\r\n })\r\n .next(function () {\r\n var documentPromises = [];\r\n changedKeys.forEach(function (key) {\r\n documentPromises.push(_this.getEntry(transaction, key).next(function (maybeDoc) {\r\n changedDocs = changedDocs.insert(key, maybeDoc || new NoDocument(key, SnapshotVersion.forDeletedDoc()));\r\n }));\r\n });\r\n return PersistencePromise.waitFor(documentPromises);\r\n })\r\n .next(function () { return changedDocs; });\r\n };\r\n /**\r\n * Removes all changes in the remote document changelog through `changeId`\r\n * (inclusive).\r\n */\r\n IndexedDbRemoteDocumentCache.prototype.removeDocumentChangesThroughChangeId = function (transaction, changeId) {\r\n var range = IDBKeyRange.upperBound(changeId);\r\n return documentChangesStore(transaction).delete(range);\r\n };\r\n IndexedDbRemoteDocumentCache.prototype.synchronizeLastDocumentChangeId = function (documentChangesStore) {\r\n var _this = this;\r\n // If there are no existing changes, we set `lastProcessedDocumentChangeId`\r\n // to 0 since IndexedDb's auto-generated keys start at 1.\r\n this._lastProcessedDocumentChangeId = 0;\r\n return documentChangesStore.iterate({ keysOnly: true, reverse: true }, function (key, value, control) {\r\n _this._lastProcessedDocumentChangeId = key;\r\n control.done();\r\n });\r\n };\r\n return IndexedDbRemoteDocumentCache;\r\n}());\r\nfunction isDocumentChangeMissingError(err) {\r\n return (err.code === Code.DATA_LOSS &&\r\n err.message === REMOTE_DOCUMENT_CHANGE_MISSING_ERR_MSG);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\r\n */\r\nfunction remoteDocumentsStore(txn) {\r\n return IndexedDbPersistence.getStore(txn, DbRemoteDocument.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the remoteDocumentChanges object\r\n * store.\r\n */\r\nfunction documentChangesStore(txn) {\r\n return IndexedDbPersistence.getStore(txn, DbRemoteDocumentChanges.store);\r\n}\r\nfunction dbKey(docKey) {\r\n return docKey.path.toArray();\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Serializer for values stored in the LocalStore. */\r\nvar LocalSerializer = /** @class */ (function () {\r\n function LocalSerializer(remoteSerializer) {\r\n this.remoteSerializer = remoteSerializer;\r\n }\r\n /** Decodes a remote document from storage locally to a Document. */\r\n LocalSerializer.prototype.fromDbRemoteDocument = function (remoteDoc) {\r\n if (remoteDoc.document) {\r\n return this.remoteSerializer.fromDocument(remoteDoc.document, !!remoteDoc.hasCommittedMutations);\r\n }\r\n else if (remoteDoc.noDocument) {\r\n var key = DocumentKey.fromSegments(remoteDoc.noDocument.path);\r\n var version = this.fromDbTimestamp(remoteDoc.noDocument.readTime);\r\n return new NoDocument(key, version, {\r\n hasCommittedMutations: !!remoteDoc.hasCommittedMutations\r\n });\r\n }\r\n else if (remoteDoc.unknownDocument) {\r\n var key = DocumentKey.fromSegments(remoteDoc.unknownDocument.path);\r\n var version = this.fromDbTimestamp(remoteDoc.unknownDocument.version);\r\n return new UnknownDocument(key, version);\r\n }\r\n else {\r\n return fail('Unexpected DbRemoteDocument');\r\n }\r\n };\r\n /** Encodes a document for storage locally. */\r\n LocalSerializer.prototype.toDbRemoteDocument = function (maybeDoc) {\r\n if (maybeDoc instanceof Document) {\r\n var doc = this.remoteSerializer.toDocument(maybeDoc);\r\n var hasCommittedMutations = maybeDoc.hasCommittedMutations;\r\n return new DbRemoteDocument(\r\n /* unknownDocument= */ null, \r\n /* noDocument= */ null, doc, hasCommittedMutations);\r\n }\r\n else if (maybeDoc instanceof NoDocument) {\r\n var path = maybeDoc.key.path.toArray();\r\n var readTime = this.toDbTimestamp(maybeDoc.version);\r\n var hasCommittedMutations = maybeDoc.hasCommittedMutations;\r\n return new DbRemoteDocument(\r\n /* unknownDocument= */ null, new DbNoDocument(path, readTime), \r\n /* document= */ null, hasCommittedMutations);\r\n }\r\n else if (maybeDoc instanceof UnknownDocument) {\r\n var path = maybeDoc.key.path.toArray();\r\n var readTime = this.toDbTimestamp(maybeDoc.version);\r\n return new DbRemoteDocument(new DbUnknownDocument(path, readTime), \r\n /* noDocument= */ null, \r\n /* document= */ null, \r\n /* hasCommittedMutations= */ true);\r\n }\r\n else {\r\n return fail('Unexpected MaybeDocumment');\r\n }\r\n };\r\n LocalSerializer.prototype.toDbTimestamp = function (snapshotVersion) {\r\n var timestamp = snapshotVersion.toTimestamp();\r\n return new DbTimestamp(timestamp.seconds, timestamp.nanoseconds);\r\n };\r\n LocalSerializer.prototype.fromDbTimestamp = function (dbTimestamp) {\r\n var timestamp = new Timestamp(dbTimestamp.seconds, dbTimestamp.nanoseconds);\r\n return SnapshotVersion.fromTimestamp(timestamp);\r\n };\r\n /** Encodes a batch of mutations into a DbMutationBatch for local storage. */\r\n LocalSerializer.prototype.toDbMutationBatch = function (userId, batch) {\r\n var _this = this;\r\n var serializedMutations = batch.mutations.map(function (m) {\r\n return _this.remoteSerializer.toMutation(m);\r\n });\r\n return new DbMutationBatch(userId, batch.batchId, batch.localWriteTime.toMillis(), serializedMutations);\r\n };\r\n /** Decodes a DbMutationBatch into a MutationBatch */\r\n LocalSerializer.prototype.fromDbMutationBatch = function (dbBatch) {\r\n var _this = this;\r\n var mutations = dbBatch.mutations.map(function (m) {\r\n return _this.remoteSerializer.fromMutation(m);\r\n });\r\n var timestamp = Timestamp.fromMillis(dbBatch.localWriteTimeMs);\r\n return new MutationBatch(dbBatch.batchId, timestamp, mutations);\r\n };\r\n /*\r\n * Encodes a set of document keys into an array of EncodedResourcePaths.\r\n */\r\n LocalSerializer.prototype.toDbResourcePaths = function (keys) {\r\n var encodedKeys = [];\r\n keys.forEach(function (key) {\r\n encodedKeys.push(encode(key.path));\r\n });\r\n return encodedKeys;\r\n };\r\n /** Decodes an array of EncodedResourcePaths into a set of document keys. */\r\n LocalSerializer.prototype.fromDbResourcePaths = function (encodedPaths) {\r\n var keys = documentKeySet();\r\n for (var _i = 0, encodedPaths_1 = encodedPaths; _i < encodedPaths_1.length; _i++) {\r\n var documentKey = encodedPaths_1[_i];\r\n keys = keys.add(new DocumentKey(decode$1(documentKey)));\r\n }\r\n return keys;\r\n };\r\n /** Decodes a DbTarget into QueryData */\r\n LocalSerializer.prototype.fromDbTarget = function (dbTarget) {\r\n var version = this.fromDbTimestamp(dbTarget.readTime);\r\n var query;\r\n if (isDocumentQuery(dbTarget.query)) {\r\n query = this.remoteSerializer.fromDocumentsTarget(dbTarget.query);\r\n }\r\n else {\r\n query = this.remoteSerializer.fromQueryTarget(dbTarget.query);\r\n }\r\n return new QueryData(query, dbTarget.targetId, QueryPurpose.Listen, dbTarget.lastListenSequenceNumber, version, dbTarget.resumeToken);\r\n };\r\n /** Encodes QueryData into a DbTarget for storage locally. */\r\n LocalSerializer.prototype.toDbTarget = function (queryData) {\r\n assert(QueryPurpose.Listen === queryData.purpose, 'Only queries with purpose ' +\r\n QueryPurpose.Listen +\r\n ' may be stored, got ' +\r\n queryData.purpose);\r\n var dbTimestamp = this.toDbTimestamp(queryData.snapshotVersion);\r\n var queryProto;\r\n if (queryData.query.isDocumentQuery()) {\r\n queryProto = this.remoteSerializer.toDocumentsTarget(queryData.query);\r\n }\r\n else {\r\n queryProto = this.remoteSerializer.toQueryTarget(queryData.query);\r\n }\r\n var resumeToken;\r\n if (queryData.resumeToken instanceof Uint8Array) {\r\n // TODO(b/78771403): Convert tokens to strings during deserialization\r\n assert(process.env.USE_MOCK_PERSISTENCE === 'YES', 'Persisting non-string stream tokens is only supported with mock persistence .');\r\n resumeToken = queryData.resumeToken.toString();\r\n }\r\n else {\r\n resumeToken = queryData.resumeToken;\r\n }\r\n // lastListenSequenceNumber is always 0 until we do real GC.\r\n return new DbTarget(queryData.targetId, queryData.query.canonicalId(), dbTimestamp, resumeToken, queryData.sequenceNumber, queryProto);\r\n };\r\n return LocalSerializer;\r\n}());\r\n/**\r\n * A helper function for figuring out what kind of query has been stored.\r\n */\r\nfunction isDocumentQuery(dbQuery) {\r\n return dbQuery.documents !== undefined;\r\n}\n\n/**\r\n * Copyright 2018 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction bufferEntryComparator(_a, _b) {\r\n var aSequence = _a[0], aIndex = _a[1];\r\n var bSequence = _b[0], bIndex = _b[1];\r\n var seqCmp = primitiveComparator(aSequence, bSequence);\r\n if (seqCmp === 0) {\r\n // This order doesn't matter, but we can bias against churn by sorting\r\n // entries created earlier as less than newer entries.\r\n return primitiveComparator(aIndex, bIndex);\r\n }\r\n else {\r\n return seqCmp;\r\n }\r\n}\r\n/**\r\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\r\n * lowest n values passed to `addElement`, and finally reports the largest of\r\n * them in `maxValue`.\r\n */\r\nvar RollingSequenceNumberBuffer = /** @class */ (function () {\r\n function RollingSequenceNumberBuffer(maxElements) {\r\n this.maxElements = maxElements;\r\n this.buffer = new SortedSet(bufferEntryComparator);\r\n this.previousIndex = 0;\r\n }\r\n RollingSequenceNumberBuffer.prototype.nextIndex = function () {\r\n return ++this.previousIndex;\r\n };\r\n RollingSequenceNumberBuffer.prototype.addElement = function (sequenceNumber) {\r\n var entry = [sequenceNumber, this.nextIndex()];\r\n if (this.buffer.size < this.maxElements) {\r\n this.buffer = this.buffer.add(entry);\r\n }\r\n else {\r\n var highestValue = this.buffer.last();\r\n if (bufferEntryComparator(entry, highestValue) < 0) {\r\n this.buffer = this.buffer.delete(highestValue).add(entry);\r\n }\r\n }\r\n };\r\n Object.defineProperty(RollingSequenceNumberBuffer.prototype, \"maxValue\", {\r\n get: function () {\r\n // Guaranteed to be non-empty. If we decide we are not collecting any\r\n // sequence numbers, nthSequenceNumber below short-circuits. If we have\r\n // decided that we are collecting n sequence numbers, it's because n is some\r\n // percentage of the existing sequence numbers. That means we should never\r\n // be in a situation where we are collecting sequence numbers but don't\r\n // actually have any.\r\n return this.buffer.last()[0];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return RollingSequenceNumberBuffer;\r\n}());\r\n/** Implements the steps for LRU garbage collection. */\r\nvar LruGarbageCollector = /** @class */ (function () {\r\n function LruGarbageCollector(delegate) {\r\n this.delegate = delegate;\r\n }\r\n /** Given a percentile of target to collect, returns the number of targets to collect. */\r\n LruGarbageCollector.prototype.calculateTargetCount = function (txn, percentile) {\r\n return this.delegate.getTargetCount(txn).next(function (targetCount) {\r\n return Math.floor(percentile / 100.0 * targetCount);\r\n });\r\n };\r\n /** Returns the nth sequence number, counting in order from the smallest. */\r\n LruGarbageCollector.prototype.nthSequenceNumber = function (txn, n) {\r\n var _this = this;\r\n if (n === 0) {\r\n return PersistencePromise.resolve(ListenSequence.INVALID);\r\n }\r\n var buffer = new RollingSequenceNumberBuffer(n);\r\n return this.delegate\r\n .forEachTarget(txn, function (target) { return buffer.addElement(target.sequenceNumber); })\r\n .next(function () {\r\n return _this.delegate.forEachOrphanedDocumentSequenceNumber(txn, function (sequenceNumber) { return buffer.addElement(sequenceNumber); });\r\n })\r\n .next(function () { return buffer.maxValue; });\r\n };\r\n /**\r\n * Removes targets with a sequence number equal to or less than the given upper bound, and removes\r\n * document associations with those targets.\r\n */\r\n LruGarbageCollector.prototype.removeTargets = function (txn, upperBound, activeTargetIds) {\r\n return this.delegate.removeTargets(txn, upperBound, activeTargetIds);\r\n };\r\n /**\r\n * Removes documents that have a sequence number equal to or less than the upper bound and are not\r\n * otherwise pinned.\r\n */\r\n LruGarbageCollector.prototype.removeOrphanedDocuments = function (txn, upperBound) {\r\n return this.delegate.removeOrphanedDocuments(txn, upperBound);\r\n };\r\n return LruGarbageCollector;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Opaque interface representing a persistence transaction.\r\n *\r\n * When you call Persistence.runTransaction(), it will create a transaction and\r\n * pass it to your callback. You then pass it to any method that operates\r\n * on persistence.\r\n */\r\nvar PersistenceTransaction = /** @class */ (function () {\r\n function PersistenceTransaction() {\r\n }\r\n return PersistenceTransaction;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$2 = 'IndexedDbPersistence';\r\n/**\r\n * Oldest acceptable age in milliseconds for client metadata before the client\r\n * is considered inactive and its associated data (such as the remote document\r\n * cache changelog) is garbage collected.\r\n */\r\nvar MAX_CLIENT_AGE_MS = 30 * 60 * 1000; // 30 minutes\r\n/**\r\n * Oldest acceptable metadata age for clients that may participate in the\r\n * primary lease election. Clients that have not updated their client metadata\r\n * within 5 seconds are not eligible to receive a primary lease.\r\n */\r\nvar MAX_PRIMARY_ELIGIBLE_AGE_MS = 5000;\r\n/**\r\n * The interval at which clients will update their metadata, including\r\n * refreshing their primary lease if held or potentially trying to acquire it if\r\n * not held.\r\n *\r\n * Primary clients may opportunistically refresh their metadata earlier\r\n * if they're already performing an IndexedDB operation.\r\n */\r\nvar CLIENT_METADATA_REFRESH_INTERVAL_MS = 4000;\r\n/** User-facing error when the primary lease is required but not available. */\r\nvar PRIMARY_LEASE_LOST_ERROR_MSG = 'The current tab is not in the required state to perform this operation. ' +\r\n 'It might be necessary to refresh the browser tab.';\r\nvar PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG = 'Another tab has exclusive access to the persistence layer. ' +\r\n 'To allow shared access, make sure to invoke ' +\r\n '`enablePersistence()` with `experimentalTabSynchronization:true` in all tabs.';\r\nvar UNSUPPORTED_PLATFORM_ERROR_MSG = 'This platform is either missing' +\r\n ' IndexedDB or is known to have an incomplete implementation. Offline' +\r\n ' persistence has been disabled.';\r\n// The format of the LocalStorage key that stores zombied client is:\r\n// firestore_zombie__\r\nvar ZOMBIED_CLIENTS_KEY_PREFIX = 'firestore_zombie';\r\nvar IndexedDbTransaction = /** @class */ (function (_super) {\r\n tslib_1.__extends(IndexedDbTransaction, _super);\r\n function IndexedDbTransaction(simpleDbTransaction, currentSequenceNumber) {\r\n var _this = _super.call(this) || this;\r\n _this.simpleDbTransaction = simpleDbTransaction;\r\n _this.currentSequenceNumber = currentSequenceNumber;\r\n return _this;\r\n }\r\n return IndexedDbTransaction;\r\n}(PersistenceTransaction));\r\nvar IndexedDbPersistence = /** @class */ (function () {\r\n // Note that `multiClientParams` must be present to enable multi-client support while multi-tab\r\n // is still experimental. When multi-client is switched to always on, `multiClientParams` will\r\n // no longer be optional.\r\n function IndexedDbPersistence(persistenceKey, clientId, platform, queue, serializer, multiClientParams) {\r\n this.persistenceKey = persistenceKey;\r\n this.clientId = clientId;\r\n this.queue = queue;\r\n this.multiClientParams = multiClientParams;\r\n this._started = false;\r\n this.isPrimary = false;\r\n this.networkEnabled = true;\r\n this.inForeground = false;\r\n /** The last time we garbage collected the Remote Document Changelog. */\r\n this.lastGarbageCollectionTime = Number.NEGATIVE_INFINITY;\r\n /** A listener to notify on primary state changes. */\r\n this.primaryStateListener = function (_) { return Promise.resolve(); };\r\n if (!IndexedDbPersistence.isAvailable()) {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, UNSUPPORTED_PLATFORM_ERROR_MSG);\r\n }\r\n this.referenceDelegate = new IndexedDbLruDelegate(this);\r\n this.dbName = persistenceKey + IndexedDbPersistence.MAIN_DATABASE;\r\n this.serializer = new LocalSerializer(serializer);\r\n this.document = platform.document;\r\n this.allowTabSynchronization = multiClientParams !== undefined;\r\n this.queryCache = new IndexedDbQueryCache(this.referenceDelegate, this.serializer);\r\n this.remoteDocumentCache = new IndexedDbRemoteDocumentCache(this.serializer, \r\n /*keepDocumentChangeLog=*/ this.allowTabSynchronization);\r\n if (platform.window && platform.window.localStorage) {\r\n this.window = platform.window;\r\n this.webStorage = this.window.localStorage;\r\n }\r\n else {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, 'IndexedDB persistence is only available on platforms that support LocalStorage.');\r\n }\r\n }\r\n IndexedDbPersistence.getStore = function (txn, store) {\r\n if (txn instanceof IndexedDbTransaction) {\r\n return SimpleDb.getStore(txn.simpleDbTransaction, store);\r\n }\r\n else {\r\n throw fail('IndexedDbPersistence must use instances of IndexedDbTransaction');\r\n }\r\n };\r\n IndexedDbPersistence.createIndexedDbPersistence = function (persistenceKey, clientId, platform, queue, serializer) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var persistence;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n persistence = new IndexedDbPersistence(persistenceKey, clientId, platform, queue, serializer);\r\n return [4 /*yield*/, persistence.start()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, persistence];\r\n }\r\n });\r\n });\r\n };\r\n IndexedDbPersistence.createMultiClientIndexedDbPersistence = function (persistenceKey, clientId, platform, queue, serializer, multiClientParams) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var persistence;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n persistence = new IndexedDbPersistence(persistenceKey, clientId, platform, queue, serializer, multiClientParams);\r\n return [4 /*yield*/, persistence.start()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, persistence];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Attempt to start IndexedDb persistence.\r\n *\r\n * @return {Promise} Whether persistence was enabled.\r\n */\r\n IndexedDbPersistence.prototype.start = function () {\r\n var _this = this;\r\n assert(!this.started, 'IndexedDbPersistence double-started!');\r\n assert(this.window !== null, \"Expected 'window' to be defined\");\r\n return SimpleDb.openOrCreate(this.dbName, SCHEMA_VERSION, new SchemaConverter(this.serializer))\r\n .then(function (db) {\r\n _this.simpleDb = db;\r\n })\r\n .then(function () { return _this.startRemoteDocumentCache(); })\r\n .then(function () {\r\n _this.attachVisibilityHandler();\r\n _this.attachWindowUnloadHook();\r\n return _this.updateClientMetadataAndTryBecomePrimary().then(function () {\r\n return _this.scheduleClientMetadataAndPrimaryLeaseRefreshes();\r\n });\r\n })\r\n .then(function () {\r\n return _this.simpleDb.runTransaction('readonly', [DbTargetGlobal.store], function (txn) {\r\n return getHighestListenSequenceNumber(txn).next(function (highestListenSequenceNumber) {\r\n var sequenceNumberSyncer = _this.multiClientParams\r\n ? _this.multiClientParams.sequenceNumberSyncer\r\n : undefined;\r\n _this.listenSequence = new ListenSequence(highestListenSequenceNumber, sequenceNumberSyncer);\r\n });\r\n });\r\n })\r\n .then(function () {\r\n _this._started = true;\r\n })\r\n .catch(function (reason) {\r\n _this.simpleDb && _this.simpleDb.close();\r\n return Promise.reject(reason);\r\n });\r\n };\r\n IndexedDbPersistence.prototype.startRemoteDocumentCache = function () {\r\n var _this = this;\r\n return this.simpleDb.runTransaction('readonly', ALL_STORES, function (txn) {\r\n return _this.remoteDocumentCache.start(txn);\r\n });\r\n };\r\n IndexedDbPersistence.prototype.setPrimaryStateListener = function (primaryStateListener) {\r\n var _this = this;\r\n this.primaryStateListener = function (primaryState) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n if (this.started) {\r\n return [2 /*return*/, primaryStateListener(primaryState)];\r\n }\r\n return [2 /*return*/];\r\n });\r\n }); };\r\n return primaryStateListener(this.isPrimary);\r\n };\r\n IndexedDbPersistence.prototype.setNetworkEnabled = function (networkEnabled) {\r\n var _this = this;\r\n if (this.networkEnabled !== networkEnabled) {\r\n this.networkEnabled = networkEnabled;\r\n // Schedule a primary lease refresh for immediate execution. The eventual\r\n // lease update will be propagated via `primaryStateListener`.\r\n this.queue.enqueueAndForget(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.started) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.updateClientMetadataAndTryBecomePrimary()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n }); });\r\n }\r\n };\r\n /**\r\n * Updates the client metadata in IndexedDb and attempts to either obtain or\r\n * extend the primary lease for the local client. Asynchronously notifies the\r\n * primary state listener if the client either newly obtained or released its\r\n * primary lease.\r\n */\r\n IndexedDbPersistence.prototype.updateClientMetadataAndTryBecomePrimary = function () {\r\n var _this = this;\r\n return this.simpleDb.runTransaction('readwrite', ALL_STORES, function (txn) {\r\n var metadataStore = clientMetadataStore(txn);\r\n return metadataStore\r\n .put(new DbClientMetadata(_this.clientId, Date.now(), _this.networkEnabled, _this.inForeground, _this.remoteDocumentCache.lastProcessedDocumentChangeId))\r\n .next(function () {\r\n if (_this.isPrimary) {\r\n return _this.verifyPrimaryLease(txn).next(function (success) {\r\n if (!success) {\r\n _this.isPrimary = false;\r\n _this.queue.enqueueAndForget(function () {\r\n return _this.primaryStateListener(false);\r\n });\r\n }\r\n });\r\n }\r\n })\r\n .next(function () { return _this.canActAsPrimary(txn); })\r\n .next(function (canActAsPrimary) {\r\n var wasPrimary = _this.isPrimary;\r\n _this.isPrimary = canActAsPrimary;\r\n if (wasPrimary !== _this.isPrimary) {\r\n _this.queue.enqueueAndForget(function () {\r\n return _this.primaryStateListener(_this.isPrimary);\r\n });\r\n }\r\n if (wasPrimary && !_this.isPrimary) {\r\n return _this.releasePrimaryLeaseIfHeld(txn);\r\n }\r\n else if (_this.isPrimary) {\r\n return _this.acquireOrExtendPrimaryLease(txn);\r\n }\r\n });\r\n });\r\n };\r\n IndexedDbPersistence.prototype.verifyPrimaryLease = function (txn) {\r\n var _this = this;\r\n var store = primaryClientStore(txn);\r\n return store.get(DbPrimaryClient.key).next(function (primaryClient) {\r\n return PersistencePromise.resolve(_this.isLocalClient(primaryClient));\r\n });\r\n };\r\n IndexedDbPersistence.prototype.removeClientMetadata = function (txn) {\r\n var metadataStore = clientMetadataStore(txn);\r\n return metadataStore.delete(this.clientId);\r\n };\r\n /**\r\n * If the garbage collection threshold has passed, prunes the\r\n * RemoteDocumentChanges and the ClientMetadata store based on the last update\r\n * time of all clients.\r\n */\r\n IndexedDbPersistence.prototype.maybeGarbageCollectMultiClientState = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var activeClients_1, inactiveClients_1;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(this.isPrimary &&\r\n !this.isWithinAge(this.lastGarbageCollectionTime, MAX_CLIENT_AGE_MS))) return [3 /*break*/, 2];\r\n this.lastGarbageCollectionTime = Date.now();\r\n inactiveClients_1 = [];\r\n return [4 /*yield*/, this.runTransaction('maybeGarbageCollectMultiClientState', 'readwrite-primary', function (txn) {\r\n var metadataStore = IndexedDbPersistence.getStore(txn, DbClientMetadata.store);\r\n return metadataStore\r\n .loadAll()\r\n .next(function (existingClients) {\r\n activeClients_1 = _this.filterActiveClients(existingClients, MAX_CLIENT_AGE_MS);\r\n inactiveClients_1 = existingClients.filter(function (client) { return activeClients_1.indexOf(client) === -1; });\r\n })\r\n .next(function () {\r\n // Delete metadata for clients that are no longer considered active.\r\n return PersistencePromise.forEach(inactiveClients_1, function (inactiveClient) {\r\n return metadataStore.delete(inactiveClient.clientId);\r\n });\r\n })\r\n .next(function () {\r\n // Retrieve the minimum change ID from the set of active clients.\r\n // The primary client doesn't read from the document change log,\r\n // and hence we exclude it when we determine the minimum\r\n // `lastProcessedDocumentChangeId`.\r\n activeClients_1 = activeClients_1.filter(function (client) { return client.clientId !== _this.clientId; });\r\n if (activeClients_1.length > 0) {\r\n var processedChangeIds = activeClients_1.map(function (client) { return client.lastProcessedDocumentChangeId || 0; });\r\n var oldestChangeId = Math.min.apply(Math, processedChangeIds);\r\n return _this.remoteDocumentCache.removeDocumentChangesThroughChangeId(txn, oldestChangeId);\r\n }\r\n });\r\n })];\r\n case 1:\r\n _a.sent();\r\n // Delete potential leftover entries that may continue to mark the\r\n // inactive clients as zombied in LocalStorage.\r\n // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\r\n // the client atomically, but we can't. So we opt to delete the IndexedDb\r\n // entries first to avoid potentially reviving a zombied client.\r\n inactiveClients_1.forEach(function (inactiveClient) {\r\n _this.window.localStorage.removeItem(_this.zombiedClientLocalStorageKey(inactiveClient.clientId));\r\n });\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Schedules a recurring timer to update the client metadata and to either\r\n * extend or acquire the primary lease if the client is eligible.\r\n */\r\n IndexedDbPersistence.prototype.scheduleClientMetadataAndPrimaryLeaseRefreshes = function () {\r\n var _this = this;\r\n this.clientMetadataRefresher = this.queue.enqueueAfterDelay(TimerId.ClientMetadataRefresh, CLIENT_METADATA_REFRESH_INTERVAL_MS, function () {\r\n return _this.updateClientMetadataAndTryBecomePrimary()\r\n .then(function () { return _this.maybeGarbageCollectMultiClientState(); })\r\n .then(function () { return _this.scheduleClientMetadataAndPrimaryLeaseRefreshes(); });\r\n });\r\n };\r\n /** Checks whether `client` is the local client. */\r\n IndexedDbPersistence.prototype.isLocalClient = function (client) {\r\n return client ? client.ownerId === this.clientId : false;\r\n };\r\n /**\r\n * Evaluate the state of all active clients and determine whether the local\r\n * client is or can act as the holder of the primary lease. Returns whether\r\n * the client is eligible for the lease, but does not actually acquire it.\r\n * May return 'false' even if there is no active leaseholder and another\r\n * (foreground) client should become leaseholder instead.\r\n */\r\n IndexedDbPersistence.prototype.canActAsPrimary = function (txn) {\r\n var _this = this;\r\n var store = primaryClientStore(txn);\r\n return store\r\n .get(DbPrimaryClient.key)\r\n .next(function (currentPrimary) {\r\n var currentLeaseIsValid = currentPrimary !== null &&\r\n _this.isWithinAge(currentPrimary.leaseTimestampMs, MAX_PRIMARY_ELIGIBLE_AGE_MS) &&\r\n !_this.isClientZombied(currentPrimary.ownerId);\r\n // A client is eligible for the primary lease if:\r\n // - its network is enabled and the client's tab is in the foreground.\r\n // - its network is enabled and no other client's tab is in the\r\n // foreground.\r\n // - every clients network is disabled and the client's tab is in the\r\n // foreground.\r\n // - every clients network is disabled and no other client's tab is in\r\n // the foreground.\r\n if (currentLeaseIsValid) {\r\n if (_this.isLocalClient(currentPrimary) && _this.networkEnabled) {\r\n return true;\r\n }\r\n if (!_this.isLocalClient(currentPrimary)) {\r\n if (!currentPrimary.allowTabSynchronization) {\r\n // Fail the `canActAsPrimary` check if the current leaseholder has\r\n // not opted into multi-tab synchronization. If this happens at\r\n // client startup, we reject the Promise returned by\r\n // `enablePersistence()` and the user can continue to use Firestore\r\n // with in-memory persistence.\r\n // If this fails during a lease refresh, we will instead block the\r\n // AsyncQueue from executing further operations. Note that this is\r\n // acceptable since mixing & matching different `synchronizeTabs`\r\n // settings is not supported.\r\n //\r\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can\r\n // no longer be turned off.\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG);\r\n }\r\n return false;\r\n }\r\n }\r\n if (_this.networkEnabled && _this.inForeground) {\r\n return true;\r\n }\r\n return clientMetadataStore(txn)\r\n .loadAll()\r\n .next(function (existingClients) {\r\n // Process all existing clients and determine whether at least one of\r\n // them is better suited to obtain the primary lease.\r\n var preferredCandidate = _this.filterActiveClients(existingClients, MAX_PRIMARY_ELIGIBLE_AGE_MS).find(function (otherClient) {\r\n if (_this.clientId !== otherClient.clientId) {\r\n var otherClientHasBetterNetworkState = !_this.networkEnabled && otherClient.networkEnabled;\r\n var otherClientHasBetterVisibility = !_this.inForeground && otherClient.inForeground;\r\n var otherClientHasSameNetworkState = _this.networkEnabled === otherClient.networkEnabled;\r\n if (otherClientHasBetterNetworkState ||\r\n (otherClientHasBetterVisibility &&\r\n otherClientHasSameNetworkState)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n });\r\n return preferredCandidate === undefined;\r\n });\r\n })\r\n .next(function (canActAsPrimary) {\r\n if (_this.isPrimary !== canActAsPrimary) {\r\n debug(LOG_TAG$2, \"Client \" + (canActAsPrimary ? 'is' : 'is not') + \" eligible for a primary lease.\");\r\n }\r\n return canActAsPrimary;\r\n });\r\n };\r\n IndexedDbPersistence.prototype.shutdown = function (deleteData) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // The shutdown() operations are idempotent and can be called even when\r\n // start() aborted (e.g. because it couldn't acquire the persistence lease).\r\n this._started = false;\r\n this.markClientZombied();\r\n if (this.clientMetadataRefresher) {\r\n this.clientMetadataRefresher.cancel();\r\n }\r\n this.detachVisibilityHandler();\r\n this.detachWindowUnloadHook();\r\n return [4 /*yield*/, this.simpleDb.runTransaction('readwrite', [DbPrimaryClient.store, DbClientMetadata.store], function (txn) {\r\n return _this.releasePrimaryLeaseIfHeld(txn).next(function () {\r\n return _this.removeClientMetadata(txn);\r\n });\r\n })];\r\n case 1:\r\n _a.sent();\r\n this.simpleDb.close();\r\n // Remove the entry marking the client as zombied from LocalStorage since\r\n // we successfully deleted its metadata from IndexedDb.\r\n this.removeClientZombiedEntry();\r\n if (!deleteData) return [3 /*break*/, 3];\r\n return [4 /*yield*/, SimpleDb.delete(this.dbName)];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns clients that are not zombied and have an updateTime within the\r\n * provided threshold.\r\n */\r\n IndexedDbPersistence.prototype.filterActiveClients = function (clients, activityThresholdMs) {\r\n var _this = this;\r\n return clients.filter(function (client) {\r\n return _this.isWithinAge(client.updateTimeMs, activityThresholdMs) &&\r\n !_this.isClientZombied(client.clientId);\r\n });\r\n };\r\n IndexedDbPersistence.prototype.getActiveClients = function () {\r\n var _this = this;\r\n return this.simpleDb.runTransaction('readonly', [DbClientMetadata.store], function (txn) {\r\n return clientMetadataStore(txn)\r\n .loadAll()\r\n .next(function (clients) {\r\n return _this.filterActiveClients(clients, MAX_CLIENT_AGE_MS).map(function (clientMetadata) { return clientMetadata.clientId; });\r\n });\r\n });\r\n };\r\n Object.defineProperty(IndexedDbPersistence.prototype, \"started\", {\r\n get: function () {\r\n return this._started;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n IndexedDbPersistence.prototype.getMutationQueue = function (user) {\r\n assert(this.started, 'Cannot initialize MutationQueue before persistence is started.');\r\n return IndexedDbMutationQueue.forUser(user, this.serializer, this.referenceDelegate);\r\n };\r\n IndexedDbPersistence.prototype.getQueryCache = function () {\r\n assert(this.started, 'Cannot initialize QueryCache before persistence is started.');\r\n return this.queryCache;\r\n };\r\n IndexedDbPersistence.prototype.getRemoteDocumentCache = function () {\r\n assert(this.started, 'Cannot initialize RemoteDocumentCache before persistence is started.');\r\n return this.remoteDocumentCache;\r\n };\r\n IndexedDbPersistence.prototype.runTransaction = function (action, mode, transactionOperation) {\r\n var _this = this;\r\n debug(LOG_TAG$2, 'Starting transaction:', action);\r\n // Do all transactions as readwrite against all object stores, since we\r\n // are the only reader/writer.\r\n return this.simpleDb.runTransaction(mode === 'readonly' ? 'readonly' : 'readwrite', ALL_STORES, function (simpleDbTxn) {\r\n if (mode === 'readwrite-primary') {\r\n // While we merely verify that we have (or can acquire) the lease\r\n // immediately, we wait to extend the primary lease until after\r\n // executing transactionOperation(). This ensures that even if the\r\n // transactionOperation takes a long time, we'll use a recent\r\n // leaseTimestampMs in the extended (or newly acquired) lease.\r\n return _this.verifyPrimaryLease(simpleDbTxn)\r\n .next(function (success) {\r\n if (!success) {\r\n error(\"Failed to obtain primary lease for action '\" + action + \"'.\");\r\n _this.isPrimary = false;\r\n _this.queue.enqueueAndForget(function () {\r\n return _this.primaryStateListener(false);\r\n });\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, PRIMARY_LEASE_LOST_ERROR_MSG);\r\n }\r\n return transactionOperation(new IndexedDbTransaction(simpleDbTxn, _this.listenSequence.next()));\r\n })\r\n .next(function (result) {\r\n return _this.acquireOrExtendPrimaryLease(simpleDbTxn).next(function () { return result; });\r\n });\r\n }\r\n else {\r\n return _this.verifyAllowTabSynchronization(simpleDbTxn).next(function () {\r\n return transactionOperation(new IndexedDbTransaction(simpleDbTxn, _this.listenSequence.next()));\r\n });\r\n }\r\n });\r\n };\r\n /**\r\n * Verifies that the current tab is the primary leaseholder or alternatively\r\n * that the leaseholder has opted into multi-tab synchronization.\r\n */\r\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\r\n // be turned off.\r\n IndexedDbPersistence.prototype.verifyAllowTabSynchronization = function (txn) {\r\n var _this = this;\r\n var store = primaryClientStore(txn);\r\n return store.get(DbPrimaryClient.key).next(function (currentPrimary) {\r\n var currentLeaseIsValid = currentPrimary !== null &&\r\n _this.isWithinAge(currentPrimary.leaseTimestampMs, MAX_PRIMARY_ELIGIBLE_AGE_MS) &&\r\n !_this.isClientZombied(currentPrimary.ownerId);\r\n if (currentLeaseIsValid && !_this.isLocalClient(currentPrimary)) {\r\n if (!currentPrimary.allowTabSynchronization) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG);\r\n }\r\n }\r\n });\r\n };\r\n /**\r\n * Obtains or extends the new primary lease for the local client. This\r\n * method does not verify that the client is eligible for this lease.\r\n */\r\n IndexedDbPersistence.prototype.acquireOrExtendPrimaryLease = function (txn) {\r\n var newPrimary = new DbPrimaryClient(this.clientId, this.allowTabSynchronization, Date.now());\r\n return primaryClientStore(txn).put(DbPrimaryClient.key, newPrimary);\r\n };\r\n IndexedDbPersistence.isAvailable = function () {\r\n return SimpleDb.isAvailable();\r\n };\r\n /**\r\n * Generates a string used as a prefix when storing data in IndexedDB and\r\n * LocalStorage.\r\n */\r\n IndexedDbPersistence.buildStoragePrefix = function (databaseInfo) {\r\n // Use two different prefix formats:\r\n //\r\n // * firestore / persistenceKey / projectID . databaseID / ...\r\n // * firestore / persistenceKey / projectID / ...\r\n //\r\n // projectIDs are DNS-compatible names and cannot contain dots\r\n // so there's no danger of collisions.\r\n var database = databaseInfo.databaseId.projectId;\r\n if (!databaseInfo.databaseId.isDefaultDatabase) {\r\n database += '.' + databaseInfo.databaseId.database;\r\n }\r\n return 'firestore/' + databaseInfo.persistenceKey + '/' + database + '/';\r\n };\r\n /** Checks the primary lease and removes it if we are the current primary. */\r\n IndexedDbPersistence.prototype.releasePrimaryLeaseIfHeld = function (txn) {\r\n var _this = this;\r\n var store = primaryClientStore(txn);\r\n return store.get(DbPrimaryClient.key).next(function (primaryClient) {\r\n if (_this.isLocalClient(primaryClient)) {\r\n debug(LOG_TAG$2, 'Releasing primary lease.');\r\n return store.delete(DbPrimaryClient.key);\r\n }\r\n else {\r\n return PersistencePromise.resolve();\r\n }\r\n });\r\n };\r\n /** Verifies that `updateTimeMs` is within `maxAgeMs`. */\r\n IndexedDbPersistence.prototype.isWithinAge = function (updateTimeMs, maxAgeMs) {\r\n var now = Date.now();\r\n var minAcceptable = now - maxAgeMs;\r\n var maxAcceptable = now;\r\n if (updateTimeMs < minAcceptable) {\r\n return false;\r\n }\r\n else if (updateTimeMs > maxAcceptable) {\r\n error(\"Detected an update time that is in the future: \" + updateTimeMs + \" > \" + maxAcceptable);\r\n return false;\r\n }\r\n return true;\r\n };\r\n IndexedDbPersistence.prototype.attachVisibilityHandler = function () {\r\n var _this = this;\r\n if (this.document !== null &&\r\n typeof this.document.addEventListener === 'function') {\r\n this.documentVisibilityHandler = function () {\r\n _this.queue.enqueueAndForget(function () {\r\n _this.inForeground = _this.document.visibilityState === 'visible';\r\n return _this.updateClientMetadataAndTryBecomePrimary();\r\n });\r\n };\r\n this.document.addEventListener('visibilitychange', this.documentVisibilityHandler);\r\n this.inForeground = this.document.visibilityState === 'visible';\r\n }\r\n };\r\n IndexedDbPersistence.prototype.detachVisibilityHandler = function () {\r\n if (this.documentVisibilityHandler) {\r\n assert(this.document !== null &&\r\n typeof this.document.addEventListener === 'function', \"Expected 'document.addEventListener' to be a function\");\r\n this.document.removeEventListener('visibilitychange', this.documentVisibilityHandler);\r\n this.documentVisibilityHandler = null;\r\n }\r\n };\r\n /**\r\n * Attaches a window.unload handler that will synchronously write our\r\n * clientId to a \"zombie client id\" location in LocalStorage. This can be used\r\n * by tabs trying to acquire the primary lease to determine that the lease\r\n * is no longer valid even if the timestamp is recent. This is particularly\r\n * important for the refresh case (so the tab correctly re-acquires the\r\n * primary lease). LocalStorage is used for this rather than IndexedDb because\r\n * it is a synchronous API and so can be used reliably from an unload\r\n * handler.\r\n */\r\n IndexedDbPersistence.prototype.attachWindowUnloadHook = function () {\r\n var _this = this;\r\n if (typeof this.window.addEventListener === 'function') {\r\n this.windowUnloadHandler = function () {\r\n // Note: In theory, this should be scheduled on the AsyncQueue since it\r\n // accesses internal state. We execute this code directly during shutdown\r\n // to make sure it gets a chance to run.\r\n _this.markClientZombied();\r\n _this.queue.enqueueAndForget(function () {\r\n // Attempt graceful shutdown (including releasing our primary lease),\r\n // but there's no guarantee it will complete.\r\n return _this.shutdown();\r\n });\r\n };\r\n this.window.addEventListener('unload', this.windowUnloadHandler);\r\n }\r\n };\r\n IndexedDbPersistence.prototype.detachWindowUnloadHook = function () {\r\n if (this.windowUnloadHandler) {\r\n assert(typeof this.window.removeEventListener === 'function', \"Expected 'window.removeEventListener' to be a function\");\r\n this.window.removeEventListener('unload', this.windowUnloadHandler);\r\n this.windowUnloadHandler = null;\r\n }\r\n };\r\n /**\r\n * Returns whether a client is \"zombied\" based on its LocalStorage entry.\r\n * Clients become zombied when their tab closes without running all of the\r\n * cleanup logic in `shutdown()`.\r\n */\r\n IndexedDbPersistence.prototype.isClientZombied = function (clientId) {\r\n try {\r\n var isZombied = this.webStorage.getItem(this.zombiedClientLocalStorageKey(clientId)) !==\r\n null;\r\n debug(LOG_TAG$2, \"Client '\" + clientId + \"' \" + (isZombied ? 'is' : 'is not') + \" zombied in LocalStorage\");\r\n return isZombied;\r\n }\r\n catch (e) {\r\n // Gracefully handle if LocalStorage isn't working.\r\n error(LOG_TAG$2, 'Failed to get zombied client id.', e);\r\n return false;\r\n }\r\n };\r\n /**\r\n * Record client as zombied (a client that had its tab closed). Zombied\r\n * clients are ignored during primary tab selection.\r\n */\r\n IndexedDbPersistence.prototype.markClientZombied = function () {\r\n try {\r\n this.webStorage.setItem(this.zombiedClientLocalStorageKey(this.clientId), String(Date.now()));\r\n }\r\n catch (e) {\r\n // Gracefully handle if LocalStorage isn't available / working.\r\n error('Failed to set zombie client id.', e);\r\n }\r\n };\r\n /** Removes the zombied client entry if it exists. */\r\n IndexedDbPersistence.prototype.removeClientZombiedEntry = function () {\r\n try {\r\n this.webStorage.removeItem(this.zombiedClientLocalStorageKey(this.clientId));\r\n }\r\n catch (e) {\r\n // Ignore\r\n }\r\n };\r\n IndexedDbPersistence.prototype.zombiedClientLocalStorageKey = function (clientId) {\r\n return ZOMBIED_CLIENTS_KEY_PREFIX + \"_\" + this.persistenceKey + \"_\" + clientId;\r\n };\r\n /**\r\n * The name of the main (and currently only) IndexedDB database. this name is\r\n * appended to the prefix provided to the IndexedDbPersistence constructor.\r\n */\r\n IndexedDbPersistence.MAIN_DATABASE = 'main';\r\n return IndexedDbPersistence;\r\n}());\r\nfunction isPrimaryLeaseLostError(err) {\r\n return (err.code === Code.FAILED_PRECONDITION &&\r\n err.message === PRIMARY_LEASE_LOST_ERROR_MSG);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the primary client object store.\r\n */\r\nfunction primaryClientStore(txn) {\r\n return txn.store(DbPrimaryClient.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the client metadata object store.\r\n */\r\nfunction clientMetadataStore(txn) {\r\n return txn.store(DbClientMetadata.store);\r\n}\r\n/** Provides LRU functionality for IndexedDB persistence. */\r\nvar IndexedDbLruDelegate = /** @class */ (function () {\r\n function IndexedDbLruDelegate(db) {\r\n this.db = db;\r\n this.garbageCollector = new LruGarbageCollector(this);\r\n }\r\n IndexedDbLruDelegate.prototype.getTargetCount = function (txn) {\r\n return this.db.getQueryCache().getQueryCount(txn);\r\n };\r\n IndexedDbLruDelegate.prototype.forEachTarget = function (txn, f) {\r\n return this.db.getQueryCache().forEachTarget(txn, f);\r\n };\r\n IndexedDbLruDelegate.prototype.forEachOrphanedDocumentSequenceNumber = function (txn, f) {\r\n return this.forEachOrphanedDocument(txn, function (docKey, sequenceNumber) {\r\n return f(sequenceNumber);\r\n });\r\n };\r\n IndexedDbLruDelegate.prototype.setInMemoryPins = function (inMemoryPins) {\r\n this.inMemoryPins = inMemoryPins;\r\n };\r\n IndexedDbLruDelegate.prototype.addReference = function (txn, key) {\r\n return writeSentinelKey(txn, key);\r\n };\r\n IndexedDbLruDelegate.prototype.removeReference = function (txn, key) {\r\n return writeSentinelKey(txn, key);\r\n };\r\n IndexedDbLruDelegate.prototype.removeTargets = function (txn, upperBound, activeTargetIds) {\r\n return this.db\r\n .getQueryCache()\r\n .removeTargets(txn, upperBound, activeTargetIds);\r\n };\r\n IndexedDbLruDelegate.prototype.removeMutationReference = function (txn, key) {\r\n return writeSentinelKey(txn, key);\r\n };\r\n /**\r\n * Returns true if anything would prevent this document from being garbage\r\n * collected, given that the document in question is not present in any\r\n * targets and has a sequence number less than or equal to the upper bound for\r\n * the collection run.\r\n */\r\n IndexedDbLruDelegate.prototype.isPinned = function (txn, docKey) {\r\n if (this.inMemoryPins.containsKey(docKey)) {\r\n return PersistencePromise.resolve(true);\r\n }\r\n else {\r\n return mutationQueuesContainKey(txn, docKey);\r\n }\r\n };\r\n IndexedDbLruDelegate.prototype.removeOrphanedDocuments = function (txn, upperBound) {\r\n var _this = this;\r\n var count = 0;\r\n var promises = [];\r\n var iteration = this.forEachOrphanedDocument(txn, function (docKey, sequenceNumber) {\r\n if (sequenceNumber <= upperBound) {\r\n var p = _this.isPinned(txn, docKey).next(function (isPinned) {\r\n if (!isPinned) {\r\n count++;\r\n return _this.removeOrphanedDocument(txn, docKey);\r\n }\r\n });\r\n promises.push(p);\r\n }\r\n });\r\n // Wait for iteration first to make sure we have a chance to add all of the\r\n // removal promises to the array.\r\n return iteration\r\n .next(function () { return PersistencePromise.waitFor(promises); })\r\n .next(function () { return count; });\r\n };\r\n /**\r\n * Clears a document from the cache. The document is assumed to be orphaned, so target-document\r\n * associations are not queried. We remove it from the remote document cache, as well as remove\r\n * its sentinel row.\r\n */\r\n IndexedDbLruDelegate.prototype.removeOrphanedDocument = function (txn, docKey) {\r\n return PersistencePromise.waitFor([\r\n documentTargetStore(txn).delete(sentinelKey(docKey)),\r\n this.db.getRemoteDocumentCache().removeEntry(txn, docKey)\r\n ]);\r\n };\r\n IndexedDbLruDelegate.prototype.removeTarget = function (txn, queryData) {\r\n var updated = queryData.copy({\r\n sequenceNumber: txn.currentSequenceNumber\r\n });\r\n return this.db.getQueryCache().updateQueryData(txn, updated);\r\n };\r\n IndexedDbLruDelegate.prototype.updateLimboDocument = function (txn, key) {\r\n return writeSentinelKey(txn, key);\r\n };\r\n /**\r\n * Call provided function for each document in the cache that is 'orphaned'. Orphaned\r\n * means not a part of any target, so the only entry in the target-document index for\r\n * that document will be the sentinel row (targetId 0), which will also have the sequence\r\n * number for the last time the document was accessed.\r\n */\r\n IndexedDbLruDelegate.prototype.forEachOrphanedDocument = function (txn, f) {\r\n var store = documentTargetStore(txn);\r\n var nextToReport = ListenSequence.INVALID;\r\n var nextPath;\r\n return store\r\n .iterate({\r\n index: DbTargetDocument.documentTargetsIndex\r\n }, function (_a, _b) {\r\n var targetId = _a[0], docKey = _a[1];\r\n var path = _b.path, sequenceNumber = _b.sequenceNumber;\r\n if (targetId === 0) {\r\n // if nextToReport is valid, report it, this is a new key so the\r\n // last one must not be a member of any targets.\r\n if (nextToReport !== ListenSequence.INVALID) {\r\n f(new DocumentKey(decode$1(nextPath)), nextToReport);\r\n }\r\n // set nextToReport to be this sequence number. It's the next one we\r\n // might report, if we don't find any targets for this document.\r\n // Note that the sequence number must be defined when the targetId\r\n // is 0.\r\n nextToReport = sequenceNumber;\r\n nextPath = path;\r\n }\r\n else {\r\n // set nextToReport to be invalid, we know we don't need to report\r\n // this one since we found a target for it.\r\n nextToReport = ListenSequence.INVALID;\r\n }\r\n })\r\n .next(function () {\r\n // Since we report sequence numbers after getting to the next key, we\r\n // need to check if the last key we iterated over was an orphaned\r\n // document and report it.\r\n if (nextToReport !== ListenSequence.INVALID) {\r\n f(new DocumentKey(decode$1(nextPath)), nextToReport);\r\n }\r\n });\r\n };\r\n return IndexedDbLruDelegate;\r\n}());\r\nfunction sentinelKey(key) {\r\n return [0, encode(key.path)];\r\n}\r\n/**\r\n * @return A value suitable for writing a sentinel row in the target-document\r\n * store.\r\n */\r\nfunction sentinelRow(key, sequenceNumber) {\r\n return new DbTargetDocument(0, encode(key.path), sequenceNumber);\r\n}\r\nfunction writeSentinelKey(txn, key) {\r\n return documentTargetStore(txn).put(sentinelRow(key, txn.currentSequenceNumber));\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A readonly view of the local state of all documents we're tracking (i.e. we\r\n * have a cached version in remoteDocumentCache or local mutations for the\r\n * document). The view is computed by applying the mutations in the\r\n * MutationQueue to the RemoteDocumentCache.\r\n */\r\nvar LocalDocumentsView = /** @class */ (function () {\r\n function LocalDocumentsView(remoteDocumentCache, mutationQueue) {\r\n this.remoteDocumentCache = remoteDocumentCache;\r\n this.mutationQueue = mutationQueue;\r\n }\r\n /**\r\n * Get the local view of the document identified by `key`.\r\n *\r\n * @return Local view of the document or null if we don't have any cached\r\n * state for it.\r\n */\r\n LocalDocumentsView.prototype.getDocument = function (transaction, key) {\r\n var _this = this;\r\n return this.mutationQueue\r\n .getAllMutationBatchesAffectingDocumentKey(transaction, key)\r\n .next(function (batches) { return _this.getDocumentInternal(transaction, key, batches); });\r\n };\r\n /** Internal version of `getDocument` that allows reusing batches. */\r\n LocalDocumentsView.prototype.getDocumentInternal = function (transaction, key, inBatches) {\r\n return this.remoteDocumentCache.getEntry(transaction, key).next(function (doc) {\r\n for (var _i = 0, inBatches_1 = inBatches; _i < inBatches_1.length; _i++) {\r\n var batch = inBatches_1[_i];\r\n doc = batch.applyToLocalView(key, doc);\r\n }\r\n return doc;\r\n });\r\n };\r\n /**\r\n * Gets the local view of the documents identified by `keys`.\r\n *\r\n * If we don't have cached state for a document in `keys`, a NoDocument will\r\n * be stored for that key in the resulting set.\r\n */\r\n LocalDocumentsView.prototype.getDocuments = function (transaction, keys) {\r\n var _this = this;\r\n return this.mutationQueue\r\n .getAllMutationBatchesAffectingDocumentKeys(transaction, keys)\r\n .next(function (batches) {\r\n var promises = [];\r\n var results = maybeDocumentMap();\r\n keys.forEach(function (key) {\r\n promises.push(_this.getDocumentInternal(transaction, key, batches).next(function (maybeDoc) {\r\n // TODO(http://b/32275378): Don't conflate missing / deleted.\r\n if (!maybeDoc) {\r\n maybeDoc = new NoDocument(key, SnapshotVersion.forDeletedDoc());\r\n }\r\n results = results.insert(key, maybeDoc);\r\n }));\r\n });\r\n return PersistencePromise.waitFor(promises).next(function () { return results; });\r\n });\r\n };\r\n /** Performs a query against the local view of all documents. */\r\n LocalDocumentsView.prototype.getDocumentsMatchingQuery = function (transaction, query) {\r\n if (DocumentKey.isDocumentKey(query.path)) {\r\n return this.getDocumentsMatchingDocumentQuery(transaction, query.path);\r\n }\r\n else {\r\n return this.getDocumentsMatchingCollectionQuery(transaction, query);\r\n }\r\n };\r\n LocalDocumentsView.prototype.getDocumentsMatchingDocumentQuery = function (transaction, docPath) {\r\n // Just do a simple document lookup.\r\n return this.getDocument(transaction, new DocumentKey(docPath)).next(function (maybeDoc) {\r\n var result = documentMap();\r\n if (maybeDoc instanceof Document) {\r\n result = result.insert(maybeDoc.key, maybeDoc);\r\n }\r\n return result;\r\n });\r\n };\r\n LocalDocumentsView.prototype.getDocumentsMatchingCollectionQuery = function (transaction, query) {\r\n var _this = this;\r\n // Query the remote documents and overlay mutations.\r\n var results;\r\n return this.remoteDocumentCache\r\n .getDocumentsMatchingQuery(transaction, query)\r\n .next(function (queryResults) {\r\n results = queryResults;\r\n return _this.mutationQueue.getAllMutationBatchesAffectingQuery(transaction, query);\r\n })\r\n .next(function (matchingMutationBatches) {\r\n for (var _i = 0, matchingMutationBatches_1 = matchingMutationBatches; _i < matchingMutationBatches_1.length; _i++) {\r\n var batch = matchingMutationBatches_1[_i];\r\n for (var _a = 0, _b = batch.mutations; _a < _b.length; _a++) {\r\n var mutation = _b[_a];\r\n var key = mutation.key;\r\n // Only process documents belonging to the collection.\r\n if (!query.path.isImmediateParentOf(key.path)) {\r\n continue;\r\n }\r\n var baseDoc = results.get(key);\r\n var mutatedDoc = mutation.applyToLocalView(baseDoc, baseDoc, batch.localWriteTime);\r\n if (mutatedDoc instanceof Document) {\r\n results = results.insert(key, mutatedDoc);\r\n }\r\n else {\r\n results = results.remove(key);\r\n }\r\n }\r\n }\r\n })\r\n .next(function () {\r\n // Finally, filter out any documents that don't actually match\r\n // the query.\r\n results.forEach(function (key, doc) {\r\n if (!query.matches(doc)) {\r\n results = results.remove(key);\r\n }\r\n });\r\n return results;\r\n });\r\n };\r\n return LocalDocumentsView;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A collection of references to a document from some kind of numbered entity\r\n * (either a target ID or batch ID). As references are added to or removed from\r\n * the set corresponding events are emitted to a registered garbage collector.\r\n *\r\n * Each reference is represented by a DocumentReference object. Each of them\r\n * contains enough information to uniquely identify the reference. They are all\r\n * stored primarily in a set sorted by key. A document is considered garbage if\r\n * there's no references in that set (this can be efficiently checked thanks to\r\n * sorting by key).\r\n *\r\n * ReferenceSet also keeps a secondary set that contains references sorted by\r\n * IDs. This one is used to efficiently implement removal of all references by\r\n * some target ID.\r\n */\r\nvar ReferenceSet = /** @class */ (function () {\r\n function ReferenceSet() {\r\n // A set of outstanding references to a document sorted by key.\r\n this.refsByKey = new SortedSet(DocReference.compareByKey);\r\n // A set of outstanding references to a document sorted by target id.\r\n this.refsByTarget = new SortedSet(DocReference.compareByTargetId);\r\n }\r\n /** Returns true if the reference set contains no references. */\r\n ReferenceSet.prototype.isEmpty = function () {\r\n return this.refsByKey.isEmpty();\r\n };\r\n /** Adds a reference to the given document key for the given ID. */\r\n ReferenceSet.prototype.addReference = function (key, id) {\r\n var ref = new DocReference(key, id);\r\n this.refsByKey = this.refsByKey.add(ref);\r\n this.refsByTarget = this.refsByTarget.add(ref);\r\n };\r\n /** Add references to the given document keys for the given ID. */\r\n ReferenceSet.prototype.addReferences = function (keys, id) {\r\n var _this = this;\r\n keys.forEach(function (key) { return _this.addReference(key, id); });\r\n };\r\n /**\r\n * Removes a reference to the given document key for the given\r\n * ID.\r\n */\r\n ReferenceSet.prototype.removeReference = function (key, id) {\r\n this.removeRef(new DocReference(key, id));\r\n };\r\n ReferenceSet.prototype.removeReferences = function (keys, id) {\r\n var _this = this;\r\n keys.forEach(function (key) { return _this.removeReference(key, id); });\r\n };\r\n /**\r\n * Clears all references with a given ID. Calls removeRef() for each key\r\n * removed.\r\n */\r\n ReferenceSet.prototype.removeReferencesForId = function (id) {\r\n var _this = this;\r\n var emptyKey = DocumentKey.EMPTY;\r\n var startRef = new DocReference(emptyKey, id);\r\n var endRef = new DocReference(emptyKey, id + 1);\r\n var keys = [];\r\n this.refsByTarget.forEachInRange([startRef, endRef], function (ref) {\r\n _this.removeRef(ref);\r\n keys.push(ref.key);\r\n });\r\n return keys;\r\n };\r\n ReferenceSet.prototype.removeAllReferences = function () {\r\n var _this = this;\r\n this.refsByKey.forEach(function (ref) { return _this.removeRef(ref); });\r\n };\r\n ReferenceSet.prototype.removeRef = function (ref) {\r\n this.refsByKey = this.refsByKey.delete(ref);\r\n this.refsByTarget = this.refsByTarget.delete(ref);\r\n };\r\n ReferenceSet.prototype.referencesForId = function (id) {\r\n var emptyKey = DocumentKey.EMPTY;\r\n var startRef = new DocReference(emptyKey, id);\r\n var endRef = new DocReference(emptyKey, id + 1);\r\n var keys = documentKeySet();\r\n this.refsByTarget.forEachInRange([startRef, endRef], function (ref) {\r\n keys = keys.add(ref.key);\r\n });\r\n return keys;\r\n };\r\n ReferenceSet.prototype.containsKey = function (key) {\r\n var ref = new DocReference(key, 0);\r\n var firstRef = this.refsByKey.firstAfterOrEqual(ref);\r\n return firstRef !== null && key.isEqual(firstRef.key);\r\n };\r\n return ReferenceSet;\r\n}());\r\nvar DocReference = /** @class */ (function () {\r\n function DocReference(key, targetOrBatchId) {\r\n this.key = key;\r\n this.targetOrBatchId = targetOrBatchId;\r\n }\r\n /** Compare by key then by ID */\r\n DocReference.compareByKey = function (left, right) {\r\n return (DocumentKey.comparator(left.key, right.key) ||\r\n primitiveComparator(left.targetOrBatchId, right.targetOrBatchId));\r\n };\r\n /** Compare by ID then by key */\r\n DocReference.compareByTargetId = function (left, right) {\r\n return (primitiveComparator(left.targetOrBatchId, right.targetOrBatchId) ||\r\n DocumentKey.comparator(left.key, right.key));\r\n };\r\n return DocReference;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\r\n * It can be used to batch up a set of changes to be written to the cache, but\r\n * additionally supports reading entries back with the `getEntry()` method,\r\n * falling back to the underlying RemoteDocumentCache if no entry is\r\n * buffered.\r\n *\r\n * NOTE: This class was introduced in iOS to work around a limitation in\r\n * LevelDB. Given IndexedDb has full transaction support with\r\n * read-your-own-writes capability, this class is not technically needed, but\r\n * has been preserved as a convenience and to aid portability.\r\n */\r\nvar RemoteDocumentChangeBuffer = /** @class */ (function () {\r\n function RemoteDocumentChangeBuffer(remoteDocumentCache) {\r\n this.remoteDocumentCache = remoteDocumentCache;\r\n this.changes = maybeDocumentMap();\r\n }\r\n /** Buffers a `RemoteDocumentCache.addEntry()` call. */\r\n RemoteDocumentChangeBuffer.prototype.addEntry = function (maybeDocument) {\r\n var changes = this.assertChanges();\r\n this.changes = changes.insert(maybeDocument.key, maybeDocument);\r\n };\r\n // NOTE: removeEntry() is not presently necessary and so is omitted.\r\n /**\r\n * Looks up an entry in the cache. The buffered changes will first be checked,\r\n * and if no buffered change applies, this will forward to\r\n * `RemoteDocumentCache.getEntry()`.\r\n *\r\n * @param transaction The transaction in which to perform any persistence\r\n * operations.\r\n * @param documentKey The key of the entry to look up.\r\n * @return The cached Document or NoDocument entry, or null if we have nothing\r\n * cached.\r\n */\r\n RemoteDocumentChangeBuffer.prototype.getEntry = function (transaction, documentKey) {\r\n var changes = this.assertChanges();\r\n var bufferedEntry = changes.get(documentKey);\r\n if (bufferedEntry) {\r\n return PersistencePromise.resolve(bufferedEntry);\r\n }\r\n else {\r\n return this.remoteDocumentCache.getEntry(transaction, documentKey);\r\n }\r\n };\r\n /**\r\n * Applies buffered changes to the underlying RemoteDocumentCache, using\r\n * the provided transaction.\r\n */\r\n RemoteDocumentChangeBuffer.prototype.apply = function (transaction) {\r\n var docs = [];\r\n var changes = this.assertChanges();\r\n changes.forEach(function (key, maybeDoc) {\r\n docs.push(maybeDoc);\r\n });\r\n // We should not buffer any more changes.\r\n this.changes = null;\r\n return this.remoteDocumentCache.addEntries(transaction, docs);\r\n };\r\n /** Helper to assert this.changes is not null and return it. */\r\n RemoteDocumentChangeBuffer.prototype.assertChanges = function () {\r\n assert(this.changes !== null, 'Changes have already been applied.');\r\n return this.changes;\r\n };\r\n return RemoteDocumentChangeBuffer;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$3 = 'LocalStore';\r\n/**\r\n * Local storage in the Firestore client. Coordinates persistence components\r\n * like the mutation queue and remote document cache to present a\r\n * latency-compensated view of stored data.\r\n *\r\n * The LocalStore is responsible for accepting mutations from the Sync Engine.\r\n * Writes from the client are put into a queue as provisional Mutations until\r\n * they are processed by the RemoteStore and confirmed as having been written\r\n * to the server.\r\n *\r\n * The local store provides the local version of documents that have been\r\n * modified locally. It maintains the constraint:\r\n *\r\n * LocalDocument = RemoteDocument + Active(LocalMutations)\r\n *\r\n * (Active mutations are those that are enqueued and have not been previously\r\n * acknowledged or rejected).\r\n *\r\n * The RemoteDocument (\"ground truth\") state is provided via the\r\n * applyChangeBatch method. It will be some version of a server-provided\r\n * document OR will be a server-provided document PLUS acknowledged mutations:\r\n *\r\n * RemoteDocument' = RemoteDocument + Acknowledged(LocalMutations)\r\n *\r\n * Note that this \"dirty\" version of a RemoteDocument will not be identical to a\r\n * server base version, since it has LocalMutations added to it pending getting\r\n * an authoritative copy from the server.\r\n *\r\n * Since LocalMutations can be rejected by the server, we have to be able to\r\n * revert a LocalMutation that has already been applied to the LocalDocument\r\n * (typically done by replaying all remaining LocalMutations to the\r\n * RemoteDocument to re-apply).\r\n *\r\n * The LocalStore is responsible for the garbage collection of the documents it\r\n * contains. For now, it every doc referenced by a view, the mutation queue, or\r\n * the RemoteStore.\r\n *\r\n * It also maintains the persistence of mapping queries to resume tokens and\r\n * target ids. It needs to know this data about queries to properly know what\r\n * docs it would be allowed to garbage collect.\r\n *\r\n * The LocalStore must be able to efficiently execute queries against its local\r\n * cache of the documents, to provide the initial set of results before any\r\n * remote changes have been received.\r\n *\r\n * Note: In TypeScript, most methods return Promises since the implementation\r\n * may rely on fetching data from IndexedDB which is async.\r\n * These Promises will only be rejected on an I/O error or other internal\r\n * (unexpected) failure (e.g. failed assert) and always represent an\r\n * unrecoverable error (should be caught / reported by the async_queue).\r\n */\r\nvar LocalStore = /** @class */ (function () {\r\n function LocalStore(\r\n /** Manages our in-memory or durable persistence. */\r\n persistence, initialUser) {\r\n this.persistence = persistence;\r\n /**\r\n * The set of document references maintained by any local views.\r\n */\r\n this.localViewReferences = new ReferenceSet();\r\n /** Maps a targetID to data about its query. */\r\n this.queryDataByTarget = {};\r\n assert(persistence.started, 'LocalStore was passed an unstarted persistence implementation');\r\n this.persistence.referenceDelegate.setInMemoryPins(this.localViewReferences);\r\n this.mutationQueue = persistence.getMutationQueue(initialUser);\r\n this.remoteDocuments = persistence.getRemoteDocumentCache();\r\n this.queryCache = persistence.getQueryCache();\r\n this.localDocuments = new LocalDocumentsView(this.remoteDocuments, this.mutationQueue);\r\n }\r\n /**\r\n * Tells the LocalStore that the currently authenticated user has changed.\r\n *\r\n * In response the local store switches the mutation queue to the new user and\r\n * returns any resulting document changes.\r\n */\r\n LocalStore.prototype.handleUserChange = function (user) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Handle user change', 'readonly', function (txn) {\r\n // Swap out the mutation queue, grabbing the pending mutation batches\r\n // before and after.\r\n var oldBatches;\r\n return _this.mutationQueue\r\n .getAllMutationBatches(txn)\r\n .next(function (promisedOldBatches) {\r\n oldBatches = promisedOldBatches;\r\n _this.mutationQueue = _this.persistence.getMutationQueue(user);\r\n // Recreate our LocalDocumentsView using the new\r\n // MutationQueue.\r\n _this.localDocuments = new LocalDocumentsView(_this.remoteDocuments, _this.mutationQueue);\r\n return _this.mutationQueue.getAllMutationBatches(txn);\r\n })\r\n .next(function (newBatches) {\r\n var removedBatchIds = [];\r\n var addedBatchIds = [];\r\n // Union the old/new changed keys.\r\n var changedKeys = documentKeySet();\r\n for (var _i = 0, oldBatches_1 = oldBatches; _i < oldBatches_1.length; _i++) {\r\n var batch = oldBatches_1[_i];\r\n removedBatchIds.push(batch.batchId);\r\n for (var _a = 0, _b = batch.mutations; _a < _b.length; _a++) {\r\n var mutation = _b[_a];\r\n changedKeys = changedKeys.add(mutation.key);\r\n }\r\n }\r\n for (var _c = 0, newBatches_1 = newBatches; _c < newBatches_1.length; _c++) {\r\n var batch = newBatches_1[_c];\r\n addedBatchIds.push(batch.batchId);\r\n for (var _d = 0, _e = batch.mutations; _d < _e.length; _d++) {\r\n var mutation = _e[_d];\r\n changedKeys = changedKeys.add(mutation.key);\r\n }\r\n }\r\n // Return the set of all (potentially) changed documents and the list\r\n // of mutation batch IDs that were affected by change.\r\n return _this.localDocuments\r\n .getDocuments(txn, changedKeys)\r\n .next(function (affectedDocuments) {\r\n return {\r\n affectedDocuments: affectedDocuments,\r\n removedBatchIds: removedBatchIds,\r\n addedBatchIds: addedBatchIds\r\n };\r\n });\r\n });\r\n });\r\n };\r\n /* Accept locally generated Mutations and commit them to storage. */\r\n LocalStore.prototype.localWrite = function (mutations) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Locally write mutations', 'readwrite', function (txn) {\r\n var batch;\r\n var localWriteTime = Timestamp.now();\r\n return _this.mutationQueue\r\n .addMutationBatch(txn, localWriteTime, mutations)\r\n .next(function (promisedBatch) {\r\n batch = promisedBatch;\r\n // TODO(koss): This is doing an N^2 update by replaying ALL the\r\n // mutations on each document (instead of just the ones added) in\r\n // this batch.\r\n var keys = batch.keys();\r\n return _this.localDocuments.getDocuments(txn, keys);\r\n })\r\n .next(function (changedDocuments) {\r\n return { batchId: batch.batchId, changes: changedDocuments };\r\n });\r\n });\r\n };\r\n /** Returns the local view of the documents affected by a mutation batch. */\r\n // PORTING NOTE: Multi-tab only.\r\n LocalStore.prototype.lookupMutationDocuments = function (batchId) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Lookup mutation documents', 'readonly', function (txn) {\r\n return _this.mutationQueue\r\n .lookupMutationKeys(txn, batchId)\r\n .next(function (keys) {\r\n if (keys) {\r\n return _this.localDocuments.getDocuments(txn, keys);\r\n }\r\n else {\r\n return PersistencePromise.resolve(null);\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Acknowledge the given batch.\r\n *\r\n * On the happy path when a batch is acknowledged, the local store will\r\n *\r\n * + remove the batch from the mutation queue;\r\n * + apply the changes to the remote document cache;\r\n * + recalculate the latency compensated view implied by those changes (there\r\n * may be mutations in the queue that affect the documents but haven't been\r\n * acknowledged yet); and\r\n * + give the changed documents back the sync engine\r\n *\r\n * @returns The resulting (modified) documents.\r\n */\r\n LocalStore.prototype.acknowledgeBatch = function (batchResult) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Acknowledge batch', 'readwrite-primary', function (txn) {\r\n var affected = batchResult.batch.keys();\r\n var documentBuffer = new RemoteDocumentChangeBuffer(_this.remoteDocuments);\r\n return _this.mutationQueue\r\n .acknowledgeBatch(txn, batchResult.batch, batchResult.streamToken)\r\n .next(function () {\r\n return _this.applyWriteToRemoteDocuments(txn, batchResult, documentBuffer);\r\n })\r\n .next(function () { return documentBuffer.apply(txn); })\r\n .next(function () { return _this.mutationQueue.performConsistencyCheck(txn); })\r\n .next(function () { return _this.localDocuments.getDocuments(txn, affected); });\r\n });\r\n };\r\n /**\r\n * Remove mutations from the MutationQueue for the specified batch;\r\n * LocalDocuments will be recalculated.\r\n *\r\n * @returns The resulting modified documents.\r\n */\r\n LocalStore.prototype.rejectBatch = function (batchId) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Reject batch', 'readwrite-primary', function (txn) {\r\n var affectedKeys;\r\n return _this.mutationQueue\r\n .lookupMutationBatch(txn, batchId)\r\n .next(function (batch) {\r\n assert(batch !== null, 'Attempt to reject nonexistent batch!');\r\n affectedKeys = batch.keys();\r\n return _this.mutationQueue.removeMutationBatch(txn, batch);\r\n })\r\n .next(function () {\r\n return _this.mutationQueue.performConsistencyCheck(txn);\r\n })\r\n .next(function () {\r\n return _this.localDocuments.getDocuments(txn, affectedKeys);\r\n });\r\n });\r\n };\r\n /** Returns the last recorded stream token for the current user. */\r\n LocalStore.prototype.getLastStreamToken = function () {\r\n var _this = this;\r\n return this.persistence.runTransaction('Get last stream token', 'readonly', function (txn) {\r\n return _this.mutationQueue.getLastStreamToken(txn);\r\n });\r\n };\r\n /**\r\n * Sets the stream token for the current user without acknowledging any\r\n * mutation batch. This is usually only useful after a stream handshake or in\r\n * response to an error that requires clearing the stream token.\r\n */\r\n LocalStore.prototype.setLastStreamToken = function (streamToken) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Set last stream token', 'readwrite-primary', function (txn) {\r\n return _this.mutationQueue.setLastStreamToken(txn, streamToken);\r\n });\r\n };\r\n /**\r\n * Returns the last consistent snapshot processed (used by the RemoteStore to\r\n * determine whether to buffer incoming snapshots from the backend).\r\n */\r\n LocalStore.prototype.getLastRemoteSnapshotVersion = function () {\r\n var _this = this;\r\n return this.persistence.runTransaction('Get last remote snapshot version', 'readonly', function (txn) { return _this.queryCache.getLastRemoteSnapshotVersion(txn); });\r\n };\r\n /**\r\n * Update the \"ground-state\" (remote) documents. We assume that the remote\r\n * event reflects any write batches that have been acknowledged or rejected\r\n * (i.e. we do not re-apply local mutations to updates from this event).\r\n *\r\n * LocalDocuments are re-calculated if there are remaining mutations in the\r\n * queue.\r\n */\r\n LocalStore.prototype.applyRemoteEvent = function (remoteEvent) {\r\n var _this = this;\r\n var documentBuffer = new RemoteDocumentChangeBuffer(this.remoteDocuments);\r\n return this.persistence.runTransaction('Apply remote event', 'readwrite-primary', function (txn) {\r\n var promises = [];\r\n var authoritativeUpdates = documentKeySet();\r\n forEachNumber(remoteEvent.targetChanges, function (targetId, change) {\r\n // Do not ref/unref unassigned targetIds - it may lead to leaks.\r\n var queryData = _this.queryDataByTarget[targetId];\r\n if (!queryData)\r\n return;\r\n // When a global snapshot contains updates (either add or modify) we\r\n // can completely trust these updates as authoritative and blindly\r\n // apply them to our cache (as a defensive measure to promote\r\n // self-healing in the unfortunate case that our cache is ever somehow\r\n // corrupted / out-of-sync).\r\n //\r\n // If the document is only updated while removing it from a target\r\n // then watch isn't obligated to send the absolute latest version: it\r\n // can send the first version that caused the document not to match.\r\n change.addedDocuments.forEach(function (key) {\r\n authoritativeUpdates = authoritativeUpdates.add(key);\r\n });\r\n change.modifiedDocuments.forEach(function (key) {\r\n authoritativeUpdates = authoritativeUpdates.add(key);\r\n });\r\n promises.push(_this.queryCache\r\n .removeMatchingKeys(txn, change.removedDocuments, targetId)\r\n .next(function () {\r\n return _this.queryCache.addMatchingKeys(txn, change.addedDocuments, targetId);\r\n }));\r\n // Update the resume token if the change includes one. Don't clear\r\n // any preexisting value.\r\n var resumeToken = change.resumeToken;\r\n if (resumeToken.length > 0) {\r\n var oldQueryData = queryData;\r\n queryData = queryData.copy({\r\n resumeToken: resumeToken,\r\n snapshotVersion: remoteEvent.snapshotVersion\r\n });\r\n _this.queryDataByTarget[targetId] = queryData;\r\n if (LocalStore.shouldPersistQueryData(oldQueryData, queryData, change)) {\r\n promises.push(_this.queryCache.updateQueryData(txn, queryData));\r\n }\r\n }\r\n });\r\n var changedDocKeys = documentKeySet();\r\n remoteEvent.documentUpdates.forEach(function (key, doc) {\r\n changedDocKeys = changedDocKeys.add(key);\r\n promises.push(documentBuffer.getEntry(txn, key).next(function (existingDoc) {\r\n // If a document update isn't authoritative, make sure we don't\r\n // apply an old document version to the remote cache. We make an\r\n // exception for SnapshotVersion.MIN which can happen for\r\n // manufactured events (e.g. in the case of a limbo document\r\n // resolution failing).\r\n if (existingDoc == null ||\r\n doc.version.isEqual(SnapshotVersion.MIN) ||\r\n (authoritativeUpdates.has(doc.key) &&\r\n !existingDoc.hasPendingWrites) ||\r\n doc.version.compareTo(existingDoc.version) >= 0) {\r\n documentBuffer.addEntry(doc);\r\n }\r\n else {\r\n debug(LOG_TAG$3, 'Ignoring outdated watch update for ', key, '. Current version:', existingDoc.version, ' Watch version:', doc.version);\r\n }\r\n }));\r\n if (remoteEvent.resolvedLimboDocuments.has(key)) {\r\n promises.push(_this.persistence.referenceDelegate.updateLimboDocument(txn, key));\r\n }\r\n });\r\n // HACK: The only reason we allow a null snapshot version is so that we\r\n // can synthesize remote events when we get permission denied errors while\r\n // trying to resolve the state of a locally cached document that is in\r\n // limbo.\r\n var remoteVersion = remoteEvent.snapshotVersion;\r\n if (!remoteVersion.isEqual(SnapshotVersion.MIN)) {\r\n var updateRemoteVersion = _this.queryCache\r\n .getLastRemoteSnapshotVersion(txn)\r\n .next(function (lastRemoteVersion) {\r\n assert(remoteVersion.compareTo(lastRemoteVersion) >= 0, 'Watch stream reverted to previous snapshot?? ' +\r\n remoteVersion +\r\n ' < ' +\r\n lastRemoteVersion);\r\n return _this.queryCache.setTargetsMetadata(txn, txn.currentSequenceNumber, remoteVersion);\r\n });\r\n promises.push(updateRemoteVersion);\r\n }\r\n return PersistencePromise.waitFor(promises)\r\n .next(function () { return documentBuffer.apply(txn); })\r\n .next(function () {\r\n return _this.localDocuments.getDocuments(txn, changedDocKeys);\r\n });\r\n });\r\n };\r\n /**\r\n * Returns true if the newQueryData should be persisted during an update of\r\n * an active target. QueryData should always be persisted when a target is\r\n * being released and should not call this function.\r\n *\r\n * While the target is active, QueryData updates can be omitted when nothing\r\n * about the target has changed except metadata like the resume token or\r\n * snapshot version. Occasionally it's worth the extra write to prevent these\r\n * values from getting too stale after a crash, but this doesn't have to be\r\n * too frequent.\r\n */\r\n LocalStore.shouldPersistQueryData = function (oldQueryData, newQueryData, change) {\r\n // Avoid clearing any existing value\r\n if (newQueryData.resumeToken.length === 0)\r\n return false;\r\n // Any resume token is interesting if there isn't one already.\r\n if (oldQueryData.resumeToken.length === 0)\r\n return true;\r\n // Don't allow resume token changes to be buffered indefinitely. This\r\n // allows us to be reasonably up-to-date after a crash and avoids needing\r\n // to loop over all active queries on shutdown. Especially in the browser\r\n // we may not get time to do anything interesting while the current tab is\r\n // closing.\r\n var timeDelta = newQueryData.snapshotVersion.toMicroseconds() -\r\n oldQueryData.snapshotVersion.toMicroseconds();\r\n if (timeDelta >= this.RESUME_TOKEN_MAX_AGE_MICROS)\r\n return true;\r\n // Otherwise if the only thing that has changed about a target is its resume\r\n // token it's not worth persisting. Note that the RemoteStore keeps an\r\n // in-memory view of the currently active targets which includes the current\r\n // resume token, so stream failure or user changes will still use an\r\n // up-to-date resume token regardless of what we do here.\r\n var changes = change.addedDocuments.size +\r\n change.modifiedDocuments.size +\r\n change.removedDocuments.size;\r\n return changes > 0;\r\n };\r\n /**\r\n * Notify local store of the changed views to locally pin documents.\r\n */\r\n LocalStore.prototype.notifyLocalViewChanges = function (viewChanges) {\r\n var _this = this;\r\n return this.persistence.runTransaction('notifyLocalViewChanges', 'readwrite', function (txn) {\r\n return PersistencePromise.forEach(viewChanges, function (viewChange) {\r\n _this.localViewReferences.addReferences(viewChange.addedKeys, viewChange.targetId);\r\n _this.localViewReferences.removeReferences(viewChange.removedKeys, viewChange.targetId);\r\n return PersistencePromise.forEach(viewChange.removedKeys, function (key) {\r\n return _this.persistence.referenceDelegate.removeReference(txn, key);\r\n });\r\n });\r\n });\r\n };\r\n /**\r\n * Gets the mutation batch after the passed in batchId in the mutation queue\r\n * or null if empty.\r\n * @param afterBatchId If provided, the batch to search after.\r\n * @returns The next mutation or null if there wasn't one.\r\n */\r\n LocalStore.prototype.nextMutationBatch = function (afterBatchId) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Get next mutation batch', 'readonly', function (txn) {\r\n if (afterBatchId === undefined) {\r\n afterBatchId = BATCHID_UNKNOWN;\r\n }\r\n return _this.mutationQueue.getNextMutationBatchAfterBatchId(txn, afterBatchId);\r\n });\r\n };\r\n /**\r\n * Read the current value of a Document with a given key or null if not\r\n * found - used for testing.\r\n */\r\n LocalStore.prototype.readDocument = function (key) {\r\n var _this = this;\r\n return this.persistence.runTransaction('read document', 'readonly', function (txn) {\r\n return _this.localDocuments.getDocument(txn, key);\r\n });\r\n };\r\n /**\r\n * Assigns the given query an internal ID so that its results can be pinned so\r\n * they don't get GC'd. A query must be allocated in the local store before\r\n * the store can be used to manage its view.\r\n */\r\n LocalStore.prototype.allocateQuery = function (query) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Allocate query', 'readwrite', function (txn) {\r\n var queryData;\r\n return _this.queryCache\r\n .getQueryData(txn, query)\r\n .next(function (cached) {\r\n if (cached) {\r\n // This query has been listened to previously, so reuse the\r\n // previous targetID.\r\n // TODO(mcg): freshen last accessed date?\r\n queryData = cached;\r\n return PersistencePromise.resolve();\r\n }\r\n else {\r\n return _this.queryCache.allocateTargetId(txn).next(function (targetId) {\r\n queryData = new QueryData(query, targetId, QueryPurpose.Listen, txn.currentSequenceNumber);\r\n return _this.queryCache.addQueryData(txn, queryData);\r\n });\r\n }\r\n })\r\n .next(function () {\r\n assert(!_this.queryDataByTarget[queryData.targetId], 'Tried to allocate an already allocated query: ' + query);\r\n _this.queryDataByTarget[queryData.targetId] = queryData;\r\n return queryData;\r\n });\r\n });\r\n };\r\n /**\r\n * Unpin all the documents associated with the given query. If\r\n * `keepPersistedQueryData` is set to false and Eager GC enabled, the method\r\n * directly removes the associated query data from the query cache.\r\n */\r\n // PORTING NOTE: `keepPersistedQueryData` is multi-tab only.\r\n LocalStore.prototype.releaseQuery = function (query, keepPersistedQueryData) {\r\n var _this = this;\r\n var mode = keepPersistedQueryData ? 'readwrite' : 'readwrite-primary';\r\n return this.persistence.runTransaction('Release query', mode, function (txn) {\r\n return _this.queryCache\r\n .getQueryData(txn, query)\r\n .next(function (queryData) {\r\n assert(queryData != null, 'Tried to release nonexistent query: ' + query);\r\n var targetId = queryData.targetId;\r\n var cachedQueryData = _this.queryDataByTarget[targetId];\r\n // References for documents sent via Watch are automatically removed when we delete a\r\n // query's target data from the reference delegate. Since this does not remove references\r\n // for locally mutated documents, we have to remove the target associations for these\r\n // documents manually.\r\n var removed = _this.localViewReferences.removeReferencesForId(targetId);\r\n delete _this.queryDataByTarget[targetId];\r\n if (!keepPersistedQueryData) {\r\n return PersistencePromise.forEach(removed, function (key) {\r\n return _this.persistence.referenceDelegate.removeReference(txn, key);\r\n }).next(function () {\r\n return _this.persistence.referenceDelegate.removeTarget(txn, cachedQueryData);\r\n });\r\n }\r\n else {\r\n return PersistencePromise.resolve();\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Runs the specified query against all the documents in the local store and\r\n * returns the results.\r\n */\r\n LocalStore.prototype.executeQuery = function (query) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Execute query', 'readonly', function (txn) {\r\n return _this.localDocuments.getDocumentsMatchingQuery(txn, query);\r\n });\r\n };\r\n /**\r\n * Returns the keys of the documents that are associated with the given\r\n * target id in the remote table.\r\n */\r\n LocalStore.prototype.remoteDocumentKeys = function (targetId) {\r\n var _this = this;\r\n return this.persistence.runTransaction('Remote document keys', 'readonly', function (txn) {\r\n return _this.queryCache.getMatchingKeysForTargetId(txn, targetId);\r\n });\r\n };\r\n // PORTING NOTE: Multi-tab only.\r\n LocalStore.prototype.getActiveClients = function () {\r\n return this.persistence.getActiveClients();\r\n };\r\n // PORTING NOTE: Multi-tab only.\r\n LocalStore.prototype.removeCachedMutationBatchMetadata = function (batchId) {\r\n this.mutationQueue.removeCachedMutationKeys(batchId);\r\n };\r\n // PORTING NOTE: Multi-tab only.\r\n LocalStore.prototype.setNetworkEnabled = function (networkEnabled) {\r\n this.persistence.setNetworkEnabled(networkEnabled);\r\n };\r\n LocalStore.prototype.applyWriteToRemoteDocuments = function (txn, batchResult, documentBuffer) {\r\n var _this = this;\r\n var batch = batchResult.batch;\r\n var docKeys = batch.keys();\r\n var promiseChain = PersistencePromise.resolve();\r\n docKeys.forEach(function (docKey) {\r\n promiseChain = promiseChain\r\n .next(function () {\r\n return documentBuffer.getEntry(txn, docKey);\r\n })\r\n .next(function (remoteDoc) {\r\n var doc = remoteDoc;\r\n var ackVersion = batchResult.docVersions.get(docKey);\r\n assert(ackVersion !== null, 'ackVersions should contain every doc in the write.');\r\n if (!doc || doc.version.compareTo(ackVersion) < 0) {\r\n doc = batch.applyToRemoteDocument(docKey, doc, batchResult);\r\n if (!doc) {\r\n assert(!remoteDoc, 'Mutation batch ' +\r\n batch +\r\n ' applied to document ' +\r\n remoteDoc +\r\n ' resulted in null');\r\n }\r\n else {\r\n documentBuffer.addEntry(doc);\r\n }\r\n }\r\n });\r\n });\r\n return promiseChain.next(function () {\r\n return _this.mutationQueue.removeMutationBatch(txn, batch);\r\n });\r\n };\r\n // PORTING NOTE: Multi-tab only.\r\n LocalStore.prototype.getQueryForTarget = function (targetId) {\r\n var _this = this;\r\n if (this.queryDataByTarget[targetId]) {\r\n return Promise.resolve(this.queryDataByTarget[targetId].query);\r\n }\r\n else {\r\n return this.persistence.runTransaction('Get query data', 'readonly', function (txn) {\r\n return _this.queryCache\r\n .getQueryDataForTarget(txn, targetId)\r\n .next(function (queryData) { return (queryData ? queryData.query : null); });\r\n });\r\n }\r\n };\r\n // PORTING NOTE: Multi-tab only.\r\n LocalStore.prototype.getNewDocumentChanges = function () {\r\n var _this = this;\r\n return this.persistence.runTransaction('Get new document changes', 'readonly', function (txn) {\r\n return _this.remoteDocuments.getNewDocumentChanges(txn);\r\n });\r\n };\r\n /**\r\n * The maximum time to leave a resume token buffered without writing it out.\r\n * This value is arbitrary: it's long enough to avoid several writes\r\n * (possibly indefinitely if updates come more frequently than this) but\r\n * short enough that restarting after crashing will still have a pretty\r\n * recent resume token.\r\n */\r\n LocalStore.RESUME_TOKEN_MAX_AGE_MICROS = 5 * 60 * 1e6;\r\n return LocalStore;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A map implementation that uses objects as keys. Objects must implement the\r\n * Equatable interface and must be immutable. Entries in the map are stored\r\n * together with the key being produced from the mapKeyFn. This map\r\n * automatically handles collisions of keys.\r\n */\r\nvar ObjectMap = /** @class */ (function () {\r\n function ObjectMap(mapKeyFn) {\r\n this.mapKeyFn = mapKeyFn;\r\n /**\r\n * The inner map for a key -> value pair. Due to the possibility of\r\n * collisions we keep a list of entries that we do a linear search through\r\n * to find an actual match. Note that collisions should be rare, so we still\r\n * expect near constant time lookups in practice.\r\n */\r\n this.inner = {};\r\n }\r\n /** Get a value for this key, or undefined if it does not exist. */\r\n ObjectMap.prototype.get = function (key) {\r\n var id = this.mapKeyFn(key);\r\n var matches = this.inner[id];\r\n if (matches === undefined) {\r\n return undefined;\r\n }\r\n for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) {\r\n var _a = matches_1[_i], otherKey = _a[0], value = _a[1];\r\n if (otherKey.isEqual(key)) {\r\n return value;\r\n }\r\n }\r\n return undefined;\r\n };\r\n ObjectMap.prototype.has = function (key) {\r\n return this.get(key) !== undefined;\r\n };\r\n /** Put this key and value in the map. */\r\n ObjectMap.prototype.set = function (key, value) {\r\n var id = this.mapKeyFn(key);\r\n var matches = this.inner[id];\r\n if (matches === undefined) {\r\n this.inner[id] = [[key, value]];\r\n return;\r\n }\r\n for (var i = 0; i < matches.length; i++) {\r\n if (matches[i][0].isEqual(key)) {\r\n matches[i] = [key, value];\r\n return;\r\n }\r\n }\r\n matches.push([key, value]);\r\n };\r\n /**\r\n * Remove this key from the map. Returns a boolean if anything was deleted.\r\n */\r\n ObjectMap.prototype.delete = function (key) {\r\n var id = this.mapKeyFn(key);\r\n var matches = this.inner[id];\r\n if (matches === undefined) {\r\n return false;\r\n }\r\n for (var i = 0; i < matches.length; i++) {\r\n if (matches[i][0].isEqual(key)) {\r\n if (matches.length === 1) {\r\n delete this.inner[id];\r\n }\r\n else {\r\n matches.splice(i, 1);\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n ObjectMap.prototype.forEach = function (fn) {\r\n forEach(this.inner, function (_, entries) {\r\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\r\n var _a = entries_1[_i], k = _a[0], v = _a[1];\r\n fn(k, v);\r\n }\r\n });\r\n };\r\n ObjectMap.prototype.isEmpty = function () {\r\n return isEmpty(this.inner);\r\n };\r\n ObjectMap.prototype[Symbol.iterator] = function () {\r\n // We don't care about the keys, all of the actual keys are in the\r\n // arrays that are the values of the inner object.\r\n var entries = [];\r\n this.forEach(function (key, value) { return entries.push({ key: key, value: value }); });\r\n return entries[Symbol.iterator]();\r\n };\r\n return ObjectMap;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MemoryMutationQueue = /** @class */ (function () {\r\n function MemoryMutationQueue(referenceDelegate) {\r\n this.referenceDelegate = referenceDelegate;\r\n /**\r\n * The set of all mutations that have been sent but not yet been applied to\r\n * the backend.\r\n */\r\n this.mutationQueue = [];\r\n /** Next value to use when assigning sequential IDs to each mutation batch. */\r\n this.nextBatchId = 1;\r\n /** The highest acknowledged mutation in the queue. */\r\n this.highestAcknowledgedBatchId = BATCHID_UNKNOWN;\r\n /** The last received stream token from the server, used to acknowledge which\r\n * responses the client has processed. Stream tokens are opaque checkpoint\r\n * markers whose only real value is their inclusion in the next request.\r\n */\r\n this.lastStreamToken = emptyByteString();\r\n /** An ordered mapping between documents and the mutations batch IDs. */\r\n this.batchesByDocumentKey = new SortedSet(DocReference.compareByKey);\r\n }\r\n MemoryMutationQueue.prototype.checkEmpty = function (transaction) {\r\n return PersistencePromise.resolve(this.mutationQueue.length === 0);\r\n };\r\n MemoryMutationQueue.prototype.acknowledgeBatch = function (transaction, batch, streamToken) {\r\n var batchId = batch.batchId;\r\n assert(batchId > this.highestAcknowledgedBatchId, 'Mutation batchIDs must be acknowledged in order');\r\n var batchIndex = this.indexOfExistingBatchId(batchId, 'acknowledged');\r\n // Verify that the batch in the queue is the one to be acknowledged.\r\n var check = this.mutationQueue[batchIndex];\r\n assert(batchId === check.batchId, 'Queue ordering failure: expected batch ' +\r\n batchId +\r\n ', got batch ' +\r\n check.batchId);\r\n assert(!check.isTombstone(), \"Can't acknowledge a previously removed batch\");\r\n this.highestAcknowledgedBatchId = batchId;\r\n this.lastStreamToken = streamToken;\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryMutationQueue.prototype.getLastStreamToken = function (transaction) {\r\n return PersistencePromise.resolve(this.lastStreamToken);\r\n };\r\n MemoryMutationQueue.prototype.setLastStreamToken = function (transaction, streamToken) {\r\n this.lastStreamToken = streamToken;\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryMutationQueue.prototype.addMutationBatch = function (transaction, localWriteTime, mutations) {\r\n assert(mutations.length !== 0, 'Mutation batches should not be empty');\r\n var batchId = this.nextBatchId;\r\n this.nextBatchId++;\r\n if (this.mutationQueue.length > 0) {\r\n var prior = this.mutationQueue[this.mutationQueue.length - 1];\r\n assert(prior.batchId < batchId, 'Mutation batchIDs must be monotonically increasing order');\r\n }\r\n var batch = new MutationBatch(batchId, localWriteTime, mutations);\r\n this.mutationQueue.push(batch);\r\n // Track references by document key.\r\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\r\n var mutation = mutations_1[_i];\r\n this.batchesByDocumentKey = this.batchesByDocumentKey.add(new DocReference(mutation.key, batchId));\r\n }\r\n return PersistencePromise.resolve(batch);\r\n };\r\n MemoryMutationQueue.prototype.lookupMutationBatch = function (transaction, batchId) {\r\n return PersistencePromise.resolve(this.findMutationBatch(batchId));\r\n };\r\n MemoryMutationQueue.prototype.lookupMutationKeys = function (transaction, batchId) {\r\n var mutationBatch = this.findMutationBatch(batchId);\r\n assert(mutationBatch != null, 'Failed to find local mutation batch.');\r\n return PersistencePromise.resolve(!mutationBatch.isTombstone() ? mutationBatch.keys() : null);\r\n };\r\n MemoryMutationQueue.prototype.getNextMutationBatchAfterBatchId = function (transaction, batchId) {\r\n var size = this.mutationQueue.length;\r\n // All batches with batchId <= this.highestAcknowledgedBatchId have been\r\n // acknowledged so the first unacknowledged batch after batchID will have a\r\n // batchID larger than both of these values.\r\n var nextBatchId = Math.max(batchId, this.highestAcknowledgedBatchId) + 1;\r\n // The requested batchId may still be out of range so normalize it to the\r\n // start of the queue.\r\n var rawIndex = this.indexOfBatchId(nextBatchId);\r\n var index = rawIndex < 0 ? 0 : rawIndex;\r\n // Finally return the first non-tombstone batch.\r\n for (; index < size; index++) {\r\n var batch = this.mutationQueue[index];\r\n if (!batch.isTombstone()) {\r\n return PersistencePromise.resolve(batch);\r\n }\r\n }\r\n return PersistencePromise.resolve(null);\r\n };\r\n MemoryMutationQueue.prototype.getAllMutationBatches = function (transaction) {\r\n return PersistencePromise.resolve(this.getAllLiveMutationBatchesBeforeIndex(this.mutationQueue.length));\r\n };\r\n MemoryMutationQueue.prototype.getAllMutationBatchesAffectingDocumentKey = function (transaction, documentKey) {\r\n var _this = this;\r\n var start = new DocReference(documentKey, 0);\r\n var end = new DocReference(documentKey, Number.POSITIVE_INFINITY);\r\n var result = [];\r\n this.batchesByDocumentKey.forEachInRange([start, end], function (ref) {\r\n assert(documentKey.isEqual(ref.key), \"Should only iterate over a single key's batches\");\r\n var batch = _this.findMutationBatch(ref.targetOrBatchId);\r\n assert(batch !== null, 'Batches in the index must exist in the main table');\r\n result.push(batch);\r\n });\r\n return PersistencePromise.resolve(result);\r\n };\r\n MemoryMutationQueue.prototype.getAllMutationBatchesAffectingDocumentKeys = function (transaction, documentKeys) {\r\n var _this = this;\r\n var uniqueBatchIDs = new SortedSet(primitiveComparator);\r\n documentKeys.forEach(function (documentKey) {\r\n var start = new DocReference(documentKey, 0);\r\n var end = new DocReference(documentKey, Number.POSITIVE_INFINITY);\r\n _this.batchesByDocumentKey.forEachInRange([start, end], function (ref) {\r\n assert(documentKey.isEqual(ref.key), \"For each key, should only iterate over a single key's batches\");\r\n uniqueBatchIDs = uniqueBatchIDs.add(ref.targetOrBatchId);\r\n });\r\n });\r\n return PersistencePromise.resolve(this.findMutationBatches(uniqueBatchIDs));\r\n };\r\n MemoryMutationQueue.prototype.getAllMutationBatchesAffectingQuery = function (transaction, query) {\r\n // Use the query path as a prefix for testing if a document matches the\r\n // query.\r\n var prefix = query.path;\r\n var immediateChildrenPathLength = prefix.length + 1;\r\n // Construct a document reference for actually scanning the index. Unlike\r\n // the prefix the document key in this reference must have an even number of\r\n // segments. The empty segment can be used a suffix of the query path\r\n // because it precedes all other segments in an ordered traversal.\r\n var startPath = prefix;\r\n if (!DocumentKey.isDocumentKey(startPath)) {\r\n startPath = startPath.child('');\r\n }\r\n var start = new DocReference(new DocumentKey(startPath), 0);\r\n // Find unique batchIDs referenced by all documents potentially matching the\r\n // query.\r\n var uniqueBatchIDs = new SortedSet(primitiveComparator);\r\n this.batchesByDocumentKey.forEachWhile(function (ref) {\r\n var rowKeyPath = ref.key.path;\r\n if (!prefix.isPrefixOf(rowKeyPath)) {\r\n return false;\r\n }\r\n else {\r\n // Rows with document keys more than one segment longer than the query\r\n // path can't be matches. For example, a query on 'rooms' can't match\r\n // the document /rooms/abc/messages/xyx.\r\n // TODO(mcg): we'll need a different scanner when we implement\r\n // ancestor queries.\r\n if (rowKeyPath.length === immediateChildrenPathLength) {\r\n uniqueBatchIDs = uniqueBatchIDs.add(ref.targetOrBatchId);\r\n }\r\n return true;\r\n }\r\n }, start);\r\n return PersistencePromise.resolve(this.findMutationBatches(uniqueBatchIDs));\r\n };\r\n MemoryMutationQueue.prototype.findMutationBatches = function (batchIDs) {\r\n var _this = this;\r\n // Construct an array of matching batches, sorted by batchID to ensure that\r\n // multiple mutations affecting the same document key are applied in order.\r\n var result = [];\r\n batchIDs.forEach(function (batchId) {\r\n var batch = _this.findMutationBatch(batchId);\r\n if (batch !== null) {\r\n result.push(batch);\r\n }\r\n });\r\n return result;\r\n };\r\n MemoryMutationQueue.prototype.removeMutationBatch = function (transaction, batch) {\r\n var _this = this;\r\n // Find the position of the first batch for removal. This need not be the\r\n // first entry in the queue.\r\n var batchIndex = this.indexOfExistingBatchId(batch.batchId, 'removed');\r\n assert(this.mutationQueue[batchIndex].batchId === batch.batchId, 'Removed batches must exist in the queue');\r\n // Only actually remove batches if removing at the front of the queue.\r\n // Previously rejected batches may have left tombstones in the queue, so\r\n // expand the removal range to include any tombstones.\r\n if (batchIndex === 0) {\r\n var endIndex = 1;\r\n for (; endIndex < this.mutationQueue.length; endIndex++) {\r\n var batch_1 = this.mutationQueue[endIndex];\r\n if (!batch_1.isTombstone()) {\r\n break;\r\n }\r\n }\r\n this.mutationQueue.splice(0, endIndex);\r\n }\r\n else {\r\n this.mutationQueue[batchIndex] = this.mutationQueue[batchIndex].toTombstone();\r\n }\r\n var references = this.batchesByDocumentKey;\r\n return PersistencePromise.forEach(batch.mutations, function (mutation) {\r\n var ref = new DocReference(mutation.key, batch.batchId);\r\n references = references.delete(ref);\r\n return _this.referenceDelegate.removeMutationReference(transaction, mutation.key);\r\n }).next(function () {\r\n _this.batchesByDocumentKey = references;\r\n });\r\n };\r\n MemoryMutationQueue.prototype.removeCachedMutationKeys = function (batchId) {\r\n // No-op since the memory mutation queue does not maintain a separate cache.\r\n };\r\n MemoryMutationQueue.prototype.containsKey = function (txn, key) {\r\n var ref = new DocReference(key, 0);\r\n var firstRef = this.batchesByDocumentKey.firstAfterOrEqual(ref);\r\n return PersistencePromise.resolve(key.isEqual(firstRef && firstRef.key));\r\n };\r\n MemoryMutationQueue.prototype.performConsistencyCheck = function (txn) {\r\n if (this.mutationQueue.length === 0) {\r\n assert(this.batchesByDocumentKey.isEmpty(), 'Document leak -- detected dangling mutation references when queue is empty.');\r\n }\r\n return PersistencePromise.resolve();\r\n };\r\n /**\r\n * A private helper that collects all the mutations batches in the queue up to\r\n * but not including the given endIndex. All tombstones in the queue are\r\n * excluded.\r\n */\r\n MemoryMutationQueue.prototype.getAllLiveMutationBatchesBeforeIndex = function (endIndex) {\r\n var result = [];\r\n for (var i = 0; i < endIndex; i++) {\r\n var batch = this.mutationQueue[i];\r\n if (!batch.isTombstone()) {\r\n result.push(batch);\r\n }\r\n }\r\n return result;\r\n };\r\n /**\r\n * Finds the index of the given batchId in the mutation queue and asserts that\r\n * the resulting index is within the bounds of the queue.\r\n *\r\n * @param batchId The batchId to search for\r\n * @param action A description of what the caller is doing, phrased in passive\r\n * form (e.g. \"acknowledged\" in a routine that acknowledges batches).\r\n */\r\n MemoryMutationQueue.prototype.indexOfExistingBatchId = function (batchId, action) {\r\n var index = this.indexOfBatchId(batchId);\r\n assert(index >= 0 && index < this.mutationQueue.length, 'Batches must exist to be ' + action);\r\n return index;\r\n };\r\n /**\r\n * Finds the index of the given batchId in the mutation queue. This operation\r\n * is O(1).\r\n *\r\n * @return The computed index of the batch with the given batchId, based on\r\n * the state of the queue. Note this index can be negative if the requested\r\n * batchId has already been remvoed from the queue or past the end of the\r\n * queue if the batchId is larger than the last added batch.\r\n */\r\n MemoryMutationQueue.prototype.indexOfBatchId = function (batchId) {\r\n if (this.mutationQueue.length === 0) {\r\n // As an index this is past the end of the queue\r\n return 0;\r\n }\r\n // Examine the front of the queue to figure out the difference between the\r\n // batchId and indexes in the array. Note that since the queue is ordered\r\n // by batchId, if the first batch has a larger batchId then the requested\r\n // batchId doesn't exist in the queue.\r\n var firstBatchId = this.mutationQueue[0].batchId;\r\n return batchId - firstBatchId;\r\n };\r\n /**\r\n * A version of lookupMutationBatch that doesn't return a promise, this makes\r\n * other functions that uses this code easier to read and more efficent.\r\n */\r\n MemoryMutationQueue.prototype.findMutationBatch = function (batchId) {\r\n var index = this.indexOfBatchId(batchId);\r\n if (index < 0 || index >= this.mutationQueue.length) {\r\n return null;\r\n }\r\n var batch = this.mutationQueue[index];\r\n assert(batch.batchId === batchId, 'If found batch must match');\r\n return batch.isTombstone() ? null : batch;\r\n };\r\n return MemoryMutationQueue;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MemoryQueryCache = /** @class */ (function () {\r\n function MemoryQueryCache(persistence) {\r\n this.persistence = persistence;\r\n /**\r\n * Maps a query to the data about that query\r\n */\r\n this.queries = new ObjectMap(function (q) { return q.canonicalId(); });\r\n /** The last received snapshot version. */\r\n this.lastRemoteSnapshotVersion = SnapshotVersion.MIN;\r\n /** The highest numbered target ID encountered. */\r\n this.highestTargetId = 0;\r\n /** The highest sequence number encountered. */\r\n this.highestSequenceNumber = 0;\r\n /**\r\n * A ordered bidirectional mapping between documents and the remote target\r\n * IDs.\r\n */\r\n this.references = new ReferenceSet();\r\n this.targetCount = 0;\r\n this.targetIdGenerator = TargetIdGenerator.forQueryCache();\r\n }\r\n MemoryQueryCache.prototype.getTargetCount = function (txn) {\r\n return PersistencePromise.resolve(this.targetCount);\r\n };\r\n MemoryQueryCache.prototype.forEachTarget = function (txn, f) {\r\n this.queries.forEach(function (_, queryData) { return f(queryData); });\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryQueryCache.prototype.getLastRemoteSnapshotVersion = function (transaction) {\r\n return PersistencePromise.resolve(this.lastRemoteSnapshotVersion);\r\n };\r\n MemoryQueryCache.prototype.getHighestSequenceNumber = function (transaction) {\r\n return PersistencePromise.resolve(this.highestSequenceNumber);\r\n };\r\n MemoryQueryCache.prototype.allocateTargetId = function (transaction) {\r\n var nextTargetId = this.targetIdGenerator.after(this.highestTargetId);\r\n this.highestTargetId = nextTargetId;\r\n return PersistencePromise.resolve(nextTargetId);\r\n };\r\n MemoryQueryCache.prototype.setTargetsMetadata = function (transaction, highestListenSequenceNumber, lastRemoteSnapshotVersion) {\r\n if (lastRemoteSnapshotVersion) {\r\n this.lastRemoteSnapshotVersion = lastRemoteSnapshotVersion;\r\n }\r\n if (highestListenSequenceNumber > this.highestSequenceNumber) {\r\n this.highestSequenceNumber = highestListenSequenceNumber;\r\n }\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryQueryCache.prototype.saveQueryData = function (queryData) {\r\n this.queries.set(queryData.query, queryData);\r\n var targetId = queryData.targetId;\r\n if (targetId > this.highestTargetId) {\r\n this.highestTargetId = targetId;\r\n }\r\n if (queryData.sequenceNumber > this.highestSequenceNumber) {\r\n this.highestSequenceNumber = queryData.sequenceNumber;\r\n }\r\n };\r\n MemoryQueryCache.prototype.addQueryData = function (transaction, queryData) {\r\n assert(!this.queries.has(queryData.query), 'Adding a query that already exists');\r\n this.saveQueryData(queryData);\r\n this.targetCount += 1;\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryQueryCache.prototype.updateQueryData = function (transaction, queryData) {\r\n assert(this.queries.has(queryData.query), 'Updating a non-existent query');\r\n this.saveQueryData(queryData);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryQueryCache.prototype.removeQueryData = function (transaction, queryData) {\r\n assert(this.targetCount > 0, 'Removing a target from an empty cache');\r\n assert(this.queries.has(queryData.query), 'Removing a non-existent target from the cache');\r\n this.queries.delete(queryData.query);\r\n this.references.removeReferencesForId(queryData.targetId);\r\n this.targetCount -= 1;\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryQueryCache.prototype.removeTargets = function (transaction, upperBound, activeTargetIds) {\r\n var _this = this;\r\n var count = 0;\r\n var removals = [];\r\n this.queries.forEach(function (key, queryData) {\r\n if (queryData.sequenceNumber <= upperBound &&\r\n !activeTargetIds[queryData.targetId]) {\r\n _this.queries.delete(key);\r\n removals.push(_this.removeMatchingKeysForTargetId(transaction, queryData.targetId));\r\n count++;\r\n }\r\n });\r\n return PersistencePromise.waitFor(removals).next(function () { return count; });\r\n };\r\n MemoryQueryCache.prototype.getQueryCount = function (transaction) {\r\n return PersistencePromise.resolve(this.targetCount);\r\n };\r\n MemoryQueryCache.prototype.getQueryData = function (transaction, query) {\r\n var queryData = this.queries.get(query) || null;\r\n return PersistencePromise.resolve(queryData);\r\n };\r\n MemoryQueryCache.prototype.getQueryDataForTarget = function (transaction, targetId) {\r\n // This method is only needed for multi-tab and we can't implement it\r\n // efficiently without additional data structures.\r\n return fail('Not yet implemented.');\r\n };\r\n MemoryQueryCache.prototype.addMatchingKeys = function (txn, keys, targetId) {\r\n this.references.addReferences(keys, targetId);\r\n var referenceDelegate = this.persistence.referenceDelegate;\r\n var promises = [];\r\n if (referenceDelegate) {\r\n keys.forEach(function (key) {\r\n promises.push(referenceDelegate.addReference(txn, key));\r\n });\r\n }\r\n return PersistencePromise.waitFor(promises);\r\n };\r\n MemoryQueryCache.prototype.removeMatchingKeys = function (txn, keys, targetId) {\r\n this.references.removeReferences(keys, targetId);\r\n var referenceDelegate = this.persistence.referenceDelegate;\r\n var promises = [];\r\n if (referenceDelegate) {\r\n keys.forEach(function (key) {\r\n promises.push(referenceDelegate.removeReference(txn, key));\r\n });\r\n }\r\n return PersistencePromise.waitFor(promises);\r\n };\r\n MemoryQueryCache.prototype.removeMatchingKeysForTargetId = function (txn, targetId) {\r\n this.references.removeReferencesForId(targetId);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryQueryCache.prototype.getMatchingKeysForTargetId = function (txn, targetId) {\r\n var matchingKeys = this.references.referencesForId(targetId);\r\n return PersistencePromise.resolve(matchingKeys);\r\n };\r\n MemoryQueryCache.prototype.containsKey = function (txn, key) {\r\n return PersistencePromise.resolve(this.references.containsKey(key));\r\n };\r\n return MemoryQueryCache;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MemoryRemoteDocumentCache = /** @class */ (function () {\r\n function MemoryRemoteDocumentCache() {\r\n this.docs = maybeDocumentMap();\r\n this.newDocumentChanges = documentKeySet();\r\n }\r\n MemoryRemoteDocumentCache.prototype.addEntries = function (transaction, maybeDocuments) {\r\n for (var _i = 0, maybeDocuments_1 = maybeDocuments; _i < maybeDocuments_1.length; _i++) {\r\n var maybeDocument = maybeDocuments_1[_i];\r\n this.docs = this.docs.insert(maybeDocument.key, maybeDocument);\r\n this.newDocumentChanges = this.newDocumentChanges.add(maybeDocument.key);\r\n }\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryRemoteDocumentCache.prototype.removeEntry = function (transaction, documentKey) {\r\n this.docs = this.docs.remove(documentKey);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryRemoteDocumentCache.prototype.getEntry = function (transaction, documentKey) {\r\n return PersistencePromise.resolve(this.docs.get(documentKey));\r\n };\r\n MemoryRemoteDocumentCache.prototype.getDocumentsMatchingQuery = function (transaction, query) {\r\n var results = documentMap();\r\n // Documents are ordered by key, so we can use a prefix scan to narrow down\r\n // the documents we need to match the query against.\r\n var prefix = new DocumentKey(query.path.child(''));\r\n var iterator = this.docs.getIteratorFrom(prefix);\r\n while (iterator.hasNext()) {\r\n var _a = iterator.getNext(), key = _a.key, maybeDoc = _a.value;\r\n if (!query.path.isPrefixOf(key.path)) {\r\n break;\r\n }\r\n if (maybeDoc instanceof Document && query.matches(maybeDoc)) {\r\n results = results.insert(maybeDoc.key, maybeDoc);\r\n }\r\n }\r\n return PersistencePromise.resolve(results);\r\n };\r\n MemoryRemoteDocumentCache.prototype.forEachDocumentKey = function (transaction, f) {\r\n return PersistencePromise.forEach(this.docs, function (entry) { return f(entry.key); });\r\n };\r\n MemoryRemoteDocumentCache.prototype.getNewDocumentChanges = function (transaction) {\r\n var _this = this;\r\n var changedDocs = maybeDocumentMap();\r\n this.newDocumentChanges.forEach(function (key) {\r\n changedDocs = changedDocs.insert(key, _this.docs.get(key) ||\r\n new NoDocument(key, SnapshotVersion.forDeletedDoc()));\r\n });\r\n this.newDocumentChanges = documentKeySet();\r\n return PersistencePromise.resolve(changedDocs);\r\n };\r\n return MemoryRemoteDocumentCache;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$4 = 'MemoryPersistence';\r\n/**\r\n * A memory-backed instance of Persistence. Data is stored only in RAM and\r\n * not persisted across sessions.\r\n */\r\nvar MemoryPersistence = /** @class */ (function () {\r\n function MemoryPersistence(clientId, isEager) {\r\n this.clientId = clientId;\r\n /**\r\n * Note that these are retained here to make it easier to write tests\r\n * affecting both the in-memory and IndexedDB-backed persistence layers. Tests\r\n * can create a new LocalStore wrapping this Persistence instance and this\r\n * will make the in-memory persistence layer behave as if it were actually\r\n * persisting values.\r\n */\r\n this.mutationQueues = {};\r\n this.remoteDocumentCache = new MemoryRemoteDocumentCache();\r\n this.listenSequence = new ListenSequence(0);\r\n this._started = false;\r\n this._started = true;\r\n if (isEager) {\r\n this.referenceDelegate = new MemoryEagerDelegate(this);\r\n }\r\n else {\r\n this.referenceDelegate = new MemoryLruDelegate(this);\r\n }\r\n this.queryCache = new MemoryQueryCache(this);\r\n }\r\n MemoryPersistence.createLruPersistence = function (clientId) {\r\n return new MemoryPersistence(clientId, /* isEager= */ false);\r\n };\r\n MemoryPersistence.createEagerPersistence = function (clientId) {\r\n return new MemoryPersistence(clientId, /* isEager= */ true);\r\n };\r\n MemoryPersistence.prototype.shutdown = function (deleteData) {\r\n // No durable state to ensure is closed on shutdown.\r\n this._started = false;\r\n return Promise.resolve();\r\n };\r\n Object.defineProperty(MemoryPersistence.prototype, \"started\", {\r\n get: function () {\r\n return this._started;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n MemoryPersistence.prototype.getActiveClients = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n return [2 /*return*/, [this.clientId]];\r\n });\r\n });\r\n };\r\n MemoryPersistence.prototype.setPrimaryStateListener = function (primaryStateListener) {\r\n // All clients using memory persistence act as primary.\r\n return primaryStateListener(true);\r\n };\r\n MemoryPersistence.prototype.setNetworkEnabled = function (networkEnabled) {\r\n // No op.\r\n };\r\n MemoryPersistence.prototype.getMutationQueue = function (user) {\r\n var queue = this.mutationQueues[user.toKey()];\r\n if (!queue) {\r\n queue = new MemoryMutationQueue(this.referenceDelegate);\r\n this.mutationQueues[user.toKey()] = queue;\r\n }\r\n return queue;\r\n };\r\n MemoryPersistence.prototype.getQueryCache = function () {\r\n return this.queryCache;\r\n };\r\n MemoryPersistence.prototype.getRemoteDocumentCache = function () {\r\n return this.remoteDocumentCache;\r\n };\r\n MemoryPersistence.prototype.runTransaction = function (action, mode, transactionOperation) {\r\n var _this = this;\r\n debug(LOG_TAG$4, 'Starting transaction:', action);\r\n var txn = new MemoryTransaction(this.listenSequence.next());\r\n this.referenceDelegate.onTransactionStarted();\r\n return transactionOperation(txn)\r\n .next(function (result) {\r\n return _this.referenceDelegate\r\n .onTransactionCommitted(txn)\r\n .next(function () { return result; });\r\n })\r\n .toPromise();\r\n };\r\n MemoryPersistence.prototype.mutationQueuesContainKey = function (transaction, key) {\r\n return PersistencePromise.or(values(this.mutationQueues)\r\n .map(function (queue) { return function () { return queue.containsKey(transaction, key); }; }));\r\n };\r\n return MemoryPersistence;\r\n}());\r\n/**\r\n * Memory persistence is not actually transactional, but future implementations\r\n * may have transaction-scoped state.\r\n */\r\nvar MemoryTransaction = /** @class */ (function () {\r\n function MemoryTransaction(currentSequenceNumber) {\r\n this.currentSequenceNumber = currentSequenceNumber;\r\n }\r\n return MemoryTransaction;\r\n}());\r\nvar MemoryEagerDelegate = /** @class */ (function () {\r\n function MemoryEagerDelegate(persistence) {\r\n this.persistence = persistence;\r\n }\r\n MemoryEagerDelegate.prototype.setInMemoryPins = function (inMemoryPins) {\r\n this.inMemoryPins = inMemoryPins;\r\n };\r\n MemoryEagerDelegate.prototype.addReference = function (txn, key) {\r\n this.orphanedDocuments.delete(key);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryEagerDelegate.prototype.removeReference = function (txn, key) {\r\n this.orphanedDocuments.add(key);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryEagerDelegate.prototype.removeMutationReference = function (txn, key) {\r\n this.orphanedDocuments.add(key);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryEagerDelegate.prototype.removeTarget = function (txn, queryData) {\r\n var _this = this;\r\n var cache = this.persistence.getQueryCache();\r\n return cache\r\n .getMatchingKeysForTargetId(txn, queryData.targetId)\r\n .next(function (keys) {\r\n keys.forEach(function (key) { return _this.orphanedDocuments.add(key); });\r\n })\r\n .next(function () { return cache.removeQueryData(txn, queryData); });\r\n };\r\n MemoryEagerDelegate.prototype.onTransactionStarted = function () {\r\n this.orphanedDocuments = new Set();\r\n };\r\n MemoryEagerDelegate.prototype.onTransactionCommitted = function (txn) {\r\n var _this = this;\r\n var cache = this.persistence.getRemoteDocumentCache();\r\n return PersistencePromise.forEach(this.orphanedDocuments, function (key) {\r\n return _this.isReferenced(txn, key).next(function (isReferenced) {\r\n if (!isReferenced) {\r\n return cache.removeEntry(txn, key);\r\n }\r\n });\r\n });\r\n };\r\n MemoryEagerDelegate.prototype.updateLimboDocument = function (txn, key) {\r\n var _this = this;\r\n return this.isReferenced(txn, key).next(function (isReferenced) {\r\n if (isReferenced) {\r\n _this.orphanedDocuments.delete(key);\r\n }\r\n else {\r\n _this.orphanedDocuments.add(key);\r\n }\r\n });\r\n };\r\n MemoryEagerDelegate.prototype.isReferenced = function (txn, key) {\r\n var _this = this;\r\n return PersistencePromise.or([\r\n function () { return _this.persistence.getQueryCache().containsKey(txn, key); },\r\n function () { return _this.persistence.mutationQueuesContainKey(txn, key); },\r\n function () { return PersistencePromise.resolve(_this.inMemoryPins.containsKey(key)); }\r\n ]);\r\n };\r\n return MemoryEagerDelegate;\r\n}());\r\nvar MemoryLruDelegate = /** @class */ (function () {\r\n function MemoryLruDelegate(persistence) {\r\n this.persistence = persistence;\r\n this.orphanedSequenceNumbers = new ObjectMap(function (k) { return encode(k.path); });\r\n this.garbageCollector = new LruGarbageCollector(this);\r\n }\r\n // No-ops, present so memory persistence doesn't have to care which delegate\r\n // it has.\r\n MemoryLruDelegate.prototype.onTransactionStarted = function () { };\r\n MemoryLruDelegate.prototype.onTransactionCommitted = function (txn) {\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryLruDelegate.prototype.forEachTarget = function (txn, f) {\r\n return this.persistence.getQueryCache().forEachTarget(txn, f);\r\n };\r\n MemoryLruDelegate.prototype.getTargetCount = function (txn) {\r\n return this.persistence.getQueryCache().getTargetCount(txn);\r\n };\r\n MemoryLruDelegate.prototype.forEachOrphanedDocumentSequenceNumber = function (txn, f) {\r\n var _this = this;\r\n return PersistencePromise.forEach(this.orphanedSequenceNumbers, function (_a) {\r\n var key = _a.key, sequenceNumber = _a.value;\r\n // Pass in the exact sequence number as the upper bound so we know it won't be pinned by\r\n // being too recent.\r\n return _this.isPinned(txn, key, sequenceNumber).next(function (isPinned) {\r\n if (!isPinned) {\r\n return f(sequenceNumber);\r\n }\r\n else {\r\n return PersistencePromise.resolve();\r\n }\r\n });\r\n });\r\n };\r\n MemoryLruDelegate.prototype.setInMemoryPins = function (inMemoryPins) {\r\n this.inMemoryPins = inMemoryPins;\r\n };\r\n MemoryLruDelegate.prototype.removeTargets = function (txn, upperBound, activeTargetIds) {\r\n return this.persistence\r\n .getQueryCache()\r\n .removeTargets(txn, upperBound, activeTargetIds);\r\n };\r\n MemoryLruDelegate.prototype.removeOrphanedDocuments = function (txn, upperBound) {\r\n var _this = this;\r\n var count = 0;\r\n var cache = this.persistence.getRemoteDocumentCache();\r\n var p = cache.forEachDocumentKey(txn, function (key) {\r\n return _this.isPinned(txn, key, upperBound).next(function (isPinned) {\r\n if (isPinned) {\r\n return PersistencePromise.resolve();\r\n }\r\n else {\r\n count++;\r\n return cache.removeEntry(txn, key);\r\n }\r\n });\r\n });\r\n return p.next(function () { return count; });\r\n };\r\n MemoryLruDelegate.prototype.removeMutationReference = function (txn, key) {\r\n this.orphanedSequenceNumbers.set(key, txn.currentSequenceNumber);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryLruDelegate.prototype.removeTarget = function (txn, queryData) {\r\n var updated = queryData.copy({\r\n sequenceNumber: txn.currentSequenceNumber\r\n });\r\n return this.persistence.getQueryCache().updateQueryData(txn, updated);\r\n };\r\n MemoryLruDelegate.prototype.addReference = function (txn, key) {\r\n this.orphanedSequenceNumbers.set(key, txn.currentSequenceNumber);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryLruDelegate.prototype.removeReference = function (txn, key) {\r\n this.orphanedSequenceNumbers.set(key, txn.currentSequenceNumber);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryLruDelegate.prototype.updateLimboDocument = function (txn, key) {\r\n this.orphanedSequenceNumbers.set(key, txn.currentSequenceNumber);\r\n return PersistencePromise.resolve();\r\n };\r\n MemoryLruDelegate.prototype.isPinned = function (txn, key, upperBound) {\r\n var _this = this;\r\n return PersistencePromise.or([\r\n function () { return _this.persistence.mutationQueuesContainKey(txn, key); },\r\n function () { return PersistencePromise.resolve(_this.inMemoryPins.containsKey(key)); },\r\n function () { return _this.persistence.getQueryCache().containsKey(txn, key); },\r\n function () {\r\n var orphanedAt = _this.orphanedSequenceNumbers.get(key);\r\n return PersistencePromise.resolve(orphanedAt !== undefined && orphanedAt > upperBound);\r\n }\r\n ]);\r\n };\r\n return MemoryLruDelegate;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$5 = 'ExponentialBackoff';\r\n/**\r\n * A helper for running delayed tasks following an exponential backoff curve\r\n * between attempts.\r\n *\r\n * Each delay is made up of a \"base\" delay which follows the exponential\r\n * backoff curve, and a +/- 50% \"jitter\" that is calculated and added to the\r\n * base delay. This prevents clients from accidentally synchronizing their\r\n * delays causing spikes of load to the backend.\r\n */\r\nvar ExponentialBackoff = /** @class */ (function () {\r\n function ExponentialBackoff(\r\n /**\r\n * The AsyncQueue to run backoff operations on.\r\n */\r\n queue, \r\n /**\r\n * The ID to use when scheduling backoff operations on the AsyncQueue.\r\n */\r\n timerId, \r\n /**\r\n * The initial delay (used as the base delay on the first retry attempt).\r\n * Note that jitter will still be applied, so the actual delay could be as\r\n * little as 0.5*initialDelayMs.\r\n */\r\n initialDelayMs, \r\n /**\r\n * The multiplier to use to determine the extended base delay after each\r\n * attempt.\r\n */\r\n backoffFactor, \r\n /**\r\n * The maximum base delay after which no further backoff is performed.\r\n * Note that jitter will still be applied, so the actual delay could be as\r\n * much as 1.5*maxDelayMs.\r\n */\r\n maxDelayMs) {\r\n this.queue = queue;\r\n this.timerId = timerId;\r\n this.initialDelayMs = initialDelayMs;\r\n this.backoffFactor = backoffFactor;\r\n this.maxDelayMs = maxDelayMs;\r\n this.timerPromise = null;\r\n /** The last backoff attempt, as epoch milliseconds. */\r\n this.lastAttemptTime = Date.now();\r\n this.reset();\r\n }\r\n /**\r\n * Resets the backoff delay.\r\n *\r\n * The very next backoffAndWait() will have no delay. If it is called again\r\n * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\r\n * subsequent ones will increase according to the backoffFactor.\r\n */\r\n ExponentialBackoff.prototype.reset = function () {\r\n this.currentBaseMs = 0;\r\n };\r\n /**\r\n * Resets the backoff delay to the maximum delay (e.g. for use after a\r\n * RESOURCE_EXHAUSTED error).\r\n */\r\n ExponentialBackoff.prototype.resetToMax = function () {\r\n this.currentBaseMs = this.maxDelayMs;\r\n };\r\n /**\r\n * Returns a promise that resolves after currentDelayMs, and increases the\r\n * delay for any subsequent attempts. If there was a pending backoff operation\r\n * already, it will be canceled.\r\n */\r\n ExponentialBackoff.prototype.backoffAndRun = function (op) {\r\n var _this = this;\r\n // Cancel any pending backoff operation.\r\n this.cancel();\r\n // First schedule using the current base (which may be 0 and should be\r\n // honored as such).\r\n var desiredDelayWithJitterMs = Math.floor(this.currentBaseMs + this.jitterDelayMs());\r\n // Guard against lastAttemptTime being in the future due to a clock change.\r\n var delaySoFarMs = Math.max(0, Date.now() - this.lastAttemptTime);\r\n // Guard against the backoff delay already being past.\r\n var remainingDelayMs = Math.max(0, desiredDelayWithJitterMs - delaySoFarMs);\r\n if (this.currentBaseMs > 0) {\r\n debug(LOG_TAG$5, \"Backing off for \" + remainingDelayMs + \" ms \" +\r\n (\"(base delay: \" + this.currentBaseMs + \" ms, \") +\r\n (\"delay with jitter: \" + desiredDelayWithJitterMs + \" ms, \") +\r\n (\"last attempt: \" + delaySoFarMs + \" ms ago)\"));\r\n }\r\n this.timerPromise = this.queue.enqueueAfterDelay(this.timerId, remainingDelayMs, function () {\r\n _this.lastAttemptTime = Date.now();\r\n return op();\r\n });\r\n // Apply backoff factor to determine next delay and ensure it is within\r\n // bounds.\r\n this.currentBaseMs *= this.backoffFactor;\r\n if (this.currentBaseMs < this.initialDelayMs) {\r\n this.currentBaseMs = this.initialDelayMs;\r\n }\r\n if (this.currentBaseMs > this.maxDelayMs) {\r\n this.currentBaseMs = this.maxDelayMs;\r\n }\r\n };\r\n ExponentialBackoff.prototype.cancel = function () {\r\n if (this.timerPromise !== null) {\r\n this.timerPromise.cancel();\r\n this.timerPromise = null;\r\n }\r\n };\r\n /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */\r\n ExponentialBackoff.prototype.jitterDelayMs = function () {\r\n return (Math.random() - 0.5) * this.currentBaseMs;\r\n };\r\n return ExponentialBackoff;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$6 = 'PersistentStream';\r\n/**\r\n * PersistentStream can be in one of 5 states (each described in detail below)\r\n * based on the following state transition diagram:\r\n *\r\n * start() called auth & connection succeeded\r\n * INITIAL ----------------> STARTING -----------------------------> OPEN\r\n * ^ | |\r\n * | | error occurred |\r\n * | \\-----------------------------v-----/\r\n * | |\r\n * backoff | |\r\n * elapsed | start() called |\r\n * \\--- BACKOFF <---------------- ERROR\r\n *\r\n * [any state] --------------------------> INITIAL\r\n * stop() called or\r\n * idle timer expired\r\n */\r\nvar PersistentStreamState;\r\n(function (PersistentStreamState) {\r\n /**\r\n * The streaming RPC is not yet running and there's no error condition.\r\n * Calling start() will start the stream immediately without backoff.\r\n * While in this state isStarted() will return false.\r\n */\r\n PersistentStreamState[PersistentStreamState[\"Initial\"] = 0] = \"Initial\";\r\n /**\r\n * The stream is starting, either waiting for an auth token or for the stream\r\n * to successfully open. While in this state, isStarted() will return true but\r\n * isOpen() will return false.\r\n */\r\n PersistentStreamState[PersistentStreamState[\"Starting\"] = 1] = \"Starting\";\r\n /**\r\n * The streaming RPC is up and running. Requests and responses can flow\r\n * freely. Both isStarted() and isOpen() will return true.\r\n */\r\n PersistentStreamState[PersistentStreamState[\"Open\"] = 2] = \"Open\";\r\n /**\r\n * The stream encountered an error. The next start attempt will back off.\r\n * While in this state isStarted() will return false.\r\n */\r\n PersistentStreamState[PersistentStreamState[\"Error\"] = 3] = \"Error\";\r\n /**\r\n * An in-between state after an error where the stream is waiting before\r\n * re-starting. After waiting is complete, the stream will try to open.\r\n * While in this state isStarted() will return true but isOpen() will return\r\n * false.\r\n */\r\n PersistentStreamState[PersistentStreamState[\"Backoff\"] = 4] = \"Backoff\";\r\n})(PersistentStreamState || (PersistentStreamState = {}));\r\n/**\r\n * Initial backoff time in milliseconds after an error.\r\n * Set to 1s according to https://cloud.google.com/apis/design/errors.\r\n */\r\nvar BACKOFF_INITIAL_DELAY_MS = 1000;\r\n/** Maximum backoff time in milliseconds */\r\nvar BACKOFF_MAX_DELAY_MS = 60 * 1000;\r\nvar BACKOFF_FACTOR = 1.5;\r\n/** The time a stream stays open after it is marked idle. */\r\nvar IDLE_TIMEOUT_MS = 60 * 1000;\r\n/**\r\n * A PersistentStream is an abstract base class that represents a streaming RPC\r\n * to the Firestore backend. It's built on top of the connections own support\r\n * for streaming RPCs, and adds several critical features for our clients:\r\n *\r\n * - Exponential backoff on failure\r\n * - Authentication via CredentialsProvider\r\n * - Dispatching all callbacks into the shared worker queue\r\n * - Closing idle streams after 60 seconds of inactivity\r\n *\r\n * Subclasses of PersistentStream implement serialization of models to and\r\n * from the JSON representation of the protocol buffers for a specific\r\n * streaming RPC.\r\n *\r\n * ## Starting and Stopping\r\n *\r\n * Streaming RPCs are stateful and need to be start()ed before messages can\r\n * be sent and received. The PersistentStream will call the onOpen() function\r\n * of the listener once the stream is ready to accept requests.\r\n *\r\n * Should a start() fail, PersistentStream will call the registered onClose()\r\n * listener with a FirestoreError indicating what went wrong.\r\n *\r\n * A PersistentStream can be started and stopped repeatedly.\r\n *\r\n * Generic types:\r\n * SendType: The type of the outgoing message of the underlying\r\n * connection stream\r\n * ReceiveType: The type of the incoming message of the underlying\r\n * connection stream\r\n * ListenerType: The type of the listener that will be used for callbacks\r\n */\r\nvar PersistentStream = /** @class */ (function () {\r\n function PersistentStream(queue, connectionTimerId, idleTimerId, connection, credentialsProvider, listener) {\r\n this.queue = queue;\r\n this.idleTimerId = idleTimerId;\r\n this.connection = connection;\r\n this.credentialsProvider = credentialsProvider;\r\n this.listener = listener;\r\n this.state = PersistentStreamState.Initial;\r\n /**\r\n * A close count that's incremented every time the stream is closed; used by\r\n * getCloseGuardedDispatcher() to invalidate callbacks that happen after\r\n * close.\r\n */\r\n this.closeCount = 0;\r\n this.idleTimer = null;\r\n this.stream = null;\r\n this.backoff = new ExponentialBackoff(queue, connectionTimerId, BACKOFF_INITIAL_DELAY_MS, BACKOFF_FACTOR, BACKOFF_MAX_DELAY_MS);\r\n }\r\n /**\r\n * Returns true if start() has been called and no error has occurred. True\r\n * indicates the stream is open or in the process of opening (which\r\n * encompasses respecting backoff, getting auth tokens, and starting the\r\n * actual RPC). Use isOpen() to determine if the stream is open and ready for\r\n * outbound requests.\r\n */\r\n PersistentStream.prototype.isStarted = function () {\r\n return (this.state === PersistentStreamState.Starting ||\r\n this.state === PersistentStreamState.Open ||\r\n this.state === PersistentStreamState.Backoff);\r\n };\r\n /**\r\n * Returns true if the underlying RPC is open (the onOpen() listener has been\r\n * called) and the stream is ready for outbound requests.\r\n */\r\n PersistentStream.prototype.isOpen = function () {\r\n return this.state === PersistentStreamState.Open;\r\n };\r\n /**\r\n * Starts the RPC. Only allowed if isStarted() returns false. The stream is\r\n * not immediately ready for use: onOpen() will be invoked when the RPC is\r\n * ready for outbound requests, at which point isOpen() will return true.\r\n *\r\n * When start returns, isStarted() will return true.\r\n */\r\n PersistentStream.prototype.start = function () {\r\n if (this.state === PersistentStreamState.Error) {\r\n this.performBackoff();\r\n return;\r\n }\r\n assert(this.state === PersistentStreamState.Initial, 'Already started');\r\n this.auth();\r\n };\r\n /**\r\n * Stops the RPC. This call is idempotent and allowed regardless of the\r\n * current isStarted() state.\r\n *\r\n * When stop returns, isStarted() and isOpen() will both return false.\r\n */\r\n PersistentStream.prototype.stop = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.isStarted()) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.close(PersistentStreamState.Initial)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * After an error the stream will usually back off on the next attempt to\r\n * start it. If the error warrants an immediate restart of the stream, the\r\n * sender can use this to indicate that the receiver should not back off.\r\n *\r\n * Each error will call the onClose() listener. That function can decide to\r\n * inhibit backoff if required.\r\n */\r\n PersistentStream.prototype.inhibitBackoff = function () {\r\n assert(!this.isStarted(), 'Can only inhibit backoff in a stopped state');\r\n this.state = PersistentStreamState.Initial;\r\n this.backoff.reset();\r\n };\r\n /**\r\n * Marks this stream as idle. If no further actions are performed on the\r\n * stream for one minute, the stream will automatically close itself and\r\n * notify the stream's onClose() handler with Status.OK. The stream will then\r\n * be in a !isStarted() state, requiring the caller to start the stream again\r\n * before further use.\r\n *\r\n * Only streams that are in state 'Open' can be marked idle, as all other\r\n * states imply pending network operations.\r\n */\r\n PersistentStream.prototype.markIdle = function () {\r\n var _this = this;\r\n // Starts the idle time if we are in state 'Open' and are not yet already\r\n // running a timer (in which case the previous idle timeout still applies).\r\n if (this.isOpen() && this.idleTimer === null) {\r\n this.idleTimer = this.queue.enqueueAfterDelay(this.idleTimerId, IDLE_TIMEOUT_MS, function () { return _this.handleIdleCloseTimer(); });\r\n }\r\n };\r\n /** Sends a message to the underlying stream. */\r\n PersistentStream.prototype.sendRequest = function (msg) {\r\n this.cancelIdleCheck();\r\n this.stream.send(msg);\r\n };\r\n /** Called by the idle timer when the stream should close due to inactivity. */\r\n PersistentStream.prototype.handleIdleCloseTimer = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n if (this.isOpen()) {\r\n // When timing out an idle stream there's no reason to force the stream into backoff when\r\n // it restarts so set the stream state to Initial instead of Error.\r\n return [2 /*return*/, this.close(PersistentStreamState.Initial)];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n /** Marks the stream as active again. */\r\n PersistentStream.prototype.cancelIdleCheck = function () {\r\n if (this.idleTimer) {\r\n this.idleTimer.cancel();\r\n this.idleTimer = null;\r\n }\r\n };\r\n /**\r\n * Closes the stream and cleans up as necessary:\r\n *\r\n * * closes the underlying GRPC stream;\r\n * * calls the onClose handler with the given 'error';\r\n * * sets internal stream state to 'finalState';\r\n * * adjusts the backoff timer based on the error\r\n *\r\n * A new stream can be opened by calling start().\r\n *\r\n * @param finalState the intended state of the stream after closing.\r\n * @param error the error the connection was closed with.\r\n */\r\n PersistentStream.prototype.close = function (finalState, error$$1) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n assert(this.isStarted(), 'Only started streams should be closed.');\r\n assert(finalState === PersistentStreamState.Error || isNullOrUndefined(error$$1), \"Can't provide an error when not in an error state.\");\r\n // Cancel any outstanding timers (they're guaranteed not to execute).\r\n this.cancelIdleCheck();\r\n this.backoff.cancel();\r\n // Invalidates any stream-related callbacks (e.g. from auth or the\r\n // underlying stream), guaranteeing they won't execute.\r\n this.closeCount++;\r\n if (finalState !== PersistentStreamState.Error) {\r\n // If this is an intentional close ensure we don't delay our next connection attempt.\r\n this.backoff.reset();\r\n }\r\n else if (error$$1 && error$$1.code === Code.RESOURCE_EXHAUSTED) {\r\n // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\r\n error(error$$1.toString());\r\n error('Using maximum backoff delay to prevent overloading the backend.');\r\n this.backoff.resetToMax();\r\n }\r\n else if (error$$1 && error$$1.code === Code.UNAUTHENTICATED) {\r\n // \"unauthenticated\" error means the token was rejected. Try force refreshing it in case it\r\n // just expired.\r\n this.credentialsProvider.invalidateToken();\r\n }\r\n // Clean up the underlying stream because we are no longer interested in events.\r\n if (this.stream !== null) {\r\n this.tearDown();\r\n this.stream.close();\r\n this.stream = null;\r\n }\r\n // This state must be assigned before calling onClose() to allow the callback to\r\n // inhibit backoff or otherwise manipulate the state in its non-started state.\r\n this.state = finalState;\r\n // Notify the listener that the stream closed.\r\n return [4 /*yield*/, this.listener.onClose(error$$1)];\r\n case 1:\r\n // Notify the listener that the stream closed.\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Can be overridden to perform additional cleanup before the stream is closed.\r\n * Calling super.tearDown() is not required.\r\n */\r\n PersistentStream.prototype.tearDown = function () { };\r\n PersistentStream.prototype.auth = function () {\r\n var _this = this;\r\n assert(this.state === PersistentStreamState.Initial, 'Must be in initial state to auth');\r\n this.state = PersistentStreamState.Starting;\r\n var dispatchIfNotClosed = this.getCloseGuardedDispatcher(this.closeCount);\r\n // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\r\n var closeCount = this.closeCount;\r\n this.credentialsProvider.getToken().then(function (token) {\r\n // Stream can be stopped while waiting for authentication.\r\n // TODO(mikelehen): We really should just use dispatchIfNotClosed\r\n // and let this dispatch onto the queue, but that opened a spec test can\r\n // of worms that I don't want to deal with in this PR.\r\n if (_this.closeCount === closeCount) {\r\n // Normally we'd have to schedule the callback on the AsyncQueue.\r\n // However, the following calls are safe to be called outside the\r\n // AsyncQueue since they don't chain asynchronous calls\r\n _this.startStream(token);\r\n }\r\n }, function (error$$1) {\r\n dispatchIfNotClosed(function () {\r\n var rpcError = new FirestoreError(Code.UNKNOWN, 'Fetching auth token failed: ' + error$$1.message);\r\n return _this.handleStreamClose(rpcError);\r\n });\r\n });\r\n };\r\n PersistentStream.prototype.startStream = function (token) {\r\n var _this = this;\r\n assert(this.state === PersistentStreamState.Starting, 'Trying to start stream in a non-starting state');\r\n var dispatchIfNotClosed = this.getCloseGuardedDispatcher(this.closeCount);\r\n this.stream = this.startRpc(token);\r\n this.stream.onOpen(function () {\r\n dispatchIfNotClosed(function () {\r\n assert(_this.state === PersistentStreamState.Starting, 'Expected stream to be in state Starting, but was ' + _this.state);\r\n _this.state = PersistentStreamState.Open;\r\n return _this.listener.onOpen();\r\n });\r\n });\r\n this.stream.onClose(function (error$$1) {\r\n dispatchIfNotClosed(function () {\r\n return _this.handleStreamClose(error$$1);\r\n });\r\n });\r\n this.stream.onMessage(function (msg) {\r\n dispatchIfNotClosed(function () {\r\n return _this.onMessage(msg);\r\n });\r\n });\r\n };\r\n PersistentStream.prototype.performBackoff = function () {\r\n var _this = this;\r\n assert(this.state === PersistentStreamState.Error, 'Should only perform backoff when in Error state');\r\n this.state = PersistentStreamState.Backoff;\r\n this.backoff.backoffAndRun(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n assert(this.state === PersistentStreamState.Backoff, 'Backoff elapsed but state is now: ' + this.state);\r\n this.state = PersistentStreamState.Initial;\r\n this.start();\r\n assert(this.isStarted(), 'PersistentStream should have started');\r\n return [2 /*return*/];\r\n });\r\n }); });\r\n };\r\n // Visible for tests\r\n PersistentStream.prototype.handleStreamClose = function (error$$1) {\r\n assert(this.isStarted(), \"Can't handle server close on non-started stream\");\r\n debug(LOG_TAG$6, \"close with error: \" + error$$1);\r\n this.stream = null;\r\n // In theory the stream could close cleanly, however, in our current model\r\n // we never expect this to happen because if we stop a stream ourselves,\r\n // this callback will never be called. To prevent cases where we retry\r\n // without a backoff accidentally, we set the stream to error in all cases.\r\n return this.close(PersistentStreamState.Error, error$$1);\r\n };\r\n /**\r\n * Returns a \"dispatcher\" function that dispatches operations onto the\r\n * AsyncQueue but only runs them if closeCount remains unchanged. This allows\r\n * us to turn auth / stream callbacks into no-ops if the stream is closed /\r\n * re-opened, etc.\r\n */\r\n PersistentStream.prototype.getCloseGuardedDispatcher = function (startCloseCount) {\r\n var _this = this;\r\n return function (fn) {\r\n _this.queue.enqueueAndForget(function () {\r\n if (_this.closeCount === startCloseCount) {\r\n return fn();\r\n }\r\n else {\r\n debug(LOG_TAG$6, 'stream callback skipped by getCloseGuardedDispatcher.');\r\n return Promise.resolve();\r\n }\r\n });\r\n };\r\n };\r\n return PersistentStream;\r\n}());\r\n/**\r\n * A PersistentStream that implements the Listen RPC.\r\n *\r\n * Once the Listen stream has called the onOpen() listener, any number of\r\n * listen() and unlisten() calls can be made to control what changes will be\r\n * sent from the server for ListenResponses.\r\n */\r\nvar PersistentListenStream = /** @class */ (function (_super) {\r\n tslib_1.__extends(PersistentListenStream, _super);\r\n function PersistentListenStream(queue, connection, credentials, serializer, listener) {\r\n var _this = _super.call(this, queue, TimerId.ListenStreamConnectionBackoff, TimerId.ListenStreamIdle, connection, credentials, listener) || this;\r\n _this.serializer = serializer;\r\n return _this;\r\n }\r\n PersistentListenStream.prototype.startRpc = function (token) {\r\n return this.connection.openStream('Listen', token);\r\n };\r\n PersistentListenStream.prototype.onMessage = function (watchChangeProto) {\r\n // A successful response means the stream is healthy\r\n this.backoff.reset();\r\n var watchChange = this.serializer.fromWatchChange(watchChangeProto);\r\n var snapshot = this.serializer.versionFromListenResponse(watchChangeProto);\r\n return this.listener.onWatchChange(watchChange, snapshot);\r\n };\r\n /**\r\n * Registers interest in the results of the given query. If the query\r\n * includes a resumeToken it will be included in the request. Results that\r\n * affect the query will be streamed back as WatchChange messages that\r\n * reference the targetId.\r\n */\r\n PersistentListenStream.prototype.watch = function (queryData) {\r\n var request = {};\r\n request.database = this.serializer.encodedDatabaseId;\r\n request.addTarget = this.serializer.toTarget(queryData);\r\n var labels = this.serializer.toListenRequestLabels(queryData);\r\n if (labels) {\r\n request.labels = labels;\r\n }\r\n this.sendRequest(request);\r\n };\r\n /**\r\n * Unregisters interest in the results of the query associated with the\r\n * given targetId.\r\n */\r\n PersistentListenStream.prototype.unwatch = function (targetId) {\r\n var request = {};\r\n request.database = this.serializer.encodedDatabaseId;\r\n request.removeTarget = targetId;\r\n this.sendRequest(request);\r\n };\r\n return PersistentListenStream;\r\n}(PersistentStream));\r\n/**\r\n * A Stream that implements the Write RPC.\r\n *\r\n * The Write RPC requires the caller to maintain special streamToken\r\n * state in between calls, to help the server understand which responses the\r\n * client has processed by the time the next request is made. Every response\r\n * will contain a streamToken; this value must be passed to the next\r\n * request.\r\n *\r\n * After calling start() on this stream, the next request must be a handshake,\r\n * containing whatever streamToken is on hand. Once a response to this\r\n * request is received, all pending mutations may be submitted. When\r\n * submitting multiple batches of mutations at the same time, it's\r\n * okay to use the same streamToken for the calls to writeMutations.\r\n *\r\n * TODO(b/33271235): Use proto types\r\n */\r\nvar PersistentWriteStream = /** @class */ (function (_super) {\r\n tslib_1.__extends(PersistentWriteStream, _super);\r\n function PersistentWriteStream(queue, connection, credentials, serializer, listener) {\r\n var _this = _super.call(this, queue, TimerId.WriteStreamConnectionBackoff, TimerId.WriteStreamIdle, connection, credentials, listener) || this;\r\n _this.serializer = serializer;\r\n _this.handshakeComplete_ = false;\r\n return _this;\r\n }\r\n Object.defineProperty(PersistentWriteStream.prototype, \"handshakeComplete\", {\r\n /**\r\n * Tracks whether or not a handshake has been successfully exchanged and\r\n * the stream is ready to accept mutations.\r\n */\r\n get: function () {\r\n return this.handshakeComplete_;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n // Override of PersistentStream.start\r\n PersistentWriteStream.prototype.start = function () {\r\n this.handshakeComplete_ = false;\r\n _super.prototype.start.call(this);\r\n };\r\n PersistentWriteStream.prototype.tearDown = function () {\r\n if (this.handshakeComplete_) {\r\n this.writeMutations([]);\r\n }\r\n };\r\n PersistentWriteStream.prototype.startRpc = function (token) {\r\n return this.connection.openStream('Write', token);\r\n };\r\n PersistentWriteStream.prototype.onMessage = function (responseProto) {\r\n // Always capture the last stream token.\r\n assert(!!responseProto.streamToken, 'Got a write response without a stream token');\r\n this.lastStreamToken = responseProto.streamToken;\r\n if (!this.handshakeComplete_) {\r\n // The first response is always the handshake response\r\n assert(!responseProto.writeResults || responseProto.writeResults.length === 0, 'Got mutation results for handshake');\r\n this.handshakeComplete_ = true;\r\n return this.listener.onHandshakeComplete();\r\n }\r\n else {\r\n // A successful first write response means the stream is healthy,\r\n // Note, that we could consider a successful handshake healthy, however,\r\n // the write itself might be causing an error we want to back off from.\r\n this.backoff.reset();\r\n var results = this.serializer.fromWriteResults(responseProto.writeResults, responseProto.commitTime);\r\n var commitVersion = this.serializer.fromVersion(responseProto.commitTime);\r\n return this.listener.onMutationResult(commitVersion, results);\r\n }\r\n };\r\n /**\r\n * Sends an initial streamToken to the server, performing the handshake\r\n * required to make the StreamingWrite RPC work. Subsequent\r\n * calls should wait until onHandshakeComplete was called.\r\n */\r\n PersistentWriteStream.prototype.writeHandshake = function () {\r\n assert(this.isOpen(), 'Writing handshake requires an opened stream');\r\n assert(!this.handshakeComplete_, 'Handshake already completed');\r\n // TODO(dimond): Support stream resumption. We intentionally do not set the\r\n // stream token on the handshake, ignoring any stream token we might have.\r\n var request = {};\r\n request.database = this.serializer.encodedDatabaseId;\r\n this.sendRequest(request);\r\n };\r\n /** Sends a group of mutations to the Firestore backend to apply. */\r\n PersistentWriteStream.prototype.writeMutations = function (mutations) {\r\n var _this = this;\r\n assert(this.isOpen(), 'Writing mutations requires an opened stream');\r\n assert(this.handshakeComplete_, 'Handshake must be complete before writing mutations');\r\n assert(this.lastStreamToken.length > 0, 'Trying to write mutation without a token');\r\n var request = {\r\n // Protos are typed with string, but we support UInt8Array on Node\r\n // tslint:disable-next-line:no-any\r\n streamToken: this.lastStreamToken,\r\n writes: mutations.map(function (mutation) { return _this.serializer.toMutation(mutation); })\r\n };\r\n this.sendRequest(request);\r\n };\r\n return PersistentWriteStream;\r\n}(PersistentStream));\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Datastore is a wrapper around the external Google Cloud Datastore grpc API,\r\n * which provides an interface that is more convenient for the rest of the\r\n * client SDK architecture to consume.\r\n */\r\nvar Datastore = /** @class */ (function () {\r\n function Datastore(queue, connection, credentials, serializer) {\r\n this.queue = queue;\r\n this.connection = connection;\r\n this.credentials = credentials;\r\n this.serializer = serializer;\r\n }\r\n Datastore.prototype.newPersistentWriteStream = function (listener) {\r\n return new PersistentWriteStream(this.queue, this.connection, this.credentials, this.serializer, listener);\r\n };\r\n Datastore.prototype.newPersistentWatchStream = function (listener) {\r\n return new PersistentListenStream(this.queue, this.connection, this.credentials, this.serializer, listener);\r\n };\r\n Datastore.prototype.commit = function (mutations) {\r\n var _this = this;\r\n var params = {\r\n database: this.serializer.encodedDatabaseId,\r\n writes: mutations.map(function (m) { return _this.serializer.toMutation(m); })\r\n };\r\n return this.invokeRPC('Commit', params).then(function (response) {\r\n return _this.serializer.fromWriteResults(response.writeResults, response.commitTime);\r\n });\r\n };\r\n Datastore.prototype.lookup = function (keys) {\r\n var _this = this;\r\n var params = {\r\n database: this.serializer.encodedDatabaseId,\r\n documents: keys.map(function (k) { return _this.serializer.toName(k); })\r\n };\r\n return this.invokeStreamingRPC('BatchGetDocuments', params).then(function (response) {\r\n var docs = maybeDocumentMap();\r\n response.forEach(function (proto) {\r\n var doc = _this.serializer.fromMaybeDocument(proto);\r\n docs = docs.insert(doc.key, doc);\r\n });\r\n var result = [];\r\n keys.forEach(function (key) {\r\n var doc = docs.get(key);\r\n assert(!!doc, 'Missing entity in write response for ' + key);\r\n result.push(doc);\r\n });\r\n return result;\r\n });\r\n };\r\n /** Gets an auth token and invokes the provided RPC. */\r\n Datastore.prototype.invokeRPC = function (rpcName, request) {\r\n var _this = this;\r\n return this.credentials\r\n .getToken()\r\n .then(function (token) {\r\n return _this.connection.invokeRPC(rpcName, request, token);\r\n })\r\n .catch(function (error) {\r\n if (error.code === Code.UNAUTHENTICATED) {\r\n _this.credentials.invalidateToken();\r\n }\r\n throw error;\r\n });\r\n };\r\n /** Gets an auth token and invokes the provided RPC with streamed results. */\r\n Datastore.prototype.invokeStreamingRPC = function (rpcName, request) {\r\n var _this = this;\r\n return this.credentials\r\n .getToken()\r\n .then(function (token) {\r\n return _this.connection.invokeStreamingRPC(rpcName, request, token);\r\n })\r\n .catch(function (error) {\r\n if (error.code === Code.UNAUTHENTICATED) {\r\n _this.credentials.invalidateToken();\r\n }\r\n throw error;\r\n });\r\n };\r\n return Datastore;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Internal transaction object responsible for accumulating the mutations to\r\n * perform and the base versions for any documents read.\r\n */\r\nvar Transaction = /** @class */ (function () {\r\n function Transaction(datastore) {\r\n this.datastore = datastore;\r\n // The version of each document that was read during this transaction.\r\n this.readVersions = documentVersionMap();\r\n this.mutations = [];\r\n this.committed = false;\r\n }\r\n Transaction.prototype.recordVersion = function (doc) {\r\n var docVersion;\r\n if (doc instanceof Document) {\r\n docVersion = doc.version;\r\n }\r\n else if (doc instanceof NoDocument) {\r\n // For deleted docs, we must use baseVersion 0 when we overwrite them.\r\n docVersion = SnapshotVersion.forDeletedDoc();\r\n }\r\n else {\r\n throw fail('Document in a transaction was a ' + doc.constructor.name);\r\n }\r\n var existingVersion = this.readVersions.get(doc.key);\r\n if (existingVersion !== null) {\r\n if (!docVersion.isEqual(existingVersion)) {\r\n // This transaction will fail no matter what.\r\n throw new FirestoreError(Code.ABORTED, 'Document version changed between two reads.');\r\n }\r\n }\r\n else {\r\n this.readVersions = this.readVersions.insert(doc.key, docVersion);\r\n }\r\n };\r\n Transaction.prototype.lookup = function (keys) {\r\n var _this = this;\r\n if (this.committed) {\r\n return Promise.reject('Transaction has already completed.');\r\n }\r\n if (this.mutations.length > 0) {\r\n return Promise.reject('Transactions lookups are invalid after writes.');\r\n }\r\n return this.datastore.lookup(keys).then(function (docs) {\r\n docs.forEach(function (doc) {\r\n if (doc instanceof NoDocument || doc instanceof Document) {\r\n _this.recordVersion(doc);\r\n }\r\n else {\r\n fail('Document in a transaction was a ' + doc.constructor.name);\r\n }\r\n });\r\n return docs;\r\n });\r\n };\r\n Transaction.prototype.write = function (mutations) {\r\n if (this.committed) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'Transaction has already completed.');\r\n }\r\n this.mutations = this.mutations.concat(mutations);\r\n };\r\n /**\r\n * Returns the version of this document when it was read in this transaction,\r\n * as a precondition, or no precondition if it was not read.\r\n */\r\n Transaction.prototype.precondition = function (key) {\r\n var version = this.readVersions.get(key);\r\n if (version) {\r\n return Precondition.updateTime(version);\r\n }\r\n else {\r\n return Precondition.NONE;\r\n }\r\n };\r\n /**\r\n * Returns the precondition for a document if the operation is an update.\r\n */\r\n Transaction.prototype.preconditionForUpdate = function (key) {\r\n var version = this.readVersions.get(key);\r\n if (version && version.isEqual(SnapshotVersion.forDeletedDoc())) {\r\n // The document doesn't exist, so fail the transaction.\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, \"Can't update a document that doesn't exist.\");\r\n }\r\n else if (version) {\r\n // Document exists, base precondition on document update time.\r\n return Precondition.updateTime(version);\r\n }\r\n else {\r\n // Document was not read, so we just use the preconditions for a blind\r\n // update.\r\n return Precondition.exists(true);\r\n }\r\n };\r\n Transaction.prototype.set = function (key, data) {\r\n this.write(data.toMutations(key, this.precondition(key)));\r\n };\r\n Transaction.prototype.update = function (key, data) {\r\n this.write(data.toMutations(key, this.preconditionForUpdate(key)));\r\n };\r\n Transaction.prototype.delete = function (key) {\r\n this.write([new DeleteMutation(key, this.precondition(key))]);\r\n // Since the delete will be applied before all following writes, we need to\r\n // ensure that the precondition for the next write will be exists: false.\r\n this.readVersions = this.readVersions.insert(key, SnapshotVersion.forDeletedDoc());\r\n };\r\n Transaction.prototype.commit = function () {\r\n var _this = this;\r\n var unwritten = this.readVersions;\r\n // For each mutation, note that the doc was written.\r\n this.mutations.forEach(function (mutation) {\r\n unwritten = unwritten.remove(mutation.key);\r\n });\r\n if (!unwritten.isEmpty()) {\r\n return Promise.reject(Error('Every document read in a transaction must also be written.'));\r\n }\r\n return this.datastore.commit(this.mutations).then(function () {\r\n _this.committed = true;\r\n });\r\n };\r\n return Transaction;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Describes the online state of the Firestore client. Note that this does not\r\n * indicate whether or not the remote store is trying to connect or not. This is\r\n * primarily used by the View / EventManager code to change their behavior while\r\n * offline (e.g. get() calls shouldn't wait for data from the server and\r\n * snapshot events should set metadata.isFromCache=true).\r\n */\r\nvar OnlineState;\r\n(function (OnlineState) {\r\n /**\r\n * The Firestore client is in an unknown online state. This means the client\r\n * is either not actively trying to establish a connection or it is currently\r\n * trying to establish a connection, but it has not succeeded or failed yet.\r\n * Higher-level components should not operate in offline mode.\r\n */\r\n OnlineState[OnlineState[\"Unknown\"] = 0] = \"Unknown\";\r\n /**\r\n * The client is connected and the connections are healthy. This state is\r\n * reached after a successful connection and there has been at least one\r\n * successful message received from the backends.\r\n */\r\n OnlineState[OnlineState[\"Online\"] = 1] = \"Online\";\r\n /**\r\n * The client is either trying to establish a connection but failing, or it\r\n * has been explicitly marked offline via a call to disableNetwork().\r\n * Higher-level components should operate in offline mode.\r\n */\r\n OnlineState[OnlineState[\"Offline\"] = 2] = \"Offline\";\r\n})(OnlineState || (OnlineState = {}));\r\n/** The source of an online state event. */\r\nvar OnlineStateSource;\r\n(function (OnlineStateSource) {\r\n OnlineStateSource[OnlineStateSource[\"RemoteStore\"] = 0] = \"RemoteStore\";\r\n OnlineStateSource[OnlineStateSource[\"SharedClientState\"] = 1] = \"SharedClientState\";\r\n})(OnlineStateSource || (OnlineStateSource = {}));\n\n/**\r\n * Copyright 2018 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$7 = 'OnlineStateTracker';\r\n// To deal with transient failures, we allow multiple stream attempts before\r\n// giving up and transitioning from OnlineState.Unknown to Offline.\r\n// TODO(mikelehen): This used to be set to 2 as a mitigation for b/66228394.\r\n// @jdimond thinks that bug is sufficiently fixed so that we can set this back\r\n// to 1. If that works okay, we could potentially remove this logic entirely.\r\nvar MAX_WATCH_STREAM_FAILURES = 1;\r\n// To deal with stream attempts that don't succeed or fail in a timely manner,\r\n// we have a timeout for OnlineState to reach Online or Offline.\r\n// If the timeout is reached, we transition to Offline rather than waiting\r\n// indefinitely.\r\nvar ONLINE_STATE_TIMEOUT_MS = 10 * 1000;\r\n/**\r\n * A component used by the RemoteStore to track the OnlineState (that is,\r\n * whether or not the client as a whole should be considered to be online or\r\n * offline), implementing the appropriate heuristics.\r\n *\r\n * In particular, when the client is trying to connect to the backend, we\r\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\r\n * a connection to succeed. If we have too many failures or the timeout elapses,\r\n * then we set the OnlineState to Offline, and the client will behave as if\r\n * it is offline (get()s will return cached data, etc.).\r\n */\r\nvar OnlineStateTracker = /** @class */ (function () {\r\n function OnlineStateTracker(asyncQueue, onlineStateHandler) {\r\n this.asyncQueue = asyncQueue;\r\n this.onlineStateHandler = onlineStateHandler;\r\n /** The current OnlineState. */\r\n this.state = OnlineState.Unknown;\r\n /**\r\n * A count of consecutive failures to open the stream. If it reaches the\r\n * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\r\n * Offline.\r\n */\r\n this.watchStreamFailures = 0;\r\n /**\r\n * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\r\n * transition from OnlineState.Unknown to OnlineState.Offline without waiting\r\n * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\r\n */\r\n this.onlineStateTimer = null;\r\n /**\r\n * Whether the client should log a warning message if it fails to connect to\r\n * the backend (initially true, cleared after a successful stream, or if we've\r\n * logged the message already).\r\n */\r\n this.shouldWarnClientIsOffline = true;\r\n }\r\n /**\r\n * Called by RemoteStore when a watch stream is started (including on each\r\n * backoff attempt).\r\n *\r\n * If this is the first attempt, it sets the OnlineState to Unknown and starts\r\n * the onlineStateTimer.\r\n */\r\n OnlineStateTracker.prototype.handleWatchStreamStart = function () {\r\n var _this = this;\r\n if (this.watchStreamFailures === 0) {\r\n this.setAndBroadcast(OnlineState.Unknown);\r\n assert(this.onlineStateTimer === null, \"onlineStateTimer shouldn't be started yet\");\r\n this.onlineStateTimer = this.asyncQueue.enqueueAfterDelay(TimerId.OnlineStateTimeout, ONLINE_STATE_TIMEOUT_MS, function () {\r\n _this.onlineStateTimer = null;\r\n assert(_this.state === OnlineState.Unknown, 'Timer should be canceled if we transitioned to a different state.');\r\n _this.logClientOfflineWarningIfNecessary(\"Backend didn't respond within \" + ONLINE_STATE_TIMEOUT_MS / 1000 + \" \" +\r\n \"seconds.\");\r\n _this.setAndBroadcast(OnlineState.Offline);\r\n // NOTE: handleWatchStreamFailure() will continue to increment\r\n // watchStreamFailures even though we are already marked Offline,\r\n // but this is non-harmful.\r\n return Promise.resolve();\r\n });\r\n }\r\n };\r\n /**\r\n * Updates our OnlineState as appropriate after the watch stream reports a\r\n * failure. The first failure moves us to the 'Unknown' state. We then may\r\n * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\r\n * actually transition to the 'Offline' state.\r\n */\r\n OnlineStateTracker.prototype.handleWatchStreamFailure = function (error$$1) {\r\n if (this.state === OnlineState.Online) {\r\n this.setAndBroadcast(OnlineState.Unknown);\r\n // To get to OnlineState.Online, set() must have been called which would\r\n // have reset our heuristics.\r\n assert(this.watchStreamFailures === 0, 'watchStreamFailures must be 0');\r\n assert(this.onlineStateTimer === null, 'onlineStateTimer must be null');\r\n }\r\n else {\r\n this.watchStreamFailures++;\r\n if (this.watchStreamFailures >= MAX_WATCH_STREAM_FAILURES) {\r\n this.clearOnlineStateTimer();\r\n this.logClientOfflineWarningIfNecessary(\"Connection failed \" + MAX_WATCH_STREAM_FAILURES + \" \" +\r\n (\"times. Most recent error: \" + error$$1.toString()));\r\n this.setAndBroadcast(OnlineState.Offline);\r\n }\r\n }\r\n };\r\n /**\r\n * Explicitly sets the OnlineState to the specified state.\r\n *\r\n * Note that this resets our timers / failure counters, etc. used by our\r\n * Offline heuristics, so must not be used in place of\r\n * handleWatchStreamStart() and handleWatchStreamFailure().\r\n */\r\n OnlineStateTracker.prototype.set = function (newState) {\r\n this.clearOnlineStateTimer();\r\n this.watchStreamFailures = 0;\r\n if (newState === OnlineState.Online) {\r\n // We've connected to watch at least once. Don't warn the developer\r\n // about being offline going forward.\r\n this.shouldWarnClientIsOffline = false;\r\n }\r\n this.setAndBroadcast(newState);\r\n };\r\n OnlineStateTracker.prototype.setAndBroadcast = function (newState) {\r\n if (newState !== this.state) {\r\n this.state = newState;\r\n this.onlineStateHandler(newState);\r\n }\r\n };\r\n OnlineStateTracker.prototype.logClientOfflineWarningIfNecessary = function (details) {\r\n var message = \"Could not reach Cloud Firestore backend. \" + details + \"\\n\" +\r\n \"This typically indicates that your device does not have a healthy \" +\r\n \"Internet connection at the moment. The client will operate in offline \" +\r\n \"mode until it is able to successfully connect to the backend.\";\r\n if (this.shouldWarnClientIsOffline) {\r\n error(message);\r\n this.shouldWarnClientIsOffline = false;\r\n }\r\n else {\r\n debug(LOG_TAG$7, message);\r\n }\r\n };\r\n OnlineStateTracker.prototype.clearOnlineStateTimer = function () {\r\n if (this.onlineStateTimer !== null) {\r\n this.onlineStateTimer.cancel();\r\n this.onlineStateTimer = null;\r\n }\r\n };\r\n return OnlineStateTracker;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$8 = 'RemoteStore';\r\n// TODO(b/35853402): Negotiate this with the stream.\r\nvar MAX_PENDING_WRITES = 10;\r\n/**\r\n * RemoteStore - An interface to remotely stored data, basically providing a\r\n * wrapper around the Datastore that is more reliable for the rest of the\r\n * system.\r\n *\r\n * RemoteStore is responsible for maintaining the connection to the server.\r\n * - maintaining a list of active listens.\r\n * - reconnecting when the connection is dropped.\r\n * - resuming all the active listens on reconnect.\r\n *\r\n * RemoteStore handles all incoming events from the Datastore.\r\n * - listening to the watch stream and repackaging the events as RemoteEvents\r\n * - notifying SyncEngine of any changes to the active listens.\r\n *\r\n * RemoteStore takes writes from other components and handles them reliably.\r\n * - pulling pending mutations from LocalStore and sending them to Datastore.\r\n * - retrying mutations that failed because of network problems.\r\n * - acking mutations to the SyncEngine once they are accepted or rejected.\r\n */\r\nvar RemoteStore = /** @class */ (function () {\r\n function RemoteStore(\r\n /**\r\n * The local store, used to fill the write pipeline with outbound mutations.\r\n */\r\n localStore, \r\n /** The client-side proxy for interacting with the backend. */\r\n datastore, asyncQueue, onlineStateHandler) {\r\n this.localStore = localStore;\r\n this.datastore = datastore;\r\n /**\r\n * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\r\n * LocalStore via fillWritePipeline() and have or will send to the write\r\n * stream.\r\n *\r\n * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\r\n * restart the write stream. When the stream is established the writes in the\r\n * pipeline will be sent in order.\r\n *\r\n * Writes remain in writePipeline until they are acknowledged by the backend\r\n * and thus will automatically be re-sent if the stream is interrupted /\r\n * restarted before they're acknowledged.\r\n *\r\n * Write responses from the backend are linked to their originating request\r\n * purely based on order, and so we can just shift() writes from the front of\r\n * the writePipeline as we receive responses.\r\n */\r\n this.writePipeline = [];\r\n /**\r\n * A mapping of watched targets that the client cares about tracking and the\r\n * user has explicitly called a 'listen' for this target.\r\n *\r\n * These targets may or may not have been sent to or acknowledged by the\r\n * server. On re-establishing the listen stream, these targets should be sent\r\n * to the server. The targets removed with unlistens are removed eagerly\r\n * without waiting for confirmation from the listen stream.\r\n */\r\n this.listenTargets = {};\r\n this.watchChangeAggregator = null;\r\n /**\r\n * Set to true by enableNetwork() and false by disableNetwork() and indicates\r\n * the user-preferred network state.\r\n */\r\n this.networkEnabled = false;\r\n this.isPrimary = false;\r\n this.onlineStateTracker = new OnlineStateTracker(asyncQueue, onlineStateHandler);\r\n // Create streams (but note they're not started yet).\r\n this.watchStream = this.datastore.newPersistentWatchStream({\r\n onOpen: this.onWatchStreamOpen.bind(this),\r\n onClose: this.onWatchStreamClose.bind(this),\r\n onWatchChange: this.onWatchStreamChange.bind(this)\r\n });\r\n this.writeStream = this.datastore.newPersistentWriteStream({\r\n onOpen: this.onWriteStreamOpen.bind(this),\r\n onClose: this.onWriteStreamClose.bind(this),\r\n onHandshakeComplete: this.onWriteHandshakeComplete.bind(this),\r\n onMutationResult: this.onMutationResult.bind(this)\r\n });\r\n }\r\n /**\r\n * Starts up the remote store, creating streams, restoring state from\r\n * LocalStore, etc.\r\n */\r\n RemoteStore.prototype.start = function () {\r\n return this.enableNetwork();\r\n };\r\n /** Re-enables the network. Idempotent. */\r\n RemoteStore.prototype.enableNetwork = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _a;\r\n return tslib_1.__generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.networkEnabled = true;\r\n if (!this.canUseNetwork()) return [3 /*break*/, 3];\r\n _a = this.writeStream;\r\n return [4 /*yield*/, this.localStore.getLastStreamToken()];\r\n case 1:\r\n _a.lastStreamToken = _b.sent();\r\n if (this.shouldStartWatchStream()) {\r\n this.startWatchStream();\r\n }\r\n else {\r\n this.onlineStateTracker.set(OnlineState.Unknown);\r\n }\r\n // This will start the write stream if necessary.\r\n return [4 /*yield*/, this.fillWritePipeline()];\r\n case 2:\r\n // This will start the write stream if necessary.\r\n _b.sent();\r\n _b.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Temporarily disables the network. The network can be re-enabled using\r\n * enableNetwork().\r\n */\r\n RemoteStore.prototype.disableNetwork = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.networkEnabled = false;\r\n return [4 /*yield*/, this.disableNetworkInternal()];\r\n case 1:\r\n _a.sent();\r\n // Set the OnlineState to Offline so get()s return from cache, etc.\r\n this.onlineStateTracker.set(OnlineState.Offline);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n RemoteStore.prototype.disableNetworkInternal = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.writeStream.stop()];\r\n case 1:\r\n _a.sent();\r\n return [4 /*yield*/, this.watchStream.stop()];\r\n case 2:\r\n _a.sent();\r\n if (this.writePipeline.length > 0) {\r\n debug(LOG_TAG$8, \"Stopping write stream with \" + this.writePipeline.length + \" pending writes\");\r\n this.writePipeline = [];\r\n }\r\n this.cleanUpWatchStreamState();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n RemoteStore.prototype.shutdown = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n debug(LOG_TAG$8, 'RemoteStore shutting down.');\r\n this.networkEnabled = false;\r\n return [4 /*yield*/, this.disableNetworkInternal()];\r\n case 1:\r\n _a.sent();\r\n // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\r\n // triggering spurious listener events with cached data, etc.\r\n this.onlineStateTracker.set(OnlineState.Unknown);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /** Starts new listen for the given query. Uses resume token if provided */\r\n RemoteStore.prototype.listen = function (queryData) {\r\n assert(!contains(this.listenTargets, queryData.targetId), 'listen called with duplicate targetId!');\r\n // Mark this as something the client is currently listening for.\r\n this.listenTargets[queryData.targetId] = queryData;\r\n if (this.shouldStartWatchStream()) {\r\n // The listen will be sent in onWatchStreamOpen\r\n this.startWatchStream();\r\n }\r\n else if (this.watchStream.isOpen()) {\r\n this.sendWatchRequest(queryData);\r\n }\r\n };\r\n /** Removes the listen from server */\r\n RemoteStore.prototype.unlisten = function (targetId) {\r\n assert(contains(this.listenTargets, targetId), 'unlisten called without assigned target ID!');\r\n delete this.listenTargets[targetId];\r\n if (this.watchStream.isOpen()) {\r\n this.sendUnwatchRequest(targetId);\r\n }\r\n if (isEmpty(this.listenTargets)) {\r\n if (this.watchStream.isOpen()) {\r\n this.watchStream.markIdle();\r\n }\r\n else if (this.canUseNetwork()) {\r\n // Revert to OnlineState.Unknown if the watch stream is not open and we\r\n // have no listeners, since without any listens to send we cannot\r\n // confirm if the stream is healthy and upgrade to OnlineState.Online.\r\n this.onlineStateTracker.set(OnlineState.Unknown);\r\n }\r\n }\r\n };\r\n /** {@link TargetMetadataProvider.getQueryDataForTarget} */\r\n RemoteStore.prototype.getQueryDataForTarget = function (targetId) {\r\n return this.listenTargets[targetId] || null;\r\n };\r\n /** {@link TargetMetadataProvider.getRemoteKeysForTarget} */\r\n RemoteStore.prototype.getRemoteKeysForTarget = function (targetId) {\r\n return this.syncEngine.getRemoteKeysForTarget(targetId);\r\n };\r\n /**\r\n * We need to increment the the expected number of pending responses we're due\r\n * from watch so we wait for the ack to process any messages from this target.\r\n */\r\n RemoteStore.prototype.sendWatchRequest = function (queryData) {\r\n this.watchChangeAggregator.recordPendingTargetRequest(queryData.targetId);\r\n this.watchStream.watch(queryData);\r\n };\r\n /**\r\n * We need to increment the expected number of pending responses we're due\r\n * from watch so we wait for the removal on the server before we process any\r\n * messages from this target.\r\n */\r\n RemoteStore.prototype.sendUnwatchRequest = function (targetId) {\r\n this.watchChangeAggregator.recordPendingTargetRequest(targetId);\r\n this.watchStream.unwatch(targetId);\r\n };\r\n RemoteStore.prototype.startWatchStream = function () {\r\n assert(this.shouldStartWatchStream(), 'startWatchStream() called when shouldStartWatchStream() is false.');\r\n this.watchChangeAggregator = new WatchChangeAggregator(this);\r\n this.watchStream.start();\r\n this.onlineStateTracker.handleWatchStreamStart();\r\n };\r\n /**\r\n * Returns whether the watch stream should be started because it's necessary\r\n * and has not yet been started.\r\n */\r\n RemoteStore.prototype.shouldStartWatchStream = function () {\r\n return (this.canUseNetwork() &&\r\n !this.watchStream.isStarted() &&\r\n !isEmpty(this.listenTargets));\r\n };\r\n RemoteStore.prototype.canUseNetwork = function () {\r\n return this.isPrimary && this.networkEnabled;\r\n };\r\n RemoteStore.prototype.cleanUpWatchStreamState = function () {\r\n this.watchChangeAggregator = null;\r\n };\r\n RemoteStore.prototype.onWatchStreamOpen = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return tslib_1.__generator(this, function (_a) {\r\n forEachNumber(this.listenTargets, function (targetId, queryData) {\r\n _this.sendWatchRequest(queryData);\r\n });\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n RemoteStore.prototype.onWatchStreamClose = function (error$$1) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n if (error$$1 === undefined) {\r\n // Graceful stop (due to stop() or idle timeout). Make sure that's\r\n // desirable.\r\n assert(!this.shouldStartWatchStream(), 'Watch stream was stopped gracefully while still needed.');\r\n }\r\n this.cleanUpWatchStreamState();\r\n // If we still need the watch stream, retry the connection.\r\n if (this.shouldStartWatchStream()) {\r\n this.onlineStateTracker.handleWatchStreamFailure(error$$1);\r\n this.startWatchStream();\r\n }\r\n else {\r\n // No need to restart watch stream because there are no active targets.\r\n // The online state is set to unknown because there is no active attempt\r\n // at establishing a connection\r\n this.onlineStateTracker.set(OnlineState.Unknown);\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n RemoteStore.prototype.onWatchStreamChange = function (watchChange, snapshotVersion) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var lastRemoteSnapshotVersion;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Mark the client as online since we got a message from the server\r\n this.onlineStateTracker.set(OnlineState.Online);\r\n if (watchChange instanceof WatchTargetChange &&\r\n watchChange.state === WatchTargetChangeState.Removed &&\r\n watchChange.cause) {\r\n // There was an error on a target, don't wait for a consistent snapshot\r\n // to raise events\r\n return [2 /*return*/, this.handleTargetError(watchChange)];\r\n }\r\n if (watchChange instanceof DocumentWatchChange) {\r\n this.watchChangeAggregator.handleDocumentChange(watchChange);\r\n }\r\n else if (watchChange instanceof ExistenceFilterChange) {\r\n this.watchChangeAggregator.handleExistenceFilter(watchChange);\r\n }\r\n else {\r\n assert(watchChange instanceof WatchTargetChange, 'Expected watchChange to be an instance of WatchTargetChange');\r\n this.watchChangeAggregator.handleTargetChange(watchChange);\r\n }\r\n if (!!snapshotVersion.isEqual(SnapshotVersion.MIN)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, this.localStore.getLastRemoteSnapshotVersion()];\r\n case 1:\r\n lastRemoteSnapshotVersion = _a.sent();\r\n if (!(snapshotVersion.compareTo(lastRemoteSnapshotVersion) >= 0)) return [3 /*break*/, 3];\r\n // We have received a target change with a global snapshot if the snapshot\r\n // version is not equal to SnapshotVersion.MIN.\r\n return [4 /*yield*/, this.raiseWatchSnapshot(snapshotVersion)];\r\n case 2:\r\n // We have received a target change with a global snapshot if the snapshot\r\n // version is not equal to SnapshotVersion.MIN.\r\n _a.sent();\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Takes a batch of changes from the Datastore, repackages them as a\r\n * RemoteEvent, and passes that on to the listener, which is typically the\r\n * SyncEngine.\r\n */\r\n RemoteStore.prototype.raiseWatchSnapshot = function (snapshotVersion) {\r\n var _this = this;\r\n assert(!snapshotVersion.isEqual(SnapshotVersion.MIN), \"Can't raise event for unknown SnapshotVersion\");\r\n var remoteEvent = this.watchChangeAggregator.createRemoteEvent(snapshotVersion);\r\n // Update in-memory resume tokens. LocalStore will update the\r\n // persistent view of these when applying the completed RemoteEvent.\r\n forEachNumber(remoteEvent.targetChanges, function (targetId, change) {\r\n if (change.resumeToken.length > 0) {\r\n var queryData = _this.listenTargets[targetId];\r\n // A watched target might have been removed already.\r\n if (queryData) {\r\n _this.listenTargets[targetId] = queryData.copy({\r\n resumeToken: change.resumeToken,\r\n snapshotVersion: snapshotVersion\r\n });\r\n }\r\n }\r\n });\r\n // Re-establish listens for the targets that have been invalidated by\r\n // existence filter mismatches.\r\n remoteEvent.targetMismatches.forEach(function (targetId) {\r\n var queryData = _this.listenTargets[targetId];\r\n if (!queryData) {\r\n // A watched target might have been removed already.\r\n return;\r\n }\r\n // Clear the resume token for the query, since we're in a known mismatch\r\n // state.\r\n _this.listenTargets[targetId] = queryData.copy({\r\n resumeToken: emptyByteString()\r\n });\r\n // Cause a hard reset by unwatching and rewatching immediately, but\r\n // deliberately don't send a resume token so that we get a full update.\r\n _this.sendUnwatchRequest(targetId);\r\n // Mark the query we send as being on behalf of an existence filter\r\n // mismatch, but don't actually retain that in listenTargets. This ensures\r\n // that we flag the first re-listen this way without impacting future\r\n // listens of this target (that might happen e.g. on reconnect).\r\n var requestQueryData = new QueryData(queryData.query, targetId, QueryPurpose.ExistenceFilterMismatch, queryData.sequenceNumber);\r\n _this.sendWatchRequest(requestQueryData);\r\n });\r\n // Finally raise remote event\r\n return this.syncEngine.applyRemoteEvent(remoteEvent);\r\n };\r\n /** Handles an error on a target */\r\n RemoteStore.prototype.handleTargetError = function (watchChange) {\r\n var _this = this;\r\n assert(!!watchChange.cause, 'Handling target error without a cause');\r\n var error$$1 = watchChange.cause;\r\n var promiseChain = Promise.resolve();\r\n watchChange.targetIds.forEach(function (targetId) {\r\n promiseChain = promiseChain.then(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n // A watched target might have been removed already.\r\n if (contains(this.listenTargets, targetId)) {\r\n delete this.listenTargets[targetId];\r\n this.watchChangeAggregator.removeTarget(targetId);\r\n return [2 /*return*/, this.syncEngine.rejectListen(targetId, error$$1)];\r\n }\r\n return [2 /*return*/];\r\n });\r\n }); });\r\n });\r\n return promiseChain;\r\n };\r\n /**\r\n * Attempts to fill our write pipeline with writes from the LocalStore.\r\n *\r\n * Called internally to bootstrap or refill the write pipeline and by\r\n * SyncEngine whenever there are new mutations to process.\r\n *\r\n * Starts the write stream if necessary.\r\n */\r\n RemoteStore.prototype.fillWritePipeline = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var lastBatchIdRetrieved, batch;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.canAddToWritePipeline()) return [3 /*break*/, 4];\r\n lastBatchIdRetrieved = this.writePipeline.length > 0\r\n ? this.writePipeline[this.writePipeline.length - 1].batchId\r\n : BATCHID_UNKNOWN;\r\n return [4 /*yield*/, this.localStore.nextMutationBatch(lastBatchIdRetrieved)];\r\n case 1:\r\n batch = _a.sent();\r\n if (!(batch === null)) return [3 /*break*/, 2];\r\n if (this.writePipeline.length === 0) {\r\n this.writeStream.markIdle();\r\n }\r\n return [3 /*break*/, 4];\r\n case 2:\r\n this.addToWritePipeline(batch);\r\n return [4 /*yield*/, this.fillWritePipeline()];\r\n case 3:\r\n _a.sent();\r\n _a.label = 4;\r\n case 4:\r\n if (this.shouldStartWriteStream()) {\r\n this.startWriteStream();\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns true if we can add to the write pipeline (i.e. the network is\r\n * enabled and the write pipeline is not full).\r\n */\r\n RemoteStore.prototype.canAddToWritePipeline = function () {\r\n return (this.canUseNetwork() && this.writePipeline.length < MAX_PENDING_WRITES);\r\n };\r\n // For testing\r\n RemoteStore.prototype.outstandingWrites = function () {\r\n return this.writePipeline.length;\r\n };\r\n /**\r\n * Queues additional writes to be sent to the write stream, sending them\r\n * immediately if the write stream is established.\r\n */\r\n RemoteStore.prototype.addToWritePipeline = function (batch) {\r\n assert(this.canAddToWritePipeline(), 'addToWritePipeline called when pipeline is full');\r\n this.writePipeline.push(batch);\r\n if (this.writeStream.isOpen() && this.writeStream.handshakeComplete) {\r\n this.writeStream.writeMutations(batch.mutations);\r\n }\r\n };\r\n RemoteStore.prototype.shouldStartWriteStream = function () {\r\n return (this.canUseNetwork() &&\r\n !this.writeStream.isStarted() &&\r\n this.writePipeline.length > 0);\r\n };\r\n RemoteStore.prototype.startWriteStream = function () {\r\n assert(this.shouldStartWriteStream(), 'startWriteStream() called when shouldStartWriteStream() is false.');\r\n this.writeStream.start();\r\n };\r\n RemoteStore.prototype.onWriteStreamOpen = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n this.writeStream.writeHandshake();\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n RemoteStore.prototype.onWriteHandshakeComplete = function () {\r\n var _this = this;\r\n // Record the stream token.\r\n return this.localStore\r\n .setLastStreamToken(this.writeStream.lastStreamToken)\r\n .then(function () {\r\n // Send the write pipeline now that the stream is established.\r\n for (var _i = 0, _a = _this.writePipeline; _i < _a.length; _i++) {\r\n var batch = _a[_i];\r\n _this.writeStream.writeMutations(batch.mutations);\r\n }\r\n })\r\n .catch(function (err) { return _this.ignoreIfPrimaryLeaseLoss(err); });\r\n };\r\n /**\r\n * Verifies the error thrown by an LocalStore operation. If a LocalStore\r\n * operation fails because the primary lease has been taken by another client,\r\n * we ignore the error. All other errors are re-thrown.\r\n *\r\n * @param err An error returned by a LocalStore operation.\r\n * @return A Promise that resolves after we recovered, or the original error.\r\n */\r\n RemoteStore.prototype.ignoreIfPrimaryLeaseLoss = function (err) {\r\n if (isPrimaryLeaseLostError(err)) {\r\n debug(LOG_TAG$8, 'Unexpectedly lost primary lease');\r\n }\r\n else {\r\n throw err;\r\n }\r\n };\r\n RemoteStore.prototype.onMutationResult = function (commitVersion, results) {\r\n var _this = this;\r\n // This is a response to a write containing mutations and should be\r\n // correlated to the first write in our write pipeline.\r\n assert(this.writePipeline.length > 0, 'Got result for empty write pipeline');\r\n var batch = this.writePipeline.shift();\r\n var success = MutationBatchResult.from(batch, commitVersion, results, this.writeStream.lastStreamToken);\r\n return this.syncEngine.applySuccessfulWrite(success).then(function () {\r\n // It's possible that with the completion of this mutation another\r\n // slot has freed up.\r\n return _this.fillWritePipeline();\r\n });\r\n };\r\n RemoteStore.prototype.onWriteStreamClose = function (error$$1) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var errorHandling;\r\n return tslib_1.__generator(this, function (_a) {\r\n if (error$$1 === undefined) {\r\n // Graceful stop (due to stop() or idle timeout). Make sure that's\r\n // desirable.\r\n assert(!this.shouldStartWriteStream(), 'Write stream was stopped gracefully while still needed.');\r\n }\r\n // If the write stream closed due to an error, invoke the error callbacks if\r\n // there are pending writes.\r\n if (error$$1 && this.writePipeline.length > 0) {\r\n errorHandling = void 0;\r\n if (this.writeStream.handshakeComplete) {\r\n // This error affects the actual write.\r\n errorHandling = this.handleWriteError(error$$1);\r\n }\r\n else {\r\n // If there was an error before the handshake has finished, it's\r\n // possible that the server is unable to process the stream token\r\n // we're sending. (Perhaps it's too old?)\r\n errorHandling = this.handleHandshakeError(error$$1);\r\n }\r\n return [2 /*return*/, errorHandling.then(function () {\r\n // The write stream might have been started by refilling the write\r\n // pipeline for failed writes\r\n if (_this.shouldStartWriteStream()) {\r\n _this.startWriteStream();\r\n }\r\n })];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n RemoteStore.prototype.handleHandshakeError = function (error$$1) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return tslib_1.__generator(this, function (_a) {\r\n // Reset the token if it's a permanent error or the error code is\r\n // ABORTED, signaling the write stream is no longer valid.\r\n if (isPermanentError(error$$1.code) || error$$1.code === Code.ABORTED) {\r\n debug(LOG_TAG$8, 'RemoteStore error before completed handshake; resetting stream token: ', this.writeStream.lastStreamToken);\r\n this.writeStream.lastStreamToken = emptyByteString();\r\n return [2 /*return*/, this.localStore\r\n .setLastStreamToken(emptyByteString())\r\n .catch(function (err) { return _this.ignoreIfPrimaryLeaseLoss(err); })];\r\n }\r\n else {\r\n // Some other error, don't reset stream token. Our stream logic will\r\n // just retry with exponential backoff.\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n RemoteStore.prototype.handleWriteError = function (error$$1) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var batch;\r\n return tslib_1.__generator(this, function (_a) {\r\n if (isPermanentError(error$$1.code)) {\r\n batch = this.writePipeline.shift();\r\n // In this case it's also unlikely that the server itself is melting\r\n // down -- this was just a bad request so inhibit backoff on the next\r\n // restart.\r\n this.writeStream.inhibitBackoff();\r\n return [2 /*return*/, this.syncEngine\r\n .rejectFailedWrite(batch.batchId, error$$1)\r\n .then(function () {\r\n // It's possible that with the completion of this mutation\r\n // another slot has freed up.\r\n return _this.fillWritePipeline();\r\n })];\r\n }\r\n else {\r\n // Transient error, just let the retry logic kick in.\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n RemoteStore.prototype.createTransaction = function () {\r\n return new Transaction(this.datastore);\r\n };\r\n RemoteStore.prototype.handleCredentialChange = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.canUseNetwork()) return [3 /*break*/, 3];\r\n // Tear down and re-create our network streams. This will ensure we get a fresh auth token\r\n // for the new user and re-fill the write pipeline with new mutations from the LocalStore\r\n // (since mutations are per-user).\r\n debug(LOG_TAG$8, 'RemoteStore restarting streams for new credential');\r\n this.networkEnabled = false;\r\n return [4 /*yield*/, this.disableNetworkInternal()];\r\n case 1:\r\n _a.sent();\r\n this.onlineStateTracker.set(OnlineState.Unknown);\r\n return [4 /*yield*/, this.enableNetwork()];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Toggles the network state when the client gains or loses its primary lease.\r\n */\r\n RemoteStore.prototype.applyPrimaryState = function (isPrimary) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.isPrimary = isPrimary;\r\n if (!(isPrimary && this.networkEnabled)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.enableNetwork()];\r\n case 1:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 2:\r\n if (!!isPrimary) return [3 /*break*/, 4];\r\n return [4 /*yield*/, this.disableNetworkInternal()];\r\n case 3:\r\n _a.sent();\r\n this.onlineStateTracker.set(OnlineState.Unknown);\r\n _a.label = 4;\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return RemoteStore;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Holds the listeners and the last received ViewSnapshot for a query being\r\n * tracked by EventManager.\r\n */\r\nvar QueryListenersInfo = /** @class */ (function () {\r\n function QueryListenersInfo() {\r\n this.listeners = [];\r\n }\r\n return QueryListenersInfo;\r\n}());\r\n/**\r\n * EventManager is responsible for mapping queries to query event emitters.\r\n * It handles \"fan-out\". -- Identical queries will re-use the same watch on the\r\n * backend.\r\n */\r\nvar EventManager = /** @class */ (function () {\r\n function EventManager(syncEngine) {\r\n this.syncEngine = syncEngine;\r\n this.queries = new ObjectMap(function (q) {\r\n return q.canonicalId();\r\n });\r\n this.onlineState = OnlineState.Unknown;\r\n this.syncEngine.subscribe(this);\r\n }\r\n EventManager.prototype.listen = function (listener) {\r\n var query = listener.query;\r\n var firstListen = false;\r\n var queryInfo = this.queries.get(query);\r\n if (!queryInfo) {\r\n firstListen = true;\r\n queryInfo = new QueryListenersInfo();\r\n this.queries.set(query, queryInfo);\r\n }\r\n queryInfo.listeners.push(listener);\r\n listener.applyOnlineStateChange(this.onlineState);\r\n if (queryInfo.viewSnap)\r\n listener.onViewSnapshot(queryInfo.viewSnap);\r\n if (firstListen) {\r\n return this.syncEngine.listen(query).then(function (targetId) {\r\n queryInfo.targetId = targetId;\r\n return targetId;\r\n });\r\n }\r\n else {\r\n return Promise.resolve(queryInfo.targetId);\r\n }\r\n };\r\n EventManager.prototype.unlisten = function (listener) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var query, lastListen, queryInfo, i;\r\n return tslib_1.__generator(this, function (_a) {\r\n query = listener.query;\r\n lastListen = false;\r\n queryInfo = this.queries.get(query);\r\n if (queryInfo) {\r\n i = queryInfo.listeners.indexOf(listener);\r\n if (i >= 0) {\r\n queryInfo.listeners.splice(i, 1);\r\n lastListen = queryInfo.listeners.length === 0;\r\n }\r\n }\r\n if (lastListen) {\r\n this.queries.delete(query);\r\n return [2 /*return*/, this.syncEngine.unlisten(query)];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n EventManager.prototype.onWatchChange = function (viewSnaps) {\r\n for (var _i = 0, viewSnaps_1 = viewSnaps; _i < viewSnaps_1.length; _i++) {\r\n var viewSnap = viewSnaps_1[_i];\r\n var query = viewSnap.query;\r\n var queryInfo = this.queries.get(query);\r\n if (queryInfo) {\r\n for (var _a = 0, _b = queryInfo.listeners; _a < _b.length; _a++) {\r\n var listener = _b[_a];\r\n listener.onViewSnapshot(viewSnap);\r\n }\r\n queryInfo.viewSnap = viewSnap;\r\n }\r\n }\r\n };\r\n EventManager.prototype.onWatchError = function (query, error) {\r\n var queryInfo = this.queries.get(query);\r\n if (queryInfo) {\r\n for (var _i = 0, _a = queryInfo.listeners; _i < _a.length; _i++) {\r\n var listener = _a[_i];\r\n listener.onError(error);\r\n }\r\n }\r\n // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\r\n // after an error.\r\n this.queries.delete(query);\r\n };\r\n EventManager.prototype.onOnlineStateChange = function (onlineState) {\r\n this.onlineState = onlineState;\r\n this.queries.forEach(function (_, queryInfo) {\r\n for (var _i = 0, _a = queryInfo.listeners; _i < _a.length; _i++) {\r\n var listener = _a[_i];\r\n listener.applyOnlineStateChange(onlineState);\r\n }\r\n });\r\n };\r\n return EventManager;\r\n}());\r\n/**\r\n * QueryListener takes a series of internal view snapshots and determines\r\n * when to raise the event.\r\n *\r\n * It uses an Observer to dispatch events.\r\n */\r\nvar QueryListener = /** @class */ (function () {\r\n function QueryListener(query, queryObserver, options) {\r\n this.query = query;\r\n this.queryObserver = queryObserver;\r\n /**\r\n * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\r\n * observer. This flag is set to true once we've actually raised an event.\r\n */\r\n this.raisedInitialEvent = false;\r\n this.onlineState = OnlineState.Unknown;\r\n this.options = options || {};\r\n }\r\n QueryListener.prototype.onViewSnapshot = function (snap) {\r\n assert(snap.docChanges.length > 0 || snap.syncStateChanged, 'We got a new snapshot with no changes?');\r\n if (!this.options.includeMetadataChanges) {\r\n // Remove the metadata only changes.\r\n var docChanges = [];\r\n for (var _i = 0, _a = snap.docChanges; _i < _a.length; _i++) {\r\n var docChange = _a[_i];\r\n if (docChange.type !== ChangeType.Metadata) {\r\n docChanges.push(docChange);\r\n }\r\n }\r\n snap = new ViewSnapshot(snap.query, snap.docs, snap.oldDocs, docChanges, snap.mutatedKeys, snap.fromCache, snap.syncStateChanged, \r\n /* excludesMetadataChanges= */ true);\r\n }\r\n if (!this.raisedInitialEvent) {\r\n if (this.shouldRaiseInitialEvent(snap, this.onlineState)) {\r\n this.raiseInitialEvent(snap);\r\n }\r\n }\r\n else if (this.shouldRaiseEvent(snap)) {\r\n this.queryObserver.next(snap);\r\n }\r\n this.snap = snap;\r\n };\r\n QueryListener.prototype.onError = function (error) {\r\n this.queryObserver.error(error);\r\n };\r\n QueryListener.prototype.applyOnlineStateChange = function (onlineState) {\r\n this.onlineState = onlineState;\r\n if (this.snap &&\r\n !this.raisedInitialEvent &&\r\n this.shouldRaiseInitialEvent(this.snap, onlineState)) {\r\n this.raiseInitialEvent(this.snap);\r\n }\r\n };\r\n QueryListener.prototype.shouldRaiseInitialEvent = function (snap, onlineState) {\r\n assert(!this.raisedInitialEvent, 'Determining whether to raise first event but already had first event');\r\n // Always raise the first event when we're synced\r\n if (!snap.fromCache) {\r\n return true;\r\n }\r\n // NOTE: We consider OnlineState.Unknown as online (it should become Offline\r\n // or Online if we wait long enough).\r\n var maybeOnline = onlineState !== OnlineState.Offline;\r\n // Don't raise the event if we're online, aren't synced yet (checked\r\n // above) and are waiting for a sync.\r\n if (this.options.waitForSyncWhenOnline && maybeOnline) {\r\n assert(snap.fromCache, 'Waiting for sync, but snapshot is not from cache');\r\n return false;\r\n }\r\n // Raise data from cache if we have any documents or we are offline\r\n return !snap.docs.isEmpty() || onlineState === OnlineState.Offline;\r\n };\r\n QueryListener.prototype.shouldRaiseEvent = function (snap) {\r\n // We don't need to handle includeDocumentMetadataChanges here because\r\n // the Metadata only changes have already been stripped out if needed.\r\n // At this point the only changes we will see are the ones we should\r\n // propagate.\r\n if (snap.docChanges.length > 0) {\r\n return true;\r\n }\r\n var hasPendingWritesChanged = this.snap && this.snap.hasPendingWrites !== snap.hasPendingWrites;\r\n if (snap.syncStateChanged || hasPendingWritesChanged) {\r\n return this.options.includeMetadataChanges === true;\r\n }\r\n // Generally we should have hit one of the cases above, but it's possible\r\n // to get here if there were only metadata docChanges and they got\r\n // stripped out.\r\n return false;\r\n };\r\n QueryListener.prototype.raiseInitialEvent = function (snap) {\r\n assert(!this.raisedInitialEvent, 'Trying to raise initial events for second time');\r\n snap = ViewSnapshot.fromInitialDocuments(snap.query, snap.docs, snap.mutatedKeys, snap.fromCache);\r\n this.raisedInitialEvent = true;\r\n this.queryObserver.next(snap);\r\n };\r\n return QueryListener;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A set of changes to what documents are currently in view and out of view for\r\n * a given query. These changes are sent to the LocalStore by the View (via\r\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\r\n */\r\nvar LocalViewChanges = /** @class */ (function () {\r\n function LocalViewChanges(targetId, addedKeys, removedKeys) {\r\n this.targetId = targetId;\r\n this.addedKeys = addedKeys;\r\n this.removedKeys = removedKeys;\r\n }\r\n LocalViewChanges.fromSnapshot = function (targetId, viewSnapshot) {\r\n var addedKeys = documentKeySet();\r\n var removedKeys = documentKeySet();\r\n for (var _i = 0, _a = viewSnapshot.docChanges; _i < _a.length; _i++) {\r\n var docChange = _a[_i];\r\n switch (docChange.type) {\r\n case ChangeType.Added:\r\n addedKeys = addedKeys.add(docChange.doc.key);\r\n break;\r\n case ChangeType.Removed:\r\n removedKeys = removedKeys.add(docChange.doc.key);\r\n break;\r\n default:\r\n // do nothing\r\n }\r\n }\r\n return new LocalViewChanges(targetId, addedKeys, removedKeys);\r\n };\r\n return LocalViewChanges;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar AddedLimboDocument = /** @class */ (function () {\r\n function AddedLimboDocument(key) {\r\n this.key = key;\r\n }\r\n return AddedLimboDocument;\r\n}());\r\nvar RemovedLimboDocument = /** @class */ (function () {\r\n function RemovedLimboDocument(key) {\r\n this.key = key;\r\n }\r\n return RemovedLimboDocument;\r\n}());\r\n/**\r\n * View is responsible for computing the final merged truth of what docs are in\r\n * a query. It gets notified of local and remote changes to docs, and applies\r\n * the query filters and limits to determine the most correct possible results.\r\n */\r\nvar View = /** @class */ (function () {\r\n function View(query, \r\n /** Documents included in the remote target */\r\n _syncedDocuments) {\r\n this.query = query;\r\n this._syncedDocuments = _syncedDocuments;\r\n this.syncState = null;\r\n /**\r\n * A flag whether the view is current with the backend. A view is considered\r\n * current after it has seen the current flag from the backend and did not\r\n * lose consistency within the watch stream (e.g. because of an existence\r\n * filter mismatch).\r\n */\r\n this.current = false;\r\n /** Documents in the view but not in the remote target */\r\n this.limboDocuments = documentKeySet();\r\n /** Document Keys that have local changes */\r\n this.mutatedKeys = documentKeySet();\r\n this.documentSet = new DocumentSet(query.docComparator.bind(query));\r\n }\r\n Object.defineProperty(View.prototype, \"syncedDocuments\", {\r\n /**\r\n * The set of remote documents that the server has told us belongs to the target associated with\r\n * this view.\r\n */\r\n get: function () {\r\n return this._syncedDocuments;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Iterates over a set of doc changes, applies the query limit, and computes\r\n * what the new results should be, what the changes were, and whether we may\r\n * need to go back to the local cache for more results. Does not make any\r\n * changes to the view.\r\n * @param docChanges The doc changes to apply to this view.\r\n * @param previousChanges If this is being called with a refill, then start\r\n * with this set of docs and changes instead of the current view.\r\n * @return a new set of docs, changes, and refill flag.\r\n */\r\n View.prototype.computeDocChanges = function (docChanges, previousChanges) {\r\n var _this = this;\r\n var changeSet = previousChanges\r\n ? previousChanges.changeSet\r\n : new DocumentChangeSet();\r\n var oldDocumentSet = previousChanges\r\n ? previousChanges.documentSet\r\n : this.documentSet;\r\n var newMutatedKeys = previousChanges\r\n ? previousChanges.mutatedKeys\r\n : this.mutatedKeys;\r\n var newDocumentSet = oldDocumentSet;\r\n var needsRefill = false;\r\n // Track the last doc in a (full) limit. This is necessary, because some\r\n // update (a delete, or an update moving a doc past the old limit) might\r\n // mean there is some other document in the local cache that either should\r\n // come (1) between the old last limit doc and the new last document, in the\r\n // case of updates, or (2) after the new last document, in the case of\r\n // deletes. So we keep this doc at the old limit to compare the updates to.\r\n //\r\n // Note that this should never get used in a refill (when previousChanges is\r\n // set), because there will only be adds -- no deletes or updates.\r\n var lastDocInLimit = this.query.hasLimit() && oldDocumentSet.size === this.query.limit\r\n ? oldDocumentSet.last()\r\n : null;\r\n docChanges.inorderTraversal(function (key, newMaybeDoc) {\r\n var oldDoc = oldDocumentSet.get(key);\r\n var newDoc = newMaybeDoc instanceof Document ? newMaybeDoc : null;\r\n if (newDoc) {\r\n assert(key.isEqual(newDoc.key), 'Mismatching keys found in document changes: ' +\r\n key +\r\n ' != ' +\r\n newDoc.key);\r\n newDoc = _this.query.matches(newDoc) ? newDoc : null;\r\n }\r\n var oldDocHadPendingMutations = oldDoc\r\n ? _this.mutatedKeys.has(oldDoc.key)\r\n : false;\r\n var newDocHasPendingMutations = newDoc\r\n ? newDoc.hasLocalMutations ||\r\n // We only consider committed mutations for documents that were\r\n // mutated during the lifetime of the view.\r\n (_this.mutatedKeys.has(newDoc.key) && newDoc.hasCommittedMutations)\r\n : false;\r\n var changeApplied = false;\r\n // Calculate change\r\n if (oldDoc && newDoc) {\r\n var docsEqual = oldDoc.data.isEqual(newDoc.data);\r\n if (!docsEqual) {\r\n if (!_this.shouldWaitForSyncedDocument(oldDoc, newDoc)) {\r\n changeSet.track({\r\n type: ChangeType.Modified,\r\n doc: newDoc\r\n });\r\n changeApplied = true;\r\n if (lastDocInLimit &&\r\n _this.query.docComparator(newDoc, lastDocInLimit) > 0) {\r\n // This doc moved from inside the limit to after the limit.\r\n // That means there may be some doc in the local cache that's\r\n // actually less than this one.\r\n needsRefill = true;\r\n }\r\n }\r\n }\r\n else if (oldDocHadPendingMutations !== newDocHasPendingMutations) {\r\n changeSet.track({ type: ChangeType.Metadata, doc: newDoc });\r\n changeApplied = true;\r\n }\r\n }\r\n else if (!oldDoc && newDoc) {\r\n changeSet.track({ type: ChangeType.Added, doc: newDoc });\r\n changeApplied = true;\r\n }\r\n else if (oldDoc && !newDoc) {\r\n changeSet.track({ type: ChangeType.Removed, doc: oldDoc });\r\n changeApplied = true;\r\n if (lastDocInLimit) {\r\n // A doc was removed from a full limit query. We'll need to\r\n // requery from the local cache to see if we know about some other\r\n // doc that should be in the results.\r\n needsRefill = true;\r\n }\r\n }\r\n if (changeApplied) {\r\n if (newDoc) {\r\n newDocumentSet = newDocumentSet.add(newDoc);\r\n if (newDocHasPendingMutations) {\r\n newMutatedKeys = newMutatedKeys.add(key);\r\n }\r\n else {\r\n newMutatedKeys = newMutatedKeys.delete(key);\r\n }\r\n }\r\n else {\r\n newDocumentSet = newDocumentSet.delete(key);\r\n newMutatedKeys = newMutatedKeys.delete(key);\r\n }\r\n }\r\n });\r\n if (this.query.hasLimit()) {\r\n while (newDocumentSet.size > this.query.limit) {\r\n var oldDoc = newDocumentSet.last();\r\n newDocumentSet = newDocumentSet.delete(oldDoc.key);\r\n newMutatedKeys = newMutatedKeys.delete(oldDoc.key);\r\n changeSet.track({ type: ChangeType.Removed, doc: oldDoc });\r\n }\r\n }\r\n assert(!needsRefill || !previousChanges, 'View was refilled using docs that themselves needed refilling.');\r\n return {\r\n documentSet: newDocumentSet,\r\n changeSet: changeSet,\r\n needsRefill: needsRefill,\r\n mutatedKeys: newMutatedKeys\r\n };\r\n };\r\n View.prototype.shouldWaitForSyncedDocument = function (oldDoc, newDoc) {\r\n // We suppress the initial change event for documents that were modified as\r\n // part of a write acknowledgment (e.g. when the value of a server transform\r\n // is applied) as Watch will send us the same document again.\r\n // By suppressing the event, we only raise two user visible events (one with\r\n // `hasPendingWrites` and the final state of the document) instead of three\r\n // (one with `hasPendingWrites`, the modified document with\r\n // `hasPendingWrites` and the final state of the document).\r\n return (oldDoc.hasLocalMutations &&\r\n newDoc.hasCommittedMutations &&\r\n !newDoc.hasLocalMutations);\r\n };\r\n /**\r\n * Updates the view with the given ViewDocumentChanges and optionally updates\r\n * limbo docs and sync state from the provided target change.\r\n * @param docChanges The set of changes to make to the view's docs.\r\n * @param updateLimboDocuments Whether to update limbo documents based on this\r\n * change.\r\n * @param targetChange A target change to apply for computing limbo docs and\r\n * sync state.\r\n * @return A new ViewChange with the given docs, changes, and sync state.\r\n */\r\n // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\r\n View.prototype.applyChanges = function (docChanges, updateLimboDocuments, targetChange) {\r\n var _this = this;\r\n assert(!docChanges.needsRefill, 'Cannot apply changes that need a refill');\r\n var oldDocs = this.documentSet;\r\n this.documentSet = docChanges.documentSet;\r\n this.mutatedKeys = docChanges.mutatedKeys;\r\n // Sort changes based on type and query comparator\r\n var changes = docChanges.changeSet.getChanges();\r\n changes.sort(function (c1, c2) {\r\n return (compareChangeType(c1.type, c2.type) ||\r\n _this.query.docComparator(c1.doc, c2.doc));\r\n });\r\n this.applyTargetChange(targetChange);\r\n var limboChanges = updateLimboDocuments\r\n ? this.updateLimboDocuments()\r\n : [];\r\n var synced = this.limboDocuments.size === 0 && this.current;\r\n var newSyncState = synced ? SyncState.Synced : SyncState.Local;\r\n var syncStateChanged = newSyncState !== this.syncState;\r\n this.syncState = newSyncState;\r\n if (changes.length === 0 && !syncStateChanged) {\r\n // no changes\r\n return { limboChanges: limboChanges };\r\n }\r\n else {\r\n var snap = new ViewSnapshot(this.query, docChanges.documentSet, oldDocs, changes, docChanges.mutatedKeys, newSyncState === SyncState.Local, syncStateChanged, \r\n /* excludesMetadataChanges= */ false);\r\n return {\r\n snapshot: snap,\r\n limboChanges: limboChanges\r\n };\r\n }\r\n };\r\n /**\r\n * Applies an OnlineState change to the view, potentially generating a\r\n * ViewChange if the view's syncState changes as a result.\r\n */\r\n View.prototype.applyOnlineStateChange = function (onlineState) {\r\n if (this.current && onlineState === OnlineState.Offline) {\r\n // If we're offline, set `current` to false and then call applyChanges()\r\n // to refresh our syncState and generate a ViewChange as appropriate. We\r\n // are guaranteed to get a new TargetChange that sets `current` back to\r\n // true once the client is back online.\r\n this.current = false;\r\n return this.applyChanges({\r\n documentSet: this.documentSet,\r\n changeSet: new DocumentChangeSet(),\r\n mutatedKeys: this.mutatedKeys,\r\n needsRefill: false\r\n }, \r\n /* updateLimboDocuments= */ false);\r\n }\r\n else {\r\n // No effect, just return a no-op ViewChange.\r\n return { limboChanges: [] };\r\n }\r\n };\r\n /**\r\n * Returns whether the doc for the given key should be in limbo.\r\n */\r\n View.prototype.shouldBeInLimbo = function (key) {\r\n // If the remote end says it's part of this query, it's not in limbo.\r\n if (this._syncedDocuments.has(key)) {\r\n return false;\r\n }\r\n // The local store doesn't think it's a result, so it shouldn't be in limbo.\r\n if (!this.documentSet.has(key)) {\r\n return false;\r\n }\r\n // If there are local changes to the doc, they might explain why the server\r\n // doesn't know that it's part of the query. So don't put it in limbo.\r\n // TODO(klimt): Ideally, we would only consider changes that might actually\r\n // affect this specific query.\r\n if (this.documentSet.get(key).hasLocalMutations) {\r\n return false;\r\n }\r\n // Everything else is in limbo.\r\n return true;\r\n };\r\n /**\r\n * Updates syncedDocuments, current, and limbo docs based on the given change.\r\n * Returns the list of changes to which docs are in limbo.\r\n */\r\n View.prototype.applyTargetChange = function (targetChange) {\r\n var _this = this;\r\n if (targetChange) {\r\n targetChange.addedDocuments.forEach(function (key) { return (_this._syncedDocuments = _this._syncedDocuments.add(key)); });\r\n targetChange.modifiedDocuments.forEach(function (key) {\r\n return assert(_this._syncedDocuments.has(key), \"Modified document \" + key + \" not found in view.\");\r\n });\r\n targetChange.removedDocuments.forEach(function (key) { return (_this._syncedDocuments = _this._syncedDocuments.delete(key)); });\r\n this.current = targetChange.current;\r\n }\r\n };\r\n View.prototype.updateLimboDocuments = function () {\r\n var _this = this;\r\n // We can only determine limbo documents when we're in-sync with the server.\r\n if (!this.current) {\r\n return [];\r\n }\r\n // TODO(klimt): Do this incrementally so that it's not quadratic when\r\n // updating many documents.\r\n var oldLimboDocuments = this.limboDocuments;\r\n this.limboDocuments = documentKeySet();\r\n this.documentSet.forEach(function (doc) {\r\n if (_this.shouldBeInLimbo(doc.key)) {\r\n _this.limboDocuments = _this.limboDocuments.add(doc.key);\r\n }\r\n });\r\n // Diff the new limbo docs with the old limbo docs.\r\n var changes = [];\r\n oldLimboDocuments.forEach(function (key) {\r\n if (!_this.limboDocuments.has(key)) {\r\n changes.push(new RemovedLimboDocument(key));\r\n }\r\n });\r\n this.limboDocuments.forEach(function (key) {\r\n if (!oldLimboDocuments.has(key)) {\r\n changes.push(new AddedLimboDocument(key));\r\n }\r\n });\r\n return changes;\r\n };\r\n /**\r\n * Update the in-memory state of the current view with the state read from\r\n * persistence.\r\n *\r\n * We update the query view whenever a client's primary status changes:\r\n * - When a client transitions from primary to secondary, it can miss\r\n * LocalStorage updates and its query views may temporarily not be\r\n * synchronized with the state on disk.\r\n * - For secondary to primary transitions, the client needs to update the list\r\n * of `syncedDocuments` since secondary clients update their query views\r\n * based purely on synthesized RemoteEvents.\r\n *\r\n * @param localDocs - The documents that match the query according to the\r\n * LocalStore.\r\n * @param remoteKeys - The keys of the documents that match the query\r\n * according to the backend.\r\n *\r\n * @return The ViewChange that resulted from this synchronization.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n View.prototype.synchronizeWithPersistedState = function (localDocs, remoteKeys) {\r\n this._syncedDocuments = remoteKeys;\r\n this.limboDocuments = documentKeySet();\r\n var docChanges = this.computeDocChanges(localDocs);\r\n return this.applyChanges(docChanges, /*updateLimboDocuments=*/ true);\r\n };\r\n /**\r\n * Returns a view snapshot as if this query was just listened to. Contains\r\n * a document add for every existing document and the `fromCache` and\r\n * `hasPendingWrites` status of the already established view.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n View.prototype.computeInitialSnapshot = function () {\r\n return ViewSnapshot.fromInitialDocuments(this.query, this.documentSet, this.mutatedKeys, this.syncState === SyncState.Local);\r\n };\r\n return View;\r\n}());\r\nfunction compareChangeType(c1, c2) {\r\n var order = function (change) {\r\n switch (change) {\r\n case ChangeType.Added:\r\n return 1;\r\n case ChangeType.Modified:\r\n return 2;\r\n case ChangeType.Metadata:\r\n // A metadata change is converted to a modified change at the public\r\n // api layer. Since we sort by document key and then change type,\r\n // metadata and modified changes must be sorted equivalently.\r\n return 2;\r\n case ChangeType.Removed:\r\n return 0;\r\n default:\r\n return fail('Unknown ChangeType: ' + change);\r\n }\r\n };\r\n return order(c1) - order(c2);\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$9 = 'SyncEngine';\r\n/**\r\n * QueryView contains all of the data that SyncEngine needs to keep track of for\r\n * a particular query.\r\n */\r\nvar QueryView = /** @class */ (function () {\r\n function QueryView(\r\n /**\r\n * The query itself.\r\n */\r\n query, \r\n /**\r\n * The target number created by the client that is used in the watch\r\n * stream to identify this query.\r\n */\r\n targetId, \r\n /**\r\n * The view is responsible for computing the final merged truth of what\r\n * docs are in the query. It gets notified of local and remote changes,\r\n * and applies the query filters and limits to determine the most correct\r\n * possible results.\r\n */\r\n view) {\r\n this.query = query;\r\n this.targetId = targetId;\r\n this.view = view;\r\n }\r\n return QueryView;\r\n}());\r\n/** Tracks a limbo resolution. */\r\nvar LimboResolution = /** @class */ (function () {\r\n function LimboResolution(key) {\r\n this.key = key;\r\n }\r\n return LimboResolution;\r\n}());\r\n/**\r\n * SyncEngine is the central controller in the client SDK architecture. It is\r\n * the glue code between the EventManager, LocalStore, and RemoteStore. Some of\r\n * SyncEngine's responsibilities include:\r\n * 1. Coordinating client requests and remote events between the EventManager\r\n * and the local and remote data stores.\r\n * 2. Managing a View object for each query, providing the unified view between\r\n * the local and remote data stores.\r\n * 3. Notifying the RemoteStore when the LocalStore has new mutations in its\r\n * queue that need sending to the backend.\r\n *\r\n * The SyncEngine’s methods should only ever be called by methods running in the\r\n * global async queue.\r\n */\r\nvar SyncEngine = /** @class */ (function () {\r\n function SyncEngine(localStore, remoteStore, \r\n // PORTING NOTE: Manages state synchronization in multi-tab environments.\r\n sharedClientState, currentUser) {\r\n this.localStore = localStore;\r\n this.remoteStore = remoteStore;\r\n this.sharedClientState = sharedClientState;\r\n this.currentUser = currentUser;\r\n this.syncEngineListener = null;\r\n this.queryViewsByQuery = new ObjectMap(function (q) {\r\n return q.canonicalId();\r\n });\r\n this.queryViewsByTarget = {};\r\n this.limboTargetsByKey = new SortedMap(DocumentKey.comparator);\r\n this.limboResolutionsByTarget = {};\r\n this.limboDocumentRefs = new ReferenceSet();\r\n /** Stores user completion handlers, indexed by User and BatchId. */\r\n this.mutationUserCallbacks = {};\r\n this.limboTargetIdGenerator = TargetIdGenerator.forSyncEngine();\r\n // The primary state is set to `true` or `false` immediately after Firestore\r\n // startup. In the interim, a client should only be considered primary if\r\n // `isPrimary` is true.\r\n this.isPrimary = undefined;\r\n this.onlineState = OnlineState.Unknown;\r\n }\r\n Object.defineProperty(SyncEngine.prototype, \"isPrimaryClient\", {\r\n // Only used for testing.\r\n get: function () {\r\n return this.isPrimary === true;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /** Subscribes to SyncEngine notifications. Has to be called exactly once. */\r\n SyncEngine.prototype.subscribe = function (syncEngineListener) {\r\n assert(syncEngineListener !== null, 'SyncEngine listener cannot be null');\r\n assert(this.syncEngineListener === null, 'SyncEngine already has a subscriber.');\r\n this.syncEngineListener = syncEngineListener;\r\n };\r\n /**\r\n * Initiates the new listen, resolves promise when listen enqueued to the\r\n * server. All the subsequent view snapshots or errors are sent to the\r\n * subscribed handlers. Returns the targetId of the query.\r\n */\r\n SyncEngine.prototype.listen = function (query) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var targetId, viewSnapshot, queryView, queryData, status_1;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.assertSubscribed('listen()');\r\n queryView = this.queryViewsByQuery.get(query);\r\n if (!queryView) return [3 /*break*/, 1];\r\n // PORTING NOTE: With Mult-Tab Web, it is possible that a query view\r\n // already exists when EventManager calls us for the first time. This\r\n // happens when the primary tab is already listening to this query on\r\n // behalf of another tab and the user of the primary also starts listening\r\n // to the query. EventManager will not have an assigned target ID in this\r\n // case and calls `listen` to obtain this ID.\r\n targetId = queryView.targetId;\r\n this.sharedClientState.addLocalQueryTarget(targetId);\r\n viewSnapshot = queryView.view.computeInitialSnapshot();\r\n return [3 /*break*/, 4];\r\n case 1: return [4 /*yield*/, this.localStore.allocateQuery(query)];\r\n case 2:\r\n queryData = _a.sent();\r\n status_1 = this.sharedClientState.addLocalQueryTarget(queryData.targetId);\r\n targetId = queryData.targetId;\r\n return [4 /*yield*/, this.initializeViewAndComputeSnapshot(queryData, status_1 === 'current')];\r\n case 3:\r\n viewSnapshot = _a.sent();\r\n if (this.isPrimary) {\r\n this.remoteStore.listen(queryData);\r\n }\r\n _a.label = 4;\r\n case 4:\r\n this.syncEngineListener.onWatchChange([viewSnapshot]);\r\n return [2 /*return*/, targetId];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Registers a view for a previously unknown query and computes its initial\r\n * snapshot.\r\n */\r\n SyncEngine.prototype.initializeViewAndComputeSnapshot = function (queryData, current) {\r\n var _this = this;\r\n var query = queryData.query;\r\n return this.localStore.executeQuery(query).then(function (docs) {\r\n return _this.localStore\r\n .remoteDocumentKeys(queryData.targetId)\r\n .then(function (remoteKeys) {\r\n var view = new View(query, remoteKeys);\r\n var viewDocChanges = view.computeDocChanges(docs);\r\n // tslint:disable-next-line:max-line-length Prettier formats this exceed 100 characters.\r\n var synthesizedTargetChange = TargetChange.createSynthesizedTargetChangeForCurrentChange(queryData.targetId, current && _this.onlineState !== OnlineState.Offline);\r\n var viewChange = view.applyChanges(viewDocChanges, \r\n /* updateLimboDocuments= */ _this.isPrimary === true, synthesizedTargetChange);\r\n assert(viewChange.limboChanges.length === 0, 'View returned limbo docs before target ack from the server.');\r\n assert(!!viewChange.snapshot, 'applyChanges for new view should always return a snapshot');\r\n var data = new QueryView(query, queryData.targetId, view);\r\n _this.queryViewsByQuery.set(query, data);\r\n _this.queryViewsByTarget[queryData.targetId] = data;\r\n return viewChange.snapshot;\r\n });\r\n });\r\n };\r\n /**\r\n * Reconcile the list of synced documents in an existing view with those\r\n * from persistence.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n SyncEngine.prototype.synchronizeViewAndComputeSnapshot = function (queryView) {\r\n var _this = this;\r\n return this.localStore.executeQuery(queryView.query).then(function (docs) {\r\n return _this.localStore\r\n .remoteDocumentKeys(queryView.targetId)\r\n .then(function (remoteKeys) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n var viewSnapshot;\r\n return tslib_1.__generator(this, function (_a) {\r\n viewSnapshot = queryView.view.synchronizeWithPersistedState(docs, remoteKeys);\r\n if (this.isPrimary) {\r\n this.updateTrackedLimbos(queryView.targetId, viewSnapshot.limboChanges);\r\n }\r\n return [2 /*return*/, viewSnapshot];\r\n });\r\n }); });\r\n });\r\n };\r\n /** Stops listening to the query. */\r\n SyncEngine.prototype.unlisten = function (query) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var queryView, targetRemainsActive;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.assertSubscribed('unlisten()');\r\n queryView = this.queryViewsByQuery.get(query);\r\n assert(!!queryView, 'Trying to unlisten on query not found:' + query);\r\n if (!this.isPrimary) return [3 /*break*/, 3];\r\n // We need to remove the local query target first to allow us to verify\r\n // whether any other client is still interested in this target.\r\n this.sharedClientState.removeLocalQueryTarget(queryView.targetId);\r\n targetRemainsActive = this.sharedClientState.isActiveQueryTarget(queryView.targetId);\r\n if (!!targetRemainsActive) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.localStore\r\n .releaseQuery(query, /*keepPersistedQueryData=*/ false)\r\n .then(function () {\r\n _this.sharedClientState.clearQueryState(queryView.targetId);\r\n _this.remoteStore.unlisten(queryView.targetId);\r\n _this.removeAndCleanupQuery(queryView);\r\n })\r\n .catch(function (err) { return _this.ignoreIfPrimaryLeaseLoss(err); })];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [3 /*break*/, 5];\r\n case 3:\r\n this.removeAndCleanupQuery(queryView);\r\n return [4 /*yield*/, this.localStore.releaseQuery(query, \r\n /*keepPersistedQueryData=*/ true)];\r\n case 4:\r\n _a.sent();\r\n _a.label = 5;\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Initiates the write of local mutation batch which involves adding the\r\n * writes to the mutation queue, notifying the remote store about new\r\n * mutations and raising events for any changes this write caused.\r\n *\r\n * The promise returned by this call is resolved when the above steps\r\n * have completed, *not* when the write was acked by the backend. The\r\n * userCallback is resolved once the write was acked/rejected by the\r\n * backend (or failed locally for any other reason).\r\n */\r\n SyncEngine.prototype.write = function (batch, userCallback) {\r\n var _this = this;\r\n this.assertSubscribed('write()');\r\n return this.localStore\r\n .localWrite(batch)\r\n .then(function (result) {\r\n _this.sharedClientState.addPendingMutation(result.batchId);\r\n _this.addMutationCallback(result.batchId, userCallback);\r\n return _this.emitNewSnapsAndNotifyLocalStore(result.changes);\r\n })\r\n .then(function () {\r\n return _this.remoteStore.fillWritePipeline();\r\n });\r\n };\r\n // TODO(klimt): Wrap the given error in a standard Firestore error object.\r\n SyncEngine.prototype.wrapUpdateFunctionError = function (error$$1) {\r\n return error$$1;\r\n };\r\n /**\r\n * Takes an updateFunction in which a set of reads and writes can be performed\r\n * atomically. In the updateFunction, the client can read and write values\r\n * using the supplied transaction object. After the updateFunction, all\r\n * changes will be committed. If some other client has changed any of the data\r\n * referenced, then the updateFunction will be called again. If the\r\n * updateFunction still fails after the given number of retries, then the\r\n * transaction will be rejection.\r\n *\r\n * The transaction object passed to the updateFunction contains methods for\r\n * accessing documents and collections. Unlike other datastore access, data\r\n * accessed with the transaction will not reflect local changes that have not\r\n * been committed. For this reason, it is required that all reads are\r\n * performed before any writes. Transactions must be performed while online.\r\n *\r\n * The promise returned is resolved when the transaction is fully committed.\r\n */\r\n SyncEngine.prototype.runTransaction = function (updateFunction, retries) {\r\n var _this = this;\r\n if (retries === void 0) { retries = 5; }\r\n assert(retries >= 0, 'Got negative number of retries for transaction.');\r\n var transaction = this.remoteStore.createTransaction();\r\n var wrappedUpdateFunction = function () {\r\n try {\r\n var userPromise = updateFunction(transaction);\r\n if (isNullOrUndefined(userPromise) ||\r\n !userPromise.catch ||\r\n !userPromise.then) {\r\n return Promise.reject(Error('Transaction callback must return a Promise'));\r\n }\r\n return userPromise.catch(function (e) {\r\n return Promise.reject(_this.wrapUpdateFunctionError(e));\r\n });\r\n }\r\n catch (e) {\r\n return Promise.reject(_this.wrapUpdateFunctionError(e));\r\n }\r\n };\r\n return wrappedUpdateFunction().then(function (result) {\r\n return transaction\r\n .commit()\r\n .then(function () {\r\n return result;\r\n })\r\n .catch(function (error$$1) {\r\n if (retries === 0) {\r\n return Promise.reject(error$$1);\r\n }\r\n // TODO(klimt): Put in a retry delay?\r\n return _this.runTransaction(updateFunction, retries - 1);\r\n });\r\n });\r\n };\r\n SyncEngine.prototype.applyRemoteEvent = function (remoteEvent) {\r\n var _this = this;\r\n this.assertSubscribed('applyRemoteEvent()');\r\n return this.localStore\r\n .applyRemoteEvent(remoteEvent)\r\n .then(function (changes) {\r\n // Update `receivedDocument` as appropriate for any limbo targets.\r\n forEach(remoteEvent.targetChanges, function (targetId, targetChange) {\r\n var limboResolution = _this.limboResolutionsByTarget[targetId];\r\n if (limboResolution) {\r\n // Since this is a limbo resolution lookup, it's for a single document\r\n // and it could be added, modified, or removed, but not a combination.\r\n assert(targetChange.addedDocuments.size +\r\n targetChange.modifiedDocuments.size +\r\n targetChange.removedDocuments.size <=\r\n 1, 'Limbo resolution for single document contains multiple changes.');\r\n if (targetChange.addedDocuments.size > 0) {\r\n limboResolution.receivedDocument = true;\r\n }\r\n else if (targetChange.modifiedDocuments.size > 0) {\r\n assert(limboResolution.receivedDocument, 'Received change for limbo target document without add.');\r\n }\r\n else if (targetChange.removedDocuments.size > 0) {\r\n assert(limboResolution.receivedDocument, 'Received remove for limbo target document without add.');\r\n limboResolution.receivedDocument = false;\r\n }\r\n else {\r\n // This was probably just a CURRENT targetChange or similar.\r\n }\r\n }\r\n });\r\n return _this.emitNewSnapsAndNotifyLocalStore(changes, remoteEvent);\r\n })\r\n .catch(function (err) { return _this.ignoreIfPrimaryLeaseLoss(err); });\r\n };\r\n /**\r\n * Applies an OnlineState change to the sync engine and notifies any views of\r\n * the change.\r\n */\r\n SyncEngine.prototype.applyOnlineStateChange = function (onlineState, source) {\r\n // If we are the secondary client, we explicitly ignore the remote store's\r\n // online state (the local client may go offline, even though the primary\r\n // tab remains online) and only apply the primary tab's online state from\r\n // SharedClientState.\r\n if ((this.isPrimary && source === OnlineStateSource.RemoteStore) ||\r\n (!this.isPrimary && source === OnlineStateSource.SharedClientState)) {\r\n var newViewSnapshots_1 = [];\r\n this.queryViewsByQuery.forEach(function (query, queryView) {\r\n var viewChange = queryView.view.applyOnlineStateChange(onlineState);\r\n assert(viewChange.limboChanges.length === 0, 'OnlineState should not affect limbo documents.');\r\n if (viewChange.snapshot) {\r\n newViewSnapshots_1.push(viewChange.snapshot);\r\n }\r\n });\r\n this.syncEngineListener.onOnlineStateChange(onlineState);\r\n this.syncEngineListener.onWatchChange(newViewSnapshots_1);\r\n this.onlineState = onlineState;\r\n if (this.isPrimary) {\r\n this.sharedClientState.setOnlineState(onlineState);\r\n }\r\n }\r\n };\r\n SyncEngine.prototype.rejectListen = function (targetId, err) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var limboResolution, limboKey, documentUpdates, resolvedLimboDocuments, event_1, queryView_1;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.assertSubscribed('rejectListens()');\r\n // PORTING NOTE: Multi-tab only.\r\n this.sharedClientState.updateQueryState(targetId, 'rejected', err);\r\n limboResolution = this.limboResolutionsByTarget[targetId];\r\n limboKey = limboResolution && limboResolution.key;\r\n if (!limboKey) return [3 /*break*/, 1];\r\n // Since this query failed, we won't want to manually unlisten to it.\r\n // So go ahead and remove it from bookkeeping.\r\n this.limboTargetsByKey = this.limboTargetsByKey.remove(limboKey);\r\n delete this.limboResolutionsByTarget[targetId];\r\n documentUpdates = new SortedMap(DocumentKey.comparator);\r\n documentUpdates = documentUpdates.insert(limboKey, new NoDocument(limboKey, SnapshotVersion.forDeletedDoc()));\r\n resolvedLimboDocuments = documentKeySet().add(limboKey);\r\n event_1 = new RemoteEvent(SnapshotVersion.MIN, \r\n /* targetChanges= */ {}, \r\n /* targetMismatches= */ new SortedSet(primitiveComparator), documentUpdates, resolvedLimboDocuments);\r\n return [2 /*return*/, this.applyRemoteEvent(event_1)];\r\n case 1:\r\n queryView_1 = this.queryViewsByTarget[targetId];\r\n assert(!!queryView_1, 'Unknown targetId: ' + targetId);\r\n return [4 /*yield*/, this.localStore\r\n .releaseQuery(queryView_1.query, /* keepPersistedQueryData */ false)\r\n .then(function () { return _this.removeAndCleanupQuery(queryView_1); })\r\n .catch(function (err) { return _this.ignoreIfPrimaryLeaseLoss(err); })];\r\n case 2:\r\n _a.sent();\r\n this.syncEngineListener.onWatchError(queryView_1.query, err);\r\n _a.label = 3;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // PORTING NOTE: Multi-tab only\r\n SyncEngine.prototype.applyBatchState = function (batchId, batchState, error$$1) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var documents;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.assertSubscribed('applyBatchState()');\r\n return [4 /*yield*/, this.localStore.lookupMutationDocuments(batchId)];\r\n case 1:\r\n documents = _a.sent();\r\n if (documents === null) {\r\n // A throttled tab may not have seen the mutation before it was completed\r\n // and removed from the mutation queue, in which case we won't have cached\r\n // the affected documents. In this case we can safely ignore the update\r\n // since that means we didn't apply the mutation locally at all (if we\r\n // had, we would have cached the affected documents), and so we will just\r\n // see any resulting document changes via normal remote document updates\r\n // as applicable.\r\n debug(LOG_TAG$9, 'Cannot apply mutation batch with id: ' + batchId);\r\n return [2 /*return*/];\r\n }\r\n if (!(batchState === 'pending')) return [3 /*break*/, 3];\r\n // If we are the primary client, we need to send this write to the\r\n // backend. Secondary clients will ignore these writes since their remote\r\n // connection is disabled.\r\n return [4 /*yield*/, this.remoteStore.fillWritePipeline()];\r\n case 2:\r\n // If we are the primary client, we need to send this write to the\r\n // backend. Secondary clients will ignore these writes since their remote\r\n // connection is disabled.\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n if (batchState === 'acknowledged' || batchState === 'rejected') {\r\n // NOTE: Both these methods are no-ops for batches that originated from\r\n // other clients.\r\n this.processUserCallback(batchId, error$$1 ? error$$1 : null);\r\n this.localStore.removeCachedMutationBatchMetadata(batchId);\r\n }\r\n else {\r\n fail(\"Unknown batchState: \" + batchState);\r\n }\r\n _a.label = 4;\r\n case 4: return [4 /*yield*/, this.emitNewSnapsAndNotifyLocalStore(documents)];\r\n case 5:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n SyncEngine.prototype.applySuccessfulWrite = function (mutationBatchResult) {\r\n var _this = this;\r\n this.assertSubscribed('applySuccessfulWrite()');\r\n var batchId = mutationBatchResult.batch.batchId;\r\n // The local store may or may not be able to apply the write result and\r\n // raise events immediately (depending on whether the watcher is caught\r\n // up), so we raise user callbacks first so that they consistently happen\r\n // before listen events.\r\n this.processUserCallback(batchId, /*error=*/ null);\r\n return this.localStore\r\n .acknowledgeBatch(mutationBatchResult)\r\n .then(function (changes) {\r\n _this.sharedClientState.updateMutationState(batchId, 'acknowledged');\r\n return _this.emitNewSnapsAndNotifyLocalStore(changes);\r\n })\r\n .catch(function (err) { return _this.ignoreIfPrimaryLeaseLoss(err); });\r\n };\r\n SyncEngine.prototype.rejectFailedWrite = function (batchId, error$$1) {\r\n var _this = this;\r\n this.assertSubscribed('rejectFailedWrite()');\r\n // The local store may or may not be able to apply the write result and\r\n // raise events immediately (depending on whether the watcher is caught up),\r\n // so we raise user callbacks first so that they consistently happen before\r\n // listen events.\r\n this.processUserCallback(batchId, error$$1);\r\n return this.localStore\r\n .rejectBatch(batchId)\r\n .then(function (changes) {\r\n _this.sharedClientState.updateMutationState(batchId, 'rejected', error$$1);\r\n return _this.emitNewSnapsAndNotifyLocalStore(changes);\r\n })\r\n .catch(function (err) { return _this.ignoreIfPrimaryLeaseLoss(err); });\r\n };\r\n SyncEngine.prototype.addMutationCallback = function (batchId, callback) {\r\n var newCallbacks = this.mutationUserCallbacks[this.currentUser.toKey()];\r\n if (!newCallbacks) {\r\n newCallbacks = new SortedMap(primitiveComparator);\r\n }\r\n newCallbacks = newCallbacks.insert(batchId, callback);\r\n this.mutationUserCallbacks[this.currentUser.toKey()] = newCallbacks;\r\n };\r\n /**\r\n * Resolves or rejects the user callback for the given batch and then discards\r\n * it.\r\n */\r\n SyncEngine.prototype.processUserCallback = function (batchId, error$$1) {\r\n var newCallbacks = this.mutationUserCallbacks[this.currentUser.toKey()];\r\n // NOTE: Mutations restored from persistence won't have callbacks, so it's\r\n // okay for there to be no callback for this ID.\r\n if (newCallbacks) {\r\n var callback = newCallbacks.get(batchId);\r\n if (callback) {\r\n assert(batchId === newCallbacks.minKey(), 'Mutation callbacks processed out-of-order?');\r\n if (error$$1) {\r\n callback.reject(error$$1);\r\n }\r\n else {\r\n callback.resolve();\r\n }\r\n newCallbacks = newCallbacks.remove(batchId);\r\n }\r\n this.mutationUserCallbacks[this.currentUser.toKey()] = newCallbacks;\r\n }\r\n };\r\n SyncEngine.prototype.removeAndCleanupQuery = function (queryView) {\r\n var _this = this;\r\n this.sharedClientState.removeLocalQueryTarget(queryView.targetId);\r\n this.queryViewsByQuery.delete(queryView.query);\r\n delete this.queryViewsByTarget[queryView.targetId];\r\n if (this.isPrimary) {\r\n var limboKeys = this.limboDocumentRefs.referencesForId(queryView.targetId);\r\n this.limboDocumentRefs.removeReferencesForId(queryView.targetId);\r\n limboKeys.forEach(function (limboKey) {\r\n var isReferenced = _this.limboDocumentRefs.containsKey(limboKey);\r\n if (!isReferenced) {\r\n // We removed the last reference for this key\r\n _this.removeLimboTarget(limboKey);\r\n }\r\n });\r\n }\r\n };\r\n SyncEngine.prototype.removeLimboTarget = function (key) {\r\n // It's possible that the target already got removed because the query failed. In that case,\r\n // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\r\n var limboTargetId = this.limboTargetsByKey.get(key);\r\n if (limboTargetId === null) {\r\n // This target already got removed, because the query failed.\r\n return;\r\n }\r\n this.remoteStore.unlisten(limboTargetId);\r\n this.limboTargetsByKey = this.limboTargetsByKey.remove(key);\r\n delete this.limboResolutionsByTarget[limboTargetId];\r\n };\r\n SyncEngine.prototype.updateTrackedLimbos = function (targetId, limboChanges) {\r\n for (var _i = 0, limboChanges_1 = limboChanges; _i < limboChanges_1.length; _i++) {\r\n var limboChange = limboChanges_1[_i];\r\n if (limboChange instanceof AddedLimboDocument) {\r\n this.limboDocumentRefs.addReference(limboChange.key, targetId);\r\n this.trackLimboChange(limboChange);\r\n }\r\n else if (limboChange instanceof RemovedLimboDocument) {\r\n debug(LOG_TAG$9, 'Document no longer in limbo: ' + limboChange.key);\r\n this.limboDocumentRefs.removeReference(limboChange.key, targetId);\r\n var isReferenced = this.limboDocumentRefs.containsKey(limboChange.key);\r\n if (!isReferenced) {\r\n // We removed the last reference for this key\r\n this.removeLimboTarget(limboChange.key);\r\n }\r\n }\r\n else {\r\n fail('Unknown limbo change: ' + JSON.stringify(limboChange));\r\n }\r\n }\r\n };\r\n SyncEngine.prototype.trackLimboChange = function (limboChange) {\r\n var key = limboChange.key;\r\n if (!this.limboTargetsByKey.get(key)) {\r\n debug(LOG_TAG$9, 'New document in limbo: ' + key);\r\n var limboTargetId = this.limboTargetIdGenerator.next();\r\n var query = Query.atPath(key.path);\r\n this.limboResolutionsByTarget[limboTargetId] = new LimboResolution(key);\r\n this.remoteStore.listen(new QueryData(query, limboTargetId, QueryPurpose.LimboResolution, ListenSequence.INVALID));\r\n this.limboTargetsByKey = this.limboTargetsByKey.insert(key, limboTargetId);\r\n }\r\n };\r\n // Visible for testing\r\n SyncEngine.prototype.currentLimboDocs = function () {\r\n return this.limboTargetsByKey;\r\n };\r\n SyncEngine.prototype.emitNewSnapsAndNotifyLocalStore = function (changes, remoteEvent) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var newSnaps, docChangesInAllViews, queriesProcessed;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n newSnaps = [];\r\n docChangesInAllViews = [];\r\n queriesProcessed = [];\r\n this.queryViewsByQuery.forEach(function (_, queryView) {\r\n queriesProcessed.push(Promise.resolve()\r\n .then(function () {\r\n var viewDocChanges = queryView.view.computeDocChanges(changes);\r\n if (!viewDocChanges.needsRefill) {\r\n return viewDocChanges;\r\n }\r\n // The query has a limit and some docs were removed, so we need\r\n // to re-run the query against the local store to make sure we\r\n // didn't lose any good docs that had been past the limit.\r\n return _this.localStore.executeQuery(queryView.query).then(function (docs) {\r\n return queryView.view.computeDocChanges(docs, viewDocChanges);\r\n });\r\n })\r\n .then(function (viewDocChanges) {\r\n var targetChange = remoteEvent && remoteEvent.targetChanges[queryView.targetId];\r\n var viewChange = queryView.view.applyChanges(viewDocChanges, \r\n /* updateLimboDocuments= */ _this.isPrimary === true, targetChange);\r\n _this.updateTrackedLimbos(queryView.targetId, viewChange.limboChanges);\r\n if (viewChange.snapshot) {\r\n if (_this.isPrimary) {\r\n _this.sharedClientState.updateQueryState(queryView.targetId, viewChange.snapshot.fromCache ? 'not-current' : 'current');\r\n }\r\n newSnaps.push(viewChange.snapshot);\r\n var docChanges = LocalViewChanges.fromSnapshot(queryView.targetId, viewChange.snapshot);\r\n docChangesInAllViews.push(docChanges);\r\n }\r\n }));\r\n });\r\n return [4 /*yield*/, Promise.all(queriesProcessed)];\r\n case 1:\r\n _a.sent();\r\n this.syncEngineListener.onWatchChange(newSnaps);\r\n return [4 /*yield*/, this.localStore.notifyLocalViewChanges(docChangesInAllViews)];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Verifies the error thrown by an LocalStore operation. If a LocalStore\r\n * operation fails because the primary lease has been taken by another client,\r\n * we ignore the error (the persistence layer will immediately call\r\n * `applyPrimaryLease` to propagate the primary state change). All other\r\n * errors are re-thrown.\r\n *\r\n * @param err An error returned by a LocalStore operation.\r\n * @return A Promise that resolves after we recovered, or the original error.\r\n */\r\n SyncEngine.prototype.ignoreIfPrimaryLeaseLoss = function (err) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n if (isPrimaryLeaseLostError(err)) {\r\n debug(LOG_TAG$9, 'Unexpectedly lost primary lease');\r\n }\r\n else {\r\n throw err;\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n SyncEngine.prototype.assertSubscribed = function (fnName) {\r\n assert(this.syncEngineListener !== null, 'Trying to call ' + fnName + ' before calling subscribe().');\r\n };\r\n SyncEngine.prototype.handleCredentialChange = function (user) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var userChanged, result;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n userChanged = !this.currentUser.isEqual(user);\r\n this.currentUser = user;\r\n if (!userChanged) return [3 /*break*/, 3];\r\n return [4 /*yield*/, this.localStore.handleUserChange(user)];\r\n case 1:\r\n result = _a.sent();\r\n // TODO(b/114226417): Consider calling this only in the primary tab.\r\n this.sharedClientState.handleUserChange(user, result.removedBatchIds, result.addedBatchIds);\r\n return [4 /*yield*/, this.emitNewSnapsAndNotifyLocalStore(result.affectedDocuments)];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3: return [4 /*yield*/, this.remoteStore.handleCredentialChange()];\r\n case 4:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // PORTING NOTE: Multi-tab only\r\n SyncEngine.prototype.applyPrimaryState = function (isPrimary) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var activeTargets, activeQueries, _i, activeQueries_1, queryData, activeTargets_1, p_1;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(isPrimary === true && this.isPrimary !== true)) return [3 /*break*/, 3];\r\n this.isPrimary = true;\r\n return [4 /*yield*/, this.remoteStore.applyPrimaryState(true)];\r\n case 1:\r\n _a.sent();\r\n activeTargets = this.sharedClientState.getAllActiveQueryTargets();\r\n return [4 /*yield*/, this.synchronizeQueryViewsAndRaiseSnapshots(activeTargets.toArray())];\r\n case 2:\r\n activeQueries = _a.sent();\r\n for (_i = 0, activeQueries_1 = activeQueries; _i < activeQueries_1.length; _i++) {\r\n queryData = activeQueries_1[_i];\r\n this.remoteStore.listen(queryData);\r\n }\r\n return [3 /*break*/, 7];\r\n case 3:\r\n if (!(isPrimary === false && this.isPrimary !== false)) return [3 /*break*/, 7];\r\n this.isPrimary = false;\r\n activeTargets_1 = [];\r\n p_1 = Promise.resolve();\r\n forEachNumber(this.queryViewsByTarget, function (targetId, queryView) {\r\n if (_this.sharedClientState.isLocalQueryTarget(targetId)) {\r\n activeTargets_1.push(targetId);\r\n }\r\n else {\r\n p_1 = p_1.then(function () { return _this.unlisten(queryView.query); });\r\n }\r\n _this.remoteStore.unlisten(queryView.targetId);\r\n });\r\n return [4 /*yield*/, p_1];\r\n case 4:\r\n _a.sent();\r\n return [4 /*yield*/, this.synchronizeQueryViewsAndRaiseSnapshots(activeTargets_1)];\r\n case 5:\r\n _a.sent();\r\n this.resetLimboDocuments();\r\n return [4 /*yield*/, this.remoteStore.applyPrimaryState(false)];\r\n case 6:\r\n _a.sent();\r\n _a.label = 7;\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // PORTING NOTE: Multi-tab only.\r\n SyncEngine.prototype.resetLimboDocuments = function () {\r\n var _this = this;\r\n forEachNumber(this.limboResolutionsByTarget, function (targetId) {\r\n _this.remoteStore.unlisten(targetId);\r\n });\r\n this.limboDocumentRefs.removeAllReferences();\r\n this.limboResolutionsByTarget = [];\r\n this.limboTargetsByKey = new SortedMap(DocumentKey.comparator);\r\n };\r\n /**\r\n * Reconcile the query views of the provided query targets with the state from\r\n * persistence. Raises snapshots for any changes that affect the local\r\n * client and returns the updated state of all target's query data.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n SyncEngine.prototype.synchronizeQueryViewsAndRaiseSnapshots = function (targets) {\r\n var _this = this;\r\n var p = Promise.resolve();\r\n var activeQueries = [];\r\n var newViewSnapshots = [];\r\n var _loop_1 = function (targetId) {\r\n p = p.then(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n var queryData, queryView, viewChange, query;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n queryView = this.queryViewsByTarget[targetId];\r\n if (!queryView) return [3 /*break*/, 4];\r\n // For queries that have a local View, we need to update their state\r\n // in LocalStore (as the resume token and the snapshot version\r\n // might have changed) and reconcile their views with the persisted\r\n // state (the list of syncedDocuments may have gotten out of sync).\r\n return [4 /*yield*/, this.localStore.releaseQuery(queryView.query, \r\n /*keepPersistedQueryData=*/ true)];\r\n case 1:\r\n // For queries that have a local View, we need to update their state\r\n // in LocalStore (as the resume token and the snapshot version\r\n // might have changed) and reconcile their views with the persisted\r\n // state (the list of syncedDocuments may have gotten out of sync).\r\n _a.sent();\r\n return [4 /*yield*/, this.localStore.allocateQuery(queryView.query)];\r\n case 2:\r\n queryData = _a.sent();\r\n return [4 /*yield*/, this.synchronizeViewAndComputeSnapshot(queryView)];\r\n case 3:\r\n viewChange = _a.sent();\r\n if (viewChange.snapshot) {\r\n newViewSnapshots.push(viewChange.snapshot);\r\n }\r\n return [3 /*break*/, 8];\r\n case 4:\r\n assert(this.isPrimary === true, 'A secondary tab should never have an active query without an active view.');\r\n return [4 /*yield*/, this.localStore.getQueryForTarget(targetId)];\r\n case 5:\r\n query = _a.sent();\r\n assert(!!query, \"Query data for target \" + targetId + \" not found\");\r\n return [4 /*yield*/, this.localStore.allocateQuery(query)];\r\n case 6:\r\n queryData = _a.sent();\r\n return [4 /*yield*/, this.initializeViewAndComputeSnapshot(queryData, \r\n /*current=*/ false)];\r\n case 7:\r\n _a.sent();\r\n _a.label = 8;\r\n case 8:\r\n activeQueries.push(queryData);\r\n return [2 /*return*/];\r\n }\r\n });\r\n }); });\r\n };\r\n for (var _i = 0, targets_1 = targets; _i < targets_1.length; _i++) {\r\n var targetId = targets_1[_i];\r\n _loop_1(targetId);\r\n }\r\n return p.then(function () {\r\n _this.syncEngineListener.onWatchChange(newViewSnapshots);\r\n return activeQueries;\r\n });\r\n };\r\n // PORTING NOTE: Multi-tab only\r\n SyncEngine.prototype.getActiveClients = function () {\r\n return this.localStore.getActiveClients();\r\n };\r\n // PORTING NOTE: Multi-tab only\r\n SyncEngine.prototype.applyTargetState = function (targetId, state, error$$1) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var _a, queryView;\r\n return tslib_1.__generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n if (this.isPrimary) {\r\n // If we receive a target state notification via WebStorage, we are\r\n // either already secondary or another tab has taken the primary lease.\r\n debug(LOG_TAG$9, 'Ignoring unexpected query state notification.');\r\n return [2 /*return*/];\r\n }\r\n if (!this.queryViewsByTarget[targetId]) return [3 /*break*/, 5];\r\n _a = state;\r\n switch (_a) {\r\n case 'current': return [3 /*break*/, 1];\r\n case 'not-current': return [3 /*break*/, 1];\r\n case 'rejected': return [3 /*break*/, 2];\r\n }\r\n return [3 /*break*/, 4];\r\n case 1:\r\n {\r\n return [2 /*return*/, this.localStore.getNewDocumentChanges().then(function (changes) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n var synthesizedRemoteEvent;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n synthesizedRemoteEvent = RemoteEvent.createSynthesizedRemoteEventForCurrentChange(targetId, state === 'current');\r\n return [4 /*yield*/, this.emitNewSnapsAndNotifyLocalStore(changes, synthesizedRemoteEvent)];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n }); }, function (err) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n var activeTargets_2;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!isDocumentChangeMissingError(err)) return [3 /*break*/, 2];\r\n activeTargets_2 = [];\r\n forEachNumber(this.queryViewsByTarget, function (target) {\r\n return activeTargets_2.push(target);\r\n });\r\n return [4 /*yield*/, this.synchronizeQueryViewsAndRaiseSnapshots(activeTargets_2)];\r\n case 1:\r\n _a.sent();\r\n return [3 /*break*/, 3];\r\n case 2: throw err;\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n }); })];\r\n }\r\n _b.label = 2;\r\n case 2:\r\n queryView = this.queryViewsByTarget[targetId];\r\n this.removeAndCleanupQuery(queryView);\r\n return [4 /*yield*/, this.localStore.releaseQuery(queryView.query, \r\n /*keepPersistedQueryData=*/ true)];\r\n case 3:\r\n _b.sent();\r\n this.syncEngineListener.onWatchError(queryView.query, error$$1);\r\n return [3 /*break*/, 5];\r\n case 4:\r\n fail('Unexpected target state: ' + state);\r\n _b.label = 5;\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // PORTING NOTE: Multi-tab only\r\n SyncEngine.prototype.applyActiveTargetsChange = function (added, removed) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var _i, added_1, targetId, query, queryData, _loop_2, this_1, _a, removed_1, targetId;\r\n return tslib_1.__generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n if (!this.isPrimary) {\r\n return [2 /*return*/];\r\n }\r\n _i = 0, added_1 = added;\r\n _b.label = 1;\r\n case 1:\r\n if (!(_i < added_1.length)) return [3 /*break*/, 6];\r\n targetId = added_1[_i];\r\n assert(!this.queryViewsByTarget[targetId], 'Trying to add an already active target');\r\n return [4 /*yield*/, this.localStore.getQueryForTarget(targetId)];\r\n case 2:\r\n query = _b.sent();\r\n assert(!!query, \"Query data for active target \" + targetId + \" not found\");\r\n return [4 /*yield*/, this.localStore.allocateQuery(query)];\r\n case 3:\r\n queryData = _b.sent();\r\n return [4 /*yield*/, this.initializeViewAndComputeSnapshot(queryData, \r\n /*current=*/ false)];\r\n case 4:\r\n _b.sent();\r\n this.remoteStore.listen(queryData);\r\n _b.label = 5;\r\n case 5:\r\n _i++;\r\n return [3 /*break*/, 1];\r\n case 6:\r\n _loop_2 = function (targetId) {\r\n var queryView;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n queryView = this_1.queryViewsByTarget[targetId];\r\n if (!queryView) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this_1.localStore\r\n .releaseQuery(queryView.query, /*keepPersistedQueryData=*/ false)\r\n .then(function () {\r\n _this.remoteStore.unlisten(targetId);\r\n _this.removeAndCleanupQuery(queryView);\r\n })\r\n .catch(function (err) { return _this.ignoreIfPrimaryLeaseLoss(err); })];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n };\r\n this_1 = this;\r\n _a = 0, removed_1 = removed;\r\n _b.label = 7;\r\n case 7:\r\n if (!(_a < removed_1.length)) return [3 /*break*/, 10];\r\n targetId = removed_1[_a];\r\n return [5 /*yield**/, _loop_2(targetId)];\r\n case 8:\r\n _b.sent();\r\n _b.label = 9;\r\n case 9:\r\n _a++;\r\n return [3 /*break*/, 7];\r\n case 10: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n SyncEngine.prototype.enableNetwork = function () {\r\n this.localStore.setNetworkEnabled(true);\r\n return this.remoteStore.enableNetwork();\r\n };\r\n SyncEngine.prototype.disableNetwork = function () {\r\n this.localStore.setNetworkEnabled(false);\r\n return this.remoteStore.disableNetwork();\r\n };\r\n SyncEngine.prototype.getRemoteKeysForTarget = function (targetId) {\r\n var limboResolution = this.limboResolutionsByTarget[targetId];\r\n if (limboResolution && limboResolution.receivedDocument) {\r\n return documentKeySet().add(limboResolution.key);\r\n }\r\n else {\r\n return this.queryViewsByTarget[targetId]\r\n ? this.queryViewsByTarget[targetId].view.syncedDocuments\r\n : documentKeySet();\r\n }\r\n };\r\n return SyncEngine;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Simple wrapper around a nullable UID. Mostly exists to make code more\r\n * readable.\r\n */\r\nvar User = /** @class */ (function () {\r\n function User(uid) {\r\n this.uid = uid;\r\n }\r\n User.prototype.isAuthenticated = function () {\r\n return this.uid != null;\r\n };\r\n /**\r\n * Returns a key representing this user, suitable for inclusion in a\r\n * dictionary.\r\n */\r\n User.prototype.toKey = function () {\r\n if (this.isAuthenticated()) {\r\n return 'uid:' + this.uid;\r\n }\r\n else {\r\n return 'anonymous-user';\r\n }\r\n };\r\n User.prototype.isEqual = function (otherUser) {\r\n return otherUser.uid === this.uid;\r\n };\r\n /** A user with a null UID. */\r\n User.UNAUTHENTICATED = new User(null);\r\n // TODO(mikelehen): Look into getting a proper uid-equivalent for\r\n // non-FirebaseAuth providers.\r\n User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');\r\n User.FIRST_PARTY = new User('first-party-uid');\r\n return User;\r\n}());\n\n/**\r\n * Copyright 2018 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$10 = 'SharedClientState';\r\n// The format of the LocalStorage key that stores the client state is:\r\n// firestore_clients__\r\nvar CLIENT_STATE_KEY_PREFIX = 'firestore_clients';\r\n// The format of the WebStorage key that stores the mutation state is:\r\n// firestore_mutations__\r\n// (for unauthenticated users)\r\n// or: firestore_mutations___\r\n//\r\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\r\n// contain.\r\nvar MUTATION_BATCH_KEY_PREFIX = 'firestore_mutations';\r\n// The format of the WebStorage key that stores a query target's metadata is:\r\n// firestore_targets__\r\nvar QUERY_TARGET_KEY_PREFIX = 'firestore_targets';\r\n// The WebStorage prefix that stores the primary tab's online state. The\r\n// format of the key is:\r\n// firestore_online_state_\r\nvar ONLINE_STATE_KEY_PREFIX = 'firestore_online_state';\r\n// The WebStorage key prefix for the key that stores the last sequence number allocated. The key\r\n// looks like 'firestore_sequence_number_'.\r\nvar SEQUENCE_NUMBER_KEY_PREFIX = 'firestore_sequence_number';\r\n/**\r\n * Holds the state of a mutation batch, including its user ID, batch ID and\r\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\r\n */\r\n// Visible for testing\r\nvar MutationMetadata = /** @class */ (function () {\r\n function MutationMetadata(user, batchId, state, error$$1) {\r\n this.user = user;\r\n this.batchId = batchId;\r\n this.state = state;\r\n this.error = error$$1;\r\n assert((error$$1 !== undefined) === (state === 'rejected'), \"MutationMetadata must contain an error iff state is 'rejected'\");\r\n }\r\n /**\r\n * Parses a MutationMetadata from its JSON representation in WebStorage.\r\n * Logs a warning and returns null if the format of the data is not valid.\r\n */\r\n MutationMetadata.fromWebStorageEntry = function (user, batchId, value) {\r\n var mutationBatch = JSON.parse(value);\r\n var validData = typeof mutationBatch === 'object' &&\r\n ['pending', 'acknowledged', 'rejected'].indexOf(mutationBatch.state) !==\r\n -1 &&\r\n (mutationBatch.error === undefined ||\r\n typeof mutationBatch.error === 'object');\r\n var firestoreError = undefined;\r\n if (validData && mutationBatch.error) {\r\n validData =\r\n typeof mutationBatch.error.message === 'string' &&\r\n typeof mutationBatch.error.code === 'string';\r\n if (validData) {\r\n firestoreError = new FirestoreError(mutationBatch.error.code, mutationBatch.error.message);\r\n }\r\n }\r\n if (validData) {\r\n return new MutationMetadata(user, batchId, mutationBatch.state, firestoreError);\r\n }\r\n else {\r\n error(LOG_TAG$10, \"Failed to parse mutation state for ID '\" + batchId + \"': \" + value);\r\n return null;\r\n }\r\n };\r\n MutationMetadata.prototype.toWebStorageJSON = function () {\r\n var batchMetadata = {\r\n state: this.state,\r\n updateTimeMs: Date.now() // Modify the existing value to trigger update.\r\n };\r\n if (this.error) {\r\n batchMetadata.error = {\r\n code: this.error.code,\r\n message: this.error.message\r\n };\r\n }\r\n return JSON.stringify(batchMetadata);\r\n };\r\n return MutationMetadata;\r\n}());\r\n/**\r\n * Holds the state of a query target, including its target ID and whether the\r\n * target is 'not-current', 'current' or 'rejected'.\r\n */\r\n// Visible for testing\r\nvar QueryTargetMetadata = /** @class */ (function () {\r\n function QueryTargetMetadata(targetId, state, error$$1) {\r\n this.targetId = targetId;\r\n this.state = state;\r\n this.error = error$$1;\r\n assert((error$$1 !== undefined) === (state === 'rejected'), \"QueryTargetMetadata must contain an error iff state is 'rejected'\");\r\n }\r\n /**\r\n * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\r\n * Logs a warning and returns null if the format of the data is not valid.\r\n */\r\n QueryTargetMetadata.fromWebStorageEntry = function (targetId, value) {\r\n var targetState = JSON.parse(value);\r\n var validData = typeof targetState === 'object' &&\r\n ['not-current', 'current', 'rejected'].indexOf(targetState.state) !==\r\n -1 &&\r\n (targetState.error === undefined ||\r\n typeof targetState.error === 'object');\r\n var firestoreError = undefined;\r\n if (validData && targetState.error) {\r\n validData =\r\n typeof targetState.error.message === 'string' &&\r\n typeof targetState.error.code === 'string';\r\n if (validData) {\r\n firestoreError = new FirestoreError(targetState.error.code, targetState.error.message);\r\n }\r\n }\r\n if (validData) {\r\n return new QueryTargetMetadata(targetId, targetState.state, firestoreError);\r\n }\r\n else {\r\n error(LOG_TAG$10, \"Failed to parse target state for ID '\" + targetId + \"': \" + value);\r\n return null;\r\n }\r\n };\r\n QueryTargetMetadata.prototype.toWebStorageJSON = function () {\r\n var targetState = {\r\n state: this.state,\r\n updateTimeMs: Date.now() // Modify the existing value to trigger update.\r\n };\r\n if (this.error) {\r\n targetState.error = {\r\n code: this.error.code,\r\n message: this.error.message\r\n };\r\n }\r\n return JSON.stringify(targetState);\r\n };\r\n return QueryTargetMetadata;\r\n}());\r\n/**\r\n * This class represents the immutable ClientState for a client read from\r\n * WebStorage, containing the list of active query targets.\r\n */\r\nvar RemoteClientState = /** @class */ (function () {\r\n function RemoteClientState(clientId, activeTargetIds) {\r\n this.clientId = clientId;\r\n this.activeTargetIds = activeTargetIds;\r\n }\r\n /**\r\n * Parses a RemoteClientState from the JSON representation in WebStorage.\r\n * Logs a warning and returns null if the format of the data is not valid.\r\n */\r\n RemoteClientState.fromWebStorageEntry = function (clientId, value) {\r\n var clientState = JSON.parse(value);\r\n var validData = typeof clientState === 'object' &&\r\n clientState.activeTargetIds instanceof Array;\r\n var activeTargetIdsSet = targetIdSet();\r\n for (var i = 0; validData && i < clientState.activeTargetIds.length; ++i) {\r\n validData = isSafeInteger(clientState.activeTargetIds[i]);\r\n activeTargetIdsSet = activeTargetIdsSet.add(clientState.activeTargetIds[i]);\r\n }\r\n if (validData) {\r\n return new RemoteClientState(clientId, activeTargetIdsSet);\r\n }\r\n else {\r\n error(LOG_TAG$10, \"Failed to parse client data for instance '\" + clientId + \"': \" + value);\r\n return null;\r\n }\r\n };\r\n return RemoteClientState;\r\n}());\r\n/**\r\n * This class represents the online state for all clients participating in\r\n * multi-tab. The online state is only written to by the primary client, and\r\n * used in secondary clients to update their query views.\r\n */\r\nvar SharedOnlineState = /** @class */ (function () {\r\n function SharedOnlineState(clientId, onlineState) {\r\n this.clientId = clientId;\r\n this.onlineState = onlineState;\r\n }\r\n /**\r\n * Parses a SharedOnlineState from its JSON representation in WebStorage.\r\n * Logs a warning and returns null if the format of the data is not valid.\r\n */\r\n SharedOnlineState.fromWebStorageEntry = function (value) {\r\n var onlineState = JSON.parse(value);\r\n var validData = typeof onlineState === 'object' &&\r\n OnlineState[onlineState.onlineState] !== undefined &&\r\n typeof onlineState.clientId === 'string';\r\n if (validData) {\r\n return new SharedOnlineState(onlineState.clientId, OnlineState[onlineState.onlineState]);\r\n }\r\n else {\r\n error(LOG_TAG$10, \"Failed to parse online state: \" + value);\r\n return null;\r\n }\r\n };\r\n return SharedOnlineState;\r\n}());\r\n/**\r\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\r\n * mutable and keeps track of all pending mutations, which allows us to\r\n * update the range of pending mutation batch IDs as new mutations are added or\r\n * removed.\r\n *\r\n * The data in `LocalClientState` is not read from WebStorage and instead\r\n * updated via its instance methods. The updated state can be serialized via\r\n * `toWebStorageJSON()`.\r\n */\r\n// Visible for testing.\r\nvar LocalClientState = /** @class */ (function () {\r\n function LocalClientState() {\r\n this.activeTargetIds = targetIdSet();\r\n }\r\n LocalClientState.prototype.addQueryTarget = function (targetId) {\r\n assert(!this.activeTargetIds.has(targetId), \"Target with ID '\" + targetId + \"' already active.\");\r\n this.activeTargetIds = this.activeTargetIds.add(targetId);\r\n };\r\n LocalClientState.prototype.removeQueryTarget = function (targetId) {\r\n this.activeTargetIds = this.activeTargetIds.delete(targetId);\r\n };\r\n /**\r\n * Converts this entry into a JSON-encoded format we can use for WebStorage.\r\n * Does not encode `clientId` as it is part of the key in WebStorage.\r\n */\r\n LocalClientState.prototype.toWebStorageJSON = function () {\r\n var data = {\r\n activeTargetIds: this.activeTargetIds.toArray(),\r\n updateTimeMs: Date.now() // Modify the existing value to trigger update.\r\n };\r\n return JSON.stringify(data);\r\n };\r\n return LocalClientState;\r\n}());\r\n/**\r\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\r\n * backing store for the SharedClientState. It keeps track of all active\r\n * clients and supports modifications of the local client's data.\r\n */\r\nvar WebStorageSharedClientState = /** @class */ (function () {\r\n function WebStorageSharedClientState(queue, platform, persistenceKey, localClientId, initialUser) {\r\n this.queue = queue;\r\n this.platform = platform;\r\n this.persistenceKey = persistenceKey;\r\n this.localClientId = localClientId;\r\n this.syncEngine = null;\r\n this.onlineStateHandler = null;\r\n this.sequenceNumberHandler = null;\r\n this.activeClients = {};\r\n this.storageListener = this.handleWebStorageEvent.bind(this);\r\n this.started = false;\r\n /**\r\n * Captures WebStorage events that occur before `start()` is called. These\r\n * events are replayed once `WebStorageSharedClientState` is started.\r\n */\r\n this.earlyEvents = [];\r\n if (!WebStorageSharedClientState.isAvailable(this.platform)) {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, 'LocalStorage is not available on this platform.');\r\n }\r\n // Escape the special characters mentioned here:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\r\n var escapedPersistenceKey = persistenceKey.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n this.storage = this.platform.window.localStorage;\r\n this.currentUser = initialUser;\r\n this.localClientStorageKey = this.toWebStorageClientStateKey(this.localClientId);\r\n this.sequenceNumberKey = SEQUENCE_NUMBER_KEY_PREFIX + \"_\" + persistenceKey;\r\n this.activeClients[this.localClientId] = new LocalClientState();\r\n this.clientStateKeyRe = new RegExp(\"^\" + CLIENT_STATE_KEY_PREFIX + \"_\" + escapedPersistenceKey + \"_([^_]*)$\");\r\n this.mutationBatchKeyRe = new RegExp(\"^\" + MUTATION_BATCH_KEY_PREFIX + \"_\" + escapedPersistenceKey + \"_(\\\\d+)(?:_(.*))?$\");\r\n this.queryTargetKeyRe = new RegExp(\"^\" + QUERY_TARGET_KEY_PREFIX + \"_\" + escapedPersistenceKey + \"_(\\\\d+)$\");\r\n this.onlineStateKey = ONLINE_STATE_KEY_PREFIX + \"_\" + persistenceKey;\r\n // Rather than adding the storage observer during start(), we add the\r\n // storage observer during initialization. This ensures that we collect\r\n // events before other components populate their initial state (during their\r\n // respective start() calls). Otherwise, we might for example miss a\r\n // mutation that is added after LocalStore's start() processed the existing\r\n // mutations but before we observe WebStorage events.\r\n this.platform.window.addEventListener('storage', this.storageListener);\r\n }\r\n /** Returns 'true' if WebStorage is available in the current environment. */\r\n WebStorageSharedClientState.isAvailable = function (platform) {\r\n return !!(platform.window && platform.window.localStorage != null);\r\n };\r\n WebStorageSharedClientState.prototype.start = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n var existingClients, _i, existingClients_1, clientId, storageItem, clientState, onlineStateJSON, onlineState, _a, _b, event_1;\r\n return tslib_1.__generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n assert(!this.started, 'WebStorageSharedClientState already started');\r\n assert(this.syncEngine !== null, 'syncEngine property must be set before calling start()');\r\n assert(this.onlineStateHandler !== null, 'onlineStateHandler property must be set before calling start()');\r\n return [4 /*yield*/, this.syncEngine.getActiveClients()];\r\n case 1:\r\n existingClients = _c.sent();\r\n for (_i = 0, existingClients_1 = existingClients; _i < existingClients_1.length; _i++) {\r\n clientId = existingClients_1[_i];\r\n if (clientId === this.localClientId) {\r\n continue;\r\n }\r\n storageItem = this.getItem(this.toWebStorageClientStateKey(clientId));\r\n if (storageItem) {\r\n clientState = RemoteClientState.fromWebStorageEntry(clientId, storageItem);\r\n if (clientState) {\r\n this.activeClients[clientState.clientId] = clientState;\r\n }\r\n }\r\n }\r\n this.persistClientState();\r\n onlineStateJSON = this.storage.getItem(this.onlineStateKey);\r\n if (onlineStateJSON) {\r\n onlineState = this.fromWebStorageOnlineState(onlineStateJSON);\r\n if (onlineState) {\r\n this.handleOnlineStateEvent(onlineState);\r\n }\r\n }\r\n for (_a = 0, _b = this.earlyEvents; _a < _b.length; _a++) {\r\n event_1 = _b[_a];\r\n this.handleWebStorageEvent(event_1);\r\n }\r\n this.earlyEvents = [];\r\n // Register a window unload hook to remove the client metadata entry from\r\n // WebStorage even if `shutdown()` was not called.\r\n this.platform.window.addEventListener('unload', function () { return _this.shutdown(); });\r\n this.started = true;\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n WebStorageSharedClientState.prototype.writeSequenceNumber = function (sequenceNumber) {\r\n this.setItem(this.sequenceNumberKey, JSON.stringify(sequenceNumber));\r\n };\r\n WebStorageSharedClientState.prototype.getAllActiveQueryTargets = function () {\r\n var activeTargets = targetIdSet();\r\n forEach(this.activeClients, function (key, value) {\r\n activeTargets = activeTargets.unionWith(value.activeTargetIds);\r\n });\r\n return activeTargets;\r\n };\r\n WebStorageSharedClientState.prototype.isActiveQueryTarget = function (targetId) {\r\n // This is not using `obj.forEach` since `forEach` doesn't support early\r\n // return.\r\n for (var clientId in this.activeClients) {\r\n if (this.activeClients.hasOwnProperty(clientId)) {\r\n if (this.activeClients[clientId].activeTargetIds.has(targetId)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n WebStorageSharedClientState.prototype.addPendingMutation = function (batchId) {\r\n this.persistMutationState(batchId, 'pending');\r\n };\r\n WebStorageSharedClientState.prototype.updateMutationState = function (batchId, state, error$$1) {\r\n this.persistMutationState(batchId, state, error$$1);\r\n // Once a final mutation result is observed by other clients, they no longer\r\n // access the mutation's metadata entry. Since WebStorage replays events\r\n // in order, it is safe to delete the entry right after updating it.\r\n this.removeMutationState(batchId);\r\n };\r\n WebStorageSharedClientState.prototype.addLocalQueryTarget = function (targetId) {\r\n var queryState = 'not-current';\r\n // Lookup an existing query state if the target ID was already registered\r\n // by another tab\r\n if (this.isActiveQueryTarget(targetId)) {\r\n var storageItem = this.storage.getItem(this.toWebStorageQueryTargetMetadataKey(targetId));\r\n if (storageItem) {\r\n var metadata = QueryTargetMetadata.fromWebStorageEntry(targetId, storageItem);\r\n if (metadata) {\r\n queryState = metadata.state;\r\n }\r\n }\r\n }\r\n this.localClientState.addQueryTarget(targetId);\r\n this.persistClientState();\r\n return queryState;\r\n };\r\n WebStorageSharedClientState.prototype.removeLocalQueryTarget = function (targetId) {\r\n this.localClientState.removeQueryTarget(targetId);\r\n this.persistClientState();\r\n };\r\n WebStorageSharedClientState.prototype.isLocalQueryTarget = function (targetId) {\r\n return this.localClientState.activeTargetIds.has(targetId);\r\n };\r\n WebStorageSharedClientState.prototype.clearQueryState = function (targetId) {\r\n this.removeItem(this.toWebStorageQueryTargetMetadataKey(targetId));\r\n };\r\n WebStorageSharedClientState.prototype.updateQueryState = function (targetId, state, error$$1) {\r\n this.persistQueryTargetState(targetId, state, error$$1);\r\n };\r\n WebStorageSharedClientState.prototype.handleUserChange = function (user, removedBatchIds, addedBatchIds) {\r\n var _this = this;\r\n removedBatchIds.forEach(function (batchId) {\r\n _this.removeMutationState(batchId);\r\n });\r\n this.currentUser = user;\r\n addedBatchIds.forEach(function (batchId) {\r\n _this.addPendingMutation(batchId);\r\n });\r\n };\r\n WebStorageSharedClientState.prototype.setOnlineState = function (onlineState) {\r\n this.persistOnlineState(onlineState);\r\n };\r\n WebStorageSharedClientState.prototype.shutdown = function () {\r\n if (this.started) {\r\n this.platform.window.removeEventListener('storage', this.storageListener);\r\n this.removeItem(this.localClientStorageKey);\r\n this.started = false;\r\n }\r\n };\r\n WebStorageSharedClientState.prototype.getItem = function (key) {\r\n var value = this.storage.getItem(key);\r\n debug(LOG_TAG$10, 'READ', key, value);\r\n return value;\r\n };\r\n WebStorageSharedClientState.prototype.setItem = function (key, value) {\r\n debug(LOG_TAG$10, 'SET', key, value);\r\n this.storage.setItem(key, value);\r\n };\r\n WebStorageSharedClientState.prototype.removeItem = function (key) {\r\n debug(LOG_TAG$10, 'REMOVE', key);\r\n this.storage.removeItem(key);\r\n };\r\n WebStorageSharedClientState.prototype.handleWebStorageEvent = function (event) {\r\n var _this = this;\r\n if (event.storageArea === this.storage) {\r\n debug(LOG_TAG$10, 'EVENT', event.key, event.newValue);\r\n if (event.key === this.localClientStorageKey) {\r\n error('Received WebStorage notification for local change. Another client might have ' +\r\n 'garbage-collected our state');\r\n return;\r\n }\r\n this.queue.enqueueAndForget(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n var clientState, clientId, mutationMetadata, queryTargetMetadata, onlineState, sequenceNumber;\r\n return tslib_1.__generator(this, function (_a) {\r\n if (!this.started) {\r\n this.earlyEvents.push(event);\r\n return [2 /*return*/];\r\n }\r\n if (event.key === null) {\r\n return [2 /*return*/];\r\n }\r\n if (this.clientStateKeyRe.test(event.key)) {\r\n if (event.newValue != null) {\r\n clientState = this.fromWebStorageClientState(event.key, event.newValue);\r\n if (clientState) {\r\n return [2 /*return*/, this.handleClientStateEvent(clientState.clientId, clientState)];\r\n }\r\n }\r\n else {\r\n clientId = this.fromWebStorageClientStateKey(event.key);\r\n return [2 /*return*/, this.handleClientStateEvent(clientId, null)];\r\n }\r\n }\r\n else if (this.mutationBatchKeyRe.test(event.key)) {\r\n if (event.newValue !== null) {\r\n mutationMetadata = this.fromWebStorageMutationMetadata(event.key, event.newValue);\r\n if (mutationMetadata) {\r\n return [2 /*return*/, this.handleMutationBatchEvent(mutationMetadata)];\r\n }\r\n }\r\n }\r\n else if (this.queryTargetKeyRe.test(event.key)) {\r\n if (event.newValue !== null) {\r\n queryTargetMetadata = this.fromWebStorageQueryTargetMetadata(event.key, event.newValue);\r\n if (queryTargetMetadata) {\r\n return [2 /*return*/, this.handleQueryTargetEvent(queryTargetMetadata)];\r\n }\r\n }\r\n }\r\n else if (event.key === this.onlineStateKey) {\r\n if (event.newValue !== null) {\r\n onlineState = this.fromWebStorageOnlineState(event.newValue);\r\n if (onlineState) {\r\n return [2 /*return*/, this.handleOnlineStateEvent(onlineState)];\r\n }\r\n }\r\n }\r\n else if (event.key === this.sequenceNumberKey) {\r\n assert(!!this.sequenceNumberHandler, 'Missing sequenceNumberHandler');\r\n sequenceNumber = fromWebStorageSequenceNumber(event.newValue);\r\n if (sequenceNumber !== ListenSequence.INVALID) {\r\n this.sequenceNumberHandler(sequenceNumber);\r\n }\r\n }\r\n return [2 /*return*/];\r\n });\r\n }); });\r\n }\r\n };\r\n Object.defineProperty(WebStorageSharedClientState.prototype, \"localClientState\", {\r\n get: function () {\r\n return this.activeClients[this.localClientId];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n WebStorageSharedClientState.prototype.persistClientState = function () {\r\n this.setItem(this.localClientStorageKey, this.localClientState.toWebStorageJSON());\r\n };\r\n WebStorageSharedClientState.prototype.persistMutationState = function (batchId, state, error$$1) {\r\n var mutationState = new MutationMetadata(this.currentUser, batchId, state, error$$1);\r\n var mutationKey = this.toWebStorageMutationBatchKey(batchId);\r\n this.setItem(mutationKey, mutationState.toWebStorageJSON());\r\n };\r\n WebStorageSharedClientState.prototype.removeMutationState = function (batchId) {\r\n var mutationKey = this.toWebStorageMutationBatchKey(batchId);\r\n this.removeItem(mutationKey);\r\n };\r\n WebStorageSharedClientState.prototype.persistOnlineState = function (onlineState) {\r\n var entry = {\r\n clientId: this.localClientId,\r\n onlineState: OnlineState[onlineState]\r\n };\r\n this.storage.setItem(this.onlineStateKey, JSON.stringify(entry));\r\n };\r\n WebStorageSharedClientState.prototype.persistQueryTargetState = function (targetId, state, error$$1) {\r\n var targetKey = this.toWebStorageQueryTargetMetadataKey(targetId);\r\n var targetMetadata = new QueryTargetMetadata(targetId, state, error$$1);\r\n this.setItem(targetKey, targetMetadata.toWebStorageJSON());\r\n };\r\n /** Assembles the key for a client state in WebStorage */\r\n WebStorageSharedClientState.prototype.toWebStorageClientStateKey = function (clientId) {\r\n assert(clientId.indexOf('_') === -1, \"Client key cannot contain '_', but was '\" + clientId + \"'\");\r\n return CLIENT_STATE_KEY_PREFIX + \"_\" + this.persistenceKey + \"_\" + clientId;\r\n };\r\n /** Assembles the key for a query state in WebStorage */\r\n WebStorageSharedClientState.prototype.toWebStorageQueryTargetMetadataKey = function (targetId) {\r\n return QUERY_TARGET_KEY_PREFIX + \"_\" + this.persistenceKey + \"_\" + targetId;\r\n };\r\n /** Assembles the key for a mutation batch in WebStorage */\r\n WebStorageSharedClientState.prototype.toWebStorageMutationBatchKey = function (batchId) {\r\n var mutationKey = MUTATION_BATCH_KEY_PREFIX + \"_\" + this.persistenceKey + \"_\" + batchId;\r\n if (this.currentUser.isAuthenticated()) {\r\n mutationKey += \"_\" + this.currentUser.uid;\r\n }\r\n return mutationKey;\r\n };\r\n /**\r\n * Parses a client state key in WebStorage. Returns null if the key does not\r\n * match the expected key format.\r\n */\r\n WebStorageSharedClientState.prototype.fromWebStorageClientStateKey = function (key) {\r\n var match = this.clientStateKeyRe.exec(key);\r\n return match ? match[1] : null;\r\n };\r\n /**\r\n * Parses a client state in WebStorage. Returns 'null' if the value could not\r\n * be parsed.\r\n */\r\n WebStorageSharedClientState.prototype.fromWebStorageClientState = function (key, value) {\r\n var clientId = this.fromWebStorageClientStateKey(key);\r\n assert(clientId !== null, \"Cannot parse client state key '\" + key + \"'\");\r\n return RemoteClientState.fromWebStorageEntry(clientId, value);\r\n };\r\n /**\r\n * Parses a mutation batch state in WebStorage. Returns 'null' if the value\r\n * could not be parsed.\r\n */\r\n WebStorageSharedClientState.prototype.fromWebStorageMutationMetadata = function (key, value) {\r\n var match = this.mutationBatchKeyRe.exec(key);\r\n assert(match !== null, \"Cannot parse mutation batch key '\" + key + \"'\");\r\n var batchId = Number(match[1]);\r\n var userId = match[2] !== undefined ? match[2] : null;\r\n return MutationMetadata.fromWebStorageEntry(new User(userId), batchId, value);\r\n };\r\n /**\r\n * Parses a query target state from WebStorage. Returns 'null' if the value\r\n * could not be parsed.\r\n */\r\n WebStorageSharedClientState.prototype.fromWebStorageQueryTargetMetadata = function (key, value) {\r\n var match = this.queryTargetKeyRe.exec(key);\r\n assert(match !== null, \"Cannot parse query target key '\" + key + \"'\");\r\n var targetId = Number(match[1]);\r\n return QueryTargetMetadata.fromWebStorageEntry(targetId, value);\r\n };\r\n /**\r\n * Parses an online state from WebStorage. Returns 'null' if the value\r\n * could not be parsed.\r\n */\r\n WebStorageSharedClientState.prototype.fromWebStorageOnlineState = function (value) {\r\n return SharedOnlineState.fromWebStorageEntry(value);\r\n };\r\n WebStorageSharedClientState.prototype.handleMutationBatchEvent = function (mutationBatch) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n if (mutationBatch.user.uid !== this.currentUser.uid) {\r\n debug(LOG_TAG$10, \"Ignoring mutation for non-active user \" + mutationBatch.user.uid);\r\n return [2 /*return*/];\r\n }\r\n return [2 /*return*/, this.syncEngine.applyBatchState(mutationBatch.batchId, mutationBatch.state, mutationBatch.error)];\r\n });\r\n });\r\n };\r\n WebStorageSharedClientState.prototype.handleQueryTargetEvent = function (targetMetadata) {\r\n return this.syncEngine.applyTargetState(targetMetadata.targetId, targetMetadata.state, targetMetadata.error);\r\n };\r\n WebStorageSharedClientState.prototype.handleClientStateEvent = function (clientId, clientState) {\r\n var _this = this;\r\n var existingTargets = this.getAllActiveQueryTargets();\r\n if (clientState) {\r\n this.activeClients[clientId] = clientState;\r\n }\r\n else {\r\n delete this.activeClients[clientId];\r\n }\r\n var newTargets = this.getAllActiveQueryTargets();\r\n var addedTargets = [];\r\n var removedTargets = [];\r\n newTargets.forEach(function (targetId) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n if (!existingTargets.has(targetId)) {\r\n addedTargets.push(targetId);\r\n }\r\n return [2 /*return*/];\r\n });\r\n }); });\r\n existingTargets.forEach(function (targetId) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n if (!newTargets.has(targetId)) {\r\n removedTargets.push(targetId);\r\n }\r\n return [2 /*return*/];\r\n });\r\n }); });\r\n return this.syncEngine.applyActiveTargetsChange(addedTargets, removedTargets);\r\n };\r\n WebStorageSharedClientState.prototype.handleOnlineStateEvent = function (onlineState) {\r\n // We check whether the client that wrote this online state is still active\r\n // by comparing its client ID to the list of clients kept active in\r\n // IndexedDb. If a client does not update their IndexedDb client state\r\n // within 5 seconds, it is considered inactive and we don't emit an online\r\n // state event.\r\n if (this.activeClients[onlineState.clientId]) {\r\n this.onlineStateHandler(onlineState.onlineState);\r\n }\r\n };\r\n return WebStorageSharedClientState;\r\n}());\r\nfunction fromWebStorageSequenceNumber(seqString) {\r\n var sequenceNumber = ListenSequence.INVALID;\r\n if (seqString != null) {\r\n try {\r\n var parsed = JSON.parse(seqString);\r\n assert(typeof parsed === 'number', 'Found non-numeric sequence number');\r\n sequenceNumber = parsed;\r\n }\r\n catch (e) {\r\n error(LOG_TAG$10, 'Failed to read sequence number from WebStorage', e);\r\n }\r\n }\r\n return sequenceNumber;\r\n}\r\n/**\r\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\r\n * clients using memory persistence. The state in this class remains fully\r\n * isolated and no synchronization is performed.\r\n */\r\nvar MemorySharedClientState = /** @class */ (function () {\r\n function MemorySharedClientState() {\r\n this.localState = new LocalClientState();\r\n this.queryState = {};\r\n this.syncEngine = null;\r\n this.onlineStateHandler = null;\r\n this.sequenceNumberHandler = null;\r\n }\r\n MemorySharedClientState.prototype.addPendingMutation = function (batchId) {\r\n // No op.\r\n };\r\n MemorySharedClientState.prototype.updateMutationState = function (batchId, state, error$$1) {\r\n // No op.\r\n };\r\n MemorySharedClientState.prototype.addLocalQueryTarget = function (targetId) {\r\n this.localState.addQueryTarget(targetId);\r\n return this.queryState[targetId] || 'not-current';\r\n };\r\n MemorySharedClientState.prototype.updateQueryState = function (targetId, state, error$$1) {\r\n this.queryState[targetId] = state;\r\n };\r\n MemorySharedClientState.prototype.removeLocalQueryTarget = function (targetId) {\r\n this.localState.removeQueryTarget(targetId);\r\n };\r\n MemorySharedClientState.prototype.isLocalQueryTarget = function (targetId) {\r\n return this.localState.activeTargetIds.has(targetId);\r\n };\r\n MemorySharedClientState.prototype.clearQueryState = function (targetId) {\r\n delete this.queryState[targetId];\r\n };\r\n MemorySharedClientState.prototype.getAllActiveQueryTargets = function () {\r\n return this.localState.activeTargetIds;\r\n };\r\n MemorySharedClientState.prototype.isActiveQueryTarget = function (targetId) {\r\n return this.localState.activeTargetIds.has(targetId);\r\n };\r\n MemorySharedClientState.prototype.start = function () {\r\n this.localState = new LocalClientState();\r\n return Promise.resolve();\r\n };\r\n MemorySharedClientState.prototype.handleUserChange = function (user, removedBatchIds, addedBatchIds) {\r\n // No op.\r\n };\r\n MemorySharedClientState.prototype.setOnlineState = function (onlineState) {\r\n // No op.\r\n };\r\n MemorySharedClientState.prototype.shutdown = function () { };\r\n MemorySharedClientState.prototype.writeSequenceNumber = function (sequenceNumber) { };\r\n return MemorySharedClientState;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LOG_TAG$11 = 'FirestoreClient';\r\n/** The DOMException code for an aborted operation. */\r\nvar DOM_EXCEPTION_ABORTED = 20;\r\n/** The DOMException code for quota exceeded. */\r\nvar DOM_EXCEPTION_QUOTA_EXCEEDED = 22;\r\n/**\r\n * FirestoreClient is a top-level class that constructs and owns all of the\r\n * pieces of the client SDK architecture. It is responsible for creating the\r\n * async queue that is shared by all of the other components in the system.\r\n */\r\nvar FirestoreClient = /** @class */ (function () {\r\n function FirestoreClient(platform, databaseInfo, credentials, \r\n /**\r\n * Asynchronous queue responsible for all of our internal processing. When\r\n * we get incoming work from the user (via public API) or the network\r\n * (incoming GRPC messages), we should always schedule onto this queue.\r\n * This ensures all of our work is properly serialized (e.g. we don't\r\n * start processing a new operation while the previous one is waiting for\r\n * an async I/O to complete).\r\n */\r\n asyncQueue) {\r\n this.platform = platform;\r\n this.databaseInfo = databaseInfo;\r\n this.credentials = credentials;\r\n this.asyncQueue = asyncQueue;\r\n this.clientId = AutoId.newId();\r\n }\r\n /**\r\n * Starts up the FirestoreClient, returning only whether or not enabling\r\n * persistence succeeded.\r\n *\r\n * The intent here is to \"do the right thing\" as far as users are concerned.\r\n * Namely, in cases where offline persistence is requested and possible,\r\n * enable it, but otherwise fall back to persistence disabled. For the most\r\n * part we expect this to succeed one way or the other so we don't expect our\r\n * users to actually wait on the firestore.enablePersistence Promise since\r\n * they generally won't care.\r\n *\r\n * Of course some users actually do care about whether or not persistence\r\n * was successfully enabled, so the Promise returned from this method\r\n * indicates this outcome.\r\n *\r\n * This presents a problem though: even before enablePersistence resolves or\r\n * rejects, users may have made calls to e.g. firestore.collection() which\r\n * means that the FirestoreClient in there will be available and will be\r\n * enqueuing actions on the async queue.\r\n *\r\n * Meanwhile any failure of an operation on the async queue causes it to\r\n * panic and reject any further work, on the premise that unhandled errors\r\n * are fatal.\r\n *\r\n * Consequently the fallback is handled internally here in start, and if the\r\n * fallback succeeds we signal success to the async queue even though the\r\n * start() itself signals failure.\r\n *\r\n * @param persistenceSettings Settings object to configure offline\r\n * persistence.\r\n * @returns A deferred result indicating the user-visible result of enabling\r\n * offline persistence. This method will reject this if IndexedDB fails to\r\n * start for any reason. If usePersistence is false this is\r\n * unconditionally resolved.\r\n */\r\n FirestoreClient.prototype.start = function (persistenceSettings) {\r\n var _this = this;\r\n // We defer our initialization until we get the current user from\r\n // setChangeListener(). We block the async queue until we got the initial\r\n // user and the initialization is completed. This will prevent any scheduled\r\n // work from happening before initialization is completed.\r\n //\r\n // If initializationDone resolved then the FirestoreClient is in a usable\r\n // state.\r\n var initializationDone = new Deferred$1();\r\n // If usePersistence is true, certain classes of errors while starting are\r\n // recoverable but only by falling back to persistence disabled.\r\n //\r\n // If there's an error in the first case but not in recovery we cannot\r\n // reject the promise blocking the async queue because this will cause the\r\n // async queue to panic.\r\n var persistenceResult = new Deferred$1();\r\n var initialized = false;\r\n this.credentials.setChangeListener(function (user) {\r\n if (!initialized) {\r\n initialized = true;\r\n _this.initializePersistence(persistenceSettings, persistenceResult, user)\r\n .then(function () { return _this.initializeRest(user); })\r\n .then(initializationDone.resolve, initializationDone.reject);\r\n }\r\n else {\r\n _this.asyncQueue.enqueueAndForget(function () {\r\n return _this.handleCredentialChange(user);\r\n });\r\n }\r\n });\r\n // Block the async queue until initialization is done\r\n this.asyncQueue.enqueueAndForget(function () {\r\n return initializationDone.promise;\r\n });\r\n // Return only the result of enabling persistence. Note that this does not\r\n // need to await the completion of initializationDone because the result of\r\n // this method should not reflect any other kind of failure to start.\r\n return persistenceResult.promise;\r\n };\r\n /** Enables the network connection and requeues all pending operations. */\r\n FirestoreClient.prototype.enableNetwork = function () {\r\n var _this = this;\r\n return this.asyncQueue.enqueue(function () {\r\n return _this.syncEngine.enableNetwork();\r\n });\r\n };\r\n /**\r\n * Initializes persistent storage, attempting to use IndexedDB if\r\n * usePersistence is true or memory-only if false.\r\n *\r\n * If IndexedDB fails because it's already open in another tab or because the\r\n * platform can't possibly support our implementation then this method rejects\r\n * the persistenceResult and falls back on memory-only persistence.\r\n *\r\n * @param persistenceSettings Settings object to configure offline persistence\r\n * @param persistenceResult A deferred result indicating the user-visible\r\n * result of enabling offline persistence. This method will reject this if\r\n * IndexedDB fails to start for any reason. If usePersistence is false\r\n * this is unconditionally resolved.\r\n * @returns a Promise indicating whether or not initialization should\r\n * continue, i.e. that one of the persistence implementations actually\r\n * succeeded.\r\n */\r\n FirestoreClient.prototype.initializePersistence = function (persistenceSettings, persistenceResult, user) {\r\n var _this = this;\r\n if (persistenceSettings.enabled) {\r\n return this.startIndexedDbPersistence(user, persistenceSettings)\r\n .then(persistenceResult.resolve)\r\n .catch(function (error$$1) {\r\n // Regardless of whether or not the retry succeeds, from an user\r\n // perspective, offline persistence has failed.\r\n persistenceResult.reject(error$$1);\r\n // An unknown failure on the first stage shuts everything down.\r\n if (!_this.canFallback(error$$1)) {\r\n return Promise.reject(error$$1);\r\n }\r\n console.warn('Error enabling offline storage. Falling back to' +\r\n ' storage disabled: ' +\r\n error$$1);\r\n return _this.startMemoryPersistence();\r\n });\r\n }\r\n else {\r\n // When usePersistence == false, enabling offline persistence is defined\r\n // to unconditionally succeed. This allows start() to have the same\r\n // signature for both cases, despite the fact that the returned promise\r\n // is only used in the enablePersistence call.\r\n persistenceResult.resolve();\r\n return this.startMemoryPersistence();\r\n }\r\n };\r\n /**\r\n * Decides whether the provided error allows us to gracefully disable\r\n * persistence (as opposed to crashing the client).\r\n */\r\n FirestoreClient.prototype.canFallback = function (error$$1) {\r\n if (error$$1 instanceof FirestoreError) {\r\n return (error$$1.code === Code.FAILED_PRECONDITION ||\r\n error$$1.code === Code.UNIMPLEMENTED);\r\n }\r\n else if (typeof DOMException !== 'undefined' &&\r\n error$$1 instanceof DOMException) {\r\n // We fall back to memory persistence if we cannot write the primary\r\n // lease. This can happen can during a schema migration, or if we run out\r\n // of quota when we try to write the primary lease.\r\n // For both the `QuotaExceededError` and the `AbortError`, it is safe to\r\n // fall back to memory persistence since all modifications to IndexedDb\r\n // failed to commit.\r\n return (error$$1.code === DOM_EXCEPTION_QUOTA_EXCEEDED ||\r\n error$$1.code === DOM_EXCEPTION_ABORTED);\r\n }\r\n return true;\r\n };\r\n /**\r\n * Starts IndexedDB-based persistence.\r\n *\r\n * @returns A promise indicating success or failure.\r\n */\r\n FirestoreClient.prototype.startIndexedDbPersistence = function (user, settings) {\r\n var _this = this;\r\n assert(settings.enabled, 'Should only start IndexedDb persitence with offline persistence enabled.');\r\n // TODO(http://b/33384523): For now we just disable garbage collection\r\n // when persistence is enabled.\r\n var storagePrefix = IndexedDbPersistence.buildStoragePrefix(this.databaseInfo);\r\n // Opt to use proto3 JSON in case the platform doesn't support Uint8Array.\r\n var serializer = new JsonProtoSerializer(this.databaseInfo.databaseId, {\r\n useProto3Json: true\r\n });\r\n return Promise.resolve().then(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n var _a, _b;\r\n return tslib_1.__generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n if (settings.experimentalTabSynchronization &&\r\n !WebStorageSharedClientState.isAvailable(this.platform)) {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, 'IndexedDB persistence is only available on platforms that support LocalStorage.');\r\n }\r\n if (!settings.experimentalTabSynchronization) return [3 /*break*/, 2];\r\n this.sharedClientState = new WebStorageSharedClientState(this.asyncQueue, this.platform, storagePrefix, this.clientId, user);\r\n _a = this;\r\n return [4 /*yield*/, IndexedDbPersistence.createMultiClientIndexedDbPersistence(storagePrefix, this.clientId, this.platform, this.asyncQueue, serializer, { sequenceNumberSyncer: this.sharedClientState })];\r\n case 1:\r\n _a.persistence = _c.sent();\r\n return [3 /*break*/, 4];\r\n case 2:\r\n this.sharedClientState = new MemorySharedClientState();\r\n _b = this;\r\n return [4 /*yield*/, IndexedDbPersistence.createIndexedDbPersistence(storagePrefix, this.clientId, this.platform, this.asyncQueue, serializer)];\r\n case 3:\r\n _b.persistence = _c.sent();\r\n _c.label = 4;\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n }); });\r\n };\r\n /**\r\n * Starts Memory-backed persistence. In practice this cannot fail.\r\n *\r\n * @returns A promise that will successfully resolve.\r\n */\r\n FirestoreClient.prototype.startMemoryPersistence = function () {\r\n this.persistence = MemoryPersistence.createEagerPersistence(this.clientId);\r\n this.sharedClientState = new MemorySharedClientState();\r\n return Promise.resolve();\r\n };\r\n /**\r\n * Initializes the rest of the FirestoreClient, assuming the initial user\r\n * has been obtained from the credential provider and some persistence\r\n * implementation is available in this.persistence.\r\n */\r\n FirestoreClient.prototype.initializeRest = function (user) {\r\n var _this = this;\r\n debug(LOG_TAG$11, 'Initializing. user=', user.uid);\r\n return this.platform\r\n .loadConnection(this.databaseInfo)\r\n .then(function (connection) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n var _this = this;\r\n var serializer, datastore, remoteStoreOnlineStateChangedHandler, sharedClientStateOnlineStateChangedHandler;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.localStore = new LocalStore(this.persistence, user);\r\n serializer = this.platform.newSerializer(this.databaseInfo.databaseId);\r\n datastore = new Datastore(this.asyncQueue, connection, this.credentials, serializer);\r\n remoteStoreOnlineStateChangedHandler = function (onlineState) {\r\n return _this.syncEngine.applyOnlineStateChange(onlineState, OnlineStateSource.RemoteStore);\r\n };\r\n sharedClientStateOnlineStateChangedHandler = function (onlineState) {\r\n return _this.syncEngine.applyOnlineStateChange(onlineState, OnlineStateSource.SharedClientState);\r\n };\r\n this.remoteStore = new RemoteStore(this.localStore, datastore, this.asyncQueue, remoteStoreOnlineStateChangedHandler);\r\n this.syncEngine = new SyncEngine(this.localStore, this.remoteStore, this.sharedClientState, user);\r\n this.sharedClientState.onlineStateHandler = sharedClientStateOnlineStateChangedHandler;\r\n // Set up wiring between sync engine and other components\r\n this.remoteStore.syncEngine = this.syncEngine;\r\n this.sharedClientState.syncEngine = this.syncEngine;\r\n this.eventMgr = new EventManager(this.syncEngine);\r\n // PORTING NOTE: LocalStore doesn't need an explicit start() on the Web.\r\n return [4 /*yield*/, this.sharedClientState.start()];\r\n case 1:\r\n // PORTING NOTE: LocalStore doesn't need an explicit start() on the Web.\r\n _a.sent();\r\n return [4 /*yield*/, this.remoteStore.start()];\r\n case 2:\r\n _a.sent();\r\n // NOTE: This will immediately call the listener, so we make sure to\r\n // set it after localStore / remoteStore are started.\r\n return [4 /*yield*/, this.persistence.setPrimaryStateListener(function (isPrimary) {\r\n return _this.syncEngine.applyPrimaryState(isPrimary);\r\n })];\r\n case 3:\r\n // NOTE: This will immediately call the listener, so we make sure to\r\n // set it after localStore / remoteStore are started.\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n }); });\r\n };\r\n FirestoreClient.prototype.handleCredentialChange = function (user) {\r\n this.asyncQueue.verifyOperationInProgress();\r\n debug(LOG_TAG$11, 'Credential Changed. Current user: ' + user.uid);\r\n return this.syncEngine.handleCredentialChange(user);\r\n };\r\n /** Disables the network connection. Pending operations will not complete. */\r\n FirestoreClient.prototype.disableNetwork = function () {\r\n var _this = this;\r\n return this.asyncQueue.enqueue(function () {\r\n return _this.syncEngine.disableNetwork();\r\n });\r\n };\r\n FirestoreClient.prototype.shutdown = function (options) {\r\n var _this = this;\r\n return this.asyncQueue.enqueue(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: \r\n // PORTING NOTE: LocalStore does not need an explicit shutdown on web.\r\n return [4 /*yield*/, this.remoteStore.shutdown()];\r\n case 1:\r\n // PORTING NOTE: LocalStore does not need an explicit shutdown on web.\r\n _a.sent();\r\n return [4 /*yield*/, this.sharedClientState.shutdown()];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, this.persistence.shutdown(options && options.purgePersistenceWithDataLoss)];\r\n case 3:\r\n _a.sent();\r\n // `removeChangeListener` must be called after shutting down the\r\n // RemoteStore as it will prevent the RemoteStore from retrieving\r\n // auth tokens.\r\n this.credentials.removeChangeListener();\r\n return [2 /*return*/];\r\n }\r\n });\r\n }); });\r\n };\r\n FirestoreClient.prototype.listen = function (query, observer, options) {\r\n var _this = this;\r\n var listener = new QueryListener(query, observer, options);\r\n this.asyncQueue.enqueueAndForget(function () {\r\n return _this.eventMgr.listen(listener);\r\n });\r\n return listener;\r\n };\r\n FirestoreClient.prototype.unlisten = function (listener) {\r\n var _this = this;\r\n this.asyncQueue.enqueueAndForget(function () {\r\n return _this.eventMgr.unlisten(listener);\r\n });\r\n };\r\n FirestoreClient.prototype.getDocumentFromLocalCache = function (docKey) {\r\n var _this = this;\r\n return this.asyncQueue\r\n .enqueue(function () {\r\n return _this.localStore.readDocument(docKey);\r\n })\r\n .then(function (maybeDoc) {\r\n if (maybeDoc instanceof Document) {\r\n return maybeDoc;\r\n }\r\n else if (maybeDoc instanceof NoDocument) {\r\n return null;\r\n }\r\n else {\r\n throw new FirestoreError(Code.UNAVAILABLE, 'Failed to get document from cache. (However, this document may ' +\r\n \"exist on the server. Run again without setting 'source' in \" +\r\n 'the GetOptions to attempt to retrieve the document from the ' +\r\n 'server.)');\r\n }\r\n });\r\n };\r\n FirestoreClient.prototype.getDocumentsFromLocalCache = function (query) {\r\n var _this = this;\r\n return this.asyncQueue\r\n .enqueue(function () {\r\n return _this.localStore.executeQuery(query);\r\n })\r\n .then(function (docs) {\r\n var remoteKeys = documentKeySet();\r\n var view = new View(query, remoteKeys);\r\n var viewDocChanges = view.computeDocChanges(docs);\r\n return view.applyChanges(viewDocChanges, \r\n /* updateLimboDocuments= */ false).snapshot;\r\n });\r\n };\r\n FirestoreClient.prototype.write = function (mutations) {\r\n var _this = this;\r\n var deferred = new Deferred$1();\r\n this.asyncQueue.enqueueAndForget(function () {\r\n return _this.syncEngine.write(mutations, deferred);\r\n });\r\n return deferred.promise;\r\n };\r\n FirestoreClient.prototype.databaseId = function () {\r\n return this.databaseInfo.databaseId;\r\n };\r\n FirestoreClient.prototype.transaction = function (updateFunction) {\r\n var _this = this;\r\n // We have to wait for the async queue to be sure syncEngine is initialized.\r\n return this.asyncQueue\r\n .enqueue(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {\r\n return [2 /*return*/];\r\n }); }); })\r\n .then(function () { return _this.syncEngine.runTransaction(updateFunction); });\r\n };\r\n return FirestoreClient;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/*\r\n * A wrapper implementation of Observer that will dispatch events\r\n * asynchronously. To allow immediate silencing, a mute call is added which\r\n * causes events scheduled to no longer be raised.\r\n */\r\nvar AsyncObserver = /** @class */ (function () {\r\n function AsyncObserver(observer) {\r\n this.observer = observer;\r\n /**\r\n * When set to true, will not raise future events. Necessary to deal with\r\n * async detachment of listener.\r\n */\r\n this.muted = false;\r\n }\r\n AsyncObserver.prototype.next = function (value) {\r\n this.scheduleEvent(this.observer.next, value);\r\n };\r\n AsyncObserver.prototype.error = function (error) {\r\n this.scheduleEvent(this.observer.error, error);\r\n };\r\n AsyncObserver.prototype.mute = function () {\r\n this.muted = true;\r\n };\r\n AsyncObserver.prototype.scheduleEvent = function (eventHandler, event) {\r\n var _this = this;\r\n if (!this.muted) {\r\n setTimeout(function () {\r\n if (!_this.muted) {\r\n eventHandler(event);\r\n }\r\n }, 0);\r\n }\r\n };\r\n return AsyncObserver;\r\n}());\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// The objects that are a part of this API are exposed to third-parties as\r\n// compiled javascript so we want to flag our private members with a leading\r\n// underscore to discourage their use.\r\n// tslint:disable:strip-private-property-underscore\r\n/**\r\n * A FieldPath refers to a field in a document. The path may consist of a single\r\n * field name (referring to a top-level field in the document), or a list of\r\n * field names (referring to a nested field in the document).\r\n */\r\nvar FieldPath$1 = /** @class */ (function () {\r\n /**\r\n * Creates a FieldPath from the provided field names. If more than one field\r\n * name is provided, the path will point to a nested field in a document.\r\n *\r\n * @param fieldNames A list of field names.\r\n */\r\n function FieldPath$$1() {\r\n var fieldNames = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n fieldNames[_i] = arguments[_i];\r\n }\r\n validateNamedArrayAtLeastNumberOfElements('FieldPath', fieldNames, 'fieldNames', 1);\r\n for (var i = 0; i < fieldNames.length; ++i) {\r\n validateArgType('FieldPath', 'string', i, fieldNames[i]);\r\n if (fieldNames[i].length === 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). \" +\r\n 'Field names must not be empty.');\r\n }\r\n }\r\n this._internalPath = new FieldPath(fieldNames);\r\n }\r\n FieldPath$$1.documentId = function () {\r\n return FieldPath$$1._DOCUMENT_ID;\r\n };\r\n FieldPath$$1.prototype.isEqual = function (other) {\r\n if (!(other instanceof FieldPath$$1)) {\r\n throw invalidClassError('isEqual', 'FieldPath', 1, other);\r\n }\r\n return this._internalPath.isEqual(other._internalPath);\r\n };\r\n /**\r\n * Internal Note: The backend doesn't technically support querying by\r\n * document ID. Instead it queries by the entire document name (full path\r\n * included), but in the cases we currently support documentId(), the net\r\n * effect is the same.\r\n */\r\n FieldPath$$1._DOCUMENT_ID = new FieldPath$$1(FieldPath.keyField().canonicalString());\r\n return FieldPath$$1;\r\n}());\r\n/**\r\n * Matches any characters in a field path string that are reserved.\r\n */\r\nvar RESERVED = new RegExp('[~\\\\*/\\\\[\\\\]]');\r\n/**\r\n * Parses a field path string into a FieldPath, treating dots as separators.\r\n */\r\nfunction fromDotSeparatedString(path) {\r\n var found = path.search(RESERVED);\r\n if (found >= 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not contain \" +\r\n \"'~', '*', '/', '[', or ']'\");\r\n }\r\n try {\r\n return new (FieldPath$1.bind.apply(FieldPath$1, [void 0].concat(path.split('.'))))();\r\n }\r\n catch (e) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not be empty, \" +\r\n \"begin with '.', end with '.', or contain '..'\");\r\n }\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar OAuthToken = /** @class */ (function () {\r\n function OAuthToken(value, user) {\r\n this.user = user;\r\n this.type = 'OAuth';\r\n this.authHeaders = { Authorization: \"Bearer \" + value };\r\n }\r\n return OAuthToken;\r\n}());\r\n/** A CredentialsProvider that always yields an empty token. */\r\nvar EmptyCredentialsProvider = /** @class */ (function () {\r\n function EmptyCredentialsProvider() {\r\n /**\r\n * Stores the listener registered with setChangeListener()\r\n * This isn't actually necessary since the UID never changes, but we use this\r\n * to verify the listen contract is adhered to in tests.\r\n */\r\n this.changeListener = null;\r\n }\r\n EmptyCredentialsProvider.prototype.getToken = function () {\r\n return Promise.resolve(null);\r\n };\r\n EmptyCredentialsProvider.prototype.invalidateToken = function () { };\r\n EmptyCredentialsProvider.prototype.setChangeListener = function (changeListener) {\r\n assert(!this.changeListener, 'Can only call setChangeListener() once.');\r\n this.changeListener = changeListener;\r\n // Fire with initial user.\r\n changeListener(User.UNAUTHENTICATED);\r\n };\r\n EmptyCredentialsProvider.prototype.removeChangeListener = function () {\r\n assert(this.changeListener !== null, 'removeChangeListener() when no listener registered');\r\n this.changeListener = null;\r\n };\r\n return EmptyCredentialsProvider;\r\n}());\r\nvar FirebaseCredentialsProvider = /** @class */ (function () {\r\n function FirebaseCredentialsProvider(app) {\r\n var _this = this;\r\n this.app = app;\r\n /**\r\n * The auth token listener registered with FirebaseApp, retained here so we\r\n * can unregister it.\r\n */\r\n this.tokenListener = null;\r\n /**\r\n * Counter used to detect if the token changed while a getToken request was\r\n * outstanding.\r\n */\r\n this.tokenCounter = 0;\r\n /** The listener registered with setChangeListener(). */\r\n this.changeListener = null;\r\n this.forceRefresh = false;\r\n this.tokenListener = function () {\r\n _this.tokenCounter++;\r\n _this.currentUser = _this.getUser();\r\n if (_this.changeListener) {\r\n _this.changeListener(_this.currentUser);\r\n }\r\n };\r\n this.tokenCounter = 0;\r\n // Will fire at least once where we set this.currentUser\r\n this.app.INTERNAL.addAuthTokenListener(this.tokenListener);\r\n }\r\n FirebaseCredentialsProvider.prototype.getToken = function () {\r\n var _this = this;\r\n assert(this.tokenListener != null, 'getToken cannot be called after listener removed.');\r\n // Take note of the current value of the tokenCounter so that this method\r\n // can fail (with an ABORTED error) if there is a token change while the\r\n // request is outstanding.\r\n var initialTokenCounter = this.tokenCounter;\r\n var forceRefresh = this.forceRefresh;\r\n this.forceRefresh = false;\r\n return this.app.INTERNAL.getToken(forceRefresh).then(function (tokenData) {\r\n // Cancel the request since the token changed while the request was\r\n // outstanding so the response is potentially for a previous user (which\r\n // user, we can't be sure).\r\n if (_this.tokenCounter !== initialTokenCounter) {\r\n throw new FirestoreError(Code.ABORTED, 'getToken aborted due to token change.');\r\n }\r\n else {\r\n if (tokenData) {\r\n assert(typeof tokenData.accessToken === 'string', 'Invalid tokenData returned from getToken():' + tokenData);\r\n return new OAuthToken(tokenData.accessToken, _this.currentUser);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n });\r\n };\r\n FirebaseCredentialsProvider.prototype.invalidateToken = function () {\r\n this.forceRefresh = true;\r\n };\r\n FirebaseCredentialsProvider.prototype.setChangeListener = function (changeListener) {\r\n assert(!this.changeListener, 'Can only call setChangeListener() once.');\r\n this.changeListener = changeListener;\r\n // Fire the initial event, but only if we received the initial user\r\n if (this.currentUser) {\r\n changeListener(this.currentUser);\r\n }\r\n };\r\n FirebaseCredentialsProvider.prototype.removeChangeListener = function () {\r\n assert(this.tokenListener != null, 'removeChangeListener() called twice');\r\n assert(this.changeListener !== null, 'removeChangeListener() called when no listener registered');\r\n this.app.INTERNAL.removeAuthTokenListener(this.tokenListener);\r\n this.tokenListener = null;\r\n this.changeListener = null;\r\n };\r\n FirebaseCredentialsProvider.prototype.getUser = function () {\r\n var currentUid = this.app.INTERNAL.getUid();\r\n assert(currentUid === null || typeof currentUid === 'string', 'Received invalid UID: ' + currentUid);\r\n return new User(currentUid);\r\n };\r\n return FirebaseCredentialsProvider;\r\n}());\r\n/*\r\n * FirstPartyToken provides a fresh token each time its value\r\n * is requested, because if the token is too old, requests will be rejected.\r\n * TODO(b/33147818) this implementation violates the current assumption that\r\n * tokens are immutable. We need to either revisit this assumption or come\r\n * up with some way for FPA to use the listen/unlisten interface.\r\n */\r\nvar FirstPartyToken = /** @class */ (function () {\r\n function FirstPartyToken(gapi, sessionIndex) {\r\n this.gapi = gapi;\r\n this.sessionIndex = sessionIndex;\r\n this.type = 'FirstParty';\r\n this.user = User.FIRST_PARTY;\r\n assert(this.gapi &&\r\n this.gapi['auth'] &&\r\n this.gapi['auth']['getAuthHeaderValueForFirstParty'], 'unexpected gapi interface');\r\n }\r\n Object.defineProperty(FirstPartyToken.prototype, \"authHeaders\", {\r\n get: function () {\r\n return {\r\n Authorization: this.gapi['auth']['getAuthHeaderValueForFirstParty']([]),\r\n 'X-Goog-AuthUser': this.sessionIndex\r\n };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return FirstPartyToken;\r\n}());\r\n/*\r\n * Provides user credentials required for the Firestore JavaScript SDK\r\n * to authenticate the user, using technique that is only available\r\n * to applications hosted by Google.\r\n */\r\nvar FirstPartyCredentialsProvider = /** @class */ (function () {\r\n function FirstPartyCredentialsProvider(gapi, sessionIndex) {\r\n this.gapi = gapi;\r\n this.sessionIndex = sessionIndex;\r\n assert(this.gapi &&\r\n this.gapi['auth'] &&\r\n this.gapi['auth']['getAuthHeaderValueForFirstParty'], 'unexpected gapi interface');\r\n }\r\n FirstPartyCredentialsProvider.prototype.getToken = function () {\r\n return Promise.resolve(new FirstPartyToken(this.gapi, this.sessionIndex));\r\n };\r\n // TODO(33108925): can someone switch users w/o a page refresh?\r\n // TODO(33110621): need to understand token/session lifecycle\r\n FirstPartyCredentialsProvider.prototype.setChangeListener = function (changeListener) {\r\n // Fire with initial uid.\r\n changeListener(User.FIRST_PARTY);\r\n };\r\n FirstPartyCredentialsProvider.prototype.removeChangeListener = function () { };\r\n FirstPartyCredentialsProvider.prototype.invalidateToken = function () { };\r\n return FirstPartyCredentialsProvider;\r\n}());\r\n/**\r\n * Builds a CredentialsProvider depending on the type of\r\n * the credentials passed in.\r\n */\r\nfunction makeCredentialsProvider(credentials) {\r\n if (!credentials) {\r\n return new EmptyCredentialsProvider();\r\n }\r\n switch (credentials.type) {\r\n case 'gapi':\r\n return new FirstPartyCredentialsProvider(credentials.client, credentials.sessionIndex || '0');\r\n case 'provider':\r\n return credentials.client;\r\n default:\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'makeCredentialsProvider failed due to invalid credential type');\r\n }\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction isPartialObserver(obj) {\r\n return implementsAnyMethods$1(obj, ['next', 'error', 'complete']);\r\n}\r\n/**\r\n * Returns true if obj is an object and contains at least one of the specified\r\n * methods.\r\n */\r\nfunction implementsAnyMethods$1(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n var object = obj;\r\n for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) {\r\n var method = methods_1[_i];\r\n if (method in object && typeof object[method] === 'function') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An opaque base class for FieldValue sentinel objects in our public API,\r\n * with public static methods for creating said sentinel objects.\r\n */\r\n// tslint:disable-next-line:class-as-namespace We use this as a base class.\r\nvar FieldValueImpl = /** @class */ (function () {\r\n function FieldValueImpl(_methodName) {\r\n this._methodName = _methodName;\r\n }\r\n FieldValueImpl.delete = function () {\r\n return DeleteFieldValueImpl.instance;\r\n };\r\n FieldValueImpl.serverTimestamp = function () {\r\n return ServerTimestampFieldValueImpl.instance;\r\n };\r\n FieldValueImpl.arrayUnion = function () {\r\n var elements = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n elements[_i] = arguments[_i];\r\n }\r\n validateAtLeastNumberOfArgs('FieldValue.arrayUnion', arguments, 1);\r\n // NOTE: We don't actually parse the data until it's used in set() or\r\n // update() since we need access to the Firestore instance.\r\n return new ArrayUnionFieldValueImpl(elements);\r\n };\r\n FieldValueImpl.arrayRemove = function () {\r\n var elements = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n elements[_i] = arguments[_i];\r\n }\r\n validateAtLeastNumberOfArgs('FieldValue.arrayRemove', arguments, 1);\r\n // NOTE: We don't actually parse the data until it's used in set() or\r\n // update() since we need access to the Firestore instance.\r\n return new ArrayRemoveFieldValueImpl(elements);\r\n };\r\n FieldValueImpl.prototype.isEqual = function (other) {\r\n return this === other;\r\n };\r\n return FieldValueImpl;\r\n}());\r\nvar DeleteFieldValueImpl = /** @class */ (function (_super) {\r\n tslib_1.__extends(DeleteFieldValueImpl, _super);\r\n function DeleteFieldValueImpl() {\r\n return _super.call(this, 'FieldValue.delete') || this;\r\n }\r\n /** Singleton instance. */\r\n DeleteFieldValueImpl.instance = new DeleteFieldValueImpl();\r\n return DeleteFieldValueImpl;\r\n}(FieldValueImpl));\r\nvar ServerTimestampFieldValueImpl = /** @class */ (function (_super) {\r\n tslib_1.__extends(ServerTimestampFieldValueImpl, _super);\r\n function ServerTimestampFieldValueImpl() {\r\n return _super.call(this, 'FieldValue.serverTimestamp') || this;\r\n }\r\n /** Singleton instance. */\r\n ServerTimestampFieldValueImpl.instance = new ServerTimestampFieldValueImpl();\r\n return ServerTimestampFieldValueImpl;\r\n}(FieldValueImpl));\r\nvar ArrayUnionFieldValueImpl = /** @class */ (function (_super) {\r\n tslib_1.__extends(ArrayUnionFieldValueImpl, _super);\r\n function ArrayUnionFieldValueImpl(_elements) {\r\n var _this = _super.call(this, 'FieldValue.arrayUnion') || this;\r\n _this._elements = _elements;\r\n return _this;\r\n }\r\n return ArrayUnionFieldValueImpl;\r\n}(FieldValueImpl));\r\nvar ArrayRemoveFieldValueImpl = /** @class */ (function (_super) {\r\n tslib_1.__extends(ArrayRemoveFieldValueImpl, _super);\r\n function ArrayRemoveFieldValueImpl(_elements) {\r\n var _this = _super.call(this, 'FieldValue.arrayRemove') || this;\r\n _this._elements = _elements;\r\n return _this;\r\n }\r\n return ArrayRemoveFieldValueImpl;\r\n}(FieldValueImpl));\r\n// Public instance that disallows construction at runtime. This constructor is\r\n// used when exporting FieldValueImpl on firebase.firestore.FieldValue and will\r\n// be called FieldValue publicly. Internally we still use FieldValueImpl which\r\n// has a type-checked private constructor. Note that FieldValueImpl and\r\n// PublicFieldValue can be used interchangeably in instanceof checks.\r\n// For our internal TypeScript code PublicFieldValue doesn't exist as a type,\r\n// and so we need to use FieldValueImpl as type and export it too.\r\n// tslint:disable-next-line:variable-name We treat this as a class name.\r\nvar PublicFieldValue = makeConstructorPrivate(FieldValueImpl, 'Use FieldValue.() instead.');\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar RESERVED_FIELD_REGEX = /^__.*__$/;\r\n/** The result of parsing document data (e.g. for a setData call). */\r\nvar ParsedSetData = /** @class */ (function () {\r\n function ParsedSetData(data, fieldMask, fieldTransforms) {\r\n this.data = data;\r\n this.fieldMask = fieldMask;\r\n this.fieldTransforms = fieldTransforms;\r\n }\r\n ParsedSetData.prototype.toMutations = function (key, precondition) {\r\n var mutations = [];\r\n if (this.fieldMask !== null) {\r\n mutations.push(new PatchMutation(key, this.data, this.fieldMask, precondition));\r\n }\r\n else {\r\n mutations.push(new SetMutation(key, this.data, precondition));\r\n }\r\n if (this.fieldTransforms.length > 0) {\r\n mutations.push(new TransformMutation(key, this.fieldTransforms));\r\n }\r\n return mutations;\r\n };\r\n return ParsedSetData;\r\n}());\r\n/** The result of parsing \"update\" data (i.e. for an updateData call). */\r\nvar ParsedUpdateData = /** @class */ (function () {\r\n function ParsedUpdateData(data, fieldMask, fieldTransforms) {\r\n this.data = data;\r\n this.fieldMask = fieldMask;\r\n this.fieldTransforms = fieldTransforms;\r\n }\r\n ParsedUpdateData.prototype.toMutations = function (key, precondition) {\r\n var mutations = [\r\n new PatchMutation(key, this.data, this.fieldMask, precondition)\r\n ];\r\n if (this.fieldTransforms.length > 0) {\r\n mutations.push(new TransformMutation(key, this.fieldTransforms));\r\n }\r\n return mutations;\r\n };\r\n return ParsedUpdateData;\r\n}());\r\n/*\r\n * Represents what type of API method provided the data being parsed; useful\r\n * for determining which error conditions apply during parsing and providing\r\n * better error messages.\r\n */\r\nvar UserDataSource;\r\n(function (UserDataSource) {\r\n UserDataSource[UserDataSource[\"Set\"] = 0] = \"Set\";\r\n UserDataSource[UserDataSource[\"Update\"] = 1] = \"Update\";\r\n UserDataSource[UserDataSource[\"MergeSet\"] = 2] = \"MergeSet\";\r\n /**\r\n * Indicates the source is a where clause, cursor bound, arrayUnion()\r\n * element, etc. Of note, isWrite(source) will return false.\r\n */\r\n UserDataSource[UserDataSource[\"Argument\"] = 3] = \"Argument\";\r\n})(UserDataSource || (UserDataSource = {}));\r\nfunction isWrite(dataSource) {\r\n switch (dataSource) {\r\n case UserDataSource.Set: // fall through\r\n case UserDataSource.MergeSet: // fall through\r\n case UserDataSource.Update:\r\n return true;\r\n case UserDataSource.Argument:\r\n return false;\r\n default:\r\n throw fail(\"Unexpected case for UserDataSource: \" + dataSource);\r\n }\r\n}\r\n/** A \"context\" object passed around while parsing user data. */\r\nvar ParseContext = /** @class */ (function () {\r\n /**\r\n * Initializes a ParseContext with the given source and path.\r\n *\r\n * @param dataSource Indicates what kind of API method this data came from.\r\n * @param methodName The name of the method the user called to create this\r\n * ParseContext.\r\n * @param path A path within the object being parsed. This could be an empty\r\n * path (in which case the context represents the root of the data being\r\n * parsed), or a nonempty path (indicating the context represents a nested\r\n * location within the data).\r\n * @param arrayElement Whether or not this context corresponds to an element\r\n * of an array.\r\n * @param fieldTransforms A mutable list of field transforms encountered while\r\n * parsing the data.\r\n * @param fieldMask A mutable list of field paths encountered while parsing\r\n * the data.\r\n *\r\n * TODO(b/34871131): We don't support array paths right now, so path can be\r\n * null to indicate the context represents any location within an array (in\r\n * which case certain features will not work and errors will be somewhat\r\n * compromised).\r\n */\r\n function ParseContext(dataSource, methodName, path, arrayElement, fieldTransforms, fieldMask) {\r\n this.dataSource = dataSource;\r\n this.methodName = methodName;\r\n this.path = path;\r\n this.arrayElement = arrayElement;\r\n // Minor hack: If fieldTransforms is undefined, we assume this is an\r\n // external call and we need to validate the entire path.\r\n if (fieldTransforms === undefined) {\r\n this.validatePath();\r\n }\r\n this.arrayElement = arrayElement !== undefined ? arrayElement : false;\r\n this.fieldTransforms = fieldTransforms || [];\r\n this.fieldMask = fieldMask || [];\r\n }\r\n ParseContext.prototype.childContextForField = function (field) {\r\n var childPath = this.path == null ? null : this.path.child(field);\r\n var context = new ParseContext(this.dataSource, this.methodName, childPath, \r\n /*arrayElement=*/ false, this.fieldTransforms, this.fieldMask);\r\n context.validatePathSegment(field);\r\n return context;\r\n };\r\n ParseContext.prototype.childContextForFieldPath = function (field) {\r\n var childPath = this.path == null ? null : this.path.child(field);\r\n var context = new ParseContext(this.dataSource, this.methodName, childPath, \r\n /*arrayElement=*/ false, this.fieldTransforms, this.fieldMask);\r\n context.validatePath();\r\n return context;\r\n };\r\n ParseContext.prototype.childContextForArray = function (index) {\r\n // TODO(b/34871131): We don't support array paths right now; so make path\r\n // null.\r\n return new ParseContext(this.dataSource, this.methodName, \r\n /*path=*/ null, \r\n /*arrayElement=*/ true, this.fieldTransforms, this.fieldMask);\r\n };\r\n ParseContext.prototype.createError = function (reason) {\r\n var fieldDescription = this.path === null || this.path.isEmpty()\r\n ? ''\r\n : \" (found in field \" + this.path.toString() + \")\";\r\n return new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + this.methodName + \"() called with invalid data. \" +\r\n reason +\r\n fieldDescription);\r\n };\r\n /** Returns 'true' if 'fieldPath' was traversed when creating this context. */\r\n ParseContext.prototype.contains = function (fieldPath) {\r\n return (this.fieldMask.find(function (field) { return fieldPath.isPrefixOf(field); }) !== undefined ||\r\n this.fieldTransforms.find(function (transform) {\r\n return fieldPath.isPrefixOf(transform.field);\r\n }) !== undefined);\r\n };\r\n ParseContext.prototype.validatePath = function () {\r\n // TODO(b/34871131): Remove null check once we have proper paths for fields\r\n // within arrays.\r\n if (this.path === null) {\r\n return;\r\n }\r\n for (var i = 0; i < this.path.length; i++) {\r\n this.validatePathSegment(this.path.get(i));\r\n }\r\n };\r\n ParseContext.prototype.validatePathSegment = function (segment) {\r\n if (isWrite(this.dataSource) && RESERVED_FIELD_REGEX.test(segment)) {\r\n throw this.createError('Document fields cannot begin and end with __');\r\n }\r\n };\r\n return ParseContext;\r\n}());\r\n/**\r\n * A placeholder object for DocumentReferences in this file, in order to\r\n * avoid a circular dependency. See the comments for `DataPreConverter` for\r\n * the full context.\r\n */\r\nvar DocumentKeyReference = /** @class */ (function () {\r\n function DocumentKeyReference(databaseId, key) {\r\n this.databaseId = databaseId;\r\n this.key = key;\r\n }\r\n return DocumentKeyReference;\r\n}());\r\n/**\r\n * Helper for parsing raw user input (provided via the API) into internal model\r\n * classes.\r\n */\r\nvar UserDataConverter = /** @class */ (function () {\r\n function UserDataConverter(preConverter) {\r\n this.preConverter = preConverter;\r\n }\r\n /** Parse document data from a non-merge set() call. */\r\n UserDataConverter.prototype.parseSetData = function (methodName, input) {\r\n var context = new ParseContext(UserDataSource.Set, methodName, FieldPath.EMPTY_PATH);\r\n validatePlainObject('Data must be an object, but it was:', context, input);\r\n var updateData = this.parseData(input, context);\r\n return new ParsedSetData(updateData, \r\n /* fieldMask= */ null, context.fieldTransforms);\r\n };\r\n /** Parse document data from a set() call with '{merge:true}'. */\r\n UserDataConverter.prototype.parseMergeData = function (methodName, input, fieldPaths) {\r\n var context = new ParseContext(UserDataSource.MergeSet, methodName, FieldPath.EMPTY_PATH);\r\n validatePlainObject('Data must be an object, but it was:', context, input);\r\n var updateData = this.parseData(input, context);\r\n var fieldMask;\r\n var fieldTransforms;\r\n if (!fieldPaths) {\r\n fieldMask = new FieldMask(context.fieldMask);\r\n fieldTransforms = context.fieldTransforms;\r\n }\r\n else {\r\n var validatedFieldPaths = [];\r\n for (var _i = 0, fieldPaths_1 = fieldPaths; _i < fieldPaths_1.length; _i++) {\r\n var stringOrFieldPath = fieldPaths_1[_i];\r\n var fieldPath = void 0;\r\n if (stringOrFieldPath instanceof FieldPath$1) {\r\n fieldPath = stringOrFieldPath._internalPath;\r\n }\r\n else if (typeof stringOrFieldPath === 'string') {\r\n fieldPath = fieldPathFromDotSeparatedString(methodName, stringOrFieldPath);\r\n }\r\n else {\r\n throw fail('Expected stringOrFieldPath to be a string or a FieldPath');\r\n }\r\n if (!context.contains(fieldPath)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Field '\" + fieldPath + \"' is specified in your field mask but missing from your input data.\");\r\n }\r\n validatedFieldPaths.push(fieldPath);\r\n }\r\n fieldMask = new FieldMask(validatedFieldPaths);\r\n fieldTransforms = context.fieldTransforms.filter(function (transform) {\r\n return fieldMask.covers(transform.field);\r\n });\r\n }\r\n return new ParsedSetData(updateData, fieldMask, fieldTransforms);\r\n };\r\n /** Parse update data from an update() call. */\r\n UserDataConverter.prototype.parseUpdateData = function (methodName, input) {\r\n var _this = this;\r\n var context = new ParseContext(UserDataSource.Update, methodName, FieldPath.EMPTY_PATH);\r\n validatePlainObject('Data must be an object, but it was:', context, input);\r\n var fieldMaskPaths = [];\r\n var updateData = ObjectValue.EMPTY;\r\n forEach(input, function (key, value) {\r\n var path = fieldPathFromDotSeparatedString(methodName, key);\r\n var childContext = context.childContextForFieldPath(path);\r\n value = _this.runPreConverter(value, childContext);\r\n if (value instanceof DeleteFieldValueImpl) {\r\n // Add it to the field mask, but don't add anything to updateData.\r\n fieldMaskPaths.push(path);\r\n }\r\n else {\r\n var parsedValue = _this.parseData(value, childContext);\r\n if (parsedValue != null) {\r\n fieldMaskPaths.push(path);\r\n updateData = updateData.set(path, parsedValue);\r\n }\r\n }\r\n });\r\n var mask = new FieldMask(fieldMaskPaths);\r\n return new ParsedUpdateData(updateData, mask, context.fieldTransforms);\r\n };\r\n /** Parse update data from a list of field/value arguments. */\r\n UserDataConverter.prototype.parseUpdateVarargs = function (methodName, field, value, moreFieldsAndValues) {\r\n var context = new ParseContext(UserDataSource.Update, methodName, FieldPath.EMPTY_PATH);\r\n var keys = [fieldPathFromArgument(methodName, field)];\r\n var values$$1 = [value];\r\n if (moreFieldsAndValues.length % 2 !== 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() needs to be called with an even number \" +\r\n 'of arguments that alternate between field names and values.');\r\n }\r\n for (var i = 0; i < moreFieldsAndValues.length; i += 2) {\r\n keys.push(fieldPathFromArgument(methodName, moreFieldsAndValues[i]));\r\n values$$1.push(moreFieldsAndValues[i + 1]);\r\n }\r\n var fieldMaskPaths = [];\r\n var updateData = ObjectValue.EMPTY;\r\n for (var i = 0; i < keys.length; ++i) {\r\n var path = keys[i];\r\n var childContext = context.childContextForFieldPath(path);\r\n var value_1 = this.runPreConverter(values$$1[i], childContext);\r\n if (value_1 instanceof DeleteFieldValueImpl) {\r\n // Add it to the field mask, but don't add anything to updateData.\r\n fieldMaskPaths.push(path);\r\n }\r\n else {\r\n var parsedValue = this.parseData(value_1, childContext);\r\n if (parsedValue != null) {\r\n fieldMaskPaths.push(path);\r\n updateData = updateData.set(path, parsedValue);\r\n }\r\n }\r\n }\r\n var mask = new FieldMask(fieldMaskPaths);\r\n return new ParsedUpdateData(updateData, mask, context.fieldTransforms);\r\n };\r\n /**\r\n * Parse a \"query value\" (e.g. value in a where filter or a value in a cursor\r\n * bound).\r\n */\r\n UserDataConverter.prototype.parseQueryValue = function (methodName, input) {\r\n var context = new ParseContext(UserDataSource.Argument, methodName, FieldPath.EMPTY_PATH);\r\n var parsed = this.parseData(input, context);\r\n assert(parsed != null, 'Parsed data should not be null.');\r\n assert(context.fieldTransforms.length === 0, 'Field transforms should have been disallowed.');\r\n return parsed;\r\n };\r\n /** Sends data through this.preConverter, handling any thrown errors. */\r\n UserDataConverter.prototype.runPreConverter = function (input, context) {\r\n try {\r\n return this.preConverter(input);\r\n }\r\n catch (e) {\r\n var message = errorMessage(e);\r\n throw context.createError(message);\r\n }\r\n };\r\n /**\r\n * Internal helper for parsing user data.\r\n *\r\n * @param input Data to be parsed.\r\n * @param context A context object representing the current path being parsed,\r\n * the source of the data being parsed, etc.\r\n * @return The parsed value, or null if the value was a FieldValue sentinel\r\n * that should not be included in the resulting parsed data.\r\n */\r\n UserDataConverter.prototype.parseData = function (input, context) {\r\n input = this.runPreConverter(input, context);\r\n if (looksLikeJsonObject(input)) {\r\n validatePlainObject('Unsupported field value:', context, input);\r\n return this.parseObject(input, context);\r\n }\r\n else if (input instanceof FieldValueImpl) {\r\n // FieldValues usually parse into transforms (except FieldValue.delete())\r\n // in which case we do not want to include this field in our parsed data\r\n // (as doing so will overwrite the field directly prior to the transform\r\n // trying to transform it). So we don't add this location to\r\n // context.fieldMask and we return null as our parsing result.\r\n this.parseSentinelFieldValue(input, context);\r\n return null;\r\n }\r\n else {\r\n // If context.path is null we are inside an array and we don't support\r\n // field mask paths more granular than the top-level array.\r\n if (context.path) {\r\n context.fieldMask.push(context.path);\r\n }\r\n if (input instanceof Array) {\r\n // TODO(b/34871131): Include the path containing the array in the error\r\n // message.\r\n if (context.arrayElement) {\r\n throw context.createError('Nested arrays are not supported');\r\n }\r\n return this.parseArray(input, context);\r\n }\r\n else {\r\n return this.parseScalarValue(input, context);\r\n }\r\n }\r\n };\r\n UserDataConverter.prototype.parseObject = function (obj, context) {\r\n var _this = this;\r\n var result = new SortedMap(primitiveComparator);\r\n if (isEmpty(obj)) {\r\n // If we encounter an empty object, we explicitly add it to the update\r\n // mask to ensure that the server creates a map entry.\r\n if (context.path && context.path.length > 0) {\r\n context.fieldMask.push(context.path);\r\n }\r\n }\r\n else {\r\n forEach(obj, function (key, val) {\r\n var parsedValue = _this.parseData(val, context.childContextForField(key));\r\n if (parsedValue != null) {\r\n result = result.insert(key, parsedValue);\r\n }\r\n });\r\n }\r\n return new ObjectValue(result);\r\n };\r\n UserDataConverter.prototype.parseArray = function (array, context) {\r\n var result = [];\r\n var entryIndex = 0;\r\n for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {\r\n var entry = array_1[_i];\r\n var parsedEntry = this.parseData(entry, context.childContextForArray(entryIndex));\r\n if (parsedEntry == null) {\r\n // Just include nulls in the array for fields being replaced with a\r\n // sentinel.\r\n parsedEntry = NullValue.INSTANCE;\r\n }\r\n result.push(parsedEntry);\r\n entryIndex++;\r\n }\r\n return new ArrayValue(result);\r\n };\r\n /**\r\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\r\n * context.fieldTransforms.\r\n */\r\n UserDataConverter.prototype.parseSentinelFieldValue = function (value, context) {\r\n // Sentinels are only supported with writes, and not within arrays.\r\n if (!isWrite(context.dataSource)) {\r\n throw context.createError(value._methodName + \"() can only be used with update() and set()\");\r\n }\r\n if (context.path === null) {\r\n throw context.createError(value._methodName + \"() is not currently supported inside arrays\");\r\n }\r\n if (value instanceof DeleteFieldValueImpl) {\r\n if (context.dataSource === UserDataSource.MergeSet) {\r\n // No transform to add for a delete, but we need to add it to our\r\n // fieldMask so it gets deleted.\r\n context.fieldMask.push(context.path);\r\n }\r\n else if (context.dataSource === UserDataSource.Update) {\r\n assert(context.path.length > 0, 'FieldValue.delete() at the top level should have already' +\r\n ' been handled.');\r\n throw context.createError('FieldValue.delete() can only appear at the top level ' +\r\n 'of your update data');\r\n }\r\n else {\r\n // We shouldn't encounter delete sentinels for queries or non-merge set() calls.\r\n throw context.createError('FieldValue.delete() cannot be used with set() unless you pass ' +\r\n '{merge:true}');\r\n }\r\n }\r\n else if (value instanceof ServerTimestampFieldValueImpl) {\r\n context.fieldTransforms.push(new FieldTransform(context.path, ServerTimestampTransform.instance));\r\n }\r\n else if (value instanceof ArrayUnionFieldValueImpl) {\r\n var parsedElements = this.parseArrayTransformElements(value._methodName, value._elements);\r\n var arrayUnion = new ArrayUnionTransformOperation(parsedElements);\r\n context.fieldTransforms.push(new FieldTransform(context.path, arrayUnion));\r\n }\r\n else if (value instanceof ArrayRemoveFieldValueImpl) {\r\n var parsedElements = this.parseArrayTransformElements(value._methodName, value._elements);\r\n var arrayRemove = new ArrayRemoveTransformOperation(parsedElements);\r\n context.fieldTransforms.push(new FieldTransform(context.path, arrayRemove));\r\n }\r\n else {\r\n fail('Unknown FieldValue type: ' + value);\r\n }\r\n };\r\n /**\r\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\r\n *\r\n * @return The parsed value\r\n */\r\n UserDataConverter.prototype.parseScalarValue = function (value, context) {\r\n if (value === null) {\r\n return NullValue.INSTANCE;\r\n }\r\n else if (typeof value === 'number') {\r\n if (isSafeInteger(value)) {\r\n return new IntegerValue(value);\r\n }\r\n else {\r\n return new DoubleValue(value);\r\n }\r\n }\r\n else if (typeof value === 'boolean') {\r\n return BooleanValue.of(value);\r\n }\r\n else if (typeof value === 'string') {\r\n return new StringValue(value);\r\n }\r\n else if (value instanceof Date) {\r\n return new TimestampValue(Timestamp.fromDate(value));\r\n }\r\n else if (value instanceof Timestamp) {\r\n // Firestore backend truncates precision down to microseconds. To ensure\r\n // offline mode works the same with regards to truncation, perform the\r\n // truncation immediately without waiting for the backend to do that.\r\n return new TimestampValue(new Timestamp(value.seconds, Math.floor(value.nanoseconds / 1000) * 1000));\r\n }\r\n else if (value instanceof GeoPoint) {\r\n return new GeoPointValue(value);\r\n }\r\n else if (value instanceof Blob) {\r\n return new BlobValue(value);\r\n }\r\n else if (value instanceof DocumentKeyReference) {\r\n return new RefValue(value.databaseId, value.key);\r\n }\r\n else {\r\n throw context.createError(\"Unsupported field value: \" + valueDescription(value));\r\n }\r\n };\r\n UserDataConverter.prototype.parseArrayTransformElements = function (methodName, elements) {\r\n var _this = this;\r\n return elements.map(function (element, i) {\r\n // Although array transforms are used with writes, the actual elements\r\n // being unioned or removed are not considered writes since they cannot\r\n // contain any FieldValue sentinels, etc.\r\n var context = new ParseContext(UserDataSource.Argument, methodName, FieldPath.EMPTY_PATH);\r\n return _this.parseData(element, context.childContextForArray(i));\r\n });\r\n };\r\n return UserDataConverter;\r\n}());\r\n/**\r\n * Checks whether an object looks like a JSON object that should be converted\r\n * into a struct. Normal class/prototype instances are considered to look like\r\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\r\n * GeoPoints, etc. are not considered to look like JSON objects since they map\r\n * to specific FieldValue types other than ObjectValue.\r\n */\r\nfunction looksLikeJsonObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n !(input instanceof Array) &&\r\n !(input instanceof Date) &&\r\n !(input instanceof Timestamp) &&\r\n !(input instanceof GeoPoint) &&\r\n !(input instanceof Blob) &&\r\n !(input instanceof DocumentKeyReference) &&\r\n !(input instanceof FieldValueImpl));\r\n}\r\nfunction validatePlainObject(message, context, input) {\r\n if (!looksLikeJsonObject(input) || !isPlainObject(input)) {\r\n var description = valueDescription(input);\r\n if (description === 'an object') {\r\n // Massage the error if it was an object.\r\n throw context.createError(message + ' a custom object');\r\n }\r\n else {\r\n throw context.createError(message + ' ' + description);\r\n }\r\n }\r\n}\r\n/**\r\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\r\n */\r\nfunction fieldPathFromArgument(methodName, path) {\r\n if (path instanceof FieldPath$1) {\r\n return path._internalPath;\r\n }\r\n else if (typeof path === 'string') {\r\n return fieldPathFromDotSeparatedString(methodName, path);\r\n }\r\n else {\r\n var message = 'Field path arguments must be of type string or FieldPath.';\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\r\n }\r\n}\r\n/**\r\n * Wraps fromDotSeparatedString with an error message about the method that\r\n * was thrown.\r\n * @param methodName The publicly visible method name\r\n * @param path The dot-separated string form of a field path which will be split\r\n * on dots.\r\n */\r\nfunction fieldPathFromDotSeparatedString(methodName, path) {\r\n try {\r\n return fromDotSeparatedString(path)._internalPath;\r\n }\r\n catch (e) {\r\n var message = errorMessage(e);\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\r\n }\r\n}\r\n/**\r\n * Extracts the message from a caught exception, which should be an Error object\r\n * though JS doesn't guarantee that.\r\n */\r\nfunction errorMessage(error) {\r\n return error instanceof Error ? error.message : error.toString();\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// The objects that are a part of this API are exposed to third-parties as\r\n// compiled javascript so we want to flag our private members with a leading\r\n// underscore to discourage their use.\r\n// tslint:disable:strip-private-property-underscore\r\n// settings() defaults:\r\nvar DEFAULT_HOST = 'firestore.googleapis.com';\r\nvar DEFAULT_SSL = true;\r\nvar DEFAULT_TIMESTAMPS_IN_SNAPSHOTS = false;\r\n// enablePersistence() defaults:\r\nvar DEFAULT_SYNCHRONIZE_TABS = false;\r\n/**\r\n * A concrete type describing all the values that can be applied via a\r\n * user-supplied firestore.Settings object. This is a separate type so that\r\n * defaults can be supplied and the value can be checked for equality.\r\n */\r\nvar FirestoreSettings = /** @class */ (function () {\r\n function FirestoreSettings(settings) {\r\n if (settings.host === undefined) {\r\n if (settings.ssl !== undefined) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Can't provide ssl option if host option is not set\");\r\n }\r\n this.host = DEFAULT_HOST;\r\n this.ssl = DEFAULT_SSL;\r\n }\r\n else {\r\n validateNamedType('settings', 'non-empty string', 'host', settings.host);\r\n this.host = settings.host;\r\n validateNamedOptionalType('settings', 'boolean', 'ssl', settings.ssl);\r\n this.ssl = defaulted(settings.ssl, DEFAULT_SSL);\r\n }\r\n validateOptionNames('settings', settings, [\r\n 'host',\r\n 'ssl',\r\n 'credentials',\r\n 'timestampsInSnapshots'\r\n ]);\r\n validateNamedOptionalType('settings', 'object', 'credentials', settings.credentials);\r\n this.credentials = settings.credentials;\r\n validateNamedOptionalType('settings', 'boolean', 'timestampsInSnapshots', settings.timestampsInSnapshots);\r\n this.timestampsInSnapshots = defaulted(settings.timestampsInSnapshots, DEFAULT_TIMESTAMPS_IN_SNAPSHOTS);\r\n }\r\n FirestoreSettings.prototype.isEqual = function (other) {\r\n return (this.host === other.host &&\r\n this.ssl === other.ssl &&\r\n this.timestampsInSnapshots === other.timestampsInSnapshots &&\r\n this.credentials === other.credentials);\r\n };\r\n return FirestoreSettings;\r\n}());\r\nvar FirestoreConfig = /** @class */ (function () {\r\n function FirestoreConfig() {\r\n }\r\n return FirestoreConfig;\r\n}());\r\n/**\r\n * Encapsulates the settings that can be used to configure Firestore\r\n * persistence.\r\n */\r\nvar PersistenceSettings = /** @class */ (function () {\r\n function PersistenceSettings(enabled, settings) {\r\n this.enabled = enabled;\r\n assert(enabled || !settings, 'Can only provide PersistenceSettings with persistence enabled');\r\n settings = settings || {};\r\n this.experimentalTabSynchronization = defaulted(settings.experimentalTabSynchronization, DEFAULT_SYNCHRONIZE_TABS);\r\n }\r\n PersistenceSettings.prototype.isEqual = function (other) {\r\n return (this.enabled === other.enabled &&\r\n this.experimentalTabSynchronization ===\r\n other.experimentalTabSynchronization);\r\n };\r\n return PersistenceSettings;\r\n}());\r\n/**\r\n * The root reference to the database.\r\n */\r\nvar Firestore = /** @class */ (function () {\r\n function Firestore(databaseIdOrApp) {\r\n var _this = this;\r\n // Public for use in tests.\r\n // TODO(mikelehen): Use modularized initialization instead.\r\n this._queue = new AsyncQueue();\r\n this.INTERNAL = {\r\n delete: function (options) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n if (this._firestoreClient) {\r\n return [2 /*return*/, this._firestoreClient.shutdown(options)];\r\n }\r\n return [2 /*return*/];\r\n });\r\n }); }\r\n };\r\n var config = new FirestoreConfig();\r\n if (typeof databaseIdOrApp.options === 'object') {\r\n // This is very likely a Firebase app object\r\n // TODO(b/34177605): Can we somehow use instanceof?\r\n var app = databaseIdOrApp;\r\n config.firebaseApp = app;\r\n config.databaseId = Firestore.databaseIdFromApp(app);\r\n config.persistenceKey = config.firebaseApp.name;\r\n config.credentials = new FirebaseCredentialsProvider(app);\r\n }\r\n else {\r\n var external_1 = databaseIdOrApp;\r\n if (!external_1.projectId) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Must provide projectId');\r\n }\r\n config.databaseId = new DatabaseId(external_1.projectId, external_1.database);\r\n // Use a default persistenceKey that lines up with FirebaseApp.\r\n config.persistenceKey = '[DEFAULT]';\r\n config.credentials = new EmptyCredentialsProvider();\r\n }\r\n config.settings = new FirestoreSettings({});\r\n this._config = config;\r\n this._databaseId = config.databaseId;\r\n }\r\n Firestore.prototype.settings = function (settingsLiteral) {\r\n validateExactNumberOfArgs('Firestore.settings', arguments, 1);\r\n validateArgType('Firestore.settings', 'object', 1, settingsLiteral);\r\n if (contains(settingsLiteral, 'persistence')) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, '\"persistence\" is now specified with a separate call to ' +\r\n 'firestore.enablePersistence().');\r\n }\r\n var newSettings = new FirestoreSettings(settingsLiteral);\r\n if (this._firestoreClient && !this._config.settings.isEqual(newSettings)) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'Firestore has already been started and its settings can no longer ' +\r\n 'be changed. You can only call settings() before calling any other ' +\r\n 'methods on a Firestore object.');\r\n }\r\n this._config.settings = newSettings;\r\n if (newSettings.credentials !== undefined) {\r\n this._config.credentials = makeCredentialsProvider(newSettings.credentials);\r\n }\r\n };\r\n Firestore.prototype.enableNetwork = function () {\r\n this.ensureClientConfigured();\r\n return this._firestoreClient.enableNetwork();\r\n };\r\n Firestore.prototype.disableNetwork = function () {\r\n this.ensureClientConfigured();\r\n return this._firestoreClient.disableNetwork();\r\n };\r\n Firestore.prototype.enablePersistence = function (settings) {\r\n if (this._firestoreClient) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'Firestore has already been started and persistence can no longer ' +\r\n 'be enabled. You can only call enablePersistence() before calling ' +\r\n 'any other methods on a Firestore object.');\r\n }\r\n return this.configureClient(new PersistenceSettings(/* enabled= */ true, settings));\r\n };\r\n Firestore.prototype.ensureClientConfigured = function () {\r\n if (!this._firestoreClient) {\r\n // Kick off starting the client but don't actually wait for it.\r\n // tslint:disable-next-line:no-floating-promises\r\n this.configureClient(new PersistenceSettings(/* enabled= */ false));\r\n }\r\n return this._firestoreClient;\r\n };\r\n Firestore.prototype.configureClient = function (persistenceSettings) {\r\n var _this = this;\r\n assert(!!this._config.settings.host, 'FirestoreSettings.host cannot be falsey');\r\n if (!this._config.settings.timestampsInSnapshots) {\r\n error(\"\\nThe behavior for Date objects stored in Firestore is going to change\\nAND YOUR APP MAY BREAK.\\nTo hide this warning and ensure your app does not break, you need to add the\\nfollowing code to your app before calling any other Cloud Firestore methods:\\n\\n const firestore = firebase.firestore();\\n const settings = {/* your settings... */ timestampsInSnapshots: true};\\n firestore.settings(settings);\\n\\nWith this change, timestamps stored in Cloud Firestore will be read back as\\nFirebase Timestamp objects instead of as system Date objects. So you will also\\nneed to update code expecting a Date to instead expect a Timestamp. For example:\\n\\n // Old:\\n const date = snapshot.get('created_at');\\n // New:\\n const timestamp = snapshot.get('created_at');\\n const date = timestamp.toDate();\\n\\nPlease audit all existing usages of Date when you enable the new behavior. In a\\nfuture release, the behavior will change to the new behavior, so if you do not\\nfollow these steps, YOUR APP MAY BREAK.\");\r\n }\r\n assert(!this._firestoreClient, 'configureClient() called multiple times');\r\n var databaseInfo = new DatabaseInfo(this._config.databaseId, this._config.persistenceKey, this._config.settings.host, this._config.settings.ssl);\r\n var preConverter = function (value) {\r\n if (value instanceof DocumentReference) {\r\n var thisDb = _this._config.databaseId;\r\n var otherDb = value.firestore._config.databaseId;\r\n if (!otherDb.isEqual(thisDb)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Document reference is for database ' +\r\n (otherDb.projectId + \"/\" + otherDb.database + \" but should be \") +\r\n (\"for database \" + thisDb.projectId + \"/\" + thisDb.database));\r\n }\r\n return new DocumentKeyReference(_this._config.databaseId, value._key);\r\n }\r\n else {\r\n return value;\r\n }\r\n };\r\n this._dataConverter = new UserDataConverter(preConverter);\r\n this._firestoreClient = new FirestoreClient(PlatformSupport.getPlatform(), databaseInfo, this._config.credentials, this._queue);\r\n return this._firestoreClient.start(persistenceSettings);\r\n };\r\n Firestore.databaseIdFromApp = function (app) {\r\n var options = app.options;\r\n if (!contains(options, 'projectId')) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, '\"projectId\" not provided in firebase.initializeApp.');\r\n }\r\n var projectId = options['projectId'];\r\n if (!projectId || typeof projectId !== 'string') {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'projectId must be a string in FirebaseApp.options');\r\n }\r\n return new DatabaseId(projectId);\r\n };\r\n Object.defineProperty(Firestore.prototype, \"app\", {\r\n get: function () {\r\n if (!this._config.firebaseApp) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, \"Firestore was not initialized using the Firebase SDK. 'app' is \" +\r\n 'not available');\r\n }\r\n return this._config.firebaseApp;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Firestore.prototype.collection = function (pathString) {\r\n validateExactNumberOfArgs('Firestore.collection', arguments, 1);\r\n validateArgType('Firestore.collection', 'non-empty string', 1, pathString);\r\n if (!pathString) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Must provide a non-empty collection path to collection()');\r\n }\r\n this.ensureClientConfigured();\r\n return new CollectionReference(ResourcePath.fromString(pathString), this);\r\n };\r\n Firestore.prototype.doc = function (pathString) {\r\n validateExactNumberOfArgs('Firestore.doc', arguments, 1);\r\n validateArgType('Firestore.doc', 'non-empty string', 1, pathString);\r\n if (!pathString) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Must provide a non-empty document path to doc()');\r\n }\r\n this.ensureClientConfigured();\r\n return DocumentReference.forPath(ResourcePath.fromString(pathString), this);\r\n };\r\n Firestore.prototype.runTransaction = function (updateFunction) {\r\n var _this = this;\r\n validateExactNumberOfArgs('Firestore.runTransaction', arguments, 1);\r\n validateArgType('Firestore.runTransaction', 'function', 1, updateFunction);\r\n return this.ensureClientConfigured().transaction(function (transaction) {\r\n return updateFunction(new Transaction$1(_this, transaction));\r\n });\r\n };\r\n Firestore.prototype.batch = function () {\r\n this.ensureClientConfigured();\r\n return new WriteBatch(this);\r\n };\r\n Object.defineProperty(Firestore, \"logLevel\", {\r\n get: function () {\r\n switch (getLogLevel()) {\r\n case LogLevel.DEBUG:\r\n return 'debug';\r\n case LogLevel.ERROR:\r\n return 'error';\r\n case LogLevel.SILENT:\r\n return 'silent';\r\n default:\r\n return fail('Unknown log level: ' + getLogLevel());\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Firestore.setLogLevel = function (level) {\r\n validateExactNumberOfArgs('Firestore.setLogLevel', arguments, 1);\r\n validateArgType('Firestore.setLogLevel', 'non-empty string', 1, level);\r\n switch (level) {\r\n case 'debug':\r\n setLogLevel(LogLevel.DEBUG);\r\n break;\r\n case 'error':\r\n setLogLevel(LogLevel.ERROR);\r\n break;\r\n case 'silent':\r\n setLogLevel(LogLevel.SILENT);\r\n break;\r\n default:\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid log level: ' + level);\r\n }\r\n };\r\n // Note: this is not a property because the minifier can't work correctly with\r\n // the way TypeScript compiler outputs properties.\r\n Firestore.prototype._areTimestampsInSnapshotsEnabled = function () {\r\n return this._config.settings.timestampsInSnapshots;\r\n };\r\n return Firestore;\r\n}());\r\n/**\r\n * A reference to a transaction.\r\n */\r\nvar Transaction$1 = /** @class */ (function () {\r\n function Transaction(_firestore, _transaction) {\r\n this._firestore = _firestore;\r\n this._transaction = _transaction;\r\n }\r\n Transaction.prototype.get = function (documentRef) {\r\n var _this = this;\r\n validateExactNumberOfArgs('Transaction.get', arguments, 1);\r\n var ref = validateReference('Transaction.get', documentRef, this._firestore);\r\n return this._transaction\r\n .lookup([ref._key])\r\n .then(function (docs) {\r\n if (!docs || docs.length !== 1) {\r\n return fail('Mismatch in docs returned from document lookup.');\r\n }\r\n var doc = docs[0];\r\n if (doc instanceof NoDocument) {\r\n return new DocumentSnapshot(_this._firestore, ref._key, null, \r\n /* fromCache= */ false, \r\n /* hasPendingWrites= */ false);\r\n }\r\n else if (doc instanceof Document) {\r\n return new DocumentSnapshot(_this._firestore, ref._key, doc, \r\n /* fromCache= */ false, \r\n /* hasPendingWrites= */ false);\r\n }\r\n else {\r\n throw fail(\"BatchGetDocumentsRequest returned unexpected document type: \" + doc.constructor.name);\r\n }\r\n });\r\n };\r\n Transaction.prototype.set = function (documentRef, value, options) {\r\n validateBetweenNumberOfArgs('Transaction.set', arguments, 2, 3);\r\n var ref = validateReference('Transaction.set', documentRef, this._firestore);\r\n options = validateSetOptions('Transaction.set', options);\r\n var parsed = options.merge || options.mergeFields\r\n ? this._firestore._dataConverter.parseMergeData('Transaction.set', value, options.mergeFields)\r\n : this._firestore._dataConverter.parseSetData('Transaction.set', value);\r\n this._transaction.set(ref._key, parsed);\r\n return this;\r\n };\r\n Transaction.prototype.update = function (documentRef, fieldOrUpdateData, value) {\r\n var moreFieldsAndValues = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n moreFieldsAndValues[_i - 3] = arguments[_i];\r\n }\r\n var ref;\r\n var parsed;\r\n if (typeof fieldOrUpdateData === 'string' ||\r\n fieldOrUpdateData instanceof FieldPath$1) {\r\n validateAtLeastNumberOfArgs('Transaction.update', arguments, 3);\r\n ref = validateReference('Transaction.update', documentRef, this._firestore);\r\n parsed = this._firestore._dataConverter.parseUpdateVarargs('Transaction.update', fieldOrUpdateData, value, moreFieldsAndValues);\r\n }\r\n else {\r\n validateExactNumberOfArgs('Transaction.update', arguments, 2);\r\n ref = validateReference('Transaction.update', documentRef, this._firestore);\r\n parsed = this._firestore._dataConverter.parseUpdateData('Transaction.update', fieldOrUpdateData);\r\n }\r\n this._transaction.update(ref._key, parsed);\r\n return this;\r\n };\r\n Transaction.prototype.delete = function (documentRef) {\r\n validateExactNumberOfArgs('Transaction.delete', arguments, 1);\r\n var ref = validateReference('Transaction.delete', documentRef, this._firestore);\r\n this._transaction.delete(ref._key);\r\n return this;\r\n };\r\n return Transaction;\r\n}());\r\nvar WriteBatch = /** @class */ (function () {\r\n function WriteBatch(_firestore) {\r\n this._firestore = _firestore;\r\n this._mutations = [];\r\n this._committed = false;\r\n }\r\n WriteBatch.prototype.set = function (documentRef, value, options) {\r\n validateBetweenNumberOfArgs('WriteBatch.set', arguments, 2, 3);\r\n this.verifyNotCommitted();\r\n var ref = validateReference('WriteBatch.set', documentRef, this._firestore);\r\n options = validateSetOptions('WriteBatch.set', options);\r\n var parsed = options.merge || options.mergeFields\r\n ? this._firestore._dataConverter.parseMergeData('WriteBatch.set', value, options.mergeFields)\r\n : this._firestore._dataConverter.parseSetData('WriteBatch.set', value);\r\n this._mutations = this._mutations.concat(parsed.toMutations(ref._key, Precondition.NONE));\r\n return this;\r\n };\r\n WriteBatch.prototype.update = function (documentRef, fieldOrUpdateData, value) {\r\n var moreFieldsAndValues = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n moreFieldsAndValues[_i - 3] = arguments[_i];\r\n }\r\n this.verifyNotCommitted();\r\n var ref;\r\n var parsed;\r\n if (typeof fieldOrUpdateData === 'string' ||\r\n fieldOrUpdateData instanceof FieldPath$1) {\r\n validateAtLeastNumberOfArgs('WriteBatch.update', arguments, 3);\r\n ref = validateReference('WriteBatch.update', documentRef, this._firestore);\r\n parsed = this._firestore._dataConverter.parseUpdateVarargs('WriteBatch.update', fieldOrUpdateData, value, moreFieldsAndValues);\r\n }\r\n else {\r\n validateExactNumberOfArgs('WriteBatch.update', arguments, 2);\r\n ref = validateReference('WriteBatch.update', documentRef, this._firestore);\r\n parsed = this._firestore._dataConverter.parseUpdateData('WriteBatch.update', fieldOrUpdateData);\r\n }\r\n this._mutations = this._mutations.concat(parsed.toMutations(ref._key, Precondition.exists(true)));\r\n return this;\r\n };\r\n WriteBatch.prototype.delete = function (documentRef) {\r\n validateExactNumberOfArgs('WriteBatch.delete', arguments, 1);\r\n this.verifyNotCommitted();\r\n var ref = validateReference('WriteBatch.delete', documentRef, this._firestore);\r\n this._mutations = this._mutations.concat(new DeleteMutation(ref._key, Precondition.NONE));\r\n return this;\r\n };\r\n WriteBatch.prototype.commit = function () {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n return tslib_1.__generator(this, function (_a) {\r\n this.verifyNotCommitted();\r\n this._committed = true;\r\n if (this._mutations.length > 0) {\r\n return [2 /*return*/, this._firestore.ensureClientConfigured().write(this._mutations)];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n WriteBatch.prototype.verifyNotCommitted = function () {\r\n if (this._committed) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'A write batch can no longer be used after commit() ' +\r\n 'has been called.');\r\n }\r\n };\r\n return WriteBatch;\r\n}());\r\n/**\r\n * A reference to a particular document in a collection in the database.\r\n */\r\nvar DocumentReference = /** @class */ (function () {\r\n function DocumentReference(_key, firestore) {\r\n this._key = _key;\r\n this.firestore = firestore;\r\n this._firestoreClient = this.firestore.ensureClientConfigured();\r\n }\r\n DocumentReference.forPath = function (path, firestore) {\r\n if (path.length % 2 !== 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid document reference. Document ' +\r\n 'references must have an even number of segments, but ' +\r\n (path.canonicalString() + \" has \" + path.length));\r\n }\r\n return new DocumentReference(new DocumentKey(path), firestore);\r\n };\r\n Object.defineProperty(DocumentReference.prototype, \"id\", {\r\n get: function () {\r\n return this._key.path.lastSegment();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DocumentReference.prototype, \"parent\", {\r\n get: function () {\r\n return new CollectionReference(this._key.path.popLast(), this.firestore);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DocumentReference.prototype, \"path\", {\r\n get: function () {\r\n return this._key.path.canonicalString();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DocumentReference.prototype.collection = function (pathString) {\r\n validateExactNumberOfArgs('DocumentReference.collection', arguments, 1);\r\n validateArgType('DocumentReference.collection', 'non-empty string', 1, pathString);\r\n if (!pathString) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Must provide a non-empty collection name to collection()');\r\n }\r\n var path = ResourcePath.fromString(pathString);\r\n return new CollectionReference(this._key.path.child(path), this.firestore);\r\n };\r\n DocumentReference.prototype.isEqual = function (other) {\r\n if (!(other instanceof DocumentReference)) {\r\n throw invalidClassError('isEqual', 'DocumentReference', 1, other);\r\n }\r\n return this.firestore === other.firestore && this._key.isEqual(other._key);\r\n };\r\n DocumentReference.prototype.set = function (value, options) {\r\n validateBetweenNumberOfArgs('DocumentReference.set', arguments, 1, 2);\r\n options = validateSetOptions('DocumentReference.set', options);\r\n var parsed = options.merge || options.mergeFields\r\n ? this.firestore._dataConverter.parseMergeData('DocumentReference.set', value, options.mergeFields)\r\n : this.firestore._dataConverter.parseSetData('DocumentReference.set', value);\r\n return this._firestoreClient.write(parsed.toMutations(this._key, Precondition.NONE));\r\n };\r\n DocumentReference.prototype.update = function (fieldOrUpdateData, value) {\r\n var moreFieldsAndValues = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n moreFieldsAndValues[_i - 2] = arguments[_i];\r\n }\r\n var parsed;\r\n if (typeof fieldOrUpdateData === 'string' ||\r\n fieldOrUpdateData instanceof FieldPath$1) {\r\n validateAtLeastNumberOfArgs('DocumentReference.update', arguments, 2);\r\n parsed = this.firestore._dataConverter.parseUpdateVarargs('DocumentReference.update', fieldOrUpdateData, value, moreFieldsAndValues);\r\n }\r\n else {\r\n validateExactNumberOfArgs('DocumentReference.update', arguments, 1);\r\n parsed = this.firestore._dataConverter.parseUpdateData('DocumentReference.update', fieldOrUpdateData);\r\n }\r\n return this._firestoreClient.write(parsed.toMutations(this._key, Precondition.exists(true)));\r\n };\r\n DocumentReference.prototype.delete = function () {\r\n validateExactNumberOfArgs('DocumentReference.delete', arguments, 0);\r\n return this._firestoreClient.write([\r\n new DeleteMutation(this._key, Precondition.NONE)\r\n ]);\r\n };\r\n DocumentReference.prototype.onSnapshot = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n validateBetweenNumberOfArgs('DocumentReference.onSnapshot', arguments, 1, 4);\r\n var options = {\r\n includeMetadataChanges: false\r\n };\r\n var observer;\r\n var currArg = 0;\r\n if (typeof args[currArg] === 'object' &&\r\n !isPartialObserver(args[currArg])) {\r\n options = args[currArg];\r\n validateOptionNames('DocumentReference.onSnapshot', options, [\r\n 'includeMetadataChanges'\r\n ]);\r\n validateNamedOptionalType('DocumentReference.onSnapshot', 'boolean', 'includeMetadataChanges', options.includeMetadataChanges);\r\n currArg++;\r\n }\r\n var internalOptions = {\r\n includeMetadataChanges: options.includeMetadataChanges\r\n };\r\n if (isPartialObserver(args[currArg])) {\r\n observer = args[currArg];\r\n }\r\n else {\r\n validateArgType('DocumentReference.onSnapshot', 'function', currArg, args[currArg]);\r\n validateOptionalArgType('DocumentReference.onSnapshot', 'function', currArg + 1, args[currArg + 1]);\r\n validateOptionalArgType('DocumentReference.onSnapshot', 'function', currArg + 2, args[currArg + 2]);\r\n observer = {\r\n next: args[currArg],\r\n error: args[currArg + 1],\r\n complete: args[currArg + 2]\r\n };\r\n }\r\n return this.onSnapshotInternal(internalOptions, observer);\r\n };\r\n DocumentReference.prototype.onSnapshotInternal = function (options, observer) {\r\n var _this = this;\r\n var errHandler = function (err) {\r\n console.error('Uncaught Error in onSnapshot:', err);\r\n };\r\n if (observer.error) {\r\n errHandler = observer.error.bind(observer);\r\n }\r\n var asyncObserver = new AsyncObserver({\r\n next: function (snapshot) {\r\n if (observer.next) {\r\n assert(snapshot.docs.size <= 1, 'Too many documents returned on a document query');\r\n var doc = snapshot.docs.get(_this._key);\r\n observer.next(new DocumentSnapshot(_this.firestore, _this._key, doc, snapshot.fromCache, snapshot.hasPendingWrites));\r\n }\r\n },\r\n error: errHandler\r\n });\r\n var internalListener = this._firestoreClient.listen(Query.atPath(this._key.path), asyncObserver, options);\r\n return function () {\r\n asyncObserver.mute();\r\n _this._firestoreClient.unlisten(internalListener);\r\n };\r\n };\r\n DocumentReference.prototype.get = function (options) {\r\n var _this = this;\r\n validateBetweenNumberOfArgs('DocumentReference.get', arguments, 0, 1);\r\n validateGetOptions('DocumentReference.get', options);\r\n return new Promise(function (resolve, reject) {\r\n if (options && options.source === 'cache') {\r\n _this.firestore\r\n .ensureClientConfigured()\r\n .getDocumentFromLocalCache(_this._key)\r\n .then(function (doc) {\r\n resolve(new DocumentSnapshot(_this.firestore, _this._key, doc, \r\n /*fromCache=*/ true, doc instanceof Document ? doc.hasLocalMutations : false));\r\n }, reject);\r\n }\r\n else {\r\n _this.getViaSnapshotListener(resolve, reject, options);\r\n }\r\n });\r\n };\r\n DocumentReference.prototype.getViaSnapshotListener = function (resolve, reject, options) {\r\n var unlisten = this.onSnapshotInternal({\r\n includeMetadataChanges: true,\r\n waitForSyncWhenOnline: true\r\n }, {\r\n next: function (snap) {\r\n // Remove query first before passing event to user to avoid\r\n // user actions affecting the now stale query.\r\n unlisten();\r\n if (!snap.exists && snap.metadata.fromCache) {\r\n // TODO(dimond): If we're online and the document doesn't\r\n // exist then we resolve with a doc.exists set to false. If\r\n // we're offline however, we reject the Promise in this\r\n // case. Two options: 1) Cache the negative response from\r\n // the server so we can deliver that even when you're\r\n // offline 2) Actually reject the Promise in the online case\r\n // if the document doesn't exist.\r\n reject(new FirestoreError(Code.UNAVAILABLE, 'Failed to get document because the client is ' + 'offline.'));\r\n }\r\n else if (snap.exists &&\r\n snap.metadata.fromCache &&\r\n options &&\r\n options.source === 'server') {\r\n reject(new FirestoreError(Code.UNAVAILABLE, 'Failed to get document from server. (However, this ' +\r\n 'document does exist in the local cache. Run again ' +\r\n 'without setting source to \"server\" to ' +\r\n 'retrieve the cached document.)'));\r\n }\r\n else {\r\n resolve(snap);\r\n }\r\n },\r\n error: reject\r\n });\r\n };\r\n return DocumentReference;\r\n}());\r\nvar SnapshotMetadata = /** @class */ (function () {\r\n function SnapshotMetadata(hasPendingWrites, fromCache) {\r\n this.hasPendingWrites = hasPendingWrites;\r\n this.fromCache = fromCache;\r\n }\r\n SnapshotMetadata.prototype.isEqual = function (other) {\r\n return (this.hasPendingWrites === other.hasPendingWrites &&\r\n this.fromCache === other.fromCache);\r\n };\r\n return SnapshotMetadata;\r\n}());\r\nvar DocumentSnapshot = /** @class */ (function () {\r\n function DocumentSnapshot(_firestore, _key, _document, _fromCache, _hasPendingWrites) {\r\n this._firestore = _firestore;\r\n this._key = _key;\r\n this._document = _document;\r\n this._fromCache = _fromCache;\r\n this._hasPendingWrites = _hasPendingWrites;\r\n }\r\n DocumentSnapshot.prototype.data = function (options) {\r\n validateBetweenNumberOfArgs('DocumentSnapshot.data', arguments, 0, 1);\r\n options = validateSnapshotOptions('DocumentSnapshot.data', options);\r\n return !this._document\r\n ? undefined\r\n : this.convertObject(this._document.data, FieldValueOptions.fromSnapshotOptions(options, this._firestore._areTimestampsInSnapshotsEnabled()));\r\n };\r\n DocumentSnapshot.prototype.get = function (fieldPath, options) {\r\n validateBetweenNumberOfArgs('DocumentSnapshot.get', arguments, 1, 2);\r\n options = validateSnapshotOptions('DocumentSnapshot.get', options);\r\n if (this._document) {\r\n var value = this._document.data.field(fieldPathFromArgument('DocumentSnapshot.get', fieldPath));\r\n if (value !== undefined) {\r\n return this.convertValue(value, FieldValueOptions.fromSnapshotOptions(options, this._firestore._areTimestampsInSnapshotsEnabled()));\r\n }\r\n }\r\n return undefined;\r\n };\r\n Object.defineProperty(DocumentSnapshot.prototype, \"id\", {\r\n get: function () {\r\n return this._key.path.lastSegment();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DocumentSnapshot.prototype, \"ref\", {\r\n get: function () {\r\n return new DocumentReference(this._key, this._firestore);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DocumentSnapshot.prototype, \"exists\", {\r\n get: function () {\r\n return this._document !== null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DocumentSnapshot.prototype, \"metadata\", {\r\n get: function () {\r\n return new SnapshotMetadata(this._hasPendingWrites, this._fromCache);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DocumentSnapshot.prototype.isEqual = function (other) {\r\n if (!(other instanceof DocumentSnapshot)) {\r\n throw invalidClassError('isEqual', 'DocumentSnapshot', 1, other);\r\n }\r\n return (this._firestore === other._firestore &&\r\n this._fromCache === other._fromCache &&\r\n this._key.isEqual(other._key) &&\r\n (this._document === null\r\n ? other._document === null\r\n : this._document.isEqual(other._document)));\r\n };\r\n DocumentSnapshot.prototype.convertObject = function (data, options) {\r\n var _this = this;\r\n var result = {};\r\n data.forEach(function (key, value) {\r\n result[key] = _this.convertValue(value, options);\r\n });\r\n return result;\r\n };\r\n DocumentSnapshot.prototype.convertValue = function (value, options) {\r\n if (value instanceof ObjectValue) {\r\n return this.convertObject(value, options);\r\n }\r\n else if (value instanceof ArrayValue) {\r\n return this.convertArray(value, options);\r\n }\r\n else if (value instanceof RefValue) {\r\n var key = value.value(options);\r\n var database = this._firestore.ensureClientConfigured().databaseId();\r\n if (!value.databaseId.isEqual(database)) {\r\n // TODO(b/64130202): Somehow support foreign references.\r\n error(\"Document \" + this._key.path + \" contains a document \" +\r\n \"reference within a different database (\" +\r\n (value.databaseId.projectId + \"/\" + value.databaseId.database + \") which is not \") +\r\n \"supported. It will be treated as a reference in the current \" +\r\n (\"database (\" + database.projectId + \"/\" + database.database + \") \") +\r\n \"instead.\");\r\n }\r\n return new DocumentReference(key, this._firestore);\r\n }\r\n else {\r\n return value.value(options);\r\n }\r\n };\r\n DocumentSnapshot.prototype.convertArray = function (data, options) {\r\n var _this = this;\r\n return data.internalValue.map(function (value) {\r\n return _this.convertValue(value, options);\r\n });\r\n };\r\n return DocumentSnapshot;\r\n}());\r\nvar QueryDocumentSnapshot = /** @class */ (function (_super) {\r\n tslib_1.__extends(QueryDocumentSnapshot, _super);\r\n function QueryDocumentSnapshot(firestore, key, document, fromCache, hasPendingWrites) {\r\n return _super.call(this, firestore, key, document, fromCache, hasPendingWrites) || this;\r\n }\r\n QueryDocumentSnapshot.prototype.data = function (options) {\r\n var data = _super.prototype.data.call(this, options);\r\n assert(typeof data === 'object', 'Document in a QueryDocumentSnapshot should exist');\r\n return data;\r\n };\r\n return QueryDocumentSnapshot;\r\n}(DocumentSnapshot));\r\nvar Query$1 = /** @class */ (function () {\r\n function Query$$1(_query, firestore) {\r\n this._query = _query;\r\n this.firestore = firestore;\r\n }\r\n Query$$1.prototype.where = function (field, opStr, value) {\r\n validateExactNumberOfArgs('Query.where', arguments, 3);\r\n validateArgType('Query.where', 'non-empty string', 2, opStr);\r\n validateDefined('Query.where', 3, value);\r\n var fieldValue;\r\n var fieldPath = fieldPathFromArgument('Query.where', field);\r\n var relationOp = RelationOp.fromString(opStr);\r\n if (fieldPath.isKeyField()) {\r\n if (relationOp === RelationOp.ARRAY_CONTAINS) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid Query. You can't perform array-contains queries on \" +\r\n 'FieldPath.documentId() since document IDs are not arrays.');\r\n }\r\n if (typeof value === 'string') {\r\n if (value.indexOf('/') !== -1) {\r\n // TODO(dimond): Allow slashes once ancestor queries are supported\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Function Query.where() requires its third parameter to be a ' +\r\n 'valid document ID if the first parameter is ' +\r\n 'FieldPath.documentId(), but it contains a slash.');\r\n }\r\n if (value === '') {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Function Query.where() requires its third parameter to be a ' +\r\n 'valid document ID if the first parameter is ' +\r\n 'FieldPath.documentId(), but it was an empty string.');\r\n }\r\n var path = this._query.path.child(new ResourcePath([value]));\r\n assert(path.length % 2 === 0, 'Path should be a document key');\r\n fieldValue = new RefValue(this.firestore._databaseId, new DocumentKey(path));\r\n }\r\n else if (value instanceof DocumentReference) {\r\n var ref = value;\r\n fieldValue = new RefValue(this.firestore._databaseId, ref._key);\r\n }\r\n else {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function Query.where() requires its third parameter to be a \" +\r\n \"string or a DocumentReference if the first parameter is \" +\r\n \"FieldPath.documentId(), but it was: \" +\r\n (valueDescription(value) + \".\"));\r\n }\r\n }\r\n else {\r\n fieldValue = this.firestore._dataConverter.parseQueryValue('Query.where', value);\r\n }\r\n var filter = Filter.create(fieldPath, relationOp, fieldValue);\r\n this.validateNewFilter(filter);\r\n return new Query$$1(this._query.addFilter(filter), this.firestore);\r\n };\r\n Query$$1.prototype.orderBy = function (field, directionStr) {\r\n validateBetweenNumberOfArgs('Query.orderBy', arguments, 1, 2);\r\n validateOptionalArgType('Query.orderBy', 'non-empty string', 2, directionStr);\r\n var direction;\r\n if (directionStr === undefined || directionStr === 'asc') {\r\n direction = Direction.ASCENDING;\r\n }\r\n else if (directionStr === 'desc') {\r\n direction = Direction.DESCENDING;\r\n }\r\n else {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function Query.orderBy() has unknown direction '\" + directionStr + \"', \" +\r\n \"expected 'asc' or 'desc'.\");\r\n }\r\n if (this._query.startAt !== null) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. You must not call Query.startAt() or ' +\r\n 'Query.startAfter() before calling Query.orderBy().');\r\n }\r\n if (this._query.endAt !== null) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. You must not call Query.endAt() or ' +\r\n 'Query.endBefore() before calling Query.orderBy().');\r\n }\r\n var fieldPath = fieldPathFromArgument('Query.orderBy', field);\r\n var orderBy = new OrderBy(fieldPath, direction);\r\n this.validateNewOrderBy(orderBy);\r\n return new Query$$1(this._query.addOrderBy(orderBy), this.firestore);\r\n };\r\n Query$$1.prototype.limit = function (n) {\r\n validateExactNumberOfArgs('Query.limit', arguments, 1);\r\n validateArgType('Query.limit', 'number', 1, n);\r\n if (n <= 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid Query. Query limit (\" + n + \") is invalid. Limit must be \" +\r\n 'positive.');\r\n }\r\n return new Query$$1(this._query.withLimit(n), this.firestore);\r\n };\r\n Query$$1.prototype.startAt = function (docOrField) {\r\n var fields = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n fields[_i - 1] = arguments[_i];\r\n }\r\n validateAtLeastNumberOfArgs('Query.startAt', arguments, 1);\r\n var bound = this.boundFromDocOrFields('Query.startAt', docOrField, fields, \r\n /*before=*/ true);\r\n return new Query$$1(this._query.withStartAt(bound), this.firestore);\r\n };\r\n Query$$1.prototype.startAfter = function (docOrField) {\r\n var fields = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n fields[_i - 1] = arguments[_i];\r\n }\r\n validateAtLeastNumberOfArgs('Query.startAfter', arguments, 1);\r\n var bound = this.boundFromDocOrFields('Query.startAfter', docOrField, fields, \r\n /*before=*/ false);\r\n return new Query$$1(this._query.withStartAt(bound), this.firestore);\r\n };\r\n Query$$1.prototype.endBefore = function (docOrField) {\r\n var fields = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n fields[_i - 1] = arguments[_i];\r\n }\r\n validateAtLeastNumberOfArgs('Query.endBefore', arguments, 1);\r\n var bound = this.boundFromDocOrFields('Query.endBefore', docOrField, fields, \r\n /*before=*/ true);\r\n return new Query$$1(this._query.withEndAt(bound), this.firestore);\r\n };\r\n Query$$1.prototype.endAt = function (docOrField) {\r\n var fields = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n fields[_i - 1] = arguments[_i];\r\n }\r\n validateAtLeastNumberOfArgs('Query.endAt', arguments, 1);\r\n var bound = this.boundFromDocOrFields('Query.endAt', docOrField, fields, \r\n /*before=*/ false);\r\n return new Query$$1(this._query.withEndAt(bound), this.firestore);\r\n };\r\n Query$$1.prototype.isEqual = function (other) {\r\n if (!(other instanceof Query$$1)) {\r\n throw invalidClassError('isEqual', 'Query', 1, other);\r\n }\r\n return (this.firestore === other.firestore && this._query.isEqual(other._query));\r\n };\r\n /** Helper function to create a bound from a document or fields */\r\n Query$$1.prototype.boundFromDocOrFields = function (methodName, docOrField, fields, before) {\r\n validateDefined(methodName, 1, docOrField);\r\n if (docOrField instanceof DocumentSnapshot) {\r\n if (fields.length > 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Too many arguments provided to \" + methodName + \"().\");\r\n }\r\n var snap = docOrField;\r\n if (!snap.exists) {\r\n throw new FirestoreError(Code.NOT_FOUND, \"Can't use a DocumentSnapshot that doesn't exist for \" +\r\n (methodName + \"().\"));\r\n }\r\n return this.boundFromDocument(methodName, snap._document, before);\r\n }\r\n else {\r\n var allFields = [docOrField].concat(fields);\r\n return this.boundFromFields(methodName, allFields, before);\r\n }\r\n };\r\n /**\r\n * Create a Bound from a query and a document.\r\n *\r\n * Note that the Bound will always include the key of the document\r\n * and so only the provided document will compare equal to the returned\r\n * position.\r\n *\r\n * Will throw if the document does not contain all fields of the order by\r\n * of the query.\r\n */\r\n Query$$1.prototype.boundFromDocument = function (methodName, doc, before) {\r\n var components = [];\r\n // Because people expect to continue/end a query at the exact document\r\n // provided, we need to use the implicit sort order rather than the explicit\r\n // sort order, because it's guaranteed to contain the document key. That way\r\n // the position becomes unambiguous and the query continues/ends exactly at\r\n // the provided document. Without the key (by using the explicit sort\r\n // orders), multiple documents could match the position, yielding duplicate\r\n // results.\r\n for (var _i = 0, _a = this._query.orderBy; _i < _a.length; _i++) {\r\n var orderBy = _a[_i];\r\n if (orderBy.field.isKeyField()) {\r\n components.push(new RefValue(this.firestore._databaseId, doc.key));\r\n }\r\n else {\r\n var value = doc.field(orderBy.field);\r\n if (value !== undefined) {\r\n components.push(value);\r\n }\r\n else {\r\n var field = orderBy.field.canonicalString();\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid query. You are trying to start or end a query using a \" +\r\n (\"document for which the field '\" + field + \"' (used as the \") +\r\n \"orderBy) does not exist.\");\r\n }\r\n }\r\n }\r\n return new Bound(components, before);\r\n };\r\n /**\r\n * Converts a list of field values to a Bound for the given query.\r\n */\r\n Query$$1.prototype.boundFromFields = function (methodName, values$$1, before) {\r\n // Use explicit order by's because it has to match the query the user made\r\n var orderBy = this._query.explicitOrderBy;\r\n if (values$$1.length > orderBy.length) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Too many arguments provided to \" + methodName + \"(). \" +\r\n \"The number of arguments must be less than or equal to the \" +\r\n \"number of Query.orderBy() clauses\");\r\n }\r\n var components = [];\r\n for (var i = 0; i < values$$1.length; i++) {\r\n var rawValue = values$$1[i];\r\n var orderByComponent = orderBy[i];\r\n if (orderByComponent.field.isKeyField()) {\r\n if (typeof rawValue !== 'string') {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid query. Expected a string for document ID in \" +\r\n (methodName + \"(), but got a \" + typeof rawValue));\r\n }\r\n if (rawValue.indexOf('/') !== -1) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid query. Document ID '\" + rawValue + \"' contains a slash in \" +\r\n (methodName + \"()\"));\r\n }\r\n var key = new DocumentKey(this._query.path.child(rawValue));\r\n components.push(new RefValue(this.firestore._databaseId, key));\r\n }\r\n else {\r\n var wrapped = this.firestore._dataConverter.parseQueryValue(methodName, rawValue);\r\n components.push(wrapped);\r\n }\r\n }\r\n return new Bound(components, before);\r\n };\r\n Query$$1.prototype.onSnapshot = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n validateBetweenNumberOfArgs('Query.onSnapshot', arguments, 1, 4);\r\n var options = {};\r\n var observer;\r\n var currArg = 0;\r\n if (typeof args[currArg] === 'object' &&\r\n !isPartialObserver(args[currArg])) {\r\n options = args[currArg];\r\n validateOptionNames('Query.onSnapshot', options, [\r\n 'includeMetadataChanges'\r\n ]);\r\n validateNamedOptionalType('Query.onSnapshot', 'boolean', 'includeMetadataChanges', options.includeMetadataChanges);\r\n currArg++;\r\n }\r\n if (isPartialObserver(args[currArg])) {\r\n observer = args[currArg];\r\n }\r\n else {\r\n validateArgType('Query.onSnapshot', 'function', currArg, args[currArg]);\r\n validateOptionalArgType('Query.onSnapshot', 'function', currArg + 1, args[currArg + 1]);\r\n validateOptionalArgType('Query.onSnapshot', 'function', currArg + 2, args[currArg + 2]);\r\n observer = {\r\n next: args[currArg],\r\n error: args[currArg + 1],\r\n complete: args[currArg + 2]\r\n };\r\n }\r\n return this.onSnapshotInternal(options, observer);\r\n };\r\n Query$$1.prototype.onSnapshotInternal = function (options, observer) {\r\n var _this = this;\r\n var errHandler = function (err) {\r\n console.error('Uncaught Error in onSnapshot:', err);\r\n };\r\n if (observer.error) {\r\n errHandler = observer.error.bind(observer);\r\n }\r\n var asyncObserver = new AsyncObserver({\r\n next: function (result) {\r\n if (observer.next) {\r\n observer.next(new QuerySnapshot(_this.firestore, _this._query, result));\r\n }\r\n },\r\n error: errHandler\r\n });\r\n var firestoreClient = this.firestore.ensureClientConfigured();\r\n var internalListener = firestoreClient.listen(this._query, asyncObserver, options);\r\n return function () {\r\n asyncObserver.mute();\r\n firestoreClient.unlisten(internalListener);\r\n };\r\n };\r\n Query$$1.prototype.get = function (options) {\r\n var _this = this;\r\n validateBetweenNumberOfArgs('Query.get', arguments, 0, 1);\r\n validateGetOptions('Query.get', options);\r\n return new Promise(function (resolve, reject) {\r\n if (options && options.source === 'cache') {\r\n _this.firestore\r\n .ensureClientConfigured()\r\n .getDocumentsFromLocalCache(_this._query)\r\n .then(function (viewSnap) {\r\n resolve(new QuerySnapshot(_this.firestore, _this._query, viewSnap));\r\n }, reject);\r\n }\r\n else {\r\n _this.getViaSnapshotListener(resolve, reject, options);\r\n }\r\n });\r\n };\r\n Query$$1.prototype.getViaSnapshotListener = function (resolve, reject, options) {\r\n var unlisten = this.onSnapshotInternal({\r\n includeMetadataChanges: true,\r\n waitForSyncWhenOnline: true\r\n }, {\r\n next: function (result) {\r\n // Remove query first before passing event to user to avoid\r\n // user actions affecting the now stale query.\r\n unlisten();\r\n if (result.metadata.fromCache &&\r\n options &&\r\n options.source === 'server') {\r\n reject(new FirestoreError(Code.UNAVAILABLE, 'Failed to get documents from server. (However, these ' +\r\n 'documents may exist in the local cache. Run again ' +\r\n 'without setting source to \"server\" to ' +\r\n 'retrieve the cached documents.)'));\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n },\r\n error: reject\r\n });\r\n };\r\n Query$$1.prototype.validateNewFilter = function (filter) {\r\n if (filter instanceof RelationFilter) {\r\n if (filter.isInequality()) {\r\n var existingField = this._query.getInequalityFilterField();\r\n if (existingField !== null && !existingField.isEqual(filter.field)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. All where filters with an inequality' +\r\n ' (<, <=, >, or >=) must be on the same field. But you have' +\r\n (\" inequality filters on '\" + existingField.toString() + \"'\") +\r\n (\" and '\" + filter.field.toString() + \"'\"));\r\n }\r\n var firstOrderByField = this._query.getFirstOrderByField();\r\n if (firstOrderByField !== null) {\r\n this.validateOrderByAndInequalityMatch(filter.field, firstOrderByField);\r\n }\r\n }\r\n else if (filter.op === RelationOp.ARRAY_CONTAINS) {\r\n if (this._query.hasArrayContainsFilter()) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. Queries only support a single array-contains ' +\r\n 'filter.');\r\n }\r\n }\r\n }\r\n };\r\n Query$$1.prototype.validateNewOrderBy = function (orderBy) {\r\n if (this._query.getFirstOrderByField() === null) {\r\n // This is the first order by. It must match any inequality.\r\n var inequalityField = this._query.getInequalityFilterField();\r\n if (inequalityField !== null) {\r\n this.validateOrderByAndInequalityMatch(inequalityField, orderBy.field);\r\n }\r\n }\r\n };\r\n Query$$1.prototype.validateOrderByAndInequalityMatch = function (inequality, orderBy) {\r\n if (!orderBy.isEqual(inequality)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid query. You have a where filter with an inequality \" +\r\n (\"(<, <=, >, or >=) on field '\" + inequality.toString() + \"' \") +\r\n (\"and so you must also use '\" + inequality.toString() + \"' \") +\r\n \"as your first Query.orderBy(), but your first Query.orderBy() \" +\r\n (\"is on field '\" + orderBy.toString() + \"' instead.\"));\r\n }\r\n };\r\n return Query$$1;\r\n}());\r\nvar QuerySnapshot = /** @class */ (function () {\r\n function QuerySnapshot(_firestore, _originalQuery, _snapshot) {\r\n this._firestore = _firestore;\r\n this._originalQuery = _originalQuery;\r\n this._snapshot = _snapshot;\r\n this._cachedChanges = null;\r\n this._cachedChangesIncludeMetadataChanges = null;\r\n this.metadata = new SnapshotMetadata(_snapshot.hasPendingWrites, _snapshot.fromCache);\r\n }\r\n Object.defineProperty(QuerySnapshot.prototype, \"docs\", {\r\n get: function () {\r\n var result = [];\r\n this.forEach(function (doc) { return result.push(doc); });\r\n return result;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(QuerySnapshot.prototype, \"empty\", {\r\n get: function () {\r\n return this._snapshot.docs.isEmpty();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(QuerySnapshot.prototype, \"size\", {\r\n get: function () {\r\n return this._snapshot.docs.size;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n QuerySnapshot.prototype.forEach = function (callback, thisArg) {\r\n var _this = this;\r\n validateBetweenNumberOfArgs('QuerySnapshot.forEach', arguments, 1, 2);\r\n validateArgType('QuerySnapshot.forEach', 'function', 1, callback);\r\n this._snapshot.docs.forEach(function (doc) {\r\n callback.call(thisArg, _this.convertToDocumentImpl(doc));\r\n });\r\n };\r\n Object.defineProperty(QuerySnapshot.prototype, \"query\", {\r\n get: function () {\r\n return new Query$1(this._originalQuery, this._firestore);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n QuerySnapshot.prototype.docChanges = function (options) {\r\n if (options) {\r\n validateOptionNames('QuerySnapshot.docChanges', options, [\r\n 'includeMetadataChanges'\r\n ]);\r\n validateNamedOptionalType('QuerySnapshot.docChanges', 'boolean', 'includeMetadataChanges', options.includeMetadataChanges);\r\n }\r\n var includeMetadataChanges = !!(options && options.includeMetadataChanges);\r\n if (includeMetadataChanges && this._snapshot.excludesMetadataChanges) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'To include metadata changes with your document changes, you must ' +\r\n 'also pass { includeMetadataChanges:true } to onSnapshot().');\r\n }\r\n if (!this._cachedChanges ||\r\n this._cachedChangesIncludeMetadataChanges !== includeMetadataChanges) {\r\n this._cachedChanges = changesFromSnapshot(this._firestore, includeMetadataChanges, this._snapshot);\r\n this._cachedChangesIncludeMetadataChanges = includeMetadataChanges;\r\n }\r\n return this._cachedChanges;\r\n };\r\n /** Check the equality. The call can be very expensive. */\r\n QuerySnapshot.prototype.isEqual = function (other) {\r\n if (!(other instanceof QuerySnapshot)) {\r\n throw invalidClassError('isEqual', 'QuerySnapshot', 1, other);\r\n }\r\n return (this._firestore === other._firestore &&\r\n this._originalQuery.isEqual(other._originalQuery) &&\r\n this._snapshot.isEqual(other._snapshot));\r\n };\r\n QuerySnapshot.prototype.convertToDocumentImpl = function (doc) {\r\n return new QueryDocumentSnapshot(this._firestore, doc.key, doc, this.metadata.fromCache, this._snapshot.mutatedKeys.has(doc.key));\r\n };\r\n return QuerySnapshot;\r\n}());\r\n// TODO(2018/11/01): As of 2018/04/17 we're changing docChanges from an array\r\n// into a method. Because this is a runtime breaking change and somewhat subtle\r\n// (both Array and Function have a .length, etc.), we'll replace commonly-used\r\n// properties (including Symbol.iterator) to throw a custom error message. In\r\n// ~6 months we can delete the custom error as most folks will have hopefully\r\n// migrated.\r\nfunction throwDocChangesMethodError() {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'QuerySnapshot.docChanges has been changed from a property into a ' +\r\n 'method, so usages like \"querySnapshot.docChanges\" should become ' +\r\n '\"querySnapshot.docChanges()\"');\r\n}\r\nvar docChangesPropertiesToOverride = [\r\n 'length',\r\n 'forEach',\r\n 'map'\r\n].concat((typeof Symbol !== 'undefined' ? [Symbol.iterator] : []));\r\ndocChangesPropertiesToOverride.forEach(function (property) {\r\n /**\r\n * We are (re-)defining properties on QuerySnapshot.prototype.docChanges which\r\n * is a Function. This could fail, in particular in the case of 'length' which\r\n * already exists on Function.prototype and on IE11 is improperly defined with\r\n * `{ configurable: false }`. So we wrap this in a try/catch to ensure that we\r\n * still have a functional SDK.\r\n */\r\n try {\r\n Object.defineProperty(QuerySnapshot.prototype.docChanges, property, {\r\n get: function () { return throwDocChangesMethodError(); }\r\n });\r\n }\r\n catch (err) { } // Ignore this failure intentionally\r\n});\r\nvar CollectionReference = /** @class */ (function (_super) {\r\n tslib_1.__extends(CollectionReference, _super);\r\n function CollectionReference(path, firestore) {\r\n var _this = _super.call(this, Query.atPath(path), firestore) || this;\r\n if (path.length % 2 !== 1) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid collection reference. Collection ' +\r\n 'references must have an odd number of segments, but ' +\r\n (path.canonicalString() + \" has \" + path.length));\r\n }\r\n return _this;\r\n }\r\n Object.defineProperty(CollectionReference.prototype, \"id\", {\r\n get: function () {\r\n return this._query.path.lastSegment();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(CollectionReference.prototype, \"parent\", {\r\n get: function () {\r\n var parentPath = this._query.path.popLast();\r\n if (parentPath.isEmpty()) {\r\n return null;\r\n }\r\n else {\r\n return new DocumentReference(new DocumentKey(parentPath), this.firestore);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(CollectionReference.prototype, \"path\", {\r\n get: function () {\r\n return this._query.path.canonicalString();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n CollectionReference.prototype.doc = function (pathString) {\r\n validateBetweenNumberOfArgs('CollectionReference.doc', arguments, 0, 1);\r\n // We allow omission of 'pathString' but explicitly prohibit passing in both\r\n // 'undefined' and 'null'.\r\n if (arguments.length === 0) {\r\n pathString = AutoId.newId();\r\n }\r\n validateArgType('CollectionReference.doc', 'non-empty string', 1, pathString);\r\n if (pathString === '') {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Document path must be a non-empty string');\r\n }\r\n var path = ResourcePath.fromString(pathString);\r\n return DocumentReference.forPath(this._query.path.child(path), this.firestore);\r\n };\r\n CollectionReference.prototype.add = function (value) {\r\n validateExactNumberOfArgs('CollectionReference.add', arguments, 1);\r\n validateArgType('CollectionReference.add', 'object', 1, value);\r\n var docRef = this.doc();\r\n return docRef.set(value).then(function () { return docRef; });\r\n };\r\n return CollectionReference;\r\n}(Query$1));\r\nfunction validateSetOptions(methodName, options) {\r\n if (options === undefined) {\r\n return {\r\n merge: false\r\n };\r\n }\r\n validateOptionNames(methodName, options, ['merge', 'mergeFields']);\r\n validateNamedOptionalType(methodName, 'boolean', 'merge', options.merge);\r\n validateOptionalArrayElements(methodName, 'mergeFields', 'a string or a FieldPath', options.mergeFields, function (element) {\r\n return typeof element === 'string' || element instanceof FieldPath$1;\r\n });\r\n if (options.mergeFields !== undefined && options.merge !== undefined) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid options passed to function \" + methodName + \"(): You cannot specify both \\\"merge\\\" \" +\r\n \"and \\\"mergeFields\\\".\");\r\n }\r\n return options;\r\n}\r\nfunction validateSnapshotOptions(methodName, options) {\r\n if (options === undefined) {\r\n return {};\r\n }\r\n validateOptionNames(methodName, options, ['serverTimestamps']);\r\n validateNamedOptionalPropertyEquals(methodName, 'options', 'serverTimestamps', options.serverTimestamps, ['estimate', 'previous', 'none']);\r\n return options;\r\n}\r\nfunction validateGetOptions(methodName, options) {\r\n validateOptionalArgType(methodName, 'object', 1, options);\r\n if (options) {\r\n validateOptionNames(methodName, options, ['source']);\r\n validateNamedOptionalPropertyEquals(methodName, 'options', 'source', options.source, ['default', 'server', 'cache']);\r\n }\r\n}\r\nfunction validateReference(methodName, documentRef, firestore) {\r\n if (!(documentRef instanceof DocumentReference)) {\r\n throw invalidClassError(methodName, 'DocumentReference', 1, documentRef);\r\n }\r\n else if (documentRef.firestore !== firestore) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Provided document reference is from a different Firestore instance.');\r\n }\r\n else {\r\n return documentRef;\r\n }\r\n}\r\n/**\r\n * Calculates the array of firestore.DocumentChange's for a given ViewSnapshot.\r\n *\r\n * Exported for testing.\r\n */\r\nfunction changesFromSnapshot(firestore, includeMetadataChanges, snapshot) {\r\n if (snapshot.oldDocs.isEmpty()) {\r\n // Special case the first snapshot because index calculation is easy and\r\n // fast\r\n var lastDoc_1;\r\n var index_1 = 0;\r\n return snapshot.docChanges.map(function (change) {\r\n var doc = new QueryDocumentSnapshot(firestore, change.doc.key, change.doc, snapshot.fromCache, snapshot.mutatedKeys.has(change.doc.key));\r\n assert(change.type === ChangeType.Added, 'Invalid event type for first snapshot');\r\n assert(!lastDoc_1 || snapshot.query.docComparator(lastDoc_1, change.doc) < 0, 'Got added events in wrong order');\r\n lastDoc_1 = change.doc;\r\n return {\r\n type: 'added',\r\n doc: doc,\r\n oldIndex: -1,\r\n newIndex: index_1++\r\n };\r\n });\r\n }\r\n else {\r\n // A DocumentSet that is updated incrementally as changes are applied to use\r\n // to lookup the index of a document.\r\n var indexTracker_1 = snapshot.oldDocs;\r\n return snapshot.docChanges\r\n .filter(function (change) { return includeMetadataChanges || change.type !== ChangeType.Metadata; })\r\n .map(function (change) {\r\n var doc = new QueryDocumentSnapshot(firestore, change.doc.key, change.doc, snapshot.fromCache, snapshot.mutatedKeys.has(change.doc.key));\r\n var oldIndex = -1;\r\n var newIndex = -1;\r\n if (change.type !== ChangeType.Added) {\r\n oldIndex = indexTracker_1.indexOf(change.doc.key);\r\n assert(oldIndex >= 0, 'Index for document not found');\r\n indexTracker_1 = indexTracker_1.delete(change.doc.key);\r\n }\r\n if (change.type !== ChangeType.Removed) {\r\n indexTracker_1 = indexTracker_1.add(change.doc);\r\n newIndex = indexTracker_1.indexOf(change.doc.key);\r\n }\r\n return { type: resultChangeType(change.type), doc: doc, oldIndex: oldIndex, newIndex: newIndex };\r\n });\r\n }\r\n}\r\nfunction resultChangeType(type) {\r\n switch (type) {\r\n case ChangeType.Added:\r\n return 'added';\r\n case ChangeType.Modified:\r\n case ChangeType.Metadata:\r\n return 'modified';\r\n case ChangeType.Removed:\r\n return 'removed';\r\n default:\r\n return fail('Unknown change type: ' + type);\r\n }\r\n}\r\n// Export the classes with a private constructor (it will fail if invoked\r\n// at runtime). Note that this still allows instanceof checks.\r\n// We're treating the variables as class names, so disable checking for lower\r\n// case variable names.\r\n// tslint:disable:variable-name\r\nvar PublicFirestore = makeConstructorPrivate(Firestore, 'Use firebase.firestore() instead.');\r\nvar PublicTransaction = makeConstructorPrivate(Transaction$1, 'Use firebase.firestore().runTransaction() instead.');\r\nvar PublicWriteBatch = makeConstructorPrivate(WriteBatch, 'Use firebase.firestore().batch() instead.');\r\nvar PublicDocumentReference = makeConstructorPrivate(DocumentReference, 'Use firebase.firestore().doc() instead.');\r\nvar PublicDocumentSnapshot = makeConstructorPrivate(DocumentSnapshot);\r\nvar PublicQueryDocumentSnapshot = makeConstructorPrivate(QueryDocumentSnapshot);\r\nvar PublicQuery = makeConstructorPrivate(Query$1);\r\nvar PublicQuerySnapshot = makeConstructorPrivate(QuerySnapshot);\r\nvar PublicCollectionReference = makeConstructorPrivate(CollectionReference, 'Use firebase.firestore().collection() instead.');\r\n// tslint:enable:variable-name\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar firestoreNamespace = {\r\n Firestore: PublicFirestore,\r\n GeoPoint: GeoPoint,\r\n Timestamp: Timestamp,\r\n Blob: PublicBlob,\r\n Transaction: PublicTransaction,\r\n WriteBatch: PublicWriteBatch,\r\n DocumentReference: PublicDocumentReference,\r\n DocumentSnapshot: PublicDocumentSnapshot,\r\n Query: PublicQuery,\r\n QueryDocumentSnapshot: PublicQueryDocumentSnapshot,\r\n QuerySnapshot: PublicQuerySnapshot,\r\n CollectionReference: PublicCollectionReference,\r\n FieldPath: FieldPath$1,\r\n FieldValue: PublicFieldValue,\r\n setLogLevel: Firestore.setLogLevel\r\n};\r\n/**\r\n * Configures Firestore as part of the Firebase SDK by calling registerService.\r\n */\r\nfunction configureForFirebase(firebase$$1) {\r\n firebase$$1.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));\r\n}\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerFirestore(instance) {\r\n configureForFirebase(instance);\r\n}\r\nregisterFirestore(firebase);\n\nexports.registerFirestore = registerFirestore;\n","import '@firebase/firestore';\n\n/**\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n","import firebase from \"firebase/app\"\nimport \"firebase/firestore\"\n\nclass Firebase {\n\tconstructor() {\n\t\tthis.initFirebase()\n\t}\n\n\tdb: any\n\n\tinitFirebase() {\n\t\tif (firebase.apps.length) return\n\t\tconst config = {\n\t\t\t// apiKey: \"AIzaSyC77IMSzncR28nKqg4uZaeZGSO4ClzX_Ps\",\n\t\t\t// authDomain: \"holy-kalo.firebaseapp.com\",\n\t\t\t// databaseURL: \"https://holy-kalo.firebaseio.com\",\n\t\t\tprojectId: \"holy-kalo\"\n\t\t\t// storageBucket: \"holy-kalo.appspot.com\",\n\t\t\t// messagingSenderId: \"90507705263\"\n\t\t}\n\t\tfirebase.initializeApp(config)\n\t\tthis.db = firebase.firestore()\n\t\tconst settings = { timestampsInSnapshots: true }\n\t\tthis.db.settings(settings)\n\t}\n\n\tget(table: string) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.db &&\n\t\t\t\tthis.db\n\t\t\t\t\t.collection(table)\n\t\t\t\t\t.get()\n\t\t\t\t\t.then(\n\t\t\t\t\t\tquerySnapshot => {\n\t\t\t\t\t\t\tconst list = []\n\t\t\t\t\t\t\tquerySnapshot.forEach(element => {\n\t\t\t\t\t\t\t\tconst data = element.data()\n\t\t\t\t\t\t\t\tlist.push(data)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tresolve(list)\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(error: any) => {\n\t\t\t\t\t\t\tconsole.log(error)\n\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t})\n\t}\n}\n\nexport default Firebase\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","/**\n * @license\n * Lodash \n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.11';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g,\n reTrimStart = /^\\s+/,\n reTrimEnd = /\\s+$/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n\n return result;\n }\n\n if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n\n return result;\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n if (isObject(srcValue)) {\n stack || (stack = new Stack);\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n value = iteratee(value);\n\n var low = 0,\n high = array == null ? 0 : array.length,\n valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '