{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://whatsincabo.com/partners-deck/herramientas/logo-oficial/brand-kit.schema.json",
  "title": "What's in Cabo brand kit contract",
  "description": "Validates the machine-readable identity contract distributed with the official What's in Cabo logo family.",
  "type": "object",
  "required": [
    "$schema",
    "schema_id",
    "schema_version",
    "brand",
    "release",
    "status",
    "deployment",
    "source_of_truth",
    "colors",
    "positioning",
    "compositions",
    "clear_space",
    "minimum_sizes",
    "asset_selection_engine",
    "format_profiles",
    "asset_selection_rules",
    "raster_selection",
    "prohibited_uses",
    "downloads"
  ],
  "properties": {
    "$schema": {"const": "brand-kit.schema.json"},
    "schema_id": {"const": "wic.brand-kit"},
    "schema_version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"},
    "brand": {"const": "What's in Cabo"},
    "release": {"type": "string", "minLength": 1},
    "status": {"enum": ["draft", "preview", "official", "retired"]},
    "content_language": {"type": "string", "minLength": 2},
    "canonical_page": {"type": "string", "format": "uri"},
    "canonical_asset_base_url": {"type": "string", "format": "uri"},
    "deployment": {
      "type": "object",
      "required": ["state", "build_id", "current_page", "current_asset_base_url", "canonical_activation"],
      "properties": {
        "state": {"enum": ["preview", "production", "retired"]},
        "build_id": {"type": "string", "minLength": 1},
        "mutable_until_approval": {"type": "boolean"},
        "current_page": {"type": "string", "format": "uri"},
        "current_asset_base_url": {"type": "string", "format": "uri"},
        "canonical_activation": {"enum": ["pending_owner_approval", "active", "retired"]}
      },
      "additionalProperties": true
    },
    "source_of_truth": {
      "type": "object",
      "required": ["kind", "geometry_locked", "editable_source", "verification_file"],
      "properties": {
        "geometry_locked": {"const": true},
        "editable_source": {"const": "svg/"},
        "verification_file": {"const": "CHECKSUMS.sha256"}
      },
      "additionalProperties": true
    },
    "colors": {
      "type": "object",
      "required": ["logo_blue", "logo_white", "support_ivory", "interface_navy_is_not_logo_blue"],
      "properties": {
        "logo_blue": {"const": "#162A3D"},
        "logo_white": {"const": "#FFFFFF"},
        "support_ivory": {"const": "#F2EDE3"},
        "interface_navy_is_not_logo_blue": {"const": "#062C53"}
      },
      "additionalProperties": true
    },
    "positioning": {"$ref": "#/$defs/positioning"},
    "compositions": {
      "type": "array",
      "minItems": 6,
      "items": {"$ref": "#/$defs/composition"}
    },
    "clear_space": {
      "type": "object",
      "required": ["minimum", "x_definition", "x_definition_by_composition"],
      "additionalProperties": true
    },
    "minimum_sizes": {
      "type": "object",
      "required": ["complete_mark_screen_recommended_px", "complete_mark_screen_conditional_px", "symbol_screen_px", "favicon_screen_px"],
      "additionalProperties": {"type": ["number", "integer", "string"]}
    },
    "asset_selection_engine": {
      "type": "object",
      "required": ["evaluation", "numeric_bounds", "missing_condition_field", "default_rule_priority", "path_resolution", "color_resolution"],
      "properties": {
        "default_rule_priority": {"const": 999},
        "color_resolution": {"type": "array", "minItems": 3}
      },
      "additionalProperties": true
    },
    "format_profiles": {
      "type": "object",
      "required": ["favicon_exact_size", "vector_preferred", "social_raster_or_vector", "print_vector"],
      "properties": {
        "favicon_exact_size": {
          "type": "object",
          "required": ["selection", "files"],
          "properties": {
            "files": {
              "type": "object",
              "required": ["16", "32", "64", "192", "512", "scalable"],
              "additionalProperties": {"type": "string"}
            }
          },
          "additionalProperties": true
        },
        "vector_preferred": {"type": "object"},
        "social_raster_or_vector": {"type": "object"},
        "print_vector": {"type": "object"}
      },
      "additionalProperties": false
    },
    "asset_selection_rules": {
      "type": "array",
      "minItems": 6,
      "items": {
        "type": "object",
        "required": ["priority", "when", "select"],
        "properties": {
          "priority": {"type": "integer", "minimum": 1},
          "when": {"type": "object"},
          "select": {
            "type": "object",
            "required": ["composition", "format", "format_profile", "color"],
            "properties": {
              "composition": {"type": "string"},
              "format": {"type": "string"},
              "format_profile": {"type": "string"},
              "color": {"type": "string"}
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      }
    },
    "raster_selection": {
      "type": "object",
      "required": ["png_1024", "png_2048", "fallback"],
      "additionalProperties": true
    },
    "prohibited_uses": {"type": "array", "minItems": 5, "items": {"type": "string"}},
    "downloads": {
      "type": "object",
      "required": ["full_public_kit", "machine_readable_contract", "json_schema", "checksums", "zip_checksum"],
      "additionalProperties": {"type": "string"}
    }
  },
  "$defs": {
    "positioning": {
      "type": "object",
      "required": [
        "category",
        "functional_statement",
        "decision_support",
        "ecosystem",
        "claim_policy",
        "emotional_statement"
      ],
      "properties": {
        "category": {"const": "destination_intelligence_layer"},
        "category_label": {"type": "string", "minLength": 1},
        "differentiation": {"type": "string", "minLength": 1},
        "functional_statement": {"type": "string", "minLength": 1},
        "primary_audiences": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {"type": "string", "minLength": 1}
        },
        "decision_support": {
          "type": "array",
          "minItems": 4,
          "maxItems": 4,
          "items": {
            "type": "object",
            "required": ["id", "label"],
            "properties": {
              "id": {"type": "string", "minLength": 1},
              "label": {"type": "string", "minLength": 1}
            },
            "additionalProperties": false
          }
        },
        "ecosystem": {
          "type": "array",
          "minItems": 5,
          "items": {
            "type": "object",
            "required": ["id", "name", "availability_status"],
            "properties": {
              "id": {"type": "string", "minLength": 1},
              "name": {"type": "string", "minLength": 1},
              "availability_status": {"const": "not_asserted"}
            },
            "additionalProperties": false
          }
        },
        "claim_policy": {
          "type": "object",
          "required": [
            "ecosystem_membership_only",
            "availability_inference_allowed",
            "real_time_inference_allowed",
            "official_destination_authority_inference_allowed",
            "instruction"
          ],
          "properties": {
            "ecosystem_membership_only": {"const": true},
            "availability_inference_allowed": {"const": false},
            "real_time_inference_allowed": {"const": false},
            "official_destination_authority_inference_allowed": {"const": false},
            "instruction": {"type": "string", "minLength": 1}
          },
          "additionalProperties": false
        },
        "emotional_statement": {"type": "string", "minLength": 1}
      },
      "additionalProperties": true
    },
    "assetSet": {
      "type": "object",
      "required": ["svg", "png_1024", "png_2048", "pdf"],
      "properties": {
        "svg": {"type": "string", "pattern": "^svg/.+\\.svg$"},
        "png_1024": {"type": "string", "pattern": "^png/.+-1024w\\.png$"},
        "png_2048": {"type": "string", "pattern": "^png/.+-2048w\\.png$"},
        "pdf": {"type": ["string", "null"]}
      },
      "additionalProperties": false
    },
    "composition": {
      "type": "object",
      "required": ["id", "name", "priority", "recommended_use", "minimum_screen_width_px", "recommended_screen_width_px", "assets"],
      "properties": {
        "id": {"type": "string", "minLength": 1},
        "name": {"type": "string", "minLength": 1},
        "priority": {"enum": ["primary", "secondary"]},
        "recommended_use": {"type": "array", "minItems": 1, "items": {"type": "string"}},
        "minimum_screen_width_px": {"type": "integer", "minimum": 1},
        "recommended_screen_width_px": {"type": "integer", "minimum": 1},
        "assets": {
          "type": "object",
          "required": ["blue", "white"],
          "properties": {
            "blue": {"$ref": "#/$defs/assetSet"},
            "white": {"$ref": "#/$defs/assetSet"}
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": true
}
