import{S as d}from"./registerWidgets.4cc86716.js";const k={"answer-sheet-input":{name:"Answer sheet",description:"Retrieve the answers from a test on usual answersheet",type:"answer-sheet-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:200,minHeight:350,initialWidth:200,initialHeight:350},pythonAPI:{name:"read_answer_sheet",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Answer Sheet Title"'},{argName:"options",description:"The options which can be chosen as an answer",typeName:"list",typeDescription:["list[str]"],isKwarg:!1,default:'["A", "B", "C", "D", "E"]',dashesInitialValue:'["A", "B", "C", "D", "E"]'},{argName:"number_of_questions",description:"Number of questions the answersheet will cover",typeName:"int",isKwarg:!1,default:"5",dashesInitialValue:"5"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"list: The values/value selected by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"options",typeName:"array",description:"The options which can be chosen as an answer"},{argName:"numberOfQuestions",typeName:"number",description:"Number of questions the answersheet will cover"},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"SAT - 2023",options:["A","B","C","D","E"],numberOfQuestions:5},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_answer_sheet",key:"example1",code:`from abstra.forms import read_answer_sheet

answer_sheet = read_answer_sheet("SAT - 2023", ["A", "B", "C", "D", "E"], 5)
# answer_sheet = { '1': 'A', '2': None, '3': 'C' }
`}]},"cards-input":{name:"Card display",description:"Read a text value from the user simple text input",type:"cards-input",autoHeight:!0,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]},{key:"card-click",description:"Function or expression to be run when a card is clicked",payloadSchema:[{key:"card",typeName:"Object",description:"The card that was clicked"}]}],dashProperties:{minWidth:200,minHeight:200,initialWidth:400,initialHeight:350},pythonAPI:{name:"read_cards",params:[{argName:"label",description:"The text related to this input",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Card Title"'},{argName:"options",description:`The options to display to the user, eg. [
{'title': 'Option 1', 'subtitle': 'Subtitle 1', 'image': 'https://image_1.png', 'description': 'option 1 description', 'topLeftExtra': 'Left 1', 'topRightExtra': 'Right 1' },
{'title': 'Option 2', 'subtitle': 'Subtitle 2', 'image': 'https://image_2.png', 'description': 'option 2 description', 'topLeftExtra': 'Left 2', 'topRightExtra': 'Right 2' }]`,typeName:"list",typeDescription:["list[AbstraCard]"],isKwarg:!1,default:null,dashesInitialValue:`[
          {
            "title": "Option 1",
            "subtitle": "Subtitle 1",
            "image": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Mona_Lisa.jpg/396px-Mona_Lisa.jpg",
            "description": "option 1 description",
            "topLeftExtra": "Left 1",
            "topRightExtra": "Right 1",
          }
        ]`},{argName:"multiple",description:"Whether the user can select multiple options. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"initial_value",description:"The initial value to display to the user. Defaults to None.",typeName:"list",typeDescription:["list[AbstraCard]"],isKwarg:!0,default:"None",formOnly:!0},{argName:"searchable",description:"Whether to show a search bar. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"layout",description:"Whether the cards layout should be 'list' or 'grid'. Defaults to 'list'. The 'grid' only applies to desktop resolutions.",typeName:"str",typeDescription:["str ('list', 'grid')"],isKwarg:!0,default:"'list'"},{argName:"columns",typeName:"int",description:"When layout is 'grid', how many columns to display",isKwarg:!0,default:"2"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"list, any: The options/option selected by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"options",typeName:"array",description:"The options that the user can select from",items:{typeName:"object",properties:[{argName:"title",typeName:"string",description:""},{argName:"subtitle",typeName:"string",description:""},{argName:"image",typeName:"string",description:""},{argName:"description",typeName:"string",description:""},{argName:"topLeftExtra",typeName:"string",description:""},{argName:"topRightExtra",typeName:"string",description:""}]}},{argName:"multiple",typeName:"boolean",description:"Whether the input can have multiple values",default:!1,isOptional:!0},{argName:"searchable",typeName:"boolean",description:"Display a search input",isOptional:!0},{argName:"initialValue",typeName:["object","array","null"],description:"The initial value of the input",isOptional:!0,items:{typeName:"object",properties:[{argName:"title",typeName:"string",description:""},{argName:"image",typeName:"string",description:""},{argName:"description",typeName:"string",description:""}],default:null}},{argName:"layout",typeName:"string",description:"Whether the cards layout should be 'list' or 'grid'. Defaults to 'list'. The 'grid' only applies to desktop resolutions.",oneOf:["list","grid"],default:"list",isOptional:!0},{argName:"columns",typeName:"number",description:"When layout is 'grid', how many columns to display",isOptional:!0,default:"2"},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Choose your character",options:[{title:"Bulbasaur",subtitle:"Grass / Poison",image:"https://assets.pokemon.com/assets/cms2/img/pokedex/full/001.png",description:"There is a plant seed on its back right from the day this Pok\xE9mon is born. The seed slowly grows larger.",topLeftExtra:"N\xBA",topRightExtra:"001"},{title:"Charmander",subtitle:"Fire",image:"https://assets.pokemon.com/assets/cms2/img/pokedex/full/004.png",description:"It has a preference for hot things. When it rains, steam is said to spout from the tip of its tail.",topLeftExtra:"N\xBA",topRightExtra:"004"},{title:"Squirtle",subtitle:"Water",image:"https://assets.pokemon.com/assets/cms2/img/pokedex/full/007.png",description:"When it retracts its long neck into its shell, it squirts out water with vigorous force.",topLeftExtra:"N\xBA",topRightExtra:"007"}]},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_cards",key:"example1",code:`from abstra.forms import read_cards

card = read_cards(
    "Choose your character",
    [
        {
            "title": "Bulbasaur",
            "subtitle": "Grass / Poison",
            "image": "https://assets.pokemon.com/assets/cms2/img/pokedex/full/001.png",
            "description": "There is a plant seed on its back right from the day this Pok\xE9mon is born. The seed slowly grows larger.",
            "topLeftExtra": "N\xBA",
            "topRightExtra": "001",
        },
        {
            "title": "Charmander",
            "subtitle": "Fire",
            "image": "https://assets.pokemon.com/assets/cms2/img/pokedex/full/004.png",
            "description": "It has a preference for hot things. When it rains, steam is said to spout from the tip of its tail.",
            "topLeftExtra": "N\xBA",
            "topRightExtra": "004",
        },
        {
            "title": "Squirtle",
            "subtitle": "Water",
            "image": "https://assets.pokemon.com/assets/cms2/img/pokedex/full/007.png",
            "description": "When it retracts its long neck into its shell, it squirts out water with vigorous force.",
            "topLeftExtra": "N\xBA",
            "topRightExtra": "007",
        },
    ],
)
# card = { 'title': ..., 'subtitle': ..., 'image': ..., 'description': ..., 'topLeftExtra': ..., 'topRightExtra': ... }
`}]},"checkbox-input":{name:"Checkbox",description:"Allow users to select an option by interacting with a checkbox",type:"checkbox-input",autoHeight:!0,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],dashProperties:{minWidth:60,minHeight:32,initialWidth:222,initialHeight:32},pythonAPI:{name:"read_checkbox",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Choose your option"'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None",formOnly:!0},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"list(str) or list(float): The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"any",description:"The initial value of the input",items:{typeName:["string","number"]},default:null,isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"I have read and agree to the terms of services"},name:"Basic Example",description:"Basic use of read_checkbox",key:"example1",code:`from abstra.forms import read_checkbox

ans = read_checkbox("I have read and agree to the terms of services")

print(ans)
`},{props:{label:"Would you like to receive product updates and announcements via email?"},name:"Optional field",description:"If check the box is optional, pass the optional parameter required",key:"example2",code:`from abstra.forms import read_checkbox

ans = read_checkbox(
    "Would you like to receive product updates and announcements via email?",
    required=False,
)

print(ans)
`},{props:{label:"I have read and agree to the [terms of services](https://example.com)"},name:"Use markdown to customize label",description:"Use markdown syntax to customize the label",key:"example3",code:`from abstra.forms import read_checkbox

ans = read_checkbox(
    "I have read and agree to the [terms of services](https://example.com)"
)
`}]},"checklist-input":{name:"Checkilst",description:"Show a checklist for users to select items",type:"checklist-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:60,minHeight:32,initialWidth:222,initialHeight:112},pythonAPI:{name:"read_checklist",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Choose your option"'},{argName:"options",description:"The options to display to the user, eg. ['Option 1', 'Option 2'] or [{'label': 'Option 1', 'value': '1'}, {'label': 'Option 2', 'value': '2'}]",typeName:"list",typeDescription:["list[AbstraOption]"],isKwarg:!1,default:null,dashesInitialValue:`[
    {
      "label": "Option 1",
      "value": 1,
    },
    {
      "label": "Option 2",
      "value": 2,
    },
  ]`},{argName:"initial_value",description:"The initial value to display to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None",formOnly:!0},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"list or any: The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"any",description:"The initial value of the input",items:{typeName:["string","number"]},default:null,isOptional:!0},{argName:"options",typeName:"array",description:"The options that the user can select from",items:{typeName:["string","object"],properties:[{argName:"key",typeName:"string",description:"The key of the option on the returning object"},{argName:"value",typeName:"any",description:"The value of the option on the returning object"}]}},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Which programming language have you worked with?",options:["Python","JavaScript","Go","Elixir","Haskell"]},name:"Basic Example",description:"Basic use of read_checklist",key:"example1",code:`from abstra.forms import read_checklist

ans = read_checklist(
    "Which programming language have you worked with?",
    ["Python", "JavaScript", "Go", "Elixir", "Haskell"],
)
`},{props:{label:"What are the solutions to the equation x^2 + 3x + 2 = 0?",options:[{label:"-1",value:"a"},{label:"-2",value:"b"},{label:"0 and -1",value:"c"},{label:"0 and 1",value:"d"},{label:"None of the above",value:"e"}]},name:"Label and value dict",description:"Use a dictionary to specify the label and value of each option. The label will be displayed to the user, and the value will be returned by the widget.",key:"example2",code:`from abstra.forms import read_checklist

ans = read_checklist(
    "What are the solutions to the equation x^2 + 3x + 2 = 0?",
    [
        {"label": "-1", "value": "a"},
        {"label": "-2", "value": "b"},
        {"label": "0 and -1", "value": "c"},
        {"label": "0 and 1", "value": "d"},
        {"label": "None of the above", "value": "e"},
    ],
)

# ans = ["a", "b"]
`},{props:{label:"",options:[{label:"I have read and agree to the [terms of services](https://example.com)",value:"agree"}]},name:"Use markdown in options",description:"Use markdown syntax to customize the options.",key:"example3",code:`from abstra.forms import read_checklist

ans = read_checklist(
    "",
    [
        {
            "label": "I have read and agree to the [terms of services](https://example.com)",
            "value": "agree",
        },
    ],
)
`}]},"click-input":{name:"Button",description:"Buttons allow users to trigger actions.",type:"click-input",autoHeight:!0,events:[{key:"click",description:"Function or expression to be run when the button is clicked",payloadSchema:[]}],dashOnly:!0,dashProperties:{minWidth:60,minHeight:62,initialWidth:140,initialHeight:62},pythonAPI:{name:"read_click",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Click here!"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"list(str) or list(float): The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Send"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_click",key:"example1",code:""}]},"cnpj-input":{name:"CNPJ input",description:"Allow users to insert a CNPJ number into the app.",type:"cnpj-input",autoHeight:!0,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],dashProperties:{minWidth:222,minHeight:70,initialWidth:222,initialHeight:112},pythonAPI:{name:"read_cnpj",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert your CNPJ here!"'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to None.",typeName:"str",typeDescription:["str (00.000.000/0001-00)"],isKwarg:!0,default:"None",formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "00.000.000/0001-00".',typeName:"str",typeDescription:["str (00.000.000/0001-00)"],isKwarg:!0,default:'"00.000.000/0001-00"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"list(str) or list(float): The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:"",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input",default:"00.000.000/0001-00"}]},examples:[{props:{label:"Insert your CNPJ below"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_cnpj",key:"example1",code:`from abstra.forms import read_cnpj

name = read_cnpj("Insert your CNPJ below")
`}]},"code-input":{name:"Code input",description:"Code input allow users to insert code and reads it.",type:"code-input",autoHeight:!1,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],dashProperties:{minWidth:377,minHeight:552,initialWidth:377,initialHeight:552},pythonAPI:{name:"read_code",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Send your code here!"'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""',formOnly:!0},{argName:"language",description:"The programming language. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"str",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"language",typeName:"string",description:"Programming language for syntax highlighting",isOptional:!0},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:"",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Show me the code!",language:"c",initialValue:`#include<stdio.h>
int main(int argc, char** argv) {
char name[256];
scanf("%s", name);
printf("%s, here is", name);
}`},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_code",key:"example1",code:`from abstra.forms import read_code

ans = read_code("Show me the code!", language="c")
`}]},"cpf-input":{name:"CPF input",description:"Allow users to insert a CPF number into the app.",type:"cpf-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:222,minHeight:70,initialWidth:222,initialHeight:112},pythonAPI:{name:"read_cpf",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert your CPF here!"'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",typeDescription:["str (000.000.000-00)"],isKwarg:!0,default:'""',formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "000.000.000-00".',typeName:"str",typeDescription:["str (000.000.000-00)"],isKwarg:!0,default:'"000.000.000-00"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"str",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:"",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input",default:"000.000.000-00"}]},examples:[{props:{label:"Insert your CPF below"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_cpf",key:"example1",code:`from abstra.forms import read_cpf

name = read_cpf("Insert your CPF below")
`}]},"currency-input":{name:"Currency input",description:"Currency input allows users to enter monetary values.",type:"currency-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:100,minHeight:72,initialWidth:300,initialHeight:112},pythonAPI:{name:"read_currency",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert the proper amount."'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to 0.",typeName:"str",isKwarg:!0,default:"0",formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "Insert the amount here".',typeName:"str",isKwarg:!0,default:'"Insert the amount here"'},{argName:"min",description:'The minimum value allowed, eg. "0". Defaults to None.',typeName:"float",isKwarg:!0,default:"None"},{argName:"max",description:'The maximum value allowed, eg. "100". Defaults to None.',typeName:"float",isKwarg:!0,default:"None"},{argName:"step",description:"The value to be incremented or decremented while using the input button. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"currency",description:'The currency to display to the user, eg. "USD", "BRL, "EUR", "GBP". Defaults to "USD".',typeName:"str",isKwarg:!0,default:'"USD"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"float",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"currency",typeName:"string",description:"The currency to use"},{argName:"initialValue",typeName:"number",description:"The initial value of the input",default:"",isOptional:!0},{argName:"min",typeName:"number",description:"The minimum value of the input",isOptional:!0},{argName:"max",typeName:"number",description:"The maximun value of the input",isOptional:!0},{argName:"step",typeName:"number",description:"The step for the input",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input"}]},examples:[{props:{label:"How many credits do you want?",initialValue:10,min:10,currency:"USD"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_currency",key:"example1",code:`from abstra.forms import read_currency

read_currency(
    f"How many credits do you want?", currency="USD", initial_value=10, min=10
)
`}]},"custom-input":{type:"custom-input",name:"Custom widget",description:"Widget with customizable UI and behaviour",autoHeight:!1,events:[{key:"custom-event",description:"Function or expression to be run when custom event is triggered",payloadSchema:[]},{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],dashProperties:{minWidth:65,minHeight:30,initialWidth:146,initialHeight:32},pythonAPI:{name:"read_custom",params:[{argName:"html_body",description:"The HTML body content",typeName:"str",typeDescription:["str (HTML snippet)"],isKwarg:!1,default:null,dashesInitialValue:'"<h1>Hello World</h1>"'},{argName:"initial_value",description:"The initial value to be stored in custom widget state.",typeName:"Any",isKwarg:!0,default:null,formOnly:!0},{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!0,default:null},{argName:"html_head",description:"The HTML head content",typeName:"str",typeDescription:["str (HTML snippet)"],isKwarg:!0,default:null,dashesInitialValue:'""'},{argName:"css",description:"The widget's CSS",typeName:"str",typeDescription:["str (CSS snippet)"],isKwarg:!0,default:null,dashesInitialValue:'"h1 { color: red; }"'},{argName:"js",description:"The widget's JavaScript",typeName:"str",typeDescription:["str (JavaScript snippet)"],isKwarg:!0,default:null,dashesInitialValue:`"console.log('Hello World')"`},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"any: The custom response"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display to the user",isOptional:!0},{argName:"initialValue",typeName:"any",description:"The initial value to be stored in custom widget state.",default:null,isOptional:!0},{argName:"htmlHead",typeName:"string",description:"The HTML head content",isOptional:!0},{argName:"htmlBody",typeName:"string",description:"The HTML body content"},{argName:"css",typeName:"string",description:"The widget's CSS",isOptional:!0},{argName:"js",typeName:"string",description:"The widget's JavaScript",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{htmlBody:"<button id='date-btn'>Get current date</button>",js:`document.getElementById('date-btn').addEventListener('click',function() {
    const date = new Date();
    const day = date.getDate();
    const month = date.getMonth() + 1;
    const year = date.getFullYear();

    changeEvent(day + '/' + month + '/' + year);
});`,css:`body {
    margin: 0;
    padding: 0;
}

#date-btn {
    cursor: pointer;
    background-color: #343b46;
    border: none;
    border-radius: 4px;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
}

#date-btn:hover {
    background-color: #3e4756;
}`,label:"Custom Widget"},name:"Basic Example",description:"The following example shows how to create a custom widget with a button that returns the current date.",key:"example1",code:`from abstra.forms import read_custom

