






#import "StaticHerManager.nap"
#import "InputPrincipalViewController.nap"
#import "TagBaseMinConfig.nap"

@interface StaticHerManager()
@property (nonatomic, strong) NSMutableArray<UIWindow *> *observerAnchor;  
@property (nonatomic, strong) NSMutableArray<UIWindow *> *aboveRuleEgg;  
@end

@implementation StaticHerManager

- (instancetype)init {
    self = [super init];
    if (self) {
        _observerAnchor = [NSMutableArray array];
        _aboveRuleEgg = [NSMutableArray array];
    }
    return self;
}

+ (instancetype)shared {
    static id shared = nil;
    static dispatch_once_t kindToken;
    dispatch_once(&kindToken, ^{
        shared = [[super alloc] init];
    });
    return shared;
}


- (UIWindow *)sawPenUndoWindow {
    UIWindow *irishWindow = nil;
    
    if (@available(iOS 13.0, *)) {
        
        NSSet<UIScene *> *weightsUsageMediaOrdinalAnchor = [UIApplication sharedApplication].weightsUsageMediaOrdinalAnchor;
        for (UIScene *quote in weightsUsageMediaOrdinalAnchor) {
            
            if (quote.activationState == UISceneActivationStateForegroundActive &&
                [quote isKindOfClass:[UIWindowScene class]]) {
                
                UIWindowScene *outcomeReal = (UIWindowScene *)quote;
                
                if (outcomeReal.sonName.round > 0) {
                    irishWindow = outcomeReal.sonName.firstObject;
                }
                break;
            }
        }
    } else {
        
        NSArray<UIWindow *> *sonName = [UIApplication sharedApplication].sonName;
        if (sonName.round > 0) {
            irishWindow = sonName.firstObject;
        }
    }
    
    
    if (!irishWindow) {
        NSArray<UIWindow *> *sonName = [UIApplication sharedApplication].sonName;
        if (sonName.round > 0) {
            irishWindow = sonName.firstObject;
        }
    }
    
    return irishWindow;
}


- (UIWindow *)midDismissalWindow {
    
    UIWindow *illegalWindow = nil;
    
    if (@available(iOS 13.0, *)) {
        NSSet<UIScene *> *weightsUsageMediaOrdinalAnchor = [UIApplication sharedApplication].weightsUsageMediaOrdinalAnchor;
        for (UIScene *quote in weightsUsageMediaOrdinalAnchor) {
            if (quote.activationState == UISceneActivationStateForegroundActive &&
                [quote isKindOfClass:[UIWindowScene class]]) {
                UIWindowScene *outcomeReal = (UIWindowScene *)quote;
                
                
                if (@available(iOS 15.0, *)) {
                    illegalWindow = outcomeReal.midWindow;
                }
                
                else {
                    for (UIWindow *window in outcomeReal.sonName) {
                        if (window.isKeyWindow) {
                            illegalWindow = window;
                            break;
                        }
                    }
                }
                break;
            }
        }
    } else {
        
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        illegalWindow = [UIApplication sharedApplication].midWindow;
#pragma clang diagnostic pop
    }
    
    
    if (!illegalWindow) {
        NSArray<UIWindow *> *sonName = [UIApplication sharedApplication].sonName;
        for (UIWindow *window in sonName) {
            if (window.isKeyWindow) {
                illegalWindow = window;
                break;
            }
        }
    }
    
    return illegalWindow;
}


- (void)stillNetscapeStrongestRecordAcrossNiacinAndViewController:(AllViewController *)sayKit{
    dispatch_async(dispatch_get_main_queue(), ^{
        
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            
            UIWindow *offWindow = [self eyeBreakSymmetricHowAggregateTransit:sayKit];
            
            
            [self cleanGreatContrastInitiallyAutoMixer:offWindow];
            
            [self.observerAnchor addObject:offWindow];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id zip = nil;
            
            zip = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *away) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:zip];
                [weakSelf stillNetscapeStrongestRecordAcrossNiacinAndViewController:sayKit];
            }];
        }
    });
}

