






#import "CutoffParsecsDescribesSexDraftViewController.h"
#import "PoloFlashViewController.h"
#import "EngineerMovieRecoveryFaxRenderCell.h"

@interface CutoffParsecsDescribesSexDraftViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *miterDrizzleRectumPrepareOutView;

@property (nonatomic, strong) UIView *curlLemmaView;

@property (nonatomic, strong) UITableView *needPutEarView;


@property (nonatomic, assign) BOOL pintDebuggingDeviceMismatchCompact;

@property (nonatomic, weak) id packetKnowWarp;

@property (nonatomic, strong) NSMutableArray *bitSpeedDirtyArray;

@property (nonatomic, strong) NSMutableArray *draftPopArray;

@property (nonatomic, strong) UIButton *stoodMajorButton;
@property (nonatomic, strong) UIButton *sentLastFatButton;

@end

@implementation CutoffParsecsDescribesSexDraftViewController

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

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

- (void)setPintDebuggingDeviceMismatchCompact:(BOOL)pintDebuggingDeviceMismatchCompact {
    
    _pintDebuggingDeviceMismatchCompact = pintDebuggingDeviceMismatchCompact;
    
    _draftPopArray = pintDebuggingDeviceMismatchCompact ? _bitSpeedDirtyArray : [NSMutableArray arrayWithObject:_packetKnowWarp];
    
    [self.needPutEarView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!pintDebuggingDeviceMismatchCompact ? MenuCluster.thirteenHand.scaleSidebar : self.draftPopArray.count > 3 ? 3 * MenuCluster.thirteenHand.scaleSidebar  : self.draftPopArray.count * MenuCluster.thirteenHand.scaleSidebar);
    }];
    
    self.needPutEarView.scrollEnabled = pintDebuggingDeviceMismatchCompact;
    
    [self.needPutEarView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.needPutEarView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _bitSpeedDirtyArray = [[MenuCluster binThickOpacityUnlikelyChamber] mutableCopy];
    
    _packetKnowWarp = _bitSpeedDirtyArray.firstObject;
    
    [self accountDeriveLocaleRetObscured];
    
    self.pintDebuggingDeviceMismatchCompact = NO;
}

- (void)accountDeriveLocaleRetObscured {
    
    _miterDrizzleRectumPrepareOutView = [[UIView alloc] init];
    _miterDrizzleRectumPrepareOutView.backgroundColor = UIColor.whiteColor;
    _miterDrizzleRectumPrepareOutView.layer.cornerRadius = 2;
    [self.view addSubview:_miterDrizzleRectumPrepareOutView];
    [self.view sendSubviewToBack:_miterDrizzleRectumPrepareOutView];
    [_miterDrizzleRectumPrepareOutView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([MenuCluster visitLookFeedAmbientSeparatorMustSize]);
    }];
    
    
    UIView *curlLemmaView = [MenuCluster curlLemmaView];
    [self.view addSubview:curlLemmaView];
    self.curlLemmaView = curlLemmaView;
    [curlLemmaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(MenuCluster.thirteenHand.italicsDrain);
        make.height.mas_equalTo(MenuCluster.thirteenHand.moduleStylus);
        make.left.equalTo(self.canCreamyButton.mas_right);
        make.right.equalTo(self.subLoadSumButton.mas_left);
    }];
    
    
    _needPutEarView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    _needPutEarView.backgroundColor = [UIColor whiteColor];
    _needPutEarView.layer.masksToBounds = YES;
    _needPutEarView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _needPutEarView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _needPutEarView.layer.borderColor = [MenuCluster asleepYetColor].CGColor;
    _needPutEarView.layer.borderWidth = 0.6;
    _needPutEarView.layer.cornerRadius = 2;
    _needPutEarView.rowHeight = MenuCluster.thirteenHand.scaleSidebar;
    _needPutEarView.delegate = self;
    _needPutEarView.dataSource = self;
    [_needPutEarView registerClass:[EngineerMovieRecoveryFaxRenderCell class] forCellReuseIdentifier:NSStringFromClass(EngineerMovieRecoveryFaxRenderCell.class)];
    [self.view addSubview:_needPutEarView];
    [self.needPutEarView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.curlLemmaView.mas_bottom).offset(MenuCluster.thirteenHand.italicsDrain);
        make.left.equalTo(self.miterDrizzleRectumPrepareOutView).offset(MenuCluster.thirteenHand.twoHitAdverb);
        make.right.equalTo(self.miterDrizzleRectumPrepareOutView).offset(-MenuCluster.thirteenHand.twoHitAdverb);
        make.height.mas_equalTo(MenuCluster.thirteenHand.scaleSidebar);
    }];
    
    
    self.stoodMajorButton = [MenuCluster hisSubFaxDetachAir:MenuCluster.hallFloorExist.lightSecurelyKurdishIrishDraw];
    [self.stoodMajorButton addTarget:self action:@selector(suchRefusedShutdownTraverseSoundPerformerAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.miterDrizzleRectumPrepareOutView addSubview:self.stoodMajorButton];
    [self.stoodMajorButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.miterDrizzleRectumPrepareOutView).offset(-MenuCluster.thirteenHand.italicsDrain);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.sentLastFatButton = [MenuCluster systolicFlagSwitchSlovakDenyColor:MenuCluster.hallFloorExist.readySumTen];
    [self.sentLastFatButton addTarget:self action:@selector(replyNotifyingAcuteOptFlushedEast:) forControlEvents:UIControlEventTouchUpInside];
    [self.miterDrizzleRectumPrepareOutView addSubview:self.sentLastFatButton];
    [self.sentLastFatButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.stoodMajorButton.mas_top).offset(-MenuCluster.thirteenHand.planeCarNear);
        make.left.right.equalTo(self.needPutEarView);
        make.height.mas_equalTo(MenuCluster.thirteenHand.armMinAuthor);
    }];
}

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    EngineerMovieRecoveryFaxRenderCell *exec = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(EngineerMovieRecoveryFaxRenderCell.class) forIndexPath:indexPath];
    NSArray *shoulder = _draftPopArray[indexPath.row];
    
    exec.titleKinName.text = shoulder[0];
    
    exec.hangFitUseView.image = [[UIImage rotateMicroHitNotifyingFutureName:shoulder[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    exec.teluguMergeTime.text = [NSString stringWithFormat:@"%@ %@",MenuCluster.hallFloorExist.raiseStretchEndShadowAssemblyTime,[self largerPrimeLinkLongitudeMetabolicHisTime:[shoulder[2] doubleValue]]];
    
    exec.accessoryType = self.pintDebuggingDeviceMismatchCompact ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return exec;
}

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


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

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

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id shoulder = _draftPopArray[indexPath.row];
        
        [_draftPopArray removeObject:shoulder];
        
        [_bitSpeedDirtyArray removeObject:shoulder];
        
        if ([self.bagCheckLeast respondsToSelector:@selector(dogPartiallyHusbandSayExpertDueName:completion:)]) {
            [self.bagCheckLeast dogPartiallyHusbandSayExpertDueName:shoulder[0] completion:^(id object) {
                
            }];
        }
        
        if(_bitSpeedDirtyArray.count > 0){
            
            _draftPopArray = _bitSpeedDirtyArray;
            _packetKnowWarp = _draftPopArray.firstObject;
            self.pintDebuggingDeviceMismatchCompact = YES;
            
        }
    }
}


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

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

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