current_date = read_custom(
    "<button id='date-btn'>Get current date</button>",
    label="Custom Widget",
    js="""
    document.getElementById('date-btn').addEventListener('click',function() {
        const date = new Date();
        const day = date.getDate();
        const month = date.getMonth() + 1;
        const year = date.getFullYear();

        changeEvent(day + '/' + month + '/' + year);
    });
    """,
    css="""
    body {
        margin: 0;
        padding: 0;
    }

    #date-btn {
        cursor: pointer;
        background-color: #343b46;
        border: none;
        border-radius: 4px;
        color: white;
        padding: 15px 32px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 16px;
    }

    #date-btn:hover {
        background-color: #3e4756;
    }
    """,
)
`}]},"date-input":{name:"Date picker input",description:"Allow users to select  a date, or a range of dates.*",type:"date-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:200,minHeight:72,initialWidth:300,initialHeight:112},pythonAPI:{name:"read_date",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Pick a date of your preference."'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to None.",typeName:"Union[datetime.date, time.struct_time, str]",typeDescription:["datetime.date","time.struct_time","str (YYYY-MM-DD)"],isKwarg:!0,default:"None",formOnly:!0},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"datetime.date",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:null},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"When were you born?"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_date",key:"example1",code:`from abstra.forms import read_date

