






#import "StableFloaterPipeParallelSubscriptViewController.h"
#import "MailWaistViewController.h"
#import "KilowattsExposuresSolutionsTremorDiscountsCell.h"

@interface StableFloaterPipeParallelSubscriptViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *blackOwnCollapsesReversedModernView;

@property (nonatomic, strong) UIView *hurricaneView;

@property (nonatomic, strong) UITableView *icyTrapWasView;


@property (nonatomic, assign) BOOL copyrightStreamLazyRestoreEar;

@property (nonatomic, weak) id warpDefineName;

@property (nonatomic, strong) NSMutableArray *panSheConvertArray;

@property (nonatomic, strong) NSMutableArray *mainSnapArray;

@property (nonatomic, strong) UIButton *mayPageAddButton;
@property (nonatomic, strong) UIButton *foundButtonButton;

@end

@implementation StableFloaterPipeParallelSubscriptViewController

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

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

- (void)setCopyrightStreamLazyRestoreEar:(BOOL)copyrightStreamLazyRestoreEar {
    
    _copyrightStreamLazyRestoreEar = copyrightStreamLazyRestoreEar;
    
    _mainSnapArray = copyrightStreamLazyRestoreEar ? _panSheConvertArray : [NSMutableArray arrayWithObject:_warpDefineName];
    
    [self.icyTrapWasView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!copyrightStreamLazyRestoreEar ? UserArtRoot.wayAbortLove.areSenderMen : self.mainSnapArray.count > 3 ? 3 * UserArtRoot.wayAbortLove.areSenderMen  : self.mainSnapArray.count * UserArtRoot.wayAbortLove.areSenderMen);
    }];
    
    self.icyTrapWasView.scrollEnabled = copyrightStreamLazyRestoreEar;
    
    [self.icyTrapWasView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.icyTrapWasView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _panSheConvertArray = [[UserArtRoot sentenceQualityOddTempSpecify] mutableCopy];
    
    _warpDefineName = _panSheConvertArray.firstObject;
    
    [self officialMalteseDefaultsAgePolicy];
    
    self.copyrightStreamLazyRestoreEar = NO;
}

- (void)officialMalteseDefaultsAgePolicy {
    
    _blackOwnCollapsesReversedModernView = [[UIView alloc] init];
    _blackOwnCollapsesReversedModernView.backgroundColor = UIColor.whiteColor;
    _blackOwnCollapsesReversedModernView.layer.cornerRadius = 2;
    [self.view addSubview:_blackOwnCollapsesReversedModernView];
    [self.view sendSubviewToBack:_blackOwnCollapsesReversedModernView];
    [_blackOwnCollapsesReversedModernView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([UserArtRoot photosMonotonicAlbumIntentWrappersWrapSize]);
    }];
    
    
    UIView *hurricaneView = [UserArtRoot hurricaneView];
    [self.view addSubview:hurricaneView];
    self.hurricaneView = hurricaneView;
    [hurricaneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(UserArtRoot.wayAbortLove.panGreenSpan);
        make.height.mas_equalTo(UserArtRoot.wayAbortLove.observerBike);
        make.left.equalTo(self.winSampleButton.mas_right);
        make.right.equalTo(self.tabTreeBagButton.mas_left);
    }];
    
    
    _icyTrapWasView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    _icyTrapWasView.backgroundColor = [UIColor whiteColor];
    _icyTrapWasView.layer.masksToBounds = YES;
    _icyTrapWasView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _icyTrapWasView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _icyTrapWasView.layer.borderColor = [UserArtRoot partBoostColor].CGColor;
    _icyTrapWasView.layer.borderWidth = 0.6;
    _icyTrapWasView.layer.cornerRadius = 2;
    _icyTrapWasView.rowHeight = UserArtRoot.wayAbortLove.areSenderMen;
    _icyTrapWasView.delegate = self;
    _icyTrapWasView.dataSource = self;
    [_icyTrapWasView registerClass:[KilowattsExposuresSolutionsTremorDiscountsCell class] forCellReuseIdentifier:NSStringFromClass(KilowattsExposuresSolutionsTremorDiscountsCell.class)];
    [self.view addSubview:_icyTrapWasView];
    [self.icyTrapWasView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.hurricaneView.mas_bottom).offset(UserArtRoot.wayAbortLove.panGreenSpan);
        make.left.equalTo(self.blackOwnCollapsesReversedModernView).offset(UserArtRoot.wayAbortLove.deltaRefused);
        make.right.equalTo(self.blackOwnCollapsesReversedModernView).offset(-UserArtRoot.wayAbortLove.deltaRefused);
        make.height.mas_equalTo(UserArtRoot.wayAbortLove.areSenderMen);
    }];
    
    
    self.mayPageAddButton = [UserArtRoot touchTremorAppearingFullCity:UserArtRoot.builtOwnSeeEar.playBondSelectedInsulinExactness];
    [self.mayPageAddButton addTarget:self action:@selector(optimizeEmbeddingSayPubInputMinorAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.blackOwnCollapsesReversedModernView addSubview:self.mayPageAddButton];
    [self.mayPageAddButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.blackOwnCollapsesReversedModernView).offset(-UserArtRoot.wayAbortLove.panGreenSpan);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.foundButtonButton = [UserArtRoot arrayAuditedDirectorRedoneLongestColor:UserArtRoot.builtOwnSeeEar.germanTwist];
    [self.foundButtonButton addTarget:self action:@selector(audioStrokingLawDefaultAreExecute:) forControlEvents:UIControlEventTouchUpInside];
    [self.blackOwnCollapsesReversedModernView addSubview:self.foundButtonButton];
    [self.foundButtonButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.mayPageAddButton.mas_top).offset(-UserArtRoot.wayAbortLove.canGradeFind);
        make.left.right.equalTo(self.icyTrapWasView);
        make.height.mas_equalTo(UserArtRoot.wayAbortLove.textBuddySee);
    }];
}

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    KilowattsExposuresSolutionsTremorDiscountsCell *slow = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(KilowattsExposuresSolutionsTremorDiscountsCell.class) forIndexPath:indexPath];
    NSArray *stopItem = _mainSnapArray[indexPath.row];
    
    slow.drumDarkName.text = stopItem[0];
    
    slow.tipAgePongView.image = [[UIImage containerModifiersAskSceneOuterName:stopItem[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    slow.sawPutBadgeTime.text = [NSString stringWithFormat:@"%@ %@",UserArtRoot.builtOwnSeeEar.drivenPartiallyRetainMacintoshIronTime,[self outYearsDecodeWideGigahertzCrossTime:[stopItem[2] doubleValue]]];
    
    slow.accessoryType = self.copyrightStreamLazyRestoreEar ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return slow;
}

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


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

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

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id stopItem = _mainSnapArray[indexPath.row];
        
        [_mainSnapArray removeObject:stopItem];
        
        [_panSheConvertArray removeObject:stopItem];
        
        if ([self.jobIrishBezel respondsToSelector:@selector(pendingServerMaxEndpointSchoolBalanceName:completion:)]) {
            [self.jobIrishBezel pendingServerMaxEndpointSchoolBalanceName:stopItem[0] completion:^(id object) {
                
            }];
        }
        
        if(_panSheConvertArray.count > 0){
            
            _mainSnapArray = _panSheConvertArray;
            _warpDefineName = _mainSnapArray.firstObject;
            self.copyrightStreamLazyRestoreEar = YES;
            
        }
    }
}


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

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

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


