{
    "namespace": "quest_book_utils",
    "beginner_tab_icon": {
        "type": "image",
        "texture": "textures/ui/permissions_member_star",
        "size": [
            13,
            14
        ],
        "offset": [
            -0.5,
            0
        ],
        "anchor_to": "center",
        "anchor_from": "center"
    },
    "base_tab@common_tabs.tab_top": {
        "$is_left_most_tab|default": false,
        "$is_right_most_tab|default": false,
        "$is_default|default": false,
        "$toggle_name": "$group_name",
        "$tab_content": "crafting.empty_tab_panel",
        "size": "$tab_size",
        "$radio_toggle_group": true,
        "$toggle_group_default_selected": 1,
        "$toggle_group_forced_index": "$tab_index",
        "$toggle_default_state": "$is_default",
        "$tab_view_binding_name": "$tab_view"
    },
    "claim_rewards_button": {
        "type": "stack_panel",
        "orientation": "horizontal",
        "collection_name": "form_buttons",
        "anchor_from": "center",
        "anchor_to": "center",
        "size": [
            "100%c",
            "100%c"
        ],
        "controls": [
            {
                "panel": {
                    "type": "panel",
                    "size": [
                        "100%c",
                        23
                    ],
                    "collection_index": "$button_index",
                    "controls": [
                        {
                            "button_text": {
                                "type": "stack_panel",
                                "orientation": "vertical",
                                "size": [
                                    "100%c",
                                    23
                                ],
                                "controls": [
                                    {
                                        "offset_padding": {
                                            "type": "panel",
                                            "size": [
                                                0,
                                                6
                                            ]
                                        }
                                    },
                                    {
                                        "horizontal": {
                                            "type": "stack_panel",
                                            "orientation": "horizontal",
                                            "size": [
                                                "100%c",
                                                "100%c"
                                            ],
                                            "controls": [
                                                {
                                                    "offset_padding": {
                                                        "type": "panel",
                                                        "size": [
                                                            8,
                                                            0
                                                        ]
                                                    }
                                                },
                                                {
                                                    "image": {
                                                        "type": "image",
                                                        "texture": "textures/ui/icon_new_item",
                                                        "size": [
                                                            9,
                                                            9
                                                        ],
                                                        "layer": 100
                                                    }
                                                },
                                                {
                                                    "offset_padding": {
                                                        "type": "panel",
                                                        "size": [
                                                            8,
                                                            0
                                                        ]
                                                    }
                                                },
                                                {
                                                    "button_text": {
                                                        "type": "label",
                                                        "text": "#form_button_text",
                                                        "text_alignment": "left",
                                                        "layer": 100,
                                                        "bindings": [
                                                            {
                                                                "binding_type": "collection_details",
                                                                "binding_collection_name": "form_buttons"
                                                            },
                                                            {
                                                                "binding_name": "#form_button_text",
                                                                "binding_type": "collection",
                                                                "binding_collection_name": "form_buttons"
                                                            }
                                                        ]
                                                    }
                                                },
                                                {
                                                    "offset_padding": {
                                                        "type": "panel",
                                                        "size": [
                                                            8,
                                                            0
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "offset_padding": {
                                            "type": "panel",
                                            "size": [
                                                0,
                                                6
                                            ]
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "button@common_buttons.light_text_button": {
                                "$pressed_button_name": "button.form_button_click",
                                "$default_button_texture": "textures/quest_book/claim_rewards_button.default",
                                "$hover_button_texture": "textures/quest_book/claim_rewards_button.hover",
                                "$pressed_button_texture": "textures/quest_book/claim_rewards_button.pressed",
                                "size": [
                                    "100%sm",
                                    23
                                ],
                                "$focus_border_size": [
                                    0,
                                    0
                                ],
                                "$button_image_size": [
                                    "100%",
                                    "100%"
                                ],
                                "layer": 1,
                                "bindings": [
                                    {
                                        "binding_type": "collection_details",
                                        "binding_collection_name": "form_buttons"
                                    }
                                ]
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_type": "collection_details",
                            "binding_collection_name": "form_buttons"
                        },
                        {
                            "binding_name": "#form_button_text",
                            "binding_type": "collection",
                            "binding_collection_name": "form_buttons"
                        },
                        {
                            "binding_type": "view",
                            "source_property_name": "(#form_button_text = 'button.claim_all_rewards')",
                            "target_property_name": "#visible"
                        }
                    ]
                }
            }
        ]
    },
    "quest_button_panel": {
        "type": "stack_panel",
        "orientation": "horizontal",
        "collection_name": "form_buttons",
        "anchor_from": "top_middle",
        "anchor_to": "top_middle",
        "size": [
            24,
            24
        ],
        "controls": [
            {
                "claimed_button@quest_book_utils.quest_button": {
                    "collection_index": "$button_index",
                    "$pressed_button_name": "button.form_button_click",
                    "$button_texture": "textures/quest_book/quest_button_claimed",
                    "size": [
                        24,
                        24
                    ],
                    "layer": 1,
                    "bindings": [
                        {
                            "binding_type": "collection_details",
                            "binding_collection_name": "form_buttons"
                        },
                        {
                            "binding_name": "#form_button_text",
                            "binding_type": "collection",
                            "binding_collection_name": "form_buttons"
                        },
                        {
                            "binding_type": "view",
                            "source_property_name": "(((#form_button_text - 'beginnerQuests.name:' - 'intermediateQuests.name:' - 'advancedQuests.name:' - 'expertQuests.name:' - 'masteryQuests.name:') - (#form_button_text - 'beginnerQuests.name:' - 'intermediateQuests.name:' - 'advancedQuests.name:' - 'expertQuests.name:' - 'masteryQuests.name:' - 'CLAIMED:' - 'COMPLETED:' - 'LOCKED:' - 'IN_PROGRESS:')))",
                            "target_property_name": "#button_state"
                        },
                        {
                            "binding_type": "view",
                            "source_property_name": "(#button_state = 'CLAIMED:')",
                            "target_property_name": "#visible"
                        }
                    ]
                }
            },
            {
                "progress_button@quest_book_utils.quest_button": {
                    "collection_index": "$button_index",
                    "$pressed_button_name": "button.form_button_click",
                    "$button_texture": "textures/quest_book/quest_button_in_progress",
                    "size": [
                        24,
                        24
                    ],
                    "layer": 1,
                    "bindings": [
                        {
                            "binding_type": "collection_details",
                            "binding_collection_name": "form_buttons"
                        },
                        {
                            "binding_name": "#form_button_text",
                            "binding_type": "collection",
                            "binding_collection_name": "form_buttons"
                        },
                        {
                            "binding_type": "view",
                            "source_property_name": "(((#form_button_text - 'beginnerQuests.name:' - 'intermediateQuests.name:' - 'advancedQuests.name:' - 'expertQuests.name:' - 'masteryQuests.name:') - (#form_button_text - 'beginnerQuests.name:' - 'intermediateQuests.name:' - 'advancedQuests.name:' - 'expertQuests.name:' - 'masteryQuests.name:' - 'CLAIMED:' - 'COMPLETED:' - 'LOCKED:' - 'IN_PROGRESS:')))",
                            "target_property_name": "#button_state"
                        },
                        {
                            "binding_type": "view",
                            "source_property_name": "(#button_state = 'IN_PROGRESS:')",
                            "target_property_name": "#visible"
                        }
                    ]
                }
            },
            {
                "completed_button@quest_book_utils.quest_button": {
                    "collection_index": "$button_index",
                    "$pressed_button_name": "button.form_button_click",
                    "$button_texture": "textures/quest_book/quest_button_completed",
                    "size": [
                        24,
                        24
                    ],
                    "layer": 1,
                    "bindings": [
                        {
                            "binding_type": "collection_details",
                            "binding_collection_name": "form_buttons"
                        },
                        {
                            "binding_name": "#form_button_text",
                            "binding_type": "collection",
                            "binding_collection_name": "form_buttons"
                        },
                        {
                            "binding_type": "view",
                            "source_property_name": "(((#form_button_text - 'beginnerQuests.name:' - 'intermediateQuests.name:' - 'advancedQuests.name:' - 'expertQuests.name:' - 'masteryQuests.name:') - (#form_button_text - 'beginnerQuests.name:' - 'intermediateQuests.name:' - 'advancedQuests.name:' - 'expertQuests.name:' - 'masteryQuests.name:' - 'CLAIMED:' - 'COMPLETED:' - 'LOCKED:' - 'IN_PROGRESS:')))",
                            "target_property_name": "#button_state"
                        },
                        {
                            "binding_type": "view",
                            "source_property_name": "((#button_state = 'COMPLETED:'))",
                            "target_property_name": "#visible"
                        }
                    ]
                }
            }
        ]
    },
    "padding_connection": {
        "type": "panel",
        "size": [
            5,
            24
        ],
        "controls": [
            {
                "padding_connection": {
                    "$connection_type|default": 0,
                    "type": "image",
                    "texture": "$texture",
                    "anchor_to": "top_left",
                    "anchor_from": "top_left",
                    "size": [
                        5,
                        29
                    ],
                    "offset": [
                        0,
                        -5
                    ],
                    "variables": [
                        {
                            "requires": "($connection_type = 0)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_0"
                        },
                        {
                            "requires": "($connection_type = 1)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_1"
                        },
                        {
                            "requires": "($connection_type = 2)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_2"
                        },
                        {
                            "requires": "($connection_type = 3)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_3"
                        }
                    ]
                }
            }
        ]
    },
    "vertical_padding": {
        "type": "panel",
        "size": [
            0,
            5
        ]
    },
    "horizontal_padding": {
        "type": "panel",
        "size": [
            5,
            0
        ]
    },
    "button_icon": {
        "ignored": "($button_icon_texture = '')",
        "$button_icon_texture|default": "",
        "type": "image",
        "texture": "$button_icon_texture",
        "anchor_to": "center",
        "anchor_from": "center",
        "layer": 1,
        "size": [
            16,
            16
        ]
    },
    "quest_button_state_panel": {
        "type": "panel",
        "anchor_to": "center",
        "anchor_from": "center",
        "layer": 1,
        "size": [
            "100%",
            "100%"
        ],
        "$button_alpha|default": 1,
        "$content_alpha|default": 1,
        "$button_image|default": "common_buttons.button_image",
        "$button_icon|default": "quest_book_utils.button_icon",
        "$connection_type|default": 0,
        "$right_connection_type|default": 0,
        "$left_connection_type|default": 0,
        "controls": [
            {
                "button_connection": {
                    "ignored": "($connection_type = 0)",
                    "type": "image",
                    "texture": "$texture",
                    "anchor_to": "top_middle",
                    "anchor_from": "top_middle",
                    "size": [
                        24,
                        5
                    ],
                    "offset": [
                        0,
                        -5
                    ],
                    "variables": [
                        {
                            "requires": "($connection_type = 1)",
                            "$texture": "textures/quest_book/connections/connection_0"
                        },
                        {
                            "requires": "($connection_type = 2)",
                            "$texture": "textures/quest_book/connections/connection_1"
                        },
                        {
                            "requires": "($connection_type = 3)",
                            "$texture": "textures/quest_book/connections/connection_2"
                        },
                        {
                            "requires": "($connection_type = 4)",
                            "$texture": "textures/quest_book/connections/connection_3"
                        },
                        {
                            "requires": "($connection_type = 5)",
                            "$texture": "textures/quest_book/connections/connection_4"
                        },
                        {
                            "requires": "($connection_type = 6)",
                            "$texture": "textures/quest_book/connections/connection_5"
                        },
                        {
                            "requires": "($connection_type = 7)",
                            "$texture": "textures/quest_book/connections/connection_6"
                        }
                    ]
                }
            },
            {
                "right_button_connection": {
                    "ignored": "($right_connection_type = 0)",
                    "type": "image",
                    "texture": "$texture",
                    "anchor_to": "top_left",
                    "anchor_from": "top_left",
                    "size": [
                        5,
                        29
                    ],
                    "offset": [
                        24,
                        -5
                    ],
                    "variables": [
                        {
                            "requires": "($right_connection_type = 1)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_0"
                        },
                        {
                            "requires": "($right_connection_type = 2)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_1"
                        },
                        {
                            "requires": "($right_connection_type = 3)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_2"
                        },
                        {
                            "requires": "($right_connection_type = 4)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_3"
                        }
                    ]
                }
            },
            {
                "left_button_connection": {
                    "ignored": "($left_connection_type = 0)",
                    "type": "image",
                    "texture": "$texture",
                    "anchor_to": "top_left",
                    "anchor_from": "top_left",
                    "size": [
                        5,
                        29
                    ],
                    "offset": [
                        -5,
                        -5
                    ],
                    "variables": [
                        {
                            "requires": "($left_connection_type = 1)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_0"
                        },
                        {
                            "requires": "($left_connection_type = 2)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_1"
                        },
                        {
                            "requires": "($left_connection_type = 3)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_2"
                        },
                        {
                            "requires": "($left_connection_type = 4)",
                            "$texture": "textures/quest_book/connections/button_padding_connection_3"
                        }
                    ]
                }
            },
            {
                "button_image@$button_image": {
                    "type": "image",
                    "anchor_to": "center",
                    "anchor_from": "center",
                    "size": [
                        "100%",
                        "100%"
                    ]
                }
            },
            {
                "button_icon@$button_icon": {
                    "layer": 2
                }
            },
            {
                "hover_text_panel": {
                    "ignored": "(not $hover_state)",
                    "allow_clipping": false,
                    "type": "panel",
                    "anchor_to": "top_left",
                    "anchor_from": "top_left",
                    "size": [
                        "100%c",
                        "100%c"
                    ],
                    "controls": [
                        {
                            "background": {
                                "type": "image",
                                "texture": "textures/quest_book/quest_button_info_background",
                                "size": [
                                    "100%c + 8px",
                                    20
                                ],
                                "offset": [
                                    26,
                                    2
                                ],
                                "controls": [
                                    {
                                        "label": {
                                            "type": "label",
                                            "text_alignment": "left",
                                            "text": "#text",
                                            "offset": [
                                                0,
                                                0
                                            ],
                                            "bindings": [
                                                {
                                                    "binding_name": "#form_button_text",
                                                    "binding_type": "collection",
                                                    "binding_collection_name": "form_buttons"
                                                },
                                                {
                                                    "binding_type": "view",
                                                    "source_property_name": "(#form_button_text - 'beginnerQuests.name:' - 'intermediateQuests.name:' - 'advancedQuests.name:' - 'expertQuests.name:' - 'masteryQuests.name:' - 'CLAIMED:' - 'COMPLETED:' - 'LOCKED:' - 'IN_PROGRESS:')",
                                                    "target_property_name": "#text"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    },
    "quest_button@common.button": {
        "$button_state_panel": "quest_book_utils.quest_button_state_panel",
        "$button_texture|default": "textures/quest_book/quest_button_no_progress.default",
        "locked_control": "locked",
        "$default_state|default": false,
        "$hover_state|default": false,
        "$pressed_state|default": false,
        "controls": [
            {
                "default@$button_state_panel": {
                    "$new_ui_button_texture": "$button_texture",
                    "$content_alpha": 1,
                    "$default_state": true,
                    "layer": 1
                }
            },
            {
                "hover@$button_state_panel": {
                    "$new_ui_button_texture": "$button_texture",
                    "$content_alpha": 1,
                    "$hover_state": true,
                    "layer": 4
                }
            },
            {
                "pressed@$button_state_panel": {
                    "$new_ui_button_texture": "$button_texture",
                    "$content_alpha": 1,
                    "$pressed_state": true,
                    "layer": 5
                }
            },
            {
                "locked@$button_state_panel": {
                    "$new_ui_button_texture": "$button_texture",
                    "$button_image": "common_buttons.locked_button_image",
                    "$content_alpha": 1,
                    "$border_layer": 1,
                    "$locked_state": true,
                    "layer": 1
                }
            }
        ]
    }
}