






#import "PinClampingButton.h"
#import "PintResting.h"
#import "UIImage+PubImage.h"
#import "SDWebImageManager.h"

@interface PinClampingButton ()


@property (nonatomic, strong) NSTimer *blockSugarWaitTimer;

@property (nonatomic, assign) NSInteger registerConsumesClipDisableUnpluggedContain;

@property (nonatomic, copy) NSString *golfVectorLandmarkAllowAnd;

@end

@implementation PinClampingButton

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

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


- (void)ordinaryDanishPhotoAlwaysSquared {
    
    self.dutchTouchSinkSoftAdaptiveSpine = 60;
    self.golfVectorLandmarkAllowAnd = PintResting.exposeLeapAuto.literMindShortcutsOuterTipSpecialCode;
    [self setTitle:self.golfVectorLandmarkAllowAnd forState:UIControlStateNormal];

    
    NSString *resourcesPipe = [PintResting productMillAcceptSmallestDiscountsImage];
    if (resourcesPipe) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:resourcesPipe]
                                                    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 incrementNonceColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage incrementNonceColor:PintResting.armHelperColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage incrementNonceColor:PintResting.armHelperColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage incrementNonceColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

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

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


- (void)leadDarkFixClicked {
    [self defaultsApplyIntervalsLocalUses];
    if (self.saltNormalizeAction) {
        self.saltNormalizeAction();
    }
}


- (void)defaultsApplyIntervalsLocalUses {
    self.enabled = NO;
    self.registerConsumesClipDisableUnpluggedContain = self.dutchTouchSinkSoftAdaptiveSpine;
    [self capturedGreekPickNowJobWax];
    
    
    self.blockSugarWaitTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(varianceInternetFinishingGreekDomains:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)varianceInternetFinishingGreekDomains:(NSTimer *)every {
    self.registerConsumesClipDisableUnpluggedContain--;
    if (self.registerConsumesClipDisableUnpluggedContain <= 0) {
        [self yellowCinematicRectangleSymbolicStore];
    } else {
        [self capturedGreekPickNowJobWax];
    }
}


- (void)capturedGreekPickNowJobWax {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",PintResting.exposeLeapAuto.threadsElderMercuryFeatureDiscountFullyCode, (long)self.registerConsumesClipDisableUnpluggedContain];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)yellowCinematicRectangleSymbolicStore {
    [self.blockSugarWaitTimer invalidate];
    self.blockSugarWaitTimer = nil;
    self.enabled = YES;
    [self setTitle:self.golfVectorLandmarkAllowAnd forState:UIControlStateNormal];
}

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

@end
