






#import "FoundCutEndCanDecreaseViewController.h"
#import "ReferenceViewController.h"
#import "StylisticMindfulRollRemoveSimulatesCell.h"

@interface FoundCutEndCanDecreaseViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *workingSunFarsiLeadSexView;

@property (nonatomic, strong) UIView *globalRowView;

@property (nonatomic, strong) UITableView *tenWaitOneView;


@property (nonatomic, assign) BOOL volumeSkipCreamySindhiEncrypt;

@property (nonatomic, weak) id nodeAddWinSeed;

@property (nonatomic, strong) NSMutableArray *anyTurnMapCupArray;

@property (nonatomic, strong) NSMutableArray *kilogramArray;

@property (nonatomic, strong) UIButton *spaSumLostButton;
@property (nonatomic, strong) UIButton *partSumGoalButton;

@end

@implementation FoundCutEndCanDecreaseViewController

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    if (_kilogramArray.count > 0 && self.volumeSkipCreamySindhiEncrypt) {
        self.volumeSkipCreamySindhiEncrypt = NO;
    }
}

- (void)viewWillAppear:(BOOL)animated {
    
    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        CGFloat bottom = RowAirFloor.loveHitOrder.coachedSleep;
        make.centerX.equalTo(self.view.superview);
        make.centerY.equalTo(self.view.superview).offset(+bottom/2);
        make.height.mas_equalTo([RowAirFloor portraitsFiveItsAdverbHandTenSize].height+bottom);
        make.width.mas_equalTo([RowAirFloor portraitsFiveItsAdverbHandTenSize].width);
    }];
}

- (void)setVolumeSkipCreamySindhiEncrypt:(BOOL)volumeSkipCreamySindhiEncrypt {
    
    _volumeSkipCreamySindhiEncrypt = volumeSkipCreamySindhiEncrypt;
    
    _kilogramArray = volumeSkipCreamySindhiEncrypt ? _anyTurnMapCupArray : [NSMutableArray arrayWithObject:_nodeAddWinSeed];
    
    [self.tenWaitOneView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!volumeSkipCreamySindhiEncrypt ? RowAirFloor.loveHitOrder.anotherRoute : self.kilogramArray.count > 3 ? 3 * RowAirFloor.loveHitOrder.anotherRoute  : self.kilogramArray.count * RowAirFloor.loveHitOrder.anotherRoute);
    }];
    
    self.tenWaitOneView.scrollEnabled = volumeSkipCreamySindhiEncrypt;
    
    [self.tenWaitOneView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.tenWaitOneView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _anyTurnMapCupArray = [[RowAirFloor fragmentSeparatorPubInferFree] mutableCopy];
    
    _nodeAddWinSeed = _anyTurnMapCupArray.firstObject;
    
    [self unableOpaqueHexCelticFlag];
    
    self.volumeSkipCreamySindhiEncrypt = NO;
}

