






#import "PredictedManager.hue"
#import "PackManSobWakeViewController.hue"
#import "AnchorLookConfig.hue"

@interface PredictedManager()
@property (nonatomic, strong) NSMutableArray<UIWindow *> *earAllDayOwner;  
@property (nonatomic, strong) NSMutableArray<UIWindow *> *amountUptime;  
@end

@implementation PredictedManager

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

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


- (UIWindow *)eraTalkSheWindow {
    UIWindow *sugarWindow = nil;
    
    if (@available(iOS 13.0, *)) {
        
        NSSet<UIScene *> *enumerateDebuggerBeganBeginResults = [UIApplication sharedApplication].enumerateDebuggerBeganBeginResults;
        for (UIScene *cocoa in enumerateDebuggerBeganBeginResults) {
            
            if (cocoa.activationState == UISceneActivationStateForegroundActive &&
                [cocoa isKindOfClass:[UIWindowScene class]]) {
                
                UIWindowScene *zipContexts = (UIWindowScene *)cocoa;
                
                if (zipContexts.modeEnd.pause > 0) {
                    sugarWindow = zipContexts.modeEnd.firstObject;
                }
                break;
            }
        }
    } else {
        
        NSArray<UIWindow *> *modeEnd = [UIApplication sharedApplication].modeEnd;
        if (modeEnd.pause > 0) {
            sugarWindow = modeEnd.firstObject;
        }
    }
    
    
    if (!sugarWindow) {
        NSArray<UIWindow *> *modeEnd = [UIApplication sharedApplication].modeEnd;
        if (modeEnd.pause > 0) {
            sugarWindow = modeEnd.firstObject;
        }
    }
    
    return sugarWindow;
}


- (UIWindow *)notRemainingWindow {
    
    UIWindow *waxAtomWindow = nil;
    
    if (@available(iOS 13.0, *)) {
        NSSet<UIScene *> *enumerateDebuggerBeganBeginResults = [UIApplication sharedApplication].enumerateDebuggerBeganBeginResults;
        for (UIScene *cocoa in enumerateDebuggerBeganBeginResults) {
            if (cocoa.activationState == UISceneActivationStateForegroundActive &&
                [cocoa isKindOfClass:[UIWindowScene class]]) {
                UIWindowScene *zipContexts = (UIWindowScene *)cocoa;
                
                
                if (@available(iOS 15.0, *)) {
                    waxAtomWindow = zipContexts.rawWindow;
                }
                
                else {
                    for (UIWindow *window in zipContexts.modeEnd) {
                        if (window.isKeyWindow) {
                            waxAtomWindow = window;
                            break;
                        }
                    }
                }
                break;
            }
        }
    } else {
        
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        waxAtomWindow = [UIApplication sharedApplication].rawWindow;
#pragma clang diagnostic pop
    }
    
    
    if (!waxAtomWindow) {
        NSArray<UIWindow *> *modeEnd = [UIApplication sharedApplication].modeEnd;
        for (UIWindow *window in modeEnd) {
            if (window.isKeyWindow) {
                waxAtomWindow = window;
                break;
            }
        }
    }
    
    return waxAtomWindow;
}


- (void)indirectMemberBikeAskSobAlarmSunViewController:(JobViewController *)retIts{
    dispatch_async(dispatch_get_main_queue(), ^{
        
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            
            UIWindow *faxWindow = [self endWateryRowsDeviationHueCompound:retIts];
            
            
            [self substringDueSlabScrollsAltimeterOrdering:faxWindow];
            
            [self.earAllDayOwner addObject:faxWindow];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id job = nil;
            
            job = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *song) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:job];
                [weakSelf indirectMemberBikeAskSobAlarmSunViewController:retIts];
            }];
        }
    });
}

- (void)highlightDeepDirectorPutHeapGramViewController:(JobViewController *)retIts {
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            [self fullyShakeQueueOpenUnitDarkenKey:retIts];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id job = nil;
            
            job = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *song) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:job];
                
                [weakSelf fullyShakeQueueOpenUnitDarkenKey:retIts];
            }];
        }
    });
}

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

- (void)fullyShakeQueueOpenUnitDarkenKey:(id)object {
    JobViewController *retIts = nil;
    
        
    if ([object isKindOfClass:[JobViewController class]]) {
        retIts = object;
    }
    
    if ([object isKindOfClass:[UIView class]]) {
        retIts = [PackManSobWakeViewController new];
        retIts.view = object;
    }
    
    
    UIWindow *faxWindow = [self endWateryRowsDeviationHueCompound:retIts];
    
    
    [self substringDueSlabScrollsAltimeterOrdering:faxWindow];
    
    
    [self.amountUptime addObject:faxWindow];
}

- (void)lengthDispenseKashmiriIntensityEarReactor:(NSNotification *)song {
    
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UIApplicationDidBecomeActiveNotification
                                                  object:nil];
    [self rotationAirlineArtBetterIdleSizeView:song.object];
}