birthday = read_date("When were you born?")
year = birthday.year
month = birthday.month
day = birthday.day
`}]},"dropdown-input":{name:"Dropdown",description:"Allow users to select one or more options by selecting items in a dropdown",type:"dropdown-input",autoHeight:!0,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],dashProperties:{minWidth:60,minHeight:60,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_dropdown",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Select your preference"'},{argName:"options",description:"The options to display to the user, eg. ['Option 1', 'Option 2'] or [{'label': 'Option 1', 'value': '1'}, {'label': 'Option 2', 'value': '2'}]",typeName:"list",typeDescription:["list[AbstraOption]"],isKwarg:!1,default:null,dashesInitialValue:`[
    {
      "label": "Option 1",
      "value": 1,
    },
    {
      "label": "Option 2",
      "value": 2,
    },
  ]`},{argName:"multiple",description:"Whether the user can select multiple options. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"initial_value",description:"The initial value to display to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None",formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "Choose an option".',typeName:"str",isKwarg:!0,default:'"Choose an option"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"str",typeDescription:"The value selected by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"initialValue",typeName:"any",description:"The initial value of the input",items:{typeName:["string","number"]},isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"options",typeName:"array",description:"The options that the user can select from",items:{typeName:["string","object"],properties:[{argName:"key",typeName:"string",description:"The key of the option on the returning object"},{argName:"value",typeName:"any",description:"The value of the option on the returning object"}]}},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input"},{argName:"multiple",typeName:"boolean",description:"Whether the input accepts multiple values or not",isOptional:!0}]},examples:[{props:{label:"Choose a color",options:["Red","Green","Blue"]},name:"Basic Example",description:"Basic use of read_dropdown",key:"example1",code:`from abstra.forms import read_dropdown

ans = read_dropdown(
    "Choose a color",
    ["Red", "Green", "Blue"],
)
# ans = "Red", "Green" or "Blue"
`},{props:{label:"Choose a color",options:["Red","Green","Blue"]},name:"Label and value dict",description:"Use a dictionary to specify the label and value of each option. The label will be displayed to the user, and the value will be returned by the widget.",key:"example2",code:`from abstra.forms import read_dropdown

ans = read_dropdown(
    "Choose a color",
    [
        {"label": "Red", "value": "R"},
        {"label": "Green", "value": "G"},
        {"label": "Blue", "value": "B"},
    ],
)
# ans = "R", "G" or "B"
`}]},"email-input":{name:"Email input",description:"Email input allow users to enter a valid email address.",type:"email-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:220,minHeight:60,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_email",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert your email"'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""',formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "Your email here".',typeName:"str",isKwarg:!0,default:'"Your email here"'},{argName:"invalid_email_message",typeName:"str",description:"Invalid e-mail message",isKwarg:!0,default:`"Hmm\u2026 doesn't look like an email"`},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"str",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"invalidEmailMessage",typeName:"string",description:"Invalid e-mail message",default:"Hmm\u2026 doesn't look like an email"},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:"",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input"}]},examples:[{props:{label:"What is your email?"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_email",key:"example1",code:`from abstra.forms import read_email

email = read_email("What is your email?")
`}]},"file-input":{name:"File upload area",description:"File upload adds a drop-area for users to upload one or more files",type:"file-input",autoHeight:!1,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],dashProperties:{minWidth:150,minHeight:112,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_file",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Upload a file."'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""',formOnly:!0},{argName:"multiple",description:"Whether the user will be allowed to upload multiple files. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"max_file_size",description:"Maximum size allowed to be transfered in total in MB.",typeName:"float",isKwarg:!0,default:"None"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"Union[FileResponse, List[FileResponse]]",typeDescription:"A dict containing the file uploaded by the user FileResponse(file: TemporaryFile, url: str, content: bytes) or a list of FileResponses in case of multiple flag set as True. \u26A0\uFE0F The url expires after 48 hours"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"initialValue",typeName:["string","array","null"],description:"The initial value of the input",default:""},{argName:"multiple",description:"Whether the user will be allowed to upload multiple files. Defaults to False.",typeName:"boolean",default:"False"},{argName:"maxFileSize",description:"Maximum size allowed to be transfered in total in MB.",typeName:"number",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Upload your .xlsx file"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_file",key:"example1",code:`from abstra.forms import read_file

file_response = read_file("Upload your .xlsx file")
file = file_response.file  # File object
`},{props:{label:"Upload your file"},name:"Saving file to a directory on Files storage",description:"This example shows how to save a file to a directory on Files",key:"example2",code:`from abstra.forms import read_file
import shutil, os

file_response = read_file("Upload your file")

destination_dir = "foo/bar/"
# Creates directory if it does not exist
os.makedirs(destination_dir, exist_ok=True)

# Copies file to destination directory
shutil.copy(file_response.file.name, destination_dir + file_response.name)
`}]},"image-input":{name:"Image upload",description:"Image upload adds a drop-area for users to upload one or more image files.",type:"image-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!1,dashProperties:{minWidth:150,minHeight:112,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_image",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Upload"'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""',formOnly:!0},{argName:"multiple",description:"Whether the user will be allowed to upload multiple files. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"max_file_size",description:"Maximum size allowed to be transfered in total in MB.",typeName:"float",isKwarg:!0,default:"None"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"Union[FileResponse, List[FileResponse]]",typeDescription:'A dict containing the image file uploaded by the user ({"file": file, "url": str, "content": bytes}) or a list of images in case of multiple flag set as True'}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"initialValue",typeName:["string","array"],description:"The initial value of the input",default:"",isOptional:!0,items:{typeName:"string"}},{argName:"maxFileSize",description:"Maximum size allowed to be transfered in total in MB.",typeName:"number",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"multiple",typeName:"boolean",description:"Whether the input accepts multiple values or not",isOptional:!0}]},examples:[{props:{label:"Upload your .png image"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_image",key:"example1",code:`from abstra.forms import read_image

file_response = read_image("Upload your .png image")
file = file_response.file  # File object
`}]},"kanban-board-input":{name:"Kanban board",description:"Kanban board",type:"kanban-board-input",dashOnly:!0,events:[],autoHeight:!1,dashProperties:{minWidth:300,minHeight:500,initialWidth:500,initialHeight:500},pythonAPI:{name:"read_kanban_board",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null},{argName:"initial_value",description:"The initial board state.",typeName:"KanbanBoard",isKwarg:!0,default:null,formOnly:!0}],returns:[{typeName:null,typeDescription:"KanbanBoard object containing all stages and cards"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"object",description:"The initial board state."},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{initialValue:{type:"kanban-board",stages:[{type:"kanban-stage",name:"Backlog",cards:[{type:"kanban-card",name:"Add a new feature #1",description:"Add a new feature to the product",tags:["feature","enhancement"]},{type:"kanban-card",name:"Fix a bug #2",description:"Fix a bug in the product",tags:["bug"]}]},{type:"kanban-stage",name:"In progress",cards:[{type:"kanban-card",name:"Add a new feature #3",description:"Add a new feature to the product",tags:["feature","enhancement"]},{type:"kanban-card",name:"Fix a bug #4",description:"Fix a bug in the product",tags:["bug"]}]},{type:"kanban-stage",name:"Done",cards:[{type:"kanban-card",name:"Add a new feature #5",description:"Add a new feature to the product",tags:["feature","enhancement"]},{type:"kanban-card",name:"Fix a bug #6",description:"Fix a bug in the product",tags:["bug"]}]}]},label:"Spring backlog"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_kanban_board",key:"example1",code:`import abstra.forms as hf

board = {
    "type": "kanban-board",
    "stages": [
        {
            "type": "kanban-stage",
            "name": "Backlog",
            "cards": [
                {
                    "type": "kanban-card",
                    "name": "Add a new feature #1",
                    "description": "Add a new feature to the product",
                    "tags": ["feature", "enhancement"],
                },
                {
                    "type": "kanban-card",
                    "name": "Fix a bug #2",
                    "description": "Fix a bug in the product",
                    "tags": ["bug"],
                },
            ],
        },
        {
            "type": "kanban-stage",
            "name": "In progress",
            "cards": [
                {
                    "type": "kanban-card",
                    "name": "Add a new feature #3",
                    "description": "Add a new feature to the product",
                    "tags": ["feature", "enhancement"],
                },
                {
                    "type": "kanban-card",
                    "name": "Fix a bug #4",
                    "description": "Fix a bug in the product",
                    "tags": ["bug"],
                },
            ],
        },
        {
            "type": "kanban-stage",
            "name": "Done",
            "cards": [
                {
                    "type": "kanban-card",
                    "name": "Add a new feature #5",
                    "description": "Add a new feature to the product",
                    "tags": ["feature", "enhancement"],
                },
                {
                    "type": "kanban-card",
                    "name": "Fix a bug #6",
                    "description": "Fix a bug in the product",
                    "tags": ["bug"],
                },
            ],
        },
    ],
}

hf.read_kanban_board(label="Product spring", initial_value=board)
`}]},"list-input":{name:"List of inputs",description:"Read a list value from the user",type:"list-input",formOnly:!0,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:146,minHeight:32,initialWidth:146,initialHeight:32},pythonAPI:{name:"read_list",params:[{argName:"item_schema",description:"The schema for the items of the list",typeName:"Any",isKwarg:!1,default:null},{argName:"initial_value",description:"The initial value to display to the user. Defaults to [{}].",typeName:"Any",isKwarg:!0,default:"[{}]",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"min",description:"Min value accepted by the input. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"max",description:"Max value accepted by the input. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"add_button_text",description:'Label to be displayed on the add button. Defaults to "+".',typeName:"str",isKwarg:!0,default:'"+"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"list",typeDescription:"The values entered by the user"}]},brokerAPI:{params:[{argName:"itemSchema",typeName:"any",description:""},{argName:"initialValue",typeName:"array",description:"",default:[{}],isOptional:!0},{argName:"min",typeName:"number",description:"The minimum number of items to allow",default:"",isOptional:!0},{argName:"max",typeName:"number",description:"The maximum number of items to allow",default:"",isOptional:!0},{argName:"addButtonText",typeName:"string",description:"The text to display on the add button",isOptional:!0},{argName:"overloadedItemSchemas",typeName:"any",description:"",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{initialValue:[{}],min:1,max:3,itemSchema:[{hint:null,initialValue:"",key:"Name",label:"Name",placeholder:"Your answer here",required:!0,type:"text-input"},{hint:null,initialValue:"",key:"Email",label:"Email",placeholder:"Your answer here",required:!0,type:"email-input"}]},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_list",key:"example1",code:`from abstra.forms import ListItemSchema, read_list