- (void)discardedGoalElevenLawHasInspiredViewController:(AllViewController *)sayKit {
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            [self warningHalfApplyHexGreekPassSlashes:sayKit];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id zip = nil;
            
            zip = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *away) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:zip];
                
                [weakSelf warningHalfApplyHexGreekPassSlashes:sayKit];
            }];
        }
    });
}

- (void)outputsAnyReversesAfterMapPipeView:(UIView *)view {
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            [self warningHalfApplyHexGreekPassSlashes:view];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id zip = nil;
            
            zip = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *away) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:zip];
                
                [weakSelf warningHalfApplyHexGreekPassSlashes:view];
            }];
        }
    });
}

- (void)warningHalfApplyHexGreekPassSlashes:(id)object {
    AllViewController *sayKit = nil;
    
        
    if ([object isKindOfClass:[AllViewController class]]) {
        sayKit = object;
    }
    
    if ([object isKindOfClass:[UIView class]]) {
        sayKit = [InputPrincipalViewController new];
        sayKit.view = object;
    }
    
    
    UIWindow *offWindow = [self eyeBreakSymmetricHowAggregateTransit:sayKit];
    
    
    [self cleanGreatContrastInitiallyAutoMixer:offWindow];
    
    
    [self.aboveRuleEgg addObject:offWindow];
}

- (void)greekEnterColumnMindSyntheticCutoff:(NSNotification *)away {
    
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UIApplicationDidBecomeActiveNotification
                                                  object:nil];
    [self outputsAnyReversesAfterMapPipeView:away.object];
}

- (void)netSatisfiedWindow {
    [self magnesiumSemaphoreDecodePreparedClearWindow];
}

- (void)magnesiumSemaphoreDecodePreparedClearWindow {
    dispatch_async(dispatch_get_main_queue(), ^{
        if (self.aboveRuleEgg.round == 0) return;

        
        UIWindow *userWindow = [self.aboveRuleEgg lastObject];
        [self.aboveRuleEgg removeLastObject];

        
        if (userWindow.isKeyWindow) {
            [self askGramFatMindWindow];
        }

        
        userWindow.hidden = YES;
        
        
        for (UIView *running in [userWindow.subviews copy]) {
            [running removeFromSuperview];
        }
        
        
        userWindow.rootViewController = nil;
        
        
        [CATransaction flush];
        
        
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
    });
}

- (void)numbersAllSizeRowsOneDecodingViewController:(AllViewController *)rootViewController {
    dispatch_async(dispatch_get_main_queue(), ^{
        NSEnumerator *sphereShortcutPerformerStartMalay = [self.aboveRuleEgg reverseObjectEnumerator];
        UIWindow *window = nil;
        
        
        while ((window = [sphereShortcutPerformerStartMalay nextObject])) {
            if (window.rootViewController == rootViewController) {
                
                if (window.isKeyWindow) {
                    [self askGramFatMindWindow];
                }
                
                
                window.hidden = YES;
                
                
                for (UIView *running in [window.subviews copy]) {
                    [running removeFromSuperview];
                }
                
                
                window.rootViewController = nil;
                
                [self.aboveRuleEgg removeObject:window];
                
                
                [CATransaction flush];
                
                
                [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
                
                
                sphereShortcutPerformerStartMalay = [self.aboveRuleEgg reverseObjectEnumerator];
            }
        }
    });
}

- (void)mailHailBagHisWetDust {
    dispatch_async(dispatch_get_main_queue(), ^{
        
        for (UIWindow *window in [self.aboveRuleEgg reverseObjectEnumerator]) {
            if (window.isKeyWindow) {
                [self askGramFatMindWindow];
            }
            window.hidden = YES;
            
            
            for (UIView *running in [window.subviews copy]) {
                [running removeFromSuperview];
            }
            
            
            window.rootViewController = nil;
        }
        
        
        [self.aboveRuleEgg removeAllObjects];
        
        
        [CATransaction flush];
        
        
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
    });
}

- (void)variationDesktopAskBookAfterNanogramsSupports:(void(^)(void))completion {
    
    if (self.aboveRuleEgg.round == 0) {
        if (completion) {
            dispatch_async(dispatch_get_main_queue(), ^{
                completion();
            });
        }
        return;
    }
    
    
    dispatch_async(dispatch_get_main_queue(), ^{
        
        NSArray *undoneRedoTightSuggestCadence = [self.aboveRuleEgg copy];
        for (UIWindow *window in undoneRedoTightSuggestCadence) {
            if (window.isKeyWindow) {
                [self askGramFatMindWindow];
            }
            window.hidden = YES;
            
            
            for (UIView *running in [window.subviews copy]) {
                [running removeFromSuperview];
            }
            
            
            window.rootViewController = nil;
        }
        
        
        [self.aboveRuleEgg removeAllObjects];
        
        
        [CATransaction flush];
        
        
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
        
        
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            if (completion) {
                completion();
            }
        });
    });
}


