






#import "SkipSentDublinButton.h"
#import "RuleListCut.h"
#import "UIImage+HasImage.h"
#import "BikeMenKinTopController.h"
#import "UIImage+HasImage.h"
#import "UIColor+RunColor.h"

@implementation SkipSentDublinButton

- (instancetype)initFolderSurgeViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.wasLayoutSeeViewController = viewController;
        [self audienceReportsBirthdaySheGopher];
    }
    return self;
}


- (void)audienceReportsBirthdaySheGopher {
    
    NSArray *treeAvailTenUploadAffiliate = [VignetteHormoneDoubleCurrencyAbsolute companyAccordingExternalBelowPaper:[AlignSmall class]];
    
    
    NSString *takeSortUnloadCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block AlignSmall *eyeSpaBuiltHex = nil;
    [treeAvailTenUploadAffiliate enumerateObjectsUsingBlock:^(AlignSmall *country, NSUInteger idx, BOOL *stop) {
        if ([country.overThumbTabCode caseInsensitiveCompare:takeSortUnloadCode] == NSOrderedSame) {
            eyeSpaBuiltHex = country;
            *stop = YES; 
        }
    }];
    self.targetDimensionBlurTenArtery = eyeSpaBuiltHex;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",RuleListCut.coloredDraft.thatZoneTheme, eyeSpaBuiltHex.predictedCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *renamingImage = [UIImage infoBusFilterVariationTurnName:RuleListCut.coloredDraft.likePerformedFollowerNetChapterReport];
    
    
    CGSize weekdayUnitSize = CGSizeMake(13, 13); 
    
    
    UIImage *hisDueImage = [self twistSongFocusImage:renamingImage resetWetSize:weekdayUnitSize];
    
    
    UIImage *templateImage = [hisDueImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    [self setImage:templateImage forState:UIControlStateNormal];
    [self setImage:templateImage forState:UIControlStateHighlighted];
    
    self.tintColor = UIColor.darkGrayColor;
    
    
    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 setBackgroundColor:UIColor.clearColor];
    [self setTitleColor:UIColor.darkGrayColor forState:UIControlStateNormal];
    [self setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
    self.titleLabel.font = [UIFont systemFontOfSize:16];

    
    self.contentEdgeInsets = UIEdgeInsetsMake(8, 12, 8, 12); 
    
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(airBadLeaseClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)twistSongFocusImage:(UIImage *)image resetWetSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat localLeast = targetSize.width / image.size.width;
    CGFloat outYouToday = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(localLeast, outYouToday);
    
    
    CGRect lowManRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - lowManRect.size.width) / 2.0,
                               (targetSize.height - lowManRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                lowManRect.size.width,
                                lowManRect.size.height)];
    
    UIImage *catImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return catImage;
}


- (void)airBadLeaseClicked {
    IgnoredInsertedSheetWidgetMeterTrainerViewController *did = [IgnoredInsertedSheetWidgetMeterTrainerViewController new];
    did.sizeLiterDelegate = self;
    [self.wasLayoutSeeViewController.navigationController pushViewController:did animated:NO];
}

- (void)completedSaturatedMegawattsUnderageLittleCompletedTeluguMile:(AlignSmall *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",RuleListCut.coloredDraft.thatZoneTheme, country.predictedCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.targetDimensionBlurTenArtery = country;
}

- (void)dealloc {
    
}
@end
