{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pomodoso.com/schema/plugin.v1.json",
  "title": "Pomodoso plugin",
  "description": "A Pomodoso plugin file (YAML). Shape only: references between collections, fields and $values are checked by Pomodoso on load.",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "number",
      "const": 1
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]{1,49}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "version": {
      "type": "string",
      "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
    },
    "icon": {
      "type": "string",
      "maxLength": 40
    },
    "description": {
      "type": "string",
      "maxLength": 300
    },
    "author": {
      "type": "string",
      "maxLength": 80
    },
    "license": {
      "type": "string",
      "maxLength": 40
    },
    "settings": {
      "maxItems": 30,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,39}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "number",
              "text",
              "boolean",
              "select"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "default": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "options": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "color": {
                      "type": "string",
                      "pattern": "^#[0-9a-fA-F]{6}$"
                    }
                  },
                  "required": [
                    "value"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          }
        },
        "required": [
          "key",
          "type",
          "label"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "select"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "options"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "options"
                ]
              }
            }
          }
        ]
      }
    },
    "collections": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,39}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "event",
              "item",
              "daily"
            ]
          },
          "title_field": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,39}$"
          },
          "fields": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "longtext",
                    "number",
                    "scale",
                    "boolean",
                    "date",
                    "url",
                    "select",
                    "multiselect",
                    "tags",
                    "rating",
                    "duration",
                    "image_url",
                    "ref",
                    "task"
                  ]
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "optional": {
                  "type": "boolean"
                },
                "default": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        }
                      ]
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  ]
                },
                "options": {
                  "minItems": 1,
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{0,39}$"
                          },
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "color": {
                            "type": "string",
                            "pattern": "^#[0-9a-fA-F]{6}$"
                          }
                        },
                        "required": [
                          "value"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "user_editable": {
                  "type": "boolean"
                },
                "min": {
                  "type": "number"
                },
                "max": {
                  "type": "number"
                },
                "unit": {
                  "type": "string",
                  "maxLength": 20
                },
                "collection": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                }
              },
              "required": [
                "key",
                "type"
              ],
              "additionalProperties": false,
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "type": {
                        "enum": [
                          "select",
                          "multiselect"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  "then": {
                    "required": [
                      "options"
                    ]
                  },
                  "else": {
                    "not": {
                      "required": [
                        "options"
                      ]
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "enum": [
                          "select"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  "then": {},
                  "else": {
                    "properties": {
                      "user_editable": {
                        "const": false
                      }
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "enum": [
                          "number",
                          "scale",
                          "rating",
                          "duration"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  "then": {},
                  "else": {
                    "allOf": [
                      {
                        "not": {
                          "required": [
                            "min"
                          ]
                        }
                      },
                      {
                        "not": {
                          "required": [
                            "max"
                          ]
                        }
                      }
                    ]
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "enum": [
                          "ref"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  "then": {
                    "required": [
                      "collection"
                    ]
                  },
                  "else": {
                    "not": {
                      "required": [
                        "collection"
                      ]
                    }
                  }
                }
              ]
            }
          }
        },
        "required": [
          "key",
          "kind",
          "fields"
        ],
        "additionalProperties": false
      }
    },
    "computed": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_]{0,39}$"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema0"
      }
    },
    "views": {
      "minItems": 1,
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,39}$"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "of": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,39}$"
          },
          "layout": {
            "type": "string",
            "enum": [
              "wide"
            ]
          },
          "blocks": {
            "minItems": 1,
            "maxItems": 30,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "counter-button"
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "adds": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "details": {
                      "type": "string",
                      "enum": [
                        "none",
                        "form"
                      ]
                    },
                    "set": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 500
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "boolean"
                          }
                        ]
                      }
                    },
                    "subtract": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "type",
                    "label",
                    "adds"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "add-button"
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "adds": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "prefill": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 500
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "boolean"
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "type",
                    "label",
                    "adds"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "form"
                    },
                    "collection": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    }
                  },
                  "required": [
                    "type",
                    "collection"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "stat"
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        },
                        {
                          "$ref": "#/$defs/__schema0"
                        }
                      ]
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "number",
                        "time_ago",
                        "days",
                        "percent",
                        "share",
                        "duration",
                        "date"
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "label",
                    "value"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "stat-row"
                    },
                    "items": {
                      "minItems": 1,
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "value": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              },
                              {
                                "$ref": "#/$defs/__schema0"
                              }
                            ]
                          },
                          "format": {
                            "type": "string",
                            "enum": [
                              "number",
                              "time_ago",
                              "days",
                              "percent",
                              "share",
                              "duration",
                              "date"
                            ]
                          }
                        },
                        "required": [
                          "label",
                          "value"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "type",
                    "items"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "progress"
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        },
                        {
                          "$ref": "#/$defs/__schema0"
                        }
                      ]
                    },
                    "max": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        },
                        {
                          "$ref": "#/$defs/__schema0"
                        }
                      ]
                    },
                    "invert": {
                      "type": "boolean"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "number",
                        "time_ago",
                        "days",
                        "percent",
                        "share",
                        "duration",
                        "date"
                      ]
                    },
                    "style": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "bar",
                            "ring",
                            "dots"
                          ]
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "value",
                    "max"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "chart"
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "bar",
                        "line"
                      ]
                    },
                    "series": {
                      "$ref": "#/$defs/__schema0"
                    },
                    "reference": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        },
                        {
                          "$ref": "#/$defs/__schema0"
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "kind",
                    "series"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "list"
                    },
                    "collection": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "filter": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 500
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              }
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "in": {
                                "minItems": 1,
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 500
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "not_in": {
                                "minItems": 1,
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 500
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "exists": {
                                "type": "boolean"
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false,
                            "minProperties": 1
                          }
                        ]
                      }
                    },
                    "primary": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "secondary": {
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      }
                    },
                    "open": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "opens": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "sort": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,39}$"
                        },
                        "order": {
                          "type": "string",
                          "enum": [
                            "asc",
                            "desc"
                          ]
                        }
                      },
                      "required": [
                        "field"
                      ],
                      "additionalProperties": false
                    },
                    "swipe": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "set": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{0,39}$"
                          },
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 500
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "set"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "type",
                    "collection",
                    "primary"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "tag-filter"
                    },
                    "collection": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "field": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    }
                  },
                  "required": [
                    "type",
                    "collection",
                    "field"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "board"
                    },
                    "collection": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "filter": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 500
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              }
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "in": {
                                "minItems": 1,
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 500
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "not_in": {
                                "minItems": 1,
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 500
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "exists": {
                                "type": "boolean"
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false,
                            "minProperties": 1
                          }
                        ]
                      }
                    },
                    "group_by": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "card": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,39}$"
                        },
                        "subtitle": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,39}$"
                        },
                        "image": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,39}$"
                        },
                        "badge": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,39}$"
                        }
                      },
                      "required": [
                        "title"
                      ],
                      "additionalProperties": false
                    },
                    "opens": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    }
                  },
                  "required": [
                    "type",
                    "collection",
                    "group_by",
                    "card"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "year-grid"
                    },
                    "collection": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "color_by": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "legend": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "type",
                    "collection"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "day-picker"
                    },
                    "collection": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "field": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    }
                  },
                  "required": [
                    "type",
                    "collection",
                    "field"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "breakdown"
                    },
                    "collection": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "field": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "range": {
                      "type": "string",
                      "anyOf": [
                        {
                          "enum": [
                            "today",
                            "yesterday",
                            "this_week",
                            "last_week",
                            "this_month",
                            "last_month",
                            "this_year",
                            "all"
                          ]
                        },
                        {
                          "pattern": "^[1-9][0-9]{0,2}(d|mo)$"
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "collection",
                    "field"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "text"
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  },
                  "required": [
                    "type",
                    "text"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": [
          "id",
          "blocks"
        ],
        "additionalProperties": false
      }
    },
    "today": {
      "type": "object",
      "properties": {
        "default_on": {
          "type": "boolean"
        },
        "widget": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "mini-counter"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "max": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "adds": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "subtract": {
                  "type": "boolean"
                }
              },
              "required": [
                "type",
                "label",
                "value",
                "adds"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "select-today"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "collection": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "field": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "after": {
                  "type": "string",
                  "enum": [
                    "year-grid"
                  ]
                }
              },
              "required": [
                "type",
                "label",
                "collection",
                "field"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "count-badge"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                }
              },
              "required": [
                "type",
                "label",
                "value"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "stat"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "number",
                    "time_ago",
                    "days",
                    "percent",
                    "share",
                    "duration",
                    "date"
                  ]
                }
              },
              "required": [
                "type",
                "label",
                "value"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "progress"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "max": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "number",
                    "time_ago",
                    "days",
                    "percent",
                    "share",
                    "duration",
                    "date"
                  ]
                },
                "caption": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "style": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "bar",
                        "ring",
                        "dots"
                      ]
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    }
                  ]
                }
              },
              "required": [
                "type",
                "label",
                "value"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "record"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "collection": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "where": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  },
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 500
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "boolean"
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "in": {
                            "minItems": 1,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                }
                              ]
                            }
                          },
                          "not_in": {
                            "minItems": 1,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                }
                              ]
                            }
                          },
                          "exists": {
                            "type": "boolean"
                          },
                          "lt": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              }
                            ]
                          },
                          "lte": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              }
                            ]
                          },
                          "gt": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              }
                            ]
                          },
                          "gte": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false,
                        "minProperties": 1
                      }
                    ]
                  }
                },
                "title": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "field": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "max": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "caption": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                }
              },
              "required": [
                "type",
                "label",
                "collection",
                "title",
                "field"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "list"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "collection": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "where": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  },
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 500
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "boolean"
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "in": {
                            "minItems": 1,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                }
                              ]
                            }
                          },
                          "not_in": {
                            "minItems": 1,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                }
                              ]
                            }
                          },
                          "exists": {
                            "type": "boolean"
                          },
                          "lt": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              }
                            ]
                          },
                          "lte": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              }
                            ]
                          },
                          "gt": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              }
                            ]
                          },
                          "gte": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false,
                        "minProperties": 1
                      }
                    ]
                  }
                },
                "opens": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,39}$"
                },
                "badge": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "badge_of": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "more": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "view": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "badge": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        },
                        {
                          "$ref": "#/$defs/__schema0"
                        }
                      ]
                    }
                  },
                  "required": [
                    "label",
                    "view"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "type",
                "label",
                "collection",
                "opens"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "stats"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "items": {
                  "minItems": 1,
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "value": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          },
                          {
                            "$ref": "#/$defs/__schema0"
                          }
                        ]
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "number",
                          "time_ago",
                          "days",
                          "percent",
                          "share",
                          "duration",
                          "date"
                        ]
                      }
                    },
                    "required": [
                      "label",
                      "value"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "type",
                "label",
                "items"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "required": [
        "widget"
      ],
      "additionalProperties": false
    },
    "hooks": {
      "maxItems": 10,
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "on": {
                "type": "string",
                "enum": [
                  "pomodoro_end",
                  "day_end"
                ]
              },
              "ask": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "yes": {
                "type": "object",
                "properties": {
                  "add": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  },
                  "set": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]{0,39}$"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "add"
                ],
                "additionalProperties": false
              },
              "pick": {
                "type": "object",
                "properties": {
                  "collection": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  },
                  "field": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  }
                },
                "required": [
                  "collection",
                  "field"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "on",
              "ask"
            ],
            "additionalProperties": false,
            "oneOf": [
              {
                "required": [
                  "yes"
                ]
              },
              {
                "required": [
                  "pick"
                ]
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "on": {
                "type": "string",
                "enum": [
                  "daily_report",
                  "weekly_report"
                ]
              },
              "line": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              }
            },
            "required": [
              "on",
              "line"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "rules": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "collection": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,39}$"
          },
          "when": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 500
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    }
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "in": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 500
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "boolean"
                          }
                        ]
                      }
                    },
                    "not_in": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 500
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "boolean"
                          }
                        ]
                      }
                    },
                    "exists": {
                      "type": "boolean"
                    },
                    "lt": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        }
                      ]
                    },
                    "lte": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        }
                      ]
                    },
                    "gt": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        }
                      ]
                    },
                    "gte": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "minProperties": 1
                }
              ]
            }
          },
          "set": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 500
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "only_if_empty": {
            "type": "boolean"
          }
        },
        "required": [
          "collection",
          "when",
          "set"
        ],
        "additionalProperties": false
      }
    },
    "migrate": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^(0|[1-9]\\d*)\\.x$"
        },
        "steps": {
          "minItems": 1,
          "maxItems": 30,
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "rename_collection": {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "to": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "rename_collection"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "rename_field": {
                    "type": "object",
                    "properties": {
                      "collection": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "from": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "to": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      }
                    },
                    "required": [
                      "collection",
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "rename_field"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "map_values": {
                    "type": "object",
                    "properties": {
                      "collection": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "field": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "map": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,39}$"
                        },
                        "additionalProperties": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,39}$"
                        }
                      }
                    },
                    "required": [
                      "collection",
                      "field",
                      "map"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "map_values"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "drop_field": {
                    "type": "object",
                    "properties": {
                      "collection": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "field": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      }
                    },
                    "required": [
                      "collection",
                      "field"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "drop_field"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "from",
        "steps"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schema_version",
    "id",
    "name",
    "version",
    "collections",
    "views"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "$ref": "#/$defs/ComputedValue"
    },
    "ComputedValue": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "count": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "where": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "not_in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "exists": {
                        "type": "boolean"
                      },
                      "lt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "lte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                ]
              }
            },
            "range": {
              "type": "string",
              "anyOf": [
                {
                  "enum": [
                    "today",
                    "yesterday",
                    "this_week",
                    "last_week",
                    "this_month",
                    "last_month",
                    "this_year",
                    "all"
                  ]
                },
                {
                  "pattern": "^[1-9][0-9]{0,2}(d|mo)$"
                }
              ]
            },
            "by": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "group": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          },
          "required": [
            "count"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "sum": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "field": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "where": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "not_in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "exists": {
                        "type": "boolean"
                      },
                      "lt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "lte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                ]
              }
            },
            "range": {
              "type": "string",
              "anyOf": [
                {
                  "enum": [
                    "today",
                    "yesterday",
                    "this_week",
                    "last_week",
                    "this_month",
                    "last_month",
                    "this_year",
                    "all"
                  ]
                },
                {
                  "pattern": "^[1-9][0-9]{0,2}(d|mo)$"
                }
              ]
            },
            "by": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "group": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          },
          "required": [
            "sum",
            "field"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "avg": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "field": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "where": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "not_in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "exists": {
                        "type": "boolean"
                      },
                      "lt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "lte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                ]
              }
            },
            "range": {
              "type": "string",
              "anyOf": [
                {
                  "enum": [
                    "today",
                    "yesterday",
                    "this_week",
                    "last_week",
                    "this_month",
                    "last_month",
                    "this_year",
                    "all"
                  ]
                },
                {
                  "pattern": "^[1-9][0-9]{0,2}(d|mo)$"
                }
              ]
            },
            "by": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "group": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          },
          "required": [
            "avg",
            "field"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "min": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "field": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "where": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "not_in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "exists": {
                        "type": "boolean"
                      },
                      "lt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "lte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                ]
              }
            },
            "range": {
              "type": "string",
              "anyOf": [
                {
                  "enum": [
                    "today",
                    "yesterday",
                    "this_week",
                    "last_week",
                    "this_month",
                    "last_month",
                    "this_year",
                    "all"
                  ]
                },
                {
                  "pattern": "^[1-9][0-9]{0,2}(d|mo)$"
                }
              ]
            },
            "by": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "group": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          },
          "required": [
            "min",
            "field"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "max": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "field": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "where": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "not_in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "exists": {
                        "type": "boolean"
                      },
                      "lt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "lte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                ]
              }
            },
            "range": {
              "type": "string",
              "anyOf": [
                {
                  "enum": [
                    "today",
                    "yesterday",
                    "this_week",
                    "last_week",
                    "this_month",
                    "last_month",
                    "this_year",
                    "all"
                  ]
                },
                {
                  "pattern": "^[1-9][0-9]{0,2}(d|mo)$"
                }
              ]
            },
            "by": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "group": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          },
          "required": [
            "max",
            "field"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "last": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "where": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "not_in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "exists": {
                        "type": "boolean"
                      },
                      "lt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "lte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                ]
              }
            },
            "field": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          },
          "required": [
            "last"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "first": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "where": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "not_in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "exists": {
                        "type": "boolean"
                      },
                      "lt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "lte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                ]
              }
            },
            "field": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          },
          "required": [
            "first"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "streak": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            },
            "where": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "not_in": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "exists": {
                        "type": "boolean"
                      },
                      "lt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "lte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gt": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      },
                      "gte": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                ]
              }
            },
            "at_least": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                },
                {
                  "$ref": "#/$defs/__schema0"
                }
              ]
            },
            "at_most": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                },
                {
                  "$ref": "#/$defs/__schema0"
                }
              ]
            }
          },
          "required": [
            "streak"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "taper": {
              "type": "object",
              "properties": {
                "from": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "down_by": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "up_by": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "every": {
                  "type": "string",
                  "enum": [
                    "day",
                    "week",
                    "month"
                  ]
                },
                "min": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                "max": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                }
              },
              "required": [
                "from",
                "every"
              ],
              "additionalProperties": false,
              "oneOf": [
                {
                  "required": [
                    "down_by"
                  ]
                },
                {
                  "required": [
                    "up_by"
                  ]
                }
              ]
            }
          },
          "required": [
            "taper"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "delta": {
              "type": "array",
              "prefixItems": [
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                }
              ],
              "items": false,
              "minItems": 2,
              "maxItems": 2
            }
          },
          "required": [
            "delta"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "calendar": {
              "type": "string",
              "enum": [
                "week",
                "month",
                "year"
              ]
            },
            "show": {
              "type": "string",
              "enum": [
                "progress",
                "passed",
                "left",
                "total"
              ]
            }
          },
          "required": [
            "calendar"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "ratio": {
              "type": "array",
              "prefixItems": [
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "pattern": "^\\$[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$"
                    },
                    {
                      "$ref": "#/$defs/__schema0"
                    }
                  ]
                }
              ],
              "items": false,
              "minItems": 2,
              "maxItems": 2
            }
          },
          "required": [
            "ratio"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Exactly one operator: count, sum, avg, min, max, last, first, streak, taper, delta, calendar or ratio."
    }
  }
}
