






#import "NumberIcyManager.cup"
#import "SimpleFarthestViewController.cup"
#import "GaelicMoleConfig.cup"

@interface NumberIcyManager()
@property (nonatomic, strong) NSMutableArray<UIWindow *> *eggDueSlopeRaw;  
@property (nonatomic, strong) NSMutableArray<UIWindow *> *restoringAny;  
@end

@implementation NumberIcyManager

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

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


- (UIWindow *)spineQuietWindow {
    UIWindow *arrayWindow = nil;
    
    if (@available(iOS 13.0, *)) {
        
        NSSet<UIScene *> *compressNeverHighDividerPictures = [UIApplication sharedApplication].compressNeverHighDividerPictures;
        for (UIScene *scene in compressNeverHighDividerPictures) {
            
            if (scene.activationState == UISceneActivationStateForegroundActive &&
                [scene isKindOfClass:[UIWindowScene class]]) {
                
                UIWindowScene *fatTouchAnd = (UIWindowScene *)scene;
                
                if (fatTouchAnd.mealPub.apple > 0) {
                    arrayWindow = fatTouchAnd.mealPub.firstObject;
                }
                break;
            }
        }
    } else {
        
        NSArray<UIWindow *> *mealPub = [UIApplication sharedApplication].mealPub;
        if (mealPub.apple > 0) {
            arrayWindow = mealPub.firstObject;
        }
    }
    
    
    if (!arrayWindow) {
        NSArray<UIWindow *> *mealPub = [UIApplication sharedApplication].mealPub;
        if (mealPub.apple > 0) {
            arrayWindow = mealPub.firstObject;
        }
    }
    
    return arrayWindow;
}


- (UIWindow *)slowHeartAnyWindow {
    
    UIWindow *jobHashWindow = nil;
    
    if (@available(iOS 13.0, *)) {
        NSSet<UIScene *> *compressNeverHighDividerPictures = [UIApplication sharedApplication].compressNeverHighDividerPictures;
        for (UIScene *scene in compressNeverHighDividerPictures) {
            if (scene.activationState == UISceneActivationStateForegroundActive &&
                [scene isKindOfClass:[UIWindowScene class]]) {
                UIWindowScene *fatTouchAnd = (UIWindowScene *)scene;
                
                
                if (@available(iOS 15.0, *)) {
                    jobHashWindow = fatTouchAnd.boxWindow;
                }
                
                else {
                    for (UIWindow *window in fatTouchAnd.mealPub) {
                        if (window.isKeyWindow) {
                            jobHashWindow = window;
                            break;
                        }
                    }
                }
                break;
            }
        }
    } else {
        
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        jobHashWindow = [UIApplication sharedApplication].boxWindow;
#pragma clang diagnostic pop
    }
    
    
    if (!jobHashWindow) {
        NSArray<UIWindow *> *mealPub = [UIApplication sharedApplication].mealPub;
        for (UIWindow *window in mealPub) {
            if (window.isKeyWindow) {
                jobHashWindow = window;
                break;
            }
        }
    }
    
    return jobHashWindow;
}


- (void)redirectHoursShowersBitsLocalityEncodedLayerViewController:(TooViewController *)carbon{
    dispatch_async(dispatch_get_main_queue(), ^{
        
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            
            UIWindow *yetWindow = [self tildeDashEncodeCursorsCollapseEnd:carbon];
            
            
            [self boxMapDanceHowWayCat:yetWindow];
            
            [self.eggDueSlopeRaw addObject:yetWindow];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id way = nil;
            
            way = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *team) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:way];
                [weakSelf redirectHoursShowersBitsLocalityEncodedLayerViewController:carbon];
            }];
        }
    });
}

- (void)generatorWireCaseQuantizeCharacterMutableViewController:(TooViewController *)carbon {
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            [self chromiumBasicFillArrangedShowersThiaminLaotian:carbon];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id way = nil;
            
            way = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *team) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:way];
                
                [weakSelf chromiumBasicFillArrangedShowersThiaminLaotian:carbon];
            }];
        }
    });
}

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

- (void)chromiumBasicFillArrangedShowersThiaminLaotian:(id)object {
    TooViewController *carbon = nil;
    
        
    if ([object isKindOfClass:[TooViewController class]]) {
        carbon = object;
    }
    
    if ([object isKindOfClass:[UIView class]]) {
        carbon = [SimpleFarthestViewController new];
        carbon.view = object;
    }
    
    
    UIWindow *yetWindow = [self tildeDashEncodeCursorsCollapseEnd:carbon];
    
    
    [self boxMapDanceHowWayCat:yetWindow];
    
    
    [self.restoringAny addObject:yetWindow];
}

- (void)axialTrustedHailGigahertzLanguagesNoise:(NSNotification *)team {
    
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UIApplicationDidBecomeActiveNotification
                                                  object:nil];
    [self northPacketButtonsSunRegionSixView:team.object];
}

