/**
 * AppConstants — Shared option arrays and configuration values.
 *
 * Used by: LocationDetails, ScanObservationForm, EnterpriseMouldAssessment,
 * and any future form components.
 */
var AppConstants = {
    ROOM_TYPES: [
        'Foyer', 'Main Bedroom', 'Second Bedroom', 'Third Bedroom', 'Fourth Bedroom',
        'Fifth Bedroom', 'Kitchen', 'Pantry', 'Storage', 'Walk-in Wardrobe',
        'Living Room', 'Nursery', 'Bathroom', 'Second Bathroom', 'Third Bathroom',
        'Toilet', 'Second Toilet', 'Third Toilet', 'Laundry Room', 'Family Room',
        'Game Room', 'Guest Room', 'Library', 'Home Office', 'Garage', 'Gym',
        'Pool', 'Porch', 'Deck', 'Sun Room', 'Balcony', 'Home Theatre',
        'Attic', 'Conservatory', 'Basement',
    ],

    BUILDING_TYPES: [
        'House', 'Terraced House', 'Apartment', 'Town House',
        'Cottage', 'Mansion', 'Commercial', 'Municipal',
    ],

    // Standard observation options (used by ScanObservationForm)
    ODOUR_OPTIONS: ['None', 'Faint', 'Mild', 'Moderate', 'Strong'],

    TEXTURE_OPTIONS: ['Damp', 'Flaking', 'Bubbling Paint', 'Furry', 'Slimy', 'Powdery'],

    // ── Enterprise Assessment Constants (used by EnterpriseMouldAssessment) ──

    // DMAT scoring scale: 0=none, 1=≤ sheet of paper, 2=paper→door, 3=≥ door
    DMAT_SCORE_LABELS: [
        { value: 0, label: '0', desc: 'None' },
        { value: 1, label: '1', desc: '≤ Sheet of paper' },
        { value: 2, label: '2', desc: 'Paper → Door' },
        { value: 3, label: '3', desc: '≥ Standard door' },
    ],

    // Component rows in the DMAT matrix
    ASSESSMENT_COMPONENTS: [
        {
            key: 'ceiling',
            label: 'Ceiling',
            icon: 'top_panel_close',
            materials: ['Ceiling Tile', 'Plaster', 'Concrete', 'Sheet Rock', 'Metal', 'Wood', 'Other'],
            assessmentNotes: ['Peeling Paint', 'Rust', 'Staining', 'Efflorescence', 'Condensation'],
        },
        {
            key: 'walls',
            label: 'Wall',
            icon: 'rectangle',
            materials: ['Sheet Rock', 'Plaster', 'Concrete', 'Block', 'Brick', 'Tile', 'Wood', 'Other'],
            assessmentNotes: ['Peeling Paint', 'Efflorescence', 'Staining', 'Rust', 'Condensation'],
        },
        {
            key: 'floor',
            label: 'Floor',
            icon: 'floor',
            materials: ['Wood', 'Carpet', 'Vinyl', 'Ceramic', 'Concrete', 'Tile', 'Other'],
            assessmentNotes: ['Buckling', 'Staining', 'Warping', 'Discolouration'],
        },
        {
            key: 'windows',
            label: 'Windows',
            icon: 'window',
            materials: ['Exterior', 'Interior', 'Skylight', 'Frame', 'Sill', 'Other'],
            assessmentNotes: ['Peeling Paint', 'Condensation', 'Rust', 'Staining'],
        },
        {
            key: 'furnishings',
            label: 'Furnishings',
            icon: 'chair',
            materials: ['Furniture', 'Mechanical', 'Sink', 'Toilet', 'Copier', 'Upholstery', 'Other'],
            assessmentNotes: ['Peeling Paint', 'Rust', 'Staining', 'Discolouration'],
        },
        {
            key: 'hvac',
            label: 'HVAC Systems',
            icon: 'hvac',
            materials: ['Radiator', 'Forced-Air', 'Fan', 'Unit Ventilator', 'Window Unit', 'Ducting', 'Other'],
            assessmentNotes: ['Peeling Paint', 'Rust', 'Staining', 'Blockage'],
        },
        {
            key: 'supplies',
            label: 'Supplies & Materials',
            icon: 'inventory_2',
            materials: ['Books', 'Boxes', 'Equipment', 'Clothing', 'Paper', 'Other'],
            assessmentNotes: ['Wrinkled Pages', 'Crumpled Boxes', 'Staining', 'Discolouration'],
        },
        {
            key: 'pipes',
            label: 'Pipes',
            icon: 'plumbing',
            materials: ['Plumbing', 'Gas', 'Drainage', 'Insulation', 'Other'],
            assessmentNotes: ['Peeling Paint', 'Rust', 'Corrosion', 'Leaking'],
        },
    ],

    // Risk classification levels
    RISK_LEVELS: ['Low', 'Medium', 'High', 'Critical'],

    // Remediation methods
    REMEDIATION_METHODS: [
        'HEPA Vacuuming',
        'Damp Wipe (Detergent)',
        'Antimicrobial Treatment',
        'Dry Ice Blasting',
        'Soda Blasting',
        'Encapsulation',
        'Removal & Disposal',
        'Structural Drying',
        'Fogging / Misting',
        'UV-C Treatment',
    ],

    // PPE levels
    PPE_LEVELS: [
        'Level 1 — Gloves & N95 Mask',
        'Level 2 — Full Coveralls & Respirator',
        'Level 3 — Full PPE with PAPR',
        'Level 4 — Full Hazmat Suit',
    ],

    // Containment types
    CONTAINMENT_TYPES: [
        'None Required',
        'Mini Containment',
        'Full Containment',
        'Negative Pressure Enclosure',
    ],

    // Shared geolocation fallback — used when GeoLocationService is unavailable, denied,
    // or times out. Sydney, matching the platform API's own demo default. Extracted here
    // (DEDUP) from what used to be several inline per-file copies of the same three
    // numbers; AnalysisPage.jsx is the first consumer migrated to this constant.
    // WeatherPanel/WeatherPage/WeatherData keep their own local copies for now — a
    // deliberate, separately-scoped follow-up, not an oversight.
    FALLBACK_COORDS: { lat: -33.8688, lon: 151.2093, name: 'Sydney' },

    // Specialists Search API's 12 categories (specialists-api-reference-pack docs §7.4).
    // Every glyph below is READ from the subset font (assets/fonts/symbols.icons.txt) —
    // an icon not in that file renders as literal ligature text (pack §10, hard
    // constraint 5), so nothing here may be a name invented against the full Material
    // Symbols set. All 12 categories found a real, semantically fitting glyph in the
    // subset, so the 'support_agent' fallback ends up unused here — kept only as the
    // deliberate default for any category the API might add later that isn't in this map.
    SPECIALIST_CATEGORY_ICONS: {
        'Plumbing':               'plumbing',
        'Contract Cleaning':      'cleaning_services',
        'Cleaning':               'cleaning_services',
        'Building Inspection':    'apartment',
        'Building Remediation':   'construction',
        'Occupational Hygienist': 'health_and_safety',
        'Mould Testing':          'science',
        'Mould Cleaning':         'cleaning_services',
        'Air Quality Testing':    'air',
        'Mycology Lab':           'biotech',
        'Mould Remediation':      'construction',
        'Mould Inspection':       'search',
    },

    // The 12 categories in filter-lozenge order — mould-specific first (what a homeowner
    // most likely wants; the pack notes these total only 382 of 5,710 companies), then the
    // broader trades that carry the bulk of the national directory.
    SPECIALIST_CATEGORIES: [
        'Mould Testing', 'Mould Cleaning', 'Mould Remediation', 'Mould Inspection',
        'Air Quality Testing', 'Mycology Lab', 'Occupational Hygienist',
        'Building Inspection', 'Building Remediation',
        'Cleaning', 'Contract Cleaning', 'Plumbing',
    ],
};

window.AppConstants = AppConstants;
