






#import "SiteCellMenButton.h"
#import "LearnWeekly.h"
#import "UIImage+EarImage.h"
#import "SDWebImageManager.h"

@interface SiteCellMenButton ()


@property (nonatomic, strong) NSTimer *keyLiveBothNapTimer;

@property (nonatomic, assign) NSInteger driveIssueDigitDublinGrammarAdaptive;

@property (nonatomic, copy) NSString *specifySpeakControlExponentsArrow;

@end

@implementation SiteCellMenButton

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self breakStrictlyWayHiddenSolve];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self breakStrictlyWayHiddenSolve];
    }
    return self;
}


- (void)breakStrictlyWayHiddenSolve {
    
    self.tenRemovalInsideIdleCalciumUplink = 60;
    self.specifySpeakControlExponentsArrow = LearnWeekly.estonianBanner.eulerDownCandidateParserDismissTomorrowCode;
    [self setTitle:self.specifySpeakControlExponentsArrow forState:UIControlStateNormal];

    
    NSString *packSpaFunEar = [LearnWeekly rowEnsureCupShrinkLocationsImage];
    if (packSpaFunEar) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:packSpaFunEar]
                                                    options:0
                                                   progress:nil
                                                  completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
            if (image) {
                dispatch_async(dispatch_get_main_queue(), ^{
                    [self setBackgroundImage:image forState:UIControlStateNormal];
                    [self setBackgroundImage:[UIImage lawYetRealmMayColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage lawYetRealmMayColor:LearnWeekly.youBorderColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage lawYetRealmMayColor:LearnWeekly.youBorderColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage lawYetRealmMayColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = LearnWeekly.reuseRenewal.stopVariance;
    self.layer.masksToBounds = YES;
    
    self.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
    
    [self sizeToFit];

    
    [self addTarget:self action:@selector(volatileNapClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (void)volatileNapClicked {
    [self dayUndefinedTelephonyRetPatterns];
    if (self.talkSubgroupsAction) {
        self.talkSubgroupsAction();
    }
}


- (void)dayUndefinedTelephonyRetPatterns {
    self.enabled = NO;
    self.driveIssueDigitDublinGrammarAdaptive = self.tenRemovalInsideIdleCalciumUplink;
    [self locationsExtendRelationsInvitedDogResulting];
    
    
    self.keyLiveBothNapTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(animatingGurationRingArcadeKilogram:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)animatingGurationRingArcadeKilogram:(NSTimer *)clean {
    self.driveIssueDigitDublinGrammarAdaptive--;
    if (self.driveIssueDigitDublinGrammarAdaptive <= 0) {
        [self blindingLateDiskPhotoBasic];
    } else {
        [self locationsExtendRelationsInvitedDogResulting];
    }
}


- (void)locationsExtendRelationsInvitedDogResulting {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",LearnWeekly.estonianBanner.cricketAnchoredDragForLandmarkDatumCode, (long)self.driveIssueDigitDublinGrammarAdaptive];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)blindingLateDiskPhotoBasic {
    [self.keyLiveBothNapTimer invalidate];
    self.keyLiveBothNapTimer = nil;
    self.enabled = YES;
    [self setTitle:self.specifySpeakControlExponentsArrow forState:UIControlStateNormal];
}

- (void)dealloc {
    
    [self.keyLiveBothNapTimer invalidate];
    self.keyLiveBothNapTimer = nil;
}

@end
