






#import "CertEggEachButton.h"
#import "OutTapPlain.h"
#import "UIImage+JobImage.h"
#import "SDWebImageManager.h"

@interface CertEggEachButton ()


@property (nonatomic, strong) NSTimer *editSodiumMealTimer;

@property (nonatomic, assign) NSInteger minViolationBasalBeenPrecisionPower;

@property (nonatomic, copy) NSString *lookupBadProfileSaltAnimated;

@end

@implementation CertEggEachButton

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

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


- (void)gaspForArrowStartedSlash {
    
    self.talkThatInstancesHighestParagraphProminent = 60;
    self.lookupBadProfileSaltAnimated = OutTapPlain.loudMeterMount.fadeWhiteRefreshManagedAgreementSlabCode;
    [self setTitle:self.lookupBadProfileSaltAnimated forState:UIControlStateNormal];

    
    NSString *pickHeapIdiom = [OutTapPlain saturatedLocalesCapsOrdinalsSphericalImage];
    if (pickHeapIdiom) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:pickHeapIdiom]
                                                    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 decimalAdvanceColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage decimalAdvanceColor:OutTapPlain.bagOuncesColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage decimalAdvanceColor:OutTapPlain.bagOuncesColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage decimalAdvanceColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

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

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


- (void)renewStaticClicked {
    [self turnPenRadioCarDistance];
    if (self.truncatedLastAction) {
        self.truncatedLastAction();
    }
}


- (void)turnPenRadioCarDistance {
    self.enabled = NO;
    self.minViolationBasalBeenPrecisionPower = self.talkThatInstancesHighestParagraphProminent;
    [self loseAndForkTrainerFetchedDeferred];
    
    
    self.editSodiumMealTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(slashLandmarkTemplateWayBuilt:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)slashLandmarkTemplateWayBuilt:(NSTimer *)extra {
    self.minViolationBasalBeenPrecisionPower--;
    if (self.minViolationBasalBeenPrecisionPower <= 0) {
        [self lazyGigabytesBirthdayLargestSlash];
    } else {
        [self loseAndForkTrainerFetchedDeferred];
    }
}


- (void)loseAndForkTrainerFetchedDeferred {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",OutTapPlain.loudMeterMount.queueSexFragmentsGolfDueWinCode, (long)self.minViolationBasalBeenPrecisionPower];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)lazyGigabytesBirthdayLargestSlash {
    [self.editSodiumMealTimer invalidate];
    self.editSodiumMealTimer = nil;
    self.enabled = YES;
    [self setTitle:self.lookupBadProfileSaltAnimated forState:UIControlStateNormal];
}

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

@end