- (void)suchRefusedShutdownTraverseSoundPerformerAction:(UIButton *)sender {
    PoloFlashViewController *realSpaceFade = [PoloFlashViewController new];
    realSpaceFade.bagCheckLeast = self.bagCheckLeast;
    [self.navigationController pushViewController:realSpaceFade animated:NO];
}

- (void)replyNotifyingAcuteOptFlushedEast:(UIButton *)sender {
    if ([self.bagCheckLeast respondsToSelector:@selector(chamberBinSundaneseRecentlyMaySceneBirthName:completion:)]) {
        [PopTipHomeView panPrinterBarWindow];
        [self.bagCheckLeast chamberBinSundaneseRecentlyMaySceneBirthName:self.packetKnowWarp[0] completion:^(id object) {
            [PopTipHomeView flipMindfulCanMutationsAuthorWindow];
        }];
    }
}


- (NSString *)largerPrimeLinkLongitudeMetabolicHisTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double spaceOneTime = now - beTime;
    NSString * yearAmharic;
    
    NSDate * earDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * won = [[NSDateFormatter alloc] init];
    [won setDateFormat:@"HH:mm"];
    NSString * overall = [won stringFromDate:earDate];
    
    [won setDateFormat:@"dd"];
    NSString * zipBar = [won stringFromDate:[NSDate date]];
    NSString * fadeKey = [won stringFromDate:earDate];
    
    if (spaceOneTime < 60) {
        yearAmharic = MenuCluster.hallFloorExist.notCrossFont;
    }else if (spaceOneTime < 60 * 60) {
        yearAmharic = [NSString stringWithFormat:@"%ld%@",(long)spaceOneTime / 60, MenuCluster.hallFloorExist.personEyeAnimationVisualSetup];
    }else if(spaceOneTime < 24 * 60 * 60 && [zipBar integerValue] == [fadeKey integerValue]){
        yearAmharic = [NSString stringWithFormat:@"%@ %@",MenuCluster.hallFloorExist.elderApple,overall];
    }else if(spaceOneTime < 24 * 60 * 60 * 2 && [zipBar integerValue] != [fadeKey integerValue]){
        if ([zipBar integerValue] - [fadeKey integerValue] == 1 || ([fadeKey integerValue] - [zipBar integerValue] > 10 && [zipBar integerValue] == 1)) {
            yearAmharic = [NSString stringWithFormat:@"%@ %@",MenuCluster.hallFloorExist.uploadRankShow,overall];
        }else{
            [won setDateFormat:@"MM-dd HH:mm"];
            yearAmharic = [won stringFromDate:earDate];
        }
    }else if(spaceOneTime < 24 * 60 * 60 * 365){
        [won setDateFormat:@"MM-dd HH:mm"];
        yearAmharic = [won stringFromDate:earDate];
    }else{
        [won setDateFormat:@"yyyy-MM-dd HH:mm"];
        yearAmharic = [won stringFromDate:earDate];
    }
    return yearAmharic;
}

@end
