// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark

part of 'product_loader_bloc.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
  'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);

/// @nodoc
mixin _$ProductLoaderEvent {
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
      String? categoryId,
      String? search,
      bool? forceRefresh,
    )
    getProduct,
    required TResult Function(String? categoryId, String? search) loadMore,
    required TResult Function() refresh,
    required TResult Function(String? query, String? categoryId) searchProduct,
    required TResult Function() getDatabaseStats,
    required TResult Function() clearCache,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult? Function(String? categoryId, String? search)? loadMore,
    TResult? Function()? refresh,
    TResult? Function(String? query, String? categoryId)? searchProduct,
    TResult? Function()? getDatabaseStats,
    TResult? Function()? clearCache,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult Function(String? categoryId, String? search)? loadMore,
    TResult Function()? refresh,
    TResult Function(String? query, String? categoryId)? searchProduct,
    TResult Function()? getDatabaseStats,
    TResult Function()? clearCache,
    required TResult orElse(),
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_GetProduct value) getProduct,
    required TResult Function(_LoadMore value) loadMore,
    required TResult Function(_Refresh value) refresh,
    required TResult Function(_SearchProduct value) searchProduct,
    required TResult Function(_GetDatabaseStats value) getDatabaseStats,
    required TResult Function(_ClearCache value) clearCache,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_GetProduct value)? getProduct,
    TResult? Function(_LoadMore value)? loadMore,
    TResult? Function(_Refresh value)? refresh,
    TResult? Function(_SearchProduct value)? searchProduct,
    TResult? Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult? Function(_ClearCache value)? clearCache,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_GetProduct value)? getProduct,
    TResult Function(_LoadMore value)? loadMore,
    TResult Function(_Refresh value)? refresh,
    TResult Function(_SearchProduct value)? searchProduct,
    TResult Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult Function(_ClearCache value)? clearCache,
    required TResult orElse(),
  }) => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $ProductLoaderEventCopyWith<$Res> {
  factory $ProductLoaderEventCopyWith(
    ProductLoaderEvent value,
    $Res Function(ProductLoaderEvent) then,
  ) = _$ProductLoaderEventCopyWithImpl<$Res, ProductLoaderEvent>;
}

/// @nodoc
class _$ProductLoaderEventCopyWithImpl<$Res, $Val extends ProductLoaderEvent>
    implements $ProductLoaderEventCopyWith<$Res> {
  _$ProductLoaderEventCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc
abstract class _$$GetProductImplCopyWith<$Res> {
  factory _$$GetProductImplCopyWith(
    _$GetProductImpl value,
    $Res Function(_$GetProductImpl) then,
  ) = __$$GetProductImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String? categoryId, String? search, bool? forceRefresh});
}

/// @nodoc
class __$$GetProductImplCopyWithImpl<$Res>
    extends _$ProductLoaderEventCopyWithImpl<$Res, _$GetProductImpl>
    implements _$$GetProductImplCopyWith<$Res> {
  __$$GetProductImplCopyWithImpl(
    _$GetProductImpl _value,
    $Res Function(_$GetProductImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? categoryId = freezed,
    Object? search = freezed,
    Object? forceRefresh = freezed,
  }) {
    return _then(
      _$GetProductImpl(
        categoryId: freezed == categoryId
            ? _value.categoryId
            : categoryId // ignore: cast_nullable_to_non_nullable
                  as String?,
        search: freezed == search
            ? _value.search
            : search // ignore: cast_nullable_to_non_nullable
                  as String?,
        forceRefresh: freezed == forceRefresh
            ? _value.forceRefresh
            : forceRefresh // ignore: cast_nullable_to_non_nullable
                  as bool?,
      ),
    );
  }
}

/// @nodoc

class _$GetProductImpl implements _GetProduct {
  const _$GetProductImpl({this.categoryId, this.search, this.forceRefresh});

  @override
  final String? categoryId;
  @override
  final String? search;
  // Added search parameter
  @override
  final bool? forceRefresh;

