






#import "SpacePullHumanButton.h"
#import "ButPhonetic.h"
#import "UIImage+MapImage.h"
#import "HandballPagerController.h"
#import "UIImage+MapImage.h"
#import "UIColor+SawColor.h"

@implementation SpacePullHumanButton

- (instancetype)initSixteenSideViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.bookAllocateViewController = viewController;
        [self bloodAxesRussianDiscreteSilent];
    }
    return self;
}


- (void)bloodAxesRussianDiscreteSilent {
    
    NSArray *lowerHandoffCatResizingHue = [EnvelopeCallRepublicCancelingEvict unifyDiskPaceModifierTint:[AddBitFail class]];
    
    
    NSString *soloCarLinkWonCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block AddBitFail *openPackCapPut = nil;
    [lowerHandoffCatResizingHue enumerateObjectsUsingBlock:^(AddBitFail *country, NSUInteger idx, BOOL *stop) {
        if ([country.kitAlphaTalkCode caseInsensitiveCompare:soloCarLinkWonCode] == NSOrderedSame) {
            openPackCapPut = country;
            *stop = YES; 
        }
    }];
    self.enterZipInterClinicalReporting = openPackCapPut;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",ButPhonetic.ditheredFast.pieceWayIntro, openPackCapPut.drivenMidCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *campaignImage = [UIImage healthProvidedMillibarsOperatingDividerName:ButPhonetic.ditheredFast.declinedMomentBiotinBufferingOwnFourth];
    
    
    CGSize lazyWithFatSize = CGSizeMake(13, 13); 
    
    
    UIImage *slightImage = [self iterationRomanImage:campaignImage tokenDogSize:lazyWithFatSize];
    
    
    [self setImage:slightImage forState:UIControlStateNormal];
    [self setImage:[slightImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateHighlighted]; 
    
    
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    
    
    self.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; 
    CGFloat spacing = 3.0; 
    self.imageEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, -spacing);  
    self.titleEdgeInsets = UIEdgeInsetsMake(0, -spacing, 0, spacing);   
    
    
    [self setBackgroundImage:[UIImage alertCostBoundColor:[ButPhonetic.sonLegacyColor argumentDogGeorgianHoverSpeakProcess:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage alertCostBoundColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]]
                   forState:UIControlStateHighlighted];
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = 2.f;
    self.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;
    self.layer.masksToBounds = YES;
    
    
    self.contentEdgeInsets = UIEdgeInsetsMake(8, 12, 8, 12); 
    
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(youLeftoverClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)iterationRomanImage:(UIImage *)image tokenDogSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat didDarkFax = targetSize.width / image.size.width;
    CGFloat chainTagger = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(didDarkFax, chainTagger);
    
    
    CGRect dryHexRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - dryHexRect.size.width) / 2.0,
                               (targetSize.height - dryHexRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                dryHexRect.size.width,
                                dryHexRect.size.height)];
    
    UIImage *tooImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return tooImage;
}


- (void)youLeftoverClicked {
    StableReleaseShadowStartCustodianFinalizeViewController *far = [StableReleaseShadowStartCustodianFinalizeViewController new];
    far.ironSegueDelegate = self;
    [self.bookAllocateViewController.navigationController pushViewController:far animated:NO];
}

- (void)useActiveRenameIndicatedWireModeGopherMarkup:(AddBitFail *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",ButPhonetic.ditheredFast.pieceWayIntro, country.drivenMidCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.enterZipInterClinicalReporting = country;
}

- (void)dealloc {
    
}
@end
