{"version":3,"file":"typescript-package-queue.mjs","sources":["../../../package/queue/src/lib/elements.class.ts","../../../package/queue/src/lib/processing.class.ts","../../../package/queue/src/lib/queue.abstract.ts","../../../package/queue/src/lib/tasks.class.ts","../../../package/queue/src/lib/task-queue.class.ts","../../../package/queue/src/lib/stack.abstract.ts","../../../package/queue/src/lib/index.ts","../../../package/queue/src/public-api.ts","../../../package/queue/src/typescript-package-queue.ts"],"sourcesContent":["// Abstract.\nimport { ArrayState } from \"@typescript-package/state\";\n/**\n * @description Array state elements in data structures such as Stack and Queue.\n * @export\n * @class Elements\n * @template Type \n * @extends {ArrayState<Type>}\n */\nexport class Elements<Type, Size extends number = number> extends ArrayState<Type>{\n  /**\n   * @description The maximum size of the `Elements`.\n   * @public\n   * @readonly\n   * @type {Size}\n   */\n  public get size(): Size {\n    return this.#size;\n  }\n\n  /**\n   * @description Privately stored maximum elements size.\n   * @type {Size}\n   */\n  #size: Size;\n\n  /**\n   * Creates an instance of `Elements`.\n   * @constructor\n   * @param {Type[]} elements \n   * @param {Size} [size=Infinity as Size] \n   */\n  constructor(elements: Type[], size: Size = Infinity as Size) {\n    super(elements.length <= size ? elements : []);\n    // Sets the size.\n    this.#size = size;\n    // Throws an error if the elements exceeds the maximum size.\n    if (elements.length > size) {\n      throw new Error(`The \\`elements\\` size exceeds the maximum size ${size} by ${elements.length - size}.`);\n    }\n  }\n\n  /**\n   * @inheritdoc\n   * @public\n   * @param {Type} element The element of `Type` to append.\n   * @returns {this} \n   */\n  public override append(element: Type): this {\n    this.#checkFull();\n    super.append(element);\n    return this;\n  }\n\n  /**\n   * @inheritdoc\n   * @public\n   * @param {number} index The index under which the specified `element` is inserted.\n   * @param {Type} element The element of `Type` to insert at specified `index`.\n   * @returns {this} \n   */\n  public override insert(index: number, element: Type): this {\n    this.#checkFull();\n    super.insert(index, element);\n    return this;\n  }\n\n  /**\n   * @description Checks whether the `Elements` state is full, equal to size.\n   * @public\n   * @returns {boolean} \n   */\n  public isFull(): boolean {\n    return this.#size === this.length;\n  }\n\n  /**\n   * @description Add the element at the beginning of `array` state.\n   * @public\n   * @param {Type} element The element of `Type` to prepend.\n   * @returns {this} \n   */\n  public override prepend(element: Type): this {\n    this.#checkFull();\n    super.prepend(element);\n    return this;\n  }\n\n  /**\n   * @inheritdoc\n   * @public\n   * @param {number} index The index to update update element.\n   * @param {Type} element The element of `Type` to update under the specified `index`.\n   * @returns {this} \n   */\n  public override update(index: number, element: Type): this {\n    super.update(index, element);\n    return this;\n  }\n\n  /** \n   * @description Checks whether length of the array is equal to maximum size.\n   * @returns {this} \n   */\n  #checkFull(): this {\n    if (this.isFull()) {\n      throw new Error(`Elements array state is full of size ${super.length}.`);\n    }\n    return this;\n  }\n};\n","// Class.\nimport { Boolean as Debug, State } from \"@typescript-package/state\";\n/**\n * @description Class designed for asynchronous processing the promises of `void`.\n * @export\n * @class Processing\n * @extends {State<Set<Promise<void>>>} The state for active processing promises, tracking the status of asynchronous operations.\n */\nexport class Processing extends State<Set<Promise<void>>> {\n  /**\n   * @description Tracks whether there are actively processed promises.\n   * @public\n   * @readonly\n   * @type {boolean}\n   */\n  public get active(): boolean {\n    return super.state.size > 0;\n  }\n\n  /**\n   * @description A current number of promises being processed.\n   * @public\n   * @readonly\n   * @type {number}\n   */\n  public get activeCount(): number {\n    return super.state.size;\n  }\n\n  /**\n   * @description Returns the first promise from processing.\n   * @public\n   * @readonly\n   * @type {Promise<void>}\n   */\n  public get first(): Promise<void> {\n    return Array.from(super.state)[0];\n  }\n\n  /**\n   * @description Returns the last promise from processing.\n   * @public\n   * @readonly\n   * @type {Promise<void>}\n   */\n  public get last(): Promise<void> {\n    return Array.from(super.state)[super.state.size - 1];\n  }\n\n  /**\n   * @description\n   * @type {*}\n   */\n  #debug = new Debug(false);\n\n  /**\n   * Creates a `Processing` object.\n   * @constructor\n   */\n  constructor() {\n    super(new Set());\n  }\n\n  /**\n   * @description Adds the promise to the processing state.\n   * @public\n   * @param {Promise<void>} promise The promise of `void` to add.\n   * @returns {this} \n   */\n  public add(promise: Promise<void>, remove: boolean = true): this {\n    super.state.add(promise);\n    this.#consoleDebug(\"`Promise` added to processing state\", { active: this.active, activeCount: this.activeCount });\n    remove === true && promise.finally(() => this.delete(promise));\n    return this;\n  }\n\n  /**\n   * @description Returns `Promise` that waits for the processing completion.\n   * @public\n   * @async\n   * @returns {Promise<void>} \n   */\n  public async complete(): Promise<void> {\n    this.#consoleDebug(\"Invoked `Processing.complete()` to wait for all processes from the state \", { activeCount: this.activeCount })\n    const promise = Promise.all(super.state);\n    await promise;\n    if (this.#debug.isTrue()) {\n      promise.finally(() => \n        this.#consoleDebug(\"`Processing.complete()` finally method invoked.\", { activeCount: this.activeCount })\n      );\n    }\n  }\n\n  /**\n   * @description Sets the `Processing` to debug state.\n   * @public\n   */\n  public debug(): this {\n    this.#debug.true();\n    return this;\n  }\n\n  /**\n   * @description Removes the specified promise from the processing state.\n   * @public\n   * @param {Promise<void>} promise \n   * @returns {this} \n   */\n  public delete(promise: Promise<void> = this.first): this {\n    this.#consoleDebug(\"`activeCount` state before removing the `Promise`\", { activeCount: this.activeCount })\n    super.state.delete(promise);\n    this.#consoleDebug(\"`Promise` removed from processing state\", { activeCount: this.activeCount });\n    return this;\n  }\n\n  /**\n   * @description Checks whether the `Processing` is active.\n   * @public\n   * @param {?boolean} [expected] An optional `boolean` type value to check the active state.\n   * @returns {boolean} \n   */\n  public isActive(expected?: boolean): boolean {\n    return typeof expected === 'boolean' ? this.active === expected : this.active;\n  }\n\n  /**\n   * @description Unset the `Processing` from the debug state.\n   * @public\n   */\n  public unDebug(): this {\n    this.#debug.false();\n    return this;\n  }\n\n  /**\n   * @description Display the console debug on debug state `true`.\n   * @param {string} message \n   * @param {?*} [data] \n   * @returns {this} \n   */\n  #consoleDebug(message: string, data?: any): this {\n    this.#debug.isTrue() && console.debug(message, data || '');\n    return this;\n  }\n}\n","// Class.\nimport { Elements } from \"./elements.class\";\n/**\n * @description A standard FIFO (First In, First Out) queue.\n * @export\n * @abstract\n * @class Queue\n * @template Type\n */\nexport abstract class Queue<Type, Size extends number = number> {\n  /**\n   * @description The `Elements` state holder.\n   * @public\n   * @readonly\n   * @type {Elements<Type>}\n   */\n  public get elements(): Elements<Type> {\n    return this.#elements;\n  }\n\n  /**\n   * @description The actual queue length.\n   * @public\n   * @readonly\n   * @type {number}\n   */\n  public get length(): number {\n    return this.#elements.length;\n  }\n\n  /**\n   * @description The maximum queue size.\n   * @public\n   * @readonly\n   * @type {Size}\n   */\n  public get size(): Size {\n    return this.#size;\n  }\n\n  /**\n   * @description The actual queue `Elements` state - raw `array` state of the queue.\n   * @public\n   * @readonly\n   * @type {readonly Type[]}\n   */\n  public get state(): readonly Type[] {\n    return this.#elements.state;\n  }\n\n  /**\n   * @description Privately stored maximum queue size of generic type variable `Size`.\n   * @type {Size}\n   */\n  #size: Size;\n\n  /**\n   * @description Privately stored `Array` queue elements state of `Elements`.\n   * @type {Elements<Type>}\n   */\n  #elements: Elements<Type>;\n\n  /**\n   * Creates an instance of child class.\n   * @constructor\n   * @param {Size} [size=Infinity as Size] The maximum size of the `Queue`.\n   * @param {...Type[]} elements The arbitrary parameters of elements of  `Type` to add.\n   */\n  constructor(size: Size = Infinity as Size, ...elements: Type[]) {\n    this.#size = size;\n    this.#elements = new Elements(elements, size);\n  }\n\n  /**\n   * @description Clears the queue.\n   * @public\n   * @returns {this}\n   */\n  public clear(): this {\n    this.#elements.clear();\n    return this;\n  }\n\n  /**\n   * @description Removes and returns the first (front) element from the queue.\n   * @public\n   * @returns {(Type | undefined)}\n   */\n  public dequeue(): Type | undefined {\n    const first = this.#elements.first();\n    this.#elements.remove(0);\n    return first;\n  }\n\n  /**\n   * @description Adds a new element to the queue.\n   * @public\n   * @param {Type} element The element of `Type` to add.\n   * @returns {this}\n   */\n  public enqueue(element: Type): this {\n    if (this.isFull()) {\n      throw new Error(`Queue is full.`);\n    }\n    this.#elements.append(element);\n    return this;\n  }\n\n  /**\n   * @description Checks if the queue is empty.\n   * @public\n   * @returns {boolean}\n   */\n  public isEmpty(): boolean {\n    return this.length === 0;\n  }\n\n  /**\n   * @description Checks if the queue is full.\n   * @public\n   * @returns {boolean}\n   */\n  public isFull(): boolean {\n    return this.#elements.isFull();\n  }\n\n  /**\n   * @description Returns the first element in the queue.\n   * @public\n   * @returns {Type}\n   */\n  public peek(): Type {\n    return this.#elements.first();\n  }\n}\n","// Class.\nimport { Ability as Processable, Boolean as Active, Boolean as Debug } from \"@typescript-package/state\";\nimport { Processing } from \"./processing.class\";\n// Type.\nimport { ErrorCallback, ProcessCallback } from \"../type\";\n/**\n * @description A class designed to manage and execute a collection of asynchronous tasks with concurrently control or synchronous tasks.\n * @export\n * @class Tasks\n * @template Type \n * @extends {Processable}\n */\nexport class Tasks<Type = any, Concurrency extends number = number> extends Processable {\n  /**\n   * @description The maximum number of elements that can be processed concurrently.\n   * @public\n   * @readonly\n   * @type {Concurrency}\n   */\n  public get concurrency(): Concurrency {\n    return this.#concurrency;\n  }\n\n  /**\n   * @description Returns the processed elements.\n   * @public\n   * @readonly\n   * @type {Set<Type>}\n   */\n  public get processed(): Set<Type> {\n    return this.#processed;\n  }\n\n  /**\n   * @description Returns the `Processing` object that contains active tasks.\n   * @public\n   * @readonly\n   * @type {Processing<Type, Concurrency>}\n   */\n  public get processing(): Processing {\n    return this.#processing;\n  }\n\n  /**\n   * @description Active state for synchronous processing.\n   * @type {Active}\n   */\n  #active = new Active(false);\n\n  /**\n   * @description Privately stored maximum number of elements that can be processed concurrently.\n   * @type {Concurrency}\n   */\n  #concurrency: Concurrency;\n\n  /**\n   * @description Privately stored debug state.\n   * @type {Debug}\n   */\n  #debug = new Debug(false);\n\n  /**\n   * @description A set of processed elements.\n   * @type {Set<Type>}\n   */\n  #processed: Set<Type> = new Set();\n\n  /**\n   * @description Privately stored `Processing` object that contains active tasks.\n   * @type {Processing}\n   */\n  #processing;\n\n  /**\n   * Creates an instance of `Tasks`.\n   * @constructor\n   * @param {Concurrency} concurrency \n   */\n  \n  /**\n   * Creates an instance of `Tasks`.\n   * @constructor\n   * @param {boolean} enabled Enable initially `Tasks` functionality.\n   * @param {Concurrency} concurrency The maximum number of elements that can be processed concurrently.\n   */\n  constructor(enabled: boolean, concurrency: Concurrency) {\n    super(enabled);\n    this.#processing = new Processing();\n    this.#concurrency = concurrency;\n  }\n\n  /**\n   * @description Set the `Tasks` to debug state.\n   * @public\n   */\n  public debug(): this {\n    this.#debug.true();\n    this.#processing.debug();\n    return this;\n  }\n\n  /**\n   * @description Runs asynchronous single processing on the `element`.\n   * @public\n   * @async\n   * @param {Type} element The element to process.\n   * @param {ProcessCallback<Type>} callbackFn The callback function to process the element.\n   * @param {ErrorCallback<Type>} [onError] An optional error handler.\n   * @returns {Promise<void>}\n   */\n  public async asyncProcess(\n    element: Type,\n    callbackFn: ProcessCallback<Type>,\n    onError?: ErrorCallback<Type>,\n    onProcessed?: ProcessCallback<Type>\n  ): Promise<void> {\n    if (this.isDisabled()) {\n      throw new Error(`Enable the functionality to use the \\`asyncProcess()\\` method.`);\n    }\n    this.#consoleDebug(\"asyncProcess started\", { element });\n    // Create a promise.\n    const task = (async () => {\n      try {\n        this.#consoleDebug(\"Processing element:\", element);\n        await callbackFn(element);\n      } catch (error) {\n        this.#consoleDebug(\"Error occurred during processing:\", { element, error });\n        onError?.(element, error);\n      } finally {\n        onProcessed?.(element); // What to do with the processed\n        this.#processed.add(element);\n        this.#consoleDebug(\"Element processed:\", { element, processed: this.#processed.size });\n      }\n    })();\n    // Add the task to the processing state.\n    await this.#processing.add(task);\n  }\n\n  /**\n   * @description Starts asynchronous processing elements with concurrency control.\n   * @public\n   * @async\n   * @param {Iterable<Type>} elements The elements to process.\n   * @param {ProcessCallback<Type>} callbackFn The function to process each element.\n   * @param {?ErrorCallback<Type>} [onError] An optional error handler.\n   * @param {('default' | 'race')} [method='default'] \n   * @returns {Promise<void>} \n   */\n  public async asyncRun(\n    elements: Iterable<Type>,\n    callbackFn: ProcessCallback<Type>,\n    onError?: ErrorCallback<Type>,\n    onProcessed?: ProcessCallback<Type>,\n    method: 'all' | 'default' | 'race' = 'default'\n  ): Promise<Set<Type>> {\n    if (this.isDisabled()) {\n      throw new Error(`Enable the functionality to use the \\`asyncRun()\\` method.`);\n    }\n    this.#consoleDebug(\"asyncRun started\", { method, concurrency: this.#concurrency });\n    switch(method) {\n      case 'race':\n        this.#consoleDebug(\"Using 'race' method\");\n        for (const element of elements) {\n          this.#consoleDebug(\"Processing element with 'race'\", { element, activeCount: this.#processing.activeCount });\n          this.#processing.activeCount >= this.#concurrency && await Promise.race(this.#processing.state);\n          this.asyncProcess(element, callbackFn, onError, onProcessed);\n        }\n        break\n      case 'all':\n      default:\n        this.#consoleDebug(\"Using the 'default' / 'all' method\");\n        const iterator = elements[Symbol.iterator]();\n        // Create the async process for the task.\n        const process = async (): Promise<void> => {\n          while (this.#processing.activeCount < this.#concurrency) {\n            const { value: element, done } = iterator.next();\n            if (done) break;\n            this.#consoleDebug(\"Processing element with default\", { element, concurrency: this.#concurrency, activeCount: this.#processing.activeCount });\n            const task = this\n              .asyncProcess(element, callbackFn, onError, onProcessed)\n              .finally(() => (this.#processing.delete(task), process()));\n            this.#consoleDebug(\"Add the processed task to the processing.\", {element, task});\n            this.#processing.add(task, false);\n          }\n          // Wait for the tasks to finish.\n          await Promise.all(this.#processing.state)\n        };\n        await process();\n        break;\n    }\n    this.#consoleDebug(\"asyncRun completed\");\n    await this.#processing.complete();\n    return this.#processed;\n  }\n\n  /**\n   * @description Runs a synchronous processing on the provided `element` using the `callbackFn`.\n   * If an `onError` callback is provided, it will handle any errors encountered during processing.\n   * @param {(Type | undefined)} element The element to be processed.\n   * @param {ProcessCallback<Type>} callbackFn A function that processes the element synchronously.\n   * @param {?ErrorCallback<Type>} [onError] An optional callback function to handle errors during processing.\n   * @returns {this} The current instance for method chaining.\n   */\n  public process(\n    element: Type | undefined,\n    callbackFn: ProcessCallback<Type>,\n    onError?: ErrorCallback<Type>,\n    onProcessed?: ProcessCallback<Type>\n  ): this {\n    if (this.isDisabled()) {\n      throw new Error(`Enable the functionality to use the \\`process()\\` method.`);\n    }\n    this.#consoleDebug(\"process started\", { element });\n    this.#active.isFalse() && this.#active.true();\n    this.#consoleDebug(\"Processing state activated\", { active: this.#active.state });\n    if (element) {\n      try {\n        this.#consoleDebug(\"Processing element\", { element });\n        callbackFn(element);\n      } catch(error) {\n        this.#consoleDebug(\"Error during processing\", { error, element });\n        onError?.(element, error);\n      } finally {\n        onProcessed?.(element);\n        // Add to the processed.\n        this.#processed.add(element);\n        this.#consoleDebug(\"Element processed\", { element, processedCount: this.#processed.size });\n        this.#active.false();\n        this.#consoleDebug(\"Processing state deactivated\", { active: this.#active.state });\n      }  \n    }\n    return this;\n  }\n\n  /**\n   * @description Runs the provided `callbackFn` synchronously on each element in the `elements` iterable.\n   * If an `onError` callback is provided, it will handle errors encountered during processing.\n   * @public\n   * @param {Iterable<Type>} elements An iterable collection of elements to be processed.\n   * @param {ProcessCallback<Type>} callbackFn A function that will process each element synchronously.\n   * @param {?ErrorCallback<Type>} [onError] Optional callback for handling errors that occur during processing.\n   */\n  public run(\n    elements: Iterable<Type>,\n    callbackFn: ProcessCallback<Type>,\n    onError?: ErrorCallback<Type>,\n    onProcessed?: ProcessCallback<Type>\n  ) {\n    if (this.isDisabled()) {\n      throw new Error(`Enable the functionality to use the \\`run()\\` method.`);\n    }\n    this.#consoleDebug(\"run started\", { elements });\n    for (const element of elements) {\n      this.#consoleDebug(\"Processing element synchronously\", { element });\n      this.process(element, callbackFn, onError, onProcessed);\n    }\n    this.#consoleDebug(\"run completed\");\n  }\n\n  /**\n   * @description Unset the `Tasks` from debug state.\n   * @public\n   */\n  public unDebug(): this {\n    this.#debug.false();\n    this.#processing.unDebug();\n    return this;\n  }\n\n  /**\n   * @description Console debug the important steps of the `Tasks` functionality on debug state `true`.\n   * @param {string} message \n   * @param {?*} [data] \n   * @returns {this} \n   */\n  #consoleDebug(message: string, data?: any): this {\n    this.#debug.isTrue() && console.debug(message, data || '');\n    return this;\n  }\n}\n","// Abstract.\nimport { Queue } from \"./queue.abstract\";\n// Class.\nimport { Processing } from \"./processing.class\";\nimport { Tasks } from \"./tasks.class\";\n// Type.\nimport { ErrorCallback, ProcessCallback } from \"../type\";\n/**\n * @description A task queue that processes elements concurrently with a specified concurrency limit.\n * @export\n * @class TaskQueue\n * @template Type \n * @template {number} [Concurrency=number] \n * @template {number} [Size=number] \n * @extends {Queue<Type, Size>}\n */\nexport class TaskQueue<\n  Type,\n  Concurrency extends number = number,\n  Size extends number = number\n> extends Queue<Type, Size> {\n  /**\n   * @description The maximum number of elements that can be processed concurrently.\n   * @public\n   * @readonly\n   * @type {Concurrency}\n   */\n  public get concurrency() {\n    return this.#tasks.concurrency;\n  }\n\n  /**\n   * @description Returns the processed elements.\n   * @public\n   * @readonly\n   * @type {Set<Type>}\n   */\n  public get processed(): Set<Type> {\n    return this.#tasks.processed;\n  }\n\n  /**\n   * @description Returns the `Processing` object that contains active tasks.\n   * @public\n   * @readonly\n   * @type {Processing<Type, Concurrency>}\n   */\n  public get processing(): Processing {\n    return this.#tasks.processing;\n  }\n\n  /**\n   * @description The `Tasks` object to handle the processing.\n   * @type {Tasks<Type, Concurrency>}\n   */\n  #tasks;\n  \n  /**\n   * Creates an instance of child class.\n   * @constructor\n   * @param {Concurrency} [concurrency=1 as Concurrency] \n   * @param {Size} [size=Infinity as Size] \n   * @param {...Type[]} elements \n   */\n  constructor(\n    concurrency: Concurrency = 1 as Concurrency,\n    size: Size = Infinity as Size,\n    ...elements: Type[]\n  ) {\n    super(size, ...elements);\n    this.#tasks = new Tasks<Type, Concurrency>(true, concurrency);\n  }\n\n  /**\n   * @description Checks whether the queue processing is completed.\n   * @public\n   * @returns {boolean} \n   */\n  public isCompleted(): boolean {\n    return super.length === 0 && this.#tasks.processing.activeCount === 0 && this.#tasks.processing.isActive(false);\n  } \n  \n  //#region Public async\n  /**\n   * @description Waits for all elements in the queue to be processed and returns the set of processed elements.\n   * @public\n   * @async\n   * @returns {Promise<Set<Type>>}\n   */\n  public async onCompleted(): Promise<Set<Type>> {\n    return new Promise<Set<Type>>((resolve, reject) => {\n      const interval = setInterval(() => \n        this.#tasks.processing.isActive()\n        ? super.length === 0 && resolve([] as any) // TODO: this.#tasks.processed\n        : clearInterval(interval)\n      , 50);\n    });\n  }\n\n  /**\n   * @description Starts asynchronous processing queue elements with concurrency control.\n   * @public\n   * @async\n   * @param {ProcessCallback<Type>} callbackFn The function to process each element.\n   * @param {?ErrorCallback<Type>} [onError] An optional error handler.\n   * @returns {Promise<Set<Type>>} \n   */\n  public async asyncRun(\n    callbackFn: ProcessCallback<Type>,\n    onError?: ErrorCallback<Type>,\n  ): Promise<Set<Type>> {\n    const process = async () => {\n      while (this.#tasks.processing.activeCount < this.#tasks.concurrency && super.length > 0) {\n        const element = this.dequeue();\n        if (element) {\n          const task = this.#tasks\n            .asyncProcess(element, callbackFn, onError)\n            .finally(() => (this.#tasks.processing.delete(task), process()));\n          this.#tasks.processing.add(task, false);\n        }\n      }\n      this.#tasks.processing.activeCount > 0 && await Promise.all(this.#tasks.processing.state);\n    }\n    await process();\n    await this.#tasks.processing.complete();\n    return this.#tasks.processed;\n  }\n  // #endregion Public async\n\n  /**\n   * @description Starts processing elements in the queue using the provided callback function.\n   * @public\n   * @param {(element: Type) => void} callbackFn A function to process each element in the queue.\n   * @param {?(element: Type, error: unknown) => void} [onError] An optional function to handle the error.\n   * @returns {void) => void}\n   */\n  public run(callbackFn: (element: Type) => void, onError?: (element: Type, error: unknown) => void) {\n    while (super.length > 0) {\n      this.#tasks.process(this.dequeue(), callbackFn, onError);\n    }\n  }\n}\n","import { Elements } from \"./elements.class\";\nimport { Queue as AbstractQueue } from \"./queue.abstract\";\n/**\n * @description A standard LIFO (Last In, First Out) queue.\n * @export\n * @abstract\n * @class Stack\n * @template Type\n */\nexport abstract class Stack<Type, Size extends number> {\n  /**\n   * @description The `Elements` of array state type.\n   * @public\n   * @readonly\n   * @type {Elements<Type>}\n   */\n  public get elements(): Elements<Type> {\n    return this.#stack.elements;\n  }\n\n  /**\n   * @description The actual stack length.\n   * @public\n   * @readonly\n   * @type {number}\n   */\n  public get length() {\n    return this.#stack.length;\n  }\n\n  /**\n   * @description The maximum stack size.\n   * @public\n   * @readonly\n   * @type {number}\n   */\n  public get size(): number {\n    return this.#size;\n  }\n\n  /**\n   * @description The actual stack `Elements` state.\n   * @public\n   * @readonly\n   * @type {readonly Type[]}\n   */\n  public get state(): readonly Type[] {\n    return this.#stack.elements.state;\n  }\n\n  /**\n   * @description Privately stored maximum stack size.\n   * @type {number}\n   */\n  #size;\n\n  /**\n   * @description Privately stored `Array` stack state.\n   * @type {ArrayState<Type>}\n   */\n  #stack;\n\n  /**\n   * Creates an instance of `Stack`.\n   * @constructor\n   * @param {number} [size=Infinity]\n   * @param {...Type[]} elements\n   */\n  constructor(size: Size = Infinity as Size, ...elements: Type[]) {\n    this.#size = size;\n    this.#stack = new (class Stack<Type, Size extends number> extends AbstractQueue<Type, Size> {})(size, ...elements);\n  }\n\n  /**\n   * @description Clears the queue.\n   * @public\n   * @returns {this}\n   */\n  public clear(): this {\n    this.#stack.clear();\n    return this;\n  }\n\n  /**\n   * @description Checks whether the stack is empty.\n   * @public\n   * @returns {boolean}\n   */\n  public isEmpty(): boolean {\n    return this.#stack.isEmpty();\n  }\n\n  /**\n   * @description Checks if the stack is full.\n   * @public\n   * @returns {boolean}\n   */\n  public isFull(): boolean {\n    return this.#stack.isFull();\n  }\n\n  /**\n   * @description Returns the top element on the stack.\n   * @public\n   * @returns {(Type | undefined)}\n   */\n  public peek(): Type | undefined {\n    return this.#stack.elements.last();\n  }\n\n  /**\n   * @description Removes and returns the top element from the stack.\n   * @public\n   * @returns {(Type | undefined)} \n   */\n  public pop(): Type | undefined {\n    const last = this.peek();\n    this.#stack.length > 0 && this.#stack.elements.remove(this.#stack.length - 1);\n    return last;\n  }\n\n  /**\n   * @description Adds a new element on the stack.\n   * @public\n   * @param {Type} element\n   * @returns {this}\n   */\n  public push(element: Type): this {\n    this.#stack.elements.append(element);\n    return this;\n  }\n}\n","// Class.\nexport { Elements } from './elements.class';\nexport { Processing } from './processing.class';\nexport { TaskQueue } from './task-queue.class';\nexport { Tasks } from './tasks.class';\n// Abstract.\nexport { Queue } from './queue.abstract';\nexport { Stack } from './stack.abstract';","/*\n * Public API Surface of queue\n */\nexport {\n  // Class.\n  Elements,\n  Processing,\n  TaskQueue,\n  Tasks,\n  // Abstract.\n  Queue,\n  Stack\n} from './lib';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Debug","Processable","Active","AbstractQueue"],"mappings":";;AAAA;AAEA;;;;;;AAMG;AACG,MAAO,QAA6C,SAAQ,UAAgB,CAAA;AAChF;;;;;AAKG;AACH,IAAA,IAAW,IAAI,GAAA;QACb,OAAO,IAAI,CAAC,KAAK;;AAGnB;;;AAGG;AACH,IAAA,KAAK;AAEL;;;;;AAKG;IACH,WAAY,CAAA,QAAgB,EAAE,IAAA,GAAa,QAAgB,EAAA;AACzD,QAAA,KAAK,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,GAAG,QAAQ,GAAG,EAAE,CAAC;;AAE9C,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI;;AAEjB,QAAA,IAAI,QAAQ,CAAC,MAAM,GAAG,IAAI,EAAE;AAC1B,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,+CAAA,EAAkD,IAAI,CAAA,IAAA,EAAO,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAA,CAAA,CAAG,CAAC;;;AAI3G;;;;;AAKG;AACa,IAAA,MAAM,CAAC,OAAa,EAAA;QAClC,IAAI,CAAC,UAAU,EAAE;AACjB,QAAA,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;AACrB,QAAA,OAAO,IAAI;;AAGb;;;;;;AAMG;IACa,MAAM,CAAC,KAAa,EAAE,OAAa,EAAA;QACjD,IAAI,CAAC,UAAU,EAAE;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