  @override
  String toString() {
    return 'ProductLoaderEvent.getProduct(categoryId: $categoryId, search: $search, forceRefresh: $forceRefresh)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$GetProductImpl &&
            (identical(other.categoryId, categoryId) ||
                other.categoryId == categoryId) &&
            (identical(other.search, search) || other.search == search) &&
            (identical(other.forceRefresh, forceRefresh) ||
                other.forceRefresh == forceRefresh));
  }

  @override
  int get hashCode =>
      Object.hash(runtimeType, categoryId, search, forceRefresh);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$GetProductImplCopyWith<_$GetProductImpl> get copyWith =>
      __$$GetProductImplCopyWithImpl<_$GetProductImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
      String? categoryId,
      String? search,
      bool? forceRefresh,
    )
    getProduct,
    required TResult Function(String? categoryId, String? search) loadMore,
    required TResult Function() refresh,
    required TResult Function(String? query, String? categoryId) searchProduct,
    required TResult Function() getDatabaseStats,
    required TResult Function() clearCache,
  }) {
    return getProduct(categoryId, search, forceRefresh);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult? Function(String? categoryId, String? search)? loadMore,
    TResult? Function()? refresh,
    TResult? Function(String? query, String? categoryId)? searchProduct,
    TResult? Function()? getDatabaseStats,
    TResult? Function()? clearCache,
  }) {
    return getProduct?.call(categoryId, search, forceRefresh);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult Function(String? categoryId, String? search)? loadMore,
    TResult Function()? refresh,
    TResult Function(String? query, String? categoryId)? searchProduct,
    TResult Function()? getDatabaseStats,
    TResult Function()? clearCache,
    required TResult orElse(),
  }) {
    if (getProduct != null) {
      return getProduct(categoryId, search, forceRefresh);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_GetProduct value) getProduct,
    required TResult Function(_LoadMore value) loadMore,
    required TResult Function(_Refresh value) refresh,
    required TResult Function(_SearchProduct value) searchProduct,
    required TResult Function(_GetDatabaseStats value) getDatabaseStats,
    required TResult Function(_ClearCache value) clearCache,
  }) {
    return getProduct(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_GetProduct value)? getProduct,
    TResult? Function(_LoadMore value)? loadMore,
    TResult? Function(_Refresh value)? refresh,
    TResult? Function(_SearchProduct value)? searchProduct,
    TResult? Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult? Function(_ClearCache value)? clearCache,
  }) {
    return getProduct?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_GetProduct value)? getProduct,
    TResult Function(_LoadMore value)? loadMore,
    TResult Function(_Refresh value)? refresh,
    TResult Function(_SearchProduct value)? searchProduct,
    TResult Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult Function(_ClearCache value)? clearCache,
    required TResult orElse(),
  }) {
    if (getProduct != null) {
      return getProduct(this);
    }
    return orElse();
  }
}

abstract class _GetProduct implements ProductLoaderEvent {
  const factory _GetProduct({
    final String? categoryId,
    final String? search,
    final bool? forceRefresh,
  }) = _$GetProductImpl;

  String? get categoryId;
  String? get search; // Added search parameter
  bool? get forceRefresh;

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$GetProductImplCopyWith<_$GetProductImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$LoadMoreImplCopyWith<$Res> {
  factory _$$LoadMoreImplCopyWith(
    _$LoadMoreImpl value,
    $Res Function(_$LoadMoreImpl) then,
  ) = __$$LoadMoreImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String? categoryId, String? search});
}