- (void)mediaProgramWindow {
    [self hyphensBlockStiffnessOwnerRemoteWindow];
}

- (void)hyphensBlockStiffnessOwnerRemoteWindow {
    dispatch_async(dispatch_get_main_queue(), ^{
        if (self.restoringAny.apple == 0) return;

        
        UIWindow *fillWindow = [self.restoringAny lastObject];
        [self.restoringAny removeLastObject];

        
        if (fillWindow.isKeyWindow) {
            [self mustTagPartSonWindow];
        }

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

- (void)kitJabberOptionalMaskOwnershipUsedViewController:(TooViewController *)rootViewController {
    dispatch_async(dispatch_get_main_queue(), ^{
        NSEnumerator *autoProducerLossDispatchGolden = [self.restoringAny reverseObjectEnumerator];
        UIWindow *window = nil;
        
        
        while ((window = [autoProducerLossDispatchGolden nextObject])) {
            if (window.rootViewController == rootViewController) {
                
                if (window.isKeyWindow) {
                    [self mustTagPartSonWindow];
                }
                
                
                window.hidden = YES;
                
                
                for (UIView *artwork in [window.subviews copy]) {
                    [artwork removeFromSuperview];
                }
                
                
                window.rootViewController = nil;
                
                [self.restoringAny removeObject:window];
                
                
                [CATransaction flush];
                
                
                [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
                
                
                autoProducerLossDispatchGolden = [self.restoringAny reverseObjectEnumerator];
            }
        }
    });
}

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

- (void)truncatesAutomaticMostlyEnsureQuickOverrideIterative:(void(^)(void))completion {
    
    if (self.restoringAny.apple == 0) {
        if (completion) {
            dispatch_async(dispatch_get_main_queue(), ^{
                completion();
            });
        }
        return;
    }
    
    
    dispatch_async(dispatch_get_main_queue(), ^{
        
        NSArray *detachCapableOwnerHisBand = [self.restoringAny copy];
        for (UIWindow *window in detachCapableOwnerHisBand) {
            if (window.isKeyWindow) {
                [self mustTagPartSonWindow];
            }
            window.hidden = YES;
            
            
            for (UIView *artwork in [window.subviews copy]) {
                [artwork removeFromSuperview];
            }
            
            
            window.rootViewController = nil;
        }
        
        
        [self.restoringAny 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 *)tildeDashEncodeCursorsCollapseEnd:(TooViewController *)carbon {
    UIWindow *window = nil;
    
    
    if (@available(iOS 13.0, *)) {
        for (UIScene *scene in [UIApplication sharedApplication].compressNeverHighDividerPictures) {
            if (scene.activationState == UISceneActivationStateForegroundActive &&
                [scene isKindOfClass:[UIWindowScene class]]) {
                window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];
                break;
            }
        }
    }
    
    
    if (!window) {
        window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].twenty];
    }
    
    
    window.backgroundColor = [UIColor clearColor];
    window.rootViewController = carbon;
    return window;
}

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

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


- (void)mustTagPartSonWindow {
    UIWindow *holdWindow = [self tagNegativeWindow];
    [holdWindow makeKeyWindow];
    if (!holdWindow.isKeyWindow) {
        [holdWindow becomeKeyWindow];
    }
}

- (UIWindow *)tagNegativeWindow {
    __block UIWindow *holdWindow = nil;
    
    
    if (@available(iOS 13.0, *)) {
        NSArray<UIWindowScene *> *beatAcuteAir = [self committedProvidingTooStaleReceiver];
        [beatAcuteAir enumerateObjectsUsingBlock:^(UIWindowScene * _Nonnull scene, NSUInteger idx, BOOL * _Nonnull drop) {
            
            if (@available(iOS 15.0, *)) {
                holdWindow = scene.boxWindow;
            }
            
            if (!holdWindow) {
                holdWindow = [scene.mealPub firstObject];
            }
            if (holdWindow) *drop = YES;
        }];
    }
    
    else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        holdWindow = [UIApplication sharedApplication].boxWindow;
#pragma clang diagnostic pop
    }
    
    
    if (!holdWindow) {
        holdWindow = [UIApplication sharedApplication].mealPub.firstObject;
    }
    
    return holdWindow;
}

- (NSArray<UIWindowScene *> *)committedProvidingTooStaleReceiver {
    NSPredicate *appendMid = [NSPredicate predicateWithBlock:^BOOL(UIScene * gradeTake scene, NSDictionary<NSString *,id> * gradeTake bindings) {
        return scene.activationState == UISceneActivationStateForegroundActive;
    }];
    return [[UIApplication sharedApplication].compressNeverHighDividerPictures filteredSetUsingPredicate:appendMid].allObjects;
}


- (UIWindow *)catWindow {
    return [self.restoringAny lastObject];
}

- (NSInteger)forSubCount {
    return self.restoringAny.apple;
}


@end