item = ListItemSchema().read("Name").read_email("Email")
ans = read_list(item, min=1, max=3)
# ans = [{'Name': '', 'Email': ''}]
`}]},"multiple-choice-input":{name:"Multiple choice",description:"Read a multiple choice value from the user",type:"multiple-choice-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:60,minHeight:70,initialWidth:223,initialHeight:152},pythonAPI:{name:"read_multiple_choice",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Select your choices"'},{argName:"options",description:"The options to display to the user, eg. ['Option 1', 'Option 2'] or [{'label': 'Option 1', 'value': '1'}, {'label': 'Option 2', 'value': '2'}]",typeName:"list",typeDescription:["list[AbstraOption]"],isKwarg:!1,default:null,dashesInitialValue:`[
    {
      "label": "Option 1",
      "value": 1,
    },
    {
      "label": "Option 2",
      "value": 2,
    },
  ]`},{argName:"multiple",description:"Whether the user can select multiple options. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"min",description:"The minimal amount of options that should be selected. Defaults to None.",typeName:"number",isKwarg:!0,default:"None"},{argName:"max",description:"The maximum amount of options that should be selected. Defaults to None.",typeName:"number",isKwarg:!0,default:"None"},{argName:"initial_value",description:"The initial value to display to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None",formOnly:!0},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"list or any: The values/value selected by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"multiple",typeName:"boolean",description:"Whether the input should accept multiple answers",default:!1,isOptional:!0},{argName:"initialValue",typeName:"any",description:"The initial value of the input",items:{typeName:["string","number"]},default:null,isOptional:!0},{argName:"min",typeName:"number",description:"The minimum number of items to allow",default:"",isOptional:!0},{argName:"max",typeName:"number",description:"The maximum number of items to allow",default:"",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"options",typeName:"array",description:"The options that the user can select from",items:{typeName:["string","object"],properties:[{argName:"key",typeName:"string",description:"The key of the option on the returning object"},{argName:"value",typeName:"any",description:"The value of the option on the returning object"}]}}]},examples:[{props:{label:"Which programming language do you prefer?",options:["Python","JavaScript"]},name:"Basic Example",description:"Basic use of read_multiple_choice",key:"example1",code:`from abstra.forms import read_multiple_choice

ans = read_multiple_choice(
    "Which programming language do you prefer?",
    ["Python", "JavaScript"],
)
# ans = "Python" or "JavaScript"
`},{props:{label:"Which programming language do you prefer?",options:["Python","JavaScript"]},name:"Label and value dict",description:"Use a dictionary to specify the label and value of each option. The label will be displayed to the user, and the value will be returned by the widget.",key:"example2",code:`from abstra.forms import read_multiple_choice

ans = read_multiple_choice(
    "Which programming language do you prefer?",
    [{"label": " Python", "value": "py"}, {"label": "JavaScript", "value": "js"}],
)
# ans = "py" or "js"
`},{props:{label:"What features do you love?",options:["forms","jobs","hooks"],multiple:!0},name:"Checkboxes",description:"Use `multiple=true` when you want allow users to select more than one option. This will make it returns a list.",key:"example3",code:`from abstra.forms import read_multiple_choice

ans = read_multiple_choice(
    "What features do you love?", ["forms", "jobs", "hooks"], multiple=True
)
# ans = ["forms", "jobs", "hooks"]
`}]},"nps-input":{name:"NPS feedback",description:"NPS feedback allow users to rank their experience from 0 to 10.",type:"nps-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:120,minHeight:60,initialWidth:608,initialHeight:112},pythonAPI:{name:"read_nps",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Rate us!"'},{argName:"min",description:"Min value accepted by the input. Defaults to 0.",typeName:"int",isKwarg:!0,default:"0"},{argName:"max",description:"Max value accepted by the input. Defaults to 10.",typeName:"int",isKwarg:!0,default:"10"},{argName:"min_hint",description:'Text to display next to the min value. Defaults to "Not at all likely".',typeName:"str",isKwarg:!0,default:'"Not at all likely"'},{argName:"max_hint",description:'Text to display next to the max value. Defaults to "Extremely likely".',typeName:"str",isKwarg:!0,default:'"Extremely likely"'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to None.",typeName:"str",typeDescription:["str (nps format)"],isKwarg:!0,default:"None",formOnly:!0},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"int",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"min",typeName:"number",description:"Minimum value of NPS",default:0,isOptional:!0},{argName:"max",typeName:"number",description:"Maximum value of NPS",default:10,isOptional:!0},{argName:"minHint",typeName:"string",description:"Hint of minimum option",default:"Not at all likely",isOptional:!0},{argName:"maxHint",typeName:"string",description:"Hint of maximum option",default:"Extremely likely",isOptional:!0},{argName:"initialValue",typeName:"number",description:"The initial value of the input",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"How likely are you to recommend Abstra Cloud?",minHint:"No way!",maxHint:"Hell yeah!"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_nps",key:"example1",code:`from abstra.forms import read_nps

ans = read_nps(
    "How likely are you to recommend Abstra Cloud?",
    min_hint="No way!",
    max_hint="Hell yeah!",
)
`}]},"number-input":{name:"Number input",description:"Number input allow users to enter numeric values.",type:"number-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:120,minHeight:60,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_number",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Number"'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to 0.",typeName:"str",isKwarg:!0,default:"0",formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "Insert a number".',typeName:"str",isKwarg:!0,default:'"Insert a number"'},{argName:"min",description:"Min value accepted by the input. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"max",description:"Max value accepted by the input. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"step",description:"The value to be incremented or decremented while using the input button. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"float",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"initialValue",typeName:"number",description:"The initial value of the input",isOptional:!0},{argName:"min",typeName:"number",description:"The minimum value of the input",isOptional:!0},{argName:"max",typeName:"number",description:"The maximun value of the input",isOptional:!0},{argName:"step",typeName:"number",description:"The step for the input",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input",default:"Insert a number"}]},examples:[{props:{label:"How old are you?"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_number",key:"example1",code:`from abstra.forms import read_number

age = read_number("How old are you?")
`}]},"number-slider-input":{name:"Number slider",description:"Allow users to select values in a slider bar. ",type:"number-slider-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:120,minHeight:30,initialWidth:223,initialHeight:72},pythonAPI:{name:"read_number_slider",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Select a value!"'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to 0.",typeName:"float",isKwarg:!0,default:"0",formOnly:!0},{argName:"min",description:"Min value accepted by the input. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"max",description:"Max value accepted by the input. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"step",description:"The value to be incremented or decremented while using the input button. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"float",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label to display above the input"},{argName:"initialValue",typeName:"number",description:"The initial value of the input",isOptional:!0},{argName:"min",typeName:"number",description:"The minimum value of the input",isOptional:!0},{argName:"max",typeName:"number",description:"The maximun value of the input",isOptional:!0},{argName:"step",typeName:"number",description:"The step for the input",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Set volume"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_number",key:"example1",code:`from hackeforms import read_number_slider

age = read_number_slider("Set volume")
`}]},"pandas-row-selection-input":{name:"Table + selection",description:"Display a pandas dataframe as a table and allow the user to select rows",type:"pandas-row-selection-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!1,dashProperties:{minWidth:195,minHeight:72,initialWidth:245,initialHeight:72},pythonAPI:{name:"read_pandas_row_selection",params:[{argName:"df",description:"The pandas dataframe to be displayed",typeName:"PandasDataFrame",isKwarg:!1,default:null,dashesInitialValue:"pandas.Series([1, 3, 5, 4, 6, 8])"},{argName:"display_index",description:"Whether to show a index column. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!0,default:null},{argName:"multiple",description:"Whether the user will be allowed to select multiple rows. Defaults to True.",typeName:"bool",isKwarg:!0,default:"True"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"list",typeDescription:"The list of selected rows"}]},brokerAPI:{params:[{argName:"table",typeName:"object",description:"",properties:[{argName:"data",typeName:"array",description:""},{argName:"schema",typeName:"object",description:"",properties:[{argName:"fields",typeName:"array",description:""}]}]},{argName:"displayIndex",typeName:"boolean",description:"",default:!1},{argName:"label",typeName:"string",description:"The label to display above the input",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"multiple",typeName:"boolean",description:"Whether the input accepts multiple values or not",isOptional:!0}]},examples:[{props:{table:{schema:{fields:[{name:"Country",type:"string"},{name:"Population",type:"number"}],primaryKey:["Country"]},data:[{Country:"USA",Population:"32,700,000"},{Country:"China",Population:"1,300,000,000"},{Country:"Japan",Population:"126,000,000"}]}},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_pandas",key:"example1",code:`from abstra.forms import read_pandas_row_selection
import pandas as pd