/// @nodoc
class __$$LoadMoreImplCopyWithImpl<$Res>
    extends _$ProductLoaderEventCopyWithImpl<$Res, _$LoadMoreImpl>
    implements _$$LoadMoreImplCopyWith<$Res> {
  __$$LoadMoreImplCopyWithImpl(
    _$LoadMoreImpl _value,
    $Res Function(_$LoadMoreImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({Object? categoryId = freezed, Object? search = freezed}) {
    return _then(
      _$LoadMoreImpl(
        categoryId: freezed == categoryId
            ? _value.categoryId
            : categoryId // ignore: cast_nullable_to_non_nullable
                  as String?,
        search: freezed == search
            ? _value.search
            : search // ignore: cast_nullable_to_non_nullable
                  as String?,
      ),
    );
  }
}

/// @nodoc

class _$LoadMoreImpl implements _LoadMore {
  const _$LoadMoreImpl({this.categoryId, this.search});

  @override
  final String? categoryId;
  @override
  final String? search;

  @override
  String toString() {
    return 'ProductLoaderEvent.loadMore(categoryId: $categoryId, search: $search)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$LoadMoreImpl &&
            (identical(other.categoryId, categoryId) ||
                other.categoryId == categoryId) &&
            (identical(other.search, search) || other.search == search));
  }

  @override
  int get hashCode => Object.hash(runtimeType, categoryId, search);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$LoadMoreImplCopyWith<_$LoadMoreImpl> get copyWith =>
      __$$LoadMoreImplCopyWithImpl<_$LoadMoreImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
      String? categoryId,
      String? search,
      bool? forceRefresh,
    )
    getProduct,
    required TResult Function(String? categoryId, String? search) loadMore,
    required TResult Function() refresh,
    required TResult Function(String? query, String? categoryId) searchProduct,
    required TResult Function() getDatabaseStats,
    required TResult Function() clearCache,
  }) {
    return loadMore(categoryId, search);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult? Function(String? categoryId, String? search)? loadMore,
    TResult? Function()? refresh,
    TResult? Function(String? query, String? categoryId)? searchProduct,
    TResult? Function()? getDatabaseStats,
    TResult? Function()? clearCache,
  }) {
    return loadMore?.call(categoryId, search);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult Function(String? categoryId, String? search)? loadMore,
    TResult Function()? refresh,
    TResult Function(String? query, String? categoryId)? searchProduct,
    TResult Function()? getDatabaseStats,
    TResult Function()? clearCache,
    required TResult orElse(),
  }) {
    if (loadMore != null) {
      return loadMore(categoryId, search);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_GetProduct value) getProduct,
    required TResult Function(_LoadMore value) loadMore,
    required TResult Function(_Refresh value) refresh,
    required TResult Function(_SearchProduct value) searchProduct,
    required TResult Function(_GetDatabaseStats value) getDatabaseStats,
    required TResult Function(_ClearCache value) clearCache,
  }) {
    return loadMore(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_GetProduct value)? getProduct,
    TResult? Function(_LoadMore value)? loadMore,
    TResult? Function(_Refresh value)? refresh,
    TResult? Function(_SearchProduct value)? searchProduct,
    TResult? Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult? Function(_ClearCache value)? clearCache,
  }) {
    return loadMore?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_GetProduct value)? getProduct,
    TResult Function(_LoadMore value)? loadMore,
    TResult Function(_Refresh value)? refresh,
    TResult Function(_SearchProduct value)? searchProduct,
    TResult Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult Function(_ClearCache value)? clearCache,
    required TResult orElse(),
  }) {
    if (loadMore != null) {
      return loadMore(this);
    }
    return orElse();
  }
}

abstract class _LoadMore implements ProductLoaderEvent {
  const factory _LoadMore({final String? categoryId, final String? search}) =
      _$LoadMoreImpl;

