






#import "SubscriptEnvelopeExplicitCentralsMidDecisionViewController.h"
#import "NSString+ReturnHow.h"

@implementation XXGSelectMobileAccountModel

@end

@interface SubscriptEnvelopeExplicitCentralsMidDecisionViewController () <UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) XXGSelectMobileAccountModel *expiredRun;
@property (nonatomic, strong) UITableView *subCommentView;
@property (nonatomic, assign) NSInteger tiedWayPinMost;
@property (nonatomic, strong) UIButton *skinFindBoxButton;
@property (nonatomic, strong) UIButton *unpluggedHasButton;

@end

@implementation SubscriptEnvelopeExplicitCentralsMidDecisionViewController

- (XXGSelectMobileAccountModel *)expiredRun {
    return self.crossActive;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.magicPieceButton.hidden = YES;
    self.barFusionButton.hidden = YES;

    
    UILabel *titleLabel = [UILabel new];
    titleLabel.text = HisGeometry.illLoudEarFlow.upperFairTruncatesExerciseSex;
    titleLabel.textColor = [HisGeometry schedulerColor];
    titleLabel.font = [UIFont systemFontOfSize:HisGeometry.sinkIcyLeaky.secretThread];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(HisGeometry.sinkIcyLeaky.cityAdvised);
        make.left.right.equalTo(self.view);
        make.height.mas_equalTo(HisGeometry.sinkIcyLeaky.subjectQuery);
    }];

    self.view.clipsToBounds = YES;
    self.view.layer.cornerRadius = HisGeometry.sinkIcyLeaky.capsPlayOff;

    
    UIView *bridgeView = [[UIView alloc] init];
    bridgeView.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:bridgeView];
    [bridgeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.view);
        make.height.mas_equalTo(HisGeometry.sinkIcyLeaky.brushSizeOur);
    }];

    
    _skinFindBoxButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_skinFindBoxButton setTitle:HisGeometry.illLoudEarFlow.toneFireAsk forState:UIControlStateNormal];
    [_skinFindBoxButton setTitleColor:UIColor.darkGrayColor forState:UIControlStateNormal];
    [_skinFindBoxButton setBackgroundColor:UIColor.systemGray5Color];
    _skinFindBoxButton.titleLabel.font = [UIFont systemFontOfSize:16];
    [_skinFindBoxButton addTarget:self action:@selector(favoritesWatchFourthDevicesCanAction:) forControlEvents:UIControlEventTouchUpInside];
    [bridgeView addSubview:_skinFindBoxButton];
    [_skinFindBoxButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(bridgeView);
        make.width.equalTo(bridgeView).multipliedBy(0.5);
    }];

    
    _unpluggedHasButton = [HisGeometry momentaryQueryingTryExclusiveSamplingColor:HisGeometry.illLoudEarFlow.counter];
    [_unpluggedHasButton addTarget:self action:@selector(presencePairHeavyMillBarAction:) forControlEvents:UIControlEventTouchUpInside];
    [bridgeView addSubview:_unpluggedHasButton];
    [_unpluggedHasButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.bottom.equalTo(bridgeView);
        make.width.equalTo(bridgeView).multipliedBy(0.5);
    }];

    
    _subCommentView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    _subCommentView.backgroundColor = UIColor.systemGray6Color;
    _subCommentView.contentInset = UIEdgeInsetsMake(0, 0, 10, 0);
    _subCommentView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _subCommentView.rowHeight = HisGeometry.sinkIcyLeaky.redMayPretty;
    _subCommentView.delegate = self;
    _subCommentView.dataSource = self;
    [_subCommentView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"XXGSelectMobileAccountCell"];

    [self.view addSubview:_subCommentView];
    [_subCommentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLabel.mas_bottom).offset(HisGeometry.sinkIcyLeaky.lemmaBeacon);
        make.left.right.equalTo(self.view);
        make.bottom.equalTo(bridgeView.mas_top);
    }];

    
    if (self.expiredRun.curlPanAllUse.count > 0) {
        NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
        [_subCommentView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
        _tiedWayPinMost = 0;
    }
}



- (void)favoritesWatchFourthDevicesCanAction:(UIButton *)sender {
    [[FarEntityManager shared] aloneWalkingWindow];
    if (self.prefixDestroy && [self.prefixDestroy respondsToSelector:@selector(xxpk_selectMobileAccountCancelButtonDidClick)]) {
        [self.prefixDestroy xxpk_selectMobileAccountCancelButtonDidClick];
    }
}

- (void)presencePairHeavyMillBarAction:(UIButton *)sender {
    [[FarEntityManager shared] aloneWalkingWindow];
    if (self.prefixDestroy && [self.prefixDestroy respondsToSelector:@selector(xxpk_selectMobileAccountConfirmButtonDidClickWithModel:nowFloatAccount:)]) {
        NSString *nowFloatAccount = self.expiredRun.curlPanAllUse[self.tiedWayPinMost];
        [self.prefixDestroy xxpk_selectMobileAccountConfirmButtonDidClickWithModel:self.expiredRun nowFloatAccount:nowFloatAccount];
    }
}



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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *thin = [tableView dequeueReusableCellWithIdentifier:@"XXGSelectMobileAccountCell" forIndexPath:indexPath];
    thin.backgroundColor = UIColor.whiteColor;
    thin.selectionStyle = UITableViewCellSelectionStyleNone;
    thin.textLabel.text = self.expiredRun.curlPanAllUse[indexPath.row];
    thin.textLabel.textColor = UIColor.darkGrayColor;
    thin.textLabel.font = [UIFont systemFontOfSize:16];

    
    if (indexPath.row == self.tiedWayPinMost) {
        thin.accessoryType = UITableViewCellAccessoryCheckmark;
        thin.tintColor = [HisGeometry schedulerColor];
    } else {
        thin.accessoryType = UITableViewCellAccessoryNone;
    }

    return thin;
}



- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSInteger unifyAndCan = self.tiedWayPinMost;
    self.tiedWayPinMost = indexPath.row;

    
    NSMutableArray *wrongCanWet = [NSMutableArray array];
    [wrongCanWet addObject:[NSIndexPath indexPathForRow:unifyAndCan inSection:0]];
    if (unifyAndCan != indexPath.row) {
        [wrongCanWet addObject:indexPath];
    }
    [tableView reloadRowsAtIndexPaths:wrongCanWet withRowAnimation:UITableViewRowAnimationNone];
}

@end
