





#import "ChildDissolveIndexHairUnbounded.h"
@import Network;

static NSString *barMovieBoxMay = nil;
static nw_path_monitor_t existNapZipIts = NULL;

@implementation ChildDissolveIndexHairUnbounded

+ (BOOL)endYearsWillStoragePrompt {
    return barMovieBoxMay != nil;
}

+ (NSString *)nearbyCatWinType {
    return barMovieBoxMay ?: @"none";
}

+ (void)askKeepNapChineseVortexCookie:(void (^)(BOOL endYearsWillStoragePrompt))completion {
    
    if (existNapZipIts != NULL) {
        nw_path_monitor_cancel(existNapZipIts);
        existNapZipIts = NULL;
    }
    
    
    existNapZipIts = nw_path_monitor_create();
    nw_path_monitor_set_queue(existNapZipIts, dispatch_get_main_queue());
    
    __block nw_path_monitor_t ownerBlurFit = existNapZipIts;
    nw_path_monitor_set_update_handler(existNapZipIts, ^(nw_path_t path) {
        nw_path_status_t status = nw_path_get_status(path);
        if (status == nw_path_status_satisfied) {
            if (nw_path_uses_interface_type(path, nw_interface_type_wifi)) {
                barMovieBoxMay = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                barMovieBoxMay = @"cellular";
            } else {
                
                barMovieBoxMay = @"other";
            }
            
            
            if (ownerBlurFit) {
                nw_path_monitor_cancel(ownerBlurFit);
                ownerBlurFit = NULL;
                existNapZipIts = NULL;
            }
            
        } else {
            barMovieBoxMay = nil;
        }
        
        
        if (completion) {
            completion([self endYearsWillStoragePrompt]);
        }
        
    });
    
    
    nw_path_monitor_start(existNapZipIts);
}

@end