data = [
    {"Country": "USA", "Population": "32,700,000"},
    {"Country": "China", "Population": "1,300,000,000"},
    {"Country": "Japan", "Population": "126,000,000"},
]
df = pd.DataFrame(data)
read_pandas_row_selection(df)
`}]},"password-input":{name:"Password input",type:"password-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,description:"Password input allow users to enter a password before seen the content.",dashProperties:{minWidth:120,minHeight:60,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_password",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert Your password"'},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""'},{argName:"lowercase_required",description:"Whether the input must have at least one lowercase character. Defaults to True.",typeName:"bool",isKwarg:!0,default:"True"},{argName:"uppercase_required",description:"Whether the input must have at least one uppercase character. Defaults to True.",typeName:"bool",isKwarg:!0,default:"True"},{argName:"special_required",description:"Whether the input must have at least one special character. Defaults to True.",typeName:"bool",isKwarg:!0,default:"True"},{argName:"digit_required",description:"Whether the input must have at least one digit. Defaults to True.",typeName:"bool",isKwarg:!0,default:"True"},{argName:"min_length",description:"Minimum length of the password. Defaults to 8.",typeName:"int",isKwarg:!0,default:"8"},{argName:"max_length",description:"Maximum length of the password. Defaults to None.",typeName:"int",isKwarg:!0,default:"None"},{argName:"size",description:"Size of the password. Defaults to None.",typeName:"int",isKwarg:!0,default:"None"},{argName:"pattern",description:"A regex pattern for the accepted password. Defaults to None.",typeName:"str",typeDescription:["str (regex)"],isKwarg:!0,default:"None"},{argName:"autocomplete",description:'The autocomplete HTML attribute. Defaults to "current-password".',typeName:"str",typeDescription:["str ('off', 'name', 'email', 'username', 'current-password', 'new-password')"],isKwarg:!0,default:'"current-password"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"str",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"lowercaseRequired",typeName:["boolean","string"],description:"Whether the input must have at least one lowercase character",default:!0,isOptional:!0},{argName:"uppercaseRequired",typeName:["boolean","string"],description:"Whether the input must have at least one uppercase character",default:!0,isOptional:!0},{argName:"specialRequired",typeName:["boolean","string"],description:"Whether the input must have at least one special character",default:!0,isOptional:!0},{argName:"digitRequired",typeName:["boolean","string"],description:"Whether the input must have at least one digit",default:!0,isOptional:!0},{argName:"minLength",typeName:"number",description:"Minimum length of the password",default:8,isOptional:!0},{argName:"maxLength",typeName:["number","null"],description:"Maximum length of the password",default:null,isOptional:!0},{argName:"size",typeName:["number","null"],description:"Size of the password",default:null,isOptional:!0},{argName:"pattern",typeName:["string","null"],description:"A regex pattern for the accepted password",default:null,isOptional:!0},{argName:"autocomplete",typeName:"string",description:"Allow the user's password manager to automatically enter the password",default:"current-password",isOptional:!0},{argName:"secret",typeName:"boolean",description:"Read-only input that indicates whether the widget response value is secret.",default:!0,isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input"}]},examples:[{props:{label:"Insert your password below"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_password",key:"example1",code:`from abstra.forms import read_password

ans = read_password("Insert your password below")
`}]},"phone-input":{name:"Phone input",description:"Phone input allow users to enter a valid phone number.",type:"phone-input",autoHeight:!0,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],dashProperties:{minWidth:377,minHeight:60,initialWidth:377,initialHeight:112},pythonAPI:{name:"read_phone",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert a phone number."'},{argName:"initial_value",description:`The initial value to display to the user. If dictionary, it contains two keys: 'country_code' (string with optional + sign or number) and 'national_number' (str or number). Ex: {'country_code': '+55', 'national_number': '21999990000'}. Defaults to "".`,typeName:"dict",typeDescription:['dict ({"country_code": str, "national_number": str})'],isKwarg:!0,default:'""',formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"PhoneResponse",typeDescription:'A dict containing the value entered by the user ({"raw": str, "masked": str})'}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"object",description:"The initial value of the input",isOptional:!0,properties:[{argName:"countryCode",typeName:"string",description:"The phone number's country code"},{argName:"nationalNumber",typeName:"string",description:"The phone number's national number"}]},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input",default:""}]},examples:[{props:{label:"What is your phone number?"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_phone",key:"example1",code:`from abstra.forms import read_pandas_row_selection

phone = read_phone("What is your phone number?")
number = phone.raw  # eg: 5521999999999
masked = phone.masked  # eg: +55 (21) 99999-9999
`}]},"rating-input":{name:"Rating feedback",description:"Rating feedback allow users to rank their experience from 1 to 5 starts.",type:"rating-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:120,minHeight:60,initialWidth:223,initialHeight:72},pythonAPI:{name:"read_rating",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Rate us!"'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to 0.",typeName:"int",isKwarg:!0,default:"0",formOnly:!0},{argName:"max",description:"Max value accepted by the input. Defaults to None.",typeName:"float",isKwarg:!0,default:"None"},{argName:"char",description:"Which char should be displayed as icon?",typeName:"str",typeDescription:["str (unicode-character)"],isKwarg:!0,default:null},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"float",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"number",description:"The initial value of the input",default:0,isOptional:!0},{argName:"max",typeName:"number",description:"The maximum value of the input",default:5,isOptional:!0},{argName:"char",typeName:"string",description:"Which char should be displayed as icon?",default:"\u2B50",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"How much do you rate this movie?"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_rating",key:"example1",code:`from abstra.forms import read_rating

rating = read_rating("How do you rate this movie?")
`},{props:{label:"How do you evaluate your Python skills?",char:"\u{1F40D}",max:3},name:"Custom chars and number of points",description:"The following example demonstrate some of the available functionality for read_rating",key:"example2",code:`from abstra.forms import read_rating

rating = read_rating("How do you evaluate your Python skills?", char="\u{1F40D}", max=3)
`}]},"rich-text-input":{name:"Rich text input",type:"rich-text-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],description:"Rich text input allows users to type and format textual content.",autoHeight:!1,dashProperties:{minWidth:100,minHeight:100,initialWidth:200,initialHeight:150},pythonAPI:{name:"read_richtext",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert your rich text here!"'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""',formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "Your rich text here".',typeName:"str",isKwarg:!0,default:'"Your rich text here"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"str",typeDescription:"The rich text value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:"",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input",default:"Your rich text here"}]},examples:[{props:{label:"Write here your bio"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_richtext",key:"example1",code:`read_richtext("Write here your bio")
`}]},"tag-input":{name:"Tag input",type:"tag-input",autoHeight:!0,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],description:"Read a tag value from the user",dashProperties:{minWidth:120,minHeight:60,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_tag",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert the desired tags."'},{argName:"initial_value",description:"The initial value to display to the user. Defaults to [].",typeName:"list",typeDescription:["list[str]"],isKwarg:!0,default:"[]",formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "Your answer here".',typeName:"str",isKwarg:!0,default:'"Your answer here"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"list(str) or list(float): The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:["array","null"],description:"The initial value of the input",default:[""],items:{typeName:["string","number"]},isOptional:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input",default:"Your answer here"},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Type and press enter to add a tag",initialValue:["Red","Green","Blue"]},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_tag",key:"example1",code:`from abstra.forms import read_tag

ans = read_tag(
    "Type and press enter to add a tag", initial_value=["Red", "Green", "Blue"]
)
# ans = ["Red", "Green" or "Blue"]\`
`}]},"text-input":{name:"Text input",description:"Text fields allow users to insert plain text.",type:"text-input",autoHeight:!0,events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],dashProperties:{minWidth:120,minHeight:60,initialWidth:223,initialHeight:112},pythonAPI:{name:"read",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert your text here!"'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""',formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "Placeholder".',typeName:"str",isKwarg:!0,default:'"Placeholder"'},{argName:"mask",description:"A mask to apply to the input. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"str",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:"",isOptional:!0},{argName:"mask",typeName:"string",description:"A mask to apply to the input",default:null,isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input",default:"Placeholder"}]},examples:[{props:{label:"What is your name?"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read",key:"example1",code:`from abstra.forms import read

name = read("What is your name?")
`},{props:{label:"What is your credit card number?",mask:"0000 0000 0000 0000"},name:"Mask Example",description:"The following example shows the usage of the mask property for read widget. In the mask property, the '0' digit represents a numeric value, the 'a' digit represents an alphabetic value and other digits are recognized as part of the value",key:"example2",code:`from abstra.forms import read

read("What is your credit card number?", mask="0000 0000 0000 0000")
`}]},"textarea-input":{name:"Long text input",type:"textarea-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],description:"Long text input allow users to type longer textual content.",autoHeight:!1,dashProperties:{minWidth:100,minHeight:100,initialWidth:200,initialHeight:150},pythonAPI:{name:"read_textarea",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Insert your text here!"'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",isKwarg:!0,default:'""',formOnly:!0},{argName:"placeholder",description:'The placeholder text to display to the user. Defaults to "Your answer here".',typeName:"str",isKwarg:!0,default:'"Your answer here"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"str",typeDescription:"The value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:"",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"placeholder",typeName:"string",description:"The placeholder text to display in the input",default:"Your answer here"}]},examples:[{props:{label:"What kind of things are you building with Abstra Cloud?"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_textarea",key:"example1",code:`from abstra.forms import read_textarea

ans = read_textarea("What kind of things are you building with Abstra Cloud?")
`}]},"time-input":{name:"Time input",type:"time-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,description:"Read a time value from the user",dashProperties:{minWidth:120,minHeight:60,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_time",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Choose the desired time."'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"str",typeDescription:["str (HH:MM:SS)"],isKwarg:!0,default:'""',formOnly:!0},{argName:"format",description:'Whether the input is in the format 24hs or AM/PM. Defaults to "24hs".',typeName:"str",isKwarg:!0,default:'"24hs"'},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"datetime.time",typeDescription:"A datetime.time object representing the value entered by the user"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:"string",description:"The initial value of the input",default:null,isOptional:!0},{argName:"format",typeName:"string",description:"The format of time options. 24hs (0-23) or ampm (0-12)",default:"24hs",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Select a time below"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_time",key:"example1",code:`from abstra.forms import read

ans = read_time("Select a time below")
# ans = 00:00:00
`}]},"toggle-input":{name:"Toggle",description:"Allow users to set between two items.",type:"toggle-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!0,dashProperties:{minWidth:120,minHeight:60,initialWidth:377,initialHeight:112},pythonAPI:{name:"read_toggle",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Click to confirm the following options"'},{argName:"on_text",description:"Text of On Toggle option",typeName:"str",isKwarg:!0,default:"Yes"},{argName:"off_text",description:"Text of Off Toggle option",typeName:"str",isKwarg:!0,default:"No"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:null,typeDescription:"bool: if the toggle was checked"}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"onText",typeName:"string",description:"Text of On toggle option"},{argName:"offText",typeName:"string",description:"Text of Off toggle option"},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{label:"Toggle",onText:"On",offText:"Off"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_toggle",key:"example1",code:`from abstra.forms import read_toggle

ans = read_toggle("Toggle")
# ans = True or False
print(ans)
`},{props:{label:"Custom Toggle",onText:"Confirm",offText:"Cancel"},name:"Custom Example",description:"The following example demonstrate how to customize the toggle options text",key:"example2",code:`from abstra.forms import read_toggle

