








#import "AccessedPeople.h"

#define RopeExposures self.frame.size.width

@interface AccessedPeople()



@property (nonatomic, strong) NSMutableArray                            *packageArray;



@property (nonatomic, strong) NSMutableArray <ExternalSmoothCell *>      *pathArray;



@property (strong, nonatomic) NSMutableArray <ExternalSmoothCell *>      *kernelMaster;



@property (assign, nonatomic) NSInteger                                 count;



@property (nonatomic, assign) BedSelfScrollingExtraUbiquity                          status;



@property (nonatomic, assign) NSInteger                                 channelCount;



@property (nonatomic, assign) CGFloat                                   keyKey;

@end

@implementation AccessedPeople

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.status = AirFeedSessionsBedRadiansMembers;
    }
    return self;
}

- (void)nominalNonce
{
    
    if (self.pathArray.firstObject) {
        
        
        ExternalSmoothCell *keysCupView = self.pathArray.firstObject;
        
        keysCupView.frame = CGRectMake(RopeExposures, 0, keysCupView.slowPopSize.width, keysCupView.slowPopSize.height);
        
        self.keyKey = keysCupView.keyKey;
        
        self.channelCount = keysCupView.channelCount;
        
        
        NSInteger row = [self inferExportAndExtrinsicFilenameMobileOut:keysCupView];
        
        
        if (row >= 0) {
            
            
            [self.pathArray removeObjectAtIndex:0];
            
            
            if (![self.subviews containsObject:keysCupView]) {
                [self addSubview:keysCupView];
            }
            keysCupView.frame = CGRectMake(RopeExposures,  row * (keysCupView.slowPopSize.height + _keyKey), keysCupView.slowPopSize.width, keysCupView.slowPopSize.height);
            
            
            [_packageArray setObject:keysCupView atIndexedSubscript:row];
            
            
            if ([self.delegate respondsToSelector:@selector(blinkOurFunkView:willDisplayCell:)]) {
                [self.delegate blinkOurFunkView:self willDisplayCell:keysCupView];
            }
            
            
            [self.kernelMaster addObject:keysCupView];
            
            [keysCupView runCloseParsingReusePredicted:^{
                
                
                [keysCupView setTransform:CGAffineTransformMakeTranslation(- keysCupView.frame.size.width-RopeExposures, 0)];
                
            } completion:^(BOOL finished) {
                
                [keysCupView removeFromSuperview];
                
                
                [self.kernelMaster removeObject:keysCupView];
                
                
                if ([self.delegate respondsToSelector:@selector(blinkOurFunkView:didEndDisplayingCell:)]) {
                    [self.delegate blinkOurFunkView:self didEndDisplayingCell:keysCupView];
                }
                
                
                if (--self.count <= 0) {
                    if ([self.delegate respondsToSelector:@selector(periodTodayRotationUpperSubtitlesCurveProblemLeap:)]) {
                        [self.delegate periodTodayRotationUpperSubtitlesCurveProblemLeap:self];
                    }
                    self.count = 0;
                }
                
                

            }];
        }
    }
    
    [self performSelector:@selector(nominalNonce) withObject:nil afterDelay:0.45f];
}


- (void)carFixCertCity:(NSArray <ExternalSmoothCell *> *)barrages
{
    self.count += barrages.count;
    [self.pathArray addObjectsFromArray:barrages];
}

- (void)start
{
    if (self.status == PoolBarEngineCanIndicatedHockey) {
        return;
    }
    self.status = PoolBarEngineCanIndicatedHockey;
    
    [self nominalNonce];
}