- (void)unableOpaqueHexCelticFlag {
    
    _workingSunFarsiLeadSexView = [[UIView alloc] init];
    
    _workingSunFarsiLeadSexView.backgroundColor = self.genderBaselinesBusyRationalLowercaseImageView ? UIColor.clearColor : UIColor.whiteColor;
    _workingSunFarsiLeadSexView.layer.cornerRadius = RowAirFloor.loveHitOrder.timeCreation;
    _workingSunFarsiLeadSexView.layer.masksToBounds = YES;
    [self.view addSubview:_workingSunFarsiLeadSexView];
    [self.view sendSubviewToBack:_workingSunFarsiLeadSexView];
    
    if (self.genderBaselinesBusyRationalLowercaseImageView) {
        [self.view sendSubviewToBack:self.genderBaselinesBusyRationalLowercaseImageView];
    }
    [_workingSunFarsiLeadSexView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([RowAirFloor portraitsFiveItsAdverbHandTenSize]);
    }];
    
    if (self.genderBaselinesBusyRationalLowercaseImageView) {
        [self.genderBaselinesBusyRationalLowercaseImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.workingSunFarsiLeadSexView);
        }];
    }
    
    
    UIView *globalRowView = [RowAirFloor globalRowView];
    [self.view addSubview:globalRowView];
    self.globalRowView = globalRowView;
    [globalRowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(RowAirFloor.loveHitOrder.portalHexFun);
        make.height.mas_equalTo(RowAirFloor.loveHitOrder.nextCutPrime);
        make.left.equalTo(self.execBrownButton.mas_right);
        make.right.equalTo(self.autoCarSexButton.mas_left);
    }];
    
    
    _tenWaitOneView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    
    _tenWaitOneView.backgroundColor = [UIColor whiteColor];
    _tenWaitOneView.layer.masksToBounds = YES;
    _tenWaitOneView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _tenWaitOneView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _tenWaitOneView.layer.borderColor = [RowAirFloor genderTooColor].CGColor;
    _tenWaitOneView.layer.borderWidth = 0.6;
    _tenWaitOneView.layer.cornerRadius = RowAirFloor.loveHitOrder.timeCreation;
    _tenWaitOneView.rowHeight = RowAirFloor.loveHitOrder.anotherRoute;
    _tenWaitOneView.delegate = self;
    _tenWaitOneView.dataSource = self;
    [_tenWaitOneView registerClass:[StylisticMindfulRollRemoveSimulatesCell class] forCellReuseIdentifier:NSStringFromClass(StylisticMindfulRollRemoveSimulatesCell.class)];
    [self.view addSubview:_tenWaitOneView];
    [self.tenWaitOneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.globalRowView.mas_bottom).offset(RowAirFloor.loveHitOrder.portalHexFun);
        make.left.equalTo(self.workingSunFarsiLeadSexView).offset(RowAirFloor.loveHitOrder.forBayerPull);
        make.right.equalTo(self.workingSunFarsiLeadSexView).offset(-RowAirFloor.loveHitOrder.forBayerPull);
        make.height.mas_equalTo(RowAirFloor.loveHitOrder.anotherRoute);
    }];
    
    
    self.spaSumLostButton = [RowAirFloor scalingCriticalSignatureHairRelation:RowAirFloor.iconYellowCube.slightMegahertzSphericalFractionsAccessing];
    [self.spaSumLostButton addTarget:self action:@selector(summariesPipeShapeCoulombsSymptomInheritedAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.workingSunFarsiLeadSexView addSubview:self.spaSumLostButton];
    [self.spaSumLostButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.workingSunFarsiLeadSexView).offset(-RowAirFloor.loveHitOrder.portalHexFun);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.partSumGoalButton = [RowAirFloor eitherPlanarUtilitiesDegreesManganeseColor:RowAirFloor.iconYellowCube.prefixesIts];
    [self.partSumGoalButton addTarget:self action:@selector(definesConsumesTalkUndoEditorFade:) forControlEvents:UIControlEventTouchUpInside];
    [self.workingSunFarsiLeadSexView addSubview:self.partSumGoalButton];
    [self.partSumGoalButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.spaSumLostButton.mas_top).offset(-RowAirFloor.loveHitOrder.putAllocated);
        make.left.right.equalTo(self.tenWaitOneView);
        make.height.mas_equalTo(RowAirFloor.loveHitOrder.tryScaleAxes);
    }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _kilogramArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    StylisticMindfulRollRemoveSimulatesCell *word = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(StylisticMindfulRollRemoveSimulatesCell.class) forIndexPath:indexPath];
    NSArray *tallLike = _kilogramArray[indexPath.row];
    
    word.clinicalName.text = tallLike[0];
    
    word.seeScanSumView.image = [[UIImage likeYouAlphaPushFriendName:tallLike[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    word.hoursEndMinTime.text = [NSString stringWithFormat:@"%@ %@",RowAirFloor.iconYellowCube.footStrongTenPresetRearrangeTime,[self targetCervicalSheIgnoringPointersEitherTime:[tallLike[2] doubleValue]]];
    
    word.accessoryType = self.volumeSkipCreamySindhiEncrypt ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return word;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    _nodeAddWinSeed = _kilogramArray[indexPath.row];
    self.volumeSkipCreamySindhiEncrypt = !self.volumeSkipCreamySindhiEncrypt;
}


- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return self.volumeSkipCreamySindhiEncrypt;
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellEditingStyleDelete;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id tallLike = _kilogramArray[indexPath.row];
        
        [_kilogramArray removeObject:tallLike];
        
        [_anyTurnMapCupArray removeObject:tallLike];
        
        if ([self.withinDecline respondsToSelector:@selector(reloadCubeDarwinIntersectEmergencyStakeName:completion:)]) {
            [self.withinDecline reloadCubeDarwinIntersectEmergencyStakeName:tallLike[0] completion:^(id object) {
                
            }];
        }
        
        if(_anyTurnMapCupArray.count > 0){
            
            _kilogramArray = _anyTurnMapCupArray;
            _nodeAddWinSeed = _kilogramArray.firstObject;
            self.volumeSkipCreamySindhiEncrypt = YES;
            
        }
    }
}


- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
    return @"Delete";
}

- (void)neutralAgentPositionCyrillicStarted:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super neutralAgentPositionCyrillicStarted:touches withEvent:event];
    self.volumeSkipCreamySindhiEncrypt = NO;
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
    self.volumeSkipCreamySindhiEncrypt = NO;
}


- (void)summariesPipeShapeCoulombsSymptomInheritedAction:(UIButton *)sender {
    ReferenceViewController *burnPubRedPin = [ReferenceViewController new];
    burnPubRedPin.withinDecline = self.withinDecline;
    [self.navigationController pushViewController:burnPubRedPin animated:NO];
}

- (void)definesConsumesTalkUndoEditorFade:(UIButton *)sender {
    if ([self.withinDecline respondsToSelector:@selector(thicknessEnhancedTerabytesLockRestoreCutterBulgarianName:completion:)]) {
        [FlowTenKitView drumDrivePostWindow];
        [self.withinDecline thicknessEnhancedTerabytesLockRestoreCutterBulgarianName:self.nodeAddWinSeed[0] completion:^(id object) {
            [FlowTenKitView speakIllTorchSockUnwindWindow];
        }];
    }
}


- (NSString *)targetCervicalSheIgnoringPointersEitherTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double getValueTime = now - beTime;
    NSString * observePath;
    
    NSDate * faxDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * bar = [[NSDateFormatter alloc] init];
    [bar setDateFormat:@"HH:mm"];
    NSString * wayBeat = [bar stringFromDate:faxDate];
    
    [bar setDateFormat:@"dd"];
    NSString * eldest = [bar stringFromDate:[NSDate date]];
    NSString * fullLow = [bar stringFromDate:faxDate];
    
    if (getValueTime < 60) {
        observePath = RowAirFloor.iconYellowCube.siteGroupRow;
    }else if (getValueTime < 60 * 60) {
        observePath = [NSString stringWithFormat:@"%ld%@",(long)getValueTime / 60, RowAirFloor.iconYellowCube.decayExcludeAmbiguousMailSin];
    }else if(getValueTime < 24 * 60 * 60 && [eldest integerValue] == [fullLow integerValue]){
        observePath = [NSString stringWithFormat:@"%@ %@",RowAirFloor.iconYellowCube.overEncode,wayBeat];
    }else if(getValueTime < 24 * 60 * 60 * 2 && [eldest integerValue] != [fullLow integerValue]){
        if ([eldest integerValue] - [fullLow integerValue] == 1 || ([fullLow integerValue] - [eldest integerValue] > 10 && [eldest integerValue] == 1)) {
            observePath = [NSString stringWithFormat:@"%@ %@",RowAirFloor.iconYellowCube.itsFatDatumTop,wayBeat];
        }else{
            [bar setDateFormat:@"MM-dd HH:mm"];
            observePath = [bar stringFromDate:faxDate];
        }
    }else if(getValueTime < 24 * 60 * 60 * 365){
        [bar setDateFormat:@"MM-dd HH:mm"];
        observePath = [bar stringFromDate:faxDate];
    }else{
        [bar setDateFormat:@"yyyy-MM-dd HH:mm"];
        observePath = [bar stringFromDate:faxDate];
    }
    return observePath;
}

@end
