$item ) { wp_add_cookie_info( $name, $item['service'], 'functional', $item['expires'], $item['purpose'], $item['data'], false, false, 'LOCALSTORAGE' ); } } /** * What the chat keeps in the browser, by name. * * @return array Map of name to service, expires, purpose and data. */ public static function storage() { $service = __( 'AI Chatbot & Agents for Amazon Bedrock', 'ai-chat-for-amazon-bedrock' ); $session = __( 'Until the browser tab is closed', 'ai-chat-for-amazon-bedrock' ); $items = array( 'aicfabPopupOpen' => array( 'service' => $service, 'expires' => $session, 'purpose' => __( 'Keeps the floating chat open or closed as the visitor left it, while they move between pages.', 'ai-chat-for-amazon-bedrock' ), 'data' => '', ), ); if ( class_exists( 'AI_Chat_Bedrock_Chat_History' ) && '' !== AI_Chat_Bedrock_Chat_History::mode() ) { $items['aicfabChat:*'] = array( 'service' => $service, 'expires' => $session, 'purpose' => __( 'Keeps the chat conversation while the visitor moves between pages.', 'ai-chat-for-amazon-bedrock' ), 'data' => __( 'Chat messages', 'ai-chat-for-amazon-bedrock' ), ); } return $items; } }