{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAqBD,MAAM;AAQN,qFAAqF;AACrF,MAAM;AAiCC,MAAM,yDAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAA2B;IAE3B,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,YAAC,QAAQ,UAAE,MAAM,EAAC,GAAG;IAEzB,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,6CAAa,EAAE,OAAO;YAAC,WAAW;QAAI,EAAE;QAC5C,KAAK;QACL,WAAW,CAAA,GAAA,6CAAU,EAAE,8BAAQ;kBAC/B,cAAA,gCAAC,CAAA,GAAA,wCAAO;YACN,QAAQ;gBACN;oBACE,CAAA,GAAA,wCAAW;oBACX;wBACE,OAAO;4BACL,CAAC,CAAA,GAAA,4CAAW,EAAE,EAAE,CAAC;4BACjB,OAAO;gCAAC,QAAQ;4BAAY;wBAC9B;oBACF;iBACD;aACF;sBACA;;;AAIT","sources":["packages/@react-spectrum/ai/src/UserMessage.tsx"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef} from '@react-types/shared';\nimport {DEFAULT_SLOT, Provider, SlotProps} from 'react-aria-components/slots';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRef, ReactNode} from 'react';\nimport {ImageContext} from '@react-spectrum/s2/Image';\nimport {mergeStyles} from '@react-spectrum/s2/mergeStyles';\nimport {style} from '@react-spectrum/s2/style' with {type: 'macro'};\nimport {StyleString} from '@react-spectrum/s2/style' with {type: 'macro'};\nimport {useDOMRef} from './useDOMRef';\n\nexport interface UserMessageProps extends DOMProps, AriaLabelingProps, SlotProps {\n  /** The contents of the user message bubble. */\n  children: ReactNode;\n  /**\n   * Spectrum-defined styles, returned by the `style()` macro.\n   */\n  styles?: StyleString;\n}\n\nconst previewImage = style({\n  width: 'full',\n  height: 132,\n  borderRadius: 'sm',\n  backgroundColor: 'transparent',\n  objectFit: 'cover'\n});\n\n// TODO: revisit whether 75% is the right, or if there should be different modalities\nconst bubble = style({\n  display: 'flex',\n  flexDirection: {\n    default: 'row',\n    ':has([slot=image])': 'column'\n  },\n  alignItems: {\n    default: 'center',\n    ':has([slot=image])': 'stretch'\n  },\n  gap: 8,\n  paddingY: 8,\n  paddingX: {\n    default: 16,\n    ':has(img)': 8\n  },\n  backgroundColor: 'gray-50',\n  color: 'neutral',\n  borderRadius: 'lg',\n  font: 'body',\n  boxSizing: 'border-box',\n  alignSelf: 'end',\n  maxWidth: '75%',\n  width: {\n    default: 'fit',\n    ':has([slot=image])': '75%'\n  }\n});\n\n/**\n * UserMessage renders a single user-authored message in a conversational AI thread.\n * Pass `slot=\"image\"` on an Image child to switch to a vertical layout with a full-width preview.\n */\nexport const UserMessage = forwardRef(function UserMessage(\n  props: UserMessageProps,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let domRef = useDOMRef(ref);\n  let {children, styles} = props;\n\n  return (\n    <div\n      {...filterDOMProps(props, {labelable: true})}\n      ref={domRef}\n      className={mergeStyles(bubble, styles)}>\n      <Provider\n        values={[\n          [\n            ImageContext,\n            {\n              slots: {\n                [DEFAULT_SLOT]: {},\n                image: {styles: previewImage}\n              }\n            }\n          ]\n        ]}>\n        {children}\n      </Provider>\n    </div>\n  );\n});\n"],"names":[],"version":3,"file":"UserMessage.cjs.map"}