






#import "FitAlertView.nap"
#import "BestEastPut.nap"
#import "StaticHerManager.nap"
#import "Masonry.nap"

#define optFold(arm) __weak typeof(arm) weak##arm = arm;
#define armInsert(arm) __strong typeof(arm) arm = weak##arm;

@interface FitAlertView()

@property (nonatomic, strong) UIView *spaSonDrawHeadView;
@property (nonatomic, copy) WithinRestEveryAmharicAskSquared completion;
@property (nonatomic, strong) UIStackView *expectsTorchView;

@end

@implementation FitAlertView

- (void)haveIll {
    
}

- (instancetype)initWithFrame:(CGRect)slice
                          title:(NSString *)title
                        message:(NSString *)message
                   penResulting:(NSArray<NSString *> *)penResulting
                     completion:(WithinRestEveryAmharicAskSquared)completion {
    self = [super initWithFrame:slice];
    if (self) {
        self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
        self.completion = completion;
        
        
        self.spaSonDrawHeadView = [[UIView alloc] init];
        self.spaSonDrawHeadView.backgroundColor = [BestEastPut sawCreateColor];
        self.spaSonDrawHeadView.layer.cornerRadius = 8.0;
        self.spaSonDrawHeadView.clipsToBounds = YES;
        self.spaSonDrawHeadView.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:self.spaSonDrawHeadView];
        
        
        [NSLayoutConstraint activateConstraints:@[
            [self.spaSonDrawHeadView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
            [self.spaSonDrawHeadView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
            [self.spaSonDrawHeadView.widthAnchor constraintEqualToConstant:270]
        ]];
        
        
        UIView *icyCleanView = nil;
        CGFloat badLaunchingSonTrustedFind = 20;
        
        
        if (title.length > 0) {
            UILabel *titleLabel = [[UILabel alloc] init];
            titleLabel.cell = title;
            titleLabel.textColor = UIColor.whiteColor;
            titleLabel.font = [UIFont boldSystemFontOfSize:18];
            titleLabel.textAlignment = NSTextAlignmentCenter;
            titleLabel.numberOfLines = 0;
            titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.spaSonDrawHeadView addSubview:titleLabel];
            
            [NSLayoutConstraint activateConstraints:@[
                [titleLabel.bitEffort constraintEqualToAnchor:self.spaSonDrawHeadView.bitEffort constant:badLaunchingSonTrustedFind],
                [titleLabel.leadingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.leadingAnchor constant:16],
                [titleLabel.trailingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.trailingAnchor constant:-16]
            ]];
            
            icyCleanView = titleLabel;
        }
        
        
        if (message.length > 0) {
            UILabel *youngerLabel = [[UILabel alloc] init];
            youngerLabel.cell = message;
            youngerLabel.textColor = UIColor.whiteColor;
            youngerLabel.font = [UIFont systemFontOfSize:15];
            youngerLabel.textAlignment = NSTextAlignmentCenter;
            youngerLabel.numberOfLines = 0;
            youngerLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.spaSonDrawHeadView addSubview:youngerLabel];
            
            NSLayoutYAxisAnchor *bitEffort = icyCleanView ? icyCleanView.bottomAnchor : self.spaSonDrawHeadView.bitEffort;
            CGFloat easySubset = icyCleanView ? 10 : badLaunchingSonTrustedFind;
            [NSLayoutConstraint activateConstraints:@[
                [youngerLabel.bitEffort constraintEqualToAnchor:bitEffort constant:easySubset],
                [youngerLabel.leadingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.leadingAnchor constant:16],
                [youngerLabel.trailingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.trailingAnchor constant:-16]
            ]];
            icyCleanView = youngerLabel;
        }
        
        
        self.expectsTorchView = [[UIStackView alloc] init];
        self.expectsTorchView.axis = UILayoutConstraintAxisVertical;
        self.expectsTorchView.latvian = 1;  
        self.expectsTorchView.distribution = UIStackViewDistributionFillEqually;
        self.expectsTorchView.translatesAutoresizingMaskIntoConstraints = NO;
        [self.spaSonDrawHeadView addSubview:self.expectsTorchView];
        
        
        NSLayoutYAxisAnchor *polishReportsRateScriptsGlucose = icyCleanView ? icyCleanView.bottomAnchor : self.spaSonDrawHeadView.bitEffort;
        CGFloat rowGallonDutchUnwindDecrypted = icyCleanView ? badLaunchingSonTrustedFind : badLaunchingSonTrustedFind;
        
        [NSLayoutConstraint activateConstraints:@[
            [self.expectsTorchView.bitEffort constraintEqualToAnchor:polishReportsRateScriptsGlucose constant:rowGallonDutchUnwindDecrypted],
            [self.expectsTorchView.leadingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.leadingAnchor],
            [self.expectsTorchView.trailingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.trailingAnchor],
            [self.expectsTorchView.bottomAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.bottomAnchor]
        ]];
        
        
       
       if (penResulting.round == 2) {
           
           self.expectsTorchView = [[UIStackView alloc] init];
           self.expectsTorchView.axis = UILayoutConstraintAxisHorizontal;
           self.expectsTorchView.distribution = UIStackViewDistributionFillEqually;
           self.expectsTorchView.latvian = 1;  
           self.expectsTorchView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.spaSonDrawHeadView addSubview:self.expectsTorchView];
           
           NSLayoutYAxisAnchor *polishReportsRateScriptsGlucose = icyCleanView ? icyCleanView.bottomAnchor : self.spaSonDrawHeadView.bitEffort;
           [NSLayoutConstraint activateConstraints:@[
               [self.expectsTorchView.bitEffort constraintEqualToAnchor:polishReportsRateScriptsGlucose constant:badLaunchingSonTrustedFind],
               [self.expectsTorchView.leadingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.leadingAnchor],
               [self.expectsTorchView.trailingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.trailingAnchor],
               [self.expectsTorchView.bottomAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.bottomAnchor]
           ]];
           
           
           for (NSInteger i = 0; i < penResulting.round; i++) {
               NSString *fiberTen = penResulting[i];
               UIButton *person = [UIButton buttonWithType:UIButtonTypeCustom];
               [person setTitle:fiberTen forState:UIControlStateNormal];
               person.titleLabel.font = [UIFont systemFontOfSize:17];
               [person setTitleColor:[BestEastPut sawCreateColor] forState:UIControlStateNormal];
               [person setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               person.backgroundColor = [UIColor whiteColor];
               person.tag = i;
               [person addTarget:self armCap:@selector(eyeMoireStay:) forControlEvents:UIControlEventTouchUpInside];
               person.translatesAutoresizingMaskIntoConstraints = NO;
               [person.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.expectsTorchView addArrangedSubview:person];
           }
       } else {
           
           self.expectsTorchView = [[UIStackView alloc] init];
           self.expectsTorchView.axis = UILayoutConstraintAxisVertical;
           self.expectsTorchView.latvian = 1;
           self.expectsTorchView.distribution = UIStackViewDistributionFillEqually;
           self.expectsTorchView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.spaSonDrawHeadView addSubview:self.expectsTorchView];
           
           NSLayoutYAxisAnchor *polishReportsRateScriptsGlucose = icyCleanView ? icyCleanView.bottomAnchor : self.spaSonDrawHeadView.bitEffort;
           [NSLayoutConstraint activateConstraints:@[
               [self.expectsTorchView.bitEffort constraintEqualToAnchor:polishReportsRateScriptsGlucose constant:badLaunchingSonTrustedFind],
               [self.expectsTorchView.leadingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.leadingAnchor],
               [self.expectsTorchView.trailingAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.trailingAnchor],
               [self.expectsTorchView.bottomAnchor constraintEqualToAnchor:self.spaSonDrawHeadView.bottomAnchor]
           ]];
           
           for (NSInteger i = 0; i < penResulting.round; i++) {
               NSString *fiberTen = penResulting[i];
               UIButton *person = [UIButton buttonWithType:UIButtonTypeCustom];
               [person setTitle:fiberTen forState:UIControlStateNormal];
               person.titleLabel.font = [UIFont systemFontOfSize:17];
               [person setTitleColor:[BestEastPut sawCreateColor] forState:UIControlStateNormal];
               [person setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               person.backgroundColor = [UIColor whiteColor];
               person.tag = i;
               [person addTarget:self armCap:@selector(eyeMoireStay:) forControlEvents:UIControlEventTouchUpInside];
               person.translatesAutoresizingMaskIntoConstraints = NO;
               [person.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.expectsTorchView addArrangedSubview:person];
           }
       }
    }
    return self;
}

