{"version":3,"file":"ngry-store.mjs","sources":["../../../../libs/store/src/lib/action/actions.ts","../../../../libs/store/src/lib/action/use-dispatch.ts","../../../../libs/store/src/lib/entity/entity-collection.ts","../../../../libs/store/src/lib/util/get-keys.ts","../../../../libs/store/src/lib/util/is-equal.ts","../../../../libs/store/src/lib/util/optimize.ts","../../../../libs/store/src/lib/store/select.ts","../../../../libs/store/src/lib/store/store.ts","../../../../libs/store/src/lib/store/update.ts","../../../../libs/store/src/lib/entity/entity-collection-store.ts","../../../../libs/store/src/lib/store/fn.ts","../../../../libs/store/src/lib/store/get.ts","../../../../libs/store/src/lib/store/patch.ts","../../../../libs/store/src/lib/store/property.ts","../../../../libs/store/src/lib/store/query.ts","../../../../libs/store/src/lib/store/reset.ts","../../../../libs/store/src/lib/store/to.ts","../../../../libs/store/src/lib/store/use-effect.ts","../../../../libs/store/src/ngry-store.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { NextObserver, Observable, Subject } from 'rxjs';\nimport { Action } from './action';\n\n/**\n * Represents an action bus.\n */\n@Injectable({\n  providedIn: 'root',\n})\nexport class Actions\n  extends Observable<Action>\n  implements NextObserver<Action>\n{\n  private readonly actions = new Subject<Action>();\n\n  constructor() {\n    super((subscriber) => this.actions.subscribe(subscriber));\n  }\n\n  next(action: Action) {\n    this.actions.next(action);\n  }\n}\n","import { inject } from '@angular/core';\r\nimport { Actions } from './actions';\r\nimport { DispatchFunction } from './dispatch-function';\r\n\r\n/**\r\n * Creates a function which forwards a given {@link Action}\r\n * to the {@link Actions} bus.\r\n */\r\nexport function useDispatch(): DispatchFunction {\r\n  const actions = inject(Actions);\r\n\r\n  return (action) => actions.next(action);\r\n}\r\n","import { CompareFunction } from '../type/compare-function';\nimport { PredicateFunction } from '../type/predicate-function';\n\n/**\n * Represents an immutable collection of entities.\n */\nexport abstract class EntityCollection<\n  ID,\n  Entity,\n  EntityCollection_ extends EntityCollection<ID, Entity, any>,\n> implements Iterable<Entity>\n{\n  /**\n   * Gets list of entities IDs.\n   */\n  readonly ids: ReadonlyArray<ID>;\n\n  /**\n   * Gets list of entities.\n   */\n  readonly entities: ReadonlyArray<Entity>;\n\n  /**\n   * Gets length of collection.\n   */\n  get length(): number {\n    return this.ids.length;\n  }\n\n  /**\n   * Indicates whether collection is empty or not.\n   */\n  get empty(): boolean {\n    return this.ids.length === 0;\n  }\n\n  /**\n   * Initializes new instance.\n   * @param entities Iterable source of entities\n   */\n  constructor(entities: Iterable<Entity> = []) {\n    const _entities = [...entities].reduce((accumulator, entity) => {\n      const index = this.selectId(entity);\n      const _index = accumulator.findIndex(\n        (_entity) => this.selectId(_entity) === index,\n      );\n\n      if (_index >= 0) {\n        accumulator.splice(_index, 1);\n      }\n\n      accumulator.push(entity);\n\n      return accumulator;\n    }, [] as Array<Entity>);\n\n    this.ids = _entities.map((entity) => this.selectId(entity));\n    this.entities = [..._entities];\n  }\n\n  [Symbol.iterator](): Iterator<Entity> {\n    return this.entities[Symbol.iterator]();\n  }\n\n  /**\n   * Gets an entity by ID.\n   * If no entity with such ID found, returns {@link undefined}.\n   * @param id Entity ID\n   */\n  get(id: ID): Entity | undefined {\n    const idx = this.ids.indexOf(id);\n\n    return this.entities[idx];\n  }\n\n  /**\n   * Determines whether this collection has an entity with such ID.\n   * @param id Entity ID\n   */\n  has(id: ID): boolean {\n    for (const _id of this.ids) {\n      if (this.compareIds(_id, id)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  /**\n   * Determines whether this collection has an entity with the same ID as given one.\n   * @param entity Instance of entity\n   */\n  includes(entity: Entity): boolean {\n    return this.has(this.selectId(entity));\n  }\n\n  /**\n   * Returns new instance of collection with given entity when one didn't include an entity with the same ID.\n   * Returns self when already includes an entity with the same ID.\n   * @param entity Instance of entity\n   */\n  add(entity: Entity): EntityCollection_ {\n    if (this.includes(entity)) {\n      return this as unknown as EntityCollection_;\n    }\n\n    return this.create([...this.entities, entity]);\n  }\n\n  /**\n   * Returns new instance of collection with given entities when one didn't include any entity with the same ID.\n   * Returns self when already includes all entities with the same ID.\n   * @param entities Iterable source of entities\n   */\n  addMany(entities: Iterable<Entity>): EntityCollection_ {\n    let collection: EntityCollection_ = this as unknown as EntityCollection_;\n\n    for (const entity of entities) {\n      collection = collection.add(entity);\n    }\n\n    return collection;\n  }\n\n  /**\n   * Returns new instance of collection with given entity instead of one with the same ID.\n   * Returns self when collection doesn't include an entity with the same ID.\n   * @param entity Instance of entity\n   */\n  update(entity: Entity): EntityCollection_ {\n    const index = this.entities.findIndex((_entity) =>\n      this.compareIds(this.selectId(entity), this.selectId(_entity)),\n    );\n\n    if (index >= 0) {\n      const entities = [...this.entities];\n\n      entities[index] = entity;\n\n      return this.create(entities);\n    }\n\n    return this as unknown as EntityCollection_;\n  }\n\n  /**\n   * Returns new instance of collection with given entities instead of ones with the same ID.\n   * Returns self when collection doesn't include any entity with the same ID.\n   * @param entities Iterable source of entities\n   */\n  updateMany(entities: Iterable<Entity>): EntityCollection_ {\n    let collection = this as unknown as EntityCollection_;\n\n    for (const entity of entities) {\n      collection = collection.update(entity);\n    }\n\n    return collection;\n  }\n\n  /**\n   * Returns new instance of collection with given entity.\n   * When collection already includes an entity with the same ID, it will be replaced.\n   * When collection doesn't include an entity with the same ID, it will be added.\n   * @param entity Instance of entity\n   */\n  set(entity: Entity): EntityCollection_ {\n    if (this.includes(entity)) {\n      return this.update(entity);\n    } else {\n      return this.add(entity);\n    }\n  }\n\n  /**\n   * Returns new instance of collection with given entities.\n   * When collection already includes an entity with the same ID, it will be replaced.\n   * When collection doesn't include an entity with the same ID, it will be added.\n   * @param entities Iterable source of entities\n   */\n  setMany(entities: Iterable<Entity>): EntityCollection_ {\n    let collection: EntityCollection_ = this as unknown as EntityCollection_;\n\n    for (const entity of entities) {\n      collection = collection.set(entity);\n    }\n\n    return collection;\n  }\n\n  /**\n   * Returns new collection without entity with given ID when collection includes one.\n   * Returns self when doesn't include an entity with given ID.\n   * @param id Entity ID\n   */\n  delete(id: ID): EntityCollection_ {\n    if (this.has(id)) {\n      return this.create(\n        this.entities.filter((entity) => this.selectId(entity) !== id),\n      );\n    } else {\n      return this as unknown as EntityCollection_;\n    }\n  }\n\n  /**\n   * Returns new collection without entities with given IDs when collection includes any.\n   * Returns self when doesn't include any entities with given IDs.\n   * @param ids Entities IDs\n   */\n  deleteMany(ids: Iterable<ID>): EntityCollection_ {\n    const entities = this.entities.filter((entity) => {\n      const entityId = this.selectId(entity);\n\n      for (const id of ids) {\n        if (this.compareIds(id, entityId)) {\n          return false;\n        }\n      }\n\n      return true;\n    });\n\n    if (this.entities.length === entities.length) {\n      return this as unknown as EntityCollection_;\n    } else {\n      return this.create(entities);\n    }\n  }\n\n  /**\n   * Returns new collection without entity with the same ID when collection includes one.\n   * Returns self when doesn't include an entity with the same ID.\n   * @param sample Instance of entity\n   */\n  remove(sample: Entity): EntityCollection_ {\n    const id: ID = this.selectId(sample);\n\n    return this.delete(id);\n  }\n\n  /**\n   * Returns new collection without entities with same IDs when collection includes any.\n   * Returns self when doesn't include any entities with the same IDs.\n   * @param samples Iterable source of entities\n   */\n  removeMany(samples: Iterable<Entity>): EntityCollection_ {\n    const ids: Set<ID> = new Set<ID>();\n\n    for (const entity of samples) {\n      ids.add(this.selectId(entity));\n    }\n\n    return this.deleteMany(ids);\n  }\n\n  /**\n   * Returns an empty collection when not empty itself.\n   * Returns self when already empty.\n   */\n  clear(): EntityCollection_ {\n    if (this.empty) {\n      return this as unknown as EntityCollection_;\n    }\n\n    return this.create([]);\n  }\n\n  /**\n   * Returns new collection with entities matching predicate when predicate didn't match all entities.\n   * Returns self when predicate matches all entities.\n   */\n  filter(predicate: PredicateFunction<Entity>): EntityCollection_ {\n    const length = this.entities.length;\n    const entities = this.entities.filter((entity) => predicate(entity));\n\n    if (entities.length === length) {\n      return this as unknown as EntityCollection_;\n    }\n\n    return this.create(entities);\n  }\n\n  /**\n   * Returns sorted collection when entities order has changed.\n   * Returns self when entities order hasn't changed.\n   * @param compare Entity comparison function\n   */\n  sort(compare: CompareFunction<Entity>): EntityCollection_ {\n    const entities = [...this.entities].sort(compare);\n\n    for (let i = 0; i < entities.length; i++) {\n      const aId = this.selectId(entities[i]);\n      const bId = this.selectId(this.entities[i]);\n\n      if (!this.compareIds(aId, bId)) {\n        return this.create(entities);\n      }\n    }\n\n    return this as unknown as EntityCollection_;\n  }\n\n  /**\n   * Returns an array representation of this collection.\n   */\n  toArray(): Array<Entity> {\n    return [...this.entities];\n  }\n\n  /**\n   * Create new instance of collection.\n   * @param entities Iterable source of entities\n   */\n  protected abstract create(entities: Iterable<Entity>): EntityCollection_;\n\n  /**\n   * Returns an ID of given entity.\n   * @param entity Instance of entity\n   */\n  protected abstract selectId(entity: Entity): ID;\n\n  /**\n   * Compares entities IDs for equality.\n   * @param a ID of left entity\n   * @param b ID of right entity\n   */\n  protected abstract compareIds(a: ID, b: ID): boolean;\n}\n","/**\n * @internal\n */\nexport function getKeys<T extends object>(object: T): ReadonlyArray<keyof T> {\n  return Object.keys(object) as unknown as ReadonlyArray<keyof T>;\n}\n","import { getKeys } from './get-keys';\n\n/**\n * @internal\n */\nexport function isEqual<T = unknown>(a: T, b: T): boolean {\n  const aType = typeof a;\n  const bType = typeof b;\n\n  if (aType !== bType) {\n    return false;\n  }\n\n  if (aType === 'object') {\n    if (Array.isArray(a) && Array.isArray(b)) {\n      return isEqualArrays(a, b);\n    }\n\n    if (isMap(a) && isMap(b)) {\n      return isEqualMaps(a, b);\n    }\n\n    if (isSet(a) && isSet(b)) {\n      return isEqualSets(a, b);\n    }\n\n    if (isDate(a) && isDate(b)) {\n      return isEqualDates(a, b);\n    }\n\n    if (isObject(a) && isObject(b)) {\n      return isEqualObjects(a, b);\n    }\n  }\n\n  return a === b;\n}\n\n//#region arrays\n\nfunction isEqualArrays<T>(a: ReadonlyArray<T>, b: ReadonlyArray<T>): boolean {\n  if (a.length !== b.length) {\n    return false;\n  }\n\n  for (let i = 0; i < a.length; i++) {\n    if (!isEqual(a[i], b[i])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n//#endregion\n\n//#region dates\n\nfunction isDate(value: unknown): value is Date {\n  return value instanceof Date;\n}\n\nfunction isEqualDates(a: Date, b: Date): boolean {\n  return a.getTime() === b.getTime();\n}\n\n//#endregion\n\n//#region maps\n\nfunction isMap(value: unknown): value is Map<unknown, unknown> {\n  return value instanceof Map;\n}\n\nfunction isEqualMaps<K, V>(a: Map<K, V>, b: Map<K, V>): boolean {\n  if (a.size !== b.size) {\n    return false;\n  }\n\n  for (const [key, value] of a) {\n    if (b.get(key) !== value) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n//#endregion\n\n//#region sets\n\nfunction isSet(value: unknown): value is Set<unknown> {\n  return value instanceof Set;\n}\n\nfunction isEqualSets<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): boolean {\n  if (a.size !== b.size) {\n    return false;\n  }\n\n  for (const value of a) {\n    if (!b.has(value)) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n//#endregion\n\n//#region objects\n\nfunction isObject(value: unknown): value is object {\n  return typeof value === 'object' && value != null;\n}\n\nfunction isEqualObjects<T extends object>(a: T, b: T): boolean {\n  if (a.constructor !== b.constructor) {\n    return false;\n  }\n\n  const aKeys = getKeys(a);\n  const bKeys = getKeys(b);\n\n  if (!isEqualArrays(aKeys, bKeys)) {\n    return false;\n  }\n\n  if (aKeys.length === 0) {\n    return true;\n  }\n\n  return aKeys.every((key) => isEqual(a[key], b[key]));\n}\n\n//#endregion\n","import { Observable, OperatorFunction } from 'rxjs';\nimport { distinctUntilChanged, shareReplay } from 'rxjs/operators';\nimport { isEqual } from './is-equal';\n\n/**\n * @internal\n */\nexport function optimize<T>(): OperatorFunction<T, T> {\n  return (source: Observable<T>): Observable<T> =>\n    source.pipe(\n      distinctUntilChanged(isEqual),\n      shareReplay({\n        refCount: true,\n        bufferSize: 1,\n      }),\n    );\n}\n","import { OperatorFunction } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { optimize } from '../util/optimize';\nimport { Selector } from './selector';\n\n/**\n * Selects a value from the state.\n * Emits only distinct values performing deep change detection.\n *\n * **Usage example**\n *\n * ```ts\n * readonly complete$ = this.store.pipe(\n *   select(state => state.isComplete()),\n * );\n * ```\n */\nexport function select<State, Result>(\n  selector: Selector<State, Result>,\n): OperatorFunction<State, Result> {\n  return (input) => input.pipe(map(selector), optimize());\n}\n","import { Inject, Injectable, InjectionToken, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { optimize } from '../util/optimize';\n\nexport const INITIAL_STATE = new InjectionToken('INITIAL_STATE');\n\n/**\n * Represents a basic store implementation.\n */\n@Injectable()\nexport class Store<State> extends Observable<State> implements OnDestroy {\n  private readonly destroy$$ = new Subject<void>();\n  private readonly state$$ = new BehaviorSubject<State>(this.initial);\n\n  readonly destroy$ = this.destroy$$.asObservable();\n\n  get snapshot(): State {\n    return this.state$$.value;\n  }\n\n  constructor(@Inject(INITIAL_STATE) readonly initial: State) {\n    super((subscriber) => state$.subscribe(subscriber));\n\n    const state$ = this.state$$.pipe(optimize());\n  }\n\n  next(state: State) {\n    this.state$$.next(state);\n  }\n\n  ngOnDestroy() {\n    this.state$$.complete();\n\n    this.destroy$$.next();\n    this.destroy$$.complete();\n  }\n}\n","import { Delegate } from '../type/delegate';\nimport { Store } from './store';\n\n/**\n * Creates a state update function which, once called,\n * replaces store's state with a new value.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, update } from '@ngry/store';\n * import { User } from './user';\n *\n * @Injectable()\n * class UserStore extends Store<User> {\n *   readonly rename = update(\n *     this,\n *     (user: User, firstName: string, lastName: string): User => {\n *       return {\n *         ...user,\n *         displayName: `${firstName} ${lastName}`,\n *         firstName,\n *         lastName,\n *       };\n *     },\n *   );\n *\n *   readonly changeEmail = update(\n *     this,\n *     (user: User, email: string): User => {\n *       return {\n *         ...user,\n *         email,\n *         emailVerified: user.email === email ? user.emailVerified : false,\n *       };\n *     },\n *   );\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { UserStore } from './user.store';\n *\n * @Component()\n * class UserComponent {\n *   constructor(private readonly store: UserStore) {\n *   }\n *\n *   rename(firstName: string, lastName: string) {\n *     this.store.rename(firstName, lastName);\n *   }\n *\n *   changeEmail(email: string) {\n *     this.store.changeEmail(email);\n *   }\n * }\n * ```\n */\nexport function update<State>(\n  store: Store<State>,\n): Delegate<[state: State], void>;\n\n/**\n * Creates a state update function which, once called, replaces store's state with a new value.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, update } from '@ngry/store';\n * import { User } from './user';\n *\n * @Injectable()\n * class UserStore extends Store<User> {\n *   readonly rename = update(\n *     this,\n *     (user: User, firstName: string, lastName: string): User => {\n *       return {\n *         ...user,\n *         displayName: `${firstName} ${lastName}`,\n *         firstName,\n *         lastName,\n *       };\n *     },\n *   );\n *\n *   readonly changeEmail = update(\n *     this,\n *     (user: User, email: string): User => {\n *       return {\n *         ...user,\n *         email,\n *         emailVerified: user.email === email ? user.emailVerified : false,\n *       };\n *     },\n *   );\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { UserStore } from './user.store';\n *\n * @Component()\n * class UserComponent {\n *   constructor(private readonly store: UserStore) {\n *   }\n *\n *   rename(firstName: string, lastName: string) {\n *     this.store.rename(firstName, lastName);\n *   }\n *\n *   changeEmail(email: string) {\n *     this.store.changeEmail(email);\n *   }\n * }\n * ```\n */\nexport function update<State, Args extends readonly unknown[]>(\n  store: Store<State>,\n  delegate: Delegate<[State, ...Args], State>,\n): Delegate<Args, void>;\n\nexport function update<State, Args extends readonly unknown[]>(\n  store: Store<State>,\n  delegate?: Delegate<[State, ...Args], State>,\n): Delegate<Args, void> {\n  return (...args: Args) => {\n    store.next(\n      delegate ? delegate(store.snapshot, ...args) : (args[0] as State),\n    );\n  };\n}\n","import { Observable } from 'rxjs';\nimport { select } from '../store/select';\nimport { Store } from '../store/store';\nimport { update } from '../store/update';\nimport { CompareFunction } from '../type/compare-function';\nimport { PredicateFunction } from '../type/predicate-function';\nimport { EntityCollection } from './entity-collection';\n\n/**\n * Represents a store of {@link EntityCollection}.\n */\nexport class EntityCollectionStore<\n  ID,\n  Entity,\n  EntityCollection_ extends EntityCollection<ID, Entity, any>,\n> extends Store<EntityCollection_> {\n  /**\n   * Gets stream of entities IDs.\n   */\n  readonly ids$: Observable<ReadonlyArray<ID>>;\n\n  /**\n   * Gets stream of entities.\n   */\n  readonly entities$: Observable<ReadonlyArray<Entity>>;\n\n  /**\n   * Gets stream of entities count.\n   */\n  readonly length$: Observable<number>;\n\n  /**\n   * Gets stream of empty state changes.\n   */\n  readonly empty$: Observable<boolean>;\n\n  constructor(initial: EntityCollection_) {\n    super(initial);\n\n    this.ids$ = this.pipe(select((collection) => collection.ids));\n    this.entities$ = this.pipe(select((collection) => collection.entities));\n    this.length$ = this.pipe(select((collection) => collection.length));\n    this.empty$ = this.pipe(select((collection) => collection.empty));\n  }\n\n  /**\n   * Emits new instance of collection with given entity when one didn't include an entity with the same ID.\n   * @param entity Instance of entity\n   */\n  readonly add = update(this, (collection: EntityCollection_, entity: Entity) =>\n    collection.add(entity),\n  );\n\n  /**\n   * Emits new instance of collection with given entities when one didn't include any entity with the same ID.\n   * @param entities Iterable source of entities\n   */\n  readonly addMany = update(\n    this,\n    (collection: EntityCollection_, entities: Iterable<Entity>) =>\n      collection.addMany(entities),\n  );\n\n  /**\n   * Emits new instance of collection with given entity instead of one with the same ID.\n   * @param entity Instance of entity\n   */\n  readonly update = update(\n    this,\n    (collection: EntityCollection_, entity: Entity) =>\n      collection.update(entity),\n  );\n\n  /**\n   * Emits new instance of collection with given entities instead of ones with the same ID.\n   * @param entities Iterable source of entities\n   */\n  readonly updateMany = update(\n    this,\n    (collection: EntityCollection_, entities: Iterable<Entity>) =>\n      collection.updateMany(entities),\n  );\n\n  /**\n   * Emits new instance of collection with given entity.\n   * When collection already includes an entity with the same ID, it will be replaced.\n   * When collection doesn't include an entity with the same ID, it will be added.\n   * @param entity Instance of entity\n   */\n  readonly set = update(this, (collection: EntityCollection_, entity: Entity) =>\n    collection.set(entity),\n  );\n\n  /**\n   * Emits new instance of collection with given entities.\n   * When collection already includes an entity with the same ID, it will be replaced.\n   * When collection doesn't include an entity with the same ID, it will be added.\n   * @param entities Iterable source of entities\n   */\n  readonly setMany = update(\n    this,\n    (collection: EntityCollection_, entities: Iterable<Entity>) =>\n      collection.setMany(entities),\n  );\n\n  /**\n   * Emits new collection without entity with given ID when collection includes one.\n   * @param id Entity ID\n   */\n  readonly delete = update(this, (collection: EntityCollection_, id: ID) =>\n    collection.delete(id),\n  );\n\n  /**\n   * Emits new collection without entities with given IDs when collection includes any.\n   * @param ids Entities IDs\n   */\n  readonly deleteMany = update(\n    this,\n    (collection: EntityCollection_, ids: Iterable<ID>) =>\n      collection.deleteMany(ids),\n  );\n\n  /**\n   * Emits new collection without entity with the same ID when collection includes one.\n   * @param sample Instance of entity\n   */\n  readonly remove = update(\n    this,\n    (collection: EntityCollection_, sample: Entity) =>\n      collection.remove(sample),\n  );\n\n  /**\n   * Emits new collection without entities with same IDs when collection includes any.\n   * @param entities Iterable source of entities\n   */\n  readonly removeMany = update(\n    this,\n    (collection: EntityCollection_, entities: Iterable<Entity>) =>\n      collection.removeMany(entities),\n  );\n\n  /**\n   * Emits an empty collection when not empty itself.\n   */\n  readonly clear = update(this, (collection: EntityCollection_) =>\n    collection.clear(),\n  );\n\n  /**\n   * Emits new collection with entities matching predicate when predicate didn't match all entities.\n   */\n  readonly filter = update(\n    this,\n    (collection: EntityCollection_, predicate: PredicateFunction<Entity>) =>\n      collection.filter(predicate),\n  );\n\n  /**\n   * Emits sorted collection when entities order has changed.\n   * @param compare Entity comparison function\n   */\n  readonly sort = update(\n    this,\n    (collection: EntityCollection_, compare: CompareFunction<Entity>) =>\n      collection.sort(compare),\n  );\n}\n","import { Observable, Subject } from 'rxjs';\nimport { Delegate } from '../type/delegate';\n\n/**\n * Creates a function which, once called, executes a reactive pipeline with side effects;\n * its arguments are being pushed to this pipeline as a tuple.\n *\n * **Usage example**\n *\n * Declare a side effects function within your custom store:\n *\n * ```ts\n * import { Injectable, Input, OnInit } from '@angular/core';\n * import { Store, fn, update } from '@ngry/store';\n * import { TaskState, toTask } from '@ngry/rx';\n * import { switchMap, tap } from 'rxjs/operators'\n * import { AccountService } from './account.service';\n * import { Account } from './account';\n *\n * @Injectable()\n * class AccountStore extends Store<TaskState<Account>> {\n *   constructor(private readonly accounts: AccountService) {\n *     super(TaskState.initial());\n *   }\n *\n *   readonly load = fn<[id: string]>((args$) =>\n *     args$.pipe(\n *       switchMap(([id]) => this.accounts.get(id).pipe(toTask())),\n *       tap(update(this)),\n *     ),\n *   );\n * }\n * ```\n *\n * Call the side effects function:\n *\n * ```ts\n * import { Component, Input, OnInit } from '@angular/core';\n * import { AccountStore } from './account.store';\n *\n * @Component()\n * class AccountComponent implements OnInit {\n *   @Input()\n *   id: string;\n *\n *   constructor(private readonly store: AccountStore) {\n *   }\n *\n *   ngOnInit() {\n *     this.store.load(this.id);\n *   }\n * }\n * ```\n */\nexport function fn<Args extends readonly unknown[] = []>(\n  init: (args$: Observable<Args>) => Observable<unknown>,\n): Delegate<Args, void> {\n  const args$ = new Subject<Args>();\n\n  init(args$).subscribe();\n\n  return (...args: Args) => {\n    args$.next(args);\n  };\n}\n","import { Delegate } from '../type/delegate';\nimport { Store } from './store';\n\n/**\n * Creates a getter function which, once called, returns a value of the given\n * state's property.\n *\n * **Usage example**\n *\n * Declare a getter function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { TaskState } from '@ngry/rx';\n * import { get, Store } from '@ngry/store';\n * import { User } from './user';\n *\n * @Injectable()\n * class UserStore extends Store<TaskState<User>> {\n *   constructor() {\n *     super(TaskState.initial());\n *   }\n *\n *   readonly getResult = get(this, 'result');\n * }\n * ```\n *\n * Call the getter function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { UserStore } from './user.store'\n *\n * @Component()\n * class UserComponent {\n *   constructor(private readonly store: UserStore) {\n *   }\n *\n *   deleteAccount() {\n *     const user = this.store.getResult();\n *     // do smth with user\n *   }\n * }\n * ```\n */\nexport function get<State extends object, Property extends keyof State>(\n  store: Store<State>,\n  property: Property,\n): Delegate<[], State[Property]> {\n  return () => store.snapshot[property];\n}\n","import { Delegate } from '../type/delegate';\n\n/**\n * Allows update delegate to return a partial state.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { patch, Store, update } from '@ngry/store';\n * import { Person } from './person';\n *\n * @Injectable()\n *\n * class PersonStore extends Store<Person> {\n *   constructor() {\n *     super({\n *       name: null,\n *       likes: null,\n *       address: {\n *         country: null,\n *         region: null,\n *         city: null,\n *         street: null,\n *         number: null,\n *       },\n *       tags: [],\n *     });\n *   }\n *\n *   readonly updateAddress = update(this, property('address', patch()));\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { PersonStore } from './person.store';\n *\n * @Component()\n * class PersonComponent {\n *   constructor(private readonly store: PersonStore) {\n *   }\n *\n *   setCity(city: string) {\n *     this.store.updateAddress({ city });\n *   }\n * }\n * ```\n */\nexport function patch<State extends object>(): Delegate<\n  [state: State, partial: Partial<State>],\n  State\n>;\n\n/**\n * Allows update delegate to return a partial state.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { patch, Store, update } from '@ngry/store';\n * import { User } from './user';\n *\n * @Injectable()\n * class UserStore extends Store<User> {\n *   readonly rename = update(\n *     this,\n *     patch((_: User, firstName: string, lastName: string): Partial<User> => {\n *       return {\n *         displayName: `${firstName} ${lastName}`,\n *         firstName,\n *         lastName,\n *       };\n *     }),\n *   );\n *\n *   readonly changeEmail = update(\n *     this,\n *     patch((user: User, email: string): Partial<User> => {\n *       return {\n *         email,\n *         emailVerified: user.email === email ? user.emailVerified : false,\n *       };\n *     }),\n *   );\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { UserStore } from './user.store';\n *\n * @Component()\n * class UserComponent {\n *   constructor(private readonly store: UserStore) {\n *   }\n *\n *   rename(firstName: string, lastName: string) {\n *     this.store.rename(firstName, lastName);\n *   }\n *\n *   changeEmail(email: string) {\n *     this.store.changeEmail(email);\n *   }\n * }\n * ```\n */\nexport function patch<State extends object, Args extends readonly unknown[]>(\n  delegate: Delegate<[State, ...Args], Partial<State>>,\n): Delegate<[State, ...Args], State>;\n\nexport function patch<State extends object, Args extends readonly unknown[]>(\n  delegate?: Delegate<[State, ...Args], Partial<State>>,\n): Delegate<[State, ...Args], State> {\n  return (state: State, ...args: Args): State => ({\n    ...state,\n    ...(delegate ? delegate(state, ...args) : (args[0] as Partial<State>)),\n  });\n}\n","import { Delegate } from '../type/delegate';\n\n/**\n * Limits an update to a specific state property.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, property, update } from '@ngry/store';\n *\n * @Injectable()\n * class PersonStore extends Store<Person> {\n *   readonly rename = update(this, property('name'));\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { PersonStore } from './person.store';\n *\n * @Component()\n * class PersonComponent {\n *   constructor(private readonly store: PersonStore) {\n *   }\n *\n *   onNameChange(name: string) {\n *     this.store.rename(name);\n *   }\n * }\n * ```\n *\n * It can be nested to limit update on even more nested property.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, property, update } from '@ngry/store';\n *\n * @Injectable()\n * class OfficeStore extends Store<Office> {\n *   readonly setCity = update(this, property('address', property('city')));\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { GeoData } from 'geo-lib';\n * import { OfficeStore } from './office.store';\n *\n * @Component()\n * class OfficeComponent {\n *   constructor(private readonly store: OfficeStore) {\n *   }\n *\n *   onLocationChange(data: GeoData) {\n *     this.store.setCity(data.address.city);\n *   }\n * }\n * ```\n *\n * It can be customized to provide a different update logic for property.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, property, update } from '@ngry/store';\n * import { Article } from './article';\n *\n * @Injectable()\n * class ArticleStore extends Store<Article> {\n *   readonly clap = update(this, property('claps', claps => claps + 1));\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { ArticleStore } from './article.store';\n *\n * @Component()\n * class ArticleComponent {\n *   constructor(private readonly store: ArticleStore) {\n *   }\n *\n *   clap() {\n *     this.store.clap();\n *   }\n * }\n * ```\n */\nexport function property<State extends object, Property extends keyof State>(\n  property: Property,\n): Delegate<[state: State, value: State[Property]], State>;\n\n/**\n * Limits an update to a specific state property.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, property, update } from '@ngry/store';\n *\n * @Injectable()\n * class PersonStore extends Store<Person> {\n *   readonly rename = update(this, property('name'));\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { PersonStore } from './person.store';\n *\n * @Component()\n * class PersonComponent {\n *   constructor(private readonly store: PersonStore) {\n *   }\n *\n *   onNameChange(name: string) {\n *     this.store.rename(name);\n *   }\n * }\n * ```\n *\n * It can be nested to limit update on even more nested property.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, property, update } from '@ngry/store';\n *\n * @Injectable()\n * class OfficeStore extends Store<Office> {\n *   readonly setCity = update(this, property('address', property('city')));\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { GeoData } from 'geo-lib';\n * import { OfficeStore } from './office.store';\n *\n * @Component()\n * class OfficeComponent {\n *   constructor(private readonly store: OfficeStore) {\n *   }\n *\n *   onLocationChange(data: GeoData) {\n *     this.store.setCity(data.address.city);\n *   }\n * }\n * ```\n *\n * It can be customized to provide a different update logic for property.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, property, update } from '@ngry/store';\n * import { Article } from './article';\n *\n * @Injectable()\n * class ArticleStore extends Store<Article> {\n *   readonly clap = update(this, property('claps', claps => claps + 1));\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { ArticleStore } from './article.store';\n *\n * @Component()\n * class ArticleComponent {\n *   constructor(private readonly store: ArticleStore) {\n *   }\n *\n *   clap() {\n *     this.store.clap();\n *   }\n * }\n * ```\n */\nexport function property<\n  State extends object,\n  Property extends keyof State,\n  Args extends readonly unknown[] = [],\n>(\n  property: Property,\n  delegate: Delegate<[State[Property], ...Args], State[Property]>,\n): Delegate<[State, ...Args], State>;\n\nexport function property<\n  State extends object,\n  Property extends keyof State,\n  Args extends readonly unknown[] = [],\n>(\n  property: Property,\n  delegate?: Delegate<[State[Property], ...Args], State[Property]>,\n): Delegate<[State, ...Args], State> {\n  return (state: State, ...args: Args): State => ({\n    ...state,\n    [property]: delegate ? delegate(state[property], ...args) : args[0],\n  });\n}\n","import { Observable } from 'rxjs';\nimport { Delegate } from '../type/delegate';\nimport { select } from './select';\nimport { Selector } from './selector';\nimport { Store } from './store';\n\n/**\n * Creates a function which, once called, returns a stream of selected distinct\n * values. Function may have any number of arguments to customize the query.\n *\n * **Usage example**\n *\n * Declare a query function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, query } from '@ngry/store';\n *\n * @Injectable()\n * class TagsStore extends Store<readonly string[]> {\n *   constructor() {\n *     super([]);\n *   }\n *\n *   readonly findCompositeTags = query(this, (tags, separator: string) =>\n *     tags.filter((tag) => tag.includes(separator)),\n *   );\n * }\n * ```\n *\n * Call the query function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { TagsStore } from './tags.store';\n *\n * @Component()\n * class TagsComponent {\n *   readonly compositeTags$ = this.store.findCompositeTags(':');\n *\n *   constructor(private readonly store: TagsStore) {\n *   }\n * }\n * ```\n */\nexport function query<State, Result, Args extends readonly unknown[] = []>(\n  store: Store<State>,\n  selector: Selector<State, Result, Args>,\n): Delegate<Args, Observable<Result>> {\n  return (...args: Args): Observable<Result> => {\n    return store.pipe(select((state) => selector(state, ...args)));\n  };\n}\n","import { Delegate } from '../type/delegate';\nimport { Store } from './store';\n\n/**\n * Creates a reset function which, once called, sets the store's state to its\n * initial value.\n *\n * **Usage example**\n *\n * Declare a reset function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, reset } from '@ngry/store';\n *\n * @Injectable()\n * class CounterStore extends Store<number> {\n *   constructor() {\n *     super(0);\n *   }\n *\n *   readonly reset = reset(this);\n * }\n * ```\n *\n * Call the reset function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { CounterStore } from './counter.store'\n *\n * @Component()\n * class CounterComponent {\n *   constructor(private readonly store: CounterStore) {\n *   }\n *\n *   reset() {\n *     this.store.reset();\n *   }\n * }\n * ```\n */\nexport function reset<State>(store: Store<State>): Delegate<[], void> {\n  return () => store.next(store.initial);\n}\n","import { Delegate } from '../type/delegate';\n\n/**\n * Replaces the whole state with a provided one.\n *\n * **Usage example**\n *\n * Create an updater function within your custom store:\n *\n * ```ts\n * import { Injectable } from '@angular/core';\n * import { Store, update, to } from '@ngry/store';\n *\n * @Injectable()\n * class CounterStore extends Store<number> {\n *   readonly reset = update(this, to(this.initial));\n * }\n * ```\n *\n * Call the updater function:\n *\n * ```ts\n * import { Component } from '@angular/core';\n * import { CounterStore } from './counter.store';\n *\n * @Component()\n * class CounterComponent {\n *   constructor(private readonly store: CounterStore) {\n *   }\n *\n *   reset() {\n *     this.store.reset();\n *   }\n * }\n * ```\n */\nexport function to<State>(state: State): Delegate<[], State> {\n  return () => state;\n}\n","import { asapScheduler, Observable, scheduled } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { Delegate } from '../type/delegate';\nimport { Store } from './store';\n\n/**\n * Declares a reactive pipeline triggered asynchronously by state changes.\n *\n * > ⚠️This API is experimental and can be changed or removed.\n *\n * **Usage example**\n *\n * Declare effect within the component store:\n *\n * ```ts\n * interface UserEntity {\n *   readonly id: number;\n *   readonly name: string;\n * }\n *\n * interface UserState {\n *   readonly id?: number;\n *   readonly data: TaskState<UserEntity>;\n * }\n *\n * @Component()\n * class UserComponent extends ComponentStore<UserState> {\n *   constructor(route: ActivatedRoute, userService: UserService) {\n *     super({\n *       data: TaskState.initial(),\n *     });\n *\n *     useEffect(this, () =>\n *       route.queryParamMap.pipe(\n *         select((params) => params.get('id')),\n *         filter(isDefined),\n *         map((id) => parseInt(id)),\n *         tap(update(this, property('id'))),\n *       ),\n *     );\n *\n *     useEffect(this, (state$) =>\n *       state$.pipe(\n *         select(({ id }) => id),\n *         filter(isDefined),\n *         switchMap((id) =>\n *           userService.get(id).pipe(\n *             toTask(),\n *             tap(update(this, property('data'))),\n *           ),\n *         ),\n *       ),\n *     );\n *   }\n * }\n * ```\n */\nexport function useEffect<State>(\n  store: Store<State>,\n  init: Delegate<[state$: Observable<State>], Observable<unknown>>,\n) {\n  return init(scheduled(store, asapScheduler))\n    .pipe(takeUntil(store.destroy$))\n    .subscribe();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;AAEG;AAIG,MAAO,OACX,SAAQ,UAAkB,CAAA;AAK1B,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;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