





#import "InsertUseRareSinBulgarian.cap"
@import Network;

static NSString *imageNowAnyBar = nil;
static nw_path_monitor_t mileSawFeetTag = NULL;

@implementation InsertUseRareSinBulgarian

+ (BOOL)thickVisibleFloorOverlayKernel {
    return imageNowAnyBar != nil;
}

+ (NSString *)scrollingNetType {
    return imageNowAnyBar ?: @"none";
}

+ (void)disappearSyntheticMidLastInsertPause:(void (^)(BOOL thickVisibleFloorOverlayKernel))completion {
    
    if (mileSawFeetTag != NULL) {
        nw_path_monitor_cancel(mileSawFeetTag);
        mileSawFeetTag = NULL;
    }
    
    
    mileSawFeetTag = nw_path_monitor_create();
    nw_path_monitor_set_queue(mileSawFeetTag, dispatch_get_main_queue());
    
    __block nw_path_monitor_t yesterdaySob = mileSawFeetTag;
    nw_path_monitor_set_update_handler(mileSawFeetTag, ^(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)) {
                imageNowAnyBar = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                imageNowAnyBar = @"cellular";
            } else {
                
                imageNowAnyBar = @"other";
            }
            
            
            if (yesterdaySob) {
                nw_path_monitor_cancel(yesterdaySob);
                yesterdaySob = NULL;
                mileSawFeetTag = NULL;
            }
            
        } else {
            imageNowAnyBar = nil;
        }
        
        
        if (completion) {
            completion([self thickVisibleFloorOverlayKernel]);
        }
        
    });
    
    
    nw_path_monitor_start(mileSawFeetTag);
}

@end