  String? get categoryId;
  String? get search;

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$LoadMoreImplCopyWith<_$LoadMoreImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$RefreshImplCopyWith<$Res> {
  factory _$$RefreshImplCopyWith(
    _$RefreshImpl value,
    $Res Function(_$RefreshImpl) then,
  ) = __$$RefreshImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$RefreshImplCopyWithImpl<$Res>
    extends _$ProductLoaderEventCopyWithImpl<$Res, _$RefreshImpl>
    implements _$$RefreshImplCopyWith<$Res> {
  __$$RefreshImplCopyWithImpl(
    _$RefreshImpl _value,
    $Res Function(_$RefreshImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc

class _$RefreshImpl implements _Refresh {
  const _$RefreshImpl();

  @override
  String toString() {
    return 'ProductLoaderEvent.refresh()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType && other is _$RefreshImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
      String? categoryId,
      String? search,
      bool? forceRefresh,
    )
    getProduct,
    required TResult Function(String? categoryId, String? search) loadMore,
    required TResult Function() refresh,
    required TResult Function(String? query, String? categoryId) searchProduct,
    required TResult Function() getDatabaseStats,
    required TResult Function() clearCache,
  }) {
    return refresh();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult? Function(String? categoryId, String? search)? loadMore,
    TResult? Function()? refresh,
    TResult? Function(String? query, String? categoryId)? searchProduct,
    TResult? Function()? getDatabaseStats,
    TResult? Function()? clearCache,
  }) {
    return refresh?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult Function(String? categoryId, String? search)? loadMore,
    TResult Function()? refresh,
    TResult Function(String? query, String? categoryId)? searchProduct,
    TResult Function()? getDatabaseStats,
    TResult Function()? clearCache,
    required TResult orElse(),
  }) {
    if (refresh != null) {
      return refresh();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_GetProduct value) getProduct,
    required TResult Function(_LoadMore value) loadMore,
    required TResult Function(_Refresh value) refresh,
    required TResult Function(_SearchProduct value) searchProduct,
    required TResult Function(_GetDatabaseStats value) getDatabaseStats,
    required TResult Function(_ClearCache value) clearCache,
  }) {
    return refresh(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_GetProduct value)? getProduct,
    TResult? Function(_LoadMore value)? loadMore,
    TResult? Function(_Refresh value)? refresh,
    TResult? Function(_SearchProduct value)? searchProduct,
    TResult? Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult? Function(_ClearCache value)? clearCache,
  }) {
    return refresh?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_GetProduct value)? getProduct,
    TResult Function(_LoadMore value)? loadMore,
    TResult Function(_Refresh value)? refresh,
    TResult Function(_SearchProduct value)? searchProduct,
    TResult Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult Function(_ClearCache value)? clearCache,
    required TResult orElse(),
  }) {
    if (refresh != null) {
      return refresh(this);
    }
    return orElse();
  }
}

abstract class _Refresh implements ProductLoaderEvent {
  const factory _Refresh() = _$RefreshImpl;
}

/// @nodoc
abstract class _$$SearchProductImplCopyWith<$Res> {
  factory _$$SearchProductImplCopyWith(
    _$SearchProductImpl value,
    $Res Function(_$SearchProductImpl) then,
  ) = __$$SearchProductImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String? query, String? categoryId});
}

/// @nodoc
class __$$SearchProductImplCopyWithImpl<$Res>
    extends _$ProductLoaderEventCopyWithImpl<$Res, _$SearchProductImpl>
    implements _$$SearchProductImplCopyWith<$Res> {
  __$$SearchProductImplCopyWithImpl(
    _$SearchProductImpl _value,
    $Res Function(_$SearchProductImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({Object? query = freezed, Object? categoryId = freezed}) {
    return _then(
      _$SearchProductImpl(
        query: freezed == query
            ? _value.query
            : query // ignore: cast_nullable_to_non_nullable
                  as String?,
        categoryId: freezed == categoryId
            ? _value.categoryId
            : categoryId // ignore: cast_nullable_to_non_nullable
                  as String?,
      ),
    );
  }
}

/// @nodoc

class _$SearchProductImpl implements _SearchProduct {
  const _$SearchProductImpl({this.query, this.categoryId});

  @override
  final String? query;
  @override
  final String? categoryId;

  @override
  String toString() {
    return 'ProductLoaderEvent.searchProduct(query: $query, categoryId: $categoryId)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$SearchProductImpl &&
            (identical(other.query, query) || other.query == query) &&
            (identical(other.categoryId, categoryId) ||
                other.categoryId == categoryId));
  }

  @override
  int get hashCode => Object.hash(runtimeType, query, categoryId);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$SearchProductImplCopyWith<_$SearchProductImpl> get copyWith =>
      __$$SearchProductImplCopyWithImpl<_$SearchProductImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
      String? categoryId,
      String? search,
      bool? forceRefresh,
    )
    getProduct,
    required TResult Function(String? categoryId, String? search) loadMore,
    required TResult Function() refresh,
    required TResult Function(String? query, String? categoryId) searchProduct,
    required TResult Function() getDatabaseStats,
    required TResult Function() clearCache,
  }) {
    return searchProduct(query, categoryId);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult? Function(String? categoryId, String? search)? loadMore,
    TResult? Function()? refresh,
    TResult? Function(String? query, String? categoryId)? searchProduct,
    TResult? Function()? getDatabaseStats,
    TResult? Function()? clearCache,
  }) {
    return searchProduct?.call(query, categoryId);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult Function(String? categoryId, String? search)? loadMore,
    TResult Function()? refresh,
    TResult Function(String? query, String? categoryId)? searchProduct,
    TResult Function()? getDatabaseStats,
    TResult Function()? clearCache,
    required TResult orElse(),
  }) {
    if (searchProduct != null) {
      return searchProduct(query, categoryId);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_GetProduct value) getProduct,
    required TResult Function(_LoadMore value) loadMore,
    required TResult Function(_Refresh value) refresh,
    required TResult Function(_SearchProduct value) searchProduct,
    required TResult Function(_GetDatabaseStats value) getDatabaseStats,
    required TResult Function(_ClearCache value) clearCache,
  }) {
    return searchProduct(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_GetProduct value)? getProduct,
    TResult? Function(_LoadMore value)? loadMore,
    TResult? Function(_Refresh value)? refresh,
    TResult? Function(_SearchProduct value)? searchProduct,
    TResult? Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult? Function(_ClearCache value)? clearCache,
  }) {
    return searchProduct?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_GetProduct value)? getProduct,
    TResult Function(_LoadMore value)? loadMore,
    TResult Function(_Refresh value)? refresh,
    TResult Function(_SearchProduct value)? searchProduct,
    TResult Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult Function(_ClearCache value)? clearCache,
    required TResult orElse(),
  }) {
    if (searchProduct != null) {
      return searchProduct(this);
    }
    return orElse();
  }
}

