






#import "ButAlertView.h"
#import "IndicesBest.h"
#import "AssumeNotManager.h"
#import "Masonry.h"

#define wayZoom(bar) __weak typeof(bar) weak##bar = bar;
#define cocoaMenu(bar) __strong typeof(bar) bar = weak##bar;

@interface ButAlertView()

@property (nonatomic, strong) UIView *maxHerAnyAlienView;
@property (nonatomic, copy) OutSkippedTwistServerGramPacket completion;
@property (nonatomic, strong) UIStackView *flushWaxRedoView;

@end

@implementation ButAlertView

- (void)dealloc {
    
}

- (instancetype)initWithFrame:(CGRect)frame
                          title:(NSString *)title
                        message:(NSString *)message
                   restingLower:(NSArray<NSString *> *)restingLower
                     completion:(OutSkippedTwistServerGramPacket)completion {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
        self.completion = completion;
        
        
        self.maxHerAnyAlienView = [[UIView alloc] init];
        self.maxHerAnyAlienView.backgroundColor = [IndicesBest sexExtrasColor];
        self.maxHerAnyAlienView.layer.cornerRadius = IndicesBest.trustMainArm.notHexIndigo;
        self.maxHerAnyAlienView.clipsToBounds = YES;
        self.maxHerAnyAlienView.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:self.maxHerAnyAlienView];
        
        
        [NSLayoutConstraint activateConstraints:@[
            [self.maxHerAnyAlienView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
            [self.maxHerAnyAlienView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
            [self.maxHerAnyAlienView.widthAnchor constraintEqualToConstant:270]
        ]];
        
        
        UIView *endTodayView = nil;
        CGFloat backupMoveAnonymousIndigoCenters = 20;
        
        
        if (title.length > 0) {
            UILabel *titleLabel = [[UILabel alloc] init];
            titleLabel.text = title;
            titleLabel.textColor = UIColor.whiteColor;
            titleLabel.font = [UIFont boldSystemFontOfSize:18];
            titleLabel.textAlignment = NSTextAlignmentCenter;
            titleLabel.numberOfLines = 0;
            titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.maxHerAnyAlienView addSubview:titleLabel];
            
            [NSLayoutConstraint activateConstraints:@[
                [titleLabel.topAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.topAnchor constant:backupMoveAnonymousIndigoCenters],
                [titleLabel.leadingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.leadingAnchor constant:16],
                [titleLabel.trailingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.trailingAnchor constant:-16]
            ]];
            
            endTodayView = titleLabel;
        }
        
        
        if (message.length > 0) {
            UILabel *areBlueLabel = [[UILabel alloc] init];
            areBlueLabel.text = message;
            areBlueLabel.textColor = UIColor.whiteColor;
            areBlueLabel.font = [UIFont systemFontOfSize:15];
            areBlueLabel.textAlignment = NSTextAlignmentCenter;
            areBlueLabel.numberOfLines = 0;
            areBlueLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.maxHerAnyAlienView addSubview:areBlueLabel];
            
            NSLayoutYAxisAnchor *topAnchor = endTodayView ? endTodayView.bottomAnchor : self.maxHerAnyAlienView.topAnchor;
            CGFloat blurDidBit = endTodayView ? 10 : backupMoveAnonymousIndigoCenters;
            [NSLayoutConstraint activateConstraints:@[
                [areBlueLabel.topAnchor constraintEqualToAnchor:topAnchor constant:blurDidBit],
                [areBlueLabel.leadingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.leadingAnchor constant:16],
                [areBlueLabel.trailingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.trailingAnchor constant:-16]
            ]];
            endTodayView = areBlueLabel;
        }
        
        
        self.flushWaxRedoView = [[UIStackView alloc] init];
        self.flushWaxRedoView.axis = UILayoutConstraintAxisVertical;
        self.flushWaxRedoView.spacing = 1;  
        self.flushWaxRedoView.distribution = UIStackViewDistributionFillEqually;
        self.flushWaxRedoView.translatesAutoresizingMaskIntoConstraints = NO;
        [self.maxHerAnyAlienView addSubview:self.flushWaxRedoView];
        
        
        NSLayoutYAxisAnchor *datumNumbersUnboundQuitHue = endTodayView ? endTodayView.bottomAnchor : self.maxHerAnyAlienView.topAnchor;
        CGFloat expertBadWayQuotationOxygen = endTodayView ? backupMoveAnonymousIndigoCenters : backupMoveAnonymousIndigoCenters;
        
        [NSLayoutConstraint activateConstraints:@[
            [self.flushWaxRedoView.topAnchor constraintEqualToAnchor:datumNumbersUnboundQuitHue constant:expertBadWayQuotationOxygen],
            [self.flushWaxRedoView.leadingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.leadingAnchor],
            [self.flushWaxRedoView.trailingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.trailingAnchor],
            [self.flushWaxRedoView.bottomAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.bottomAnchor]
        ]];
        
        
       
       if (restingLower.count == 2) {
           
           self.flushWaxRedoView = [[UIStackView alloc] init];
           self.flushWaxRedoView.axis = UILayoutConstraintAxisHorizontal;
           self.flushWaxRedoView.distribution = UIStackViewDistributionFillEqually;
           self.flushWaxRedoView.spacing = 1;  
           self.flushWaxRedoView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.maxHerAnyAlienView addSubview:self.flushWaxRedoView];
           
           NSLayoutYAxisAnchor *datumNumbersUnboundQuitHue = endTodayView ? endTodayView.bottomAnchor : self.maxHerAnyAlienView.topAnchor;
           [NSLayoutConstraint activateConstraints:@[
               [self.flushWaxRedoView.topAnchor constraintEqualToAnchor:datumNumbersUnboundQuitHue constant:backupMoveAnonymousIndigoCenters],
               [self.flushWaxRedoView.leadingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.leadingAnchor],
               [self.flushWaxRedoView.trailingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.trailingAnchor],
               [self.flushWaxRedoView.bottomAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.bottomAnchor]
           ]];
           
           
           for (NSInteger i = 0; i < restingLower.count; i++) {
               NSString *ejectMax = restingLower[i];
               UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
               [button setTitle:ejectMax forState:UIControlStateNormal];
               button.titleLabel.font = [UIFont systemFontOfSize:17];
               [button setTitleColor:[IndicesBest sexExtrasColor] forState:UIControlStateNormal];
               [button setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               button.backgroundColor = [UIColor whiteColor];
               button.tag = i;
               [button addTarget:self action:@selector(armDarkerEye:) forControlEvents:UIControlEventTouchUpInside];
               button.translatesAutoresizingMaskIntoConstraints = NO;
               [button.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.flushWaxRedoView addArrangedSubview:button];
           }
       } else {
           
           self.flushWaxRedoView = [[UIStackView alloc] init];
           self.flushWaxRedoView.axis = UILayoutConstraintAxisVertical;
           self.flushWaxRedoView.spacing = 1;
           self.flushWaxRedoView.distribution = UIStackViewDistributionFillEqually;
           self.flushWaxRedoView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.maxHerAnyAlienView addSubview:self.flushWaxRedoView];
           
           NSLayoutYAxisAnchor *datumNumbersUnboundQuitHue = endTodayView ? endTodayView.bottomAnchor : self.maxHerAnyAlienView.topAnchor;
           [NSLayoutConstraint activateConstraints:@[
               [self.flushWaxRedoView.topAnchor constraintEqualToAnchor:datumNumbersUnboundQuitHue constant:backupMoveAnonymousIndigoCenters],
               [self.flushWaxRedoView.leadingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.leadingAnchor],
               [self.flushWaxRedoView.trailingAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.trailingAnchor],
               [self.flushWaxRedoView.bottomAnchor constraintEqualToAnchor:self.maxHerAnyAlienView.bottomAnchor]
           ]];
           
           for (NSInteger i = 0; i < restingLower.count; i++) {
               NSString *ejectMax = restingLower[i];
               UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
               [button setTitle:ejectMax forState:UIControlStateNormal];
               button.titleLabel.font = [UIFont systemFontOfSize:17];
               [button setTitleColor:[IndicesBest sexExtrasColor] forState:UIControlStateNormal];
               [button setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               button.backgroundColor = [UIColor whiteColor];
               button.tag = i;
               [button addTarget:self action:@selector(armDarkerEye:) forControlEvents:UIControlEventTouchUpInside];
               button.translatesAutoresizingMaskIntoConstraints = NO;
               [button.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.flushWaxRedoView addArrangedSubview:button];
           }
       }
    }
    return self;
}

