@sendbird/ai-agent-messenger-react 1.43.0 → 1.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -14,7 +14,7 @@ $2
14
14
  `),r=[];let s=0;for(;s<n.length;){const o=n[s],i=Rg(o);if(!i){r.push(o),s+=1;continue}let c=-1;for(let u=s+1;u<n.length;u++)if(kg(n[u],i)){c=u;break}if(c===-1){r.push(o),s+=1;continue}r.push(` ${t} `),s=c+1}return r.join(`
15
15
  `)},Pn=(e,t)=>{let n=0,r=t-1;for(;r>=0&&e[r]==="\\";)n+=1,r-=1;return n%2===1},Vg=e=>{const t=[];let n=0,r="";for(;n<e.length;){const s=e[n];if(s!=="`"||Pn(e,n)){r+=s,n+=1;continue}let o=n;for(;o<e.length&&e[o]==="`";)o+=1;const i=e.slice(n,o);let c=o,u=!1;for(;c<e.length&&e[c]!==`
16
16
  `;){if(e[c]==="`"&&!Pn(e,c)&&e.startsWith(i,c)){const d=e.slice(o,c),m=t.push(d)-1;r+=sa(m),n=c+i.length,u=!0;break}c+=1}u||(r+=i,n=o)}return{text:r,inlineCodes:t}},ca=(e,{codeBlockPlaceholder:t=Mg}={})=>{const n=e==null?void 0:e.replace(/\r\n?/g,`