ans = read_toggle("Custom Toggle", on_text="Confirm", off_text="Cancel")
# ans = True or False
`}]},"video-input":{name:"Video upload",description:"Video upload adds a drop-area for users to upload one or more video files.",type:"video-input",events:[{key:"change",description:"Function or expression to be run when the input value changes",payloadSchema:[]}],autoHeight:!1,dashProperties:{minWidth:150,minHeight:112,initialWidth:223,initialHeight:112},pythonAPI:{name:"read_video",params:[{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Upload your video"'},{argName:"initial_value",description:'The initial value to display to the user. Defaults to "".',typeName:"Union[str, io.IOBase]",typeDescription:["io.IOBase","str (filepath)","str (URL)"],isKwarg:!0,default:'""',formOnly:!0},{argName:"multiple",description:"Whether the user will be allowed to upload multiple files. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"max_file_size",description:"Maximum size allowed to be transfered in total in MB.",typeName:"float",isKwarg:!0,default:"None"},{argName:"disabled",description:"whether the input is disabled. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"required",description:'Whether the input is required or not eg. "this field is required". Defaults to True.',typeName:"Union[bool, str]",typeDescription:["bool","str"],isKwarg:!0,default:"True",formOnly:!0},{argName:"hint",description:"A tooltip displayed to the user. Defaults to None.",typeName:"str",isKwarg:!0,default:"None"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[{typeName:"Union[FileResponse, List[FileResponse]]",typeDescription:'A dict containing the video uploaded by the user ({"file": file, "url": str, "content": bytes}) or a list of videos in case of multiple flag set as True'}]},brokerAPI:{params:[{argName:"label",typeName:"string",description:"The label of the input"},{argName:"initialValue",typeName:["string","array"],description:"The initial value of the input",items:{typeName:"string"},default:null,isOptional:!0},{argName:"maxFileSize",description:"Maximum size allowed to be transfered in total in MB.",typeName:"number",isOptional:!0},{argName:"key",typeName:"string",description:"The key of the input on the returning object"},{argName:"disabled",typeName:"boolean",description:"Whether the input is disabled"},{argName:"hint",typeName:["string","null"],description:"message describing the input",default:null,isOptional:!0},{argName:"end_program",typeName:["boolean","null"],description:"End program after this widget is shown",default:!1,isOptional:!0},{argName:"required",typeName:["boolean","string"],description:"Whether the input is required or not",default:!0,isOptional:!0,formOnly:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0},{argName:"multiple",typeName:"boolean",description:"Whether the input accepts multiple values or not",isOptional:!0}]},examples:[{props:{label:"Upload your video"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_video",key:"example1",code:`from abstra.forms import read_video

file_response = read_video("Upload your video")
file = file_response.file  # File object
`}]},"file-output":{name:"Download file",description:"Show a button for the user to download a file.",type:"file-output",autoHeight:!0,events:[],dashProperties:{minWidth:65,minHeight:30,initialWidth:223,initialHeight:72},pythonAPI:{name:"display_file",params:[{argName:"file",description:"The file to download",typeName:"Union[str, io.IOBase]",typeDescription:["io.IOBase","str (filepath)","str (URL)"],isKwarg:!1,default:null,dashesInitialValue:'"https://gist.github.com/armgilles/194bcff35001e7eb53a2a8b441e8b2c6/archive/92200bc0a673d5ce2110aaad4544ed6c4010f687.zip"'},{argName:"download_text",description:'The text to display on the button that will download the file. Defaults to "Download here".',typeName:"str",isKwarg:!0,default:'"Download"'},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"fileUrl",typeName:"string",description:""},{argName:"downloadText",typeName:"string",default:"Download",description:""},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{fileUrl:"https://placekitten.com/200/300",downloadText:"Click here to reveal the secret"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_file",key:"example1",code:`from abstra.forms import display_file

display_file(
    "https://placekitten.com/200/300", download_text="Click here to reveal the secret"
)
`}]},"html-output":{name:"HTML",description:"Embed HTML to the app.",type:"html-output",events:[],autoHeight:!0,dashProperties:{minWidth:65,minHeight:30,initialWidth:146,initialHeight:32},pythonAPI:{name:"display_html",params:[{argName:"html",description:"The html snippet to display to the user",typeName:"str",typeDescription:["str (html snippet)"],isKwarg:!1,default:null,dashesInitialValue:'"<div>Hello World</div>"'},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"html",typeName:"string",description:""},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{html:'<svg width="100" height="100"><circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /></svg>'},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_html",key:"example1",code:`from abstra.forms import display_html

display_html(
    '<svg width="100" height="100"><circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /></svg>'
)
`}]},"iframe-output":{name:"iframe",description:"Embed content using iframe.",type:"iframe-output",events:[],autoHeight:!1,dashProperties:{minWidth:377,minHeight:632,initialWidth:377,initialHeight:632},pythonAPI:{name:"display_iframe",params:[{argName:"url_or_html",description:"The link to the document or the own document to display to the user",typeName:"str",typeDescription:["str (URL)","str (html snippet)"],isKwarg:!1,default:null,dashesInitialValue:'"<div>Hello World</div>"'},{argName:"width",description:'The width of the iframe. Defaults to "800".',typeName:"int",typeDescription:["int (pixels)"],isKwarg:!0,default:'"800"'},{argName:"height",description:'The height of the iframe. Defaults to "600".',typeName:"int",typeDescription:["int (pixels)"],isKwarg:!0,default:'"600"'},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"url",typeName:"string",description:""},{argName:"width",typeName:"string",description:"",isOptional:!0},{argName:"height",typeName:"string",description:"",isOptional:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{url:"https://www.google.com/maps/embed?pb=!1m16!1m12!1m3!1d2965.0824050173574!2d-93.63905729999999!3d41.998507000000004!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!2m1!1sWebFilings%2C+University+Boulevard%2C+Ames%2C+IA!5e0!3m2!1sen!2sus!4v1390839289319",width:"300",height:"250"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_iframe",key:"example1",code:`from abstra.forms import display_iframe

display_iframe(
    "https://www.google.com/maps/embed?pb=!1m16!1m12!1m3!1d2965.0824050173574!2d-93.63905729999999!3d41.998507000000004!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!2m1!1sWebFilings%2C+University+Boulevard%2C+Ames%2C+IA!5e0!3m2!1sen!2sus!4v1390839289319",
    width="300",
    height="250",
)
`}]},"image-output":{name:"Show image",description:"Show an image to the user",type:"image-output",events:[],autoHeight:!1,dashProperties:{minWidth:60,minHeight:60,initialWidth:223,initialHeight:312},pythonAPI:{name:"display_image",params:[{argName:"image",description:"The image to display to the user",typeName:"Union[str, io.IOBase]",typeDescription:["io.IOBase","str (filepath)","str (URL)"],isKwarg:!1,default:null,dashesInitialValue:'"https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Mona_Lisa.jpg/396px-Mona_Lisa.jpg"'},{argName:"subtitle",description:'The subtitle of the image. Defaults to "".',typeName:"str",isKwarg:!0,default:'""'},{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!0,default:null},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"imageUrl",typeName:"string",description:""},{argName:"subtitle",typeName:"string",default:"",description:"",isOptional:!0},{argName:"label",typeName:"string",description:"The label to display above the image",isOptional:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{imageUrl:"https://placekitten.com/200/200",subtitle:"Meooow"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_image",key:"example1",code:`from abstra.forms import display_image

display_image("https://placekitten.com/200/200", subtitle="Meooow")
`}]},"latex-output":{name:"Show Latex formula",description:"Show an Latex formula to the user",type:"latex-output",events:[],autoHeight:!0,dashProperties:{minWidth:60,minHeight:30,initialWidth:146,initialHeight:32},pythonAPI:{name:"display_latex",params:[{argName:"text",description:"The latex formula to display to the user",typeName:"str",typeDescription:["str (latex snippet)"],isKwarg:!1,default:null,dashesInitialValue:'"\\(x^2 + y^2 = z^2\\)"'},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"text",typeName:"string",description:"The latex formula"},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{text:"\\(ax^2 + bx + c = 0\\)"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_latex",key:"example1",code:`from abstra.forms import display_latex

display_latex("\\(ax^2 + bx + c = 0\\)")
`},{props:{text:"When \\(a \\ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are $$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.$$"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_latex",key:"example2",code:`from abstra.forms import display_latex

display_latex(
    """When \\(a \\\\ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are
$$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.$$"""
)
`}]},"link-output":{name:"Link (text URL)",description:"Allow users to see and open content from text links.",type:"link-output",events:[],autoHeight:!0,dashProperties:{minWidth:60,minHeight:30,initialWidth:146,initialHeight:72},pythonAPI:{name:"display_link",params:[{argName:"link_url",description:"The url of the link to display to the user",typeName:"str",typeDescription:["str (URL)"],isKwarg:!1,default:null,dashesInitialValue:'"https://www.abstracloud.com"'},{argName:"link_text",description:'The text to display on the link. Defaults to "Click here".',typeName:"str",isKwarg:!0,default:'"Click here"'},{argName:"same_tab",description:"Whether to open the link in the same tab or not. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"linkText",typeName:"string",description:""},{argName:"linkUrl",typeName:"string",description:""},{argName:"sameTab",typeName:"boolean",description:"",default:!1,isOptional:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{linkUrl:"https://console.abstracloud.com",linkText:"Abstra Cloud Homepage"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_link",key:"example1",code:`from abstra.forms import display_link

display_link("https://console.abstracloud.com", link_text="Abstra Cloud Homepage")
`}]},"markdown-output":{name:"Markdown",description:"Show a formatted text to the user",type:"markdown-output",autoHeight:!0,events:[],dashProperties:{minWidth:60,minHeight:30,initialWidth:146,initialHeight:72},pythonAPI:{name:"display_markdown",params:[{argName:"text",description:"The formatted text to display to the user",typeName:"str",typeDescription:["str (markdown snippet)"],isKwarg:!1,default:null,dashesInitialValue:'"### Hello World"'},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"text",typeName:"string",description:""},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{text:`
## Let's see some examples 8-)

