APP_NAME_TO_USECASE = {
    "people_counting": "people_counting",
    "drone_traffic_monitoring": "drone_traffic_monitoring",
    "intrusion_detection": "intrusion_detection",
    "proximity_detection": "proximity_detection",
    "mask_detection": "mask_detection",
    "pipeline_detection": "pipeline_detection",
    "vehicle_monitoring": "vehicle_monitoring",
    "Vehicle Type Monitoring": "vehicle_monitoring",
    "Vehicle Monitoring": "vehicle_monitoring",
    "vehicle-monitoring": "vehicle_monitoring",
    "weapon_detection": "weapon_detection",
    "traffic_sign_monitoring": "traffic_sign_monitoring",
    "flare_analysis": "flare_analysis",
    "ppe_compliance": "ppe_compliance",
    "Customer Activity Analysis": "advanced_customer_service",
    "assembly_line_detection": "assembly_line_detection",
    "crop_weed_detection"  : "crop_weed_detection",
    "emergency_vehicle_detection": "emergency_vehicle_detection",
    "fashion_detection": "fashion_detection",
    "gender_detection": "gender_detection",
    "price_tag_detection": "price_tag_detection",
    "windmill_maintenance": "windmill_maintenance",
    "underwater_pollution_detection": "underwater_pollution_detection",
    "solar_panel": "solar_panel",
    "face_emotion": "face_emotion",
    "pedestrian_detection": "pedestrian_detection",
    "warehouse_object_segmentation": "warehouse_object_segmentation",
    "flower_segmentation": "flower_segmentation",
    "shopping_cart_analysis": "shopping_cart_analysis",
    "car_part_segmentation": "car_part_segmentation",
    "weld_defect_detection" : "weld_defect_detection",
    "fruit_monitoring" : "fruit_monitoring",
    "concrete_crack_detection": "concrete_crack_detection",
    "lane_detection" : "lane_detection",
    "shelf_inventory" :"shelf_inventory",
    "smoker_detection": "smoker_detection",
    "age_detection": "age_detection",
    "defect_detection_products": "defect_detection_products",
    "parking_space_detection": "parking_space_detection",
    "car_damage_detection": "car_damage_detection",
    "license_plate_detection": "license_plate_detection",
    "shoplifting_detection": "shoplifting_detection",
    "cardiomegaly_classification": "cardiomegaly_classification",
    "road_traffic_density": "road_traffic_density",
    "histopathological_cancer_detection" : "histopathological_cancer_detection",
    "road_view_segmentation": "road_view_segmentation",
    "face_recognition": "face_recognition",
    "drowsy_driver_detection": "drowsy_driver_detection",
    "waterbody_segmentation": "waterbody_segmentation",
    "litter_detection" : "litter_detection",
    "leak_detection": "leak_detection",
    "Fire Safety Monitoring": "fire_smoke_detection",
    "human_activity_recognition": "human_activity_recognition",
    "abandoned_object_detection" : "abandoned_object_detection",
    "gas_leak_detection": "gas_leak_detection",
    "color_detection": "color_detection",
    "Color Detection": "color_detection",
    "License Plate Recognition" : "license_plate_monitor",
    "License Plate Monitoring" : "license_plate_monitor",
    "cell_microscopy_segmentation": "cell_microscopy_segmentation",
    "Dwell Detection": "dwell",
    "age_gender_detection": "age_gender_detection",
    "People Tracking" : "people_tracking",
    "wildlife_monitoring": "wildlife_monitoring",
    "pcb_defect_detection": "pcb_defect_detection",
    "underground_pipeline_defect" : "underground_pipeline_defect",
    "suspicious_activity_detection": "suspicious_activity_detection",
    "natural_disaster_detection": "natural_disaster_detection",
    "Foot Fall": "footfall",
    "footfall": "footfall",
    "foot_fall": "footfall",
    "Crowdflow": "crowdflow",
    "crowdflow": "crowdflow",
    "HeatMaps": "heatmaps",
    "heatmaps": "heatmaps",
    "Crowd Density HeatMaps": "crowd_density_heatmaps",
    "crowd_density_heatmaps": "crowd_density_heatmaps",
    "Hazard Zone Entry": "hazard_zone_entry",
    "Parking Lot Vehicle Monitoring": "vehicle_monitoring_parking_lot",
    "vehicle_monitoring_parking_lot": "vehicle_monitoring_parking_lot",
    "Vehicle Monitoring Parking Lot": "vehicle_monitoring_parking_lot",
    "Drone view vehicle monitoring": "vehicle_monitoring_drone_view",
    "Parking Lot Analytics": "parking_lot_analytics",
    "Vehicle Monitoring Wrong Way": "vehicle_monitoring_wrong_way",
    "Stopped Vehicle Monitoring": "stopped_vehicle_monitoring",
    "Area Utilization": "area_utilization",
    "Loitering Detection": "loitering_detection",
    "Tailgating Detection": "tailgating_detection",
    "Vehicle Color Detection": "vehicle_color_detection",
    "Fall Detection": "fall_detection",
    "Running Detection": "running_detection",
    "Liquid Leak Detection": "liquid_leak_detection",
    "Pipe Gas Leak Detection": "pipe_gas_leak_detection",
    "People In Zone Counting": "people_counting_in_zone",
    "Pipe Corrosion Detection": "pipe_corrosion_detection",
    "Overcrowding Detection": "overcrowding_detection",
    "Animal Detection": "animal_detection",
    "Burglary Detection": "burglary_detection",
    "Landslide Detection": "landslide_detection",
}