abstract class _SearchProduct implements ProductLoaderEvent {
  const factory _SearchProduct({
    final String? query,
    final String? categoryId,
  }) = _$SearchProductImpl;

  String? get query;
  String? get categoryId;

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$SearchProductImplCopyWith<_$SearchProductImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$GetDatabaseStatsImplCopyWith<$Res> {
  factory _$$GetDatabaseStatsImplCopyWith(
    _$GetDatabaseStatsImpl value,
    $Res Function(_$GetDatabaseStatsImpl) then,
  ) = __$$GetDatabaseStatsImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$GetDatabaseStatsImplCopyWithImpl<$Res>
    extends _$ProductLoaderEventCopyWithImpl<$Res, _$GetDatabaseStatsImpl>
    implements _$$GetDatabaseStatsImplCopyWith<$Res> {
  __$$GetDatabaseStatsImplCopyWithImpl(
    _$GetDatabaseStatsImpl _value,
    $Res Function(_$GetDatabaseStatsImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc

class _$GetDatabaseStatsImpl implements _GetDatabaseStats {
  const _$GetDatabaseStatsImpl();

  @override
  String toString() {
    return 'ProductLoaderEvent.getDatabaseStats()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType && other is _$GetDatabaseStatsImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
      String? categoryId,
      String? search,
      bool? forceRefresh,
    )
    getProduct,
    required TResult Function(String? categoryId, String? search) loadMore,
    required TResult Function() refresh,
    required TResult Function(String? query, String? categoryId) searchProduct,
    required TResult Function() getDatabaseStats,
    required TResult Function() clearCache,
  }) {
    return getDatabaseStats();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult? Function(String? categoryId, String? search)? loadMore,
    TResult? Function()? refresh,
    TResult? Function(String? query, String? categoryId)? searchProduct,
    TResult? Function()? getDatabaseStats,
    TResult? Function()? clearCache,
  }) {
    return getDatabaseStats?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult Function(String? categoryId, String? search)? loadMore,
    TResult Function()? refresh,
    TResult Function(String? query, String? categoryId)? searchProduct,
    TResult Function()? getDatabaseStats,
    TResult Function()? clearCache,
    required TResult orElse(),
  }) {
    if (getDatabaseStats != null) {
      return getDatabaseStats();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_GetProduct value) getProduct,
    required TResult Function(_LoadMore value) loadMore,
    required TResult Function(_Refresh value) refresh,
    required TResult Function(_SearchProduct value) searchProduct,
    required TResult Function(_GetDatabaseStats value) getDatabaseStats,
    required TResult Function(_ClearCache value) clearCache,
  }) {
    return getDatabaseStats(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_GetProduct value)? getProduct,
    TResult? Function(_LoadMore value)? loadMore,
    TResult? Function(_Refresh value)? refresh,
    TResult? Function(_SearchProduct value)? searchProduct,
    TResult? Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult? Function(_ClearCache value)? clearCache,
  }) {
    return getDatabaseStats?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_GetProduct value)? getProduct,
    TResult Function(_LoadMore value)? loadMore,
    TResult Function(_Refresh value)? refresh,
    TResult Function(_SearchProduct value)? searchProduct,
    TResult Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult Function(_ClearCache value)? clearCache,
    required TResult orElse(),
  }) {
    if (getDatabaseStats != null) {
      return getDatabaseStats(this);
    }
    return orElse();
  }
}