- (void)optimizeEmbeddingSayPubInputMinorAction:(UIButton *)sender {
    MailWaistViewController *smallYetStood = [MailWaistViewController new];
    smallYetStood.jobIrishBezel = self.jobIrishBezel;
    [self.navigationController pushViewController:smallYetStood animated:NO];
}

- (void)audioStrokingLawDefaultAreExecute:(UIButton *)sender {
    if ([self.jobIrishBezel respondsToSelector:@selector(mirroringAllocateFitBrowseStereoSenderReviewName:completion:)]) {
        [ActualSkipView bondLocalDiskWindow];
        [self.jobIrishBezel mirroringAllocateFitBrowseStereoSenderReviewName:self.warpDefineName[0] completion:^(id object) {
            [ActualSkipView assistantTensionCarEraFetchWindow];
        }];
    }
}


- (NSString *)outYearsDecodeWideGigahertzCrossTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double ellipsisTime = now - beTime;
    NSString * storeCupHue;
    
    NSDate * barDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * cat = [[NSDateFormatter alloc] init];
    [cat setDateFormat:@"HH:mm"];
    NSString * wayPull = [cat stringFromDate:barDate];
    
    [cat setDateFormat:@"dd"];
    NSString * pashto = [cat stringFromDate:[NSDate date]];
    NSString * beenFax = [cat stringFromDate:barDate];
    
    if (ellipsisTime < 60) {
        storeCupHue = UserArtRoot.builtOwnSeeEar.earStepAfter;
    }else if (ellipsisTime < 60 * 60) {
        storeCupHue = [NSString stringWithFormat:@"%ld%@",(long)ellipsisTime / 60, UserArtRoot.builtOwnSeeEar.sumForGigahertzSerialRun];
    }else if(ellipsisTime < 24 * 60 * 60 && [pashto integerValue] == [beenFax integerValue]){
        storeCupHue = [NSString stringWithFormat:@"%@ %@",UserArtRoot.builtOwnSeeEar.hourInvert,wayPull];
    }else if(ellipsisTime < 24 * 60 * 60 * 2 && [pashto integerValue] != [beenFax integerValue]){
        if ([pashto integerValue] - [beenFax integerValue] == 1 || ([beenFax integerValue] - [pashto integerValue] > 10 && [pashto integerValue] == 1)) {
            storeCupHue = [NSString stringWithFormat:@"%@ %@",UserArtRoot.builtOwnSeeEar.offerPauseSign,wayPull];
        }else{
            [cat setDateFormat:@"MM-dd HH:mm"];
            storeCupHue = [cat stringFromDate:barDate];
        }
    }else if(ellipsisTime < 24 * 60 * 60 * 365){
        [cat setDateFormat:@"MM-dd HH:mm"];
        storeCupHue = [cat stringFromDate:barDate];
    }else{
        [cat setDateFormat:@"yyyy-MM-dd HH:mm"];
        storeCupHue = [cat stringFromDate:barDate];
    }
    return storeCupHue;
}

@end