APP_NAME_TO_CATEGORY = {
    "people_counting": "general",
    "drone_traffic_monitoring": "traffic",
    "intrusion_detection": "security",
    "proximity_detection": "security",
    "mask_detection": "mask_detection",
    "pipeline_detection": "pipeline_detection",
    "vehicle_monitoring": "traffic",
    "Vehicle Type Monitoring": "traffic",
    "Vehicle Monitoring": "traffic",
    "vehicle-monitoring": "traffic",
    "weapon_detection": "security",
    "traffic_sign_monitoring": "traffic",
    "flare_analysis": "flare_detection",
    "ppe_compliance": "security",
    "Customer Activity Analysis": "sales",
    "assembly_line_detection": "manufacturing",
    "crop_weed_detection": "agriculture",
    "emergency_vehicle_detection": "traffic",
    "fashion_detection": "retail",
    "gender_detection": "general",
    "price_tag_detection": "retail",
    "windmill_maintenance": "windmill_maintenance",
    "underwater_pollution_detection": "environmental",
    "solar_panel": "energy",
    "face_emotion": "general",
    "pedestrian_detection": "pedestrian",
    "warehouse_object_segmentation": "retail",
    "flower_segmentation": "agriculture",
    "shopping_cart_analysis": "retail",
    "car_part_segmentation": "automobile",
    "weld_defect_detection" : "weld",
    "fruit_monitoring" : "agriculture",
    "concrete_crack_detection": "general",
    "lane_detection" : "traffic",
    "shelf_inventory" : "retail",
    "smoker_detection": "general",
    "age_detection": "general",
    "defect_detection_products": "retail",
    "parking_space_detection": "parking_space",
    "car_damage_detection": "car_damage",
    "license_plate_detection": "license_plate",
    "shoplifting_detection": "security",
    "cardiomegaly_classification": "healthcare",
    "road_traffic_density": "automobile",
    "histopathological_cancer_detection" : "healthcare",
    "road_view_segmentation": "automobile",
    "face_recognition": "security",
    "drowsy_driver_detection": "automobile",
    "waterbody_segmentation": "agriculture",
    "litter_detection" : "litter_detection",
    "leak_detection": "oil_gas",
    "Fire Safety Monitoring": "hazard",
    "human_activity_recognition": "general",
    "abandoned_object_detection" : "security",
    "gas_leak_detection": "oil_gas",
    "color_detection": "visual_appearance",
    "Color Detection": "visual_appearance",
    "License Plate Recognition" : "license_plate_monitor",
    "License Plate Monitoring" : "license_plate_monitor",
    "cell_microscopy_segmentation" : "healthcare",
    "Dwell Detection": "general",
    "age_gender_detection": "age_gender_detection",
    "People Tracking" : "general",
    
    "wildlife_monitoring": "environmental",
    "pcb_defect_detection": "manufacturing",
    "underground_pipeline_defect" : "general",
    "suspicious_activity_detection": "security",
    "natural_disaster_detection": "environmental",
    "Foot Fall": "retail",
    "footfall": "retail",
    "foot_fall": "retail",
    "Crowdflow": "retail",
    "crowdflow": "retail",
    "HeatMaps": "retail",
    "heatmaps": "retail",
    "Crowd Density HeatMaps": "retail",
    "crowd_density_heatmaps": "retail",
    "Hazard Zone Entry": "general",
    "Parking Lot Vehicle Monitoring": "traffic",
    "vehicle_monitoring_parking_lot": "traffic",
    "Vehicle Monitoring Parking Lot": "traffic",
    "Drone view vehicle monitoring": "traffic",
    "Parking Lot Analytics": "traffic",
    "Vehicle Monitoring Wrong Way": "traffic",
    "Stopped Vehicle Monitoring": "traffic",
    "Area Utilization": "general",
    "Loitering Detection": "general",
    "Tailgating Detection": "security",
    "Vehicle Color Detection": "traffic",
    "Fall Detection": "general",
    "Running Detection": "security",
    "Liquid Leak Detection": "security",
    "Pipe Gas Leak Detection": "security",
    "People Counting In Zone": "general",
    "Pipe Corrosion Detection": "security",
    "Overcrowding Detection": "security",
    "Animal Detection": "general",
    "Burglary Detection": "security",
    "Landslide Detection": "environmental",
}

def get_usecase_from_app_name(app_name: str) -> str:
    normalized_app_name = app_name.lower().replace(" ", "_").replace("-", "_")
    return APP_NAME_TO_USECASE.get(app_name, APP_NAME_TO_USECASE.get(normalized_app_name))

def get_category_from_app_name(app_name: str) -> str:
    normalized_app_name = app_name.lower().replace(" ", "_").replace("-", "_")
    return APP_NAME_TO_CATEGORY.get(app_name, APP_NAME_TO_CATEGORY.get(normalized_app_name))