{
  "namespace": "realmsPlus_buy",

  "buy_now_content": {
    "type": "stack_panel",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "description_stack@realmsPlus_buy.description_stack": {}
      },
      {
        "realm_name@realmsPlus_buy.realm_name_stack": {}
      },
      {
        "terms_and_conditions@realmsPlus_buy.terms_and_conditions": {}
      },
      {
        "padding_2": {
          "type": "panel",
          "size": [ "100%", 4 ]
        }
      },
      {
        "buy_button@realmsPlus_buy.buy_button_panel": {
          "$pressed_button_name": "button.create_realm",
          "$buy_now_bindings": [
            {
              "binding_name": "#has_checked_tos",
              "binding_name_override": "#enabled"
            }
          ]
        }
      },
      {
        "padding_3": {
          "type": "panel",
          "size": [ "100%", 4 ]
        }
      },
      {
        "platform_terms_factory": {
          "type": "stack_panel",
          "factory": {
            "name": "platform_terms_factory",
            "control_ids": {
              "terms": "@realmsPlus_buy.content_text_section"
            }
          },
          "collection_name": "platform_terms_collection",
          "bindings": [
            {
              "binding_name": "#platform_term_controls",
              "binding_name_override": "#collection_length"
            }
          ]
        }
      }
    ]
  },

  "content_text_section": {
    "type": "stack_panel",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "text_description@realmsPlus_buy.content_description": {}
      },
      {
        "toggle_section_divider@common.section_divider": {}
      },
      {
        "padding": {
          "type": "panel",
          "size": [ "100%", 4 ]
        }
      }
    ]
  },

  "content_description": {
    "type": "panel",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "content_description_label": {
          "type": "label",
          "size": [ "100%", "default" ],
          "text": "#platform_terms_text",
          "color": "$body_text_color",
          "font_type": "smooth",          
          "bindings": [
            {
              "binding_name": "#platform_terms_text",
              "binding_collection_name": "platform_terms_collection",
              "binding_type": "collection"
            }
          ]
        }
      }
    ]
  },

  "trial_image_and_description": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%", "100%cm" ],
    "controls": [
      {
        "image_border@common.focus_border_white": {
          "size": [ "25%", "100%c + 2px" ],
          "color": [ 0, 0, 0 ],
          "layer": 2,
          "controls": [
            {
              "realms_image@common.service_repo_image_panel": {
                "size": [ "100% - 2px", "133.33%x" ],
                "$repo_image_texture": "realms_plus_logo_tall",
                "layer": -1
              }
            }
          ]
        }
      },
      {
        "padding": {
          "type": "panel",
          "size": [ 4, 0 ]
        }
      },
      {
        "description_text": {
          "type": "label",
          "text": "#trial_desciption_text",
          "color": "$store_white_text_color",
          "size": [ "fill", "default" ],
          "font_type": "smooth",
          "bindings": [
            {
              "binding_name": "#trial_desciption_text"
            }
          ]
        }
      }
    ]
  },

  "title_text": {
    "type": "label",
    "size": [ "100% - 4px", "default" ],
    "text": "#buy_now_banner_text",
    "color": "$store_white_text_color",
    "bindings": [
      {
        "binding_name": "#buy_now_banner_text"
      }
    ]
  },

  "description_stack": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "title_with_gradient@realmsPlus.gradient_content_panel": {
          "size": [ "100%", 15 ],
          "$gradient_content": "realmsPlus_buy.title_text"
        }
      },
      {
        "padding": {
          "type": "panel",
          "size": [ 0, 2 ]
        }
      },
      { "image_and_description@realmsPlus_buy.trial_image_and_description": {} }
    ]
  },

  "realm_name_stack": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "realm_name_label@common.minecraftTenLabel": {
          "size": [ "100%", "default" ],
          "text": "realmsCreateScreen.nameHeader.name",
          "color": "$store_white_text_color"
        }
      },
      {
        "padding_0": {
          "type": "panel",
          "size": [ "100%", 1 ]
        }
      },
      {
        "realm_name_text_box@common.text_edit_box": {
          "size": [ "100%", 20 ],
          "$text_edit_box_label_anchor_point": "left_middle",
          "$place_holder_text": "#placeholder_realm_name",
          "$text_edit_box_placeholder_content_binding_name": "#placeholder_realm_name",
          "$option_binding_name": "#realms_name_box",
          "$text_box_name": "#realms_name_box",
          "$text_edit_box_content_binding_name": "#realms_name_box",
          "$text_edit_box_enabled_binding_type": "none",
          "$focus_override_right": "FOCUS_OVERRIDE_STOP"
        }
      }
    ]
  },

  "terms_and_conditions": {
    "type": "panel",
    "size": [ "100%", 34 ],
    "controls": [
      {
        "terms_panel@realmsPlus_buy.terms_and_conditions_panel": {}
      }
    ]
  },

  "terms_and_conditions_panel": {
    "type": "panel",
    "size": [ "100%", "100% - 4px" ],
    "controls": [
      {
        "name_label@common.minecraftTenLabel": {
          "offset": [ 0, -1 ],
          "text": "realmsCreateScreen.termsAndConditionsHeader",
          "color": "$store_white_text_color",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "layer": 2
        }
      },
      {
        "terms_string_panel": {
          "type": "panel",
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "offset": [ 0, 7 ],
          "size": [ "100%", "100% - 10px" ],
          "$pressed_button_name_terms_conditions": "button.tos_hyperlink",
          "$pressed_button_name_privacy_policy": "button.privpol_hyperlink",
          "variables": [
            {
              // Stop-gap measure until we can get hyperlinks to work from VR and FireTV
              // $xbox_one should be removed when xbox stops being UWP, it's only here now
              // because otherwise the link opens in the browser, which closes minecraft
              "requires": "($is_holographic or $fire_tv or $xbox_one)",
              "$pressed_button_name_terms_conditions": "button.tos_popup"
            },
            {
              // Stop-gap measure until we can get hyperlinks to work from VR and FireTV
              // $xbox_one should be removed when xbox stops being UWP, it's only here now
              // because otherwise the link opens in the browser, which closes minecraft
              "requires": "($is_holographic or $fire_tv or $xbox_one)",
              "$pressed_button_name_privacy_policy": "button.privpol_popup"
            }
          ],
          "controls": [
            {
              "banner_fill": {
                "type": "image",
                "size": [ "100%", "100%" ],
                "layer": 2,
                "texture": "textures/ui/Black",
                "keep_ratio": false
              }
            },
            {
              "buttons_stack_panel": {
                "type": "stack_panel",
                "orientation": "horizontal",
                "size": [ "100%", "100%" ],
                "variables": [
                  {
                    "requires": "(not $is_low_memory_device)",
                    "$button_font_scale_factor": 1.39
                  }
                ],
                "controls": [
                  {
                    "agree_panel": {
                      "type": "panel",
                      "size": [ 68, "100%" ],
                      "anchor_from": "left_middle",
                      "anchor_to": "left_middle",
                      "layer": 3,
                      "controls": [
                        {
                          "checkbox_control@common.checkbox": {
                            "size": [ "50%", "100%" ],
                            "offset": [ 0, 0 ],
                            "anchor_from": "left_middle",
                            "anchor_to": "left_middle",
                            "$checkbox_alignment": "left_middle",
                            "$checkbox_offset": [ 7, 0 ],
                            "$toggle_name": "#agree_terms_and_conditions",
                            "focus_change_up": "2users",
                            "focus_identifier": "checkbox_control",
                            "bindings": [
                              {
                                "binding_name": "#has_checked_tos",
                                "binding_name_override": "#toggle_state"
                              }
                            ]
                          }
                        },
                        {
                          "i_agree_label": {
                            "type": "label",
                            "color": "$main_header_text_color",
                            "text": "realmsCreateScreen.termsAndConditionsAgree",
                            "offset": [ 22, 0 ],
                            "size": [ "75%", "default" ],
                            "layer": 3,
                            "anchor_from": "left_middle",
                            "anchor_to": "left_middle"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "view_terms_button@realmsPlus_buy.view_terms_button": {
                      "size": [ "fill", "100%" ]
                    }
                  },
                  {
                    "privacy_policy_button@realmsPlus_buy.privacy_policy_button": {
                      "size": [ "fill", "100%" ]
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "button_text@common.minecraftTenLabel": {
    "size": "$button_text_size",
    "max_size": "$button_text_max_size",
    "text": "$button_text",
    "color": "$text_color"
  },

  "view_terms_button@common_buttons.light_content_button": {
    "$button_text": "store.realmsPlus.buyNow.viewTerms",
    "$button_text_size": [ "default", "default" ],
    "$button_text_max_size": [ "100% - 10px", 18 ],
    "$pressed_button_name": "$pressed_button_name_terms_conditions",
    "$button_content": "realmsPlus_buy.button_text"
  },

  "privacy_policy_button@common_buttons.light_content_button": {
    "$button_text": "store.realmsPlus.buyNow.viewPrivacyPolicy",
    "$button_text_size": [ "default", "default" ],
    "$button_text_max_size": [ "100% - 10px", 18 ],
    "$pressed_button_name": "$pressed_button_name_privacy_policy",
    "$button_content": "realmsPlus_buy.button_text"
  },

  "buy_button_panel": {
    "type": "panel",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "buy_button@common_buttons.light_content_button": {
          "size": [ "100%", 20 ],
          "$button_content": "realmsPlus_buy.buy_button_content",
          "bindings": "$buy_now_bindings"
        }
      }
    ]
  },

  "buy_button_content": {
    "type": "panel",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "button_chevron_panel": {
          "type": "stack_panel",
          "orientation": "horizontal",
          "size": [ "100%c", "100%" ],
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "offset": [ -2, -2 ],
          "controls": [
            {
              "buy_button_chevron@realmsPlus.markdown_background_animated": {}
            }
          ]
        }
      },
      {
        "button_text@common.minecraftTenLabel": {
          "text": "#buy_now_button_text",
          "size": [ "default", "default" ],
          "color": "$text_color",
          "layer": 1,
          "bindings": [
            {
              "binding_name": "#buy_now_button_text"
            }
          ]
        }
      }
    ]
  }

}
