@daffodil/core 0.53.1 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core.mjs","sources":["../../../libs/core/src/utils/long-arithmetic.ts","../../../libs/core/src/utils/range.ts","../../../libs/core/src/utils/shallow-compare.ts","../../../libs/core/src/utils/shuffle.ts","../../../libs/core/src/utils/random-subset.ts","../../../libs/core/src/utils/random-slice.ts","../../../libs/core/src/utils/array-to-dict.ts","../../../libs/core/src/utils/sample.ts","../../../libs/core/src/utils/unique.ts","../../../libs/core/src/errors/inheritable-error.ts","../../../libs/core/src/errors/is-error.ts","../../../libs/core/src/storage/error/error.ts","../../../libs/core/src/storage/error/error.service.ts","../../../libs/core/src/storage/server-error/server-error.ts","../../../libs/core/src/storage/server-error/server-error.service.ts","../../../libs/core/src/storage/localstorage/localstorage.service.ts","../../../libs/core/src/storage/noopstorage/noopstorage.service.ts","../../../libs/core/src/storage/persistence.interface.ts","../../../libs/core/src/storage/persistence-server-safe.token.ts","../../../libs/core/src/operators/backoff.pipe.ts","../../../libs/core/src/base64/server/server.service.ts","../../../libs/core/src/base64/browser/browser.service.ts","../../../libs/core/src/base64/base64.interface.ts","../../../libs/core/src/collection/sortable.ts","../../../libs/core/src/collection/page-out-of-bounds.error.ts","../../../libs/core/src/collection/error-map.ts","../../../libs/core/src/collection/build-metadata.ts","../../../libs/core/src/filterable/type/filter-type.ts","../../../libs/core/src/filterable/type/range/separator.ts","../../../libs/core/src/filters/errors/codes.enum.ts","../../../libs/core/src/filters/errors/unknown-filter-type.error.ts","../../../libs/core/src/filters/type/equal/behaviors/apply/apply.ts","../../../libs/core/src/filters/type/range/compute-pair-label.ts","../../../libs/core/src/filters/type/range/behaviors/apply/apply.ts","../../../libs/core/src/filters/errors/filter-not-found.error.ts","../../../libs/core/src/filters/errors/request-name-mismatch.error.ts","../../../libs/core/src/filters/validators/request-name-match.ts","../../../libs/core/src/filters/errors/request-type-mismatch.error.ts","../../../libs/core/src/filters/validators/request-type-match.ts","../../../libs/core/src/filters/behaviors/apply/apply-filter.ts","../../../libs/core/src/filters/behaviors/apply/apply-request-to-filters.ts","../../../libs/core/src/filters/behaviors/apply/apply-requests-to-filters.ts","../../../libs/core/src/filters/type/equal/behaviors/clear/clear.ts","../../../libs/core/src/filters/type/range/behaviors/clear/clear.ts","../../../libs/core/src/filters/behaviors/clear/clear-filter.ts","../../../libs/core/src/filters/behaviors/clear/clear-filters.ts","../../../libs/core/src/filters/type/equal/behaviors/remove/remove.ts","../../../libs/core/src/filters/type/range/behaviors/remove/remove.ts","../../../libs/core/src/filters/behaviors/remove/remove-filter.ts","../../../libs/core/src/filters/behaviors/remove/remove-request-from-filters.ts","../../../libs/core/src/filters/behaviors/remove/remove-requests-from-filters.ts","../../../libs/core/src/filters/type/equal/behaviors/toggle/toggle.ts","../../../libs/core/src/filters/type/range/behaviors/toggle/toggle.ts","../../../libs/core/src/filters/behaviors/toggle/toggle.ts","../../../libs/core/src/filters/behaviors/toggle/toggle-request-on-filters.ts","../../../libs/core/src/filters/type/equal/is-applied/is-applied.ts","../../../libs/core/src/filters/type/range/is-applied/is-applied.ts","../../../libs/core/src/filters/is-applied/is-filter-applied.ts","../../../libs/core/src/filters/type/equal/is-applied/is-toggle-request-applied-to-filter.ts","../../../libs/core/src/filters/type/range/is-applied/is-toggle-request-applied-to-filter.ts","../../../libs/core/src/filters/is-applied/is-toggle-request-applied-to-filter.ts","../../../libs/core/src/filters/find-applied/find-applied-options.ts","../../../libs/core/src/filters/type/equal/to-request/filter-to-request.ts","../../../libs/core/src/filters/type/range/to-request/filter-to-request.ts","../../../libs/core/src/filters/type/range-numeric/to-request/filter-to-request.ts","../../../libs/core/src/filters/to-request/filter-to-request.ts","../../../libs/core/src/filters/to-request/filters-to-requests.ts","../../../libs/core/src/filters/type/range/array-to-dict/pair.ts","../../../libs/core/src/filters/type/equal/array-to-dict/option.ts","../../../libs/core/src/filters/array-to-dict/array-to-dict.ts","../../../libs/core/src/filters/compute-applied-filters/compute-applied-filters.ts","../../../libs/core/src/collection/build-request.ts","../../../libs/core/src/identifiable/array-to-dict.ts","../../../libs/core/src/daffodil-core.ts"],"sourcesContent":["/**\n * A helper function to get the number of decimal significant figures of a number.\n * This function will fail if the given number has more than 16 significant figures or\n * the value of the number is greater than 10^11\n *\n * @param number\n */\nfunction daffPrecision(number: number): number {\n let p = 10000;\n if(number === undefined || number === null) {\n return p;\n }\n while (Math.round(number * p) / p !== number) {\n p *= 10;\n }\n return p;\n}\n\n/**\n * A function to add long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are less than\n * 16 significant figures and less than 10^11\n *\n * @param numbers\n */\nexport function daffAdd(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffAdd.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.reduce((acc, number) => acc + Math.round(number*precision), 0) / precision;\n}\n\n/**\n * A function to subtract long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than\n * 16 significant figures and less than 10^11\n *\n * @param numbers\n */\nexport function daffSubtract(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffSubtract.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.slice(1).reduce(\n (acc, number) => acc - Math.round(number*precision),\n Math.round(numbers[0]*precision),\n ) / precision;\n}\n\n/**\n * A function to multiply long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures\n * and less than 10^11\n *\n * @param numbers\n */\nexport function daffMultiply(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffMultiply.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.reduce(\n (acc, number) => acc * Math.round(number*precision),\n 1,\n ) / Math.pow(precision, numbers.length);\n}\n\n/**\n * A function to divide long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures\n * and less than 10^11\n *\n * Returns NaN when attempting to use NaN as an input.\n * Returns NaN when attempting to divide by 0 or null.\n *\n * @param numbers\n */\nexport function daffDivide(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffDivide.');\n }\n // TODO(griest024): use better condition after IE support is dropped\n const illegalOperation = numbers.filter(isNaN).length > 0\n || numbers.slice(1).filter(n => n === 0 || n === null).length > 0;\n if (illegalOperation) {\n return NaN;\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.slice(1).reduce(\n (acc, number) => acc / Math.round(number*precision),\n Math.round(numbers[0]*precision),\n ) * Math.pow(precision, numbers.length - 2);\n}\n","/**\n * Range\n *\n * Range accepts two inputs, a `start` and an `end`\n * and returns an array filled with numbers from\n * `start` to `end`.\n *\n * @param start\n * @param end\n * @returns number\n */\nexport const range = (start: number, end: number): Array<number> =>\n Array.apply(null, Array(end - start + 1)).map((val, index) => index + start);\n\n","/**\n * Shallow compares two objects using a list of provided property keys to enumerate the values.\n * `null` and `undefined` are considered equal for the purposes of the comparison.\n * A strict equality comparison is used for truthy property values.\n */\nexport function shallowCompare<T, K extends keyof T = keyof T>(obj1: T, obj2: T, props: K[]): boolean {\n return !!(obj1 && obj2 && props.reduce(\n (acc, prop) => {\n const p1 = obj1[prop];\n const p2 = obj2[prop];\n return acc && (\n // undefined and null are treated as equal\n (p1 === undefined || p1 === null) && (p2 === undefined || p2 === null)\n || p1 === p2\n );\n },\n true,\n ));\n}\n","/**\n * Immutable Fisher-Yates Shuffle\n * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle\n */\nexport const shuffle = <T>(array: T[]): T[] => {\n const result = [];\n array.forEach((el, i) => {\n const s = Math.floor(Math.random() * i);\n if( s !== i ){\n result[i] = result[s];\n }\n result[s] = el;\n });\n return result;\n};\n","import { shuffle } from './shuffle';\n\n/**\n * Returns a random subset of an array in a random order.\n *\n * @param array\n * @param length\n */\nexport const randomSubset = <T>(array: T[], length?: number): T[] => {\n if(length > array.length){\n throw new Error('Requested length is longer than array length.');\n }\n length = length ? length : Math.floor(Math.random() * array.length);\n return shuffle(array).slice(0, length);\n};\n","/**\n * Returns a random slice of an array.\n * An optional length may be specified.\n *\n * @param array\n */\nexport const randomSlice = <T>(array: T[], length?: number): T[] => {\n if(array.length === 0) {\n return [];\n };\n if(length > array.length) {\n throw new Error('Requested length is longer than array length.');\n }\n const arrayLength = length || Math.floor(Math.random() * array.length);\n const start = Math.floor(Math.random() * (array.length - arrayLength + 1));\n const end = start + arrayLength;\n return array.slice(start, end);\n};\n","type Dictionary = Record<string | number | symbol, any>;\n\n/**\n * Converts an array into a dictionary.\n * Dictionary values are keyed by the return of the specified `getKey`.\n */\nexport const daffArrayToDict = <T extends Dictionary>(array: T[], getKey: (val: T) => keyof Dictionary): Record<keyof Dictionary, T> =>\n array.reduce(\n (dict, val) => {\n dict[getKey(val)] = val;\n return dict;\n },\n {},\n );\n","import { randomSlice } from './random-slice';\n\n/**\n * Returns a random element of an array.\n */\nexport const sample = <T>(array: T[]): T => randomSlice(array, 1)[0];\n","/**\n * Filters an array of elements, removing duplicates.\n * Does not guarantee order of filtered elements.\n *\n * An optional comparator function may be passed for arbitrary comparison behavior.\n * The default is a strict equality comparison: `a === b`.\n */\nexport const unique = <T>(array: T[], comparator: (a: T, b: T) => boolean = (a, b) => a === b): T[] =>\n array.filter((a, index) => array.slice(index + 1).filter(b => comparator(a, b)).length === 0);\n","/**\n * A class which allows you to appropriately check the inheritance of an error.\n *\n * In typescript, when you try to extend an error with a specialized error class,\n * if you try to call something like:\n *\n * ```ts\n * class MyError extends Error {}\n *\n * let myError = new MyError();\n *\n * myError instanceof MyError; // returns false\n * ```\n *\n * You will see unexpected things. This class fixes that issue as described here\n * https://github.com/microsoft/TypeScript/issues/13965\n */\nexport class DaffInheritableError extends Error {\n __proto__: Error;\n\n recoverable = false;\n\n constructor(message?: string) {\n\t super(message);\n\t const trueProto = new.target.prototype;\n\n\t Object.setPrototypeOf(this, trueProto);\n }\n}\n","import { DaffError } from './error.interface';\nimport { DaffInheritableError } from './inheritable-error';\n\n/**\n * Checks if the passed object is a {@link DaffError}\n */\nexport const daffIsError = (error: any): boolean =>\n error instanceof DaffInheritableError || !!(<DaffError>error).code;\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\n\nexport class DaffStorageServiceError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_STORAGE_FAILURE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\nimport { DaffStorageServiceError } from './error';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffErrorStorageService implements DaffPersistenceService {\n static readonly ERROR_MESSAGE = 'The DaffErrorStorageService always throws an error.';\n\n setItem(key: string, value: any): void {\n this.throwError();\n }\n\n getItem(key: string): any {\n this.throwError();\n }\n\n removeItem(key: string): any {\n this.throwError();\n }\n\n clear(){\n this.throwError();\n }\n\n private throwError() {\n throw new DaffStorageServiceError(DaffErrorStorageService.ERROR_MESSAGE);\n }\n}\n","import { DaffError } from '../../errors/public_api';\nimport { DaffStorageServiceError } from '../error/error';\n\n/**\n * An error thrown when there is an attempt to access storage on the server and none is available.\n */\nexport class DaffServerSideStorageError extends DaffStorageServiceError implements DaffError {\n public readonly code: string = 'DAFF_SERVER_STORAGE_FAILURE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\nimport { DaffServerSideStorageError } from './server-error';\n\n/**\n * A storage service meant to be loaded into SSR contexts.\n * It will always throw the {@link DaffServerSideStorageError}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffServerErrorStorageService implements DaffPersistenceService {\n static readonly ERROR_MESSAGE = 'The DaffServerErrorStorageService always throws an error.';\n\n setItem(key: string, value: any): void {\n this.throwError();\n }\n\n getItem(key: string): any {\n this.throwError();\n }\n\n removeItem(key: string): any {\n this.throwError();\n }\n\n clear(){\n this.throwError();\n }\n\n private throwError() {\n throw new DaffServerSideStorageError(DaffServerErrorStorageService.ERROR_MESSAGE);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Injectable,\n Inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffLocalStorageService implements DaffPersistenceService {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if(!isPlatformBrowser(platformId)){\n throw new Error('The DaffLocalStorageService can only be instantiated in the browser.');\n }\n }\n\n /**\n * Persist the given item into local storage.\n */\n setItem(key: string, value: any): void {\n localStorage.setItem(key, value);\n }\n\n /**\n * Retrieve the given item from localstorage.\n */\n getItem(key: string): any {\n return localStorage.getItem(key);\n }\n\n /**\n * Remove a given item from localstorage\n */\n removeItem(key: string): any {\n localStorage.removeItem(key);\n }\n\n clear(){\n localStorage.clear();\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffNoopStorageService implements DaffPersistenceService {\n setItem(key: string, value: any): void {};\n getItem(key: string): any {};\n clear(): void {};\n removeItem(key: string): void {};\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffLocalStorageService } from './localstorage/localstorage.service';\nimport { DaffServerErrorStorageService } from './server-error/public_api';\n\nexport interface DaffPersistenceService {\n setItem(key: string, value: any): void;\n getItem(key: string): any;\n clear(): void;\n removeItem(key: string): void;\n}\n\nexport const DaffPersistenceServiceToken = new InjectionToken<DaffPersistenceService>('DaffPersistenceService', {\n providedIn: 'root',\n factory: () => isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? new DaffLocalStorageService(inject<string>(PLATFORM_ID))\n : new DaffServerErrorStorageService(),\n});\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffNoopStorageService } from './noopstorage/noopstorage.service';\nimport {\n DaffPersistenceService,\n DaffPersistenceServiceToken,\n} from './persistence.interface';\n\n/**\n * Provides noop for the persistence service on the server.\n */\nexport const DaffServerSafePersistenceServiceToken = new InjectionToken<\nDaffPersistenceService\n>('DaffServerSafePersistenceService', {\n providedIn: 'root',\n factory: () =>\n isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? inject<DaffPersistenceService>(DaffPersistenceServiceToken)\n : inject<DaffPersistenceService>(DaffNoopStorageService),\n});\n","import {\n pipe,\n timer,\n throwError,\n} from 'rxjs';\nimport {\n retryWhen,\n mergeMap,\n} from 'rxjs/operators';\n\n/**\n * Retries failed Observables\n *\n * @param maxTries The maximum number of tries the observable will be tried\n * @param ms The initial amount of time\n */\nexport function backoff(maxTries: number, ms: number) {\n return pipe(\n retryWhen(attempt => attempt.pipe(\n mergeMap((shadowedAttempt: Error, i) => {\n if(i >= maxTries) {\n return throwError(shadowedAttempt);\n }\n return timer(ms*Math.pow(2,i));\n }),\n )),\n );\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBase64Service } from '../base64.interface';\n\ndeclare const Buffer;\n\n/**\n * A base64 service meant to be loaded into SSR contexts.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffServerBase64Service implements DaffBase64Service {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if (isPlatformBrowser(platformId)){\n throw new Error('The DaffBrowserBase64Service can only be instantiated on the server.');\n }\n }\n\n encode(str: string): string {\n return Buffer.from(str).toString('base64');\n }\n\n decode(str: string): string {\n return Buffer.from(str, 'base64').toString('ascii');\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Injectable,\n Inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBase64Service } from '../base64.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffBrowserBase64Service implements DaffBase64Service {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if(!isPlatformBrowser(platformId)){\n throw new Error('The DaffBrowserBase64Service can only be instantiated in the browser.');\n }\n }\n\n encode(str: string): string {\n return btoa(str);\n }\n\n decode(str: string): string {\n return atob(str);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBrowserBase64Service } from './browser/browser.service';\nimport { DaffServerBase64Service } from './server/public_api';\n\n/**\n * A service for encoding and decoding base64 strings.\n */\nexport interface DaffBase64Service {\n /**\n * Encodes an ASCII string to base64.\n */\n encode(str: string): string;\n /**\n * Decodes a base64 string to ASCII.\n */\n decode(str: string): string;\n}\n\n/**\n * A token which creates a base64 service appropriate for the current environment, i.e., browser vs. server.\n */\nexport const DaffBase64ServiceToken = new InjectionToken<DaffBase64Service>('DaffBase64Service', {\n providedIn: 'root',\n factory: () => isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? new DaffBrowserBase64Service(inject<string>(PLATFORM_ID))\n : new DaffServerBase64Service(inject<string>(PLATFORM_ID)),\n});\n","/**\n * The metadata that describes the sorting behavior of a collection of elements.\n */\nexport interface DaffSortOptions {\n default: DaffSortOption['value'];\n options: DaffSortOption[];\n}\n\n\n/**\n * One particular option used to sort a collection of elements;\n */\nexport interface DaffSortOption {\n label: string;\n value: any;\n}\n\n/**\n * The direction in which to sort a list of elements, e.g. if the list was\n * sorted alphabetically, \"Ascending\" would be from \"A-Z\",\n * and \"Descending\" would be from \"Z-A\".\n */\nexport enum DaffSortDirectionEnum {\n Ascending = 'ASC',\n Descending = 'DSC'\n}\n\n/**\n * Describes the properties of a collection that make the collection able to be\n * sorted by Daffodil.\n */\nexport interface DaffSortable {\n\n /**\n * The available options by which to sort the collection.\n */\n sortOptions: DaffSortOptions;\n\n /**\n * The currently applied sorting option.\n */\n appliedSortOption: DaffSortOption['value'];\n\n /**\n * The currently applied sort direction.\n */\n appliedSortDirection: DaffSortDirectionEnum;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '../errors/public_api';\n\nexport const DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE = 'DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS';\n\n/**\n * An error thrown when the requested page is greater than the number of available pages.\n */\nexport class DaffCollectionPageOutOfBoundsError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffCollectionPageOutOfBoundsError,\n DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE,\n} from './page-out-of-bounds.error';\n\nexport const daffCollectionErrorMap = {\n [DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE]: DaffCollectionPageOutOfBoundsError,\n};\n","import { DaffCollectionMetadata } from './metadata.interface';\nimport { DaffCollectionRequest } from './request.interface';\n\ntype MetadataRequestIntersection = keyof DaffCollectionMetadata & keyof DaffCollectionRequest;\n\nconst allowedMetadataKeys: MetadataRequestIntersection[] = [\n 'appliedSortOption',\n 'appliedSortDirection',\n 'currentPage',\n 'pageSize',\n];\n\n/**\n * Extracts the part of the {@link DaffCollectionRequest} that can be directly set in {@link DaffCollectionMetadata}.\n */\nexport const daffCollectionBuildMetadataFromRequest = (request: DaffCollectionRequest): Partial<DaffCollectionMetadata> =>\n allowedMetadataKeys.reduce(<K extends MetadataRequestIntersection>(acc: Partial<DaffCollectionMetadata>, key: K) => {\n if (request[key]) {\n acc[key] = request[key];\n }\n return acc;\n }, <Partial<DaffCollectionMetadata>>{});\n","/**\n * The known types of filters.\n */\nexport enum DaffFilterType {\n Equal = 'equal',\n RangeNumeric = 'rangeNumeric'\n}\n","/**\n * The separator between a range type filter's values\n * e.g. \"price\": \"30-40\".\n */\nexport const DaffFilterFromToFilterSeparator = '-';\n","/**\n * The error codes applicable to the filter behaviors of `@daffodil/core`.\n */\nexport enum DaffFilterErrorCodes {\n FILTER_REQUEST_TYPE_MISMATCH = 'DAFF_FILTER_REQUEST_TYPE_MISMATCH',\n FILTER_REQUEST_NAME_MISMATCH = 'DAFF_FILTER_REQUEST_NAME_MISMATCH',\n FILTER_NOT_FOUND = 'DAFF_FILTER_NOT_FOUND',\n UNKNOWN_FILTER_TYPE = 'DAFF_FILTER_UNKNOWN_TYPE',\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\nimport { DaffFilterErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an operation targeting a filter matches a type unknown\n * to Daffodil.\n */\nexport class DaffFilterUnknownType extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffFilterErrorCodes.UNKNOWN_FILTER_TYPE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffFilterEqual,\n DaffFilterEqualRequest,\n} from '../../../../../filterable/public_api';\n\n/**\n * Applies a {@link DaffFilterEqualRequest} to a {@link DaffFilterEqual}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffApplyFilterEqual = (\n request: DaffFilterEqualRequest,\n filter: DaffFilterEqual,\n): DaffFilterEqual => ({\n ...filter,\n options: request.value.reduce((acc, value) => {\n const option = filter.options[value];\n\n if (option) {\n acc[value] = {\n ...option,\n applied: true,\n };\n }\n\n return acc;\n }, { ...filter.options }),\n});\n","import { DaffFilterFromToFilterSeparator } from '../../../filterable/public_api';\n\nexport const daffFilterComputeRangePairLabel = (min, max): string =>\n `${min}${DaffFilterFromToFilterSeparator}${max}`;\n","import {\n DaffFilterRangeRequestBase,\n DaffFilterRangeBase,\n} from '../../../../../filterable/public_api';\nimport { daffFilterComputeRangePairLabel } from '../../compute-pair-label';\n\n/**\n * Applies a {@link DaffFilterRangeRequestBase} to a {@link DaffFilterRangeBase}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffApplyFilterRange = <T, U extends DaffFilterRangeRequestBase<T>, V extends DaffFilterRangeBase<T>>(\n request: U,\n filter: V,\n): V => ({\n ...filter,\n options: {\n [daffFilterComputeRangePairLabel(request.value.min, request.value.max)]: {\n min: {\n value: request.value.min,\n label: String(request.value.min),\n },\n max: {\n value: request.value.max,\n label: String(request.value.max),\n },\n applied: true,\n },\n },\n});\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\nimport { DaffFilterErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when a lookup for a filter.\n */\nexport class DaffFilterNotFound extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffFilterErrorCodes.FILTER_NOT_FOUND;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\nimport { DaffFilterErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an operation targeting a filter matching one name\n * matches a filter of another name.\n */\nexport class DaffFilterRequestNameMismatch extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffFilterErrorCodes.FILTER_REQUEST_NAME_MISMATCH;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffFilterRequest,\n DaffFilter,\n DaffFilterToggleRequest,\n} from '../../filterable/public_api';\nimport { DaffFilterNotFound } from '../errors/filter-not-found.error';\nimport { DaffFilterRequestNameMismatch } from '../errors/request-name-mismatch.error';\n\n/**\n * Ensures that the names of the filter and the filter request match.\n *\n * @throws {@link DaffFilterNotFound} if the names do not match.\n */\nexport const daffFilterValidateRequestNameMatch = (\n request: DaffFilterRequest | DaffFilterToggleRequest,\n filter: DaffFilter,\n): void => {\n if (!filter) {\n throw new DaffFilterNotFound('Filter does not exist');\n }\n if (request.name !== filter.name) {\n throw new DaffFilterRequestNameMismatch('Filter name does not match request name');\n }\n};\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\nimport { DaffFilterErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an operation targeting a filter matching one type\n * matches a filter of another type.\n */\nexport class DaffFilterRequestTypeMismatch extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffFilterErrorCodes.FILTER_REQUEST_TYPE_MISMATCH;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffFilterRequest,\n DaffFilter,\n DaffFilterToggleRequest,\n} from '../../filterable/public_api';\nimport { DaffFilterRequestTypeMismatch } from '../errors/request-type-mismatch.error';\n\n/**\n * Ensures that the types of the filter and the filter request match.\n *\n * @throws {@link DaffFilterRequestTypeMismatch} if the types do not match.\n */\nexport const daffFilterValidateRequestTypeMatch = (\n request: DaffFilterRequest | DaffFilterToggleRequest,\n filter: DaffFilter,\n): void => {\n if (request.type !== filter.type) {\n throw new DaffFilterRequestTypeMismatch('Filter types don\\'t match');\n }\n};\n","import {\n DaffFilterRequest,\n DaffFilter,\n DaffFilterType,\n DaffFilterEqual,\n DaffFilterRangeNumeric,\n} from '../../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../../errors/unknown-filter-type.error';\nimport { daffApplyFilterEqual } from '../../type/equal/behaviors/apply/apply';\nimport { daffApplyFilterRange } from '../../type/range/behaviors/apply/apply';\nimport {\n daffFilterValidateRequestNameMatch,\n daffFilterValidateRequestTypeMatch,\n} from '../../validators/public_api';\n\n/**\n * Applies a filter request to the matching filter.\n *\n * @idempotent {filter}\n * @throws {@link DaffFilterUnknownType}\n */\nexport const daffApplyFilter = (request: DaffFilterRequest, filter: DaffFilter): DaffFilter => {\n daffFilterValidateRequestNameMatch(request, filter);\n daffFilterValidateRequestTypeMatch(request, filter);\n\n switch (request.type) {\n case DaffFilterType.Equal:\n return daffApplyFilterEqual(request, <DaffFilterEqual>filter);\n case(DaffFilterType.RangeNumeric):\n return daffApplyFilterRange(request, <DaffFilterRangeNumeric>filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../../filterable/public_api';\nimport { daffApplyFilter } from './apply-filter';\n\n/**\n * Applies a {@link DaffFilterRequest} to a dictionary of {@link DaffFilter}\n * returning the updated dictionary.\n *\n * @idempotent {filters}\n */\nexport const daffApplyRequestToFilters = (request: DaffFilterRequest, filters: DaffFilters): DaffFilters => ({\n ...filters,\n [request.name]: daffApplyFilter(request, filters[request.name]),\n});\n\n\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../../filterable/public_api';\nimport { daffApplyFilter } from './apply-filter';\n\n/**\n * Applies filters from a {@link DaffFilterRequest} to a dictionary\n * of {@link DaffFilter}.\n *\n * @idempotent {filters}\n */\nexport const daffApplyRequestsToFilters = (\n filtersRequests: DaffFilterRequest[],\n filters: DaffFilters,\n): DaffFilters =>\n filtersRequests.reduce((acc, request) => {\n acc[request.name] = daffApplyFilter(request, filters[request.name]);\n return acc;\n }, { ...filters });\n\n\n","import { DaffFilterEqual } from '../../../../../filterable/public_api';\n\n/**\n * Unapplies the applied filter options of a {@link DaffFilterEqual}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffClearFilterEqual = (filter: DaffFilterEqual): DaffFilterEqual => ({\n ...filter,\n options: Object.keys(filter.options).map((key) => filter.options[key]).reduce((acc, option) => {\n acc[option.value] = {\n ...option,\n applied: false,\n };\n return acc;\n }, { ...filter.options }),\n});\n","import { DaffFilterRangeBase } from '../../../../../filterable/public_api';\n\n/**\n * Unapplies the applied filter options of a {@link DaffFilterRangeBase}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffClearFilterRange = <T, U extends DaffFilterRangeBase<T>>(filter: U): U => ({\n ...filter,\n options: {},\n});\n","import {\n DaffFilterType,\n DaffFilter,\n} from '../../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../../errors/unknown-filter-type.error';\nimport { daffClearFilterEqual } from '../../type/equal/behaviors/clear/clear';\nimport { daffClearFilterRange } from '../../type/range/behaviors/clear/clear';\n\n/**\n * Undoes the applied state of all applied filter options of a {@link DaffFilter}\n * returning the filter.\n *\n * @idempotent {filter}\n */\nexport const daffClearFilter = (filter: DaffFilter): DaffFilter => {\n switch (filter.type) {\n case DaffFilterType.RangeNumeric:\n return daffClearFilterRange(filter);\n case DaffFilterType.Equal:\n return daffClearFilterEqual(filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","\n\nimport { DaffFilters } from '../../../filterable/public_api';\nimport { daffClearFilter } from './clear-filter';\n\n/**\n * Undoes the applied state of all applied filter options of a dictionary of {@link DaffFilter}\n * returning updated dictionary.\n *\n * @idempotent {filters}\n */\nexport const daffClearFilters = (filters: DaffFilters): DaffFilters =>\n Object.keys(filters).map((key) => filters[key]).reduce((acc, filter) => {\n acc[filter.name] = daffClearFilter(filter);\n return acc;\n }, {});\n","import {\n DaffFilterEqualRequest,\n DaffFilter,\n DaffFilterEqual,\n} from '../../../../../filterable/public_api';\n\n/**\n * Removes the matching filter options of a {@link DaffFilterEqual}\n * that match the {@link DaffFilterEqualRequest}\n *\n * If there are no matching options, returns the original {@link DaffFilterEqual}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffRemoveFilterEqual = (\n request: DaffFilterEqualRequest,\n filter: DaffFilterEqual,\n): DaffFilter => ({\n ...filter,\n options: request.value.reduce((acc, value) => {\n const option = filter.options[value];\n\n if (option) {\n acc[value] = {\n ...option,\n applied: false,\n };\n }\n\n return acc;\n }, { ...filter.options }),\n});\n","import {\n DaffFilterRangeRequestBase,\n DaffFilterRangeBase,\n} from '../../../../../filterable/public_api';\nimport { daffFilterComputeRangePairLabel } from '../../compute-pair-label';\n\n/**\n * Removes the matching filter options of a {@link DaffFilterRangeBase}\n * that match the {@link DaffFilterRangeRequestBase}\n *\n * If there are no matching options, returns the original {@link DaffFilterRangeBase}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffRemoveFilterRange = <T, U extends DaffFilterRangeBase<T>>(\n request: DaffFilterRangeRequestBase<T>,\n filter: U,\n): U =>\n filter.options[daffFilterComputeRangePairLabel(request.value.min, request.value.max)]\n ? ({\n ...filter,\n options: {},\n })\n : filter;\n","import {\n DaffFilterRequest,\n DaffFilter,\n DaffFilterType,\n DaffFilterEqual,\n DaffFilterRangeNumeric,\n} from '../../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../../errors/unknown-filter-type.error';\nimport { daffRemoveFilterEqual } from '../../type/equal/behaviors/remove/remove';\nimport { daffRemoveFilterRange } from '../../type/range/behaviors/remove/remove';\nimport {\n daffFilterValidateRequestNameMatch,\n daffFilterValidateRequestTypeMatch,\n} from '../../validators/public_api';\n\n/**\n * Undoes any applied options of a {@link DaffFilter} that match the\n * {@link DaffFilterRequest}, returning the {@link DaffFilter}.\n *\n * @idempotent {filter}\n * @pure\n */\nexport const daffRemoveFilter = (request: DaffFilterRequest, filter: DaffFilter): DaffFilter => {\n daffFilterValidateRequestNameMatch(request, filter);\n daffFilterValidateRequestTypeMatch(request, filter);\n\n switch (request.type) {\n case DaffFilterType.Equal:\n return daffRemoveFilterEqual(request, <DaffFilterEqual>filter);\n case (DaffFilterType.RangeNumeric):\n return daffRemoveFilterRange(request, <DaffFilterRangeNumeric>filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../../filterable/public_api';\nimport { daffRemoveFilter } from './remove-filter';\n\n/**\n * Undoes any applied options of a particular filter of a dictionary of {@link DaffFilter}\n * that match the {@link DaffFilterRequest}, returning the dictionary of {@link DaffFilter}.\n *\n * @idempotent {filters}\n */\nexport const daffRemoveRequestFromFilters = (\n request: DaffFilterRequest,\n filters: DaffFilters,\n): DaffFilters => ({\n ...filters,\n [request.name]: daffRemoveFilter(request, filters[request.name]),\n});\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../../filterable/public_api';\nimport { daffRemoveFilter } from './remove-filter';\n\n/**\n * Undoes all applied options of a dictionary of {@link DaffFilter}\n * that match any of the {@link DaffFilterRequest},\n * returning the updated dictionary of {@link DaffFilter}.\n *\n * @idempotent {filters}\n */\nexport const daffRemoveRequestsFromFilters = (\n requests: (DaffFilterRequest)[],\n filters: DaffFilters,\n): DaffFilters =>\n requests.reduce((acc, request) => {\n acc[request.name] = daffRemoveFilter(request, filters[request.name]);\n return acc;\n }, { ...filters });\n","import { DaffFilterEqual } from '../../../../../filterable/public_api';\nimport { DaffFilterEqualToggleRequest } from '../../../../../filterable/public_api';\n\n/**\n * Oscillates the applied state of the matching filter options of a {@link DaffFilterEqual}\n * that match the {@link DaffFilterEqualRequest}\n *\n * If there are no matching options, returns the original {@link DaffFilterEqual}\n *\n * @docs-private\n */\nexport const daffToggleFilterEqual = (\n request: DaffFilterEqualToggleRequest,\n filter: DaffFilterEqual,\n): DaffFilterEqual => {\n const option = filter.options[request.value];\n\n return option\n ? {\n ...filter,\n options: {\n ...filter.options,\n [option.value]: {\n ...option,\n applied: !option.applied,\n },\n },\n }\n : filter;\n};\n","import {\n DaffFilterRangeBase,\n DaffFilterRangeRequestBase,\n} from '../../../../../filterable/public_api';\nimport { daffFilterComputeRangePairLabel } from '../../compute-pair-label';\nimport { daffApplyFilterRange } from '../apply/apply';\nimport { daffRemoveFilterRange } from '../remove/remove';\n\n/**\n * Oscillates the applied state of the matching filter options of a {@link DaffFilterRangeBase}\n * that match the {@link DaffFilterRangeRequestBase}\n *\n * If there are no matching options, returns the original {@link DaffFilterRangeBase}\n *\n * @docs-private\n */\nexport const daffToggleFilterRange = <T, U extends DaffFilterRangeBase<T>>(\n request: DaffFilterRangeRequestBase<T>,\n filter: U,\n): U =>\n filter.options[daffFilterComputeRangePairLabel(request.value.min, request.value.max)]\n ? daffRemoveFilterRange(request, filter)\n : daffApplyFilterRange(request, filter);\n","import {\n DaffFilterToggleRequest,\n DaffFilter,\n DaffFilterType,\n DaffFilterEqual,\n DaffFilterRangeNumeric,\n} from '../../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../../errors/unknown-filter-type.error';\nimport { daffToggleFilterEqual } from '../../type/equal/behaviors/toggle/toggle';\nimport { daffToggleFilterRange } from '../../type/range/behaviors/toggle/toggle';\nimport {\n daffFilterValidateRequestNameMatch,\n daffFilterValidateRequestTypeMatch,\n} from '../../validators/public_api';\n\n/**\n * Toggles the state of the filters (and their options) in the {@link DaffFilter}\n * that match the {@link DaffFilterToggleRequest} .\n */\nexport function daffToggleFilter(\n request: DaffFilterToggleRequest,\n filter: DaffFilter,\n): DaffFilter {\n daffFilterValidateRequestNameMatch(request, filter);\n daffFilterValidateRequestTypeMatch(request, filter);\n\n switch (request.type) {\n case DaffFilterType.Equal:\n return daffToggleFilterEqual(request, <DaffFilterEqual>filter);\n case(DaffFilterType.RangeNumeric):\n return daffToggleFilterRange(request, <DaffFilterRangeNumeric>filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n}\n","\n\nimport {\n DaffFilters,\n DaffFilterToggleRequest,\n} from '../../../filterable/public_api';\nimport { daffToggleFilter } from './toggle';\n\n/**\n * Toggles the state of a filter option in the {@link DaffFilters}\n * that matches the {@link DaffFilterToggleRequest}.\n */\nexport const daffToggleRequestOnFilters = (\n request: DaffFilterToggleRequest,\n filters: DaffFilters,\n): DaffFilters => ({\n ...filters,\n [request.name]: daffToggleFilter(request, filters[request.name]),\n});\n\n\n","import { DaffFilterEqual } from '../../../../filterable/public_api';\n\n/**\n * Determines whether or not the {@link DaffFilterEqual} has any applied options.\n */\nexport const daffIsFilterEqualApplied = (filter: DaffFilterEqual): boolean =>\n Object.keys(filter.options).map((key) => filter.options[key]).findIndex(option => option.applied) > -1;\n","import { DaffFilterRangeBase } from '../../../../filterable/public_api';\n\n/**\n * Determines whether or not a {@link DaffFilterRangeBase} has any applied options.\n */\nexport const daffIsFilterRangeApplied = <T>(filter: DaffFilterRangeBase<T>): boolean =>\n Object.keys(filter.options).length > 0;\n","import {\n DaffFilterType,\n DaffFilter,\n} from '../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../errors/unknown-filter-type.error';\nimport { daffIsFilterEqualApplied } from '../type/equal/is-applied/is-applied';\nimport { daffIsFilterRangeApplied } from '../type/range/is-applied/is-applied';\n\n/**\n * Determines whether or not a filter has any currently applied options.\n */\nexport const daffIsFilterApplied = (filter: DaffFilter): boolean => {\n switch (filter.type) {\n case DaffFilterType.RangeNumeric:\n return daffIsFilterRangeApplied(filter);\n case DaffFilterType.Equal:\n return daffIsFilterEqualApplied(filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","import {\n DaffFilterEqualToggleRequest,\n DaffFilterEqual,\n} from '../../../../filterable/public_api';\n\n/**\n * Determines whether or not any {@link DaffFilterEqual} options matching {@link DaffFilterEqualToggleRequest} are applied.\n */\nexport const daffIsEqualToggleRequestAppliedToFilter = (\n request: DaffFilterEqualToggleRequest,\n filter: DaffFilterEqual,\n): boolean => !!filter.options[request.value]?.applied;\n","import {\n DaffFilterRangeRequestBase,\n DaffFilterRangeBase,\n} from '../../../../filterable/public_api';\nimport { daffFilterComputeRangePairLabel } from '../compute-pair-label';\n\n/**\n * Determines whether or not any {@link DaffFilterRangeBase} options matching {@link DaffFilterRangeRequestBase} are applied.\n */\nexport const daffIsRangeToggleRequestAppliedToFilter = <T>(\n request: DaffFilterRangeRequestBase<T>,\n filter: DaffFilterRangeBase<T>,\n): boolean =>\n daffFilterComputeRangePairLabel(request.value.min, request.value.max) in filter.options;\n","import {\n DaffFilter,\n DaffFilterToggleRequest,\n DaffFilterType,\n DaffFilterRangeNumericToggleRequest,\n DaffFilterEqualToggleRequest,\n} from '../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../errors/unknown-filter-type.error';\nimport { daffIsEqualToggleRequestAppliedToFilter } from '../type/equal/is-applied/is-toggle-request-applied-to-filter';\nimport { daffIsRangeToggleRequestAppliedToFilter } from '../type/range/is-applied/is-toggle-request-applied-to-filter';\n\n/**\n * Determines whether or not a {@link DaffFilterToggleRequest} is already applied to a {@link DaffFilter}.\n */\nexport const daffIsToggleRequestAppliedToFilter = (request: DaffFilterToggleRequest, filter: DaffFilter): boolean => {\n switch (filter.type) {\n case DaffFilterType.RangeNumeric:\n return daffIsRangeToggleRequestAppliedToFilter(<DaffFilterRangeNumericToggleRequest>request, filter);\n case DaffFilterType.Equal:\n return daffIsEqualToggleRequestAppliedToFilter(<DaffFilterEqualToggleRequest>request, filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","import { DaffFilterBase } from '../../filterable/public_api';\n\n/**\n * Finds the applied options in the filter.\n */\nexport const daffFilterFindAppliedOptions = <T extends DaffFilterBase>(filter: T): T['options'][string][] =>\n Object.keys(filter.options).map((key) => <T['options'][string]>filter.options[key]).filter((option) => option.applied);\n","import {\n DaffFilterEqual,\n DaffFilterEqualRequest,\n DaffFilterType,\n} from '../../../../filterable/public_api';\nimport { daffFilterFindAppliedOptions } from '../../../find-applied/public_api';\n\n/**\n * Builds an {@link DaffFilterEqualRequest} from the passed filter and options.\n */\nexport const daffFilterEqualToRequest = (\n filter: DaffFilterEqual,\n): DaffFilterEqualRequest | null => {\n const options = daffFilterFindAppliedOptions(filter);\n if(!options.length){\n return null;\n }\n\n return {\n type: DaffFilterType.Equal,\n name: filter.name,\n value: options.map(option => option.value),\n };\n};\n","import {\n DaffFilterRangeBase,\n DaffFilterRangeRequestBase,\n} from '../../../../filterable/public_api';\nimport { daffFilterFindAppliedOptions } from '../../../find-applied/public_api';\n\n/**\n * Builds a {@link DaffFilterRangeRequestBase} from the passed {@link DaffFilterRangeBase} and options.\n */\nexport const daffFilterRangeToRequest = <T, U extends DaffFilterRangeBase<T>>(\n filter: U,\n): DaffFilterRangeRequestBase<T> => {\n const options = daffFilterFindAppliedOptions(filter);\n if(!options.length){\n return null;\n }\n\n return {\n type: filter.type,\n name: filter.name,\n value: {\n min: options[0].min.value,\n max: options[0].max.value,\n },\n };\n};\n","import {\n DaffFilterRangeNumeric,\n DaffFilterRangeNumericRequest,\n} from '../../../../filterable/public_api';\nimport { daffFilterRangeToRequest } from '../../range/to-request/filter-to-request';\n\n/**\n * Transforms a {@link DaffFilterRangeNumeric} into a {@link DaffFilterRangeNumericRequest}\n */\nexport const daffFilterRangeNumericToRequest = (\n filter: DaffFilterRangeNumeric,\n): DaffFilterRangeNumericRequest => <DaffFilterRangeNumericRequest>daffFilterRangeToRequest(filter);\n","import {\n DaffFilter,\n DaffFilterRequest,\n DaffFilterType,\n} from '../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../errors/unknown-filter-type.error';\nimport { daffFilterEqualToRequest } from '../type/equal/to-request/filter-to-request';\nimport { daffFilterRangeNumericToRequest } from '../type/range-numeric/to-request/filter-to-request';\n\n/**\n * Builds a filter request from a filter.\n * Returns null if the filter does not have at least one applied option.\n */\nexport function daffFilterToRequest(filter: DaffFilter): DaffFilterRequest | null {\n switch (filter.type) {\n case DaffFilterType.RangeNumeric:\n return daffFilterRangeNumericToRequest(filter);\n case DaffFilterType.Equal:\n return daffFilterEqualToRequest(filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../filterable/public_api';\nimport { daffFilterToRequest } from './filter-to-request';\n\n/**\n * Builds a list of filter requests from a list of filters.\n * Requests are only built for the filters that have at least one applied option.\n */\nexport function daffFiltersToRequests(filters: DaffFilters): DaffFilterRequest[] {\n return Object.keys(filters).map((key) => filters[key]).reduce((acc: DaffFilterRequest[], filter) => {\n const request = daffFilterToRequest(filter);\n\n if (request) {\n acc.push(request);\n }\n\n return acc;\n }, []);\n}\n","import { DaffFilterRangePair } from '../../../../filterable/public_api';\nimport { daffArrayToDict } from '../../../../utils/public_api';\nimport { daffFilterComputeRangePairLabel } from '../compute-pair-label';\n\n/**\n * Transforms an {@link DaffFilterRangePair[]} to a dictionary.\n */\nexport const daffFilterRangePairArrayToDict = <T>(pairs: DaffFilterRangePair<T>[]): Record<string, DaffFilterRangePair<T>> =>\n daffArrayToDict(pairs, pair => daffFilterComputeRangePairLabel(pair.min.value, pair.max.value));\n","import { DaffFilterEqualOption } from '../../../../filterable/public_api';\nimport { daffArrayToDict } from '../../../../utils/public_api';\n\n/**\n * Converts a list of equal filter options to a dict of options keyed by option value.\n */\nexport const daffFilterEqualOptionArrayToDict =\n (options: DaffFilterEqualOption[]): Record<DaffFilterEqualOption['value'], DaffFilterEqualOption> =>\n daffArrayToDict(options, option => option.value);\n","import {\n DaffFilter,\n DaffFilters,\n} from '../../filterable/public_api';\nimport { daffArrayToDict } from '../../utils/public_api';\n\n/**\n * Converts a list of filters into a dictionary of filters keyed by filter name.\n */\nexport const daffFilterArrayToDict = (filters: DaffFilter[]): DaffFilters =>\n daffArrayToDict(filters, filter => filter.name);\n","\n\nimport {\n DaffFilterType,\n DaffFilterEqualOption,\n DaffFilterRangePair,\n DaffFilters,\n} from '../../filterable/public_api';\nimport { daffFilterFindAppliedOptions } from '../find-applied/public_api';\nimport { daffFilterEqualOptionArrayToDict } from '../type/equal/public_api';\nimport { daffFilterRangePairArrayToDict } from '../type/range/public_api';\n\n/**\n * Returns a {@link DaffFilters} and only their applied options.\n * {@link DaffFilter} that have no applied options will be omitted.\n */\nexport const daffComputeAppliedFilters = (filters: DaffFilters): DaffFilters =>\n Object.keys(filters).map(key => filters[key]).reduce((acc, filter) => {\n const appliedOptions = daffFilterFindAppliedOptions(filter);\n\n if (appliedOptions.length > 0) {\n acc[filter.name] = {\n ...filter,\n options: filter.type === DaffFilterType.Equal\n ? daffFilterEqualOptionArrayToDict(<DaffFilterEqualOption[]>appliedOptions)\n : daffFilterRangePairArrayToDict(<DaffFilterRangePair<unknown>[]>appliedOptions),\n };\n }\n\n return acc;\n }, {});\n","import { daffFiltersToRequests } from '../filters/public_api';\nimport { DaffCollectionMetadata } from './metadata.interface';\nimport { DaffCollectionRequest } from './request.interface';\n\n/**\n * Builds a {@link DaffCollectionRequest} from {@link DaffCollectionMetadata}.\n */\nexport const daffCollectionBuildRequestFromMetadata = (metadata: DaffCollectionMetadata): Partial<DaffCollectionRequest> => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n filterRequests: daffFiltersToRequests(metadata.filters),\n});\n","import { daffArrayToDict } from '../utils/public_api';\nimport { DaffIdentifiable } from './identifiable.interface';\n\n/**\n * Transforms an array of {@link DaffIdentifiable} objects to a dictionary of those objects keyed by ID.\n */\nexport const daffIdentifiableArrayToDict = <T extends DaffIdentifiable = DaffIdentifiable>(ary: T[]): Record<T['id'], T> =>\n daffArrayToDict(ary, ({ id }) => id);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;AACH,SAAS,aAAa,CAAC,MAAc,EAAA;IACnC,IAAI,CAAC,GAAG,KAAK,CAAC;AACd,IAAA,IAAG,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,EAAE;AAC1C,QAAA,OAAO,CAAC,CAAC;AACV,KAAA;AACD,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,MAAM,EAAE;QAC5C,CAAC,IAAI,EAAE,CAAC;AACT,KAAA;AACD,IAAA,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;;AAMG;AACa,SAAA,OAAO,CAAC,GAAG,OAAiB,EAAA;AAC1C,IAAA,IAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AACrB,QAAA,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC5D,KAAA;AACD,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;IAC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C,IAAI,CAAC,GAAG;AACjB,YAAA,GAAG,MAAM;AACT,YAAA,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,KAAK;AAC3C,kBAAE,gCAAgC,CAA0B,cAAc,CAAC;AAC3E,kBAAE,8BAA8B,CAAiC,cAAc,CAAC;SACnF,CAAC;AACH,KAAA;AAED,IAAA,OAAO,GAAG,CAAC;AACb,CAAC,EAAE,EAAE;;AC1BP;;AAEG;MACU,sCAAsC,GAAG,CAAC,QAAgC,MAAsC;IAC3H,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;IAC7C,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;IACnD,WAAW,EAAE,QAAQ,CAAC,WAAW;IACjC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC3B,IAAA,cAAc,EAAE,qBAAqB,CAAC,QAAQ,CAAC,OAAO,CAAC;AACxD,CAAA;;ACVD;;AAEG;MACU,2BAA2B,GAAG,CAAgD,GAAQ,KACjG,eAAe,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE;;ACPrC;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-core.mjs","sources":["../../../libs/core/src/utils/long-arithmetic.ts","../../../libs/core/src/utils/range.ts","../../../libs/core/src/utils/shallow-compare.ts","../../../libs/core/src/utils/shuffle.ts","../../../libs/core/src/utils/random-subset.ts","../../../libs/core/src/utils/random-slice.ts","../../../libs/core/src/utils/array-to-dict.ts","../../../libs/core/src/utils/sample.ts","../../../libs/core/src/utils/unique.ts","../../../libs/core/src/errors/inheritable-error.ts","../../../libs/core/src/errors/is-error.ts","../../../libs/core/src/storage/error/error.ts","../../../libs/core/src/storage/error/error.service.ts","../../../libs/core/src/storage/server-error/server-error.ts","../../../libs/core/src/storage/server-error/server-error.service.ts","../../../libs/core/src/storage/localstorage/localstorage.service.ts","../../../libs/core/src/storage/noopstorage/noopstorage.service.ts","../../../libs/core/src/storage/persistence.interface.ts","../../../libs/core/src/storage/persistence-server-safe.token.ts","../../../libs/core/src/operators/backoff.pipe.ts","../../../libs/core/src/base64/server/server.service.ts","../../../libs/core/src/base64/browser/browser.service.ts","../../../libs/core/src/base64/base64.interface.ts","../../../libs/core/src/collection/sortable.ts","../../../libs/core/src/collection/page-out-of-bounds.error.ts","../../../libs/core/src/collection/error-map.ts","../../../libs/core/src/collection/build-metadata.ts","../../../libs/core/src/filterable/type/filter-type.ts","../../../libs/core/src/filterable/type/range/separator.ts","../../../libs/core/src/filters/errors/codes.enum.ts","../../../libs/core/src/filters/errors/unknown-filter-type.error.ts","../../../libs/core/src/filters/type/equal/behaviors/apply/apply.ts","../../../libs/core/src/filters/type/range/compute-pair-label.ts","../../../libs/core/src/filters/type/range/behaviors/apply/apply.ts","../../../libs/core/src/filters/errors/filter-not-found.error.ts","../../../libs/core/src/filters/errors/request-name-mismatch.error.ts","../../../libs/core/src/filters/validators/request-name-match.ts","../../../libs/core/src/filters/errors/request-type-mismatch.error.ts","../../../libs/core/src/filters/validators/request-type-match.ts","../../../libs/core/src/filters/behaviors/apply/apply-filter.ts","../../../libs/core/src/filters/behaviors/apply/apply-request-to-filters.ts","../../../libs/core/src/filters/behaviors/apply/apply-requests-to-filters.ts","../../../libs/core/src/filters/type/equal/behaviors/clear/clear.ts","../../../libs/core/src/filters/type/range/behaviors/clear/clear.ts","../../../libs/core/src/filters/behaviors/clear/clear-filter.ts","../../../libs/core/src/filters/behaviors/clear/clear-filters.ts","../../../libs/core/src/filters/type/equal/behaviors/remove/remove.ts","../../../libs/core/src/filters/type/range/behaviors/remove/remove.ts","../../../libs/core/src/filters/behaviors/remove/remove-filter.ts","../../../libs/core/src/filters/behaviors/remove/remove-request-from-filters.ts","../../../libs/core/src/filters/behaviors/remove/remove-requests-from-filters.ts","../../../libs/core/src/filters/type/equal/behaviors/toggle/toggle.ts","../../../libs/core/src/filters/type/range/behaviors/toggle/toggle.ts","../../../libs/core/src/filters/behaviors/toggle/toggle.ts","../../../libs/core/src/filters/behaviors/toggle/toggle-request-on-filters.ts","../../../libs/core/src/filters/type/equal/is-applied/is-applied.ts","../../../libs/core/src/filters/type/range/is-applied/is-applied.ts","../../../libs/core/src/filters/is-applied/is-filter-applied.ts","../../../libs/core/src/filters/type/equal/is-applied/is-toggle-request-applied-to-filter.ts","../../../libs/core/src/filters/type/range/is-applied/is-toggle-request-applied-to-filter.ts","../../../libs/core/src/filters/is-applied/is-toggle-request-applied-to-filter.ts","../../../libs/core/src/filters/find-applied/find-applied-options.ts","../../../libs/core/src/filters/type/equal/to-request/filter-to-request.ts","../../../libs/core/src/filters/type/range/to-request/filter-to-request.ts","../../../libs/core/src/filters/type/range-numeric/to-request/filter-to-request.ts","../../../libs/core/src/filters/to-request/filter-to-request.ts","../../../libs/core/src/filters/to-request/filters-to-requests.ts","../../../libs/core/src/filters/type/range/array-to-dict/pair.ts","../../../libs/core/src/filters/type/equal/array-to-dict/option.ts","../../../libs/core/src/filters/array-to-dict/array-to-dict.ts","../../../libs/core/src/filters/compute-applied-filters/compute-applied-filters.ts","../../../libs/core/src/collection/build-request.ts","../../../libs/core/src/identifiable/array-to-dict.ts","../../../libs/core/src/daffodil-core.ts"],"sourcesContent":["/**\n * A helper function to get the number of decimal significant figures of a number.\n * This function will fail if the given number has more than 16 significant figures or\n * the value of the number is greater than 10^11\n *\n * @param number\n */\nfunction daffPrecision(number: number): number {\n let p = 10000;\n if(number === undefined || number === null) {\n return p;\n }\n while (Math.round(number * p) / p !== number) {\n p *= 10;\n }\n return p;\n}\n\n/**\n * A function to add long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are less than\n * 16 significant figures and less than 10^11\n *\n * @param numbers\n */\nexport function daffAdd(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffAdd.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.reduce((acc, number) => acc + Math.round(number*precision), 0) / precision;\n}\n\n/**\n * A function to subtract long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than\n * 16 significant figures and less than 10^11\n *\n * @param numbers\n */\nexport function daffSubtract(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffSubtract.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.slice(1).reduce(\n (acc, number) => acc - Math.round(number*precision),\n Math.round(numbers[0]*precision),\n ) / precision;\n}\n\n/**\n * A function to multiply long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures\n * and less than 10^11\n *\n * @param numbers\n */\nexport function daffMultiply(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffMultiply.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.reduce(\n (acc, number) => acc * Math.round(number*precision),\n 1,\n ) / Math.pow(precision, numbers.length);\n}\n\n/**\n * A function to divide long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures\n * and less than 10^11\n *\n * Returns NaN when attempting to use NaN as an input.\n * Returns NaN when attempting to divide by 0 or null.\n *\n * @param numbers\n */\nexport function daffDivide(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffDivide.');\n }\n // TODO(griest024): use better condition after IE support is dropped\n const illegalOperation = numbers.filter(isNaN).length > 0\n || numbers.slice(1).filter(n => n === 0 || n === null).length > 0;\n if (illegalOperation) {\n return NaN;\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.slice(1).reduce(\n (acc, number) => acc / Math.round(number*precision),\n Math.round(numbers[0]*precision),\n ) * Math.pow(precision, numbers.length - 2);\n}\n","/**\n * Range\n *\n * Range accepts two inputs, a `start` and an `end`\n * and returns an array filled with numbers from\n * `start` to `end`.\n *\n * @param start\n * @param end\n * @returns number\n */\nexport const range = (start: number, end: number): Array<number> =>\n Array.apply(null, Array(end - start + 1)).map((val, index) => index + start);\n\n","/**\n * Shallow compares two objects using a list of provided property keys to enumerate the values.\n * `null` and `undefined` are considered equal for the purposes of the comparison.\n * A strict equality comparison is used for truthy property values.\n */\nexport function shallowCompare<T>(obj1: T, obj2: T, props: (T extends T ? keyof T: never)[]): boolean {\n return !!(obj1 && obj2 && props.reduce(\n (acc, prop) => {\n const p1 = obj1[prop];\n const p2 = obj2[prop];\n return acc && (\n // undefined and null are treated as equal\n (p1 === undefined || p1 === null) && (p2 === undefined || p2 === null)\n || p1 === p2\n );\n },\n true,\n ));\n}\n","/**\n * Immutable Fisher-Yates Shuffle\n * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle\n */\nexport const shuffle = <T>(array: T[]): T[] => {\n const result = [];\n array.forEach((el, i) => {\n const s = Math.floor(Math.random() * i);\n if( s !== i ){\n result[i] = result[s];\n }\n result[s] = el;\n });\n return result;\n};\n","import { shuffle } from './shuffle';\n\n/**\n * Returns a random subset of an array in a random order.\n *\n * @param array\n * @param length\n */\nexport const randomSubset = <T>(array: T[], length?: number): T[] => {\n if(length > array.length){\n throw new Error('Requested length is longer than array length.');\n }\n length = length ? length : Math.floor(Math.random() * array.length);\n return shuffle(array).slice(0, length);\n};\n","/**\n * Returns a random slice of an array.\n * An optional length may be specified.\n *\n * @param array\n */\nexport const randomSlice = <T>(array: T[], length?: number): T[] => {\n if(array.length === 0) {\n return [];\n };\n if(length > array.length) {\n throw new Error('Requested length is longer than array length.');\n }\n const arrayLength = length || Math.floor(Math.random() * array.length);\n const start = Math.floor(Math.random() * (array.length - arrayLength + 1));\n const end = start + arrayLength;\n return array.slice(start, end);\n};\n","type Dictionary = Record<string | number | symbol, any>;\n\n/**\n * Converts an array into a dictionary.\n * Dictionary values are keyed by the return of the specified `getKey`.\n */\nexport const daffArrayToDict = <T extends Dictionary>(array: T[], getKey: (val: T) => keyof Dictionary): Record<keyof Dictionary, T> =>\n array.reduce(\n (dict, val) => {\n dict[getKey(val)] = val;\n return dict;\n },\n {},\n );\n","import { randomSlice } from './random-slice';\n\n/**\n * Returns a random element of an array.\n */\nexport const sample = <T>(array: T[]): T => randomSlice(array, 1)[0];\n","/**\n * Filters an array of elements, removing duplicates.\n * Does not guarantee order of filtered elements.\n *\n * An optional comparator function may be passed for arbitrary comparison behavior.\n * The default is a strict equality comparison: `a === b`.\n */\nexport const unique = <T>(array: T[], comparator: (a: T, b: T) => boolean = (a, b) => a === b): T[] =>\n array.filter((a, index) => array.slice(index + 1).filter(b => comparator(a, b)).length === 0);\n","/**\n * A class which allows you to appropriately check the inheritance of an error.\n *\n * In typescript, when you try to extend an error with a specialized error class,\n * if you try to call something like:\n *\n * ```ts\n * class MyError extends Error {}\n *\n * let myError = new MyError();\n *\n * myError instanceof MyError; // returns false\n * ```\n *\n * You will see unexpected things. This class fixes that issue as described here\n * https://github.com/microsoft/TypeScript/issues/13965\n */\nexport class DaffInheritableError extends Error {\n __proto__: Error;\n\n recoverable = false;\n\n constructor(message?: string) {\n\t super(message);\n\t const trueProto = new.target.prototype;\n\n\t Object.setPrototypeOf(this, trueProto);\n }\n}\n","import { DaffError } from './error.interface';\nimport { DaffInheritableError } from './inheritable-error';\n\n/**\n * Checks if the passed object is a {@link DaffError}\n */\nexport const daffIsError = (error: any): boolean =>\n error instanceof DaffInheritableError || !!(<DaffError>error).code;\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\n\nexport class DaffStorageServiceError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_STORAGE_FAILURE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\nimport { DaffStorageServiceError } from './error';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffErrorStorageService implements DaffPersistenceService {\n static readonly ERROR_MESSAGE = 'The DaffErrorStorageService always throws an error.';\n\n setItem(key: string, value: any): void {\n this.throwError();\n }\n\n getItem(key: string): any {\n this.throwError();\n }\n\n removeItem(key: string): any {\n this.throwError();\n }\n\n clear(){\n this.throwError();\n }\n\n private throwError() {\n throw new DaffStorageServiceError(DaffErrorStorageService.ERROR_MESSAGE);\n }\n}\n","import { DaffError } from '../../errors/public_api';\nimport { DaffStorageServiceError } from '../error/error';\n\n/**\n * An error thrown when there is an attempt to access storage on the server and none is available.\n */\nexport class DaffServerSideStorageError extends DaffStorageServiceError implements DaffError {\n public readonly code: string = 'DAFF_SERVER_STORAGE_FAILURE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\nimport { DaffServerSideStorageError } from './server-error';\n\n/**\n * A storage service meant to be loaded into SSR contexts.\n * It will always throw the {@link DaffServerSideStorageError}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffServerErrorStorageService implements DaffPersistenceService {\n static readonly ERROR_MESSAGE = 'The DaffServerErrorStorageService always throws an error.';\n\n setItem(key: string, value: any): void {\n this.throwError();\n }\n\n getItem(key: string): any {\n this.throwError();\n }\n\n removeItem(key: string): any {\n this.throwError();\n }\n\n clear(){\n this.throwError();\n }\n\n private throwError() {\n throw new DaffServerSideStorageError(DaffServerErrorStorageService.ERROR_MESSAGE);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Injectable,\n Inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffLocalStorageService implements DaffPersistenceService {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if(!isPlatformBrowser(platformId)){\n throw new Error('The DaffLocalStorageService can only be instantiated in the browser.');\n }\n }\n\n /**\n * Persist the given item into local storage.\n */\n setItem(key: string, value: any): void {\n localStorage.setItem(key, value);\n }\n\n /**\n * Retrieve the given item from localstorage.\n */\n getItem(key: string): any {\n return localStorage.getItem(key);\n }\n\n /**\n * Remove a given item from localstorage\n */\n removeItem(key: string): any {\n localStorage.removeItem(key);\n }\n\n clear(){\n localStorage.clear();\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffNoopStorageService implements DaffPersistenceService {\n setItem(key: string, value: any): void {};\n getItem(key: string): any {};\n clear(): void {};\n removeItem(key: string): void {};\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffLocalStorageService } from './localstorage/localstorage.service';\nimport { DaffServerErrorStorageService } from './server-error/public_api';\n\nexport interface DaffPersistenceService {\n setItem(key: string, value: any): void;\n getItem(key: string): any;\n clear(): void;\n removeItem(key: string): void;\n}\n\nexport const DaffPersistenceServiceToken = new InjectionToken<DaffPersistenceService>('DaffPersistenceService', {\n providedIn: 'root',\n factory: () => isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? new DaffLocalStorageService(inject<string>(PLATFORM_ID))\n : new DaffServerErrorStorageService(),\n});\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffNoopStorageService } from './noopstorage/noopstorage.service';\nimport {\n DaffPersistenceService,\n DaffPersistenceServiceToken,\n} from './persistence.interface';\n\n/**\n * Provides noop for the persistence service on the server.\n */\nexport const DaffServerSafePersistenceServiceToken = new InjectionToken<\nDaffPersistenceService\n>('DaffServerSafePersistenceService', {\n providedIn: 'root',\n factory: () =>\n isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? inject<DaffPersistenceService>(DaffPersistenceServiceToken)\n : inject<DaffPersistenceService>(DaffNoopStorageService),\n});\n","import {\n pipe,\n timer,\n throwError,\n} from 'rxjs';\nimport {\n retryWhen,\n mergeMap,\n} from 'rxjs/operators';\n\n/**\n * Retries failed Observables\n *\n * @param maxTries The maximum number of tries the observable will be tried\n * @param ms The initial amount of time\n */\nexport function backoff(maxTries: number, ms: number) {\n return pipe(\n retryWhen(attempt => attempt.pipe(\n mergeMap((shadowedAttempt: Error, i) => {\n if(i >= maxTries) {\n return throwError(shadowedAttempt);\n }\n return timer(ms*Math.pow(2,i));\n }),\n )),\n );\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBase64Service } from '../base64.interface';\n\ndeclare const Buffer;\n\n/**\n * A base64 service meant to be loaded into SSR contexts.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffServerBase64Service implements DaffBase64Service {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if (isPlatformBrowser(platformId)){\n throw new Error('The DaffBrowserBase64Service can only be instantiated on the server.');\n }\n }\n\n encode(str: string): string {\n return Buffer.from(str).toString('base64');\n }\n\n decode(str: string): string {\n return Buffer.from(str, 'base64').toString('ascii');\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Injectable,\n Inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBase64Service } from '../base64.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffBrowserBase64Service implements DaffBase64Service {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if(!isPlatformBrowser(platformId)){\n throw new Error('The DaffBrowserBase64Service can only be instantiated in the browser.');\n }\n }\n\n encode(str: string): string {\n return btoa(str);\n }\n\n decode(str: string): string {\n return atob(str);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBrowserBase64Service } from './browser/browser.service';\nimport { DaffServerBase64Service } from './server/public_api';\n\n/**\n * A service for encoding and decoding base64 strings.\n */\nexport interface DaffBase64Service {\n /**\n * Encodes an ASCII string to base64.\n */\n encode(str: string): string;\n /**\n * Decodes a base64 string to ASCII.\n */\n decode(str: string): string;\n}\n\n/**\n * A token which creates a base64 service appropriate for the current environment, i.e., browser vs. server.\n */\nexport const DaffBase64ServiceToken = new InjectionToken<DaffBase64Service>('DaffBase64Service', {\n providedIn: 'root',\n factory: () => isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? new DaffBrowserBase64Service(inject<string>(PLATFORM_ID))\n : new DaffServerBase64Service(inject<string>(PLATFORM_ID)),\n});\n","/**\n * The metadata that describes the sorting behavior of a collection of elements.\n */\nexport interface DaffSortOptions {\n default: DaffSortOption['value'];\n options: DaffSortOption[];\n}\n\n\n/**\n * One particular option used to sort a collection of elements;\n */\nexport interface DaffSortOption {\n label: string;\n value: any;\n}\n\n/**\n * The direction in which to sort a list of elements, e.g. if the list was\n * sorted alphabetically, \"Ascending\" would be from \"A-Z\",\n * and \"Descending\" would be from \"Z-A\".\n */\nexport enum DaffSortDirectionEnum {\n Ascending = 'ASC',\n Descending = 'DSC'\n}\n\n/**\n * Describes the properties of a collection that make the collection able to be\n * sorted by Daffodil.\n */\nexport interface DaffSortable {\n\n /**\n * The available options by which to sort the collection.\n */\n sortOptions: DaffSortOptions;\n\n /**\n * The currently applied sorting option.\n */\n appliedSortOption: DaffSortOption['value'];\n\n /**\n * The currently applied sort direction.\n */\n appliedSortDirection: DaffSortDirectionEnum;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '../errors/public_api';\n\nexport const DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE = 'DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS';\n\n/**\n * An error thrown when the requested page is greater than the number of available pages.\n */\nexport class DaffCollectionPageOutOfBoundsError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffCollectionPageOutOfBoundsError,\n DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE,\n} from './page-out-of-bounds.error';\n\nexport const daffCollectionErrorMap = {\n [DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE]: DaffCollectionPageOutOfBoundsError,\n};\n","import { DaffCollectionMetadata } from './metadata.interface';\nimport { DaffCollectionRequest } from './request.interface';\n\ntype MetadataRequestIntersection = keyof DaffCollectionMetadata & keyof DaffCollectionRequest;\n\nconst allowedMetadataKeys: MetadataRequestIntersection[] = [\n 'appliedSortOption',\n 'appliedSortDirection',\n 'currentPage',\n 'pageSize',\n];\n\n/**\n * Extracts the part of the {@link DaffCollectionRequest} that can be directly set in {@link DaffCollectionMetadata}.\n */\nexport const daffCollectionBuildMetadataFromRequest = (request: DaffCollectionRequest): Partial<DaffCollectionMetadata> =>\n allowedMetadataKeys.reduce(<K extends MetadataRequestIntersection>(acc: Partial<DaffCollectionMetadata>, key: K) => {\n if (request[key]) {\n acc[key] = request[key];\n }\n return acc;\n }, <Partial<DaffCollectionMetadata>>{});\n","/**\n * The known types of filters.\n */\nexport enum DaffFilterType {\n Equal = 'equal',\n RangeNumeric = 'rangeNumeric'\n}\n","/**\n * The separator between a range type filter's values\n * e.g. \"price\": \"30-40\".\n */\nexport const DaffFilterFromToFilterSeparator = '-';\n","/**\n * The error codes applicable to the filter behaviors of `@daffodil/core`.\n */\nexport enum DaffFilterErrorCodes {\n FILTER_REQUEST_TYPE_MISMATCH = 'DAFF_FILTER_REQUEST_TYPE_MISMATCH',\n FILTER_REQUEST_NAME_MISMATCH = 'DAFF_FILTER_REQUEST_NAME_MISMATCH',\n FILTER_NOT_FOUND = 'DAFF_FILTER_NOT_FOUND',\n UNKNOWN_FILTER_TYPE = 'DAFF_FILTER_UNKNOWN_TYPE',\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\nimport { DaffFilterErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an operation targeting a filter matches a type unknown\n * to Daffodil.\n */\nexport class DaffFilterUnknownType extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffFilterErrorCodes.UNKNOWN_FILTER_TYPE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffFilterEqual,\n DaffFilterEqualRequest,\n} from '../../../../../filterable/public_api';\n\n/**\n * Applies a {@link DaffFilterEqualRequest} to a {@link DaffFilterEqual}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffApplyFilterEqual = (\n request: DaffFilterEqualRequest,\n filter: DaffFilterEqual,\n): DaffFilterEqual => ({\n ...filter,\n options: request.value.reduce((acc, value) => {\n const option = filter.options[value];\n\n if (option) {\n acc[value] = {\n ...option,\n applied: true,\n };\n }\n\n return acc;\n }, { ...filter.options }),\n});\n","import { DaffFilterFromToFilterSeparator } from '../../../filterable/public_api';\n\nexport const daffFilterComputeRangePairLabel = (min, max): string =>\n `${min}${DaffFilterFromToFilterSeparator}${max}`;\n","import {\n DaffFilterRangeRequestBase,\n DaffFilterRangeBase,\n} from '../../../../../filterable/public_api';\nimport { daffFilterComputeRangePairLabel } from '../../compute-pair-label';\n\n/**\n * Applies a {@link DaffFilterRangeRequestBase} to a {@link DaffFilterRangeBase}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffApplyFilterRange = <T, U extends DaffFilterRangeRequestBase<T>, V extends DaffFilterRangeBase<T>>(\n request: U,\n filter: V,\n): V => ({\n ...filter,\n options: {\n [daffFilterComputeRangePairLabel(request.value.min, request.value.max)]: {\n min: {\n value: request.value.min,\n label: String(request.value.min),\n },\n max: {\n value: request.value.max,\n label: String(request.value.max),\n },\n applied: true,\n },\n },\n});\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\nimport { DaffFilterErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when a lookup for a filter.\n */\nexport class DaffFilterNotFound extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffFilterErrorCodes.FILTER_NOT_FOUND;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\nimport { DaffFilterErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an operation targeting a filter matching one name\n * matches a filter of another name.\n */\nexport class DaffFilterRequestNameMismatch extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffFilterErrorCodes.FILTER_REQUEST_NAME_MISMATCH;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffFilterRequest,\n DaffFilter,\n DaffFilterToggleRequest,\n} from '../../filterable/public_api';\nimport { DaffFilterNotFound } from '../errors/filter-not-found.error';\nimport { DaffFilterRequestNameMismatch } from '../errors/request-name-mismatch.error';\n\n/**\n * Ensures that the names of the filter and the filter request match.\n *\n * @throws {@link DaffFilterNotFound} if the names do not match.\n */\nexport const daffFilterValidateRequestNameMatch = (\n request: DaffFilterRequest | DaffFilterToggleRequest,\n filter: DaffFilter,\n): void => {\n if (!filter) {\n throw new DaffFilterNotFound('Filter does not exist');\n }\n if (request.name !== filter.name) {\n throw new DaffFilterRequestNameMismatch('Filter name does not match request name');\n }\n};\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\nimport { DaffFilterErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an operation targeting a filter matching one type\n * matches a filter of another type.\n */\nexport class DaffFilterRequestTypeMismatch extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffFilterErrorCodes.FILTER_REQUEST_TYPE_MISMATCH;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffFilterRequest,\n DaffFilter,\n DaffFilterToggleRequest,\n} from '../../filterable/public_api';\nimport { DaffFilterRequestTypeMismatch } from '../errors/request-type-mismatch.error';\n\n/**\n * Ensures that the types of the filter and the filter request match.\n *\n * @throws {@link DaffFilterRequestTypeMismatch} if the types do not match.\n */\nexport const daffFilterValidateRequestTypeMatch = (\n request: DaffFilterRequest | DaffFilterToggleRequest,\n filter: DaffFilter,\n): void => {\n if (request.type !== filter.type) {\n throw new DaffFilterRequestTypeMismatch('Filter types don\\'t match');\n }\n};\n","import {\n DaffFilterRequest,\n DaffFilter,\n DaffFilterType,\n DaffFilterEqual,\n DaffFilterRangeNumeric,\n} from '../../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../../errors/unknown-filter-type.error';\nimport { daffApplyFilterEqual } from '../../type/equal/behaviors/apply/apply';\nimport { daffApplyFilterRange } from '../../type/range/behaviors/apply/apply';\nimport {\n daffFilterValidateRequestNameMatch,\n daffFilterValidateRequestTypeMatch,\n} from '../../validators/public_api';\n\n/**\n * Applies a filter request to the matching filter.\n *\n * @idempotent {filter}\n * @throws {@link DaffFilterUnknownType}\n */\nexport const daffApplyFilter = (request: DaffFilterRequest, filter: DaffFilter): DaffFilter => {\n daffFilterValidateRequestNameMatch(request, filter);\n daffFilterValidateRequestTypeMatch(request, filter);\n\n switch (request.type) {\n case DaffFilterType.Equal:\n return daffApplyFilterEqual(request, <DaffFilterEqual>filter);\n case(DaffFilterType.RangeNumeric):\n return daffApplyFilterRange(request, <DaffFilterRangeNumeric>filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../../filterable/public_api';\nimport { daffApplyFilter } from './apply-filter';\n\n/**\n * Applies a {@link DaffFilterRequest} to a dictionary of {@link DaffFilter}\n * returning the updated dictionary.\n *\n * @idempotent {filters}\n */\nexport const daffApplyRequestToFilters = (request: DaffFilterRequest, filters: DaffFilters): DaffFilters => ({\n ...filters,\n [request.name]: daffApplyFilter(request, filters[request.name]),\n});\n\n\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../../filterable/public_api';\nimport { daffApplyFilter } from './apply-filter';\n\n/**\n * Applies filters from a {@link DaffFilterRequest} to a dictionary\n * of {@link DaffFilter}.\n *\n * @idempotent {filters}\n */\nexport const daffApplyRequestsToFilters = (\n filtersRequests: DaffFilterRequest[],\n filters: DaffFilters,\n): DaffFilters =>\n filtersRequests.reduce((acc, request) => {\n acc[request.name] = daffApplyFilter(request, filters[request.name]);\n return acc;\n }, { ...filters });\n\n\n","import { DaffFilterEqual } from '../../../../../filterable/public_api';\n\n/**\n * Unapplies the applied filter options of a {@link DaffFilterEqual}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffClearFilterEqual = (filter: DaffFilterEqual): DaffFilterEqual => ({\n ...filter,\n options: Object.keys(filter.options).map((key) => filter.options[key]).reduce((acc, option) => {\n acc[option.value] = {\n ...option,\n applied: false,\n };\n return acc;\n }, { ...filter.options }),\n});\n","import { DaffFilterRangeBase } from '../../../../../filterable/public_api';\n\n/**\n * Unapplies the applied filter options of a {@link DaffFilterRangeBase}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffClearFilterRange = <T, U extends DaffFilterRangeBase<T>>(filter: U): U => ({\n ...filter,\n options: {},\n});\n","import {\n DaffFilterType,\n DaffFilter,\n} from '../../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../../errors/unknown-filter-type.error';\nimport { daffClearFilterEqual } from '../../type/equal/behaviors/clear/clear';\nimport { daffClearFilterRange } from '../../type/range/behaviors/clear/clear';\n\n/**\n * Undoes the applied state of all applied filter options of a {@link DaffFilter}\n * returning the filter.\n *\n * @idempotent {filter}\n */\nexport const daffClearFilter = (filter: DaffFilter): DaffFilter => {\n switch (filter.type) {\n case DaffFilterType.RangeNumeric:\n return daffClearFilterRange(filter);\n case DaffFilterType.Equal:\n return daffClearFilterEqual(filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","\n\nimport { DaffFilters } from '../../../filterable/public_api';\nimport { daffClearFilter } from './clear-filter';\n\n/**\n * Undoes the applied state of all applied filter options of a dictionary of {@link DaffFilter}\n * returning updated dictionary.\n *\n * @idempotent {filters}\n */\nexport const daffClearFilters = (filters: DaffFilters): DaffFilters =>\n Object.keys(filters).map((key) => filters[key]).reduce((acc, filter) => {\n acc[filter.name] = daffClearFilter(filter);\n return acc;\n }, {});\n","import {\n DaffFilterEqualRequest,\n DaffFilter,\n DaffFilterEqual,\n} from '../../../../../filterable/public_api';\n\n/**\n * Removes the matching filter options of a {@link DaffFilterEqual}\n * that match the {@link DaffFilterEqualRequest}\n *\n * If there are no matching options, returns the original {@link DaffFilterEqual}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffRemoveFilterEqual = (\n request: DaffFilterEqualRequest,\n filter: DaffFilterEqual,\n): DaffFilter => ({\n ...filter,\n options: request.value.reduce((acc, value) => {\n const option = filter.options[value];\n\n if (option) {\n acc[value] = {\n ...option,\n applied: false,\n };\n }\n\n return acc;\n }, { ...filter.options }),\n});\n","import {\n DaffFilterRangeRequestBase,\n DaffFilterRangeBase,\n} from '../../../../../filterable/public_api';\nimport { daffFilterComputeRangePairLabel } from '../../compute-pair-label';\n\n/**\n * Removes the matching filter options of a {@link DaffFilterRangeBase}\n * that match the {@link DaffFilterRangeRequestBase}\n *\n * If there are no matching options, returns the original {@link DaffFilterRangeBase}\n *\n * @idempotent {filter}\n * @docs-private\n */\nexport const daffRemoveFilterRange = <T, U extends DaffFilterRangeBase<T>>(\n request: DaffFilterRangeRequestBase<T>,\n filter: U,\n): U =>\n filter.options[daffFilterComputeRangePairLabel(request.value.min, request.value.max)]\n ? ({\n ...filter,\n options: {},\n })\n : filter;\n","import {\n DaffFilterRequest,\n DaffFilter,\n DaffFilterType,\n DaffFilterEqual,\n DaffFilterRangeNumeric,\n} from '../../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../../errors/unknown-filter-type.error';\nimport { daffRemoveFilterEqual } from '../../type/equal/behaviors/remove/remove';\nimport { daffRemoveFilterRange } from '../../type/range/behaviors/remove/remove';\nimport {\n daffFilterValidateRequestNameMatch,\n daffFilterValidateRequestTypeMatch,\n} from '../../validators/public_api';\n\n/**\n * Undoes any applied options of a {@link DaffFilter} that match the\n * {@link DaffFilterRequest}, returning the {@link DaffFilter}.\n *\n * @idempotent {filter}\n * @pure\n */\nexport const daffRemoveFilter = (request: DaffFilterRequest, filter: DaffFilter): DaffFilter => {\n daffFilterValidateRequestNameMatch(request, filter);\n daffFilterValidateRequestTypeMatch(request, filter);\n\n switch (request.type) {\n case DaffFilterType.Equal:\n return daffRemoveFilterEqual(request, <DaffFilterEqual>filter);\n case (DaffFilterType.RangeNumeric):\n return daffRemoveFilterRange(request, <DaffFilterRangeNumeric>filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../../filterable/public_api';\nimport { daffRemoveFilter } from './remove-filter';\n\n/**\n * Undoes any applied options of a particular filter of a dictionary of {@link DaffFilter}\n * that match the {@link DaffFilterRequest}, returning the dictionary of {@link DaffFilter}.\n *\n * @idempotent {filters}\n */\nexport const daffRemoveRequestFromFilters = (\n request: DaffFilterRequest,\n filters: DaffFilters,\n): DaffFilters => ({\n ...filters,\n [request.name]: daffRemoveFilter(request, filters[request.name]),\n});\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../../filterable/public_api';\nimport { daffRemoveFilter } from './remove-filter';\n\n/**\n * Undoes all applied options of a dictionary of {@link DaffFilter}\n * that match any of the {@link DaffFilterRequest},\n * returning the updated dictionary of {@link DaffFilter}.\n *\n * @idempotent {filters}\n */\nexport const daffRemoveRequestsFromFilters = (\n requests: (DaffFilterRequest)[],\n filters: DaffFilters,\n): DaffFilters =>\n requests.reduce((acc, request) => {\n acc[request.name] = daffRemoveFilter(request, filters[request.name]);\n return acc;\n }, { ...filters });\n","import { DaffFilterEqual } from '../../../../../filterable/public_api';\nimport { DaffFilterEqualToggleRequest } from '../../../../../filterable/public_api';\n\n/**\n * Oscillates the applied state of the matching filter options of a {@link DaffFilterEqual}\n * that match the {@link DaffFilterEqualRequest}\n *\n * If there are no matching options, returns the original {@link DaffFilterEqual}\n *\n * @docs-private\n */\nexport const daffToggleFilterEqual = (\n request: DaffFilterEqualToggleRequest,\n filter: DaffFilterEqual,\n): DaffFilterEqual => {\n const option = filter.options[request.value];\n\n return option\n ? {\n ...filter,\n options: {\n ...filter.options,\n [option.value]: {\n ...option,\n applied: !option.applied,\n },\n },\n }\n : filter;\n};\n","import {\n DaffFilterRangeBase,\n DaffFilterRangeRequestBase,\n} from '../../../../../filterable/public_api';\nimport { daffFilterComputeRangePairLabel } from '../../compute-pair-label';\nimport { daffApplyFilterRange } from '../apply/apply';\nimport { daffRemoveFilterRange } from '../remove/remove';\n\n/**\n * Oscillates the applied state of the matching filter options of a {@link DaffFilterRangeBase}\n * that match the {@link DaffFilterRangeRequestBase}\n *\n * If there are no matching options, returns the original {@link DaffFilterRangeBase}\n *\n * @docs-private\n */\nexport const daffToggleFilterRange = <T, U extends DaffFilterRangeBase<T>>(\n request: DaffFilterRangeRequestBase<T>,\n filter: U,\n): U =>\n filter.options[daffFilterComputeRangePairLabel(request.value.min, request.value.max)]\n ? daffRemoveFilterRange(request, filter)\n : daffApplyFilterRange(request, filter);\n","import {\n DaffFilterToggleRequest,\n DaffFilter,\n DaffFilterType,\n DaffFilterEqual,\n DaffFilterRangeNumeric,\n} from '../../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../../errors/unknown-filter-type.error';\nimport { daffToggleFilterEqual } from '../../type/equal/behaviors/toggle/toggle';\nimport { daffToggleFilterRange } from '../../type/range/behaviors/toggle/toggle';\nimport {\n daffFilterValidateRequestNameMatch,\n daffFilterValidateRequestTypeMatch,\n} from '../../validators/public_api';\n\n/**\n * Toggles the state of the filters (and their options) in the {@link DaffFilter}\n * that match the {@link DaffFilterToggleRequest} .\n */\nexport function daffToggleFilter(\n request: DaffFilterToggleRequest,\n filter: DaffFilter,\n): DaffFilter {\n daffFilterValidateRequestNameMatch(request, filter);\n daffFilterValidateRequestTypeMatch(request, filter);\n\n switch (request.type) {\n case DaffFilterType.Equal:\n return daffToggleFilterEqual(request, <DaffFilterEqual>filter);\n case(DaffFilterType.RangeNumeric):\n return daffToggleFilterRange(request, <DaffFilterRangeNumeric>filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n}\n","\n\nimport {\n DaffFilters,\n DaffFilterToggleRequest,\n} from '../../../filterable/public_api';\nimport { daffToggleFilter } from './toggle';\n\n/**\n * Toggles the state of a filter option in the {@link DaffFilters}\n * that matches the {@link DaffFilterToggleRequest}.\n */\nexport const daffToggleRequestOnFilters = (\n request: DaffFilterToggleRequest,\n filters: DaffFilters,\n): DaffFilters => ({\n ...filters,\n [request.name]: daffToggleFilter(request, filters[request.name]),\n});\n\n\n","import { DaffFilterEqual } from '../../../../filterable/public_api';\n\n/**\n * Determines whether or not the {@link DaffFilterEqual} has any applied options.\n */\nexport const daffIsFilterEqualApplied = (filter: DaffFilterEqual): boolean =>\n Object.keys(filter.options).map((key) => filter.options[key]).findIndex(option => option.applied) > -1;\n","import { DaffFilterRangeBase } from '../../../../filterable/public_api';\n\n/**\n * Determines whether or not a {@link DaffFilterRangeBase} has any applied options.\n */\nexport const daffIsFilterRangeApplied = <T>(filter: DaffFilterRangeBase<T>): boolean =>\n Object.keys(filter.options).length > 0;\n","import {\n DaffFilterType,\n DaffFilter,\n} from '../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../errors/unknown-filter-type.error';\nimport { daffIsFilterEqualApplied } from '../type/equal/is-applied/is-applied';\nimport { daffIsFilterRangeApplied } from '../type/range/is-applied/is-applied';\n\n/**\n * Determines whether or not a filter has any currently applied options.\n */\nexport const daffIsFilterApplied = (filter: DaffFilter): boolean => {\n switch (filter.type) {\n case DaffFilterType.RangeNumeric:\n return daffIsFilterRangeApplied(filter);\n case DaffFilterType.Equal:\n return daffIsFilterEqualApplied(filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","import {\n DaffFilterEqualToggleRequest,\n DaffFilterEqual,\n} from '../../../../filterable/public_api';\n\n/**\n * Determines whether or not any {@link DaffFilterEqual} options matching {@link DaffFilterEqualToggleRequest} are applied.\n */\nexport const daffIsEqualToggleRequestAppliedToFilter = (\n request: DaffFilterEqualToggleRequest,\n filter: DaffFilterEqual,\n): boolean => !!filter.options[request.value]?.applied;\n","import {\n DaffFilterRangeRequestBase,\n DaffFilterRangeBase,\n} from '../../../../filterable/public_api';\nimport { daffFilterComputeRangePairLabel } from '../compute-pair-label';\n\n/**\n * Determines whether or not any {@link DaffFilterRangeBase} options matching {@link DaffFilterRangeRequestBase} are applied.\n */\nexport const daffIsRangeToggleRequestAppliedToFilter = <T>(\n request: DaffFilterRangeRequestBase<T>,\n filter: DaffFilterRangeBase<T>,\n): boolean =>\n daffFilterComputeRangePairLabel(request.value.min, request.value.max) in filter.options;\n","import {\n DaffFilter,\n DaffFilterToggleRequest,\n DaffFilterType,\n DaffFilterRangeNumericToggleRequest,\n DaffFilterEqualToggleRequest,\n} from '../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../errors/unknown-filter-type.error';\nimport { daffIsEqualToggleRequestAppliedToFilter } from '../type/equal/is-applied/is-toggle-request-applied-to-filter';\nimport { daffIsRangeToggleRequestAppliedToFilter } from '../type/range/is-applied/is-toggle-request-applied-to-filter';\n\n/**\n * Determines whether or not a {@link DaffFilterToggleRequest} is already applied to a {@link DaffFilter}.\n */\nexport const daffIsToggleRequestAppliedToFilter = (request: DaffFilterToggleRequest, filter: DaffFilter): boolean => {\n switch (filter.type) {\n case DaffFilterType.RangeNumeric:\n return daffIsRangeToggleRequestAppliedToFilter(<DaffFilterRangeNumericToggleRequest>request, filter);\n case DaffFilterType.Equal:\n return daffIsEqualToggleRequestAppliedToFilter(<DaffFilterEqualToggleRequest>request, filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","import { DaffFilterBase } from '../../filterable/public_api';\n\n/**\n * Finds the applied options in the filter.\n */\nexport const daffFilterFindAppliedOptions = <T extends DaffFilterBase>(filter: T): T['options'][string][] =>\n Object.keys(filter.options).map((key) => <T['options'][string]>filter.options[key]).filter((option) => option.applied);\n","import {\n DaffFilterEqual,\n DaffFilterEqualRequest,\n DaffFilterType,\n} from '../../../../filterable/public_api';\nimport { daffFilterFindAppliedOptions } from '../../../find-applied/public_api';\n\n/**\n * Builds an {@link DaffFilterEqualRequest} from the passed filter and options.\n */\nexport const daffFilterEqualToRequest = (\n filter: DaffFilterEqual,\n): DaffFilterEqualRequest | null => {\n const options = daffFilterFindAppliedOptions(filter);\n if(!options.length){\n return null;\n }\n\n return {\n type: DaffFilterType.Equal,\n name: filter.name,\n value: options.map(option => option.value),\n };\n};\n","import {\n DaffFilterRangeBase,\n DaffFilterRangeRequestBase,\n} from '../../../../filterable/public_api';\nimport { daffFilterFindAppliedOptions } from '../../../find-applied/public_api';\n\n/**\n * Builds a {@link DaffFilterRangeRequestBase} from the passed {@link DaffFilterRangeBase} and options.\n */\nexport const daffFilterRangeToRequest = <T, U extends DaffFilterRangeBase<T>>(\n filter: U,\n): DaffFilterRangeRequestBase<T> => {\n const options = daffFilterFindAppliedOptions(filter);\n if(!options.length){\n return null;\n }\n\n return {\n type: filter.type,\n name: filter.name,\n value: {\n min: options[0].min.value,\n max: options[0].max.value,\n },\n };\n};\n","import {\n DaffFilterRangeNumeric,\n DaffFilterRangeNumericRequest,\n} from '../../../../filterable/public_api';\nimport { daffFilterRangeToRequest } from '../../range/to-request/filter-to-request';\n\n/**\n * Transforms a {@link DaffFilterRangeNumeric} into a {@link DaffFilterRangeNumericRequest}\n */\nexport const daffFilterRangeNumericToRequest = (\n filter: DaffFilterRangeNumeric,\n): DaffFilterRangeNumericRequest => <DaffFilterRangeNumericRequest>daffFilterRangeToRequest(filter);\n","import {\n DaffFilter,\n DaffFilterRequest,\n DaffFilterType,\n} from '../../filterable/public_api';\nimport { DaffFilterUnknownType } from '../errors/unknown-filter-type.error';\nimport { daffFilterEqualToRequest } from '../type/equal/to-request/filter-to-request';\nimport { daffFilterRangeNumericToRequest } from '../type/range-numeric/to-request/filter-to-request';\n\n/**\n * Builds a filter request from a filter.\n * Returns null if the filter does not have at least one applied option.\n */\nexport function daffFilterToRequest(filter: DaffFilter): DaffFilterRequest | null {\n switch (filter.type) {\n case DaffFilterType.RangeNumeric:\n return daffFilterRangeNumericToRequest(filter);\n case DaffFilterType.Equal:\n return daffFilterEqualToRequest(filter);\n default:\n throw new DaffFilterUnknownType('Unknown filter type');\n }\n};\n","\n\nimport {\n DaffFilterRequest,\n DaffFilters,\n} from '../../filterable/public_api';\nimport { daffFilterToRequest } from './filter-to-request';\n\n/**\n * Builds a list of filter requests from a list of filters.\n * Requests are only built for the filters that have at least one applied option.\n */\nexport function daffFiltersToRequests(filters: DaffFilters): DaffFilterRequest[] {\n return Object.keys(filters).map((key) => filters[key]).reduce((acc: DaffFilterRequest[], filter) => {\n const request = daffFilterToRequest(filter);\n\n if (request) {\n acc.push(request);\n }\n\n return acc;\n }, []);\n}\n","import { DaffFilterRangePair } from '../../../../filterable/public_api';\nimport { daffArrayToDict } from '../../../../utils/public_api';\nimport { daffFilterComputeRangePairLabel } from '../compute-pair-label';\n\n/**\n * Transforms an {@link DaffFilterRangePair[]} to a dictionary.\n */\nexport const daffFilterRangePairArrayToDict = <T>(pairs: DaffFilterRangePair<T>[]): Record<string, DaffFilterRangePair<T>> =>\n daffArrayToDict(pairs, pair => daffFilterComputeRangePairLabel(pair.min.value, pair.max.value));\n","import { DaffFilterEqualOption } from '../../../../filterable/public_api';\nimport { daffArrayToDict } from '../../../../utils/public_api';\n\n/**\n * Converts a list of equal filter options to a dict of options keyed by option value.\n */\nexport const daffFilterEqualOptionArrayToDict =\n (options: DaffFilterEqualOption[]): Record<DaffFilterEqualOption['value'], DaffFilterEqualOption> =>\n daffArrayToDict(options, option => option.value);\n","import {\n DaffFilter,\n DaffFilters,\n} from '../../filterable/public_api';\nimport { daffArrayToDict } from '../../utils/public_api';\n\n/**\n * Converts a list of filters into a dictionary of filters keyed by filter name.\n */\nexport const daffFilterArrayToDict = (filters: DaffFilter[]): DaffFilters =>\n daffArrayToDict(filters, filter => filter.name);\n","\n\nimport {\n DaffFilterType,\n DaffFilterEqualOption,\n DaffFilterRangePair,\n DaffFilters,\n} from '../../filterable/public_api';\nimport { daffFilterFindAppliedOptions } from '../find-applied/public_api';\nimport { daffFilterEqualOptionArrayToDict } from '../type/equal/public_api';\nimport { daffFilterRangePairArrayToDict } from '../type/range/public_api';\n\n/**\n * Returns a {@link DaffFilters} and only their applied options.\n * {@link DaffFilter} that have no applied options will be omitted.\n */\nexport const daffComputeAppliedFilters = (filters: DaffFilters): DaffFilters =>\n Object.keys(filters).map(key => filters[key]).reduce((acc, filter) => {\n const appliedOptions = daffFilterFindAppliedOptions(filter);\n\n if (appliedOptions.length > 0) {\n acc[filter.name] = {\n ...filter,\n options: filter.type === DaffFilterType.Equal\n ? daffFilterEqualOptionArrayToDict(<DaffFilterEqualOption[]>appliedOptions)\n : daffFilterRangePairArrayToDict(<DaffFilterRangePair<unknown>[]>appliedOptions),\n };\n }\n\n return acc;\n }, {});\n","import { daffFiltersToRequests } from '../filters/public_api';\nimport { DaffCollectionMetadata } from './metadata.interface';\nimport { DaffCollectionRequest } from './request.interface';\n\n/**\n * Builds a {@link DaffCollectionRequest} from {@link DaffCollectionMetadata}.\n */\nexport const daffCollectionBuildRequestFromMetadata = (metadata: DaffCollectionMetadata): Partial<DaffCollectionRequest> => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n filterRequests: daffFiltersToRequests(metadata.filters),\n});\n","import { daffArrayToDict } from '../utils/public_api';\nimport { DaffIdentifiable } from './identifiable.interface';\n\n/**\n * Transforms an array of {@link DaffIdentifiable} objects to a dictionary of those objects keyed by ID.\n */\nexport const daffIdentifiableArrayToDict = <T extends DaffIdentifiable = DaffIdentifiable>(ary: T[]): Record<T['id'], T> =>\n daffArrayToDict(ary, ({ id }) => id);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;AACH,SAAS,aAAa,CAAC,MAAc,EAAA;IACnC,IAAI,CAAC,GAAG,KAAK,CAAC;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,EAAE,EAAE,KAAK,EAAE;;ACPrC;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daffodil/core",
3
- "version": "0.53.1",
3
+ "version": "0.56.0",
4
4
  "description": "Interfaces built for daffodil/state",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,4 +1,7 @@
1
1
  import { DaffStateError } from './state-error.interface';
2
2
  export interface DaffErrorable {
3
- errors: DaffStateError[];
3
+ /**
4
+ * A list of errors applicable only to this entity.
5
+ */
6
+ daffErrors: DaffStateError[];
4
7
  }
@@ -17,7 +17,7 @@ export declare function daffCompleteOperation<T extends DaffOperationState = Daf
17
17
  * Indicates a failed operation.
18
18
  * Sets loading to stable and stores errors.
19
19
  */
20
- export declare function daffOperationFailed<T extends DaffOperationState = DaffOperationState>(errors: T['errors'], state: T): T;
20
+ export declare function daffOperationFailed<T extends DaffOperationState = DaffOperationState>(errors: T['daffErrors'], state: T): T;
21
21
  /**
22
22
  * Resets errors.
23
23
  */
@@ -1,14 +1,11 @@
1
1
  import { DaffIdentifiable } from '@daffodil/core';
2
- import { DaffStateError } from '../../errors/public_api';
2
+ import { DaffErrorable } from '../../errors/public_api';
3
3
  import { DaffStateable } from '../../states/public_api';
4
4
  /**
5
5
  * An entity that is responsible for storing its own errors and loading state.
6
+ * Its possible to be an "optimistic" entity, i.e. only temporary while the real entity is in some loading state.
6
7
  */
7
- export declare type DaffOperationEntity<T extends DaffIdentifiable = DaffIdentifiable> = DaffStateable & T & {
8
- /**
9
- * A list of errors applicable only to this entity.
10
- */
11
- daffErrors: DaffStateError[];
8
+ export declare type DaffOperationEntity<T extends DaffIdentifiable = DaffIdentifiable> = DaffStateable & DaffErrorable & T & {
12
9
  /**
13
10
  * Whether this entity is temporary.
14
11
  * A temporary entity is a placeholder for the optimistic success of an entity operation
@@ -9,7 +9,7 @@ export interface DaffOperationStateFacadeInterface<TState extends DaffOperationS
9
9
  /**
10
10
  * The loading state enum.
11
11
  */
12
- loadingState$: Observable<TState['loading']>;
12
+ loadingState$: Observable<TState['daffState']>;
13
13
  /**
14
14
  * Whether the operation state is in any of the loading states.
15
15
  */
@@ -25,7 +25,7 @@ export interface DaffOperationStateFacadeInterface<TState extends DaffOperationS
25
25
  /**
26
26
  * The errors in the operation state.
27
27
  */
28
- errors$: Observable<TState['errors']>;
28
+ errors$: Observable<TState['daffErrors']>;
29
29
  /**
30
30
  * Whether the operation state has any errors.
31
31
  * If so, it should be considered to be in an "error" state.
@@ -7,7 +7,7 @@ export interface DaffOperationStateSelectors<TRootState, TState extends DaffOper
7
7
  /**
8
8
  * Selects the loading state enum.
9
9
  */
10
- selectLoadingState: MemoizedSelector<TRootState, TState['loading']>;
10
+ selectLoadingState: MemoizedSelector<TRootState, TState['daffState']>;
11
11
  /**
12
12
  * Selects whether the operation state is in any of the loading states.
13
13
  */
@@ -23,7 +23,7 @@ export interface DaffOperationStateSelectors<TRootState, TState extends DaffOper
23
23
  /**
24
24
  * Selects the errors in the operation state.
25
25
  */
26
- selectErrors: MemoizedSelector<TRootState, TState['errors']>;
26
+ selectErrors: MemoizedSelector<TRootState, TState['daffErrors']>;
27
27
  /**
28
28
  * Selects whether the operation state has any errors.
29
29
  * If so, it should be considered to be in an "error" state.
@@ -1,17 +1,9 @@
1
- import { DaffStateError } from '../errors/public_api';
2
- import { DaffState } from '../states/public_api';
1
+ import { DaffErrorable } from '../errors/public_api';
2
+ import { DaffStateable } from '../states/public_api';
3
3
  /**
4
4
  * A basic operation state.
5
5
  * Represents the current state of an operation and any associated errors.
6
6
  */
7
- export interface DaffOperationState {
8
- /**
9
- * The loading state of the operations backed by this state.
10
- */
11
- loading: DaffState;
12
- /**
13
- * The errors generated by the most recent operation.
14
- */
15
- errors: DaffStateError[];
7
+ export interface DaffOperationState extends DaffErrorable, DaffStateable {
16
8
  }
17
9
  export declare const daffOperationInitialState: DaffOperationState;
@@ -3,4 +3,4 @@
3
3
  * `null` and `undefined` are considered equal for the purposes of the comparison.
4
4
  * A strict equality comparison is used for truthy property values.
5
5
  */
6
- export declare function shallowCompare<T, K extends keyof T = keyof T>(obj1: T, obj2: T, props: K[]): boolean;
6
+ export declare function shallowCompare<T>(obj1: T, obj2: T, props: (T extends T ? keyof T : never)[]): boolean;