{
  "namespace": "anvil_pocket",

  "generic_label": {
    "type": "label",
    "color": "$pocket_title_text_color",
    "anchor_from": "center",
    "anchor_to": "center"
  },

  // Backgrounds //

  "background_image": {
    "type": "image",
    "size": [ "100%", "100%" ],
    "texture": "textures/ui/background_panel"
  },

  // Arrow //

  "arrow_icon": {
    "type": "image",
    "texture": "textures/ui/arrow_icon",
    "size": [ 24, 16 ]
  },

  // Labels //

  "cost_label@anvil_pocket.generic_label": {
    "shadow": false,
    "text": "#text",
    "anchor_from": "left_middle",
    "anchor_to": "left_middle"

  },
  "title_label@anvil_pocket.generic_label": {
    "anchor_from": "left_middle", // the parent
    "anchor_to": "left_middle", // this control
    "text": "container.repair"
  },

  // Text Edit //

  "text_edit_control@common.text_edit_box": {
    "anchor_from": "left_middle", // the parent
    "anchor_to": "left_middle", // this control
    "size": [ 142, 16 ],

    "property_bag": {
      "#property_field": "#item_name"
    },
    "max_length": 30,
    "$text_edit_binding_name": "#text_box_item_name"
  },
  "anvil_title_and_text_panel": {
    "type": "panel",
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "controls": [
      {
        "title_label@anvil_pocket.title_label": {
          "layer": 1,
          "offset": [ 5, -8 ]
        }
      },
      {
        "text_edit_control@anvil_pocket.text_edit_control": {
          "offset": [ 0, 8 ]
        }
      }
    ]
  },

  // Slots //

  "slots_panel": {
    "type": "panel",
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "controls": [
      {
        "input_slot@common.pocket_ui_large_container_item": {
          "offset": [ 0, 0 ],
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "$item_collection_name": "anvil_input_items"
        }
      },
      {
        "material_slot@common.pocket_ui_large_container_item": {
          "offset": [ 48, 0 ],
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "$item_collection_name": "anvil_material_items"
        }
      },
      {
        "result_slot@common.pocket_ui_large_container_item": {
          "offset": [ 109, 0 ],
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "$item_collection_name": "anvil_result_items",
          "$button_ref": "anvil.anvil_output_slot_button"
        }
      },
      {
        "plus_sign@anvil_pocket.generic_label": {
          "text": "+",
          "offset": [ 38, 0 ],
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "layer": 1
        }
      },
      {
        "arrow": {
          "type": "image",
          "texture": "textures/ui/arrow_inactive",
          "size": [ 22, 15 ],
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "offset": [ 83, 0 ],
          "controls": [
            {
              "cross_out": {
                "type": "image",
                "layer": 1,
                "texture": "textures/ui/crossout",
                "bindings": [
                  {
                    "binding_name": "#cross_out_icon",
                    "binding_name_override": "#visible"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  // Anvil Panel //

  "anvil_contents_panel": {
    "type": "panel",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "red_cost@anvil_pocket.cost_label": {
          "offset": [ 40, -27 ],
          "color": "$anvil_cost_fail_text_color",
          "bindings": [
            {
              "binding_name": "#cost_text",
              "binding_name_override": "#text"
            },
            {
              "binding_name": "#cost_text_red",
              "binding_name_override": "#visible"
            }
          ]
        }
      },
      {
        "green_cost@anvil_pocket.cost_label": {
          "offset": [ 40, -27 ],
          "color": "$anvil_cost_success_text_color",
          "bindings": [
            {
              "binding_name": "#cost_text",
              "binding_name_override": "#text"
            },
            {
              "binding_name": "#cost_text_green",
              "binding_name_override": "#visible"
            }
          ]
        }
      },
      {
        "slots_panel@anvil_pocket.slots_panel": {
          "offset": [ 0, -2 ]
        }
      },
      {
        "anvil_title_and_text_panel@anvil_pocket.anvil_title_and_text_panel": {
          "offset": [ 0, -50 ]
        }
      }
    ]
  },

  // Inventory Grids //

  "inventory_grid": {
    "type": "grid",
    "grid_rescaling_type": "horizontal",
    "anchor_to": "top_left",
    "anchor_from": "top_left",
    "size": [ "100%", "default" ],
    "maximum_grid_items": 36,
    "collection_name": "combined_hotbar_and_inventory_items",
    "grid_item_template": "common.pocket_ui_container_item",
    "$item_collection_name": "combined_hotbar_and_inventory_items"
  },

  "inventory_content": {
    "type": "panel",
    "size": [ "80%", "95%" ],
    "anchor_to": "center",
    "anchor_from": "center",
    "controls": [
      {
        "scrolling_panel@common.scrolling_panel": {
          "layer": 1,
          "$scrolling_pane_size": [ "100%", "100%-2px" ],
          "$scrolling_content": "anvil_pocket.inventory_grid",
          "$scroll_box_mouse_image_control": "common-classic.button_state_default",
          "$scroll_size": [ "8px", "100%" ]
        }
      }
    ]
  },

  // Half Screens //

  "half_screen": {
    "type": "input_panel",
    "size": [ "50%", "100%-31px" ],
    "offset": [ 0, 27 ],
    "anchor_from": "top_left",
    "anchor_to": "top_left"
  },
  "inventory_half_screen@anvil_pocket.half_screen": {
    "size": [ "32%", "100%-35px" ],
    "offset": [ 9, 31 ],

    "controls": [
      { "inventory_content@anvil_pocket.inventory_content": {} }
    ]
  },
  "anvil_half_screen@anvil_pocket.half_screen": {
    "anchor_from": "top_right",
    "anchor_to": "top_right",
    "size": [ "68%", "default" ],
    "offset": [ 10, 0 ],
    "controls": [
      {
        "anvil_contents_panel@anvil_pocket.anvil_contents_panel": {
          "layer": 2
        }
      }
    ]
  },

  // Header //

  "header": {
    "type": "panel",
    "size": [ "100%", 28 ],
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",
    "controls": [
      {
        "header_background": {
          "type": "image",
          "texture": "textures/ui/header_bar"
        }
      },
      { "legacy_pocket_close_button@common.legacy_pocket_close_button": {} },
      {
        "panel": {
          "type": "panel",
          "anchor_from": "center",
          "anchor_to": "center",
          "controls": [
            {
              "title_label@anvil_pocket.generic_label": {
                "text": "tile.anvil.name",
                "layer": 1
              }
            }
          ]
        }
      }
    ]
  },

  // Anvil Screen //

  "anvil_panel": {
    "type": "panel",
    "controls": [
      { "header@anvil_pocket.header": { "layer": 2 } },
      { "bg@anvil_pocket.background_image": {} },
      { "root_panel@common.root_panel": {} },
      {
        "inventory@anvil_pocket.inventory_half_screen": {
          "layer": 1,
          "$container_size": 36,
          "$pane_collection": "combined_hotbar_and_inventory_items"
        }
      },
      { "anvil_half_screen@anvil_pocket.anvil_half_screen": {} },

      { "container_gamepad_helpers@common.container_gamepad_helpers": { "layer": 2 } },
      { "inventory_selected_icon_button@common.inventory_selected_icon_button": {} },
      { "hold_icon@common.inventory_take_progress_icon_button": {} },
      { "flying_item_renderer@common.flying_item_renderer": {} },
      { "selected_item_details_factory@common.selected_item_details_factory": {} }
    ]
  }
}