abstract class _GetDatabaseStats implements ProductLoaderEvent {
  const factory _GetDatabaseStats() = _$GetDatabaseStatsImpl;
}

/// @nodoc
abstract class _$$ClearCacheImplCopyWith<$Res> {
  factory _$$ClearCacheImplCopyWith(
    _$ClearCacheImpl value,
    $Res Function(_$ClearCacheImpl) then,
  ) = __$$ClearCacheImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$ClearCacheImplCopyWithImpl<$Res>
    extends _$ProductLoaderEventCopyWithImpl<$Res, _$ClearCacheImpl>
    implements _$$ClearCacheImplCopyWith<$Res> {
  __$$ClearCacheImplCopyWithImpl(
    _$ClearCacheImpl _value,
    $Res Function(_$ClearCacheImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of ProductLoaderEvent
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc

class _$ClearCacheImpl implements _ClearCache {
  const _$ClearCacheImpl();

  @override
  String toString() {
    return 'ProductLoaderEvent.clearCache()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType && other is _$ClearCacheImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
      String? categoryId,
      String? search,
      bool? forceRefresh,
    )
    getProduct,
    required TResult Function(String? categoryId, String? search) loadMore,
    required TResult Function() refresh,
    required TResult Function(String? query, String? categoryId) searchProduct,
    required TResult Function() getDatabaseStats,
    required TResult Function() clearCache,
  }) {
    return clearCache();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult? Function(String? categoryId, String? search)? loadMore,
    TResult? Function()? refresh,
    TResult? Function(String? query, String? categoryId)? searchProduct,
    TResult? Function()? getDatabaseStats,
    TResult? Function()? clearCache,
  }) {
    return clearCache?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? categoryId, String? search, bool? forceRefresh)?
    getProduct,
    TResult Function(String? categoryId, String? search)? loadMore,
    TResult Function()? refresh,
    TResult Function(String? query, String? categoryId)? searchProduct,
    TResult Function()? getDatabaseStats,
    TResult Function()? clearCache,
    required TResult orElse(),
  }) {
    if (clearCache != null) {
      return clearCache();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_GetProduct value) getProduct,
    required TResult Function(_LoadMore value) loadMore,
    required TResult Function(_Refresh value) refresh,
    required TResult Function(_SearchProduct value) searchProduct,
    required TResult Function(_GetDatabaseStats value) getDatabaseStats,
    required TResult Function(_ClearCache value) clearCache,
  }) {
    return clearCache(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_GetProduct value)? getProduct,
    TResult? Function(_LoadMore value)? loadMore,
    TResult? Function(_Refresh value)? refresh,
    TResult? Function(_SearchProduct value)? searchProduct,
    TResult? Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult? Function(_ClearCache value)? clearCache,
  }) {
    return clearCache?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_GetProduct value)? getProduct,
    TResult Function(_LoadMore value)? loadMore,
    TResult Function(_Refresh value)? refresh,
    TResult Function(_SearchProduct value)? searchProduct,
    TResult Function(_GetDatabaseStats value)? getDatabaseStats,
    TResult Function(_ClearCache value)? clearCache,
    required TResult orElse(),
  }) {
    if (clearCache != null) {
      return clearCache(this);
    }
    return orElse();
  }
}

abstract class _ClearCache implements ProductLoaderEvent {
  const factory _ClearCache() = _$ClearCacheImpl;
}

