






#import "BaseBookMenButton.h"
#import "ReloadThird.h"
#import "UIImage+HasImage.h"
#import "SDWebImageManager.h"

@interface BaseBookMenButton ()


@property (nonatomic, strong) NSTimer *customRotatingTimer;

@property (nonatomic, assign) NSInteger toleranceReachableSparseSchemeUtilitiesMillibars;

@property (nonatomic, copy) NSString *dryImportantBookmarksOceanClaim;

@end

@implementation BaseBookMenButton

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

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


- (void)scrollMetricMakeDependentFont {
    
    self.ticketsDryCenterModernSixOnce = 60;
    self.dryImportantBookmarksOceanClaim = ReloadThird.phoneKitTenTen.artElasticEntryPartlyArmSummaryCode;
    [self setTitle:self.dryImportantBookmarksOceanClaim forState:UIControlStateNormal];

    
    NSString *notLawTagsNow = [ReloadThird importantHelpersPreferNineWrapImage];
    if (notLawTagsNow) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:notLawTagsNow]
                                                    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 mailWireForSixColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage mailWireForSixColor:ReloadThird.fairBlockColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage mailWireForSixColor:ReloadThird.fairBlockColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage mailWireForSixColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

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

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


- (void)pintAuditedClicked {
    [self daughterStrongEndsUnwrapCinematic];
    if (self.getRawLossDueAction) {
        self.getRawLossDueAction();
    }
}


- (void)daughterStrongEndsUnwrapCinematic {
    self.enabled = NO;
    self.toleranceReachableSparseSchemeUtilitiesMillibars = self.ticketsDryCenterModernSixOnce;
    [self storeClampLosePartiallyUnfocusedSimple];
    
    
    self.customRotatingTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(marathiExactRadiansNextFeature:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)marathiExactRadiansNextFeature:(NSTimer *)water {
    self.toleranceReachableSparseSchemeUtilitiesMillibars--;
    if (self.toleranceReachableSparseSchemeUtilitiesMillibars <= 0) {
        [self backKnowRomanQuickSummary];
    } else {
        [self storeClampLosePartiallyUnfocusedSimple];
    }
}


- (void)storeClampLosePartiallyUnfocusedSimple {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",ReloadThird.phoneKitTenTen.sensorRecordingPlaceVendorBlinkIgnoreCode, (long)self.toleranceReachableSparseSchemeUtilitiesMillibars];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)backKnowRomanQuickSummary {
    [self.customRotatingTimer invalidate];
    self.customRotatingTimer = nil;
    self.enabled = YES;
    [self setTitle:self.dryImportantBookmarksOceanClaim forState:UIControlStateNormal];
}

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

@end
