{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*$"
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "contract": {
      "type": "number",
      "const": 1
    },
    "tier": {
      "type": "string",
      "enum": [
        "full",
        "skin"
      ]
    },
    "runtime": {
      "type": "string",
      "enum": [
        "platform",
        "sandbox"
      ]
    },
    "extends": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*@\\d+$"
    },
    "labelTR": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "descriptionTR": {
      "type": "string",
      "minLength": 1,
      "maxLength": 280
    },
    "tags": {
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 24
      }
    },
    "catalogSize": {
      "type": "string",
      "enum": [
        "small",
        "medium",
        "large"
      ]
    },
    "fonts": {
      "maxItems": 4,
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "source": {
                "type": "string",
                "const": "google"
              }
            },
            "required": [
              "family",
              "source"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "source": {
                "type": "string",
                "const": "pack"
              },
              "license": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "files": {
                "minItems": 1,
                "maxItems": 8,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "file": {
                      "type": "string",
                      "pattern": "^fonts\\/[a-z0-9._-]+\\.woff2$"
                    },
                    "weight": {
                      "anyOf": [
                        {
                          "type": "number",
                          "const": 400
                        },
                        {
                          "type": "number",
                          "const": 500
                        },
                        {
                          "type": "number",
                          "const": 600
                        },
                        {
                          "type": "number",
                          "const": 700
                        }
                      ]
                    },
                    "style": {
                      "type": "string",
                      "enum": [
                        "normal",
                        "italic"
                      ]
                    }
                  },
                  "required": [
                    "file",
                    "weight"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "family",
              "source",
              "license",
              "files"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "presets": {
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9-]*$"
      }
    },
    "defaultPreset": {
      "type": "object",
      "properties": {
        "colorway": {
          "type": "string"
        },
        "typeset": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "optional": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Split",
          "Placeholder",
          "CollectionCard",
          "Breadcrumbs",
          "Textarea",
          "Checkbox",
          "Accordion",
          "KeyValueList",
          "Divider",
          "Logo",
          "Notice",
          "Tabs",
          "Dialog",
          "Pagination",
          "Table",
          "Video",
          "Marquee",
          "Countdown"
        ]
      }
    },
    "hooks": {
      "maxItems": 16,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^data-mzk-[a-z0-9-]+$"
      }
    },
    "sections": {
      "maxItems": 2,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "pattern": "^mozaik-[a-z0-9-]+\\.[a-z][a-z0-9-]*@\\d+$"
          },
          "fallbackRole": {
            "type": "string",
            "enum": [
              "hero",
              "grid",
              "story",
              "trust",
              "announcement",
              "header",
              "footer",
              "pdp",
              "collectionGrid",
              "text",
              "collections",
              "cart",
              "legal",
              "faq"
            ]
          }
        },
        "required": [
          "type",
          "fallbackRole"
        ],
        "additionalProperties": false
      }
    },
    "publisher": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "supportEmail": {
          "type": "string",
          "format": "email",
          "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
        },
        "supportUrl": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "agent": {
      "type": "object",
      "properties": {
        "summaryTR": {
          "type": "string",
          "minLength": 1,
          "maxLength": 400
        },
        "authoringDocs": {
          "type": "string"
        },
        "notes": {
          "maxItems": 12,
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "required": [
        "summaryTR"
      ],
      "additionalProperties": false
    },
    "migrations": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "version",
    "contract",
    "tier",
    "labelTR",
    "descriptionTR",
    "publisher",
    "agent"
  ],
  "additionalProperties": false
}