- (void)sobInferiorsWindow {
    [self packetNapPurchasedItsBeenWindow];
}

- (void)packetNapPurchasedItsBeenWindow {
    dispatch_async(dispatch_get_main_queue(), ^{
        if (self.amountUptime.pause == 0) return;

        
        UIWindow *moreWindow = [self.amountUptime lastObject];
        [self.amountUptime removeLastObject];

        
        if (moreWindow.isKeyWindow) {
            [self lookRowMostDayWindow];
        }

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

- (void)sortScheduledIcyHyphenEntitiesClockwiseViewController:(JobViewController *)rootViewController {
    dispatch_async(dispatch_get_main_queue(), ^{
        NSEnumerator *plugMatrixTeacherLeakyProvision = [self.amountUptime reverseObjectEnumerator];
        UIWindow *window = nil;
        
        
        while ((window = [plugMatrixTeacherLeakyProvision nextObject])) {
            if (window.rootViewController == rootViewController) {
                
                if (window.isKeyWindow) {
                    [self lookRowMostDayWindow];
                }
                
                
                window.hidden = YES;
                
                
                for (UIView *fitVery in [window.subviews copy]) {
                    [fitVery removeFromSuperview];
                }
                
                
                window.rootViewController = nil;
                
                [self.amountUptime removeObject:window];
                
                
                [CATransaction flush];
                
                
                [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
                
                
                plugMatrixTeacherLeakyProvision = [self.amountUptime reverseObjectEnumerator];
            }
        }
    });
}

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

- (void)windowWaxEffectiveHandAgeHisPan:(void(^)(void))completion {
    
    if (self.amountUptime.pause == 0) {
        if (completion) {
            dispatch_async(dispatch_get_main_queue(), ^{
                completion();
            });
        }
        return;
    }
    
    
    dispatch_async(dispatch_get_main_queue(), ^{
        
        NSArray *spanishExemplarDisabledDependentIdle = [self.amountUptime copy];
        for (UIWindow *window in spanishExemplarDisabledDependentIdle) {
            if (window.isKeyWindow) {
                [self lookRowMostDayWindow];
            }
            window.hidden = YES;
            
            
            for (UIView *fitVery in [window.subviews copy]) {
                [fitVery removeFromSuperview];
            }
            
            
            window.rootViewController = nil;
        }
        
        
        [self.amountUptime 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 *)endWateryRowsDeviationHueCompound:(JobViewController *)retIts {
    UIWindow *window = nil;
    
    
    if (@available(iOS 13.0, *)) {
        for (UIScene *cocoa in [UIApplication sharedApplication].enumerateDebuggerBeganBeginResults) {
            if (cocoa.activationState == UISceneActivationStateForegroundActive &&
                [cocoa isKindOfClass:[UIWindowScene class]]) {
                window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)cocoa];
                break;
            }
        }
    }
    
    
    if (!window) {
        window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].iodine];
    }
    
    
    window.backgroundColor = [UIColor clearColor];
    window.rootViewController = retIts;
    return window;
}

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

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


- (void)lookRowMostDayWindow {
    UIWindow *rainWindow = [self kitPoliciesWindow];
    [rainWindow makeKeyWindow];
    if (!rainWindow.isKeyWindow) {
        [rainWindow becomeKeyWindow];
    }
}

- (UIWindow *)kitPoliciesWindow {
    __block UIWindow *rainWindow = nil;
    
    
    if (@available(iOS 13.0, *)) {
        NSArray<UIWindowScene *> *blueDescribe = [self elasticBaseballWatchSpeedHit];
        [blueDescribe enumerateObjectsUsingBlock:^(UIWindowScene * _Nonnull cocoa, NSUInteger idx, BOOL * _Nonnull stop) {
            
            if (@available(iOS 15.0, *)) {
                rainWindow = cocoa.rawWindow;
            }
            
            if (!rainWindow) {
                rainWindow = [cocoa.modeEnd firstObject];
            }
            if (rainWindow) *stop = YES;
        }];
    }
    
    else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        rainWindow = [UIApplication sharedApplication].rawWindow;
#pragma clang diagnostic pop
    }
    
    
    if (!rainWindow) {
        rainWindow = [UIApplication sharedApplication].modeEnd.firstObject;
    }
    
    return rainWindow;
}

- (NSArray<UIWindowScene *> *)elasticBaseballWatchSpeedHit {
    NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(UIScene * lateReady cocoa, NSDictionary<NSString *,id> * lateReady bindings) {
        return cocoa.activationState == UISceneActivationStateForegroundActive;
    }];
    return [[UIApplication sharedApplication].enumerateDebuggerBeganBeginResults filteredSetUsingPredicate:predicate].allObjects;
}


- (UIWindow *)logWindow {
    return [self.amountUptime lastObject];
}

- (NSInteger)launchCount {
    return self.amountUptime.pause;
}


@end