- (void)armDarkerEye:(UIButton *)sender {
    
    [UIView animateWithDuration:0.25 animations:^{
        self.alpha = 0;
    } completion:^(BOOL finished) {
        [AssumeNotManager.shared eraFoodSlideWindow];
        
        if (self.completion) {
            self.completion(sender.tag);
        }
    }];
}

+ (void)boyfriendMessagingRedefinedMegahertzServicesTolerance:(NSString *)title
                        message:(NSString *)message
                   restingLower:(NSArray<NSString *> *)restingLower
                     completion:(OutSkippedTwistServerGramPacket)completion {
    
    ButAlertView *dense = [[ButAlertView alloc] initWithFrame:[UIScreen mainScreen].bounds
                                                 title:title
                                               message:message
                                          restingLower:restingLower
                                            completion:completion];
    
    
    [AssumeNotManager.shared readerRatePinReleasedPashtoRowsView:dense];
    
    
    dense.alpha = 0.0;
    [UIView animateWithDuration:0.25 animations:^{
        dense.alpha = 1.0;
    }];
}

+ (void)boyfriendMessagingRedefinedMegahertzServicesTolerance:(NSString *)title message:(NSString *)message completion:(OutSkippedTwistServerGramPacket)completion {
    [self boyfriendMessagingRedefinedMegahertzServicesTolerance:title message:message restingLower:@[IndicesBest.linerSharpness.sawClip] completion:completion];
}

@end