17
- `);if(!n)return;const r=[];let s=n;s=zg(s,t),s=Bg(s);const o=Vg(s);s=o.text,r.push(...o.inlineCodes),s=Ng(s),s=Dg(s),s=Pg(s),s=$g(s),s=Fg(s),s=Hg(s),s=Gg(s),s=Ug(s);for(let c=0;c<r.length;c++)s=s.replaceAll(sa(c),r[c]);return $t(s)||void 0},Kg=(e,t)=>{var s;const n=((s=e.name)==null?void 0:s.trim())||"",r=e.mimeType??"";return Ve(r)?t.image:on(r)?t.video:Ti({name:n,mimeType:r})?t.pdf(n):t.document(n)},$n=e=>(e==null?void 0:e.trim())||"",qg=e=>(e?$t(e):void 0)||void 0,Eo=30,Wg=e=>e.length>Eo?`${e.slice(0,Eo)}…`:e,Yg=({agent:e,status:t,lastMessage:n,time:r,unreadCount:s},o)=>{const i=Wg($t(n)),c=[t,i].filter(Boolean).join(", ");return o($t(e),$t(c),r,s)},Dr=e=>({text:$n(e),format:"plain"}),jg=e=>({text:$n(e),format:"markdown"}),Xg=({markdownText:e,plainText:t,comparisonText:n})=>{const r=$n(e);return r&&r!==$n(n)?jg(r):Dr(t)},en=({sender:e,message:t,messageFormat:n="plain",time:r,codeBlockPlaceholder:s})=>{const o=[],i=n==="markdown"?ca(t,{codeBlockPlaceholder:s}):qg(t);if(r&&o.push(r),e&&o.push(e),i&&o.push(i),o.length!==0)return o.join(", ")},la=(e,t)=>ca(e==null?void 0:e.trim(),t!==void 0?{codeBlockPlaceholder:t}:void 0),Zg=(...e)=>$t(e.filter(Boolean).join(", "))||void 0,_o=(e,t,n,r)=>{if(!t||Ii(t,n))return e;const s=la(t,r);return s?Zg(e,s):e},ua=(e,t)=>{var r,s;const n=(r=e.message)==null?void 0:r.trim();if(e.isFileMessage()){const o=((s=e.name)==null?void 0:s.trim())||"",i=Kg({name:o,mimeType:e.type},t);return _o(i,n,[o],t.codeBlockPlaceholder)}if(e.isMultipleFilesMessage()){const o=e.fileInfoList??[],i=o.length;if(i===0)return;const c=o.map(m=>{var h;return((h=m.fileName)==null?void 0:h.trim())||""}),d=o.every(m=>{var h;return(h=m.mimeType)==null?void 0:h.startsWith("image")})?t.receivedFilesImageCount(i):t.multipleFilesCount(i);return _o(d,n,c,t.codeBlockPlaceholder)}return la(n,t.codeBlockPlaceholder)},Jg=(e,t={})=>{const{throttleMs:n=1e3,isSuppressed:r,maxOrderedQueueSize:s=10}=t,o=Math.max(1,s);let i=null;const c=[];let u=null,d=null,m=null,h=!1,g=0;const f=(R,M,$)=>({text:R,ignoreSuppression:M,queueOrder:g++,dedupeKey:$}),p=()=>{const R=c[0]??null,M=i;return R&&M?M.queueOrder<R.queueOrder?(i=null,M):c.shift()??null:R?c.shift()??null:M!==null?(i=null,M):null},C=()=>{for(;;){const R=p();if(!R)return null;if(!(!R.ignoreSuppression&&(r!=null&&r())))return R}},_=R=>{u=R.text,d=R.dedupeKey??null,h=!0,e(R.text),m=setTimeout(()=>{m=null,h=!1;const M=C();M&&_(M)},n)},E=R=>{u=R.text,d=R.dedupeKey??null,e(R.text)},A=(R,M,$,N)=>M!=null&&N!=null?M===N:M==null&&N==null?R!=null&&R===$:!1,y=(R,M,$)=>{if(!R||!M&&(r!=null&&r()))return;const N=$==null?void 0:$.dedupeKey;if(!(h&&A(R,N,u,d)))if(h){if((($==null?void 0:$.mode)??"latestOnly")==="ordered"){const se=c[c.length-1];if(se&&A(R,N,se.text,se.dedupeKey))return;c.push(f(R,M,N)),c.length>o&&c.shift();return}i=f(R,M,N)}else i=null,_(f(R,M,N))};return{announce:(R,M)=>{y(R,!1,M)},announceIgnoringSuppression:(R,M)=>{y(R,!0,M)},flush:()=>{const R=[];let M=p();for(;M!==null;)R.push(M),M=p();if(m!==null&&(clearTimeout(m),m=null),h=!1,R.length!==0)for(const $ of R)E($)},destroy:()=>{m!==null&&(clearTimeout(m),m=null),i=null,c.length=0,u=null,d=null,h=!1}}},Qg=e=>{switch(e){case"newMessage":case"conversationClosed":case"csatDisplayed":case"csatSubmitted":case"csatExpired":return"ordered";default:return"latestOnly"}},ef=(e,t)=>e.screen==="conversationList"?typeof e.conversationCount=="number"?t.screenConversationListWithCount(e.conversationCount):t.screenConversationListNoCount:[e.agentName?t.screenConversationWithAgent(e.agentName):t.screenConversation,e.isClosed?t.conversationClosed:null,e.isClosed&&e.hasCSAT?t.csatDisplayed:null,e.isEmpty?t.emptyState:null].filter(r=>!!r).join(". "),tf=(e,t)=>{switch(e.event){case"newMessage":return e.body!==void 0||e.time!==void 0?[t.newMessage(1),e.time,e.senderName,e.body].filter(r=>!!r).join(", "):e.senderName?t.newMessageFromSender(e.senderName,1):t.newMessage(1);case"typing":return t.typing(e.agentName??"");case"sendFailed":return t.sendFailed;case"agentConnected":return t.agentConnected(e.agentName??"");case"conversationClosed":return t.conversationClosed;case"csatDisplayed":return t.csatDisplayed;case"csatSubmitted":return e.submittedLabel;case"csatExpired":return t.csatExpired;case"emptyState":return t.emptyState;case"inputDisabled":return t.inputDisabled}},nf=(e,t)=>{switch(e.type){case"fileSizeExceeded":return t.fileSizeExceeded(e.maxSizeMB??25);case"sendFailed":return t.sendFailed;case"csatFormError":return t.csatFormError;case"generic":return e.message}},rf=(e,t)=>!t||!Xe(e)||e.sender.userId!==t?null:e.reqId||(e.messageId>0?String(e.messageId):null),sf=(e,t)=>Le.isAdmin(e)?Le.isCSAT(e):"sender"in e?e.sender.userId!==t:!1,of=e=>"messageId"in e&&e.messageId>0?String(e.messageId):"reqId"in e&&typeof e.reqId=="string"&&e.reqId.length>0?e.reqId:null,af=e=>e===_e.CollectionEventSource.EVENT_MESSAGE_RECEIVED||e===_e.CollectionEventSource.EVENT_MESSAGE_UPDATED,cf=({isOpened:e,opensConversationList:t})=>e?t?"closeConversationList":"closeConversation":t?"openConversationList":"openConversation",lf=(e,t)=>{switch(e){case"closeConversationList":return t.closeConversationList;case"closeConversation":return t.closeConversation;case"openConversationList":return t.openConversationList;case"openConversation":return t.openConversation}},uf=(e,t)=>{switch(e){case"closeConversation":return t.hintCloseConversation;case"openConversationList":return t.hintOpenConversationList;case"openConversation":return t.hintOpenConversation;default:return}},df=({intent:e,strings:t})=>({label:lf(e,t),hint:uf(e,t)}),mf="1.43.0",Fe="sb-agent",Ae={ENTRY:`${Fe}-entry`,MODAL_ROOT:`${Fe}-modal-root`,WINDOW:`${Fe}-window`,LAUNCHER:`${Fe}-launcher`,NUDGE_MESSAGE:`${Fe}-nudge-message`,WINDOW_TITLE:`${Fe}-window-title`},da="data-sb-initial-focus",ma="true",hf=`[${da}="${ma}"]`,ha={[da]:ma},ps="data-sb-focus-trap-sentinel",gf="true",ga="data-sb-initial-focus-header",fa="true",ff=`[${ga}="${fa}"]`,pa={[ga]:fa},Ea="data-sb-message-input",_a="true",pf=`textarea[${Ea}="${_a}"]:not(:disabled)`,Ef={[Ea]:_a},Ca=1e3,vn=2147483647,It={MODAL:vn-1,TOOLTIP:vn-2,WINDOW:vn-3,LAUNCHER:vn-4},Sa=36,_f=100,Cf=mf,va="noopener noreferrer nofollow",Sf=()=>typeof document>"u"||document.visibilityState==="visible",Pr=()=>typeof document<"u"&&document.visibilityState==="hidden",Co=()=>Pr()?"backgrounded":"foregrounded",vf={getState:Co,subscribe:e=>{if(typeof document>"u")return()=>{};const t=()=>e(Co());return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}};function bf(){return{isOnline:()=>navigator.onLine,subscribe:e=>{const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t),window.addEventListener("offline",n),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}const bn={};function yf(){return{get:e=>{try{return localStorage.getItem(e)}catch{return bn[e]??null}},set:(e,t)=>{try{localStorage.setItem(e,t)}catch{bn[e]=t}},delete:e=>{try{localStorage.removeItem(e)}catch{delete bn[e]}},getKeys:e=>{try{const t=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);r&&r.startsWith(e)&&t.push(r)}return t}catch{return Object.keys(bn).filter(t=>t.startsWith(e))}}}}const Af={conversation:{input_placeholder:"Ask a question",input_placeholder_disabled:"Chat is unavailable in this channel",input_placeholder_steward:"Processing your request...",input_placeholder_wait_ai_agent_response:"Waiting for the agent's reply...",input_placeholder_active_form:"Please fill out the form to move forward.",input_placeholder_reconnecting:"Trying to reconnect. Refresh if persists.",unknown_message_type:"(Unknown message type)",powered_by:"Powered by",citation_title:"Source",start_new_conversation_label:"Start a conversation",scroll_to_new_messages_label:()=>"New message",failed_message_resend:"Retry",failed_message_remove:"Remove",file_upload_no_supported_files:"No supported file types available.",file_upload_replace_alert_title:"Replace attachment?",file_upload_replace_alert_description:"Uploading a different file type will replace the current one.",a11y_message_list:"Chat messages",a11y_scroll_to_bottom:"Scroll to bottom",a11y_scroll_to_new_messages:"Scroll to new messages",a11y_open_conversation_list:"Open conversation list",a11y_open_conversation:"Open conversation with Support",a11y_open_conversations:"Open conversations",a11y_close_conversation:"Close conversation",a11y_close_conversations:"Close conversations",a11y_menu:"Menu",a11y_message_input:"Message",a11y_send_message:"Send message",a11y_attach_file:"Attach file",a11y_close_messenger:"Close messenger",a11y_dismiss_nudge_message:"Dismiss message",a11y_expand_messenger:"Expand messenger",a11y_collapse_messenger:"Collapse messenger",a11y_connect_agent:"Talk to human agent",a11y_message_sender_you:"You",a11y_suggested_reply:"Suggested reply",a11y_typing_indicator:"Typing",a11y_code_block_placeholder:"Code block",a11y_typing_format:e=>`${e} is typing`,a11y_message_failed:"Message send failed",a11y_new_messages_received:e=>`${e} new ${e===1?"message":"messages"} received`,a11y_new_messages_received_from_sender:(e,t)=>`${e}: ${t} new ${t===1?"message":"messages"} received`,a11y_agent_connected:e=>"Connected to human agent",a11y_conversation_closed:"Conversation has ended",a11y_file_image:e=>`Image file: ${e}`,a11y_file_video:e=>`Video file: ${e}`,a11y_file_pdf:e=>`PDF file: ${e}`,a11y_file_document:e=>`Document file: ${e}`,a11y_received_file_image:"Image file",a11y_received_file_video:"Video file",a11y_received_file_pdf:e=>`PDF file: ${e}`,a11y_received_files_image_count:e=>`${e} ${e===1?"image":"images"}`,a11y_screen_conversation:"Conversation",a11y_screen_conversation_with_agent:e=>`Conversation with ${e}`,a11y_screen_conversation_list_no_count:"Conversation list",a11y_screen_conversation_list_with_count:e=>`Conversations, ${e} total`,a11y_csat_displayed:"Satisfaction survey displayed",a11y_empty_conversation:"No messages in this conversation",a11y_input_disabled:"Message input is disabled",a11y_file_size_exceeded:e=>`File exceeds size limit of ${e}MB`,a11y_csat_form_error:"Please complete the required fields",a11y_hint_send_message:"Sends the message",a11y_hint_open_conversation:"Opens the conversation",a11y_hint_open_conversations:"Opens conversations",a11y_hint_close_conversation:"Closes the conversation",a11y_hint_close_messenger:"Closes the messenger",a11y_hint_open_menu:"Opens the menu",a11y_hint_connect_to_agent:"Escalates to a human agent",a11y_hint_attach_file:"Opens file attachment options",a11y_hint_view_new_messages:"Scrolls to new messages",a11y_hint_open_file:"Opens the file",a11y_hint_open_image:"Opens the image",a11y_hint_send_reply:"Sends this reply",image_viewer_default_title:"Image",a11y_image_viewer_close:"Close image viewer",a11y_image_viewer_previous:"Previous image",a11y_image_viewer_next:"Next image",a11y_image_viewer_download:"Download image",attachment_document:"Files"},conversation_list:{header_title:"Conversations",ended:"Ended",system_message:"System message",footer_title:"Start a conversation",multiple_files_count:e=>`${e} ${e===1?"file":"files"}`,a11y_conversation_item:(e,t,n,r)=>`${e}, ${t}, ${n}${r>0?`, ${r} unread ${r===1?"message":"messages"}`:""}`},date_format:{just_now:"Just now",minutes_ago:e=>`${e} minutes ago`,hours_ago:e=>`${e} hours ago`,date_short:"MM/dd/yyyy",date_separator:"MMMM dd, yyyy",message_timestamp:"p"},csat:{title:"Your feedback matters to us",submitted_label:"Successfully submitted!",cre_question:"Was your issue resolved?",cre_positive_label:"Yes, thank you! 👍",cre_negative_label:"No, that didn't help.",reason_placeholder:"Share your feedback",question:"How would you rate your experience?",submit_label:"Submit",submission_expired:"We're sorry, the survey period has ended.",a11y_csat_rating_label:(e,t)=>`${e} out of 5 — ${t}`,a11y_hint_select_rating:"Selects this rating"},form:{optional_label:"optional",validation_required:"This question is required"},common:{placeholder_something_went_wrong:"Something went wrong",placeholder_no_messages:"No messages",placeholder_no_conversations:"No conversations yet",placeholder_something_went_wrong_retry_label:"Retry",button_ok:"OK",button_cancel:"Cancel"},feedback:{title:"Submit feedback",good:"Good",bad:"Bad",comment_label:"Comment (optional)",comment_placeholder:"Leave a comment",cancel:"Cancel",submit:"Submit",save:"Save",edit:"Edit feedback",remove:"Remove feedback"},handoff:{confirm_title:"Request handoff?",confirm_description:"You'll be transferred to a human agent. Your conversation history will be shared.",confirm_cancel:"Cancel",confirm_handoff:"Handoff"},memory:{dialog_title:"Memory",desc_on:"Memory is **turned on**. It remembers your conversation history to provide personalized responses tailored to your previous questions and preferences.",desc_off:"Memory is **turned off**. If turned on, it will remember your conversation history to provide personalized responses tailored to your previous questions and preferences.",button_use:"Use",button_dont_use:"Don't use",button_keep_using:"Keep using",button_disable:"Disable",button_disable_and_delete:"Disable & Delete memory",button_keep_off:"Keep off",button_enable:"Enable memory",button_cancel:"Cancel",error_message:"Failed to update memory state. Please try again.",a11y_indicator_manage:"Manage memory",a11y_indicator_on:"Memory is on",a11y_indicator_off:"Memory is off"},connection_delay:{title:"Something went wrong. You'll be reconnected shortly.",description:e=>`Estimated waiting time: ${e}`},desk:{ticket_closure_confirm:"Yes, it's resolved",ticket_closure_decline:"No, I still need help",ticket_closure_error_message:"Failed to update the resolution status. Please try again."}},$r={language:"en",strings:Af,dateLocale:nl.enUS},ba=e=>({MESSAGE_INPUT__PLACE_HOLDER:e.conversation.input_placeholder,MESSAGE_INPUT__PLACE_HOLDER__DISABLED:e.conversation.input_placeholder_disabled,MESSAGE_INPUT__PLACE_HOLDER__STEWARD:e.conversation.input_placeholder_steward,MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE:e.conversation.input_placeholder_wait_ai_agent_response,MESSAGE_INPUT__PLACE_HOLDER__RECONNECTING:e.conversation.input_placeholder_reconnecting,UNKNOWN__UNKNOWN_MESSAGE_TYPE:e.conversation.unknown_message_type,POWERED_BY:e.conversation.powered_by,CSAT_TITLE_UNSUBMITTED:e.csat.title,CSAT_TITLE_SUBMITTED:e.csat.submitted_label,CSAT_CRE_TITLE:e.csat.cre_question,CSAT_CRE_SOLVED:e.csat.cre_positive_label,CSAT_CRE_NOT_SOLVED:e.csat.cre_negative_label,CSAT_REASON_PLACEHOLDER:e.csat.reason_placeholder,CSAT_RATING_TITLE:e.csat.question,CSAT_SUBMIT_LABEL:e.csat.submit_label,CSAT_SUBMISSION_EXPIRED:e.csat.submission_expired,DATE_FORMAT__JUST_NOW:e.date_format.just_now,DATE_FORMAT__MINUTES_AGO:e.date_format.minutes_ago,DATE_FORMAT__HOURS_AGO:e.date_format.hours_ago,DATE_FORMAT__DATE_SHORT:e.date_format.date_short,DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR:e.date_format.date_separator,DATE_FORMAT__MESSAGE_TIMESTAMP:e.date_format.message_timestamp,CONVERSATION_LIST__HEADER_TITLE:e.conversation_list.header_title,CONVERSATION_LIST__ENDED:e.conversation_list.ended,CONVERSATION_LIST__SYSTEM_MESSAGE:e.conversation_list.system_message,CONVERSATION_LIST__NO_CONVERSATIONS:e.common.placeholder_no_conversations,CONVERSATION_LIST__MULTIPLE_FILES_COUNT:e.conversation_list.multiple_files_count,TALK_TO_AGENT:e.conversation.start_new_conversation_label,CITATION_SOURCE_TITLE:e.conversation.citation_title,FORM_PLACEHOLDER:e.conversation.input_placeholder_active_form,FORM_VALIDATION_REQUIRED:e.form.validation_required,OPTIONAL:e.form.optional_label,PLACE_HOLDER__WRONG:e.common.placeholder_something_went_wrong,PLACE_HOLDER__NO_MESSAGES:e.common.placeholder_no_messages,RETRY:e.common.placeholder_something_went_wrong_retry_label,BUTTON__OK:e.common.button_ok,BUTTON__CANCEL:e.common.button_cancel,FAILED_MESSAGE_RESEND:e.conversation.failed_message_resend,FAILED_MESSAGE_REMOVE:e.conversation.failed_message_remove,DESK__TICKET_CLOSURE_CONFIRM:e.desk.ticket_closure_confirm,DESK__TICKET_CLOSURE_DECLINE:e.desk.ticket_closure_decline,DESK__TICKET_CLOSURE_ERROR_MESSAGE:e.desk.ticket_closure_error_message,FILE_UPLOAD_NO_SUPPORTED_FILES:e.conversation.file_upload_no_supported_files,FILE_UPLOAD_REPLACE_ALERT__TITLE:e.conversation.file_upload_replace_alert_title,FILE_UPLOAD_REPLACE_ALERT__DESCRIPTION:e.conversation.file_upload_replace_alert_description,FILE_UPLOAD_FILES:e.conversation.attachment_document,FEEDBACK_TITLE:e.feedback.title,FEEDBACK_GOOD:e.feedback.good,FEEDBACK_BAD:e.feedback.bad,FEEDBACK_COMMENT_LABEL:e.feedback.comment_label,FEEDBACK_COMMENT_PLACEHOLDER:e.feedback.comment_placeholder,FEEDBACK_CANCEL:e.feedback.cancel,FEEDBACK_SUBMIT:e.feedback.submit,FEEDBACK_SAVE:e.feedback.save,FEEDBACK_EDIT:e.feedback.edit,FEEDBACK_REMOVE:e.feedback.remove,A11Y_MESSAGE_LIST:e.conversation.a11y_message_list,A11Y_SCROLL_TO_BOTTOM:e.conversation.a11y_scroll_to_bottom,A11Y_SCROLL_TO_NEW_MESSAGES:e.conversation.a11y_scroll_to_new_messages,A11Y_OPEN_CONVERSATION_LIST:e.conversation.a11y_open_conversation_list,A11Y_OPEN_CONVERSATION:e.conversation.a11y_open_conversation,A11Y_OPEN_CONVERSATIONS:e.conversation.a11y_open_conversations,A11Y_CLOSE_CONVERSATION:e.conversation.a11y_close_conversation,A11Y_CLOSE_CONVERSATIONS:e.conversation.a11y_close_conversations,A11Y_MENU:e.conversation.a11y_menu,A11Y_MESSAGE_INPUT:e.conversation.a11y_message_input,A11Y_SEND_MESSAGE:e.conversation.a11y_send_message,A11Y_ATTACH_FILE:e.conversation.a11y_attach_file,A11Y_CONNECT_AGENT:e.conversation.a11y_connect_agent,A11Y_CLOSE_MESSENGER:e.conversation.a11y_close_messenger,A11Y_DISMISS_NUDGE_MESSAGE:e.conversation.a11y_dismiss_nudge_message,A11Y_EXPAND_MESSENGER:e.conversation.a11y_expand_messenger,A11Y_COLLAPSE_MESSENGER:e.conversation.a11y_collapse_messenger,A11Y_MESSAGE_SENDER_YOU:e.conversation.a11y_message_sender_you,A11Y_SUGGESTED_REPLY:e.conversation.a11y_suggested_reply,A11Y_TYPING_INDICATOR:e.conversation.a11y_typing_indicator,A11Y_CODE_BLOCK_PLACEHOLDER:e.conversation.a11y_code_block_placeholder,A11Y_TYPING_FORMAT:e.conversation.a11y_typing_format,A11Y_MESSAGE_FAILED:e.conversation.a11y_message_failed,A11Y_NEW_MESSAGES_RECEIVED:e.conversation.a11y_new_messages_received,A11Y_NEW_MESSAGES_RECEIVED_FROM_SENDER:e.conversation.a11y_new_messages_received_from_sender,A11Y_AGENT_CONNECTED:e.conversation.a11y_agent_connected,A11Y_CONVERSATION_CLOSED:e.conversation.a11y_conversation_closed,A11Y_FILE_IMAGE:e.conversation.a11y_file_image,A11Y_FILE_VIDEO:e.conversation.a11y_file_video,A11Y_FILE_PDF:e.conversation.a11y_file_pdf,A11Y_FILE_DOCUMENT:e.conversation.a11y_file_document,A11Y_RECEIVED_FILE_IMAGE:e.conversation.a11y_received_file_image,A11Y_RECEIVED_FILE_VIDEO:e.conversation.a11y_received_file_video,A11Y_RECEIVED_FILE_PDF:e.conversation.a11y_received_file_pdf,A11Y_RECEIVED_FILES_IMAGE_COUNT:e.conversation.a11y_received_files_image_count,A11Y_SCREEN_CONVERSATION:e.conversation.a11y_screen_conversation,A11Y_SCREEN_CONVERSATION_WITH_AGENT:e.conversation.a11y_screen_conversation_with_agent,A11Y_SCREEN_CONVERSATION_LIST_NO_COUNT:e.conversation.a11y_screen_conversation_list_no_count,A11Y_SCREEN_CONVERSATION_LIST_WITH_COUNT:e.conversation.a11y_screen_conversation_list_with_count,A11Y_CSAT_DISPLAYED:e.conversation.a11y_csat_displayed,A11Y_EMPTY_CONVERSATION:e.conversation.a11y_empty_conversation,A11Y_INPUT_DISABLED:e.conversation.a11y_input_disabled,A11Y_FILE_SIZE_EXCEEDED:e.conversation.a11y_file_size_exceeded,A11Y_CSAT_FORM_ERROR:e.conversation.a11y_csat_form_error,A11Y_HINT_SEND_MESSAGE:e.conversation.a11y_hint_send_message,A11Y_HINT_OPEN_CONVERSATION:e.conversation.a11y_hint_open_conversation,A11Y_HINT_OPEN_CONVERSATIONS:e.conversation.a11y_hint_open_conversations,A11Y_HINT_CLOSE_CONVERSATION:e.conversation.a11y_hint_close_conversation,A11Y_HINT_OPEN_MENU:e.conversation.a11y_hint_open_menu,A11Y_HINT_CONNECT_TO_AGENT:e.conversation.a11y_hint_connect_to_agent,A11Y_HINT_ATTACH_FILE:e.conversation.a11y_hint_attach_file,A11Y_HINT_VIEW_NEW_MESSAGES:e.conversation.a11y_hint_view_new_messages,A11Y_HINT_OPEN_FILE:e.conversation.a11y_hint_open_file,A11Y_HINT_OPEN_IMAGE:e.conversation.a11y_hint_open_image,A11Y_HINT_SEND_REPLY:e.conversation.a11y_hint_send_reply,A11Y_CONVERSATION_ITEM:e.conversation_list.a11y_conversation_item,A11Y_CSAT_RATING_LABEL:e.csat.a11y_csat_rating_label,A11Y_HINT_SELECT_RATING:e.csat.a11y_hint_select_rating,IMAGE_VIEWER__DEFAULT_TITLE:e.conversation.image_viewer_default_title,A11Y_IMAGE_VIEWER_CLOSE:e.conversation.a11y_image_viewer_close,A11Y_IMAGE_VIEWER_PREVIOUS:e.conversation.a11y_image_viewer_previous,A11Y_IMAGE_VIEWER_NEXT:e.conversation.a11y_image_viewer_next,A11Y_IMAGE_VIEWER_DOWNLOAD:e.conversation.a11y_image_viewer_download,SCROLL_TO_NEW_MESSAGES_LABEL:e.conversation.scroll_to_new_messages_label,HANDOFF_CONFIRM__TITLE:e.handoff.confirm_title,HANDOFF_CONFIRM__DESCRIPTION:e.handoff.confirm_description,HANDOFF_CONFIRM__CANCEL:e.handoff.confirm_cancel,HANDOFF_CONFIRM__HANDOFF:e.handoff.confirm_handoff,MEMORY__DIALOG_TITLE:e.memory.dialog_title,MEMORY__DESC_ON:e.memory.desc_on,MEMORY__DESC_OFF:e.memory.desc_off,MEMORY__BUTTON_USE:e.memory.button_use,MEMORY__BUTTON_DONT_USE:e.memory.button_dont_use,MEMORY__BUTTON_KEEP_USING:e.memory.button_keep_using,MEMORY__BUTTON_DISABLE:e.memory.button_disable,MEMORY__BUTTON_DISABLE_AND_DELETE:e.memory.button_disable_and_delete,MEMORY__BUTTON_KEEP_OFF:e.memory.button_keep_off,MEMORY__BUTTON_ENABLE:e.memory.button_enable,MEMORY__BUTTON_CANCEL:e.memory.button_cancel,MEMORY__ERROR_MESSAGE:e.memory.error_message,A11Y_MEMORY_INDICATOR_MANAGE:e.memory.a11y_indicator_manage,A11Y_MEMORY_INDICATOR_ON:e.memory.a11y_indicator_on,A11Y_MEMORY_INDICATOR_OFF:e.memory.a11y_indicator_off,CONNECTION_DELAY__TITLE:e.connection_delay.title,CONNECTION_DELAY__DESCRIPTION:e.connection_delay.description}),ya=e=>{var t;return((t=e.split("-"))==null?void 0:t[0])??un},un="en",Aa=new Set([un,"ko","es","pt","fr","hi","it","de","tr","ja"]),Tf='@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}',{Provider:If,useContext:Es}=ye("AgentUIElementResolver"),xf=({entryElement:e,modalRootElement:t,rootElement:n,children:r})=>{const s=l.useMemo(()=>{const o=n??document.body,i=e??o,c=t??o,u=d=>d===Ae.MODAL_ROOT?c:i.querySelector(`#${d}`);return{resolveElement:u,resolvePortalContainer:d=>u(d)??c}},[e,t,n]);return a.createElement(If,{value:s},r)};function _t(e,t){const n=e.getRootNode({composed:t});return n instanceof ShadowRoot||n instanceof Document?n:document}const So=()=>{const e=[];let t=0;const n=new Set,r=()=>n.forEach(s=>s());return{register:s=>{const o=++t;return e.push({id:o,handler:s}),r(),()=>{const i=e.findIndex(c=>c.id===o);i>=0&&(e.splice(i,1),r())}},dismissTopmost:()=>{const s=e[e.length-1];return s?(s.handler(),!0):!1},subscribe:s=>(n.add(s),()=>{n.delete(s)}),getOpenCount:()=>e.length}},{Provider:Mf,useContext:_s}=ye("EscapeDismissStack"),vo=e=>{e.stopPropagation(),e.stopImmediatePropagation()},Rf=({rootElement:e=document.body,boundaryElement:t,children:n})=>{const r=l.useRef(null),s=l.useRef(null);r.current||(r.current=So()),s.current||(s.current=So());const o=r.current,i=s.current;l.useLayoutEffect(()=>{const u=t??_t(e),d=m=>{if(m.key==="Escape"){if(o.dismissTopmost()){vo(m);return}i.dismissTopmost()&&vo(m)}};return u.addEventListener("keydown",d),()=>u.removeEventListener("keydown",d)},[t,e,i,o]);const c=l.useMemo(()=>({register:o.register,dismissTopmost:o.dismissTopmost,registerShellDismissHandler:i.register,subscribe:o.subscribe,getOpenCount:o.getOpenCount}),[i,o]);return a.createElement(Mf,{value:c},n)},Ta=(e,t,n)=>{const r=l.useRef(t);l.useLayoutEffect(()=>{r.current=t},[t]),l.useLayoutEffect(()=>{if(e)return n(()=>r.current())},[e,n])},kf=(e,t)=>{const{register:n}=_s();Ta(e,t,n)},wf=(e,t)=>{const{registerShellDismissHandler:n}=_s();Ta(e,t,n)},Ia=()=>{const{subscribe:e,getOpenCount:t}=_s();return l.useSyncExternalStore(e,()=>t()>0,()=>!1)},Lf=(e,t,n)=>{const r=e[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((s,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},bo=ba($r.strings),Of={...bo,HEADER_BUTTON__AGENT_HANDOFF:"Talk to human agent",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Select an option to continue",BUTTON__SUBMIT:"Submit",SUBMITTED:"Submitted",TRY_AGAIN:"Please try again.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Up to %d files can be attached.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"The maximum size per file is %d MB.",FILE_UPLOAD_NOTIFICATION__FILES_EXCLUDED_BY_VALIDATION:"%d files were excluded due to limits. Please select files individually.",FILE_UPLOAD_PHOTOS:"Photos",FILE_VIEWER__UNSUPPORT:"Unsupported message",A11Y_FILE_SELECTED:e=>`${e}, selected`,A11Y_FILE_REMOVE_BUTTON:e=>`Remove file: ${e}`,A11Y_FILE_UPLOAD_OPTIONS:"File upload options",A11Y_FAILED_MESSAGE_OPTIONS:"Failed message options",A11Y_FEEDBACK_OPTIONS:"Feedback options",A11Y_CSAT_TEXT_INPUT_LABEL:"Enter answer",FORM_UNAVAILABLE:"Form is no longer available.",FORM_NOT_SUPPORTED:"This form is not supported in the current version.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimum ${e} characters required`,FORM_VALIDATION_MAX_LENGTH:e=>`Maximum ${e} characters allowed`,FORM_VALIDATION_MIN:e=>`Minimum value is ${e}`,FORM_VALIDATION_MAX:e=>`Maximum value is ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Select at least ${e} options`,FORM_VALIDATION_MAX_SELECT:e=>`Select at most ${e} options`,FORM_VALIDATION_REGEX_FAILED:"Invalid format",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:bo.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"h:mma",CONVERSATION_LIST__TOPICS_FALLBACK:"No category",CONVERSATION_CLOSED_FOOTER_LABEL:"Your conversation has ended",START_NEW_CONVERSATION:"💬 Start a new conversation",RETURN_TO_CONVERSATION:"💬 Return to conversation",BUTTON__SAVE:"Save",NO_NAME:"(No name)",CHANNEL_FROZEN:"Channel frozen"},Fn={language:$r.language,dateLocale:$r.dateLocale,stringSet:Of},Nf=Object.freeze(Object.defineProperty({__proto__:null,default:Fn},Symbol.toStringTag,{value:"Module"})),Fr=new Map([[un,Fn]]);async function Df(e){const t=Fr.get(e);if(t)return t;try{if(Aa.has(e)){const{default:n}=await Lf(Object.assign({"./languages/de.ts":()=>Promise.resolve().then(()=>require("./cjs/qr4Ghr48.cjs")),"./languages/en.ts":()=>Promise.resolve().then(()=>Nf),"./languages/es.ts":()=>Promise.resolve().then(()=>require("./cjs/fdHbDI5i.cjs")),"./languages/fr.ts":()=>Promise.resolve().then(()=>require("./cjs/DsrX4pE_.cjs")),"./languages/hi.ts":()=>Promise.resolve().then(()=>require("./cjs/BoXkkKL_.cjs")),"./languages/it.ts":()=>Promise.resolve().then(()=>require("./cjs/De9EY1XB.cjs")),"./languages/ja.ts":()=>Promise.resolve().then(()=>require("./cjs/DoR1M7Tp.cjs")),"./languages/ko.ts":()=>Promise.resolve().then(()=>require("./cjs/s8NcCXAz.cjs")),"./languages/pt.ts":()=>Promise.resolve().then(()=>require("./cjs/D3Aoub0b.cjs")),"./languages/tr.ts":()=>Promise.resolve().then(()=>require("./cjs/D-lytti9.cjs"))}),`./languages/${e}.ts`,3);return Fr.set(e,n),n}return Fn}catch{return Fn}}const{Provider:Pf,useContext:le}=ye("Localization"),$f=({language:e=navigator.language,languageCode:t,logger:n,stringSet:r,children:s})=>{const[o,i]=l.useState(Fr.get(un));return l.useEffect(()=>{const c=t??ya(e);o.language!==c&&(n==null||n.debug("localization.useEffect: update language",{from:o.language,to:c}),Df(c).then(i))},[e,t,n]),a.createElement(Pf,{value:{language:o.language,defaultStringSet:o.stringSet,stringSet:{...o.stringSet,...r},dateLocale:o.dateLocale,format:(c,u,d)=>pt.format(c,u,{locale:o.dateLocale,...d})}},s)},Un="data-sb-agent-theme",yo=e=>(t,...n)=>{let r="";return t.forEach((s,o)=>{r+=s+(n[o]??"")}),`[${Un}='${e}'] & { ${r} }`},ne={light:yo("light"),dark:yo("dark")},Ff=F.css(({theme:e})=>{const{palette:t}=e;return`
17
+ `);if(!n)return;const r=[];let s=n;s=zg(s,t),s=Bg(s);const o=Vg(s);s=o.text,r.push(...o.inlineCodes),s=Ng(s),s=Dg(s),s=Pg(s),s=$g(s),s=Fg(s),s=Hg(s),s=Gg(s),s=Ug(s);for(let c=0;c<r.length;c++)s=s.replaceAll(sa(c),r[c]);return $t(s)||void 0},Kg=(e,t)=>{var s;const n=((s=e.name)==null?void 0:s.trim())||"",r=e.mimeType??"";return Ve(r)?t.image:on(r)?t.video:Ti({name:n,mimeType:r})?t.pdf(n):t.document(n)},$n=e=>(e==null?void 0:e.trim())||"",qg=e=>(e?$t(e):void 0)||void 0,Eo=30,Wg=e=>e.length>Eo?`${e.slice(0,Eo)}…`:e,Yg=({agent:e,status:t,lastMessage:n,time:r,unreadCount:s},o)=>{const i=Wg($t(n)),c=[t,i].filter(Boolean).join(", ");return o($t(e),$t(c),r,s)},Dr=e=>({text:$n(e),format:"plain"}),jg=e=>({text:$n(e),format:"markdown"}),Xg=({markdownText:e,plainText:t,comparisonText:n})=>{const r=$n(e);return r&&r!==$n(n)?jg(r):Dr(t)},en=({sender:e,message:t,messageFormat:n="plain",time:r,codeBlockPlaceholder:s})=>{const o=[],i=n==="markdown"?ca(t,{codeBlockPlaceholder:s}):qg(t);if(r&&o.push(r),e&&o.push(e),i&&o.push(i),o.length!==0)return o.join(", ")},la=(e,t)=>ca(e==null?void 0:e.trim(),t!==void 0?{codeBlockPlaceholder:t}:void 0),Zg=(...e)=>$t(e.filter(Boolean).join(", "))||void 0,_o=(e,t,n,r)=>{if(!t||Ii(t,n))return e;const s=la(t,r);return s?Zg(e,s):e},ua=(e,t)=>{var r,s;const n=(r=e.message)==null?void 0:r.trim();if(e.isFileMessage()){const o=((s=e.name)==null?void 0:s.trim())||"",i=Kg({name:o,mimeType:e.type},t);return _o(i,n,[o],t.codeBlockPlaceholder)}if(e.isMultipleFilesMessage()){const o=e.fileInfoList??[],i=o.length;if(i===0)return;const c=o.map(m=>{var h;return((h=m.fileName)==null?void 0:h.trim())||""}),d=o.every(m=>{var h;return(h=m.mimeType)==null?void 0:h.startsWith("image")})?t.receivedFilesImageCount(i):t.multipleFilesCount(i);return _o(d,n,c,t.codeBlockPlaceholder)}return la(n,t.codeBlockPlaceholder)},Jg=(e,t={})=>{const{throttleMs:n=1e3,isSuppressed:r,maxOrderedQueueSize:s=10}=t,o=Math.max(1,s);let i=null;const c=[];let u=null,d=null,m=null,h=!1,g=0;const f=(R,M,$)=>({text:R,ignoreSuppression:M,queueOrder:g++,dedupeKey:$}),p=()=>{const R=c[0]??null,M=i;return R&&M?M.queueOrder<R.queueOrder?(i=null,M):c.shift()??null:R?c.shift()??null:M!==null?(i=null,M):null},C=()=>{for(;;){const R=p();if(!R)return null;if(!(!R.ignoreSuppression&&(r!=null&&r())))return R}},_=R=>{u=R.text,d=R.dedupeKey??null,h=!0,e(R.text),m=setTimeout(()=>{m=null,h=!1;const M=C();M&&_(M)},n)},E=R=>{u=R.text,d=R.dedupeKey??null,e(R.text)},A=(R,M,$,N)=>M!=null&&N!=null?M===N:M==null&&N==null?R!=null&&R===$:!1,y=(R,M,$)=>{if(!R||!M&&(r!=null&&r()))return;const N=$==null?void 0:$.dedupeKey;if(!(h&&A(R,N,u,d)))if(h){if((($==null?void 0:$.mode)??"latestOnly")==="ordered"){const se=c[c.length-1];if(se&&A(R,N,se.text,se.dedupeKey))return;c.push(f(R,M,N)),c.length>o&&c.shift();return}i=f(R,M,N)}else i=null,_(f(R,M,N))};return{announce:(R,M)=>{y(R,!1,M)},announceIgnoringSuppression:(R,M)=>{y(R,!0,M)},flush:()=>{const R=[];let M=p();for(;M!==null;)R.push(M),M=p();if(m!==null&&(clearTimeout(m),m=null),h=!1,R.length!==0)for(const $ of R)E($)},destroy:()=>{m!==null&&(clearTimeout(m),m=null),i=null,c.length=0,u=null,d=null,h=!1}}},Qg=e=>{switch(e){case"newMessage":case"conversationClosed":case"csatDisplayed":case"csatSubmitted":case"csatExpired":return"ordered";default:return"latestOnly"}},ef=(e,t)=>e.screen==="conversationList"?typeof e.conversationCount=="number"?t.screenConversationListWithCount(e.conversationCount):t.screenConversationListNoCount:[e.agentName?t.screenConversationWithAgent(e.agentName):t.screenConversation,e.isClosed?t.conversationClosed:null,e.isClosed&&e.hasCSAT?t.csatDisplayed:null,e.isEmpty?t.emptyState:null].filter(r=>!!r).join(". "),tf=(e,t)=>{switch(e.event){case"newMessage":return e.body!==void 0||e.time!==void 0?[t.newMessage(1),e.time,e.senderName,e.body].filter(r=>!!r).join(", "):e.senderName?t.newMessageFromSender(e.senderName,1):t.newMessage(1);case"typing":return t.typing(e.agentName??"");case"sendFailed":return t.sendFailed;case"agentConnected":return t.agentConnected(e.agentName??"");case"conversationClosed":return t.conversationClosed;case"csatDisplayed":return t.csatDisplayed;case"csatSubmitted":return e.submittedLabel;case"csatExpired":return t.csatExpired;case"emptyState":return t.emptyState;case"inputDisabled":return t.inputDisabled}},nf=(e,t)=>{switch(e.type){case"fileSizeExceeded":return t.fileSizeExceeded(e.maxSizeMB??25);case"sendFailed":return t.sendFailed;case"csatFormError":return t.csatFormError;case"generic":return e.message}},rf=(e,t)=>!t||!Xe(e)||e.sender.userId!==t?null:e.reqId||(e.messageId>0?String(e.messageId):null),sf=(e,t)=>Le.isAdmin(e)?Le.isCSAT(e):"sender"in e?e.sender.userId!==t:!1,of=e=>"messageId"in e&&e.messageId>0?String(e.messageId):"reqId"in e&&typeof e.reqId=="string"&&e.reqId.length>0?e.reqId:null,af=e=>e===_e.CollectionEventSource.EVENT_MESSAGE_RECEIVED||e===_e.CollectionEventSource.EVENT_MESSAGE_UPDATED,cf=({isOpened:e,opensConversationList:t})=>e?t?"closeConversationList":"closeConversation":t?"openConversationList":"openConversation",lf=(e,t)=>{switch(e){case"closeConversationList":return t.closeConversationList;case"closeConversation":return t.closeConversation;case"openConversationList":return t.openConversationList;case"openConversation":return t.openConversation}},uf=(e,t)=>{switch(e){case"closeConversation":return t.hintCloseConversation;case"openConversationList":return t.hintOpenConversationList;case"openConversation":return t.hintOpenConversation;default:return}},df=({intent:e,strings:t})=>({label:lf(e,t),hint:uf(e,t)}),mf="1.43.1",Fe="sb-agent",Ae={ENTRY:`${Fe}-entry`,MODAL_ROOT:`${Fe}-modal-root`,WINDOW:`${Fe}-window`,LAUNCHER:`${Fe}-launcher`,NUDGE_MESSAGE:`${Fe}-nudge-message`,WINDOW_TITLE:`${Fe}-window-title`},da="data-sb-initial-focus",ma="true",hf=`[${da}="${ma}"]`,ha={[da]:ma},ps="data-sb-focus-trap-sentinel",gf="true",ga="data-sb-initial-focus-header",fa="true",ff=`[${ga}="${fa}"]`,pa={[ga]:fa},Ea="data-sb-message-input",_a="true",pf=`textarea[${Ea}="${_a}"]:not(:disabled)`,Ef={[Ea]:_a},Ca=1e3,vn=2147483647,It={MODAL:vn-1,TOOLTIP:vn-2,WINDOW:vn-3,LAUNCHER:vn-4},Sa=36,_f=100,Cf=mf,va="noopener noreferrer nofollow",Sf=()=>typeof document>"u"||document.visibilityState==="visible",Pr=()=>typeof document<"u"&&document.visibilityState==="hidden",Co=()=>Pr()?"backgrounded":"foregrounded",vf={getState:Co,subscribe:e=>{if(typeof document>"u")return()=>{};const t=()=>e(Co());return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}};function bf(){return{isOnline:()=>navigator.onLine,subscribe:e=>{const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t),window.addEventListener("offline",n),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}const bn={};function yf(){return{get:e=>{try{return localStorage.getItem(e)}catch{return bn[e]??null}},set:(e,t)=>{try{localStorage.setItem(e,t)}catch{bn[e]=t}},delete:e=>{try{localStorage.removeItem(e)}catch{delete bn[e]}},getKeys:e=>{try{const t=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);r&&r.startsWith(e)&&t.push(r)}return t}catch{return Object.keys(bn).filter(t=>t.startsWith(e))}}}}const Af={conversation:{input_placeholder:"Ask a question",input_placeholder_disabled:"Chat is unavailable in this channel",input_placeholder_steward:"Processing your request...",input_placeholder_wait_ai_agent_response:"Waiting for the agent's reply...",input_placeholder_active_form:"Please fill out the form to move forward.",input_placeholder_reconnecting:"Trying to reconnect. Refresh if persists.",unknown_message_type:"(Unknown message type)",powered_by:"Powered by",citation_title:"Source",start_new_conversation_label:"Start a conversation",scroll_to_new_messages_label:()=>"New message",failed_message_resend:"Retry",failed_message_remove:"Remove",file_upload_no_supported_files:"No supported file types available.",file_upload_replace_alert_title:"Replace attachment?",file_upload_replace_alert_description:"Uploading a different file type will replace the current one.",a11y_message_list:"Chat messages",a11y_scroll_to_bottom:"Scroll to bottom",a11y_scroll_to_new_messages:"Scroll to new messages",a11y_open_conversation_list:"Open conversation list",a11y_open_conversation:"Open conversation with Support",a11y_open_conversations:"Open conversations",a11y_close_conversation:"Close conversation",a11y_close_conversations:"Close conversations",a11y_menu:"Menu",a11y_message_input:"Message",a11y_send_message:"Send message",a11y_attach_file:"Attach file",a11y_close_messenger:"Close messenger",a11y_dismiss_nudge_message:"Dismiss message",a11y_expand_messenger:"Expand messenger",a11y_collapse_messenger:"Collapse messenger",a11y_connect_agent:"Talk to human agent",a11y_message_sender_you:"You",a11y_suggested_reply:"Suggested reply",a11y_typing_indicator:"Typing",a11y_code_block_placeholder:"Code block",a11y_typing_format:e=>`${e} is typing`,a11y_message_failed:"Message send failed",a11y_new_messages_received:e=>`${e} new ${e===1?"message":"messages"} received`,a11y_new_messages_received_from_sender:(e,t)=>`${e}: ${t} new ${t===1?"message":"messages"} received`,a11y_agent_connected:e=>"Connected to human agent",a11y_conversation_closed:"Conversation has ended",a11y_file_image:e=>`Image file: ${e}`,a11y_file_video:e=>`Video file: ${e}`,a11y_file_pdf:e=>`PDF file: ${e}`,a11y_file_document:e=>`Document file: ${e}`,a11y_received_file_image:"Image file",a11y_received_file_video:"Video file",a11y_received_file_pdf:e=>`PDF file: ${e}`,a11y_received_files_image_count:e=>`${e} ${e===1?"image":"images"}`,a11y_screen_conversation:"Conversation",a11y_screen_conversation_with_agent:e=>`Conversation with ${e}`,a11y_screen_conversation_list_no_count:"Conversation list",a11y_screen_conversation_list_with_count:e=>`Conversations, ${e} total`,a11y_csat_displayed:"Satisfaction survey displayed",a11y_empty_conversation:"No messages in this conversation",a11y_input_disabled:"Message input is disabled",a11y_file_size_exceeded:e=>`File exceeds size limit of ${e}MB`,a11y_csat_form_error:"Please complete the required fields",a11y_hint_send_message:"Sends the message",a11y_hint_open_conversation:"Opens the conversation",a11y_hint_open_conversations:"Opens conversations",a11y_hint_close_conversation:"Closes the conversation",a11y_hint_close_messenger:"Closes the messenger",a11y_hint_open_menu:"Opens the menu",a11y_hint_connect_to_agent:"Escalates to a human agent",a11y_hint_attach_file:"Opens file attachment options",a11y_hint_view_new_messages:"Scrolls to new messages",a11y_hint_open_file:"Opens the file",a11y_hint_open_image:"Opens the image",a11y_hint_send_reply:"Sends this reply",image_viewer_default_title:"Image",a11y_image_viewer_close:"Close image viewer",a11y_image_viewer_previous:"Previous image",a11y_image_viewer_next:"Next image",a11y_image_viewer_download:"Download image",attachment_document:"Files"},conversation_list:{header_title:"Conversations",ended:"Ended",system_message:"System message",footer_title:"Start a conversation",multiple_files_count:e=>`${e} ${e===1?"file":"files"}`,a11y_conversation_item:(e,t,n,r)=>`${e}, ${t}, ${n}${r>0?`, ${r} unread ${r===1?"message":"messages"}`:""}`},date_format:{just_now:"Just now",minutes_ago:e=>`${e} minutes ago`,hours_ago:e=>`${e} hours ago`,date_short:"MM/dd/yyyy",date_separator:"MMMM dd, yyyy",message_timestamp:"p"},csat:{title:"Your feedback matters to us",submitted_label:"Successfully submitted!",cre_question:"Was your issue resolved?",cre_positive_label:"Yes, thank you! 👍",cre_negative_label:"No, that didn't help.",reason_placeholder:"Share your feedback",question:"How would you rate your experience?",submit_label:"Submit",submission_expired:"We're sorry, the survey period has ended.",a11y_csat_rating_label:(e,t)=>`${e} out of 5 — ${t}`,a11y_hint_select_rating:"Selects this rating"},form:{optional_label:"optional",validation_required:"This question is required"},common:{placeholder_something_went_wrong:"Something went wrong",placeholder_no_messages:"No messages",placeholder_no_conversations:"No conversations yet",placeholder_something_went_wrong_retry_label:"Retry",button_ok:"OK",button_cancel:"Cancel"},feedback:{title:"Submit feedback",good:"Good",bad:"Bad",comment_label:"Comment (optional)",comment_placeholder:"Leave a comment",cancel:"Cancel",submit:"Submit",save:"Save",edit:"Edit feedback",remove:"Remove feedback"},handoff:{confirm_title:"Request handoff?",confirm_description:"You'll be transferred to a human agent. Your conversation history will be shared.",confirm_cancel:"Cancel",confirm_handoff:"Handoff"},memory:{dialog_title:"Memory",desc_on:"Memory is **turned on**. It remembers your conversation history to provide personalized responses tailored to your previous questions and preferences.",desc_off:"Memory is **turned off**. If turned on, it will remember your conversation history to provide personalized responses tailored to your previous questions and preferences.",button_use:"Use",button_dont_use:"Don't use",button_keep_using:"Keep using",button_disable:"Disable",button_disable_and_delete:"Disable & Delete memory",button_keep_off:"Keep off",button_enable:"Enable memory",button_cancel:"Cancel",error_message:"Failed to update memory state. Please try again.",a11y_indicator_manage:"Manage memory",a11y_indicator_on:"Memory is on",a11y_indicator_off:"Memory is off"},connection_delay:{title:"Something went wrong. You'll be reconnected shortly.",description:e=>`Estimated waiting time: ${e}`},desk:{ticket_closure_confirm:"Yes, it's resolved",ticket_closure_decline:"No, I still need help",ticket_closure_error_message:"Failed to update the resolution status. Please try again."}},$r={language:"en",strings:Af,dateLocale:nl.enUS},ba=e=>({MESSAGE_INPUT__PLACE_HOLDER:e.conversation.input_placeholder,MESSAGE_INPUT__PLACE_HOLDER__DISABLED:e.conversation.input_placeholder_disabled,MESSAGE_INPUT__PLACE_HOLDER__STEWARD:e.conversation.input_placeholder_steward,MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE:e.conversation.input_placeholder_wait_ai_agent_response,MESSAGE_INPUT__PLACE_HOLDER__RECONNECTING:e.conversation.input_placeholder_reconnecting,UNKNOWN__UNKNOWN_MESSAGE_TYPE:e.conversation.unknown_message_type,POWERED_BY:e.conversation.powered_by,CSAT_TITLE_UNSUBMITTED:e.csat.title,CSAT_TITLE_SUBMITTED:e.csat.submitted_label,CSAT_CRE_TITLE:e.csat.cre_question,CSAT_CRE_SOLVED:e.csat.cre_positive_label,CSAT_CRE_NOT_SOLVED:e.csat.cre_negative_label,CSAT_REASON_PLACEHOLDER:e.csat.reason_placeholder,CSAT_RATING_TITLE:e.csat.question,CSAT_SUBMIT_LABEL:e.csat.submit_label,CSAT_SUBMISSION_EXPIRED:e.csat.submission_expired,DATE_FORMAT__JUST_NOW:e.date_format.just_now,DATE_FORMAT__MINUTES_AGO:e.date_format.minutes_ago,DATE_FORMAT__HOURS_AGO:e.date_format.hours_ago,DATE_FORMAT__DATE_SHORT:e.date_format.date_short,DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR:e.date_format.date_separator,DATE_FORMAT__MESSAGE_TIMESTAMP:e.date_format.message_timestamp,CONVERSATION_LIST__HEADER_TITLE:e.conversation_list.header_title,CONVERSATION_LIST__ENDED:e.conversation_list.ended,CONVERSATION_LIST__SYSTEM_MESSAGE:e.conversation_list.system_message,CONVERSATION_LIST__NO_CONVERSATIONS:e.common.placeholder_no_conversations,CONVERSATION_LIST__MULTIPLE_FILES_COUNT:e.conversation_list.multiple_files_count,TALK_TO_AGENT:e.conversation.start_new_conversation_label,CITATION_SOURCE_TITLE:e.conversation.citation_title,FORM_PLACEHOLDER:e.conversation.input_placeholder_active_form,FORM_VALIDATION_REQUIRED:e.form.validation_required,OPTIONAL:e.form.optional_label,PLACE_HOLDER__WRONG:e.common.placeholder_something_went_wrong,PLACE_HOLDER__NO_MESSAGES:e.common.placeholder_no_messages,RETRY:e.common.placeholder_something_went_wrong_retry_label,BUTTON__OK:e.common.button_ok,BUTTON__CANCEL:e.common.button_cancel,FAILED_MESSAGE_RESEND:e.conversation.failed_message_resend,FAILED_MESSAGE_REMOVE:e.conversation.failed_message_remove,DESK__TICKET_CLOSURE_CONFIRM:e.desk.ticket_closure_confirm,DESK__TICKET_CLOSURE_DECLINE:e.desk.ticket_closure_decline,DESK__TICKET_CLOSURE_ERROR_MESSAGE:e.desk.ticket_closure_error_message,FILE_UPLOAD_NO_SUPPORTED_FILES:e.conversation.file_upload_no_supported_files,FILE_UPLOAD_REPLACE_ALERT__TITLE:e.conversation.file_upload_replace_alert_title,FILE_UPLOAD_REPLACE_ALERT__DESCRIPTION:e.conversation.file_upload_replace_alert_description,FILE_UPLOAD_FILES:e.conversation.attachment_document,FEEDBACK_TITLE:e.feedback.title,FEEDBACK_GOOD:e.feedback.good,FEEDBACK_BAD:e.feedback.bad,FEEDBACK_COMMENT_LABEL:e.feedback.comment_label,FEEDBACK_COMMENT_PLACEHOLDER:e.feedback.comment_placeholder,FEEDBACK_CANCEL:e.feedback.cancel,FEEDBACK_SUBMIT:e.feedback.submit,FEEDBACK_SAVE:e.feedback.save,FEEDBACK_EDIT:e.feedback.edit,FEEDBACK_REMOVE:e.feedback.remove,A11Y_MESSAGE_LIST:e.conversation.a11y_message_list,A11Y_SCROLL_TO_BOTTOM:e.conversation.a11y_scroll_to_bottom,A11Y_SCROLL_TO_NEW_MESSAGES:e.conversation.a11y_scroll_to_new_messages,A11Y_OPEN_CONVERSATION_LIST:e.conversation.a11y_open_conversation_list,A11Y_OPEN_CONVERSATION:e.conversation.a11y_open_conversation,A11Y_OPEN_CONVERSATIONS:e.conversation.a11y_open_conversations,A11Y_CLOSE_CONVERSATION:e.conversation.a11y_close_conversation,A11Y_CLOSE_CONVERSATIONS:e.conversation.a11y_close_conversations,A11Y_MENU:e.conversation.a11y_menu,A11Y_MESSAGE_INPUT:e.conversation.a11y_message_input,A11Y_SEND_MESSAGE:e.conversation.a11y_send_message,A11Y_ATTACH_FILE:e.conversation.a11y_attach_file,A11Y_CONNECT_AGENT:e.conversation.a11y_connect_agent,A11Y_CLOSE_MESSENGER:e.conversation.a11y_close_messenger,A11Y_DISMISS_NUDGE_MESSAGE:e.conversation.a11y_dismiss_nudge_message,A11Y_EXPAND_MESSENGER:e.conversation.a11y_expand_messenger,A11Y_COLLAPSE_MESSENGER:e.conversation.a11y_collapse_messenger,A11Y_MESSAGE_SENDER_YOU:e.conversation.a11y_message_sender_you,A11Y_SUGGESTED_REPLY:e.conversation.a11y_suggested_reply,A11Y_TYPING_INDICATOR:e.conversation.a11y_typing_indicator,A11Y_CODE_BLOCK_PLACEHOLDER:e.conversation.a11y_code_block_placeholder,A11Y_TYPING_FORMAT:e.conversation.a11y_typing_format,A11Y_MESSAGE_FAILED:e.conversation.a11y_message_failed,A11Y_NEW_MESSAGES_RECEIVED:e.conversation.a11y_new_messages_received,A11Y_NEW_MESSAGES_RECEIVED_FROM_SENDER:e.conversation.a11y_new_messages_received_from_sender,A11Y_AGENT_CONNECTED:e.conversation.a11y_agent_connected,A11Y_CONVERSATION_CLOSED:e.conversation.a11y_conversation_closed,A11Y_FILE_IMAGE:e.conversation.a11y_file_image,A11Y_FILE_VIDEO:e.conversation.a11y_file_video,A11Y_FILE_PDF:e.conversation.a11y_file_pdf,A11Y_FILE_DOCUMENT:e.conversation.a11y_file_document,A11Y_RECEIVED_FILE_IMAGE:e.conversation.a11y_received_file_image,A11Y_RECEIVED_FILE_VIDEO:e.conversation.a11y_received_file_video,A11Y_RECEIVED_FILE_PDF:e.conversation.a11y_received_file_pdf,A11Y_RECEIVED_FILES_IMAGE_COUNT:e.conversation.a11y_received_files_image_count,A11Y_SCREEN_CONVERSATION:e.conversation.a11y_screen_conversation,A11Y_SCREEN_CONVERSATION_WITH_AGENT:e.conversation.a11y_screen_conversation_with_agent,A11Y_SCREEN_CONVERSATION_LIST_NO_COUNT:e.conversation.a11y_screen_conversation_list_no_count,A11Y_SCREEN_CONVERSATION_LIST_WITH_COUNT:e.conversation.a11y_screen_conversation_list_with_count,A11Y_CSAT_DISPLAYED:e.conversation.a11y_csat_displayed,A11Y_EMPTY_CONVERSATION:e.conversation.a11y_empty_conversation,A11Y_INPUT_DISABLED:e.conversation.a11y_input_disabled,A11Y_FILE_SIZE_EXCEEDED:e.conversation.a11y_file_size_exceeded,A11Y_CSAT_FORM_ERROR:e.conversation.a11y_csat_form_error,A11Y_HINT_SEND_MESSAGE:e.conversation.a11y_hint_send_message,A11Y_HINT_OPEN_CONVERSATION:e.conversation.a11y_hint_open_conversation,A11Y_HINT_OPEN_CONVERSATIONS:e.conversation.a11y_hint_open_conversations,A11Y_HINT_CLOSE_CONVERSATION:e.conversation.a11y_hint_close_conversation,A11Y_HINT_OPEN_MENU:e.conversation.a11y_hint_open_menu,A11Y_HINT_CONNECT_TO_AGENT:e.conversation.a11y_hint_connect_to_agent,A11Y_HINT_ATTACH_FILE:e.conversation.a11y_hint_attach_file,A11Y_HINT_VIEW_NEW_MESSAGES:e.conversation.a11y_hint_view_new_messages,A11Y_HINT_OPEN_FILE:e.conversation.a11y_hint_open_file,A11Y_HINT_OPEN_IMAGE:e.conversation.a11y_hint_open_image,A11Y_HINT_SEND_REPLY:e.conversation.a11y_hint_send_reply,A11Y_CONVERSATION_ITEM:e.conversation_list.a11y_conversation_item,A11Y_CSAT_RATING_LABEL:e.csat.a11y_csat_rating_label,A11Y_HINT_SELECT_RATING:e.csat.a11y_hint_select_rating,IMAGE_VIEWER__DEFAULT_TITLE:e.conversation.image_viewer_default_title,A11Y_IMAGE_VIEWER_CLOSE:e.conversation.a11y_image_viewer_close,A11Y_IMAGE_VIEWER_PREVIOUS:e.conversation.a11y_image_viewer_previous,A11Y_IMAGE_VIEWER_NEXT:e.conversation.a11y_image_viewer_next,A11Y_IMAGE_VIEWER_DOWNLOAD:e.conversation.a11y_image_viewer_download,SCROLL_TO_NEW_MESSAGES_LABEL:e.conversation.scroll_to_new_messages_label,HANDOFF_CONFIRM__TITLE:e.handoff.confirm_title,HANDOFF_CONFIRM__DESCRIPTION:e.handoff.confirm_description,HANDOFF_CONFIRM__CANCEL:e.handoff.confirm_cancel,HANDOFF_CONFIRM__HANDOFF:e.handoff.confirm_handoff,MEMORY__DIALOG_TITLE:e.memory.dialog_title,MEMORY__DESC_ON:e.memory.desc_on,MEMORY__DESC_OFF:e.memory.desc_off,MEMORY__BUTTON_USE:e.memory.button_use,MEMORY__BUTTON_DONT_USE:e.memory.button_dont_use,MEMORY__BUTTON_KEEP_USING:e.memory.button_keep_using,MEMORY__BUTTON_DISABLE:e.memory.button_disable,MEMORY__BUTTON_DISABLE_AND_DELETE:e.memory.button_disable_and_delete,MEMORY__BUTTON_KEEP_OFF:e.memory.button_keep_off,MEMORY__BUTTON_ENABLE:e.memory.button_enable,MEMORY__BUTTON_CANCEL:e.memory.button_cancel,MEMORY__ERROR_MESSAGE:e.memory.error_message,A11Y_MEMORY_INDICATOR_MANAGE:e.memory.a11y_indicator_manage,A11Y_MEMORY_INDICATOR_ON:e.memory.a11y_indicator_on,A11Y_MEMORY_INDICATOR_OFF:e.memory.a11y_indicator_off,CONNECTION_DELAY__TITLE:e.connection_delay.title,CONNECTION_DELAY__DESCRIPTION:e.connection_delay.description}),ya=e=>{var t;return((t=e.split("-"))==null?void 0:t[0])??un},un="en",Aa=new Set([un,"ko","es","pt","fr","hi","it","de","tr","ja"]),Tf='@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}',{Provider:If,useContext:Es}=ye("AgentUIElementResolver"),xf=({entryElement:e,modalRootElement:t,rootElement:n,children:r})=>{const s=l.useMemo(()=>{const o=n??document.body,i=e??o,c=t??o,u=d=>d===Ae.MODAL_ROOT?c:i.querySelector(`#${d}`);return{resolveElement:u,resolvePortalContainer:d=>u(d)??c}},[e,t,n]);return a.createElement(If,{value:s},r)};function _t(e,t){const n=e.getRootNode({composed:t});return n instanceof ShadowRoot||n instanceof Document?n:document}const So=()=>{const e=[];let t=0;const n=new Set,r=()=>n.forEach(s=>s());return{register:s=>{const o=++t;return e.push({id:o,handler:s}),r(),()=>{const i=e.findIndex(c=>c.id===o);i>=0&&(e.splice(i,1),r())}},dismissTopmost:()=>{const s=e[e.length-1];return s?(s.handler(),!0):!1},subscribe:s=>(n.add(s),()=>{n.delete(s)}),getOpenCount:()=>e.length}},{Provider:Mf,useContext:_s}=ye("EscapeDismissStack"),vo=e=>{e.stopPropagation(),e.stopImmediatePropagation()},Rf=({rootElement:e=document.body,boundaryElement:t,children:n})=>{const r=l.useRef(null),s=l.useRef(null);r.current||(r.current=So()),s.current||(s.current=So());const o=r.current,i=s.current;l.useLayoutEffect(()=>{const u=t??_t(e),d=m=>{if(m.key==="Escape"){if(o.dismissTopmost()){vo(m);return}i.dismissTopmost()&&vo(m)}};return u.addEventListener("keydown",d),()=>u.removeEventListener("keydown",d)},[t,e,i,o]);const c=l.useMemo(()=>({register:o.register,dismissTopmost:o.dismissTopmost,registerShellDismissHandler:i.register,subscribe:o.subscribe,getOpenCount:o.getOpenCount}),[i,o]);return a.createElement(Mf,{value:c},n)},Ta=(e,t,n)=>{const r=l.useRef(t);l.useLayoutEffect(()=>{r.current=t},[t]),l.useLayoutEffect(()=>{if(e)return n(()=>r.current())},[e,n])},kf=(e,t)=>{const{register:n}=_s();Ta(e,t,n)},wf=(e,t)=>{const{registerShellDismissHandler:n}=_s();Ta(e,t,n)},Ia=()=>{const{subscribe:e,getOpenCount:t}=_s();return l.useSyncExternalStore(e,()=>t()>0,()=>!1)},Lf=(e,t,n)=>{const r=e[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((s,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},bo=ba($r.strings),Of={...bo,HEADER_BUTTON__AGENT_HANDOFF:"Talk to human agent",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Select an option to continue",BUTTON__SUBMIT:"Submit",SUBMITTED:"Submitted",TRY_AGAIN:"Please try again.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Up to %d files can be attached.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"The maximum size per file is %d MB.",FILE_UPLOAD_NOTIFICATION__FILES_EXCLUDED_BY_VALIDATION:"%d files were excluded due to limits. Please select files individually.",FILE_UPLOAD_PHOTOS:"Photos",FILE_VIEWER__UNSUPPORT:"Unsupported message",A11Y_FILE_SELECTED:e=>`${e}, selected`,A11Y_FILE_REMOVE_BUTTON:e=>`Remove file: ${e}`,A11Y_FILE_UPLOAD_OPTIONS:"File upload options",A11Y_FAILED_MESSAGE_OPTIONS:"Failed message options",A11Y_FEEDBACK_OPTIONS:"Feedback options",A11Y_CSAT_TEXT_INPUT_LABEL:"Enter answer",FORM_UNAVAILABLE:"Form is no longer available.",FORM_NOT_SUPPORTED:"This form is not supported in the current version.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimum ${e} characters required`,FORM_VALIDATION_MAX_LENGTH:e=>`Maximum ${e} characters allowed`,FORM_VALIDATION_MIN:e=>`Minimum value is ${e}`,FORM_VALIDATION_MAX:e=>`Maximum value is ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Select at least ${e} options`,FORM_VALIDATION_MAX_SELECT:e=>`Select at most ${e} options`,FORM_VALIDATION_REGEX_FAILED:"Invalid format",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:bo.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"h:mma",CONVERSATION_LIST__TOPICS_FALLBACK:"No category",CONVERSATION_CLOSED_FOOTER_LABEL:"Your conversation has ended",START_NEW_CONVERSATION:"💬 Start a new conversation",RETURN_TO_CONVERSATION:"💬 Return to conversation",BUTTON__SAVE:"Save",NO_NAME:"(No name)",CHANNEL_FROZEN:"Channel frozen"},Fn={language:$r.language,dateLocale:$r.dateLocale,stringSet:Of},Nf=Object.freeze(Object.defineProperty({__proto__:null,default:Fn},Symbol.toStringTag,{value:"Module"})),Fr=new Map([[un,Fn]]);async function Df(e){const t=Fr.get(e);if(t)return t;try{if(Aa.has(e)){const{default:n}=await Lf(Object.assign({"./languages/de.ts":()=>Promise.resolve().then(()=>require("./cjs/qr4Ghr48.cjs")),"./languages/en.ts":()=>Promise.resolve().then(()=>Nf),"./languages/es.ts":()=>Promise.resolve().then(()=>require("./cjs/fdHbDI5i.cjs")),"./languages/fr.ts":()=>Promise.resolve().then(()=>require("./cjs/DsrX4pE_.cjs")),"./languages/hi.ts":()=>Promise.resolve().then(()=>require("./cjs/BoXkkKL_.cjs")),"./languages/it.ts":()=>Promise.resolve().then(()=>require("./cjs/De9EY1XB.cjs")),"./languages/ja.ts":()=>Promise.resolve().then(()=>require("./cjs/DoR1M7Tp.cjs")),"./languages/ko.ts":()=>Promise.resolve().then(()=>require("./cjs/s8NcCXAz.cjs")),"./languages/pt.ts":()=>Promise.resolve().then(()=>require("./cjs/D3Aoub0b.cjs")),"./languages/tr.ts":()=>Promise.resolve().then(()=>require("./cjs/D-lytti9.cjs"))}),`./languages/${e}.ts`,3);return Fr.set(e,n),n}return Fn}catch{return Fn}}const{Provider:Pf,useContext:le}=ye("Localization"),$f=({language:e=navigator.language,languageCode:t,logger:n,stringSet:r,children:s})=>{const[o,i]=l.useState(Fr.get(un));return l.useEffect(()=>{const c=t??ya(e);o.language!==c&&(n==null||n.debug("localization.useEffect: update language",{from:o.language,to:c}),Df(c).then(i))},[e,t,n]),a.createElement(Pf,{value:{language:o.language,defaultStringSet:o.stringSet,stringSet:{...o.stringSet,...r},dateLocale:o.dateLocale,format:(c,u,d)=>pt.format(c,u,{locale:o.dateLocale,...d})}},s)},Un="data-sb-agent-theme",yo=e=>(t,...n)=>{let r="";return t.forEach((s,o)=>{r+=s+(n[o]??"")}),`[${Un}='${e}'] & { ${r} }`},ne={light:yo("light"),dark:yo("dark")},Ff=F.css(({theme:e})=>{const{palette:t}=e;return`
18
18
  :root,
