import { D as DataModel } from './data-model-f7ccf826.js';

class ItemFetchState {
  constructor(data, isPending = false, error) {
    this.beforeFetch = () => new ItemFetchState(this.data, true, undefined);
    this.afterFetch = (response) => new ItemFetchState(DataModel.decode(response), false, undefined);
    this.afterFetchError = (error) => new ItemFetchState(this.data, false, error);
    this.data = data;
    this.error = error;
    this.isPending = isPending;
  }
}
ItemFetchState.init = () => new ItemFetchState();

export { ItemFetchState as I };
