{"version":3,"file":"nodes.cjs","sourceRoot":"","sources":["../../src/ui/nodes.ts"],"names":[],"mappings":";;;AACA,uDAAwE;AAExE;;;;GAIG;AACH,IAAY,QAaX;AAbD,WAAY,QAAQ;IAClB,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,2BAAe,CAAA;IACf,uBAAW,CAAA;IACX,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,2BAAe,CAAA;IACf,yBAAa,CAAA;AACf,CAAC,EAbW,QAAQ,wBAAR,QAAQ,QAanB;AAED;;GAEG;AACU,QAAA,UAAU,GAAG,IAAA,oBAAM,EAAC;IAC/B,IAAI,EAAE,IAAA,oBAAM,GAAE;CACf,CAAC,CAAC;AAWH;;GAEG;AACU,QAAA,aAAa,GAAG,IAAA,oBAAM,EACjC,kBAAU,EACV,IAAA,oBAAM,EAAC;IACL,KAAK,EAAE,IAAA,qBAAO,GAAE;CACjB,CAAC,CACH,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { assign, object, string, unknown } from '@metamask/superstruct';\n\n/**\n * The supported node types. This is based on SIP-7.\n *\n * @see https://metamask.github.io/SIPs/SIPS/sip-7\n */\nexport enum NodeType {\n  Copyable = 'copyable',\n  Divider = 'divider',\n  Heading = 'heading',\n  Panel = 'panel',\n  Spinner = 'spinner',\n  Text = 'text',\n  Image = 'image',\n  Row = 'row',\n  Address = 'address',\n  Button = 'button',\n  Input = 'input',\n  Form = 'form',\n}\n\n/**\n * @internal\n */\nexport const NodeStruct = object({\n  type: string(),\n});\n\n/**\n * The base node type. All nodes extend this type.\n *\n * @property type - The type of the node. See {@link NodeType} for the supported\n * node types.\n * @internal\n */\nexport type Node = Infer<typeof NodeStruct>;\n\n/**\n * @internal\n */\nexport const LiteralStruct = assign(\n  NodeStruct,\n  object({\n    value: unknown(),\n  }),\n);\n\n/**\n * A node with a value. This is used for nodes that render a value, such as\n * {@link Text}.\n *\n * @property type - The type of the node.\n * @property value - The value of the node. The type of the value depends on the\n * node type.\n * @internal\n */\nexport type Literal = Infer<typeof LiteralStruct>;\n"]}