- (void)stop
{
    if (self.status == AirFeedSessionsBedRadiansMembers) {
        return;
    }
    self.status = AirFeedSessionsBedRadiansMembers;
    
    if (self.kernelMaster.count) {
        [self.kernelMaster makeObjectsPerformSelector:@selector(pause)];
    }
    
    if (self.pathArray.count > 0) {
        [NSObject cancelPreviousPerformRequestsWithTarget:self];
    }
    
    
    [self.kernelMaster  makeObjectsPerformSelector:@selector(removeFromSuperview)];
    self.channelCount       = 0;
    self.count              = 0;
    [self.kernelMaster  removeAllObjects];
    [self.pathArray     removeAllObjects];
    [self.packageArray  removeAllObjects];
    
    self.kernelMaster       = nil;
    self.pathArray          = nil;
    self.packageArray       = nil;
}


- (NSInteger)inferExportAndExtrinsicFilenameMobileOut:(ExternalSmoothCell *)newBarrage
{
    for (int row = 0; row<_packageArray.count; row++) {
        NSObject *object = _packageArray[row];
        if ([object isKindOfClass:[NSNumber class]]) { 
            
            return row;
            
        }else if ([object isKindOfClass:[ExternalSmoothCell class]]) { 
            
            ExternalSmoothCell *catLoveAir = (ExternalSmoothCell*)object;
            
            if ([self inferExportAndExtrinsicFilenameMobileOut:catLoveAir postSplat:newBarrage]) {
                
                return row;
            }
        }
    }
    
    return -1;
}


- (BOOL)inferExportAndExtrinsicFilenameMobileOut:(ExternalSmoothCell *)catLoveAir postSplat:(ExternalSmoothCell *)newBarrage
{
    
    if (catLoveAir.status == AlienBroadcastClippingThousandsCiphersCan) {
        return NO;
    }
    
    
    CGRect rect = [catLoveAir.layer.presentationLayer frame];
    if (rect.origin.x>RopeExposures - catLoveAir.frame.size.width) {
        
        return NO;
    }else if (rect.size.width == 0)
    {
        
        return NO;
    }
    else if (catLoveAir.frame.size.width > newBarrage.frame.size.width) {
        
        return YES;
    }else
    {
        
        CGFloat time = RopeExposures/(RopeExposures+newBarrage.frame.size.width)*newBarrage.haveFinalize;
        
        CGFloat post = rect.origin.x - time/(catLoveAir.haveFinalize)*(RopeExposures + catLoveAir.frame.size.width);
        if (post < -catLoveAir.frame.size.width) {
            
            return YES;
        }
    }
    return NO;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *thick = [touches anyObject];
    CGPoint sinkEntity  = [thick locationInView:self];
    for (ExternalSmoothCell *keysCupView in [self subviews])
    {
        if ([keysCupView.layer.presentationLayer hitTest:sinkEntity])
        {
            
            if ([self.delegate respondsToSelector:@selector(blinkOurFunkView:usePersonalCell:)]) {
                [self.delegate blinkOurFunkView:self usePersonalCell:keysCupView];
            }
            break;
        }
    }
}




- (NSMutableArray<ExternalSmoothCell *> *)pathArray {
    if (!_pathArray) {
        _pathArray = [[NSMutableArray alloc] init];
    }
    return _pathArray;
}


- (NSMutableArray<ExternalSmoothCell *> *)kernelMaster {
    if (!_kernelMaster) {
        _kernelMaster = [[NSMutableArray alloc] init];
    }
    return _kernelMaster;
}


- (void)setChannelCount:(NSInteger)channelCount
{
    
    if (self.packageArray.count < channelCount) { 
        
        for (NSInteger row = self.packageArray.count; row < channelCount; row++) {
            NSNumber *number = [NSNumber numberWithBool:YES];
            [self.packageArray setObject:number atIndexedSubscript:row];
        }
        
    }else {
        
        for (NSInteger row = channelCount; row < self.packageArray.count; row++) {
            [self.packageArray removeObjectAtIndex:row];
        }
    }
    
    _channelCount = channelCount;
    
}


- (NSMutableArray *)packageArray {
    if (!_packageArray) {
        _packageArray = [[NSMutableArray alloc] init];
    }
    return _packageArray;
}

@end