/// @nodoc
mixin _$ProductLoaderState {
  List<Product> get products => throw _privateConstructorUsedError;
  Option<ProductFailure> get failureOptionProduct =>
      throw _privateConstructorUsedError;
  bool get hasReachedMax => throw _privateConstructorUsedError;
  int get page => throw _privateConstructorUsedError;
  bool get isLoadingMore => throw _privateConstructorUsedError;
  String? get searchQuery => throw _privateConstructorUsedError;
  String? get categoryId => throw _privateConstructorUsedError;

  /// Create a copy of ProductLoaderState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  $ProductLoaderStateCopyWith<ProductLoaderState> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $ProductLoaderStateCopyWith<$Res> {
  factory $ProductLoaderStateCopyWith(
    ProductLoaderState value,
    $Res Function(ProductLoaderState) then,
  ) = _$ProductLoaderStateCopyWithImpl<$Res, ProductLoaderState>;
  @useResult
  $Res call({
    List<Product> products,
    Option<ProductFailure> failureOptionProduct,
    bool hasReachedMax,
    int page,
    bool isLoadingMore,
    String? searchQuery,
    String? categoryId,
  });
}

/// @nodoc
class _$ProductLoaderStateCopyWithImpl<$Res, $Val extends ProductLoaderState>
    implements $ProductLoaderStateCopyWith<$Res> {
  _$ProductLoaderStateCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  /// Create a copy of ProductLoaderState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? products = null,
    Object? failureOptionProduct = null,
    Object? hasReachedMax = null,
    Object? page = null,
    Object? isLoadingMore = null,
    Object? searchQuery = freezed,
    Object? categoryId = freezed,
  }) {
    return _then(
      _value.copyWith(
            products: null == products
                ? _value.products
                : products // ignore: cast_nullable_to_non_nullable
                      as List<Product>,
            failureOptionProduct: null == failureOptionProduct
                ? _value.failureOptionProduct
                : failureOptionProduct // ignore: cast_nullable_to_non_nullable
                      as Option<ProductFailure>,
            hasReachedMax: null == hasReachedMax
                ? _value.hasReachedMax
                : hasReachedMax // ignore: cast_nullable_to_non_nullable
                      as bool,
            page: null == page
                ? _value.page
                : page // ignore: cast_nullable_to_non_nullable
                      as int,
            isLoadingMore: null == isLoadingMore
                ? _value.isLoadingMore
                : isLoadingMore // ignore: cast_nullable_to_non_nullable
                      as bool,
            searchQuery: freezed == searchQuery
                ? _value.searchQuery
                : searchQuery // ignore: cast_nullable_to_non_nullable
                      as String?,
            categoryId: freezed == categoryId
                ? _value.categoryId
                : categoryId // ignore: cast_nullable_to_non_nullable
                      as String?,
          )
          as $Val,
    );
  }
}

/// @nodoc
abstract class _$$ProductLoaderStateImplCopyWith<$Res>
    implements $ProductLoaderStateCopyWith<$Res> {
  factory _$$ProductLoaderStateImplCopyWith(
    _$ProductLoaderStateImpl value,
    $Res Function(_$ProductLoaderStateImpl) then,
  ) = __$$ProductLoaderStateImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({
    List<Product> products,
    Option<ProductFailure> failureOptionProduct,
    bool hasReachedMax,
    int page,
    bool isLoadingMore,
    String? searchQuery,
    String? categoryId,
  });
}

/// @nodoc
class __$$ProductLoaderStateImplCopyWithImpl<$Res>
    extends _$ProductLoaderStateCopyWithImpl<$Res, _$ProductLoaderStateImpl>
    implements _$$ProductLoaderStateImplCopyWith<$Res> {
  __$$ProductLoaderStateImplCopyWithImpl(
    _$ProductLoaderStateImpl _value,
    $Res Function(_$ProductLoaderStateImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of ProductLoaderState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? products = null,
    Object? failureOptionProduct = null,
    Object? hasReachedMax = null,
    Object? page = null,
    Object? isLoadingMore = null,
    Object? searchQuery = freezed,
    Object? categoryId = freezed,
  }) {
    return _then(
      _$ProductLoaderStateImpl(
        products: null == products
            ? _value._products
            : products // ignore: cast_nullable_to_non_nullable
                  as List<Product>,
        failureOptionProduct: null == failureOptionProduct
            ? _value.failureOptionProduct
            : failureOptionProduct // ignore: cast_nullable_to_non_nullable
                  as Option<ProductFailure>,
        hasReachedMax: null == hasReachedMax
            ? _value.hasReachedMax
            : hasReachedMax // ignore: cast_nullable_to_non_nullable
                  as bool,
        page: null == page
            ? _value.page
            : page // ignore: cast_nullable_to_non_nullable
                  as int,
        isLoadingMore: null == isLoadingMore
            ? _value.isLoadingMore
            : isLoadingMore // ignore: cast_nullable_to_non_nullable
                  as bool,
        searchQuery: freezed == searchQuery
            ? _value.searchQuery
            : searchQuery // ignore: cast_nullable_to_non_nullable
                  as String?,
        categoryId: freezed == categoryId
            ? _value.categoryId
            : categoryId // ignore: cast_nullable_to_non_nullable
                  as String?,
      ),
    );
  }
}