19
19
  :host {
20
20
  --sendbird-primary-extra-dark: ${t.primary.extraDark};
@@ -85,7 +85,7 @@ $2
85
85
  }
86
86
 
87
87
  ${({$rtlFlip:e})=>e&&Yf};
88
- `,Xf=()=>a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64"},a.createElement("rect",{x:"8",y:"8",width:"48",height:"48",fill:"none",className:"stroke",rx:"4"}),a.createElement("line",{x1:"20",y1:"20",x2:"44",y2:"44",className:"stroke"}),a.createElement("line",{x1:"44",y1:"20",x2:"20",y2:"44",className:"stroke"})),{Provider:Zf,useContext:Jf}=ye("MessengerIcon",{icons:xa}),Qf=({icons:e,children:t})=>{const n=l.useMemo(()=>({icons:mm(xa,e)}),[e]);return a.createElement(Zf,{value:n},t)},{Provider:ep,useContext:Ma}=ye("MessengerTheme");function tp(e){const{theme:t,appearance:n,logger:r}=e;return a.createElement(eh,{appearance:n,palette:t==null?void 0:t.palette,typography:t==null?void 0:t.typography,colors:t==null?void 0:t.colors,logger:r},a.createElement(np,{...e}))}function np({rootElement:e=document.body,children:t}){const{theme:n,updateTheme:r}=Wn();return l.useLayoutEffect(()=>{e.setAttribute(Un,n.selectedTheme)},[e,n.selectedTheme]),a.createElement(F.ThemeProvider,{theme:n},a.createElement(ep,{value:{theme:n,updateTheme:r,rootElement:e}},t))}const rp=(e,t)=>{l.useEffect(()=>{const n=_t(t)instanceof ShadowRoot,r=_t(t,!0);if(!(n?t:r).querySelector(`link[href*='${e}']`)){const o=r.createElement("link");o.rel="stylesheet",o.href=e,(n?t:r.head).appendChild(o)}},[e,t])},sp=(e,t=document.body)=>{l.useEffect(()=>{if(!e)return;const n=_t(t),s=n instanceof ShadowRoot?t:n.head;if(!s)return;const o=`sba-${btoa(e).slice(0,10)}`;let i=s.querySelector(`style#${o}`);i?i.textContent!==e&&(i.textContent=e):(i=s.ownerDocument.createElement("style"),i.id=o,i.textContent=e,s.appendChild(i))},[e,t])},op=80,ip=()=>{const{stringSet:e}=le(),t={screenConversation:e.A11Y_SCREEN_CONVERSATION,screenConversationWithAgent:e.A11Y_SCREEN_CONVERSATION_WITH_AGENT,screenConversationListNoCount:e.A11Y_SCREEN_CONVERSATION_LIST_NO_COUNT,screenConversationListWithCount:e.A11Y_SCREEN_CONVERSATION_LIST_WITH_COUNT,newMessage:e.A11Y_NEW_MESSAGES_RECEIVED,newMessageFromSender:e.A11Y_NEW_MESSAGES_RECEIVED_FROM_SENDER,typing:e.A11Y_TYPING_FORMAT,sendFailed:e.A11Y_MESSAGE_FAILED,agentConnected:e.A11Y_AGENT_CONNECTED,conversationClosed:e.A11Y_CONVERSATION_CLOSED,csatDisplayed:e.A11Y_CSAT_DISPLAYED,csatExpired:e.CSAT_SUBMISSION_EXPIRED,emptyState:e.A11Y_EMPTY_CONVERSATION,inputDisabled:e.A11Y_INPUT_DISABLED,fileSizeExceeded:e.A11Y_FILE_SIZE_EXCEEDED,csatFormError:e.A11Y_CSAT_FORM_ERROR},n=l.useRef(t);return n.current=t,n},Ra=ye("AriaLiveRegion",{announce:Ee,announceScreenEntry:Ee,announceStatus:Ee,announceError:Ee,flush:Ee,setSuppressionState:Ee}),ap=Ra.Provider,Cs=Ra.useContext,cp={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},lp=({children:e})=>{const t=l.useRef(null),n=l.useRef(new Set),r=l.useRef(Ee),s=ip(),[o]=l.useState(()=>Jg(f=>{r.current(f)},{throttleMs:1e3,isSuppressed:()=>n.current.size>0}));r.current=f=>{const p=t.current;p&&(p.textContent="",requestAnimationFrame(()=>{p.textContent=f}))},l.useEffect(()=>()=>{o.destroy()},[o]);const i=o.announce,c=o.flush,u=l.useCallback(f=>{const p=ef(f,s.current);i(p)},[i]),d=l.useCallback((f,p)=>{const C=tf(f,s.current),_=(p==null?void 0:p.mode)??Qg(f.event);i(C,{mode:_,dedupeKey:p==null?void 0:p.dedupeKey})},[i]),m=l.useCallback((f,p)=>{const C=nf(f,s.current);o.announceIgnoringSuppression(C),p&&setTimeout(()=>{p.focus()},op)},[o]),h=l.useCallback((f,p)=>{if(p){n.current.add(f);return}n.current.delete(f)},[]),g=l.useMemo(()=>({announce:i,announceScreenEntry:u,announceStatus:d,announceError:m,flush:c,setSuppressionState:h}),[i,m,u,d,c,h]);return a.createElement(ap,{value:g},e,a.createElement("div",{ref:t,role:"status","aria-live":"polite","aria-atomic":"true",style:cp}))},ka=ye("ConversationAnnouncements",{announcementsEnabled:!0,announce:Ee,announceScreenEntry:Ee,announceStatus:Ee,announceError:Ee,setIsSuppressed:Ee,setStatusPauseState:Ee,flush:Ee}),up=ka.Provider,gt=ka.useContext,dp=({children:e,announcementsEnabled:t=!0})=>{const{announce:n,announceScreenEntry:r,announceStatus:s,announceError:o,flush:i,setSuppressionState:c}=Cs(),u=l.useRef([]),d=l.useRef(new Set),m=l.useRef(Symbol("conversation-announcements")),h=l.useCallback(T=>{if(!t||!T){c(m.current,!1);return}c(m.current,!0)},[t,c]),g=l.useCallback(()=>{u.current=[]},[]),f=l.useCallback(()=>{if(u.current.length===0)return;if(!t){g();return}const T=[...u.current];g(),T.forEach(I=>{i(),s(I.params,I.options)})},[s,t,g,i]),p=l.useCallback((T,I)=>{if(I){d.current.add(T);return}d.current.delete(T),d.current.size===0&&f()},[f]),C=l.useCallback(T=>{t&&n(T)},[n,t]),_=l.useCallback(T=>{t&&r(T)},[r,t]),E=l.useCallback((T,I)=>{if(t){if(d.current.size>0){u.current.push({params:T,options:I});return}s(T,I)}},[s,t]),A=l.useCallback((T,I)=>{t&&o(T,I)},[o,t]);l.useLayoutEffect(()=>(t||(g(),c(m.current,!1)),()=>{g(),c(m.current,!1)}),[t,g,c]);const y=l.useMemo(()=>({announcementsEnabled:t,announce:C,announceScreenEntry:_,announceStatus:E,announceError:A,setIsSuppressed:h,setStatusPauseState:p,flush:i}),[t,i,C,A,_,E,h,p]);return a.createElement(up,{value:y},e)},Yn=["a[href]","button:not(:disabled)","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"])'].join(", "),wa=`${Yn}, [tabindex="-1"]`,Ft=e=>{if(!e.isConnected||e.hidden)return!1;let t=e;const n=e.ownerDocument.defaultView;for(;t;){if(t.hidden||t.getAttribute("aria-hidden")==="true")return!1;if(n){const r=n.getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden")return!1}t=t.parentElement}return!0},rn=(e,t)=>{for(const n of e.querySelectorAll(t))if(!n.hasAttribute(ps)&&Ft(n))return n;return null},La=e=>{let t=null,n=null;for(const r of e.querySelectorAll(Yn))r.hasAttribute(ps)||Ft(r)&&(t??(t=r),n=r);return t?{first:t,last:n}:null},Oa=(e,t)=>e instanceof ShadowRoot&&!(t instanceof HTMLElement)?e.host.ownerDocument.activeElement===e.host:t instanceof HTMLElement?e instanceof Document?t===e.body||t===e.documentElement:!1:!0,mp=(e,t,n)=>Oa(e,t)||n!=null&&t instanceof HTMLElement&&n.contains(t),Ss=e=>rn(e,hf),Na=e=>Ss(e)??rn(e,Yn),hp=e=>{const t=Ss(e);if(t)return t;const n=e.querySelector(ff);return(n?rn(n,wa):null)??rn(e,Yn)},B=({as:e,variant:t="body1",color:n,maxTextLines:r,className:s,...o})=>a.createElement(pp,{as:e,$variant:t,className:s,$color:n,$maxTextLines:r,...o}),Ao=new WeakMap,gp=(e,t)=>{let n=Ao.get(t);n||(n=new Map,Ao.set(t,n));const r=n.get(e);if(r)return r;const s=t[e]??t.body1,o=F.css`font-size:${nt(s.fontSize)};font-weight:${s.fontWeight};${s.fontFamily?`font-family: ${s.fontFamily};`:""}
88
+ `,Xf=()=>a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64"},a.createElement("rect",{x:"8",y:"8",width:"48",height:"48",fill:"none",className:"stroke",rx:"4"}),a.createElement("line",{x1:"20",y1:"20",x2:"44",y2:"44",className:"stroke"}),a.createElement("line",{x1:"44",y1:"20",x2:"20",y2:"44",className:"stroke"})),{Provider:Zf,useContext:Jf}=ye("MessengerIcon",{icons:xa}),Qf=({icons:e,children:t})=>{const n=l.useMemo(()=>({icons:mm(xa,e)}),[e]);return a.createElement(Zf,{value:n},t)},{Provider:ep,useContext:Ma}=ye("MessengerTheme");function tp(e){const{theme:t,appearance:n,logger:r}=e;return a.createElement(eh,{appearance:n,palette:t==null?void 0:t.palette,typography:t==null?void 0:t.typography,colors:t==null?void 0:t.colors,logger:r},a.createElement(np,{...e}))}function np({rootElement:e=document.body,children:t}){const{theme:n,updateTheme:r}=Wn();return l.useLayoutEffect(()=>{e.setAttribute(Un,n.selectedTheme)},[e,n.selectedTheme]),a.createElement(F.ThemeProvider,{theme:n},a.createElement(ep,{value:{theme:n,updateTheme:r,rootElement:e}},t))}const rp=(e,t)=>{l.useEffect(()=>{const n=_t(t)instanceof ShadowRoot,r=_t(t,!0);if(!(n?t:r).querySelector(`link[href*='${e}']`)){const o=r.createElement("link");o.rel="stylesheet",o.href=e,(n?t:r.head).appendChild(o)}},[e,t])},sp=(e,t=document.body)=>{l.useEffect(()=>{if(!e)return;const n=_t(t),s=n instanceof ShadowRoot?t:n.head;if(!s)return;const o=`sba-${btoa(e).slice(0,10)}`;let i=s.querySelector(`style#${o}`);i?i.textContent!==e&&(i.textContent=e):(i=s.ownerDocument.createElement("style"),i.id=o,i.textContent=e,s.appendChild(i))},[e,t])},op=80,ip=()=>{const{stringSet:e}=le(),t={screenConversation:e.A11Y_SCREEN_CONVERSATION,screenConversationWithAgent:e.A11Y_SCREEN_CONVERSATION_WITH_AGENT,screenConversationListNoCount:e.A11Y_SCREEN_CONVERSATION_LIST_NO_COUNT,screenConversationListWithCount:e.A11Y_SCREEN_CONVERSATION_LIST_WITH_COUNT,newMessage:e.A11Y_NEW_MESSAGES_RECEIVED,newMessageFromSender:e.A11Y_NEW_MESSAGES_RECEIVED_FROM_SENDER,typing:e.A11Y_TYPING_FORMAT,sendFailed:e.A11Y_MESSAGE_FAILED,agentConnected:e.A11Y_AGENT_CONNECTED,conversationClosed:e.A11Y_CONVERSATION_CLOSED,csatDisplayed:e.A11Y_CSAT_DISPLAYED,csatExpired:e.CSAT_SUBMISSION_EXPIRED,emptyState:e.A11Y_EMPTY_CONVERSATION,inputDisabled:e.A11Y_INPUT_DISABLED,fileSizeExceeded:e.A11Y_FILE_SIZE_EXCEEDED,csatFormError:e.A11Y_CSAT_FORM_ERROR},n=l.useRef(t);return n.current=t,n},Ra=ye("AriaLiveRegion",{announce:Ee,announceScreenEntry:Ee,announceStatus:Ee,announceError:Ee,flush:Ee,setSuppressionState:Ee}),ap=Ra.Provider,Cs=Ra.useContext,cp={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},lp=({children:e})=>{const t=l.useRef(null),n=l.useRef(new Set),r=l.useRef(Ee),s=ip(),[o]=l.useState(()=>Jg(f=>{r.current(f)},{throttleMs:1e3,isSuppressed:()=>n.current.size>0}));r.current=f=>{const p=t.current;p&&(p.textContent="",requestAnimationFrame(()=>{p.textContent=f}))},l.useEffect(()=>()=>{o.destroy()},[o]);const i=o.announce,c=o.flush,u=l.useCallback(f=>{const p=ef(f,s.current);i(p)},[i]),d=l.useCallback((f,p)=>{const C=tf(f,s.current),_=(p==null?void 0:p.mode)??Qg(f.event);i(C,{mode:_,dedupeKey:p==null?void 0:p.dedupeKey})},[i]),m=l.useCallback((f,p)=>{const C=nf(f,s.current);o.announceIgnoringSuppression(C),p&&setTimeout(()=>{p.focus()},op)},[o]),h=l.useCallback((f,p)=>{if(p){n.current.add(f);return}n.current.delete(f)},[]),g=l.useMemo(()=>({announce:i,announceScreenEntry:u,announceStatus:d,announceError:m,flush:c,setSuppressionState:h}),[i,m,u,d,c,h]);return a.createElement(ap,{value:g},e,a.createElement("div",{ref:t,role:"status","aria-live":"polite","aria-atomic":"true",style:cp}))},ka=ye("ConversationAnnouncements",{announcementsEnabled:!0,announce:Ee,announceScreenEntry:Ee,announceStatus:Ee,announceError:Ee,setIsSuppressed:Ee,setStatusPauseState:Ee,flush:Ee}),up=ka.Provider,gt=ka.useContext,dp=({children:e,announcementsEnabled:t=!0})=>{const{announce:n,announceScreenEntry:r,announceStatus:s,announceError:o,flush:i,setSuppressionState:c}=Cs(),u=l.useRef([]),d=l.useRef(new Set),m=l.useRef(Symbol("conversation-announcements")),h=l.useCallback(T=>{if(!t||!T){c(m.current,!1);return}c(m.current,!0)},[t,c]),g=l.useCallback(()=>{u.current=[]},[]),f=l.useCallback(()=>{if(u.current.length===0)return;if(!t){g();return}const T=[...u.current];g(),T.forEach(I=>{i(),s(I.params,I.options)})},[s,t,g,i]),p=l.useCallback((T,I)=>{if(I){d.current.add(T);return}d.current.delete(T),d.current.size===0&&f()},[f]),C=l.useCallback(T=>{t&&n(T)},[n,t]),_=l.useCallback(T=>{t&&r(T)},[r,t]),E=l.useCallback((T,I)=>{if(t){if(d.current.size>0){u.current.push({params:T,options:I});return}s(T,I)}},[s,t]),A=l.useCallback((T,I)=>{t&&o(T,I)},[o,t]);l.useLayoutEffect(()=>(t||(g(),c(m.current,!1)),()=>{g(),c(m.current,!1)}),[t,g,c]);const y=l.useMemo(()=>({announcementsEnabled:t,announce:C,announceScreenEntry:_,announceStatus:E,announceError:A,setIsSuppressed:h,setStatusPauseState:p,flush:i}),[t,i,C,A,_,E,h,p]);return a.createElement(up,{value:y},e)},Yn=["a[href]","button:not(:disabled)","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'iframe:not([tabindex="-1"])','[tabindex]:not([tabindex="-1"])'].join(", "),wa=`${Yn}, [tabindex="-1"]`,Ft=e=>{if(!e.isConnected||e.hidden)return!1;let t=e;const n=e.ownerDocument.defaultView;for(;t;){if(t.hidden||t.getAttribute("aria-hidden")==="true")return!1;if(n){const r=n.getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden")return!1}t=t.parentElement}return!0},rn=(e,t)=>{for(const n of e.querySelectorAll(t))if(!n.hasAttribute(ps)&&Ft(n))return n;return null},La=e=>{let t=null,n=null;for(const r of e.querySelectorAll(Yn))r.hasAttribute(ps)||Ft(r)&&(t??(t=r),n=r);return t?{first:t,last:n}:null},Oa=(e,t)=>e instanceof ShadowRoot&&!(t instanceof HTMLElement)?e.host.ownerDocument.activeElement===e.host:t instanceof HTMLElement?e instanceof Document?t===e.body||t===e.documentElement:!1:!0,mp=(e,t,n)=>Oa(e,t)||n!=null&&t instanceof HTMLElement&&n.contains(t),Ss=e=>rn(e,hf),Na=e=>Ss(e)??rn(e,Yn),hp=e=>{const t=Ss(e);if(t)return t;const n=e.querySelector(ff);return(n?rn(n,wa):null)??rn(e,Yn)},B=({as:e,variant:t="body1",color:n,maxTextLines:r,className:s,...o})=>a.createElement(pp,{as:e,$variant:t,className:s,$color:n,$maxTextLines:r,...o}),Ao=new WeakMap,gp=(e,t)=>{let n=Ao.get(t);n||(n=new Map,Ao.set(t,n));const r=n.get(e);if(r)return r;const s=t[e]??t.body1,o=F.css`font-size:${nt(s.fontSize)};font-weight:${s.fontWeight};${s.fontFamily?`font-family: ${s.fontFamily};`:""}
89
89
  ${s.lineHeight?`line-height: ${s.lineHeight};`:"line-height: 100%;"}