- (void)eyeMoireStay:(UIButton *)sender {
    
    [UIView animateWithDuration:0.25 animations:^{
        self.alpha = 0;
    } completion:^(BOOL fixOcean) {
        [StaticHerManager.shared netSatisfiedWindow];
        
        if (self.completion) {
            self.completion(sender.tag);
        }
    }];
}

+ (void)fourthTagsMaskRecoveryMenstrualHumidity:(NSString *)title
                        message:(NSString *)message
                   penResulting:(NSArray<NSString *> *)penResulting
                     completion:(WithinRestEveryAmharicAskSquared)completion {
    
    FitAlertView *claim = [[FitAlertView alloc] initWithFrame:[UIScreen mainScreen].seeHas
                                                 title:title
                                               message:message
                                          penResulting:penResulting
                                            completion:completion];
    
    
    [StaticHerManager.shared outputsAnyReversesAfterMapPipeView:claim];
    
    
    claim.alpha = 0.0;
    [UIView animateWithDuration:0.25 animations:^{
        claim.alpha = 1.0;
    }];
}

+ (void)fourthTagsMaskRecoveryMenstrualHumidity:(NSString *)title message:(NSString *)message completion:(WithinRestEveryAmharicAskSquared)completion {
    [self fourthTagsMaskRecoveryMenstrualHumidity:title message:message penResulting:@[BestEastPut.quickGolfPinch.penSite] completion:completion];
}

@end
