$history as ConversationStore::listFor() returns them * @param int $postId the post being edited when the drawer was opened, else 0 * @param string|null $model the user's effective model (Chat\UserPrefs::modelFor()); null means the catalog's default * @param string|null $sprite path to the icon sprite, as Shell takes it; null means the plugin's own * @param array{id: string, title: string}|null $screen the screen the drawer is on, as Shell takes it */ public function __construct(private Store $store, private ModelCatalog $catalog, private ?Conversation $conversation, private array $history, private int $postId = 0, private ?string $model = null, private ?string $sprite = null, private ?array $screen = null) {} public function render(): string { $close = $this->tag('button', [ 'type' => 'button', 'class' => 'ab-btn ab-btn--icon ab-drawer__close', 'data-action' => 'drawer-close', 'aria-label' => __('Close the chat', 'alpaca-bot'), ], $this->e('×')); $shell = new Shell($this->store, $this->catalog, $this->conversation, $this->history, $this->postId, $this->sprite, $this->model, null, true, $this->screen); return $this->tag('div', ['class' => 'ab-drawer__panel'], $close . $shell->render()); } }