/**
 * @fileoverview Utility module for playgroundToolbox.js
 * 
 * @module pages.Playground.config.playgroundToolbox
 */

import { getCategoryIcon } from "../../../components/game/editors/toolboxIcons";

export const playgroundToolbox = {
  kind: "categoryToolbox",
  contents: [
    // Lógica
    {
      kind: "category",
      name: "Lógica",
      colour: "#5C81A6",
      cssIcon: getCategoryIcon("Lógica"),
      contents: [
        { kind: "block", type: "controls_if" },
        { kind: "block", type: "logic_compare" },
        { kind: "block", type: "logic_operation" },
        { kind: "block", type: "logic_negate" },
        { kind: "block", type: "logic_boolean" },
        { kind: "block", type: "logic_null" },
        { kind: "block", type: "logic_ternary" },
      ],
    },

    // Loops
    {
      kind: "category",
      name: "Repetição",
      colour: "#5CA65C",
      cssIcon: getCategoryIcon("Repetição"),
      contents: [
        {
          kind: "block",
          type: "controls_repeat_ext",
          inputs: {
            TIMES: {
              shadow: { type: "math_number", fields: { NUM: 10 } },
            },
          },
        },
        { kind: "block", type: "controls_whileUntil" },
        {
          kind: "block",
          type: "controls_for",
          inputs: {
            FROM: { shadow: { type: "math_number", fields: { NUM: 1 } } },
            TO: { shadow: { type: "math_number", fields: { NUM: 10 } } },
            BY: { shadow: { type: "math_number", fields: { NUM: 1 } } },
          },
        },
        { kind: "block", type: "controls_forEach" },
        { kind: "block", type: "controls_flow_statements" },
      ],
    },

    // Matemática
    {
      kind: "category",
      name: "Matemática",
      colour: "#5C68A6",
      cssIcon: getCategoryIcon("Matemática"),
      contents: [
        { kind: "block", type: "math_number", fields: { NUM: 123 } },
        {
          kind: "block",
          type: "math_arithmetic",
          inputs: {
            A: { shadow: { type: "math_number", fields: { NUM: 1 } } },
            B: { shadow: { type: "math_number", fields: { NUM: 1 } } },
          },
        },
        {
          kind: "block",
          type: "math_single",
          inputs: {
            NUM: { shadow: { type: "math_number", fields: { NUM: 9 } } },
          },
        },
        {
          kind: "block",
          type: "math_trig",
          inputs: {
            NUM: { shadow: { type: "math_number", fields: { NUM: 45 } } },
          },
        },
        { kind: "block", type: "math_constant" },
        {
          kind: "block",
          type: "math_number_property",
          inputs: {
            NUMBER_TO_CHECK: {
              shadow: { type: "math_number", fields: { NUM: 0 } },
            },
          },
        },
        {
          kind: "block",
          type: "math_round",
          inputs: {
            NUM: { shadow: { type: "math_number", fields: { NUM: 3.1 } } },
          },
        },
        { kind: "block", type: "math_on_list" },
        {
          kind: "block",
          type: "math_modulo",
          inputs: {
            DIVIDEND: { shadow: { type: "math_number", fields: { NUM: 64 } } },
            DIVISOR: { shadow: { type: "math_number", fields: { NUM: 10 } } },
          },
        },
        {
          kind: "block",
          type: "math_constrain",
          inputs: {
            VALUE: { shadow: { type: "math_number", fields: { NUM: 50 } } },
            LOW: { shadow: { type: "math_number", fields: { NUM: 1 } } },
            HIGH: { shadow: { type: "math_number", fields: { NUM: 100 } } },
          },
        },
        {
          kind: "block",
          type: "math_random_int",
          inputs: {
            FROM: { shadow: { type: "math_number", fields: { NUM: 1 } } },
            TO: { shadow: { type: "math_number", fields: { NUM: 100 } } },
          },
        },
        { kind: "block", type: "math_random_float" },
        {
          kind: "block",
          type: "math_atan2",
          inputs: {
            X: { shadow: { type: "math_number", fields: { NUM: 1 } } },
            Y: { shadow: { type: "math_number", fields: { NUM: 1 } } },
          },
        },
      ],
    },

    // Texto
    {
      kind: "category",
      name: "Texto",
      colour: "#5CA68D",
      cssIcon: getCategoryIcon("Texto"),
      contents: [
        { kind: "block", type: "text", fields: { TEXT: "" } },
        { kind: "block", type: "text_join" },
        {
          kind: "block",
          type: "text_append",
          inputs: {
            TEXT: { shadow: { type: "text", fields: { TEXT: "" } } },
          },
        },
        {
          kind: "block",
          type: "text_length",
          inputs: {
            VALUE: { shadow: { type: "text", fields: { TEXT: "abc" } } },
          },
        },
        {
          kind: "block",
          type: "text_isEmpty",
          inputs: {
            VALUE: { shadow: { type: "text", fields: { TEXT: "" } } },
          },
        },
        { kind: "block", type: "text_indexOf" },
        { kind: "block", type: "text_charAt" },
        { kind: "block", type: "text_getSubstring" },
        {
          kind: "block",
          type: "text_changeCase",
          inputs: {
            TEXT: { shadow: { type: "text", fields: { TEXT: "abc" } } },
          },
        },
        {
          kind: "block",
          type: "text_trim",
          inputs: {
            TEXT: { shadow: { type: "text", fields: { TEXT: "abc" } } },
          },
        },
        {
          kind: "block",
          type: "text_print",
          inputs: {
            TEXT: { shadow: { type: "text", fields: { TEXT: "abc" } } },
          },
        },
        {
          kind: "block",
          type: "text_prompt_ext",
          inputs: {
            TEXT: { shadow: { type: "text", fields: { TEXT: "abc" } } },
          },
        },
      ],
    },

    // Listas
    {
      kind: "category",
      name: "Listas",
      colour: "#745CA6",
      cssIcon: getCategoryIcon("Listas"),
      contents: [
        { kind: "block", type: "lists_create_with" },
        { kind: "block", type: "lists_create_empty" },
        {
          kind: "block",
          type: "lists_repeat",
          inputs: {
            NUM: { shadow: { type: "math_number", fields: { NUM: 5 } } },
          },
        },
        { kind: "block", type: "lists_length" },
        { kind: "block", type: "lists_isEmpty" },
        { kind: "block", type: "lists_indexOf" },
        { kind: "block", type: "lists_getIndex" },
        { kind: "block", type: "lists_setIndex" },
        { kind: "block", type: "lists_getSublist" },
        {
          kind: "block",
          type: "lists_split",
          inputs: {
            DELIM: { shadow: { type: "text", fields: { TEXT: "," } } },
          },
        },
        { kind: "block", type: "lists_sort" },
      ],
    },

    // Variáveis
    {
      kind: "category",
      name: "Variáveis",
      colour: "#A65C81",
      custom: "VARIABLE",
      cssIcon: getCategoryIcon("Variáveis"),
    },

    // Funções
    {
      kind: "category",
      name: "Funções",
      colour: "#9A5CA6",
      custom: "PROCEDURE",
      cssIcon: getCategoryIcon("Funções"),
    },
  ],
};