/// @nodoc

class _$ProductLoaderStateImpl implements _ProductLoaderState {
  _$ProductLoaderStateImpl({
    required final List<Product> products,
    required this.failureOptionProduct,
    this.hasReachedMax = false,
    this.page = 1,
    this.isLoadingMore = false,
    this.searchQuery,
    this.categoryId,
  }) : _products = products;

  final List<Product> _products;
  @override
  List<Product> get products {
    if (_products is EqualUnmodifiableListView) return _products;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_products);
  }

  @override
  final Option<ProductFailure> failureOptionProduct;
  @override
  @JsonKey()
  final bool hasReachedMax;
  @override
  @JsonKey()
  final int page;
  @override
  @JsonKey()
  final bool isLoadingMore;
  @override
  final String? searchQuery;
  @override
  final String? categoryId;

  @override
  String toString() {
    return 'ProductLoaderState(products: $products, failureOptionProduct: $failureOptionProduct, hasReachedMax: $hasReachedMax, page: $page, isLoadingMore: $isLoadingMore, searchQuery: $searchQuery, categoryId: $categoryId)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ProductLoaderStateImpl &&
            const DeepCollectionEquality().equals(other._products, _products) &&
            (identical(other.failureOptionProduct, failureOptionProduct) ||
                other.failureOptionProduct == failureOptionProduct) &&
            (identical(other.hasReachedMax, hasReachedMax) ||
                other.hasReachedMax == hasReachedMax) &&
            (identical(other.page, page) || other.page == page) &&
            (identical(other.isLoadingMore, isLoadingMore) ||
                other.isLoadingMore == isLoadingMore) &&
            (identical(other.searchQuery, searchQuery) ||
                other.searchQuery == searchQuery) &&
            (identical(other.categoryId, categoryId) ||
                other.categoryId == categoryId));
  }

  @override
  int get hashCode => Object.hash(
    runtimeType,
    const DeepCollectionEquality().hash(_products),
    failureOptionProduct,
    hasReachedMax,
    page,
    isLoadingMore,
    searchQuery,
    categoryId,
  );

  /// Create a copy of ProductLoaderState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$ProductLoaderStateImplCopyWith<_$ProductLoaderStateImpl> get copyWith =>
      __$$ProductLoaderStateImplCopyWithImpl<_$ProductLoaderStateImpl>(
        this,
        _$identity,
      );
}

abstract class _ProductLoaderState implements ProductLoaderState {
  factory _ProductLoaderState({
    required final List<Product> products,
    required final Option<ProductFailure> failureOptionProduct,
    final bool hasReachedMax,
    final int page,
    final bool isLoadingMore,
    final String? searchQuery,
    final String? categoryId,
  }) = _$ProductLoaderStateImpl;

  @override
  List<Product> get products;
  @override
  Option<ProductFailure> get failureOptionProduct;
  @override
  bool get hasReachedMax;
  @override
  int get page;
  @override
  bool get isLoadingMore;
  @override
  String? get searchQuery;
  @override
  String? get categoryId;

  /// Create a copy of ProductLoaderState
  /// with the given fields replaced by the non-null parameter values.
  @override
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$ProductLoaderStateImplCopyWith<_$ProductLoaderStateImpl> get copyWith =>
      throw _privateConstructorUsedError;
}