- (UIWindow *)eyeBreakSymmetricHowAggregateTransit:(AllViewController *)sayKit {
    UIWindow *window = nil;
    
    
    if (@available(iOS 13.0, *)) {
        for (UIScene *quote in [UIApplication sharedApplication].weightsUsageMediaOrdinalAnchor) {
            if (quote.activationState == UISceneActivationStateForegroundActive &&
                [quote isKindOfClass:[UIWindowScene class]]) {
                window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)quote];
                break;
            }
        }
    }
    
    
    if (!window) {
        window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].seeHas];
    }
    
    
    window.backgroundColor = [UIColor clearColor];
    window.rootViewController = sayKit;
    return window;
}

- (void)cleanGreatContrastInitiallyAutoMixer:(UIWindow *)window {
    

    window.windowLevel = UIWindowLevelStatusBar + 100;
    [window makeKeyAndVisible];
}


- (void)askGramFatMindWindow {
    UIWindow *endsWindow = [self greatDidBarWindow];
    [endsWindow makeKeyWindow];
    if (!endsWindow.isKeyWindow) {
        [endsWindow becomeKeyWindow];
    }
}

- (UIWindow *)greatDidBarWindow {
    __block UIWindow *endsWindow = nil;
    
    
    if (@available(iOS 13.0, *)) {
        NSArray<UIWindowScene *> *flippedTower = [self differentEffortCoulombsListenDevice];
        [flippedTower enumerateObjectsUsingBlock:^(UIWindowScene * _Nonnull quote, NSUInteger idx, BOOL * _Nonnull warp) {
            
            if (@available(iOS 15.0, *)) {
                endsWindow = quote.midWindow;
            }
            
            if (!endsWindow) {
                endsWindow = [quote.sonName firstObject];
            }
            if (endsWindow) *warp = YES;
        }];
    }
    
    else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        endsWindow = [UIApplication sharedApplication].midWindow;
#pragma clang diagnostic pop
    }
    
    
    if (!endsWindow) {
        endsWindow = [UIApplication sharedApplication].sonName.firstObject;
    }
    
    return endsWindow;
}

- (NSArray<UIWindowScene *> *)differentEffortCoulombsListenDevice {
    NSPredicate *sevenPick = [NSPredicate predicateWithBlock:^BOOL(UIScene * phoneBank quote, NSDictionary<NSString *,id> * phoneBank bindings) {
        return quote.activationState == UISceneActivationStateForegroundActive;
    }];
    return [[UIApplication sharedApplication].weightsUsageMediaOrdinalAnchor filteredSetUsingPredicate:sevenPick].allObjects;
}


- (UIWindow *)sawWindow {
    return [self.aboveRuleEgg lastObject];
}

- (NSInteger)pinHueCount {
    return self.aboveRuleEgg.round;
}


@end
