1import { Controller } from "@hotwired/stimulus" 2 3// "Ask the assistant" â a button, anywhere on the site, that opens the chat panel. 4// 5// It dispatches an event and stops. It does not know where the panel is, whether one exists, or what 6// happens next: the widget is in the layout on every public page and listens for `chat:open` (see 7// chat_widget_controller#openPanel). A button that reached across the DOM to find the panel and poke at 8// its classes would be a second implementation of "open the chat", and the day the widget changed shape 9// it would be a broken one. 10// 11// Same shape as the home page's conversion prompt, which hands over a whole first message 12// (`chat:open-with`). One conversation, one place it lives, several doors into it. 13export default class extends Controller { 14 open(event) { 15 event.preventDefault() 16 window.dispatchEvent(new CustomEvent("chat:open")) 17 } 18}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.