/********************************************************
+*   (c) Mojang. All rights reserved                       *
+*   (c) Microsoft. All rights reserved.                   *
+*********************************************************/

{
  "namespace": "realms_allowlist",

  //---------------------------------------------------------------------------
  // Vertical Stack Panel
  //---------------------------------------------------------------------------

  "spacing_gap": {
    "type": "panel",
    "size": [ "100%", 5 ]
  },

    "friends_containing_panel": {
        "type": "panel",
        "$friends_containing_panel_size|default": [ "100%", "100%c" ],
        "size": "$friends_containing_panel_size",
        "controls": [
            {
                "friends_panel@realms_allowlist.friends_panel": {}
            }
        ]
    },

  "friends_panel": {
    "type": "stack_panel",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "orientation": "vertical",
    "size": "$friend_panel_size",
    "$member_collection_name": "members_collection",
    "$invited_collection_name": "invited_friends_collection",
    "$uninvited_collection_name": "uninvited_friends_collection",
    "$blocked_players_collection_name": "blocked_players_collection",
    "controls": [
      {
        "add_friends_and_invite_link_panel@realms_allowlist.add_friends_and_invite_link_panel": {}
      },
      {
        "option_dropdown_permissions@settings_common.option_dropdown": {
          "$option_label": "permissions.title.settings",
          "$dropdown_content": "permissions.permission_level_dropdown_content",
          "$dropdown_area": "friends_panel",
          "$dropdown_name": "realm_default_permission_dropdown",
          "$button_type_panel": "permissions.permission_level_dropdown_state_content",
          "$options_dropdown_toggle_label_binding": "#realm_default_permission_dropdown_toggle_label",
          "$option_enabled_binding_name": "#realm_default_permission_dropdown_enabled",
          "$show_option_label": true,
          "$is_world_settings": true,
          "$dropdown_scroll_content_size": [ "100%", "385%" ],
          "size": [ "100%", "50px" ]
        }
      },
      { "player_filter_label@realms_allowlist.player_filter_label": {} },
      { "player_filter_text_box@realms_allowlist.player_filter_text_box": {} },
      {
        "spacing_gap_members_top@realms_allowlist.spacing_gap": {}
      },
      {
        "lists": {
          "type": "stack_panel",
          "size": [ "100%", "100%c" ],
          "controls": [
            { "members_label@realms_allowlist.members_label": {} },
            {
              "members_stack@realms_allowlist.factory_stack": {
                "collection_name": "members_collection",
                "factory": {
                  "name": "factory",
                  "control_ids": {
                    "small_button": "@realms_allowlist.member_factory_xbl_profile",
                    "large_button": "@realms_allowlist.member_factory_linked_account"
                  }
                },
                "bindings": [
                  {
                    "binding_name": "#members_section_content",
                    "binding_name_override": "#collection_length"
                  }
                ]
              }
            },
            {
              "spacing_gap_members_bottom@realms_allowlist.spacing_gap": {}
            },
            {
              "members_page_panel@realms_allowlist.page_panel": {
                "$next_button_name": "next_page_button_members",
                "$prev_button_name": "prev_page_button_members",
                "$this_page_index_text": "#members_page_index_text",
                "$is_visible_binding_name": "#members_buttons_visible",
                "$is_prev_visible": "#members_prevButton_visible",
                "$is_next_visible": "#members_nextButton_visible"
              }
            },
            { "invited_friends_label@realms_allowlist.invited_friends_label": {} },
            {
              "invited_stack@realms_allowlist.factory_stack": {
                "collection_name": "invited_friends_collection",
                "factory": {
                  "name": "factory",
                  "control_ids": {
                    "small_button": "@realms_allowlist.invited_factory_xbl_profile",
                    "large_button": "@realms_allowlist.invited_factory_linked_account"
                  }
                },
                "bindings": [
                  {
                    "binding_name": "#invited_section_content",
                    "binding_name_override": "#collection_length"
                  }
                ]
              }
            },
            {
              "spacing_gap_invited_friends@realms_allowlist.spacing_gap": {}
            },
            {
              "invited_friends_page_panel@realms_allowlist.page_panel": {
                "$next_button_name": "next_page_button_invited_friends",
                "$prev_button_name": "prev_page_button_invited_friends",
                "$this_page_index_text": "#invited_friends_page_index_text",
                "$is_visible_binding_name": "#invited_friends_buttons_visible",
                "$is_prev_visible": "#invited_friends_prevButton_visible",
                "$is_next_visible": "#invited_friends_nextButton_visible"
              }
            },
            { "uninvited_friends_label@realms_allowlist.uninvited_friends_label": {} },
            {
              "uninvited_stack@realms_allowlist.factory_stack": {
                "collection_name": "uninvited_friends_collection",
                "factory": {
                  "name": "factory",
                  "control_ids": {
                    "small_button": "@realms_allowlist.uninvited_factory_xbl_profile",
                    "large_button": "@realms_allowlist.uninvited_factory_linked_account"
                  }
                },
                "bindings": [
                  {
                    "binding_name": "#uninvited_section_content",
                    "binding_name_override": "#collection_length"
                  }
                ]
              }
            },
            {
              "spacing_gap_uninvited_friends@realms_allowlist.spacing_gap": {}
            },
            {
              "uninvited_friends_page_panel@realms_allowlist.page_panel": {
                "$next_button_name": "next_page_button_uninvited_friends",
                "$prev_button_name": "prev_page_button_uninvited_friends",
                "$this_page_index_text": "#uninvited_friends_page_index_text",
                "$is_visible_binding_name": "#uninvited_friends_buttons_visible",
                "$is_prev_visible": "#uninvited_friends_prevButton_visible",
                "$is_next_visible": "#uninvited_friends_nextButton_visible"
              }
            },
            { "blocked_players_label@realms_allowlist.blocked_players_label": {} },
            {
              "blocked_players_stack@realms_allowlist.factory_stack": {
                "collection_name": "blocked_players_collection",
                "factory": {
                  "name": "factory",
                  "control_ids": {
                    "small_button": "@realms_allowlist.blocked_factory_xbl_profile",
                    "large_button": "@realms_allowlist.blocked_factory_linked_account"
                  }
                },
                "bindings": [
                  {
                    "binding_name": "#blocked_section_content",
                    "binding_name_override": "#collection_length"
                  }
                ]
              }
            },
            {
              "spacing_gap_blocked_players@realms_allowlist.spacing_gap": {}
            },
            {
              "blocked_players_page_panel@realms_allowlist.page_panel": {
                "$next_button_name": "next_page_button_blocked_players",
                "$prev_button_name": "prev_page_button_blocked_players",
                "$this_page_index_text": "#blocked_players_page_index_text",
                "$is_visible_binding_name": "#blocked_players_buttons_visible",
                "$is_prev_visible": "#blocked_players_prevButton_visible",
                "$is_next_visible": "#blocked_players_nextButton_visible"
              }
            },
            { "no_invites_label@realms_allowlist.no_invites_label": {} }

          ],
          "bindings": [
            {
              "binding_name": "(not #loading_friends)",
              "binding_name_override": "#visible",
              "binding_type": "global"
            }
          ]
        }
      },
      { "loading_friends@realms_allowlist.loading_friends": {} }
    ]
  },

  "add_friends_and_invite_link_panel": {
    "type": "panel",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", 40 ],
    "$show_invite_links_button|default": false,
    "variables": [
        {
            "requires": "$show_invite_links_button",
            "$button_size": [ "33%", 32 ]
        },
        {
            "requires": "(not $show_invite_links_button)",
            "$button_size": [ "50%", 32 ]
        }
    ],
    "controls": [
      {
        "allowlist_stack_panel": {
          "type": "stack_panel",
          "size": [ "100%", "100%" ],
          "orientation": "horizontal",
            "controls": [
                {
                    "find_friends_button_panel@realms_allowlist.find_friends_button_panel": {
                        "ignored": "(not $supports_add_friend)"
                    }
                },
                {
                    "spacing_1": {
                        "type": "panel",
                        "size": [ 2, "100%" ]
                    }
                },
                {
                    "invite_links_panel": {
                        "ignored": "(not $show_invite_links_button)",
                        "type": "panel",
                        "size": "$button_size",
                        "controls": [
                            {
                                "invite_links_button@common_buttons.light_text_button": {
                                    "anchor_from": "left_middle",
                                    "anchor_to": "left_middle",
                                    "size": [ "default", 30 ],
                                    "layer": 2,
                                    "$button_text": "realmsSettingsScreen.inviteLinksSectionTitle",
                                    "button_mappings": [
                                        {
                                            "from_button_id": "button.menu_select",
                                            "to_button_id": "button.invite_links",
                                            "mapping_type": "pressed"
                                        },
                                        {
                                            "from_button_id": "button.menu_ok",
                                            "to_button_id": "button.invite_links",
                                            "mapping_type": "focused"
                                        }
                                    ],
                                    "bindings": [
                                        {
                                            "binding_name": "#members_list_enabled", // a hack: you cannot set "enabled":false directly on a ui control
                                            "binding_name_override": "#enabled"
                                        }
                                    ]
                                }

                            }
                        ],
                        "bindings": [
                            {
                                "binding_name": "#options_visible",
                                "binding_name_override": "#visible",
                                "binding_type": "global"
                            }
                        ]
                    }
                },
                {
                    "spacing_2": {
                        "ignored": "(not $show_invite_links_button)",
                        "type": "panel",
                        "size": [ 2, "100%" ]
                    }
                },
                {
                    "options_panel": {
                        "type": "panel",
                        "size": "$button_size",
                        "controls": [
                            {
                                "clear_members_button@common_buttons.light_text_button": {
                                    "anchor_from": "left_middle",
                                    "anchor_to": "left_middle",
                                    "size": [ "default", 30 ],
                                    "layer": 2,
                                    "$button_text": "realmsClearMembers.clear",
                                    "button_mappings": [
                                        {
                                            "from_button_id": "button.menu_select",
                                            "to_button_id": "button.clear_members",
                                            "mapping_type": "pressed"
                                        },
                                        {
                                            "from_button_id": "button.menu_ok",
                                            "to_button_id": "button.clear_members",
                                            "mapping_type": "focused"
                                        }
                                    ],
                                    "bindings": [
                                        {
                                            "binding_name": "#members_list_enabled", // a hack: you cannot set "enabled":false directly on a ui control
                                            "binding_name_override": "#enabled"
                                        }
                                    ]
                                }

                            }
                        ],
                        "bindings": [
                            {
                                "binding_name": "#options_visible",
                                "binding_name_override": "#visible",
                                "binding_type": "global"
                            }
                        ]
                    }
                }
            ]
        }
      }
    ]
  },

  "options_icon": {
    "type": "image",
    "layer": 0,
    "texture": "textures/ui/more-dots",
    "color": "black",
    "size": [ 11, 11 ]
  },

  "account_link_image": {
    "type": "image",
    "texture": "textures/ui/control"
  },

  "account_link_icon": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "space_01": {
          "type": "panel",
          "size": [ 9, "100%" ]
        }
      },
      {
        "account_link_image@invite.account_link_image": {
          "size": [ 2, "100%" ]
        }
      },
      {
        "space_03": {
          "type": "panel",
          "size": [ 9, "100%" ]
        }
      }
    ]
  },

  "find_friends_button_panel": {
    "type": "panel",
    "size": [ "fill", 32 ],
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "controls": [
      { "find_friends_button@find_friends_button": {} }
    ]
  },

  "invited_friends_label": {
    "type": "panel",
    "size": [ "100%", 13 ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "controls": [
      {
        "friend_title": {
          "type": "label",
          "color": "$main_header_text_color",
          "offset": [ 1, -1 ],
          "text": "realmsInvitationScreen.invitedPlayers",
          "font_size": "normal",
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "layer": 1
        }
      }
    ],
    "bindings": [
      {
        "binding_name": "#invited_friends_visible",
        "binding_name_override": "#visible",
        "binding_type": "global"
      }
    ]
  },

  "player_filter_label": {
    "type": "panel",
    "size": [ "100%", 13 ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "controls": [
      {
        "player_filter_title": {
          "type": "label",
          "color": "$main_header_text_color",
          "offset": [ 1, -1 ],
          "text": "realmsInvitationScreen.playerFilterTitle",
          "font_size": "normal",
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "layer": 1
        }
      }
    ]
  },

  "members_label": {
    "type": "stack_panel",
    "size": [ "100%", 13 ],
    "orientation": "horizontal",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "controls": [
      {
        "friend_title": {
          "type": "label",
          "color": "$main_header_text_color",
          "offset": [ 1, -1 ],
          "text": "realmsInvitationScreen.members",
          "font_size": "normal",
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "layer": 1
        }
      },
      {
        "padding_panel": {
          "type": "panel",
          "size": [ "fill", "100%" ]
        }
      },
      {
        "loading_text": {
          "type": "label",
          "color": "$main_header_text_color",
          "offset": [ 1, -1 ],
          "text": "#member_loading_text",
          "font_size": "normal",
          "anchor_from": "bottom_right",
          "anchor_to": "bottom_right",
          "layer": 1,
          "bindings": [
            {
              "binding_name": "#member_loading_text",
              "binding_type": "global"
            }
          ]
        }
      }
    ],
    "bindings": [
      {
        "binding_name": "#members_visible",
        "binding_name_override": "#visible",
        "binding_type": "global"
      }
    ]
  },

  "blocked_players_label": {
    "type": "panel",
    "size": [ "100%", 11 ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "controls": [
      {
        "friend_title": {
          "type": "label",
          "offset": [ 1, -1 ],
          "color": "$main_header_text_color",
          "text": "realmsInvitationScreen.blocked",
          "font_size": "normal",
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "layer": 1
        }
      }
    ],
    "bindings": [
      {
        "binding_name": "#blocked_players_visible",
        "binding_name_override": "#visible",
        "binding_type": "global"
      }
    ]
  },

  "uninvited_friends_label": {
    "type": "panel",
    "size": [ "100%", 11 ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "controls": [
      {
        "friend_title": {
          "type": "label",
          "color": "$main_header_text_color",
          "offset": [ 1, -1 ],
          "text": "realmsInvitationScreen.friends",
          "font_size": "normal",
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "layer": 1
        }
      }
    ],
    "bindings": [
      {
        "binding_name": "#uninvited_friends_visible",
        "binding_name_override": "#visible",
        "binding_type": "global"
      }
    ]
  },

  "no_invites_label@realms_allowlist.panel_text": {
    "text": "realmsInvitationScreen.noInvites",
    "size": [ "100%", 20 ],
    "font_size": "normal",
    "anchor_from": "center",
    "anchor_to": "center",
    "bindings": [
      {
        "binding_name": "#no_invites_visible",
        "binding_name_override": "#visible",
        "binding_type": "global"
      }
    ]
  },

  "loading_friends@realms_allowlist.panel_text": {
    "text": "realmsInvitationScreen.loadingFriends",
    "size": [ "100%", 20 ],
    "font_size": "normal",
    "anchor_from": "center",
    "anchor_to": "center",
    "bindings": [
      {
        "binding_name": "#loading_friends",
        "binding_name_override": "#visible",
        "binding_type": "global"
      }
    ]
  },

  //---------------------------------------------------------------------------
  // Gamertag Panel
  //---------------------------------------------------------------------------

  "blocked_grid_item": {
    "type": "panel",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", 29 ],
    "controls": [
      {
        "blocked_panel@realms_allowlist.blocked_panel": {}
      }
    ]
  },

  "factory_stack": {
    "type": "stack_panel",
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",
    "orientation": "vertical",
    "size": [ "100%", "100%c" ]
  },

  "member_factory_xbl_profile@realms_allowlist.xbl_profile_panel_factory": {
    "$collection_binding_name": "members_collection"
  },

  "member_factory_linked_account@realms_allowlist.linked_account_panel_factory": {
    "$collection_binding_name": "members_collection"
  },

  "invited_factory_xbl_profile@realms_allowlist.xbl_profile_panel_factory": {
    "$collection_binding_name": "invited_friends_collection"
  },

  "invited_factory_linked_account@realms_allowlist.linked_account_panel_factory": {
    "$collection_binding_name": "invited_friends_collection"
  },

  "uninvited_factory_xbl_profile@realms_allowlist.xbl_profile_panel_factory": {
    "$collection_binding_name": "uninvited_friends_collection"
  },

  "uninvited_factory_linked_account@realms_allowlist.linked_account_panel_factory": {
    "$collection_binding_name": "uninvited_friends_collection"
  },

  "blocked_factory_xbl_profile@realms_allowlist.xbl_profile_blocked_panel_factory": {
    "$collection_binding_name": "blocked_players_collection"
  },

  "blocked_factory_linked_account@realms_allowlist.linked_account_blocked_panel_factory": {
    "$collection_binding_name": "blocked_players_collection"
  },

  "xbl_profile_panel_factory@realms_allowlist.gapped_xbl_profile_panel": {
    "$member_collection_name": "members_collection",
    "$invited_collection_name": "invited_friends_collection",
    "$uninvited_collection_name": "uninvited_friends_collection",
    "$blocked_players_collection_name": "blocked_players_collection"
  },

  "xbl_profile_blocked_panel_factory@realms_allowlist.gapped_blocked_xbl_profile_panel": {
    "$member_collection_name": "members_collection",
    "$invited_collection_name": "invited_friends_collection",
    "$uninvited_collection_name": "uninvited_friends_collection",
    "$blocked_players_collection_name": "blocked_players_collection"
  },

  "linked_account_panel_factory@realms_allowlist.gapped_linked_account_panel": {
    "$member_collection_name": "members_collection",
    "$invited_collection_name": "invited_friends_collection",
    "$uninvited_collection_name": "uninvited_friends_collection",
    "$blocked_players_collection_name": "blocked_players_collection"
  },

  "linked_account_blocked_panel_factory@realms_allowlist.gapped_blocked_linked_account_panel": {
    "$member_collection_name": "members_collection",
    "$invited_collection_name": "invited_friends_collection",
    "$uninvited_collection_name": "uninvited_friends_collection",
    "$blocked_players_collection_name": "blocked_players_collection"
  },

  "xbl_profile_panel@realms_common.main_banner": {
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", 27 ],
    "controls": [
      { "player_status_panel@realms_allowlist.player_status_panel": {} },
      { "xbl_user_panel@realms_allowlist.xbl_user_panel": {} },
      {
        "right_controls_panel@realms_allowlist.right_controls_panel": {
          "offset": [ -3, 0 ], // Right aligned
          "layer": 6
        }
      },
      {
        "progress@progress.progress_loading_bars": {
          "size": [ 27, 27 ],
          "bindings": [
            {
              "binding_type": "view",
              "source_control_name": "gamer_pic",
              "resolve_sibling_scope": true,
              "source_property_name": "(#profile_image_options = '')",
              "target_property_name": "#visible"
            }
          ]
        }
      }
    ]
  },

  "factory_gap_template": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "gapped_control@$templated_control": {}
      },
      {
        "spacing1": {
          "type": "panel",
          "size": [ "100%", 3 ]
        }
      }
    ]
  },

  "gapped_xbl_profile_panel@factory_gap_template": {
    "$templated_control": "realms_allowlist.xbl_profile_panel"
  },

  "gapped_linked_account_panel@factory_gap_template": {
    "$templated_control": "realms_allowlist.linked_account_panel"
  },

  "gapped_blocked_xbl_profile_panel@factory_gap_template": {
    "$templated_control": "realms_allowlist.blocked_panel"
  },

  "gapped_blocked_linked_account_panel@factory_gap_template": {
    "$templated_control": "realms_allowlist.linked_account_blocked_panel"
  },

  "blocked_panel@realms_common.main_banner": {
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", 27 ],
    "controls": [
      { "xbl_user_panel@realms_allowlist.xbl_user_panel": {} },
      {
        "unblock_button@unblock_button": {
          "offset": [ -3, 0 ]
        }
      }
    ]
  },

  "linked_account_panel@realms_common.main_banner": {
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", 52 ],
    "controls": [
      {
        "linked_account_positioning_panel@realms_allowlist.linked_user_stack_panel": {}
      },
      {
        "right_controls_panel@realms_allowlist.right_controls_panel": {
          "offset": [ -3, -12 ], // Right aligned
          "layer": 6
        }
      },
      {
        "progress@progress.progress_loading_bars": {
          "size": [ 27, 27 ],
          "bindings": [
            {
              "binding_type": "view",
              "source_control_name": "gamer_pic",
              "resolve_sibling_scope": true,
              "source_property_name": "(#profile_image_options = '')",
              "target_property_name": "#visible"
            }
          ]
        }
      }
    ]
  },

  "linked_account_blocked_panel@realms_common.main_banner": {
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", 52 ],
    "controls": [
      {
        "linked_account_positioning_panel@realms_allowlist.linked_user_stack_panel": {
          "$ignore_status_icon": true
        }
      },
      {
        "unblock_button@unblock_button": {
          "anchor_from": "top_right",
          "anchor_to": "top_right",
          "offset": [ -3, 3 ]
        }
      },
      {
        "progress@progress.progress_loading_bars": {
          "size": [ 27, 27 ],
          "bindings": [
            {
              "binding_type": "view",
              "source_control_name": "gamer_pic",
              "resolve_sibling_scope": true,
              "source_property_name": "(#profile_image_options = '')",
              "target_property_name": "#visible"
            }
          ]
        }
      }
    ]
  },

  "xbl_user_panel": {
    "type": "stack_panel",
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "orientation": "horizontal",
    "size": [ "100%c", "100% - 6px" ], // Y sizing = -2 for top and bottom black border, -4 for indent of 2 px top and bottom, should total 20
    "layer": 6,
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "gamer_pic",
        "resolve_sibling_scope": true,
        "source_property_name": "(not (#profile_image_options = ''))",
        "target_property_name": "#visible"
      }
    ],
    "controls": [
      {
        "spacing1@realms_allowlist.horizontal_indent": {
          "size": [ 25, "100%" ]
        }
      },
      {
        "platform_icon_positioner": {
          "type": "panel",
          "size": [ 15, "100%" ],
          "ignored": "(not $is_ps4)"
        }
      },
      {
        "gamerpic_panel@realms_allowlist.gamerpic_panel": {
          "size": [ 21, "100%" ]
        }
      },
      {
        "spacing2@realms_allowlist.horizontal_indent": {
          "size": [ 1, "100%" ]
        }
      },
      {
        "gamertag_label_panel@realms_allowlist.gamertag_label_panel": {
        }
      }
    ]
  },

  "third_party_user_panel": {
    "type": "stack_panel",
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "orientation": "horizontal",
    "size": [ "100%c", "100% - 6px" ], // Y sizing = -2 for top and bottom black border, -4 for indent of 2 px top and bottom, should total 20
    "layer": 6,
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "third_party_profile_picture",
        "resolve_sibling_scope": true,
        "source_property_name": "(not (#texture = ''))",
        "target_property_name": "#visible"
      }
    ],
    "controls": [
      {
        "spacing1@realms_allowlist.horizontal_indent": {
          "size": [ 25, "100%" ]
        }
      },
      {
        "profile_picture@realms_allowlist.third_party_profile_pic_panel": {
          "size": [ 21, "100%" ]
        }
      },
      {
        "spacing2@realms_allowlist.horizontal_indent": {
          "size": [ 1, "100%" ]
        }
      },
      {
        "third_party_profile_label@realms_allowlist.third_party_profile_label": {
        }
      }
    ]
  },

  "linked_profile_pictures_panel": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ 21, "100%" ],
    "anchor_to": "center",
    "anchor_from": "center",
    "controls": [
      {
        "pp2@realms_allowlist.third_party_profile_pic_panel": {
          "size": [ "100%", 21 ],
          "layer": 1
        }
      },
      {
        "account_link@realms_allowlist.account_link_icon": {
          "size": [ "100%", "fill" ]
        }
      },
      {
        "pp1@realms_allowlist.gamerpic_panel": {
          "size": [ "100%", 21 ],
          "layer": 1
        }
      }
    ]
  },

  "platform_profile_names": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ "fill", "100%" ],
    "controls": [
      {
        "friend_grid_third_party_tag@realms_allowlist.third_party_profile_label": {
          "size": [ "100%", 12 ],
          "layer": 1
        }
      },
      {
        "spacer_02": {
          "type": "panel",
          "size": [ "100%", 13 ]
        }
      },
      {
        "friend_grid_xbl_gamertag@realms_allowlist.gamertag_label_panel": {
          "size": [ "100%", 12 ],
          "layer": 1
        }
      },
      {
        "spacer_03": {
          "type": "panel",
          "size": [ "100%", 10 ]
        }
      }
    ]
  },

  "linked_user_stack_panel": {
    "type": "stack_panel",
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "orientation": "horizontal",
    "$ignore_status_icon|default": false,
    "size": [ "100%", "100% - 6px" ], // Y sizing = -2 for top and bottom black border, -4 for indent of 2 px top and bottom, should total 20
    "layer": 6,
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "third_party_profile_picture",
        "resolve_sibling_scope": true,
        "source_property_name": "(not (#texture = ''))",
        "target_property_name": "#visible"
      },
      {
        "binding_type": "view",
        "source_control_name": "gamer_pic",
        "resolve_sibling_scope": true,
        "source_property_name": "(not (#profile_image_options = ''))",
        "target_property_name": "#visible"
      }
    ],
    "controls": [
      {
        "allow_offset_control": {
          "type": "panel",
          "size": [ 20, "100%" ],

          "controls": [
            {
              "player_status_panel@realms_allowlist.player_status_panel": {
                "size": [ 20, 20 ],
                "ignored": "$ignore_status_icon",

                "anchor_from": "top_left",
                "anchor_to": "top_left"

              }
            }
          ]
        }
      },
      {
        "platform_icon_positioner": {
          "type": "panel",
          "size": [ 15, "100%" ],
          "controls": [
            {
              "platform_icon@invite.platform_icon_panel": {
                "layer": 1,
                "$is_platform_icon": "$invite_platform_icons_visible",
                "$icon_offset": [ 0, 2 ],
                "anchor_to": "top_left",
                "anchor_from": "top_left"
              }
            }
          ]
        }
      },
      {
        "spacing1@realms_allowlist.horizontal_indent": {
          "size": [ 5, "100%" ]
        }
      },
      {
        "profile_picture@realms_allowlist.linked_profile_pictures_panel": {}
      },
      {
        "spacing2@realms_allowlist.horizontal_indent": {
          "size": [ 1, "100%" ]
        }
      },
      {
        "platform_names_label@realms_allowlist.platform_profile_names": {
          "size": [ "fill", "100%" ]
        }
      },
      {
        "spacing3@realms_allowlist.horizontal_indent": {
          "size": [ 3, "100%" ]
        }
      }
    ]
  },

  "horizontal_indent": {
    "type": "panel",
    "size": [ 2, "100%" ]
  },

  "vertical_indent": {
    "type": "panel",
    "size": [ "100%", 2 ]
  },

  "gamerpic_panel": {
    "type": "panel",
    "size": [ 21, 21 ],
    "anchor_to": "left_middle",
    "anchor_from": "left_middle",
    "controls": [
      { "black_border@realms_allowlist.black_border": {} },
      {
        "gamer_pic@realms_allowlist.gamer_pic": {
          "layer": 1,
          "size": [ "100% - 2px", "100% - 2px" ]
        }
      }
    ]
  },

  "third_party_profile_pic_panel": {
    "type": "panel",
    "size": [ "100%", "100%" ],
    "anchor_to": "left_middle",
    "anchor_from": "left_middle",
    "controls": [
      { "black_border@realms_allowlist.black_border": {} },
      {
        "third_party_profile_picture@realms_allowlist.third_party_profile_picture": {
          "layer": 1,
          "size": [ "100% - 2px", "100% - 2px" ]
        }
      }
    ]
  },

  "gamertag_label_panel": {
    "type": "panel",
    "anchor_to": "left_middle",
    "anchor_from": "left_middle",
    "size": [ 100, "100%" ],
    "controls": [
      { "gamertag_label@realms_allowlist.gamertag_label": {} },
      { "real_name_label@realms_allowlist.real_name_label": {} }
    ]
  },

  "third_party_profile_label": {
    "type": "panel",
    "anchor_to": "left_middle",
    "anchor_from": "left_middle",
    "size": [ 100, "100%" ],
    "controls": [
      { "profile_name_label@realms_allowlist.third_party_profile_name_label": {} }
    ]
  },

  "panel_text": {
    "type": "label",
    "color": "$dark_grid_item_text_color",
    "shadow": false,
    "layer": 5,
    "anchor_from": "top_left",
    "anchor_to": "top_left"
  },

  "gamertag_label@realms_allowlist.panel_text": {
    "offset": [ 1, 1 ],
    "text": "#gamertag",
    "font_size": "normal",
    "anchor_to": "top_left",
    "anchor_from": "top_left",
    "bindings": [
      {
        "binding_name": "#gamertag",
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name"
      }
    ]
  },

  "third_party_profile_name_label@realms_allowlist.panel_text": {
    "offset": [ 1, 1 ],
    "text": "#third_party_profile_name",
    "font_size": "normal",
    "anchor_to": "top_left",
    "anchor_from": "top_left",
    "bindings": [
      {
        "binding_name": "#third_party_profile_name",
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name"
      }
    ]
  },

  "real_name_label@realms_allowlist.panel_text": {
    "offset": [ 1, "100%" ],
    "text": "#real_name",
    "font_size": "normal",
    "anchor_to": "bottom_left",
    "anchor_from": "bottom_left",
    "bindings": [
      {
        "binding_name": "#real_name",
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name"
      }
    ]
  },

  "right_settings_panel": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%c", 21 ],
    "controls": [
      { "member_settings@realms_allowlist.member_settings": {} }
    ]
  },

  "member_settings": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "ignored": "($collection_binding_name = $uninvited_collection_name)",
    "size": [ "100%c", 21 ],
    "controls": [
      { "minus_button@realms_allowlist.minus_button": {} },
      {
        "horizontal_space": {
          "type": "panel",
          "size": [ 2, "100%" ]
        }
      },
      {
        "member_permissions@realms_allowlist.permissions_dropdown": {}
      },
      {
        "op_deop_button@realms_allowlist.op_deop_button": {
          "bindings": [
            {
              "binding_name": "#loading_friends",
              "binding_name_override": "#visible"
            }
          ]
        }
      }
    ],
    "bindings": [
      {
        "binding_name": "#show_member_settings",
        "binding_name_override": "#visible",
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name"
      }
    ]
  },

  "right_controls_panel": {
    "type": "panel",
    "size": [ "100%c", "100%" ],
    "anchor_from": "right_middle",
    "anchor_to": "right_middle",
    "controls": [
      { "right_settings_panel@realms_allowlist.right_settings_panel": {} },
      {
        "uninvited_friends_invite_button@realms_allowlist.invite_button": {
          "size": [ 62, 21 ]
        }
      }
    ]
  },

  "player_status_panel": {
    "size": [ 20, "100% - 2px" ],
    "layer": 6,
    "type": "panel",
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "controls": [
      {
        "player_online_icon@realms_allowlist.player_online_icon": {
          "bindings": [
            {
              "binding_name": "#player_online",
              "binding_name_override": "#visible",
              "binding_type": "collection",
              "binding_collection_name": "$collection_binding_name"
            }
          ]
        }
      },
      {
        "player_offline_icon@realms_allowlist.player_offline_icon": {
          "bindings": [
            {
              "binding_name": "(not #player_online)",
              "binding_name_override": "#visible",
              "binding_type": "collection",
              "binding_collection_name": "$collection_binding_name"
            }
          ]
        }
      }
    ]
  },

  "permissions_dropdown": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ "100%c", "100%" ],
    "controls": [
      {
        "vertical_space": {
          "type": "panel",
          "size": [ 0, 2 ]
        }
      },
      {
        "option_dropdown_permissions@settings_common.option_dropdown": {
          "$dropdown_content": "permissions.permission_level_dropdown_content",
          "$dropdown_area": "friends_panel",
          "$dropdown_name": "player_permissions_dropdown",
          "$dropdown_icon_image_texture_binding": "#collection_permission_level_dropdown_icon_texture",
          "$anchor_dropdown_content_from": "top_right",
          "$anchor_dropdown_content_to": "top_right",
          "$icon_binding_type_override": "collection",
          "$icon_binding_collection_name_override": "$collection_binding_name",
          "$button_type_panel": "permissions.permission_level_dropdown_state_content",
          "$options_dropdown_toggle_label_binding": "#player_permissions_dropdown_toggle_label",
          "$options_dropdown_toggle_label_binding_type": "collection",
          "$options_dropdown_toggle_label_binding_collection_name": "$collection_binding_name",
          "$toggle_binding_type": "collection",
          "$toggle_grid_collection_name": "$collection_binding_name",
          "$option_enabled_binding_name": "#player_permissions_dropdown_enabled",
          "$content_label_visible": false,
          "$is_world_settings": true,
          "$show_option_label": false,
          "$dropdown_icon_image_size": [ 10, 10 ],
          "$dropdown_scroll_content_size": [ "400%", "600%" ],
          "$content_size": [ "100% - 9px", "100% - 8px" ],
          "size": [ "40px", "100%" ],
          "$option_dropdown_size": [ "100%", "21px" ],
          "bindings": [
            {
              "binding_name": "(not #loading_friends)",
              "binding_name_override": "#visible"
            }
          ]
        }
      }
    ]
  },

  //---------------------------------------------------------------------------
  // Buttons
  //---------------------------------------------------------------------------

  "invite_button@common_buttons.light_text_button": {
    "size": [ 21, 21 ],
    "layer": 1,
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "$button_text": "realmsSettingsScreen.allowlist_invite",
    "ignored": "($collection_binding_name = $member_collection_name or $collection_binding_name = $invited_collection_name)",
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.realms_invite_plus",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.realms_invite_plus",
        "mapping_type": "focused"
      }
    ],
    "bindings": [
      {
        "binding_type": "collection_details",
        "binding_collection_name": "$collection_binding_name"
      },
      {
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name",
        "binding_name": "#invite_button_visible",
        "binding_name_override": "#visible"
      },
      {
        "binding_name": "#members_list_enabled", // a hack: you cannot set "enabled":false directly on a ui control
        "binding_name_override": "#enabled"
      }
    ]
  },

  "minus_button@common_buttons.light_glyph_button": {
    "size": [ 21, 21 ],
    "layer": 2,
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "$button_content": "realms_allowlist.minus_icon",
    "$button_tts_header": "realmsInvitationScreen.removeRealmMember",
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.realms_invite_minus",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.realms_invite_minus",
        "mapping_type": "focused"
      }
    ],
    "bindings": [
      {
        "binding_type": "collection_details",
        "binding_collection_name": "$collection_binding_name"
      },
      {
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name",
        "binding_name": "#is_not_owner",
        "binding_name_override": "#visible"
      },
      {
        "binding_name": "#members_list_enabled", // a hack: you cannot set "enabled":false directly on a ui control
        "binding_name_override": "#enabled"
      }
    ]
  },

  "unblock_label": {
    "type": "label",
    "color": "$text_color",
    "anchor_from": "center",
    "anchor_to": "center",
    "text": "realmsInvitationScreen.unblock",
    "text_alignment": "center",
    "size": [ "100%", 15 ],
    "offset": [ 0, 2 ]
  },

  "unblock_button@common_buttons.light_content_button": {
    "size": [ 62, 21 ],
    "anchor_from": "right_middle",
    "anchor_to": "right_middle",
    "$button_content": "realms_allowlist.unblock_label",
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.realms_invite_unblock",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.realms_invite_unblock",
        "mapping_type": "focused"
      }
    ],
    "bindings": [
      {
        "binding_type": "collection_details",
        "binding_collection_name": "$collection_binding_name"
      },
      {
        "binding_name": "#members_list_enabled", // a hack: you cannot set "enabled":false directly on a ui control
        "binding_name_override": "#enabled"
      }
    ]
  },

  "op_deop_button@common_toggles.light_image_toggle_collection": {
    "size": [ 21, 21 ],
    "layer": 2,
    "ignored": "($collection_binding_name = $uninvited_collection_name)",
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "$checked_image": "realms_allowlist.op_icon",
    "$unchecked_image": "realms_allowlist.deop_icon",
    "$toggle_state_binding_name": "#operator",
    "$toggle_name": "#operator",
    "$toggle_binding_type": "collection",
    "$toggle_grid_collection_name": "$collection_binding_name",
    "$toggle_enabled_binding_name": "#members_list_enabled",
    "$toggle_enabled_binding_type": "global"
  },

  "find_friends_button@common_buttons.light_text_button": {
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "size": [ "100%", 30 ],
    "layer": 2,
    "$button_content": "realms_allowlist.plus_icon",
    "$button_text": "realmsInvitationScreen.findFriends",
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.realms_invite_find_friends",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.realms_invite_find_friends",
        "mapping_type": "focused"
      }
    ],
    "bindings": [
      {
        "binding_name": "#members_list_enabled", // a hack: you cannot set "enabled":false directly on a ui control
        "binding_name_override": "#enabled"
      }
    ]
  },

  //---------------------------------------------------------------------------
  // assets
  //---------------------------------------------------------------------------
  //Black border is used for the grid item and around the gamerpic
  "black_border": {
    "type": "image",
    "texture": "textures/ui/mainbanners"
  },

  "gamer_pic": {
    "type": "custom",
    "renderer": "profile_image_renderer",
    "bindings": [
      {
        "binding_name": "#profile_image_options",
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name"
      }
    ]
  },

  "third_party_profile_picture": {
    "type": "image",
    "texture": "#texture",
    "texture_file_system": "#texture_file_system",
    "bindings": [
      {
        "binding_name": "#third_party_profile_pic",
        "binding_name_override": "#texture",
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name"
      },
      {
        "binding_name": "#third_party_profile_pic_file_system",
        "binding_name_override": "#texture_file_system",
        "binding_type": "collection",
        "binding_collection_name": "$collection_binding_name"
      }
    ]
  },

  "player_online_icon": {
    "type": "image",
    "texture": "textures/ui/player_online_icon",
    "size": [ 7, 7 ]
  },

  "player_offline_icon": {
    "type": "image",
    "texture": "textures/ui/player_offline_icon",
    "size": [ 7, 7 ]
  },

  "plus_icon": {
    "type": "image",
    "layer": 2,
    "texture": "textures/ui/plus",
    "size": [ 11, 11 ]
  },

  "more_icon": {
    "type": "image",
    "layer": 2,
    "size": [ 13, 3 ],
    "texture": "textures/ui/more_dots"
  },

  "share_icon": {
    "type": "image",
    "layer": 2,
    "size": "$share_icon_size",
    "texture": "$share_icon_texture",
    "offset": "$share_icon_offset"
  },

  "minus_icon": {
    "type": "image",
    "layer": 2,
    "texture": "textures/ui/minus",
    "size": [ 11, 3 ]
  },

  "op_icon": {
    "type": "image",
    "layer": 2,
    "texture": "textures/ui/op",
    "size": [ 14, 14 ]
  },

  "deop_icon": {
    "type": "image",
    "layer": 2,
    "texture": "textures/ui/deop",
    "size": [ 14, 14 ]
  },

  // -----------------------------------------------
  //
  //    screen
  //
  // -----------------------------------------------

  "player_filter_text_box@common.text_edit_box": {
    "size": [ "100%", 25 ],
    "$text_box_name": "#player_filter_text_box",
    "max_length": 30,
    "$place_holder_text": "realmsSettingsScreen.searchBox"
  },

  "page_panel": {
    "type": "panel",
    "size": [ "100%", 20 ],
    "controls": [
      {
        "prev_button@settings_common.action_button": {
          "$button_text": "realmsSettingsScreen.dev_prev_page_label",
          "$pressed_button_name": "$prev_button_name",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "size": [ 70, "100%" ],
          "$is_prev_visible|default": "#visible",
          "bindings": [
            {
              "binding_name": "$is_prev_visible",
              "binding_name_override": "#visible"
            }
          ]
        }
      },
      {
        "page_text": {
          "type": "label",
          "text": "$this_page_index_text",
          "color": "$sub_header_text_color",
          "anchor_from": "center",
          "anchor_to": "center",
          "size": [ "default", "50%" ],
          "bindings": [
            {
              "binding_name": "$this_page_index_text"
            }
          ]
        }
      },
      {
        "next_button@settings_common.action_button": {
          "$button_text": "realmsSettingsScreen.dev_next_page_label",
          "$pressed_button_name": "$next_button_name",
          "anchor_from": "top_right",
          "anchor_to": "top_right",
          "size": [ 70, "100%" ],
          "$is_next_visible|default": "#visible",
          "bindings": [
            {
              "binding_name": "$is_next_visible",
              "binding_name_override": "#visible"
            }
          ]
        }
      }
    ],
    "bindings": [
      {
        "binding_name": "$is_visible_binding_name",
        "binding_name_override": "#visible",
        "binding_type": "global"
      }
    ]
  },

  "realms_allowlist_panel_content@common.scrolling_panel": {
    "anchor_to": "top_left",
    "anchor_from": "top_left",
    "$show_background": false,
    "$scroll_size": [ 5, "100% - 4px" ],
    "$scrolling_content": "realms_allowlist.friends_containing_panel",
    "$friend_panel_size": [ "100% - 1px", "100%c" ]
  },

  "realms_allowlist_content_panel@common_dialogs.main_panel_one_button": {
    "$child_control": "realms_allowlist.realms_allowlist_content_panel_children",
    "$text_name": "realmsInvitationScreen.title",
    "$show_close_button": false,
    "size": "$narrow_screen_size"
  },

  "realms_allowlist_content_panel_children": {
    "type": "panel",
    "anchor_to": "top_left",
    "anchor_from": "top_left",
    "controls": [
      {
        "realms_allowlist_panel_content@realms_allowlist.realms_allowlist_panel_content": {
          "offset": [ 2, 0 ],
          "$scrolling_pane_size": [ "100% - 4px", "100%" ]
        }
      },
      {
        "done_button@common_buttons.light_text_button": {
          "anchor_from": "bottom_middle",
          "anchor_to": "top_middle",
          "size": [ "100% + 2px", 30 ],
          "offset": [ 0, 5 ],
          "layer": 2,
          "$button_text": "realmsInvitationScreen.done",
          "button_mappings": [
            {
              "from_button_id": "button.menu_select",
              "to_button_id": "button.menu_realm_send_invites",
              "mapping_type": "pressed"
            },
            {
              "from_button_id": "button.menu_ok",
              "to_button_id": "button.menu_realm_send_invites",
              "mapping_type": "focused"
            }
          ]
        }
      }
    ]
  },

  "realms_allowlist_screen@common.base_screen": {
    "$screen_content": "realms_allowlist.realms_allowlist_content"
  },

  "realms_allowlist_content": {
    "type": "panel",
    "controls": [
      {
        "root_panel": {
          "type": "input_panel",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "controls": [
            { "realms_allowlist_content_panel@realms_allowlist.realms_allowlist_content_panel": { "layer": 1 } }
          ]
        }
      }
    ]
  },

  "transparent_close_button@common_buttons.transparent_content_button": {
    "size": [ "100%", "100%" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "$default_content_alpha": 0,
    "$default_button_alpha": 0,
    "$default_hover_alpha": 0,
    "$default_pressed_alpha": 0,
    "$hover_button_texture": "textures/ui/imagetaggedcorner",
    "$pressed_button_texture": "textures/ui/imagetaggedcorner",
    "$close_button_to_button_id|default": "button.menu_exit",
    "bindings": [
      {
        "binding_name": "(not #gamepad_helper_visible)",
        "binding_name_override": "#visible"
      }
    ],
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.realms_options_close",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.realms_options_close",
        "mapping_type": "focused"
      }
    ]
  }
}