* 1^th^ H~2~0 

- [ ] Task

* ==Mark==

* [Link](https://www.abstracloud.com/)`},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_markdown",key:"example1",code:`from abstra.forms import display_markdown


display_markdown(
    """
## Let's see some examples 8-)

* 1^th^ H~2~0



- [ ] Task

* ==Mark==

* [Link](https://www.abstracloud.com/)"""
)
`}]},"pandas-output":{name:"Table",description:"Display a pandas dataframe to the user",type:"pandas-output",autoHeight:!1,events:[{key:"row-click",description:"When clicking on a row",payloadSchema:[{key:"row",typeName:"pandas.Series",description:"The row that was clicked"}]},{key:"row-edit",description:"Function or expression to be run when the user edits a cell",payloadSchema:[]},{key:"action-click",description:"Function or expression to be run when the input value changes",payloadSchema:[{key:"action",description:"The action that was clicked",typeName:"str"}]}],dashProperties:{minWidth:195,minHeight:72,initialWidth:245,initialHeight:72},pythonAPI:{name:"display_pandas",params:[{argName:"df",description:"The dataframe to display to the user",typeName:"PandasDataFrame",isKwarg:!1,default:null,dashesInitialValue:"pandas.Series([1, 3, 5, 4, 6, 8])"},{argName:"display_index",description:"Whether to show a index column. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!0,default:null},{argName:"editable",description:"Whether the user will be allowed to edit the cells. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False"},{argName:"actions",description:"Actions that can be triggered by table rows",typeName:"list",typeDescription:["list[str]"],isKwarg:!0,default:"[]"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"table",typeName:"object",description:"",properties:[{argName:"data",typeName:"array",description:""},{argName:"schema",typeName:"object",description:"",properties:[{argName:"fields",typeName:"array",description:""}]}]},{argName:"displayIndex",typeName:"boolean",description:"",default:!1},{argName:"label",typeName:"string",description:"The label to display above the dataframe",isOptional:!0},{argName:"editable",typeName:"boolean",description:"Whether the user will be allowed to edit the cells",default:!1},{argName:"actions",typeName:"array",description:"Actions that can be triggered by table rows",isOptional:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{table:{schema:{fields:[{name:"Country",type:"string"},{name:"Population",type:"number"}],primaryKey:["Country"]},data:[{Country:"USA",Population:"32,700,000"},{Country:"China",Population:"1,300,000,000"},{Country:"Japan",Population:"126,000,000"}]}},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_pandas",key:"example1",code:`from abstra.forms import display_pandas

display_pandas(df)
`}]},"plotly-output":{name:"Plotly graph",description:"Displays a Plotly figure to the user",type:"plotly-output",events:[],autoHeight:!1,dashProperties:{minWidth:245,minHeight:112,initialWidth:245,initialHeight:112},pythonAPI:{name:"display_plotly",params:[{argName:"fig",description:"The figure to display to the user",typeName:"PlotlyFigure",isKwarg:!1,default:null,dashesInitialValue:'plotly_express.bar(x=["a", "b", "c"], y=[1, 3, 2])'},{argName:"label",description:"The label to display to the user",typeName:"str",isKwarg:!0,default:null},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"figure",typeName:"any",description:""},{argName:"label",typeName:"string",description:"The label to display above the figure",isOptional:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{figure:{data:[{type:"bar",x:[1,2,3],y:[1,3,2]}],layout:{title:{text:"Bar chart example"}}}},name:"Basic Example",description:"The following example demonstrate some of the available functionality for display_plotly",key:"example1",code:`from abstra.forms import display_plotly
import plotly.graph_objects as go

figure = go.Figure(
    data=[go.Bar(x=[1, 2, 3], y=[1, 3, 2])],
    layout=go.Layout(title=go.layout.Title(text="Bar chart example")),
)

display_plotly(figure)
`}]},"progress-output":{name:"Progress bar",description:"Show a progress bar when loading the app.",type:"progress-output",events:[],autoHeight:!0,dashProperties:{minWidth:60,minHeight:30,initialWidth:300,initialHeight:32},pythonAPI:{name:"display_progress",params:[{argName:"current",description:"The progress being made. Defaults to 50.",typeName:"float",isKwarg:!1,default:"50",dashesInitialValue:"50"},{argName:"total",description:"Total progress. Defaults to 100.",typeName:"float",isKwarg:!1,default:"100",dashesInitialValue:"100"},{argName:"text",description:'The text displayed with this progress step. Defaults to "".',typeName:"str",isKwarg:!0,default:'""'},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"current",typeName:"number",description:"",default:50},{argName:"total",typeName:"number",description:"",default:100},{argName:"text",typeName:"string",description:"",default:"",isOptional:!0},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{current:50,total:100},name:"Default behavior",description:"This is what happens when there is no parameter passed",key:"example1",code:`from abstra.forms import display_progress

display_progress()
`},{props:{current:8,total:10,text:"Almost there!"},name:"Custom fields",description:"You can customize the current and total number of steps. Also the message of each step",key:"example2",code:`from time import sleep

for i in range(10):
    display_progress(i, 10, text="Computing values")

    sleep(1)  # Do some computation
`}]},"text-output":{name:"Text display",description:'"Text display" adds textual information into the app.',type:"text-output",autoHeight:!0,events:[],dashProperties:{minWidth:60,minHeight:30,initialWidth:223,initialHeight:112},pythonAPI:{name:"display",params:[{argName:"text",description:"The text to display to the user",typeName:"str",isKwarg:!1,default:null,dashesInitialValue:'"Your text here!"'},{argName:"size",description:"The size of the text: 'small', 'medium', 'large'",typeName:"str",isKwarg:!0,default:"medium"},{argName:"end_program",description:"Whether the program should end after the widget is shown. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"full_width",description:"Whether the input should use full screen width. Defaults to False.",typeName:"bool",isKwarg:!0,default:"False",formOnly:!0},{argName:"button_text",description:"What text to display on the button when the widget is not part of a Page. Defaults to 'Next'.",typeName:"str",isKwarg:!0,default:"Next",formOnly:!0}],returns:[]},brokerAPI:{params:[{argName:"text",description:"",typeName:"string"},{argName:"size",description:"",typeName:"string"},{argName:"columns",typeName:"number",description:"number of columns this input will take",isOptional:!0,formOnly:!0},{argName:"fullWidth",typeName:"boolean",description:"Whether the widget should take up the full width of the page",isOptional:!0,formOnly:!0}]},examples:[{props:{text:"Hello world!"},name:"Basic Example",description:"The following example demonstrate some of the available functionality for read_display",key:"example1",code:`from abstra.forms import display

display("Hello world!")
`}]}},_={redirect:{type:"redirect",description:"Redirect the user to another page",pythonAPI:{name:"redirect",params:[{argName:"url",typeName:"str",description:"The URL to redirect to",isKwarg:!1,default:null}],returns:[]},brokerAPI:{params:[{argName:"url",typeName:"string",description:"The URL to redirect to"}]}},"execute-js":{type:"execute-js",description:"Execute JavaScript code on the browser",pythonAPI:{name:"execute_js",params:[{argName:"code",typeName:"str",description:"Execute JavaScript code on the browser",isKwarg:!1,default:null},{argName:"context",typeName:"dict",description:"A dictionary of variables to be passed to the code.",isKwarg:!1,default:"{}"}],returns:[{typeDescription:"the result of the code execution",typeName:"Any"}]},brokerAPI:{params:[{argName:"code",typeName:"string",description:"Execute JavaScript code on the browser"},{argName:"context",typeName:"object",description:"A dictionary of variables to be passed to the code."}]}}},T={convertToPdf:`See below an example of how to convert a docx file to pdf.

\`\`\`python
import abstra.forms as hf
import requests, os
fr = hf.read_file("Upload your docx")
r = requests.post(
os.getenv('CONVERT_TO_PDF_URL'),
files={"file": (fr.name, fr.content)}
)
with open("/tmp/document.pdf", "wb") as f:
f.write(r.content)
hf.display_file('/tmp/document.pdf')
\`\`\`
`,dashes:`### Dashes VS Code Extension

Abstra Dashes is a visual GUI builder for Python. Build an app by
dragging and dropping widgets onto the canvas and easily binding them to a Python script.

It's available as a VS Code extension, so you can use it right from your IDE. Download it [here](https://www.abstracloud.com/editor)

Please note that the extension is currently under development and we're providing it as a preview. We'd love to hear your feedback and suggestions.

### Authentication

Use the \`get_user()\` function to show a authentication screen before the app is loaded.

\`\`\`python
from abstra.dashes import get_user
user = get_user()
if not user.email.ends_with "@abstracloud.com":
  exit()
# continue with the app
\`\`\`

### Redirect

Use the \`redirect()\` function redirect a user to another URL either external or internal.

\`\`\`python
from abstra.dashes import redirect
def open_abstra_cloud():
  # Redirects to an external URL
  redirect("https://abstracloud.com")
\`\`\`

### Use query params

\`\`\`python
from abstra.dashes import redirect
def open_user_page(user_id):
  # Redirects to https://abstradash.abstra.run/user?user=123
  redirect("https://abstradash.abstra.run/user", {"user_id": 123})
\`\`\`
`,getStarted:`## Welcome to Abstra Cloud

Abstra Cloud is the simplest way to execute your Python scripts on the web.
With **Smart Forms**, use our lib to generate web UIs from your
scripts. With **Jobs**, you can schedule your scripts to run in
the cloud with a single click.

Abstra Cloud is the hub for all your Python scripts on the web. Our tools simplify building and deploying in Python - from generating front-end for your projects to handling deployment infrastructure.
`,hooks:`### Hooks

Hooks are scrips which are triggered by HTTP requests. When your hook is active, any HTTP request sent to the hook endpoint will trigger the execution of the script.

### Dashboard

On the dashboard you may create new, duplicate and delete hooks, enable and disable them, check their path and recent runs status.

### Editor

Use the left side to write your hook's Python code. The right side is used to setup the request method, change test values and check responses from the tests.

Use "Settings" tab to customize the hook's path.

You may also customize the subdomain of your hook's path.

### Getting the request

To access the request data you have to use our builtin utils function get_request:

\`\`\`python
from abstra.hooks import get_request
body, query, headers = get_request()
\`\`\`

### Sending the response

To send the response you have to use on of our builtin utils functions send_response or send_json:

\`\`\`python
from abstra.hooks import send_response, send_json
send_response(body="plain text body")
send_json(data={'ok': True}, status_code=200, headers={"ABSTRA": "CLOUD"})
\`\`\`
`,howToUseReactive:`### How to use Reactive

In this quick tutorial, we'll use the Reactive feature to create a dynamic field in our Smart Form that pops up whenever the client fits a certain criteria.

\u200D

We're building a User Registration form that must fit brand-new users and also new users from a paying organization. So while most of the Form's flow remains the same, if the user's company is already a client, we'll add in a Client ID field to their registration.

\u200D

The only extra step is building the reactive function before our regular Page: if the \`current_client\` is marked as \u201CYes\u201D, we'll return the new Client ID field. Then just add the function into our Page:

\`\`\`python
def render(partial):
    if partial["current_client"] == "Yes":
        return Page().read("Enter client ID:")

onboarding = Page().display("Welcome to new user registration.") \\
            .read_email("Enter the user's email:", key = "email") \\
            .read_date("Enter creation date:", key = "date") \\
            .read_multiple_choice(
                "Is this user from a company that's already a client?",
                ["Yes", "No"],
                key = "current_client") \\
            .reactive(render) \\
            .run()
\`\`\`

After this easy registration flow, you can do almost anything with the info: send it [to your CRM](https://www.abstracloud.com/examples/subscribe-to-a-new-feature), [to a database](https://www.abstracloud.com/examples/customer-registration), or [send a personalized welcome email](https://www.abstracloud.com/examples/lead-gen-form), for example. [Check out our use cases page for more.](https://www.abstracloud.com/use-cases)

As we've seen, with Reactive you can make your pages respond according to user input. This means widgets being added, removed or having it's validation type changed within the Form's flow. That's less code and logic to get in your way.
`,jobs:`### Creating a job

Write a new script straight in the online Code Editor, just as you would in your fav IDE. You can also copy and paste some of our [examples](https://www.abstracloud.com/examples) to get started.

If you already have a working script you\u2019d like to schedule, that\u2019s easy to do. Add the script to your workspace\u2019s Files and import it into your job by typing <import file_name> in the Editor.

### Scheduling runs

Once your code is ready, scheduling is less than a minute away. Switch to the \u2018Schedule\u2019 tab and select a date, time and frequency. You\u2019re good to go - just use the toggle to turn your scheduling on or off.

### Checking up on your job

To make sure everything\u2019s running smoothly, view your past runs on the logs console adjacent to the Editor, or get an overview of all your scripts\u2019 executions on the Jobs dashboard.
`,package:`### Packages

You most likely will need additional Python libraries in order to do what you have in mind with your script. Use the "Packages\u201D tab to install them, just as you would with pip locally. Fill in the package's name and, optionally, the desired version. Click the \u201CAdd Package\u201D button to complete. In order to use any package in a script, just import it in the code.

#### Important

Note that new packages may take up to 5 minutes to be available inside your scripts.

### Files

Your file system can be used in two ways: access information from other files, like a CSV or another .py file, inside your scripts or save outputs from your scripts in varied file formats.

### Environment Variables

You can set environment variables to be used by all the scripts in your workspace. Once set they cannot be seen again by anyone, including you. Navigate to the \u201Cenv vars\u201D tab in your workspace to add them.

#### Note

Environment variables are useful when you need to access the same variable from multiple scripts (like an API endpoint) or when you have a sensitive variable that could not be exposed on the code (like a password).

### Members

All workspaces have an unlimited number of seats for collaborative building and editing. To invite new members to join your workspace, just add their email in the \u201CMembers\u201D section - they\u2019ll receive an invite.

#### Important

You can set member permissions within a workspace between \u201CEditor\u201D and \u201CAdmin\u201D - only admins can add and remove other members. Since workspaces are independent, remember to add co-creators to each environment they need access to.

### Subdomain

You can customize your workspace\u2019s URL by setting a subdomain. This new URL will be used for accessing your Smart Forms and Hooks.`,utils:`### Selenium (beta)

Run selenium on your scripts using our dedicated webdrivers

\`\`\`python
from abstra.forms import *
from os import getenv
from selenium import webdriver

ABSTRA_SELENIUM_URL = getenv('ABSTRA_SELENIUM_URL')

options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox")

with webdriver.Remote(command_executor=ABSTRA_SELENIUM_URL, options=options) as driver:
    driver.get("https://abstracloud.com/")
    driver.save_screenshot("/tmp/screenshot.png")
    display_image("/tmp/screenshot.png")

\`\`\`

[Check out a tutorial on our blog](https://www.abstracloud.com/tutorials/how-to-run-selenium-on-abstra-cloud)

This feature is still beta. Please reach out if you find any problems.
`},b={widgets:k,actions:_,documentation:T},h=e=>"type"in e&&e.type in b.widgets,v=e=>"type"in e&&e.type in b.widgets,I=e=>d.exports.upperFirst(d.exports.camelCase(e)),A=(e,a)=>d.exports.pickBy(e,t=>{const i=a[t.type].pythonAPI.params,r=d.exports.pickBy(t.props,(o,s)=>{const l=i.find(p=>p.argName===s),u=o.trim();return!(!l||u.length===0)});return!i.some(o=>{if(!o.isKwarg&&!(o.argName in r)&&!o.default)return!0})});function q(e,a){const t=(i,r)=>{var n;return((n=i.toLocaleLowerCase().match(new RegExp(r.toLocaleLowerCase().replace(/(\\)/g,"\\\\"),"g")))!=null?n:[]).length/i.length};return a.reduce((i,r)=>i+10*t(e.type,r)+5*t(e.name,r)+1*t(e.description,r),0)}function H(e,a){return e.length!==a.length?!1:e.every(t=>a.includes(t))}const g=(e,a)=>{for(const t in a){if(t===e)return a[t];const i=a[t];if(h(i))continue;const r=g(e,i.slot);if(r)return r}return null},w=(e,a)=>{for(const t in a){const i=a[t];if(h(i))continue;if(t===e)return i;const r=w(e,i.slot);if(r)return r}return null},E=(e,a)=>g(e,m(a)),S=(e,a)=>{const t=g(e,m(a));if(!t)throw new Error("widget not found");return t.id=e,t},C=(e,a)=>w(e,m(a)),m=e=>e.version==="0.1"?e.widgets:e.slot,U=e=>e.version==="0.1"?"/widgets":"/slot",B=e=>{const a=e.slot,t=[],i=r=>{for(const n in r){const o=r[n];v(o)?t.push(n):i(o.slot)}};return i(a),t},x="#414a58",W="DM Sans",D="Inter";function j(e){var a,t,i,r,n,o,s,l,u,p,c,f,y,N;return{id:e.id,path:e.path,theme:e.theme,brandName:(a=e.brand_name)!=null?a:null,title:e.title,isLocal:(t=e.is_local)!=null?t:!1,startMessage:(i=e.start_message)!=null?i:null,endMessage:(r=e.end_message)!=null?r:null,errorMessage:(n=e.error_message)!=null?n:null,timeoutMessage:(o=e.timeout_message)!=null?o:null,startButtonText:(s=e.start_button_text)!=null?s:null,restartButtonText:(l=e.restart_button_text)!=null?l:null,logoUrl:e.logo_url,mainColor:(u=e.main_color)!=null?u:x,fontFamily:(p=e.font_family)!=null?p:W,autoStart:(c=e.auto_start)!=null?c:!1,allowRestart:e.allow_restart,welcomeTitle:(f=e.welcome_title)!=null?f:null,runtimeType:"form",sidebar:(N=(y=e.workspace)==null?void 0:y.sidebar)!=null?N:[]}}function R(e){var a,t,i,r,n,o,s,l;return{id:e.id,path:e.path,title:e.title,theme:e.theme,brandName:(a=e.brand_name)!=null?a:null,logoUrl:(t=e.logo_url)!=null?t:null,mainColor:(i=e.main_color)!=null?i:x,fontFamily:(r=e.font_family)!=null?r:D,layout:e.layout,idOrPath:e.id||e.path,workspaceName:(o=(n=e.workspace)==null?void 0:n.name)!=null?o:"Untitled Workspace",runtimeType:"dash",sidebar:(l=(s=e.workspace)==null?void 0:s.sidebar)!=null?l:[]}}const V=e=>({...e,slot:O(m(e))}),K=e=>{var a,t;return{...e,id:(a=e.id)!=null?a:"",variable:(t=e.variable)!=null?t:null,props:Object.keys(e.props),events:Object.keys(e.events),position:{rowStart:e.rowStart,rowEnd:e.rowEnd,colStart:e.colStart,colEnd:e.colEnd}}},F=e=>({...e,slot:O(e.slot),props:Object.keys(e.props),position:{row:e.row,height:e.height,order:e.order}}),O=e=>{if(!e)throw new Error("Slot is undefined");return Object.keys(e).reduce((a,t)=>{const i=e[t];return h(i)?{...a,[t]:K(i)}:{...a,[t]:F(i)}},{})};export{U as a,S as b,C as c,V as d,E as e,g as f,m as g,I as h,h as i,H as j,A as k,B as l,v as m,R as n,j as r,q as s,k as w};
//# sourceMappingURL=runnerData.cef787df.js.map
