{"version":3,"file":"panel.cjs","sourceRoot":"","sources":["../../../src/ui/components/panel.ts"],"names":[],"mappings":";;;AACA,uDAAoE;AAEpE,2CAA0C;AAC1C,yCAAwC;AACxC,6CAA4C;AAC5C,2CAA0C;AAC1C,qCAAoC;AACpC,2CAA0C;AAC1C,uCAAsC;AACtC,uCAAsC;AACtC,mCAAkC;AAClC,2CAA0C;AAC1C,qCAAoC;AACpC,yDAAsD;AACtD,wCAAgD;AAEhD;;GAEG;AACU,QAAA,YAAY,GAAG,IAAA,oBAAM,EAChC,kBAAU,EACV,IAAA,oBAAM,EAAC;IACL,sEAAsE;IACtE,QAAQ,EAAE,IAAA,mBAAK,EACb,IAAA,kBAAI;IACF,0BAA0B;IAC1B,GAAG,EAAE;IACH,mEAAmE;IACnE,uBAAe,CAClB,CACF;CACF,CAAC,CACH,CAAC;AAEF;;GAEG;AACU,QAAA,WAAW,GAAkB,IAAA,oBAAM,EAC9C,oBAAY,EACZ,IAAA,oBAAM,EAAC;IACL,IAAI,EAAE,IAAA,mBAAO,EAAC,gBAAQ,CAAC,KAAK,CAAC;CAC9B,CAAC,CACH,CAAC;AAQF,8EAA8E;AACjE,QAAA,eAAe,GAAG,IAAA,sBAAU,EAAC;IACxC,yBAAc;IACd,uBAAa;IACb,uBAAa;IACb,mBAAW;IACX,mBAAW;IACX,uBAAa;IACb,iBAAU;IACV,eAAS;IACT,uBAAa;IACb,mBAAW;IACX,iBAAU;IACV,qBAAY;CACb,CAAC,CAAC","sourcesContent":["import type { Infer, Struct } from '@metamask/superstruct';\nimport { array, assign, lazy, object } from '@metamask/superstruct';\n\nimport { AddressStruct } from './address';\nimport { ButtonStruct } from './button';\nimport { CopyableStruct } from './copyable';\nimport { DividerStruct } from './divider';\nimport { FormStruct } from './form';\nimport { HeadingStruct } from './heading';\nimport { ImageStruct } from './image';\nimport { InputStruct } from './input';\nimport { RowStruct } from './row';\nimport { SpinnerStruct } from './spinner';\nimport { TextStruct } from './text';\nimport { typedUnion, literal } from '../../internals';\nimport { NodeStruct, NodeType } from '../nodes';\n\n/**\n * @internal\n */\nexport const ParentStruct = assign(\n  NodeStruct,\n  object({\n    // This node references itself indirectly, so we need to use `lazy()`.\n    children: array(\n      lazy(\n        /* istanbul ignore next */\n        () =>\n          // eslint-disable-next-line @typescript-eslint/no-use-before-define\n          ComponentStruct,\n      ),\n    ),\n  }),\n);\n\n/**\n * @internal\n */\nexport const PanelStruct: Struct<Panel> = assign(\n  ParentStruct,\n  object({\n    type: literal(NodeType.Panel),\n  }),\n);\n\n// This node references itself indirectly, so it cannot be inferred.\nexport type Panel = {\n  type: NodeType.Panel;\n  children: Component[];\n};\n\n// This is defined separately from `Component` to avoid circular dependencies.\nexport const ComponentStruct = typedUnion([\n  CopyableStruct,\n  DividerStruct,\n  HeadingStruct,\n  ImageStruct,\n  PanelStruct,\n  SpinnerStruct,\n  TextStruct,\n  RowStruct,\n  AddressStruct,\n  InputStruct,\n  FormStruct,\n  ButtonStruct,\n]);\n\n/**\n * All supported component types.\n */\nexport type Component = Infer<typeof ComponentStruct>;\n"]}