90
90
  `;return n.set(e,o),o},fp=e=>e?F.css`display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:${e};overflow:hidden;`:"",pp=v.default.span`font-stretch:normal;letter-spacing:normal;${({$variant:e,theme:t})=>gp(e,t.typography)}color:${({$color:e})=>e};${({$maxTextLines:e})=>fp(e)}`;async function vs(e){let t=e;t&&(!t.startsWith("http://")&&!t.startsWith("https://")&&(t="https://"+t),window.open(t,"_blank","noopener,noreferrer"))}const Ur='[role="dialog"][aria-modal="true"]',Ep=(e,t)=>{const n=new Set(Array.from(e.ownerDocument.querySelectorAll(Ur)).filter(s=>s!==e&&(s.contains(e)||e.contains(s)))),r=t==null?void 0:t.closest(Ur);return r&&r!==e&&n.add(r),n},_p=(e,t)=>Array.from(e.ownerDocument.querySelectorAll(Ur)).some(n=>n!==e&&!t.has(n)&&!n.contains(e)&&Ft(n)),Cp=e=>{const t=Na(e)??e;t===e&&Da(e),t.focus()},Da=e=>{e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1")},Sp=(e,t)=>{const n=La(e);if(!n){Da(e),e.focus();return}n[t].focus()},To=(e,t)=>{const n=e.ownerDocument.createElement("span");return n.tabIndex=0,n.setAttribute(ps,gf),n.style.cssText=["position: fixed","width: 1px","height: 1px","opacity: 0","overflow: hidden","pointer-events: none"].join(";"),n.addEventListener("focus",()=>Sp(e,t)),n},vp=(e,t)=>{e.key==="Tab"&&(e.defaultPrevented||e.target===t&&(La(t)||(e.preventDefault(),t.focus())))},jn=(e,t,{nameReady:n=!0}={})=>{const r=l.useRef(0),s=l.useRef(!1);l.useEffect(()=>{if(!e||!t.current){s.current=!1;return}r.current+=1;const o=r.current,i=t.current,c=i.getRootNode(),u=c.activeElement instanceof HTMLElement?c.activeElement:null,d=Ep(i,u);return()=>{u&&Re(()=>{if(r.current!==o)return;const m=c.activeElement;i.isConnected&&m instanceof HTMLElement&&m!==i&&!i.contains(m)&&!Oa(c,m)&&m.matches(wa)&&Ft(m)||_p(i,d)||!u.isConnected||!Ft(u)||u.focus()})}},[e,t]),l.useEffect(()=>{if(!e||!t.current)return;const o=t.current;let i=!1;const c=()=>{if(i||s.current||!o.isConnected)return;const m=o.getRootNode().activeElement;if(m instanceof HTMLElement&&m!==o&&o.contains(m)&&Ft(m)){s.current=!0;return}s.current=!0,Cp(o)};if(n)return Re(c),()=>{i=!0};const u=setTimeout(()=>Re(c),Ca);return()=>{i=!0,clearTimeout(u)}},[e,t,n]),l.useEffect(()=>{if(!e||!t.current)return;const o=t.current,i=To(o,"last"),c=To(o,"first"),u=d=>vp(d,o);return o.insertBefore(i,o.firstChild),o.appendChild(c),o.addEventListener("keydown",u),()=>{o.removeEventListener("keydown",u),i.remove(),c.remove()}},[e,t])},St=({style:e,portalContainerId:t,visible:n,onClose:r,children:s,cancelable:o=!0,"aria-label":i,"aria-labelledby":c,"aria-describedby":u})=>{const d=l.useRef(null),{resolvePortalContainer:m}=Es();return jn(n,d),kf(n,o?r:Ee),n?rl.createPortal(a.createElement(bp,{onClick:o?r:void 0,style:e},a.createElement(yp,{ref:d,role:"dialog","aria-modal":"true","aria-label":i,"aria-labelledby":c,"aria-describedby":u,onClick:h=>h.stopPropagation()},s)),m(t)):null},bp=v.default.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${b.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${It.MODAL};`,yp=v.default.div`border-radius:4px;overflow:hidden;box-shadow:0 16px 24px 2px rgba(13,13,13,0.12),0 6px 30px 5px rgba(13,13,13,0.08),0 6px 10px -5px rgba(13,13,13,0.04);z-index:${It.MODAL};`,Ap=({id:e,children:t})=>a.createElement(Tp,{id:e},t),Tp=v.default.span`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;`,Io=(e,t)=>{const n={role:"heading","aria-level":2,"aria-label":e};return t!=null&&t.active&&t.titleId?{...n,id:t.titleId,tabIndex:-1,...t.initialFocus===!1?{}:ha}:n},Ip=()=>{const e=`${l.useId()}-`;return(t,n)=>{if(!t)return{props:{},node:null};const r=e+n,s=l.createElement(Ap,{id:r,children:t});return{props:{"aria-describedby":r},node:s}}},xo=({name:e,mimeType:t,selected:n},r)=>{var o;const s=Ve(t??"")?r.A11Y_FILE_IMAGE(e):on(t??"")?r.A11Y_FILE_VIDEO(e):Ti({name:e,mimeType:t})?r.A11Y_FILE_PDF(e):r.A11Y_FILE_DOCUMENT(e);return n?((o=r.A11Y_FILE_SELECTED)==null?void 0:o.call(r,s))??`${s}, selected`:s},xp=e=>t=>{t.repeat||(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())},Zt=({onActivate:e})=>({role:"button",tabIndex:0,onClick:e,onKeyDown:xp(e)}),Mp=({disabled:e,currentIndex:t,totalCount:n,onNavigate:r})=>s=>{var u;if(e||n<=0)return;let o=null;switch(s.key){case"ArrowRight":case"ArrowDown":o=(t+1)%n;break;case"ArrowLeft":case"ArrowUp":o=(t-1+n)%n;break;default:return}s.preventDefault(),r(o);const i=s.currentTarget.parentElement,c=i==null?void 0:i.querySelectorAll('[role="radio"]');(u=c==null?void 0:c[o])==null||u.focus()},Mo=(e,t,n,r,s,o)=>{let i=-1;return(e||!s&&n===0)&&(i=0),{role:"radio","aria-checked":e,"aria-disabled":t,onKeyDown:Mp({disabled:t,currentIndex:n,totalCount:r,onNavigate:o}),tabIndex:i}},ue=()=>{const{stringSet:e}=le(),t=Ip(),n=(i,c)=>{let u=e.A11Y_HINT_OPEN_FILE,d="of";Ve(i??"")&&(u=e.A11Y_HINT_OPEN_IMAGE,d="oi"),c!==void 0&&(d+=c);const m=t(u,d);return{props:m.props,descriptionNode:m.node}},r=i=>({"aria-label":xo(i,e)});return{launcher:{button:({isOpened:i,opensConversationList:c})=>{const u=df({intent:cf({isOpened:i,opensConversationList:c}),strings:{openConversation:e.A11Y_OPEN_CONVERSATION,openConversationList:e.A11Y_OPEN_CONVERSATIONS,closeConversation:e.A11Y_CLOSE_CONVERSATION,closeConversationList:e.A11Y_CLOSE_CONVERSATIONS,hintOpenConversation:e.A11Y_HINT_OPEN_CONVERSATION,hintOpenConversationList:e.A11Y_HINT_OPEN_CONVERSATIONS,hintCloseConversation:e.A11Y_HINT_CLOSE_CONVERSATION}});let d="lc";u.hint===e.A11Y_HINT_OPEN_CONVERSATION&&(d="lo"),u.hint===e.A11Y_HINT_OPEN_CONVERSATIONS&&(d="los");const m=t(u.hint,d);return{props:{"aria-label":u.label,...m.props},descriptionNode:m.node}}},messenger:{closeButton:()=>({props:{"aria-label":e.A11Y_CLOSE_MESSENGER},descriptionNode:null}),expandButton:i=>{let c=e.A11Y_EXPAND_MESSENGER;return i&&(c=e.A11Y_COLLAPSE_MESSENGER),{props:{"aria-label":c},descriptionNode:null}},connectionDelayDialog:()=>({props:{"aria-label":e.CONNECTION_DELAY__TITLE},descriptionNode:null})},conversation:{header:{menuButton:()=>{const i=e.A11Y_HINT_OPEN_MENU,c=t(i,"mb");return{props:{"aria-label":e.A11Y_MENU,...c.props},descriptionNode:c.node}},closeConversationButton:()=>{const i=e.A11Y_HINT_CLOSE_CONVERSATION,c=t(i,"cc");return{props:{"aria-label":e.A11Y_CLOSE_CONVERSATION,...c.props},descriptionNode:c.node}},handoffButton:()=>{const i=e.A11Y_HINT_CONNECT_TO_AGENT,c=t(i,"h");return{props:{"aria-label":e.A11Y_CONNECT_AGENT,...c.props},descriptionNode:c.node}},title:(i,c)=>({props:Io(i,c),descriptionNode:null}),memoryIndicator:i=>{let c=e.A11Y_MEMORY_INDICATOR_OFF,u="mof";i&&(c=e.A11Y_MEMORY_INDICATOR_ON,u="mon");const d=t(c,u);return{props:{"aria-label":e.A11Y_MEMORY_INDICATOR_MANAGE,...d.props},descriptionNode:d.node}}},messageInput:{attachFileButton:()=>{const i=e.A11Y_HINT_ATTACH_FILE,c=t(i,"af");return{props:{"aria-label":e.A11Y_ATTACH_FILE,...c.props},descriptionNode:c.node}},sendButton:()=>{const i=e.A11Y_HINT_SEND_MESSAGE,c=t(i,"sm");return{props:{"aria-label":e.A11Y_SEND_MESSAGE,...c.props},descriptionNode:c.node}},textInput:i=>({props:{role:"textbox","aria-label":i,...Ef},descriptionNode:null})},suggestedReplies:{item:(i,c)=>{const u=e.A11Y_HINT_SEND_REPLY,d=t(u,`sr${c}`);return{props:{"aria-label":`${e.A11Y_SUGGESTED_REPLY}, ${i}`,...d.props},descriptionNode:d.node}}},feedback:{container:()=>{const i=e.A11Y_HINT_SELECT_RATING,c=t(i,"fb");return{props:c.props,descriptionNode:c.node}},button:(i,c)=>{const u=e.A11Y_HINT_SELECT_RATING,d=t(u,`f${i}`);let m=e.FEEDBACK_BAD;return i==="good"&&(m=e.FEEDBACK_GOOD),{props:{"aria-label":m,...d.props,"aria-pressed":c},descriptionNode:d.node}},optionsBottomSheet:()=>({props:{"aria-label":e.A11Y_FEEDBACK_OPTIONS},descriptionNode:null})},messageList:{item:({label:i,holding:c})=>c?{props:{"aria-hidden":!0},descriptionNode:null}:{props:{role:"listitem",tabIndex:-1,"aria-label":i},descriptionNode:null},typingItem:i=>({props:{role:"listitem",tabIndex:-1,"aria-label":en({sender:i,message:e.A11Y_TYPING_INDICATOR,codeBlockPlaceholder:e.A11Y_CODE_BLOCK_PLACEHOLDER})},descriptionNode:null})},newMessagesButton:()=>{const i=e.A11Y_HINT_VIEW_NEW_MESSAGES,c=t(i,"nm");return{props:{"aria-label":e.A11Y_SCROLL_TO_NEW_MESSAGES,...c.props},descriptionNode:c.node}},scrollToBottomButton:()=>{const i=e.A11Y_HINT_VIEW_NEW_MESSAGES,c=t(i,"sb");return{props:{"aria-label":e.A11Y_SCROLL_TO_BOTTOM,...c.props},descriptionNode:c.node}},startNewConversationButton:({onActivate:i})=>({props:{...Zt({onActivate:i}),"aria-label":e.TALK_TO_AGENT},descriptionNode:null}),poweredByLink:()=>({props:{"aria-label":`${e.POWERED_BY} Sendbird`},descriptionNode:null}),retryButton:(i=e.RETRY)=>({props:{"aria-label":i},descriptionNode:null}),file:{label:(i,c,u)=>i?xo({name:i,mimeType:c,selected:u},e):"",preview:i=>({props:r(i),descriptionNode:null}),buttonLikePreview:({onActivate:i,...c},u)=>{const d=n(c.mimeType,u);return{props:{...Zt({onActivate:i}),...r(c),...d.props},descriptionNode:d.descriptionNode}},removeButton:i=>({props:{"aria-label":e.A11Y_FILE_REMOVE_BUTTON(i)},descriptionNode:null})},csat:{scoresContainer:i=>{const c=e.A11Y_HINT_SELECT_RATING,u=t(c,"cs");return{props:{role:"radiogroup","aria-label":i,...u.props},descriptionNode:u.node}},scoreItem:({score:i,label:c,selected:u,disabled:d,currentIndex:m,totalCount:h,hasSelection:g,onChange:f})=>{var E;const p=c.trim()||c,C=e.A11Y_HINT_SELECT_RATING,_=t(C,`cs${i}`);return{props:{disabled:d,onClick:()=>f(i),...Mo(u,d,m,h,g,A=>f(A+1)),..._.props,"aria-label":((E=e.A11Y_CSAT_RATING_LABEL)==null?void 0:E.call(e,i,p))??`${i} / ${h} — ${p}`},descriptionNode:_.node}},submitButton:i=>({props:{"aria-label":i},descriptionNode:null})},form:{button:i=>({props:{"aria-label":i},descriptionNode:null}),textInput:(i,c,u,d)=>({props:{...d!=null&&d.labelId?{"aria-labelledby":d.labelId}:{"aria-label":i},"aria-required":c,"aria-disabled":u},descriptionNode:null}),numberInput:(i,c,u)=>({props:{"aria-label":i,"aria-required":c,"aria-disabled":u},descriptionNode:null}),singleSelectGroup:i=>{const c={role:"radiogroup"};return i&&(c["aria-label"]=i),{props:c,descriptionNode:null}},singleSelectOption:(i,c,u,d,m,h,g)=>({props:{...Mo(c,u,d,m,h,g),"aria-label":i},descriptionNode:null}),multiSelectOption:(i,c,u)=>({props:{"aria-label":i,"aria-pressed":c,"aria-disabled":u},descriptionNode:null})}},conversationList:{headerTitle:(i,c)=>({props:Io(i,c),descriptionNode:null}),footer:{button:({onActivate:i})=>({props:{...Zt({onActivate:i}),"aria-label":e.TALK_TO_AGENT},descriptionNode:null})},item:({agent:i,status:c,lastMessage:u,time:d,unreadCount:m,onActivate:h})=>{const g=Yg({agent:i,status:c,lastMessage:u,time:d,unreadCount:m},e.A11Y_CONVERSATION_ITEM);if(!h)return{props:{"aria-label":g},descriptionNode:null};const f=e.A11Y_HINT_OPEN_CONVERSATION,p=t(f,"cli");return{props:{...Zt({onActivate:h}),...p.props,"aria-label":g},descriptionNode:p.node}}}}},Rp=({title:e,description:t,highlightedText:n})=>{const r=bg(t,n);return a.createElement(wp,null,a.createElement(Lp,null,a.createElement(B,{as:"div",variant:"h1",color:b.themedColor.textHighEmphasis},e),t&&a.createElement(Op,null,a.createElement(B,{as:"div",variant:"body3",color:b.themedColor.textMidEmphasis},r.beforeText,r.highlightedText?a.createElement(Np,null,r.highlightedText):null,r.afterText))))},kp=()=>{const{components:e}=Xn.useContext(),{stringSet:t}=le(),{messenger:n}=ue(),r=Sg(),s=r.showDescription?vg(r.remainingTime):"",o=r.showDescription?t.CONNECTION_DELAY__DESCRIPTION(s):"";return a.createElement(St,{portalContainerId:Ae.WINDOW,visible:r.visible,onClose:Ee,...n.connectionDelayDialog().props},a.createElement(e.Dialog,{title:t.CONNECTION_DELAY__TITLE,description:o,highlightedText:s||void 0}))},Xn=Qe({template:kp,components:{Dialog:Rp}}),wp=v.default.div`width:280px;padding:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({theme:e})=>e.colors.base.modalContentBackground};`,Lp=v.default.div`display:flex;flex-direction:column;`,Op=v.default.div`margin-top:16px;`,Np=v.default.strong`font-weight:700;`,Dp=({url:e})=>vs(e),{Provider:Pp,Consumer:Pa,useContext:me}=ye("Messenger");function $p({children:e,state:t,enableCloseConversationButton:n=!1,enableExpandButton:r=!0,enableAutoDisconnectInLauncher:s=!0,...o}){const[i,c]=l.useState(!1),[u,d]=l.useState(!1),m={opened:(t==null?void 0:t.opened)??i,setOpened:(t==null?void 0:t.setOpened)??c,expanded:(t==null?void 0:t.expanded)??u,setExpanded:(t==null?void 0:t.setExpanded)??d},{resolveElement:h}=Es(),g=l.useCallback(()=>{m.setOpened(!1)},[m.setOpened]);wf(m.opened,g);const f=l.useRef(m.opened);l.useLayoutEffect(()=>{const _=f.current&&!m.opened;if(f.current=m.opened,!_)return;const E=_t(o.rootElement),A=h(Ae.WINDOW);let y=!1;return Re(()=>{var T;y||mp(E,E.activeElement,A)&&((T=h(Ae.LAUNCHER))==null||T.focus())}),()=>{y=!0}},[m.opened,o.rootElement,h]);const{Template:p}=Xn.useContext(),C=l.useMemo(()=>{var _;return{...o.handlers,onClickLink:((_=o.handlers)==null?void 0:_.onClickLink)??Dp}},[o.handlers]);return a.createElement(Sm,{...o},_=>a.createElement(Pp,{value:{...o,..._,state:m,enableCloseConversationButton:n,enableExpandButton:r,enableAutoDisconnectInLauncher:s,handlers:C}},a.createElement(p,null),e))}const $a=/iPad|iPhone|iPod/.test(navigator.userAgent),Fp=/Android/.test(navigator.userAgent),dn=e=>$a||Fp;let Yt=null,pr=null;const Up=(e,t=5e3)=>{Yt&&(clearInterval(Yt),clearTimeout(pr));const n=document.title;Yt=setInterval(()=>{document.title=document.title===e?n:e},750),pr=setTimeout(()=>{clearInterval(Yt),Yt=null,pr=null,document.title=n},t)},Fa=()=>{Promise.resolve().then(()=>require("./cjs/B93o4u0P.cjs")).then(e=>{new Audio(e.default).play().catch(()=>{})})},Ua="0 16px 24px 2px rgba(33, 33, 33, 0.12), 0 6px 30px 5px rgba(33, 33, 33, 0.08), 0 6px 10px -5px rgba(33, 33, 33, 0.04)",ke=F.css`&:focus-visible{outline:2px solid ${b.themedColor.primary};outline-offset:2px;}`,Ro=e=>{if(typeof e=="string"||typeof e=="number")return String(e)},mn=({visible:e,title:t,description:n,confirmText:r="OK",cancelText:s,onConfirm:o,onCancel:i,onClose:c,"aria-label":u})=>{const d=l.useId(),m=l.useId(),h=u??Ro(t)??Ro(n),g=u?void 0:t?d:n?m:void 0,f=t&&n?m:void 0,p=()=>{c(),Re(()=>o==null?void 0:o())},C=()=>{c(),Re(()=>i==null?void 0:i())};return a.createElement(St,{portalContainerId:Ae.WINDOW,visible:e,onClose:c,"aria-label":h,"aria-labelledby":g,"aria-describedby":f},a.createElement(Bp,null,a.createElement(Hp,null,t&&a.createElement("div",{id:d},a.createElement(B,{variant:"h1",color:b.themedColor.textHighEmphasis},t)),n&&a.createElement(Gp,{id:m},a.createElement(B,{variant:"body3",color:b.themedColor.textMidEmphasis},n))),a.createElement(zp,null,s&&a.createElement(ko,{onClick:C},a.createElement(B,{variant:"button",color:b.themedColor.textHighEmphasis},s)),a.createElement(ko,{onClick:p},a.createElement(B,{variant:"button",color:b.themedColor.primary},r)))))},Bp=v.default.div`width:360px;height:auto;padding-block:24px 12px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({theme:e})=>e.colors.base.modalContentBackground};`,Hp=v.default.div`margin-bottom:16px;`,Gp=v.default.div`margin-top:16px;`,zp=v.default.div`display:flex;flex-direction:row;justify-content:flex-end;`,ko=v.default.button`all:unset;display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:transparent;padding:10px 16px;${ke}`,{Provider:Vp,useContext:De}=ye("MessengerSession"),Kp=l.forwardRef(function({children:e,...t},n){return a.createElement(oh,{ref:n,...t},r=>a.createElement(qp,{...r},e))}),qp=({children:e,...t})=>{const{chatSDK:n,logger:r,appId:s,aiAgentId:o,agentPreviewConfigs:i,state:c,handlers:u,dispatcher:d,_aiAgentSDK:m}=me(),{userSessionInfo:h,authenticate:g,userSession:f,aiAgentInfo:p,launcherInfo:C}=t,[_,E]=l.useState(!1),A=l.useRef(null);mt(n,{async onUserJoined(T,I){var L,R,M,$;T.conversation&&T.conversation.type===Ce.ConversationType.PROACTIVE&&I.userId===((L=n.currentUser)==null?void 0:L.userId)&&(r.info("messengerSession.onUserJoined: proactive channel joined",T.url),(M=m.session)==null||M._updateActiveChannel({url:T.url,status:"open",conversationStatus:(R=T.conversation)==null?void 0:R.status}),c.setOpened(!0),Wp({sound:document.hidden||!c.opened}),($=A.current)==null||$.call(A,{channel:T}))}}),l.useEffect(()=>{g().then(({launcher:T})=>{T.auto_open&&!dn()&&setTimeout(()=>c.setOpened(!0),500)}).catch(T=>{var I;r.error("messengerSession: failed to initialize",T),(I=u==null?void 0:u.onInitializeFailed)==null||I.call(u,T)})},[n,s,o,h==null?void 0:h.userId]),l.useEffect(()=>{const T=()=>E(!0);return d.subscribe(ze.AnonymousSessionTokenExpired,T),()=>d.unsubscribe(ze.AnonymousSessionTokenExpired,T)},[d]);const y=l.useCallback(()=>{t.deauthenticate().finally(()=>window.location.reload())},[t.deauthenticate]);return!f||!p||!C?null:a.createElement(Vp,{value:{...t,userSession:f,aiAgentInfo:{...p,...i==null?void 0:i.bot},launcherInfo:{...C,...i==null?void 0:i.launcher},registerOnJoinedProactiveConversation:T=>A.current=T}},e,a.createElement(mn,{visible:_,title:"Session timed out",description:"Start a new conversation.",onConfirm:y,onClose:Ee}))};function Wp({sound:e}){Up("🔔You have received a new message"),e&&Fa()}const Bn=`@${Fe}-focused-channel`,Ba=`${Date.now()}-${Math.random().toString(36).slice(2)}`,Yp=()=>{try{const e=localStorage.getItem(Bn);return e?JSON.parse(e).channelUrl??null:null}catch{return null}},wo=e=>{try{localStorage.setItem(Bn,JSON.stringify({channelUrl:e,tabId:Ba}))}catch{}},Lo=()=>{try{const e=localStorage.getItem(Bn);if(!e)return;JSON.parse(e).tabId===Ba&&localStorage.removeItem(Bn)}catch{}},jp=(e,t)=>(l.useEffect(()=>{if(!t||!e)return;const n=()=>wo(e),r=()=>Lo();return document.hasFocus()&&wo(e),window.addEventListener("focus",n),window.addEventListener("blur",r),()=>{window.removeEventListener("focus",n),window.removeEventListener("blur",r),Lo()}},[t,e]),{isChannelViewedInAnyTab:()=>document.hasFocus()||Yp()===e}),Xp=e=>{const{config:t,chatSDK:n}=me(),{sdkUser:r}=De(),s=t.conversation.messageAlertSoundEnabled,{isChannelViewedInAnyTab:o}=jp(e,s);mt(n,{onMessageReceived(i,c){if(!s||i.url!==e||o())return;(Xe(c)&&c.sender.userId!==(r==null?void 0:r.userId)||c.isAdminMessage()&&!c.silent)&&Fa()}})},Br=new WeakMap;function Zp(e,t){Ve(e.type)&&!Br.has(e)&&Br.set(e,Ha(t))}async function Jp(e){const t=URL.createObjectURL(e),n=await Ha(t);return URL.revokeObjectURL(t),n}function Ha(e){return new Promise(t=>{const n=new Image;n.onload=function(){t({width:String(n.width),height:String(n.height)})},n.onerror=function(){t(void 0)},n.src=e})}async function Qp(e){if("file"in e&&e.file instanceof File&&Ve(e.file.type)){const t=await(Br.get(e.file)??Jp(e.file));return t?new we.MessageMetaArray({key:bi,value:[t.width,t.height]}):void 0}}const eE=({onScrollAfterSendMessage:e})=>{const{agentPreviewConfigs:t,handlers:n}=me(),r=l.useRef(t==null?void 0:t.agentAttributes);return r.current=t==null?void 0:t.agentAttributes,{onBeforeSendMessage:async s=>{const o=await Qp(s),i={...s,metaArrays:o?[o]:void 0},c=tE(r.current);return c?{...i,data:JSON.stringify(c)}:i},onAfterSendMessage:s=>{var o,i,c;e(),(o=n==null?void 0:n.onMessageSend)==null||o.call(n,s.message),s.sendingStatus===we.SendingStatus.SUCCEEDED?(i=n==null?void 0:n.onCustomEvent)==null||i.call(n,{type:"message-sent-succeeded",data:{message:s}}):s.sendingStatus===we.SendingStatus.PENDING&&((c=n==null?void 0:n.onCustomEvent)==null||c.call(n,{type:"message-sent-pending",data:{message:s}}))}}},tE=e=>{if(!e)return null;const t={};return e.ai&&Object.keys(e.ai).length>0&&(t.ai_attrs=e.ai),e.safeguard&&Object.keys(e.safeguard).length>0&&(t.safeguard_attrs=e.safeguard),typeof e.use_prompt_cache=="boolean"&&(t.use_prompt_cache=e.use_prompt_cache),Object.keys(t).length>0?t:null},Nt=50,Er=Nt-40,{Provider:nE,useContext:Ga}=ye("ConversationScroll"),Oo={viewport:0,contentHeight:0,contentSnapshotHeight:0,shouldRecalc:!1,shouldUpdate:!1},_r=e=>Math.max(0,e.scrollHeight-e.scrollTop-e.clientHeight),No=e=>Array.from(e.querySelectorAll(`#${Fe}-message-item`));function rE({scrollMode:e,messageStackDirection:t,children:n}){const r=l.useRef(null),s=l.useRef({mutation:null,resize:null,resizeTargets:new Set}),o=l.useRef({distanceFromBottom:0,prevScrollTop:0}),i=l.useRef({awayByUser:!1,programmatic:!1,streaming:!1,reconcileTimer:null,userMessageTimer:null}),c=l.useRef(Oo),[u,d]=l.useState(0),[m,h]=l.useState(0),[g,f]=l.useState(!1),[p,C]=l.useState(!1),[_,E]=l.useState(!0),A=x=>{const w=_r(x);return o.current.distanceFromBottom=w,h(w),w},y=()=>{const x=i.current;x.reconcileTimer&&(clearTimeout(x.reconcileTimer),x.reconcileTimer=null)},T=l.useCallback(()=>{const x=s.current;x.mutation&&(x.mutation.disconnect(),x.mutation=null),x.resize&&(x.resize.disconnect(),x.resize=null),x.resizeTargets.clear()},[]),I=l.useMemo(()=>g||t==="bottom"?"auto":e,[g,t,e]),k=()=>{c.current.contentSnapshotHeight=c.current.contentHeight,c.current.shouldUpdate=!0,c.current.shouldRecalc=!0},L=()=>{const x=r.current;!x||!c.current.shouldUpdate||d(w=>{c.current.shouldUpdate=!1;const{contentHeight:D,contentSnapshotHeight:U,shouldRecalc:J}=c.current,oe=x.clientHeight;if(U>D)return w;const ee=R(x,{messageType:"outgoing"});let Se=0;if(ee){const K=ee.message.offsetTop-Er+oe;Se=Math.max(0,K-D)}else{const K=D-U,he=oe-Er;Se=Math.max(0,K-he)}return w===0||Se!==w||J?(c.current.shouldRecalc=!1,Se):w})},R=l.useCallback((x,w)=>{const{messageType:D="all"}=w??{},U=No(x);let J=U;D==="outgoing"&&(J=U.filter(ge=>ge.getAttribute("data-layout-id")==="outgoingmessage"));const oe=J[J.length-1];if(!oe)return null;const ee=x.getBoundingClientRect(),Se=oe.getBoundingClientRect(),K=x.scrollTop+(Se.top-ee.top),he=K+oe.offsetHeight;return{message:oe,scrollTop:K,lastMessageBottom:he}},[]),M=l.useCallback(()=>{const x=r.current;if(!x||I!=="fixed")return;const w=R(x);c.current.contentHeight=(w==null?void 0:w.lastMessageBottom)??x.scrollHeight,!i.current.streaming&&c.current.contentSnapshotHeight>0&&k(),i.current.programmatic?o.current.distanceFromBottom=_r(x):A(x),L()},[I,R]),$=l.useCallback(()=>{T(),y(),c.current=Oo,d(0),h(0),E(!0),o.current.distanceFromBottom=0,o.current.prevScrollTop=0,i.current.awayByUser=!1,i.current.programmatic=!1},[T]),N=l.useCallback((x=!0)=>{const w=o.current.distanceFromBottom>Nt;if(i.current.awayByUser=!1,h(0),!w){Re(()=>{const D=r.current;D&&!i.current.awayByUser&&D.scrollTo({top:D.scrollHeight,behavior:"auto"})});return}i.current.programmatic||(i.current.programmatic=!0,E(!1),y()),Re(()=>{const D=r.current;if(!D){i.current.programmatic=!1,E(!0);return}if(i.current.awayByUser){i.current.programmatic=!1,A(D),E(!0);return}const U=()=>{if(r.current!==D){i.current.programmatic=!1,r.current&&A(r.current),E(!0);return}i.current.programmatic=!1,A(D),E(!0)};if(x&&!i.current.reconcileTimer){const J=setTimeout(U,500);i.current.reconcileTimer=J,D.addEventListener("scrollend",()=>{clearTimeout(J),i.current.reconcileTimer=null,U()},{once:!0})}D.scrollTo({top:D.scrollHeight,behavior:x?"smooth":"auto"}),x||U()})},[]),Q=l.useCallback(()=>{const x=r.current;if(x){if(i.current.awayByUser){A(x);return}N(!1)}},[N]),se=l.useCallback(()=>{const x=r.current,w=s.current;if(!x||!w.resize)return;const D=new Set(No(x));for(const U of w.resizeTargets)D.has(U)||(w.resize.unobserve(U),w.resizeTargets.delete(U));for(const U of D)w.resizeTargets.has(U)||(w.resize.observe(U),w.resizeTargets.add(U))},[]),Y=l.useCallback(x=>{T();const w=s.current;typeof ResizeObserver<"u"&&(w.resize=new ResizeObserver(Q),se());const D=new MutationObserver(()=>{se(),Q()});w.mutation=D,D.observe(x,{childList:!0})},[T,Q,se]),j=l.useCallback(x=>{if(!x){r.current=null,T();return}if(r.current=x,I!=="fixed"){Y(x);return}$(),c.current.viewport=x.clientHeight;const w=new MutationObserver(()=>{M()});s.current.mutation=w,w.observe(x,{childList:!0,subtree:!0})},[T,I,M,$,Y]),P=l.useCallback(()=>{const x=r.current;if(!x)return;const w=R(x,{messageType:"outgoing"});w&&(x.scrollTo({top:w.message.offsetTop-Er,behavior:"smooth"}),i.current.userMessageTimer&&clearTimeout(i.current.userMessageTimer),i.current.userMessageTimer=setTimeout(()=>{C(!1)},500))},[R]),q=(x,w,D)=>{const U=_r(x);if(D&&U>Nt){i.current.programmatic=!1,i.current.awayByUser=!0,y(),A(x),E(!0),o.current.prevScrollTop=w;return}o.current.distanceFromBottom=U},W=(x,w,D)=>{const J=A(x)<=Nt;w&&!J&&(i.current.awayByUser=!0,y()),D&&J&&(i.current.awayByUser=!1)},G=l.useCallback(x=>{const{scrollTop:w}=x.currentTarget,D=o.current.prevScrollTop;i.current.programmatic?q(x.currentTarget,w,w<D):W(x.currentTarget,w<D,w>D),o.current.prevScrollTop=w},[]),H=l.useCallback(()=>{I==="fixed"&&(C(!0),k())},[I]),V=l.useCallback(()=>{I==="fixed"?setTimeout(()=>P(),300):N()},[I,P]),z=l.useCallback(x=>{i.current.streaming=x,I==="fixed"?k():i.current.awayByUser||N()},[I,N]),Z=l.useCallback(x=>{f(x),x&&(d(0),I==="fixed"&&T())},[T,I]),ae=l.useCallback(x=>{I==="auto"&&x&&!i.current.awayByUser&&N()},[I,N]),be=!(m<=Nt)&&!p,xe=l.useCallback(()=>o.current.distanceFromBottom>Nt,[]),Oe=l.useMemo(()=>({ref:j,state:{bottomSpace:u,isAwayFromBottom:be,isScrollPositionReconciled:_,shouldCountNewMessages:xe},props:{onScroll:G},actions:{scrollToBottom:N,onBeforeMessageSend:H,onAfterMessageSend:V,onStreamingUpdate:z,onConversationClosed:Z,onTypingIndicatorUpdate:ae}}),[j,u,be,_,xe,G,N,H,V,z,Z,ae]);return a.createElement(nE,{value:Oe},n)}const{Provider:sE,Context:oE,useContext:Me}=ye("Conversation"),iE=({children:e})=>{var s;const{channelSource:t}=Me(),n=(s=t.channel)==null?void 0:s.url,{checkForUserActionRequired:r}=ng(n);return tg(n),l.useEffect(()=>{var i;const o=(i=t.channel)==null?void 0:i.lastMessage;o&&r(o)},[t.channel,r]),a.createElement(a.Fragment,null,e)},aE=({context:e,scrollSource:t,goToActiveConversation:n,onNavigateToConversationList:r,children:s})=>{const o=l.useMemo(()=>({...e,scrollSource:t,goToActiveConversation:n,onNavigateToConversationList:r}),[e,t,n,r]);return a.createElement(sE,{value:o},s)},cE=({channelUrl:e,onClearChannelUrl:t,onNavigateToConversationList:n,conversationStatsEnabled:r,shouldMarkAsRead:s,shouldInitializeConversation:o,initialUserMessage:i,children:c})=>{const{activeChannel:u,refreshActiveChannel:d}=De(),m=Ga(),h=e||(u==null?void 0:u.url);Xp(h);const{onBeforeSendMessage:g,onAfterSendMessage:f}=eE({onScrollAfterSendMessage:()=>{m.actions.onAfterMessageSend()}}),p=l.useCallback(A=>(m.actions.onBeforeMessageSend(),g(A)),[m.actions,g]),C=l.useCallback(A=>{const y=A.some(T=>Ie.isStreaming(T));m.actions.onStreamingUpdate(y)},[m.actions.onStreamingUpdate]),_=l.useCallback(A=>{m.actions.onConversationClosed(A===Ce.ConversationStatus.CLOSED)},[m.actions.onConversationClosed]),E=l.useCallback(async()=>{await d(),e&&(t==null||t())},[d,e,t]);return a.createElement(Dh,{key:h,channelUrl:h,onBeforeSendMessage:p,onAfterSendMessage:f,onMessagesUpdated:C,onMessagesReceived:C,onChannelDeleted:E,onConversationStatusChanged:_,conversationStatsEnabled:r,shouldMarkAsRead:s,shouldInitializeConversation:o,initialUserMessage:i,shouldCountNewMessages:m.state.shouldCountNewMessages},A=>a.createElement(aE,{context:A,scrollSource:m,goToActiveConversation:E,onNavigateToConversationList:n},a.createElement(iE,null,c)))},za=({children:e,...t})=>{const{config:n}=Te(),{agentPreviewConfigs:r}=me(),s=n.conversation.list.scrollMode,o=r==null?void 0:r.messageStackDirection;return a.createElement(rE,{scrollMode:s,messageStackDirection:o},a.createElement(cE,{...t},e))},bs=l.createContext({onDrop:Ee,subscribe:()=>Ee}),Hr=({children:e})=>{const t=l.useRef(new Set);return a.createElement(bs.Provider,{value:{onDrop:n=>{var r;if(n.preventDefault(),(r=n.dataTransfer)!=null&&r.files){const s=Array.from(n.dataTransfer.files);s.length>0&&t.current.forEach(o=>o(s))}},subscribe:n=>(t.current.add(n),()=>t.current.delete(n))}},e)},lE=({onDropFiles:e})=>{const{subscribe:t}=l.useContext(bs);l.useEffect(()=>t(e),[e])};Hr.Consumer=({children:e})=>{const{onDrop:t}=l.useContext(bs);return e({onDrop:t,onDragOver:s=>s.preventDefault()})};const Va=ye("WindowTitle",{hasWindowTitleReference:!1,isTitlePending:!1,isWindowNameReady:!0,registerWindowTitleReference:()=>Ee,registerWindowTitlePending:()=>Ee}),uE=Va.Provider,Ka=Va.useContext,Do=()=>{const e=l.useRef(0),[t,n]=l.useState(!1),r=l.useCallback(()=>{let s=!0;return e.current+=1,e.current===1&&n(!0),()=>{s&&(s=!1,e.current=Math.max(0,e.current-1),e.current===0&&n(!1))}},[]);return[t,r]},ys=({children:e})=>{const[t,n]=Do(),[r,s]=Do(),o=!r||t,i=l.useMemo(()=>({hasWindowTitleReference:t,isTitlePending:r,isWindowNameReady:o,registerWindowTitleReference:n,registerWindowTitlePending:s}),[t,r,n,s]);return a.createElement(uE,{value:i},e)},Zn=Ka,qa=({enabled:e,label:t})=>{const{registerWindowTitleReference:n,registerWindowTitlePending:r}=Ka(),s=e&&t.trim().length>0;return l.useLayoutEffect(()=>{if(e)return r()},[r,e]),l.useLayoutEffect(()=>{if(s)return n()},[n,s]),{enabled:s,id:s?Ae.WINDOW_TITLE:void 0}},dE=(e,t)=>{const r=(t?rn(e,t):null)??hp(e)??e;r===e&&!e.hasAttribute("tabindex")&&e.setAttribute("tabindex","-1"),r.focus({focusVisible:!1})},Wa=(e,{enabled:t,ready:n,nameReady:r=!0,targetSelector:s,suppressed:o=!1})=>{const i=l.useRef(!1);l.useEffect(()=>{if(!t){i.current=!1;return}if(i.current||!e.current||o||s&&!n)return;const c=Ss(e.current)!=null;if(!s&&!c&&!n)return;let u=!1;const d=()=>{u||i.current||!e.current||(i.current=!0,dE(e.current,s))};if(r)return Re(d),()=>{u=!0};const m=setTimeout(()=>Re(d),Ca);return()=>{u=!0,clearTimeout(m)}},[t,n,r,s,e,o])},mE=(e,t)=>{const{announcementsEnabled:n}=gt(),{channelSource:r}=Me(),{isWindowNameReady:s}=Zn(),o=Ia(),i=r.channel!=null||r.error!=null;Wa(e,{enabled:n,ready:i,nameReady:s,targetSelector:t==="messageInput"?pf:void 0,suppressed:o})},hE=()=>{var s;const{_statsEnabled:e,channelSource:t}=Me(),n=(s=t.channel)==null?void 0:s.url,r=l.useCallback(o=>{const i=()=>{o(Pr()?"backgrounded":"foregrounded")};return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)},[]);Tg({channelUrl:n,enabled:e,isInitiallyBackgrounded:Pr,isForegrounded:Sf,subscribeToForegroundState:r})},gE=e=>Ve(e)||on(e);function fE(e,t){return e.filter(n=>Ie.isWelcomeMessage(n,t))}const Ya=(e,{previewWelcomeMessages:t,aiAgentUserId:n})=>e.filter(r=>t.length>0?!Ie.isWelcomeMessage(r,n):!0),pE=[],ja=()=>{var f,p,C,_;const{agentPreviewConfigs:e={},aiAgentId:t}=me(),{aiAgentInfo:n,userSession:r}=De(),{channelSource:s,messageSource:o,state:{input:i,streamAnimation:c}}=Me(),u=e.welcomeMessages??pE,d=l.useMemo(()=>Ya(o.messages,{previewWelcomeMessages:u,aiAgentUserId:t}),[t,o.messages,u]),m=dt(s.channel),g=((p=(f=Li(s.channel,r.userId))==null?void 0:f.nickname)==null?void 0:p.trim())||((C=n==null?void 0:n.nickname)==null?void 0:C.trim())||void 0;return{initialized:o.initialized,channelUrl:(_=s.channel)==null?void 0:_.url,agentName:g,isClosed:$e(s.channel),isHandedOff:m,messages:d,filteredMessagesCount:d.length,hasWelcomeMessages:u.length>0,inputDisabled:i.disabled,inputDisabledBy:i.disabledBy,isStreamAnimating:c.isAnimating,currentUserId:r.userId}},EE=(e={})=>{const{announceScreenEntry:t,announcementsEnabled:n}=gt(),{initialized:r=!1,channelUrl:s,agentName:o,isClosed:i=!1,messages:c=[],hasWelcomeMessages:u=!1}=e,d=l.useRef(null),m=l.useMemo(()=>c.some(g=>Le.isAdmin(g)&&Le.isCSAT(g)),[c]),h=c.length===0&&!u;l.useEffect(()=>{if(!n){d.current=null;return}!r||!s||d.current!==s&&(t({screen:"conversation",agentName:o,isClosed:i,hasCSAT:m,...h?{isEmpty:!0}:{}}),d.current=s)},[o,t,n,s,m,r,i,h])},_E=()=>{const e=ja();EE(e)},Xa=e=>({image:e.A11Y_RECEIVED_FILE_IMAGE,video:e.A11Y_RECEIVED_FILE_VIDEO,pdf:e.A11Y_RECEIVED_FILE_PDF,document:e.A11Y_FILE_DOCUMENT,receivedFilesImageCount:e.A11Y_RECEIVED_FILES_IMAGE_COUNT,multipleFilesCount:e.CONVERSATION_LIST__MULTIPLE_FILES_COUNT,codeBlockPlaceholder:e.A11Y_CODE_BLOCK_PLACEHOLDER}),Po=(e,t,n=pt.format)=>{const r=ua(e,Xa(t)),s="sender"in e?e.sender:void 0,o=e.createdAt!=null&&e.createdAt!==0?n(e.createdAt,t.DATE_FORMAT__MESSAGE_TIMESTAMP):void 0;return{senderName:typeof(s==null?void 0:s.nickname)=="string"&&s.nickname.trim()||void 0,body:r||void 0,time:o}},CE={senderName:!0,body:!0,time:!0},SE=Object.keys(CE),vE=(e,t)=>SE.every(n=>e[n]===t[n]),$o=2e3,Fo=400,Gr=e=>{const t=new Set;return"reqId"in e&&typeof e.reqId=="string"&&e.reqId.length>0&&t.add(`req:${e.reqId}`),"messageId"in e&&e.messageId>0&&t.add(`message:${String(e.messageId)}`),[...t]},Za=e=>{if(!Le.isAdmin(e)||!Le.isCSAT(e))return null;const t=of(e);return t?`csat:${t}`:null},bE=e=>{const t=new Set;for(const n of e){const r=Za(n);r&&t.add(r)}return t},yE=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r&&Gr(r).some(s=>t.includes(s)))return r}},Cr=(e,t)=>e.some(n=>t.includes(n)),Uo=()=>typeof document>"u"?null:document.activeElement instanceof HTMLElement?document.activeElement:null,Sr=e=>new Map(e.map(({key:t,sendingStatus:n})=>[t,n])),AE=()=>{const{announceStatus:e,announcementsEnabled:t}=gt(),{stringSet:n,format:r}=le(),{channelUrl:s,messages:o,isClosed:i,isHandedOff:c,agentName:u,initialized:d,inputDisabled:m,inputDisabledBy:h,isStreamAnimating:g,currentUserId:f}=ja(),{outgoingMessageStates:p,outgoingMessageStatusSignature:C}=l.useMemo(()=>{if(!f)return{outgoingMessageStates:[],outgoingMessageStatusSignature:""};const G=o.flatMap(H=>{const V=rf(H,f);return!V||!("sendingStatus"in H)?[]:[{key:V,sendingStatus:H.sendingStatus}]});return{outgoingMessageStates:G,outgoingMessageStatusSignature:G.map(({key:H,sendingStatus:V})=>`${H}:${V}`).join(",")}},[f,o]),_=l.useRef({isClosed:!1,isHandedOff:!1,inputDisabled:m,inputDisabledBy:h,outgoingMessageStatuses:Sr(p)}),E=l.useRef({messages:o,currentUserId:f,inputDisabledBy:h,isStreamAnimating:g,stringSet:n,format:r}),A=l.useRef([]),y=l.useRef(null),T=l.useRef([]),I=l.useRef(new Set),k=l.useRef(new Set),L=l.useRef(!1),R=l.useRef(s);E.current={messages:o,currentUserId:f,inputDisabledBy:h,isStreamAnimating:g,stringSet:n,format:r};const M=()=>E.current.isStreamAnimating||E.current.inputDisabledBy==="ai_responding",$=()=>{y.current!=null&&(clearTimeout(y.current),y.current=null)},N=(G,H,V)=>{const z=V==null?void 0:V.replaceableForMs;if(G.length===0||!z)return;const Z=Date.now();T.current=[...T.current.filter(({replaceableUntil:ae})=>ae>Z),{eventKeys:G,parts:H,replaceableUntil:Z+z}]},Q=()=>A.current.length>0,se=()=>{A.current=[]},Y=()=>{const[G,...H]=A.current;if(!G)return!1;A.current=H;const{eventKeys:V,parts:z,dedupeKey:Z}=G,ae=xe=>{N(V,xe,{replaceableForMs:V.length>0?$o:void 0}),e({event:"newMessage",...xe},Z?{dedupeKey:Z}:void 0)};if(V.length===0)return ae(z),!0;const O=E.current,be=yE(O.messages,V);if(be){const xe=Po(be,O.stringSet,O.format);return ae(xe),!0}return ae(z),!0},j=()=>{for($();Y(););},P=(G=$o)=>{$(),y.current=setTimeout(()=>{if(y.current=null,M())return;const H=Uo(),[V]=A.current;if(!V)return;if(V.focusTarget!==H){A.current=[{...V,focusTarget:H},...A.current.slice(1)],P(Fo);return}Y()&&Q()&&P(Fo)},G)},q=(G,H,V)=>{const z={eventKeys:H,parts:G,focusTarget:Uo(),dedupeKey:V?V.dedupeKey??void 0:H[0]},Z=H.length===0?-1:A.current.findIndex(({eventKeys:ae})=>Cr(ae,H));Z>=0?A.current=A.current.map((ae,O)=>O===Z?{...z,dedupeKey:V?z.dedupeKey:ae.dedupeKey}:ae):A.current=[...A.current,z],P()},W=(G,H,V)=>{if(G!=="messagesUpdated"||H.length===0)return!1;const z=Date.now(),Z=T.current.find(ae=>ae.replaceableUntil>z&&Cr(ae.eventKeys,H));return Z?!vE(V,Z.parts):!1};l.useEffect(()=>{const G=R.current!==s;(!t||!d||G)&&(L.current=!1,k.current.clear(),se(),T.current=[],I.current.clear(),$(),G&&(R.current=s),!t||!d)||L.current||(L.current=!0,R.current=s,_.current={isClosed:i,isHandedOff:c,inputDisabled:m,inputDisabledBy:h,outgoingMessageStatuses:Sr(p)},I.current=new Set(o.flatMap(H=>{if(!Ie.isStreaming(H))return[];const V="sender"in H?H.sender:void 0;return(V==null?void 0:V.userId)===E.current.currentUserId?[]:Gr(H)})),k.current=bE(o))},[e,t,s,d,m,i,c,C]),l.useEffect(()=>{const G=(H,V)=>{const z=E.current,Z=Gr(H),ae=Za(H);if(ae!=null){if(k.current.has(ae))return;k.current.add(ae),e({event:"csatDisplayed"});return}if(Ie.isStreaming(H)){Z.forEach(U=>{I.current.add(U)});return}const O=Z.filter(U=>I.current.has(U)),be=V==="messagesUpdated"&&O.length>0;be&&O.forEach(U=>{I.current.delete(U)});const xe=V==="messagesUpdated"&&A.current.some(({eventKeys:U})=>Cr(U,Z)),Oe=Po(H,z.stringSet,z.format),x=W(V,Z,Oe);if(!be&&V!=="messagesAdded"&&!xe&&!x)return;const w=x?{dedupeKey:null}:void 0;if(be||M()||xe){q(Oe,[...new Set([...O,...Z])],w);return}if(x){q(Oe,Z,w);return}Q()&&j();const D=Z[0];e({event:"newMessage",...Oe},D?{dedupeKey:D}:void 0)};return qn.subscribe(H=>{if(!L.current||H.channelUrl!==s||H.kind==="initialized"||H.kind==="messagesDeleted"||!af(H.source))return;const V=E.current.currentUserId;for(const z of H.messages)z&&sf(z,V)&&G(z,H.kind)})},[e,s]),l.useEffect(()=>{L.current&&(M()||Q()&&P())},[h,g]),l.useEffect(()=>()=>{$()},[]),l.useEffect(()=>{if(!L.current)return;const G=_.current,H=G.outgoingMessageStatuses;G.outgoingMessageStatuses=Sr(p),p.some(({key:z,sendingStatus:Z})=>{const ae=H.get(z);return ae!==void 0&&ae!=="failed"&&Z==="failed"})&&e({event:"sendFailed"})},[e,C]),l.useEffect(()=>{if(!L.current)return;const G=_.current;i&&!G.isClosed&&e({event:"conversationClosed"}),G.isClosed=i},[e,i]),l.useEffect(()=>{if(!L.current)return;const G=_.current;c&&!G.isHandedOff&&e({event:"agentConnected",agentName:u}),G.isHandedOff=c},[u,e,c]),l.useEffect(()=>{if(!L.current)return;const G=_.current;m&&h!=="ai_responding"&&(!G.inputDisabled||G.inputDisabledBy==="ai_responding")&&e({event:"inputDisabled"}),G.inputDisabled=m,G.inputDisabledBy=h},[e,m,h])},TE=()=>{const{channelSource:e}=Me(),t=ta(e.channel);return!(t!=null&&t.user.userId)||!t.user.nickname?null:{userId:t.user.userId,nickname:t.user.nickname}},IE=e=>{const{announceStatus:t,announcementsEnabled:n}=gt();ag(e??null,r=>{t({event:"typing",agentName:r})},1e4,n)},xE=()=>{const e=TE();IE(e)},te=({type:e,size:t=24,className:n,color:r})=>{const{icons:s}=Jf(),o=s[e];return a.createElement(ME,{className:n,"data-testid":`sb-icon-${e}`},a.createElement(o,{size:t,color:r??b.color.primary.main,flipInRtl:Kf.has(e)}))},ME=v.default.span.attrs({"aria-hidden":"true"})`
91
91
  display: inline-flex;
package/dist/index.js CHANGED
@@ -8008,7 +8008,7 @@ const Pg = /* @__PURE__ */ new Set(["free_text", "single_choice"]), Fg = ({ csat
8008
8008
  }) => ({
8009
8009
  label: Pf(e, t),
8010
8010
  hint: Ff(e, t)
8011
- }), Bf = "1.43.0", Ve = "sb-agent", Me = {
8011
+ }), Bf = "1.43.1", Ve = "sb-agent", Me = {
8012
8012
  ENTRY: `${Ve}-entry`,
8013
8013
  MODAL_ROOT: `${Ve}-modal-root`,
8014
8014
  WINDOW: `${Ve}-window`,
@@ -9108,6 +9108,8 @@ const Np = (e, t) => {
9108
9108
  "input:not(:disabled)",
9109
9109
  "select:not(:disabled)",
9110
9110
  "textarea:not(:disabled)",
9111
+ // Tab reaches an iframe without a tabindex, so the focus trap must be able to wrap to one too.
9112
+ 'iframe:not([tabindex="-1"])',
9111
9113
  '[tabindex]:not([tabindex="-1"])'
9112
9114
  ].join(", "), Ya = `${rr}, [tabindex="-1"]`, Wt = (e) => {
9113
9115
  if (!e.isConnected || e.hidden) return !1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendbird/ai-agent-messenger-react",
3
- "version": "1.43.0",
3
+ "version": "1.43.1",
4
4
  "description": "Delight AI Agent Messenger for React",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -47,7 +47,8 @@
47
47
  "react-dom": "^19.0.0",
48
48
  "strip-json-comments": "^5.0.1",
49
49
  "styled-components": "^6.1.15",
50
- "@sendbird/ai-agent-core": "1.43.0",
50
+ "@sendbird/ai-agent-core": "1.43.1",
51
+ "@sendbird/ai-agent-test-fixtures": "0.0.1",
51
52
  "@sendbird/config-editor": "0.1.0",
52
53
  "@sendbird/dev-tools": "0.0.1",
53
54
  "@sendbird/test-presets": "0.0.1",