1var INPUT_FRAME_TARGET = "ai_chat_input_frame"; 2var MESSAGES_LIST_TARGET = "ai_chat_messages_list"; 3export function updateChatMessagesTurboStreamRender(event, callbacks) { 4 var _customEvent_detail, _customEvent_detail1; 5 var customEvent = event; 6 var newStream = (_customEvent_detail = customEvent.detail) === null || _customEvent_detail === void 0 ? void 0 : _customEvent_detail.newStream; 7 var render = (_customEvent_detail1 = customEvent.detail) === null || _customEvent_detail1 === void 0 ? void 0 : _customEvent_detail1.render; 8 if (!newStream || !render) { 9 return; 10 } 11 var action = newStream.getAttribute("action"); 12 var target = newStream.getAttribute("target"); 13 if (action === "replace" && target === INPUT_FRAME_TARGET) { 14 customEvent.detail.render = function(streamElement) { 15 render(streamElement); 16 requestAnimationFrame(callbacks.onInputFrameReplaced); 17 }; 18 return; 19 } 20 if (action !== "append" || target !== MESSAGES_LIST_TARGET) { 21 return; 22 } 23 customEvent.detail.render = function(streamElement) { 24 render(streamElement); 25 requestAnimationFrame(callbacks.onMessageAppended); 26 }; 27}
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.