## class: `WyUserCard`, `wy-user-card`

Overlay profile card displaying detailed information about a user. The user can be followed/unfollowed, blocked and reported.

**Used sub components:**

*   [`<wy-overlay>`](./ui/wy-overlay)
*   [`<wy-button>`](./ui/wy-button)
*   [`<wy-container>`](./ui/wy-container)
*   [`<wy-avatar>`](./ui/wy-avatar)
*   [`<wy-avatar-header>`](./ui/wy-avatar)
*   [`<wy-dropdown>`](./ui/wy-dropdown)
*   [`<wy-icon>`](./ui/wy-icon)

### Fields

| Name               | Type                                    | Default | Description                                                     | Inherited From        |
| ------------------ | --------------------------------------- | ------- | --------------------------------------------------------------- | --------------------- |
| `uid`              | `string \| number \| null \| undefined` |         | User identifier to get profile details for.                     |                       |
| `profile`          | `UserOrAgentMinimalType \| undefined`   |         | User profile data                                               |                       |
| `show`             | `boolean`                               | `false` | Whether the overlay should be shown                             |                       |
| `listenTo`         | `EventTarget \| null \| undefined`      |         | Element to listen to \`wy-user-profile\` events on              |                       |
| `handleUserAction` |                                         |         |                                                                 |                       |
| `link`             | `LinkType \| undefined`                 |         | Any provided link that should be loaded, shown and highlighted. | WeavySubTypeComponent |

### Methods

| Name             | Description                                                                                                                                                                                                                                                                                                | Parameters                        | Return                       | Inherited From        |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ---------------------------- | --------------------- |
| `follow`         | Follows the provided user/profile.                                                                                                                                                                                                                                                                         | `follow: boolean`                 |                              |                       |
| `confirmReport`  | Confirm and report the profile for moderation.&#xA;&#xA;Uses the native confirm rather than an in-app dialog, matching how reporting a message works.&#xA;Reporting cannot be undone, so confirmation is required before submitting it.                                                                    |                                   |                              |                       |
| `block`          | Blocks or unblocks the profile.&#xA;&#xA;Resolves when the server has it, so callers can act on the outcome; rejects the way the mutation does.                                                                                                                                                            | `block: boolean`                  |                              |                       |
| `confirmBlock`   | Confirm and block the profile.&#xA;&#xA;The confirm carries the explanation, not a warning: blocking is reversible and unblock sits right here, so the&#xA;point is telling people what it actually does. That the blocked user is never told, and can still write to you, is&#xA;the part nobody expects. |                                   |                              |                       |
| `whenLink`       | Resolves when a provided link is available.                                                                                                                                                                                                                                                                |                                   | `Promise<LinkType>`          | WeavySubTypeComponent |
| `whenReady`      | Resolves when the component has rendered first time.                                                                                                                                                                                                                                                       |                                   | `Promise<WeavySubComponent>` | WeavySubComponent     |
| `dispatchAction` | Dispatch a \`wy-action\` event on the component.                                                                                                                                                                                                                                                           | `detail: WyActionEventDetailType` | `boolean`                    | WeavySubComponent     |

### Events

| Name    | Type          | Description                      | Inherited From    |
| ------- | ------------- | -------------------------------- | ----------------- |
| `ready` | `CustomEvent` | When the component has rendered. | WeavySubComponent |

### Attributes

| Name   | Field | Inherited From |
| ------ | ----- | -------------- |
| `uid`  | uid   |                |
| `show` | show  |                |

### Slots

| Name     | Description                                        |
| -------- | -------------------------------------------------- |
| `toggle` | Content to use in a toggle button for the overlay. |

<details><summary>Private API</summary>

### Fields

| Name                        | Privacy | Type                                                               | Default                                                                                         | Description | Inherited From        |
| --------------------------- | ------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- | ----------- | --------------------- |
| `#userFollowMutation`       | private |                                                                    | `new MutationController<void, Error, MutateUserFollowProps, MutateUserFollowContextType>(this)` |             |                       |
| `#reportMutation`           | private |                                                                    | `new MutationController<void, Error, MutateReportProps, void>(this)`                            |             |                       |
| `#userBlockMutation`        | private |                                                                    | `new MutationController<void, Error, MutateUserBlockProps, MutateUserBlockContextType>(this)`   |             |                       |
| `#profileQuery`             | private |                                                                    | `new QueryController<UserOrAgentDetailType>(this)`                                              |             |                       |
| `#resolveContextDataBlobs`  | private | `(blobs: ContextDataBlobsType) => void \| undefined`               |                                                                                                 |             | WeavySubTypeComponent |
| `#whenContextDataBlobs`     | private |                                                                    | `new Promise<ContextDataBlobsType>((r) => { this.#resolveContextDataBlobs = r; })`              |             | WeavySubTypeComponent |
| `#resolveComponentFeatures` | private | `(componentFeatures: ComponentFeaturePolicy) => void \| undefined` |                                                                                                 |             | WeavySubTypeComponent |
| `#whenComponentFeatures`    | private |                                                                    | `new Promise<ComponentFeaturePolicy>((r) => { this.#resolveComponentFeatures = r; })`           |             | WeavySubTypeComponent |
| `#resolveLink`              | private | `(link: LinkType) => void \| undefined`                            |                                                                                                 |             | WeavySubTypeComponent |
| `#whenLink`                 | private |                                                                    | `new Promise<LinkType>((r) => { this.#resolveLink = r; })`                                      |             | WeavySubTypeComponent |
| `#resolveSettings`          | private | `(settings: WeavyComponentSettingsType) => void \| undefined`      |                                                                                                 |             | WeavySubTypeComponent |
| `#whenSettings`             | private |                                                                    | `new Promise<WeavyComponentSettingsType>((r) => { this.#resolveSettings = r; })`                |             | WeavySubTypeComponent |
| `#resolveContextId`         | private | `(contextId: ContextIdType) => void \| undefined`                  |                                                                                                 |             | WeavySubComponent     |
| `#whenContextId`            | private |                                                                    | `new Promise<ContextIdType>((r) => { this.#resolveContextId = r; })`                            |             | WeavySubComponent     |
| `#resolveUser`              | private | `(user: UserType) => void \| undefined`                            |                                                                                                 |             | WeavySubComponent     |
| `#whenUser`                 | private |                                                                    | `new Promise<UserType>((r) => { this.#resolveUser = r; })`                                      |             | WeavySubComponent     |
| `#resolveWeavy`             | private | `(weavy: WeavyType) => void \| undefined`                          |                                                                                                 |             | WeavySubComponent     |
| `#whenWeavy`                | private |                                                                    | `new Promise<WeavyType>((r) => { this.#resolveWeavy = r; })`                                    |             | WeavySubComponent     |
| `#resolveReady`             | private | `(component: WeavySubComponent) => void \| undefined`              |                                                                                                 |             | WeavySubComponent     |
| `#whenReady`                | private |                                                                    | `new Promise<WeavySubComponent>((r) => { this.#resolveReady = r; })`                            |             | WeavySubComponent     |

### Methods

| Name      | Privacy | Description                                                                                                                                                                                                                                                        | Parameters | Return | Inherited From |
| --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | ------ | -------------- |
| `unblock` | private | Unblocks the profile and closes the card.&#xA;&#xA;Unconfirmed, unlike blocking -- it only restores what was there. Closes on the way out for the same reason block&#xA;does: the card looks the same either way, so the close is the only sign anything happened. |            |        |                |

</details>

<hr/>

## Exports

| Kind                        | Name           | Declaration | Module                         | Package |
| --------------------------- | -------------- | ----------- | ------------------------------ | ------- |
| `js`                        | `WyUserCard`   | WyUserCard  | lib/components/wy-user-card.ts |         |
| `custom-element-definition` | `wy-user-card` | WyUserCard  | lib/components/wy-user-card.ts |         |
