@helpai/elements 0.68.3 → 0.68.5

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/elements.js CHANGED
@@ -1,21 +1,21 @@
1
- "use strict";var HelpAI=(()=>{var Ir=Object.defineProperty;var __=Object.getOwnPropertyDescriptor;var u_=Object.getOwnPropertyNames;var p_=Object.prototype.hasOwnProperty;var f_=(e,t,n)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var m_=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of u_(t))!p_.call(e,a)&&a!==n&&Ir(e,a,{get:()=>t[a],enumerable:!(o=__(t,a))||o.enumerable});return e};var g_=e=>m_(Ir({},"__esModule",{value:!0}),e);var K=(e,t,n)=>f_(e,typeof t!="symbol"?t+"":t,n);var Jm={};var P={id:"help-ai",name:"@helpai/elements",global:"HelpAI",tagName:"web-ai-chat",cssPrefix:"helpai",defaultBaseUrl:"https://help.ai",displayName:"Help AI",domain:"help.ai",siteUrl:"https://help.ai"};var hi={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",talkToOperator:"Talk to an operator",connectingOperator:"Connecting you to an operator\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",cancelOperatorRequest:"Keep chatting with the AI",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",reject:"Reject",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},h_={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",talkToOperator:"Parler \xE0 un op\xE9rateur",connectingOperator:"Mise en relation avec un op\xE9rateur\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",cancelOperatorRequest:"Continuer avec l'IA",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",reject:"Refuser",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},v_={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0645\u0648\u0638\u0641",connectingOperator:"\u062C\u0627\u0631\u064A \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0623\u062D\u062F \u0627\u0644\u0645\u0648\u0638\u0641\u064A\u0646\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0631\u062F",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},b_={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",talkToOperator:"Hablar con un operador",connectingOperator:"Conect\xE1ndote con un operador\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",cancelOperatorRequest:"Seguir con la IA",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",reject:"Rechazar",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},y_={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",talkToOperator:"\u05D3\u05D1\u05E8 \u05E2\u05DD \u05E0\u05E6\u05D9\u05D2",connectingOperator:"\u05DE\u05D7\u05D1\u05E8 \u05D0\u05D5\u05EA\u05DA \u05DC\u05E0\u05E6\u05D9\u05D2\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E2\u05E0\u05D4",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},P_={en:hi,fr:h_,ar:v_,es:b_,he:y_};function oo(e,t){let n=vi(e),o=ro(t),a=n==="en"?{}:P_[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...hi,...a,...l,...i}}function vi(e){return(e.split("-")[0]??"en").toLowerCase()}var x_=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function bi(e){return x_.has(vi(e))}function Oe(e,t){return e[t]??t}function ro(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function yi(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function Pi(e,t){let{translations:n,defaultLocale:o,...a}=e,i=yi(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function xi(e,t){let{translations:n,defaultLocale:o,...a}=e,i=yi(n,t);if(!i)return a;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=a.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(m=>[m.value,m]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(m=>{let _=u.get(m.value);return _?{...m,label:_.label??m.label,description:_.description??m.description}:m})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var Ar=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},ao=new Ar;var Or=["off","error","warn","info","debug","trace"],Nr=P.cssPrefix,Si=`${Nr}.debug`,S_=`__${P.global}_DEBUG__`,k_=`${Nr}-debug`,io=2,Mr=null;function w_(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(k_);if(e!==null){let t=Lr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Si);if(e){let t=Lr(e);if(t>=0)return t}}catch{}return Reflect.get(window,S_)?4:2}function Lr(e){if(e===!0||e==="1"||e==="true")return 4;if(e===!1||e==="0"||e==="false"||e==="off")return 0;if(typeof e=="number")return Math.max(0,Math.min(5,Math.floor(e)));if(typeof e=="string"){let t=Or.indexOf(e);if(t>=0)return t}return-1}function so(e){let t=Lr(e);if(!(t<0)){io=t;try{window.localStorage?.setItem(Si,Or[t])}catch{}}}function mn(){return Or[io]}io=w_();function ki(e){let t=`[${Nr}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(io<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),Mr))try{Mr({level:i,scope:e,message:l,payload:s})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>ki(`${e}:${o}`)}}var W=ki("core");function gn(e){Mr=e}var St=W.scope("context"),C_=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),wi=50,Dr=1024,E_=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function $r(e){return Ci(e,"userContext",!0)}function Fr(e){return Ci(e,"pageContext",!1)}function Ci(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){St.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},a=0;for(let[i,l]of Object.entries(e)){if(C_.has(i)){St.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=wi){St.warn(`${t} truncated at ${wi} keys \u2014 dropped "${i}"`);continue}let s=T_(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!E_.test(o.email)&&(St.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function T_(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){St.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Dr?(St.warn(`truncated ${e}.${t} to ${Dr} chars`),o.slice(0,Dr)):o}St.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var lo={maxBytes:10485760,maxCount:10,accept:"*/*"},Ei={voice:"local"},Ti={list:[],byTrigger:{}},Br={enabled:!0,sampleRate:1},co={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},qt={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Ri={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},Hr={enabled:!0,volume:.3,events:void 0},Ii={enabled:!0,events:void 0},Ai=[{label:"tabConversations",layout:"chat"}];function mt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},a=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=R_(t.theme),u=n.mode??"floating",m=I_(a.defaultLocale),_=a.availableLocales??[a.locale??m],h=Wt(a.locale??m,_,m),f=(t.baseUrl??P.defaultBaseUrl).replace(/\/$/,""),b=(t.agentApiBaseUrl??`${f}/api/agent`).replace(/\/$/,""),g=(t.dataApiBaseUrl??`${f}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:f,agentApiBaseUrl:b,dataApiBaseUrl:g,userContext:$r(t.userContext),pageContext:Fr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:u,iframe:n.iframe??!1,responseMode:o.responseMode??"streaming",showReasoning:o.showReasoning??!1,showToolCalls:o.showToolCalls??!1,showSources:o.showSources??!1,enableMessageFeedback:!(o.disableMessageFeedback??!1),autoSendSuggestions:o.autoSendSuggestions??!1,features:{voice:t.features?.voice??Ei.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0,tools:t.features?.tools},forms:hn(t.forms,h),endpoints:{upload:t.endpoints?.upload??co.upload,transcribe:t.endpoints?.transcribe??co.transcribe,submitForm:t.endpoints?.submitForm??co.submitForm},attachments:{accept:t.composer?.attachments?.accept??lo.accept,maxBytes:t.composer?.attachments?.maxBytes??lo.maxBytes,maxCount:t.composer?.attachments?.maxCount??lo.maxCount},locale:h,defaultLocale:m,availableLocales:_,startMinimized:o.startMinimized??!0,actions:A_(u,s.actions),size:n.size??{},launcher:B_(t.launcher),sound:M_(i.sound),haptics:L_(i.haptics),strings:oo(h,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:N_(l.poweredBy),composer:D_(t.composer),modules:$_(t.modules),tracking:O_(t.tracking,g),storage:t.storage??ao,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function R_(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function I_(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function Wt(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function A_(e,t){return t??Ri[e]}function M_(e){return{enabled:e?.enabled??Hr.enabled,volume:e?.volume??Hr.volume,events:e?.events}}function L_(e){return{enabled:e?.enabled??Ii.enabled,events:e?.events}}function O_(e,t){let n=e?.sampleRate??Br.sampleRate;return{enabled:e?.enabled??Br.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function N_(e){let n={...{text:`Powered by ${P.displayName}`,href:P.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function D_(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function $_(e){let t=e===void 0?Ai:e,n=new Set,o=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let l=i.contentTags?.filter(Boolean),s=i.id??l?.[0]??i.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:i.label,layout:i.layout};l&&l.length>0&&(c.contentTags=l),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=!(i.hideGreeting??!1),c.showSearchBar=!(i.hideSearchBar??!1),c.showRecentConversations=!(i.hideRecentConversations??!1),i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),o.push(c)}let a=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:a}}function hn(e,t){var i;if(!e?.length)return Ti;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=xi(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(F_).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let a={};for(let l of n)for(let s of l.triggers)(a[i=s.kind]??(a[i]=[])).push(l);return{list:n,byTrigger:a}}function F_(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"after-messages",param:o}:null}if(t==="idle"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"idle",param:o}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function B_(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??qt.variant,size:e?.size??qt.size,label:e?.label??qt.label,icon:e?.icon??qt.icon,hidden:e?.hidden??qt.hidden,callout:t}}function zr(e,t,n,o){let a=Wt(t,e.availableLocales,e.defaultLocale);if(a===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return a!==e.locale&&(i.locale=a,i.strings=oo(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var H_=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Ur(e,t){if(!t)return e;let n={...e};for(let i of H_){let l=t[i];if(l===void 0)continue;let s=e[i];if(i==="theme"){s===void 0&&(n[i]=l);continue}i!=="i18n"&&(n[i]=Mi(l,s))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let o=e.i18n,a=t.i18n;if(o||a){let i=Mi(a??{},o);a?.availableLocales!==void 0&&(i.availableLocales=a.availableLocales),a?.defaultLocale!==void 0&&(i.defaultLocale=a.defaultLocale);let l=o?.strings,s=a?.strings;(l||s)&&(i.strings=z_(s,l)),n.i18n=i}return n}function Mi(e,t){if(!t)return e;let n={...e};for(let[o,a]of Object.entries(t))a!==void 0&&(n[o]=a);return n}function z_(e,t){if(!e)return t;if(!t)return e;let n=ro(e),o=ro(t);if(!n&&!o)return{...e,...t};let a={},i=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(i))a[s]={...c};for(let[s,c]of Object.entries(l))a[s]={...a[s],...c};return a}var U_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],it=e=>e!=="false",Oi=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Ni=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],Di=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",it]],$i=[["width","width"],["height","height"]],Fi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",it],["show-reasoning","showReasoning",it],["show-tool-calls","showToolCalls",it],["show-sources","showSources",it],["disable-message-feedback","disableMessageFeedback",it],["auto-send-suggestions","autoSendSuggestions",it]],Bi=[["locale","locale"]],q_=new Set(U_),W_=e=>Oi(e).filter(t=>q_.has(t)),Hi=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",it]],zi=[["features-disable-file-upload","disableFileUpload",it],["features-voice","voice",e=>e],["features-tools","tools",Oi]],Ui=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],qi=[["user-id","id"],["user-email","email"],["user-name","name"]],Wi=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],V_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],K_=[Ni,Di,$i,Fi,Bi,Hi,zi,Ui,qi,Wi],G_=new Set(["iframe","start-minimized"]),qr=[...K_.flatMap(e=>e.map(([t])=>t).filter(t=>!G_.has(t))),...V_];function _o(e){let t={},n=h=>{let f=e(h);return f===null||f===""?void 0:f};for(let[h,f,b]of Ni){let g=n(h);g!==void 0&&(t[f]=b?b(g):g)}let o=kt(n,Di),a=kt(n,$i);(o||a)&&(t.presentation={...o,...a?{size:a}:{}});let i=kt(n,Fi);i&&(t.behavior=i);let l=kt(n,Bi);l&&(t.i18n=l);let s=X_(e,n);s&&(t.launcher=s);let c=kt(n,zi);c&&(t.features=c);let d=kt(n,Ui);d&&(t.endpoints=d);let u=Li(n,qi,"user-context");u&&(t.userContext=u);let m=Li(n,Wi,"page-context");m&&(t.pageContext=m);let _=n("actions");return _!==void 0&&(t.header={actions:W_(_)}),t}function Wr(e){return e?_o(t=>e[j_(t)]??null):{}}function j_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function kt(e,t){let n={};for(let[o,a,i]of t){let l=e(o);l!==void 0&&(n[a]=i?i(l):l)}return Object.keys(n).length>0?n:null}function Li(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let a={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(a=s)}catch{}let l={...a,...o};return Object.keys(l).length>0?l:null}function X_(e,t){let n=kt(t,Hi)??{},o=e("launcher-label");o!==null&&(n.label=o);let a=t("callout-text");if(a){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:a,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var vo,z,Xi,jr,gt,Vi,Yi,Ji,Vr,po,vn,Qi,Xr,Kr,Gr,Y_,mo={},go=[],J_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,bn=Array.isArray;function st(e,t){for(var n in t)e[n]=t[n];return e}function Yr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function lt(e,t,n){var o,a,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?a=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?vo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return fo(e,l,o,a,null)}function fo(e,t,n,o,a){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Xi,__i:-1,__u:0};return a==null&&z.vnode!=null&&z.vnode(i),i}function ee(e){return e.children}function $e(e,t){this.props=e,this.context=t}function Vt(e,t){if(t==null)return e.__?Vt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Vt(e):null}function Q_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=st({},t);i.__v=t.__v+1,z.vnode&&z.vnode(i),Jr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Vt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,os(o,i,a),t.__e=t.__=null,i.__e!=n&&Zi(i)}}function Zi(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Zi(e)}function Ki(e){(!e.__d&&(e.__d=!0)&&gt.push(e)&&!ho.__r++||Vi!=z.debounceRendering)&&((Vi=z.debounceRendering)||Yi)(ho)}function ho(){try{for(var e,t=1;gt.length;)gt.length>t&&gt.sort(Ji),e=gt.shift(),t=gt.length,Q_(e)}finally{gt.length=ho.__r=0}}function es(e,t,n,o,a,i,l,s,c,d,u){var m,_,h,f,b,g,x,C=o&&o.__k||go,v=t.length;for(c=Z_(n,t,C,c,v),m=0;m<v;m++)(h=n.__k[m])!=null&&(_=h.__i!=-1&&C[h.__i]||mo,h.__i=m,g=Jr(e,h,_,a,i,l,s,c,d,u),f=h.__e,h.ref&&_.ref!=h.ref&&(_.ref&&Qr(_.ref,null,h),u.push(h.ref,h.__c||f,h)),b==null&&f!=null&&(b=f),(x=!!(4&h.__u))||_.__k===h.__k?(c=ts(h,c,e,x),x&&_.__e&&(_.__e=null)):typeof h.type=="function"&&g!==void 0?c=g:f&&(c=f.nextSibling),h.__u&=-7);return n.__e=b,c}function Z_(e,t,n,o,a){var i,l,s,c,d,u=n.length,m=u,_=0;for(e.__k=new Array(a),i=0;i<a;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[i]=fo(null,l,null,null,null):bn(l)?l=e.__k[i]=fo(ee,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=fo(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,c=i+_,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=eu(l,n,c,m))!=-1&&(m--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>u?_--:a<u&&_++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?_--:d==c+1?_++:(d>c?_--:_++,l.__u|=4))):e.__k[i]=null;if(m)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Vt(s)),as(s,s));return o}function ts(e,t,n,o){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=ts(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Vt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function yn(e,t){return t=t||[],e==null||typeof e=="boolean"||(bn(e)?e.some(function(n){yn(n,t)}):t.push(e)),t}function eu(e,t,n,o){var a,i,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<t.length;)if((d=t[l=a>=0?a--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Gi(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||J_.test(t)?n:n+"px"}function uo(e,t,n,o,a){var i,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Gi(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Gi(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Qi,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[vn]=o[vn]:(n[vn]=Xr,e.addEventListener(t,i?Gr:Kr,i)):e.removeEventListener(t,i?Gr:Kr,i);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function ji(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[po]==null)t[po]=Xr++;else if(t[po]<n[vn])return;return n(z.event?z.event(t):t)}}}function Jr(e,t,n,o,a,i,l,s,c,d){var u,m,_,h,f,b,g,x,C,v,S,U,te,j,ie,se,N=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=z.__b)&&u(t);e:if(typeof N=="function"){m=l.length;try{if(C=t.props,v=N.prototype&&N.prototype.render,S=(u=N.contextType)&&o[u.__c],U=u?S?S.props.value:u.__:o,n.__c?x=(_=t.__c=n.__c).__=_.__E:(v?t.__c=_=new N(C,U):(t.__c=_=new $e(C,U),_.constructor=N,_.render=nu),S&&S.sub(_),_.state||(_.state={}),_.__n=o,h=_.__d=!0,_.__h=[],_._sb=[]),v&&_.__s==null&&(_.__s=_.state),v&&N.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=st({},_.__s)),st(_.__s,N.getDerivedStateFromProps(C,_.__s))),f=_.props,b=_.state,_.__v=t,h)v&&N.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),v&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(v&&N.getDerivedStateFromProps==null&&C!==f&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(C,U),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(C,_.__s,U)===!1){t.__v!=n.__v&&(_.props=C,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(I){I&&(I.__=t)}),go.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(C,_.__s,U),v&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(f,b,g)})}if(_.context=U,_.props=C,_.__P=e,_.__e=!1,te=z.__r,j=0,v)_.state=_.__s,_.__d=!1,te&&te(t),u=_.render(_.props,_.state,_.context),go.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,te&&te(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++j<25);_.state=_.__s,_.getChildContext!=null&&(o=st(st({},o),_.getChildContext())),v&&!h&&_.getSnapshotBeforeUpdate!=null&&(g=_.getSnapshotBeforeUpdate(f,b)),ie=u!=null&&u.type===ee&&u.key==null?rs(u.props.children):u,s=es(e,bn(ie)?ie:[ie],t,n,o,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),x&&(_.__E=_.__=null)}catch(I){if(l.length=m,t.__v=null,c||i!=null){if(I.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i!=null&&(i[i.indexOf(s)]=null),t.__e=s}else if(i!=null)for(se=i.length;se--;)Yr(i[se])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),I.then||ns(t),z.__e(I,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=tu(n.__e,t,n,o,a,i,l,c,d);return(u=z.diffed)&&u(t),128&t.__u?void 0:s}function ns(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ns))}function os(e,t,n){for(var o=0;o<n.length;o++)Qr(n[o],n[++o],n[++o]);z.__c&&z.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){z.__e(i,a.__v)}})}function rs(e){return typeof e!="object"||e==null||e.__b>0?e:bn(e)?e.map(rs):e.constructor!==void 0?null:st({},e)}function tu(e,t,n,o,a,i,l,s,c){var d,u,m,_,h,f,b,g=n.props||mo,x=t.props,C=t.type;if(C=="svg"?a="http://www.w3.org/2000/svg":C=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((h=i[d])&&"setAttribute"in h==!!C&&(C?h.localName==C:h.nodeType==3)){e=h,i[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(x);e=document.createElementNS(a,C,x.is&&x),s&&(z.__m&&z.__m(t,i),s=!1),i=null}if(C==null)g===x||s&&e.data==x||(e.data=x);else{if(i=C=="textarea"&&x.defaultValue!=null?null:i&&vo.call(e.childNodes),!s&&i!=null)for(g={},d=0;d<e.attributes.length;d++)g[(h=e.attributes[d]).name]=h.value;for(d in g)h=g[d],d=="dangerouslySetInnerHTML"?m=h:d=="children"||d in x||d=="value"&&"defaultValue"in x||d=="checked"&&"defaultChecked"in x||uo(e,d,null,h,a);for(d in x)h=x[d],d=="children"?_=h:d=="dangerouslySetInnerHTML"?u=h:d=="value"?f=h:d=="checked"?b=h:s&&typeof h!="function"||g[d]===h||uo(e,d,h,g[d],a);if(u)s||m&&(u.__html==m.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(m&&(e.innerHTML=""),es(t.type=="template"?e.content:e,bn(_)?_:[_],t,n,o,C=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&Vt(n,0),s,c),i!=null)for(d=i.length;d--;)Yr(i[d]);s&&C!="textarea"||(d="value",C=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[d]||C=="progress"&&!f||C=="option"&&f!=g[d])&&uo(e,d,f,g[d],a),d="checked",b!=null&&b!=e[d]&&uo(e,d,b,g[d],a))}return e}function Qr(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(a){z.__e(a,n)}}function as(e,t,n){var o,a;if(z.unmount&&z.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Qr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){z.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&as(o[a],t,n||typeof e.type!="function");n||Yr(e.__e),e.__c=e.__=e.__e=void 0}function nu(e,t,n){return this.constructor(e,n)}function wt(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),z.__&&z.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Jr(t,e=(!o&&n||t).__k=lt(ee,null,[e]),a||mo,mo,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?vo.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),os(i,e,l),e.props.children=null}vo=go.slice,z={__e:function(e,t,n,o){for(var a,i,l;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),l=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,o||{}),l=a.__d),l)return a.__E=a}catch(s){e=s}throw e}},Xi=0,jr=function(e){return e!=null&&e.constructor===void 0},$e.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=st({},this.state),typeof e=="function"&&(e=e(st({},n),this.props)),e&&st(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ki(this))},$e.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ki(this))},$e.prototype.render=ee,gt=[],Yi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ji=function(e,t){return e.__v.__b-t.__v.__b},ho.__r=0,Vr=Math.random().toString(8),po="__d"+Vr,vn="__a"+Vr,Qi=/(PointerCapture)$|Capture$/i,Xr=0,Kr=ji(!1),Gr=ji(!0),Y_=0;var Kt="0.68.3";function is(e){return`${P.cssPrefix}:${e}`}function Pn(e,t,n){e.dispatchEvent(new CustomEvent(is(t),{detail:n}))}function ss(e,t){let o=Object.entries(t).map(([a,i])=>{let l=is(a),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[a,i]of o)e.removeEventListener(a,i)}}function qe(){let e=Date.now(),t=new Uint8Array(16);t[0]=Math.floor(e/2**40)&255,t[1]=Math.floor(e/2**32)&255,t[2]=e>>>24&255,t[3]=e>>>16&255,t[4]=e>>>8&255,t[5]=e&255,ou(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function ou(e){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){crypto.getRandomValues(e);return}for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}var Ct=W.scope("persistence");function ht(e,t=ao,n){let o=n?`${e}.${n}`:e,a=`${P.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${P.cssPrefix}.${o}${l}`,c=`${P.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,m=`${s}.panelOpen`,_=`${s}.panelSize`,h=`${s}.calloutDismissed`,f=`${s}.sidebarCollapsed`,b=`${s}.activeModule`,g=`${s}.historyCount`,x=`${s}.formsDone`,C={getVisitorId(){let v=t.get(c);if(v)return v;let S=qe();return t.set(c,S),S},setVisitorId(v){Ct.debug("setVisitorId (rebind)",{id:v,scope:o}),t.set(c,v)},loadConversationId(){return t.get(d)??void 0},saveConversationId(v){Ct.trace("saveConversationId",{id:v,scope:o}),v?t.set(d,v):t.remove(d)},loadUserPrefs(){let v=t.get(u);if(!v)return{};try{let S=JSON.parse(v);return ls(S)?S:{}}catch(S){return Ct.warn("loadUserPrefs parse failed",{error:S}),{}}},saveUserPrefs(v){try{t.set(u,JSON.stringify(v))}catch(S){Ct.warn("saveUserPrefs serialise failed",{error:S})}},patchUserPrefs(v){let S=C.loadUserPrefs();C.saveUserPrefs({...S,...v})},loadPanelOpen(){let v=t.get(m);return v==="1"?!0:v==="0"?!1:null},savePanelOpen(v){t.set(m,v?"1":"0")},loadPanelSize(){let v=t.get(_);return v==="normal"||v==="expanded"||v==="fullscreen"?v:null},savePanelSize(v){t.set(_,v)},loadCalloutDismissed(v){if(!v)return!1;let S=t.get(h);return!!S&&S===v},saveCalloutDismissed(v){v?t.set(h,v):t.remove(h)},loadSidebarCollapsed(){let v=t.get(f);return v==="1"?!0:v==="0"?!1:null},saveSidebarCollapsed(v){t.set(f,v?"1":"0")},loadActiveModule(){return t.get(b)||null},saveActiveModule(v){t.set(b,v)},loadHistoryCount(){let v=t.get(g);if(!v)return null;let S=Number.parseInt(v,10);return Number.isFinite(S)&&S>=0?S:null},saveHistoryCount(v){t.set(g,String(v))},loadFormsDone(){let v=t.get(x);if(!v)return{};try{let S=JSON.parse(v);return ls(S)?S:{}}catch(S){return Ct.warn("loadFormsDone parse failed",{error:S}),{}}},saveFormDone(v){try{let S=C.loadFormsDone();S[v]=Date.now(),t.set(x,JSON.stringify(S))}catch(S){Ct.warn("saveFormDone serialise failed",{error:S})}},rememberStorageVersion(v){v&&v!==t.get(a)&&(Ct.debug("rememberStorageVersion (force-reset on next load)",{version:v}),t.set(a,v))},clearConversation(){t.remove(d)}};return C}function ls(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var cs=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-accent-fg: var(--__P__-accent);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-pill-l-min: .3;--__P__-pill-l-max: .46;--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-mode="modal"]),:host([data-mode="drawer"]){--__P__-conversation-max: 100%}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h);--__P__-accent-fg: oklch(from var(--__P__-accent-user) clamp(.3, l, .46) c h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
2
- `;var ds=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent-fg);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3
- `;var _s=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent-fg);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent-fg);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border:1px solid var(--__P__-border);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{display:flex;align-items:stretch;padding:0;overflow:hidden;background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{display:flex;flex:0 0 auto;align-items:center;padding:0 .875rem;border-inline-end:1px solid color-mix(in oklab,var(--__P__-accent),transparent 60%);color:var(--__P__-accent);font-size:calc(13px * var(--__P__-text-scale));font-weight:600;letter-spacing:.025em;user-select:none}.__P__-bubble-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent-fg);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent-fg)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-operator-banner{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 var(--__P__-space-3) var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg-elevated),var(--__P__-accent) 6%);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);line-height:1.3;text-align:center}.__P__-operator-pulse{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-operator-cancel{flex:0 0 auto;padding:0;border:0;background:none;color:var(--__P__-accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.__P__-operator-cancel:hover{opacity:.8}.__P__-operator-cancel:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-radius:var(--__P__-radius-sm)}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent-fg)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent-fg);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent-fg);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent-fg)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent;user-select:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=completed]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=responded]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=awaiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=denied]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=error]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=superseded]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
4
- `;var us=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
5
- `;var ps=`:host([data-mode="page"]){min-height:0}:host([data-mode="page"]) .__P__-page-shell{display:grid;grid-template-columns:280px 1fr;width:100%;height:100%;min-height:0;background:var(--__P__-bg);color:var(--__P__-fg);transition:grid-template-columns var(--__P__-dur-base) var(--__P__-ease-in-out)}:host([data-mode="page"]) .__P__-page-shell[data-sidebar-collapsed=true]{grid-template-columns:48px 1fr}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}:host([data-mode="page"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-width:0;min-height:0;flex:1 1 0}:host([data-mode="page"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;animation:none}:host([data-mode="page"]) .__P__-sidebar{border-inline-end:1px solid var(--__P__-border);display:flex;flex-direction:column;overflow:hidden;background:var(--__P__-surface)}:host([data-mode="page"]) .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-5);border-bottom:1px solid var(--__P__-border);display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2);min-height:56px;box-sizing:border-box}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-2);justify-content:center}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-logo,:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-title{display:none}:host([data-mode="page"]) .__P__-sidebar-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--__P__-border);border-radius:6px;background:transparent;color:var(--__P__-fg);cursor:pointer;transition:background .12s,border-color .12s}:host([data-mode="page"]) .__P__-sidebar-toggle:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-toggle:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-logo{height:32px;display:block}:host([data-mode="page"]) .__P__-sidebar-title{font-size:var(--__P__-text-md);font-weight:600}:host([data-mode="page"]) .__P__-sidebar-section{padding:var(--__P__-space-3) var(--__P__-space-4);border-bottom:1px solid var(--__P__-border)}:host([data-mode="page"]) .__P__-sidebar-nav{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}:host([data-mode="page"]) .__P__-sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);text-decoration:none;font-size:calc(14px * var(--__P__-text-scale));transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-nav-item:hover{background:var(--__P__-hover)}:host([data-mode="page"]) .__P__-sidebar-nav-item:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}:host([data-mode="page"]) .__P__-sidebar-cards{display:grid;grid-template-columns:1fr;gap:var(--__P__-space-2)}:host([data-mode="page"]) .__P__-sidebar-card{display:block;padding:10px 12px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);text-decoration:none;color:var(--__P__-fg);transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-card:hover{border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-card-label{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}:host([data-mode="page"]) .__P__-sidebar-card-desc{font-size:var(--__P__-text-xs);color:var(--__P__-muted);margin-top:2px}:host([data-mode="page"]) .__P__-sidebar-conversations{flex:1 1 auto;overflow-y:auto;padding:var(--__P__-space-3) var(--__P__-space-4)}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;overflow:hidden}@media(max-width:768px){:host([data-mode="page"]) .__P__-page-shell{grid-template-columns:1fr}:host([data-mode="page"]) .__P__-sidebar{display:none}}
6
- `;var cu="helpai",du="#5B5BD6",_u="#FFFFFF",uu="12px",pu="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",Zr=[cs,ds,_s,us,ps].join(`
7
- `).replace(/__P__/g,cu).replaceAll("__BRAND_ACCENT_TEXT__",_u).replaceAll("__BRAND_ACCENT__",du).replaceAll("__BRAND_RADIUS__",uu).replaceAll("__BRAND_FONT__",pu);var fu=W.scope("mount"),fs=new WeakMap,ms={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function gs(e,t){e.style.cssText=ms[t]}function Et(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Gt(e={}){let t=e.position??"flow";fu.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${P.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let o;e.existingHost?o=e.existingHost:(o=document.createElement(n),(e.target??document.body).appendChild(o)),o.setAttribute("data-brand",P.id),o.style.cssText=ms[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!mu(a,i)){let s=i.createElement("style");s.textContent=Zr,a.appendChild(s)}let l=document.createElement("div");return l.className=`${P.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:a}}function mu(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=fs.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(Zr),fs.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function gu(e,t){let n=P.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function hu(e,t){e.dataset.theme=t}function vu(e,t){let n=P.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function bu(e,t){e.dataset.position=t}function bo(e,t){e.dataset.mode=t}function hs(e,t){hu(e,t.themeMode),gu(e,t.themeOverrides),bu(e,t.position),vu(e,t.size)}var yu=W.scope("iframe"),Pu='<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:transparent;overflow:hidden}</style></head><body></body></html>';function ys(e,t,n="closed",o="floating",a=null){yu.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!a});let i=document.createElement("iframe");i.title=`${P.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),bs(i,t,n,o),(o==="inline"&&a?a:document.body).appendChild(i);let s=i.contentDocument;if(!s)throw new Error("iframe contentDocument unavailable (cross-origin?)");s.open(),s.write(Pu),s.close();let c=Gt({...e,target:s.body}),d=new MutationObserver(()=>{bs(i,t,c.hostElement.dataset.mode??"closed",o)});return d.observe(c.hostElement,{attributes:!0,attributeFilter:["data-mode"]}),{...c,iframeElement:i,destroy(){d.disconnect(),c.destroy(),i.remove()}}}var yo="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",vs={closed:{w:"88px",h:"88px"},expanded:{w:"min(calc(100vw - 32px), 680px)",h:"min(calc(100vh - 32px), 860px)"},open:{w:"min(calc(100vw - 32px), 440px)",h:"min(calc(100vh - 32px), 700px)"}};function bs(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${yo}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${yo}position:static;display:block;width:100%;height:100%;`;return}if(typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches&&(n==="open"||n==="expanded")){e.style.cssText=`${yo}position:fixed;inset:0;width:100vw;height:100vh;`;return}let i=t.startsWith("top-")?"top":"bottom",l=t.endsWith("-left")?"left":"right",{w:s,h:c}=vs[n]??vs.open;e.style.cssText=`${yo}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var jt=class{constructor(){K(this,"handlers",new Map)}on(t,n){let o=this.handlers.get(t);return o||(o=new Set,this.handlers.set(t,o)),o.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let o=this.handlers.get(t);if(o)for(let a of o)try{a(n)}catch{}}clear(){this.handlers.clear()}};var Xt,he,ea,Ps,xn=0,Rs=[],be=z,xs=be.__b,Ss=be.__r,ks=be.diffed,ws=be.__c,Cs=be.unmount,Es=be.__;function xo(e,t){be.__h&&be.__h(he,e,xn||t),xn=0;var n=he.__H||(he.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function T(e){return xn=1,Is(As,e)}function Is(e,t,n){var o=xo(Xt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):As(void 0,t),function(s){var c=o.__N?o.__N[0]:o.__[0],d=o.t(c,s);c!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=he,!he.__f)){var a=function(s,c,d){if(!o.__c.__H)return!0;var u=!1,m=o.__c.props!==s;if(o.__c.__H.__.some(function(h){if(h.__N){u=!0;var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(m=!0)}}),i){var _=i.call(this,s,c,d);return u?_||m:_}return!u||m};he.__f=!0;var i=he.shouldComponentUpdate,l=he.componentWillUpdate;he.componentWillUpdate=function(s,c,d){if(this.__e){var u=i;i=void 0,a(s,c,d),i=u}l&&l.call(this,s,c,d)},he.shouldComponentUpdate=a}return o.__N||o.__}function E(e,t){var n=xo(Xt++,3);!be.__s&&na(n.__H,t)&&(n.__=e,n.u=t,he.__H.__h.push(n))}function vt(e,t){var n=xo(Xt++,4);!be.__s&&na(n.__H,t)&&(n.__=e,n.u=t,he.__h.push(n))}function F(e){return xn=5,Me(function(){return{current:e}},[])}function Me(e,t){var n=xo(Xt++,7);return na(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D(e,t){return xn=8,Me(function(){return e},t)}function xu(){for(var e;e=Rs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Po),t.__h.some(ta),t.__h=[]}catch(n){t.__h=[],be.__e(n,e.__v)}}}be.__b=function(e){he=null,xs&&xs(e)},be.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Es&&Es(e,t)},be.__r=function(e){Ss&&Ss(e),Xt=0;var t=(he=e.__c).__H;t&&(ea===he?(t.__h=[],he.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Po),t.__h.some(ta),t.__h=[],Xt=0)),ea=he},be.diffed=function(e){ks&&ks(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Rs.push(t)!==1&&Ps===be.requestAnimationFrame||((Ps=be.requestAnimationFrame)||Su)(xu)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),ea=he=null},be.__c=function(e,t){t.some(function(n){try{n.__h.some(Po),n.__h=n.__h.filter(function(o){return!o.__||ta(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],be.__e(o,n.__v)}}),ws&&ws(e,t)},be.unmount=function(e){Cs&&Cs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{Po(o)}catch(a){t=a}}),n.__H=void 0,t&&be.__e(t,n.__v))};var Ts=typeof requestAnimationFrame=="function";function Su(e){var t,n=function(){clearTimeout(o),Ts&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Ts&&(t=requestAnimationFrame(n))}function Po(e){var t=he,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),he=t}function ta(e){var t=he;e.__c=e.__(),he=t}function na(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function As(e,t){return typeof t=="function"?t(e):t}var ku=Symbol.for("preact-signals");function Co(){if(ct>1)ct--;else{var e,t=!1;for((function(){var a=ko;for(ko=void 0;a!==void 0;){var i=a.S;if(i.v===a.v)for(var l=i.t;l!==void 0;l=l.x)l.i===a.i&&(l.i=i.i);a=a.o}})();kn!==void 0;){var n=kn;for(kn=void 0,So++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ls(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(So=0,ct--,t)throw e}}function Yt(e){if(ct>0)return e();oa=++wu,ct++;try{return e()}finally{Co()}}var Sn,fe=void 0;function wn(e){var t=fe,n=Sn;fe=void 0,Sn=void 0;try{return e()}finally{fe=t,Sn=n}}var kn=void 0,ct=0,So=0,wu=0,oa=0,ko=void 0,wo=0;function Ms(e){if(fe!==void 0){var t=e.n;if(t===void 0||t.t!==fe)return t={i:0,S:e,p:fe.s,n:void 0,t:fe,e:void 0,x:void 0,r:t},fe.s!==void 0&&(fe.s.n=t),fe.s=t,e.n=t,32&fe.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=fe.s,t.n=void 0,fe.s.n=t,fe.s=t),t}}function we(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}we.prototype.brand=ku;we.prototype.h=function(){return!0};we.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:wn(function(){var o;(o=t.W)==null||o.call(t)}))};we.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&wn(function(){var a;(a=t.Z)==null||a.call(t)}))}};we.prototype.subscribe=function(e){var t=this;return dt(function(){var n=t.value;wn(function(){return e(n)})},{name:"sub"})};we.prototype.valueOf=function(){return this.value};we.prototype.toString=function(){return this.value+""};we.prototype.toJSON=function(){return this.value};we.prototype.peek=function(){var e=this;return wn(function(){return e.value})};Object.defineProperty(we.prototype,"value",{get:function(){var e=Ms(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(So>100)throw new Error("Cycle detected");(function(n){ct!==0&&So===0&&n.l!==oa&&(n.l=oa,ko={S:n,v:n.v,i:n.i,o:ko})})(this),this.v=e,this.i++,wo++,ct++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Co()}}}});function q(e,t){return new we(e,t)}function Ls(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Os(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ns(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function Tt(e,t){we.call(this,void 0,t),this.x=e,this.s=void 0,this.g=wo-1,this.f=4}Tt.prototype=new we;Tt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===wo))return!0;if(this.g=wo,this.f|=1,this.i>0&&!Ls(this))return this.f&=-2,!0;var e=fe;try{Os(this),fe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return fe=e,Ns(this),this.f&=-2,!0};Tt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}we.prototype.S.call(this,e)};Tt.prototype.U=function(e){if(this.t!==void 0&&(we.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Tt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Tt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ms(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Cn(e,t){return new Tt(e,t)}function Ds(e){var t=e.m;if(e.m=void 0,typeof t=="function"){ct++;var n=fe;fe=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,ra(e),o}finally{fe=n,Co()}}}function ra(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ds(e)}function Cu(e){if(fe!==this)throw new Error("Out-of-order effect");Ns(this),fe=e,this.f&=-2,8&this.f&&ra(this),Co()}function Jt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Sn&&Sn.push(this)}Jt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};Jt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ds(this),Os(this),ct++;var e=fe;return fe=this,Cu.bind(this,e)};Jt.prototype.N=function(){2&this.f||(this.f|=2,this.u=kn,kn=this)};Jt.prototype.d=function(){this.f|=8,1&this.f||ra(this)};Jt.prototype.dispose=function(){this.d()};function dt(e,t){var n=new Jt(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var $s,Ro,Eo,Eu=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Fs=[];dt(function(){$s=this.N})();function Qt(e,t){z[e]=t.bind(null,z[e]||function(){})}function To(e){if(Eo){var t=Eo;Eo=void 0,t()}Eo=e&&e.S()}function Bs(e){var t=this,n=e.data,o=et(n);o.value=n;var a=Me(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=Cn(function(){var h=o.value.value;return h===0?0:h===!0?"":h||""}),u=Cn(function(){return!Array.isArray(d.value)&&!jr(d.value)}),m=dt(function(){if(this.N=Hs,u.value){var h=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),_=t.__$u.d;return t.__$u.d=function(){m(),_.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}Bs.displayName="ReactiveTextNode";Object.defineProperties(we.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Bs},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Qt("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var a in o)if(a!=="children"){var i=o[a];i instanceof we&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});Qt("__r",function(e,t){if(e(t),t.type!==ee){To();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(a,i){var l;return dt(function(){l=this},{name:i}),l.c=a,l})(function(){var a;Eu&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Ro=o,To(n)}});Qt("__e",function(e,t,n,o){To(),Ro=void 0,e(t,n,o)});Qt("diffed",function(e,t){To(),Ro=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,a=t.props,i=n.U;if(i)for(var l in i){var s=i[l];s===void 0||o&&l in o||(s.d(),i[l]=void 0)}if(o){i||(i={},n.U=i);for(var c in o){var d=i[c],u=o[c];d===void 0?(d=Tu(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function Tu(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=q(n);return{o:function(l,s){i.value=l,o=s},d:dt(function(){this.N=Hs;var l=i.value.value;o[t]!==l&&(o[t]=l,a?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Qt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var a in o){var i=o[a];i&&i.d()}}}var l=t.__np;if(l){var s=t.props;for(var c in l)s[c]=l[c]}t.__np=void 0}else{var d=t.__c;if(d){var u=d.__$u;u&&(d.__$u=void 0,u.d())}}e(t)});Qt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});$e.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var a in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(o||i||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function et(e,t){return Me(function(){return q(e,t)},[])}function J(e,t){var n=F(e);return n.current=e,Ro.__$f|=4,Me(function(){return Cn(function(){return n.current()},t)},[])}var Ru=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Iu(){Yt(function(){for(var e;e=Fs.shift();)$s.call(e)})}function Hs(){Fs.push(this)===1&&(z.requestAnimationFrame||Ru)(Iu)}function zs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Us(e){return zs(e)}function qs(e){return!(!zs(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Io(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var Au=900,Mu=640;function aa(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;return o==="expanded"||o==="fullscreen"||o==="normal"?o:n>0&&n<Mu?"fullscreen":n>=(t.autoSizeBreakpoint??Au)?"expanded":"normal"}function En(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:aa(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Zt(){return typeof window>"u"?0:window.innerWidth}var Lu="x-public-key",Ou="x-ai-agent-deployment-id";function Ws(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[Ou]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??Lu]=e.publicKey),t}}}function Tn(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),a=()=>i();t?.addEventListener("abort",a,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",a),n()}})}var Ye=class extends Error{constructor(n,o,a,i){super(n);K(this,"code",o);K(this,"status",a);K(this,"cause",i);this.name="StreamError"}};var Vs=W.scope("parser");async function*ia(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Ye(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of Nu(e,t)){let o=Du(n);if(o==="done")return;o&&(yield o)}}async function*Nu(e,t){if(!e.body)throw new Ye("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:a,value:i}=await n.read();if(a){let s=o.trim();s&&(yield s);return}o+=i;let l;for(;(l=o.indexOf(`
1
+ "use strict";var HelpAI=(()=>{var Cr=Object.defineProperty;var d_=Object.getOwnPropertyDescriptor;var __=Object.getOwnPropertyNames;var u_=Object.prototype.hasOwnProperty;var p_=(e,t,n)=>t in e?Cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var f_=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of __(t))!u_.call(e,a)&&a!==n&&Cr(e,a,{get:()=>t[a],enumerable:!(o=d_(t,a))||o.enumerable});return e};var m_=e=>f_(Cr({},"__esModule",{value:!0}),e);var K=(e,t,n)=>p_(e,typeof t!="symbol"?t+"":t,n);var Jm={};var P={id:"help-ai",name:"@helpai/elements",global:"HelpAI",tagName:"web-ai-chat",cssPrefix:"helpai",defaultBaseUrl:"https://help.ai",displayName:"Help AI",domain:"help.ai",siteUrl:"https://help.ai"};var pi={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",talkToOperator:"Talk to an operator",connectingOperator:"Connecting you to an operator\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",cancelOperatorRequest:"Keep chatting with the AI",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",reject:"Reject",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},g_={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",talkToOperator:"Parler \xE0 un op\xE9rateur",connectingOperator:"Mise en relation avec un op\xE9rateur\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",cancelOperatorRequest:"Continuer avec l'IA",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",reject:"Refuser",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},h_={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0645\u0648\u0638\u0641",connectingOperator:"\u062C\u0627\u0631\u064A \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0623\u062D\u062F \u0627\u0644\u0645\u0648\u0638\u0641\u064A\u0646\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0631\u062F",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},v_={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",talkToOperator:"Hablar con un operador",connectingOperator:"Conect\xE1ndote con un operador\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",cancelOperatorRequest:"Seguir con la IA",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",reject:"Rechazar",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},b_={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",talkToOperator:"\u05D3\u05D1\u05E8 \u05E2\u05DD \u05E0\u05E6\u05D9\u05D2",connectingOperator:"\u05DE\u05D7\u05D1\u05E8 \u05D0\u05D5\u05EA\u05DA \u05DC\u05E0\u05E6\u05D9\u05D2\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E2\u05E0\u05D4",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},y_={en:pi,fr:g_,ar:h_,es:v_,he:b_};function eo(e,t){let n=fi(e),o=to(t),a=n==="en"?{}:y_[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...pi,...a,...l,...i}}function fi(e){return(e.split("-")[0]??"en").toLowerCase()}var P_=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function mi(e){return P_.has(fi(e))}function Le(e,t){return e[t]??t}function to(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function gi(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function hi(e,t){let{translations:n,defaultLocale:o,...a}=e,i=gi(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function vi(e,t){let{translations:n,defaultLocale:o,...a}=e,i=gi(n,t);if(!i)return a;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=a.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(m=>[m.value,m]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(m=>{let _=u.get(m.value);return _?{...m,label:_.label??m.label,description:_.description??m.description}:m})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var Er=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},no=new Er;var Ir=["off","error","warn","info","debug","trace"],Ar=P.cssPrefix,bi=`${Ar}.debug`,x_=`__${P.global}_DEBUG__`,S_=`${Ar}-debug`,oo=2,Tr=null;function k_(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(S_);if(e!==null){let t=Rr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(bi);if(e){let t=Rr(e);if(t>=0)return t}}catch{}return Reflect.get(window,x_)?4:2}function Rr(e){if(e===!0||e==="1"||e==="true")return 4;if(e===!1||e==="0"||e==="false"||e==="off")return 0;if(typeof e=="number")return Math.max(0,Math.min(5,Math.floor(e)));if(typeof e=="string"){let t=Ir.indexOf(e);if(t>=0)return t}return-1}function ro(e){let t=Rr(e);if(!(t<0)){oo=t;try{window.localStorage?.setItem(bi,Ir[t])}catch{}}}function _n(){return Ir[oo]}oo=k_();function yi(e){let t=`[${Ar}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(oo<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),Tr))try{Tr({level:i,scope:e,message:l,payload:s})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>yi(`${e}:${o}`)}}var W=yi("core");function un(e){Tr=e}var xt=W.scope("context"),w_=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),Pi=50,Mr=1024,C_=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Lr(e){return xi(e,"userContext",!0)}function Or(e){return xi(e,"pageContext",!1)}function xi(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){xt.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},a=0;for(let[i,l]of Object.entries(e)){if(w_.has(i)){xt.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=Pi){xt.warn(`${t} truncated at ${Pi} keys \u2014 dropped "${i}"`);continue}let s=E_(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!C_.test(o.email)&&(xt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function E_(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){xt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Mr?(xt.warn(`truncated ${e}.${t} to ${Mr} chars`),o.slice(0,Mr)):o}xt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var ao={maxBytes:10485760,maxCount:10,accept:"*/*"},Si={voice:"local"},ki={list:[],byTrigger:{}},Nr={enabled:!0,sampleRate:1},io={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Ht={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},wi={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},Dr={enabled:!0,volume:.3,events:void 0},Ci={enabled:!0,events:void 0},Ei=[{label:"tabConversations",layout:"chat"}];function ft(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},a=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=T_(t.theme),u=n.mode??"floating",m=R_(a.defaultLocale),_=a.availableLocales??[a.locale??m],h=zt(a.locale??m,_,m),f=(t.baseUrl??P.defaultBaseUrl).replace(/\/$/,""),b=(t.agentApiBaseUrl??`${f}/api/agent`).replace(/\/$/,""),g=(t.dataApiBaseUrl??`${f}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:f,agentApiBaseUrl:b,dataApiBaseUrl:g,userContext:Lr(t.userContext),pageContext:Or(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:u,iframe:n.iframe??!1,responseMode:o.responseMode??"streaming",showReasoning:o.showReasoning??!1,showToolCalls:o.showToolCalls??!1,showSources:o.showSources??!1,enableMessageFeedback:!(o.disableMessageFeedback??!1),autoSendSuggestions:o.autoSendSuggestions??!1,features:{voice:t.features?.voice??Si.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0,tools:t.features?.tools},forms:pn(t.forms,h),endpoints:{upload:t.endpoints?.upload??io.upload,transcribe:t.endpoints?.transcribe??io.transcribe,submitForm:t.endpoints?.submitForm??io.submitForm},attachments:{accept:t.composer?.attachments?.accept??ao.accept,maxBytes:t.composer?.attachments?.maxBytes??ao.maxBytes,maxCount:t.composer?.attachments?.maxCount??ao.maxCount},locale:h,defaultLocale:m,availableLocales:_,startMinimized:o.startMinimized??!0,actions:I_(u,s.actions),size:n.size??{},launcher:F_(t.launcher),sound:A_(i.sound),haptics:M_(i.haptics),strings:eo(h,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:O_(l.poweredBy),composer:N_(t.composer),modules:D_(t.modules),tracking:L_(t.tracking,g),storage:t.storage??no,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function T_(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function R_(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function zt(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function I_(e,t){return t??wi[e]}function A_(e){return{enabled:e?.enabled??Dr.enabled,volume:e?.volume??Dr.volume,events:e?.events}}function M_(e){return{enabled:e?.enabled??Ci.enabled,events:e?.events}}function L_(e,t){let n=e?.sampleRate??Nr.sampleRate;return{enabled:e?.enabled??Nr.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function O_(e){let n={...{text:`Powered by ${P.displayName}`,href:P.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function N_(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function D_(e){let t=e===void 0?Ei:e,n=new Set,o=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let l=i.contentTags?.filter(Boolean),s=i.id??l?.[0]??i.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:i.label,layout:i.layout};l&&l.length>0&&(c.contentTags=l),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=!(i.hideGreeting??!1),c.showSearchBar=!(i.hideSearchBar??!1),c.showRecentConversations=!(i.hideRecentConversations??!1),i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),o.push(c)}let a=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:a}}function pn(e,t){var i;if(!e?.length)return ki;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=vi(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map($_).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let a={};for(let l of n)for(let s of l.triggers)(a[i=s.kind]??(a[i]=[])).push(l);return{list:n,byTrigger:a}}function $_(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"after-messages",param:o}:null}if(t==="idle"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"idle",param:o}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function F_(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??Ht.variant,size:e?.size??Ht.size,label:e?.label??Ht.label,icon:e?.icon??Ht.icon,hidden:e?.hidden??Ht.hidden,callout:t}}function $r(e,t,n,o){let a=zt(t,e.availableLocales,e.defaultLocale);if(a===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return a!==e.locale&&(i.locale=a,i.strings=eo(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var B_=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Fr(e,t){if(!t)return e;let n={...e};for(let i of B_){let l=t[i];if(l===void 0)continue;let s=e[i];if(i==="theme"){s===void 0&&(n[i]=l);continue}i!=="i18n"&&(n[i]=Ti(l,s))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let o=e.i18n,a=t.i18n;if(o||a){let i=Ti(a??{},o);a?.availableLocales!==void 0&&(i.availableLocales=a.availableLocales),a?.defaultLocale!==void 0&&(i.defaultLocale=a.defaultLocale);let l=o?.strings,s=a?.strings;(l||s)&&(i.strings=H_(s,l)),n.i18n=i}return n}function Ti(e,t){if(!t)return e;let n={...e};for(let[o,a]of Object.entries(t))a!==void 0&&(n[o]=a);return n}function H_(e,t){if(!e)return t;if(!t)return e;let n=to(e),o=to(t);if(!n&&!o)return{...e,...t};let a={},i=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(i))a[s]={...c};for(let[s,c]of Object.entries(l))a[s]={...a[s],...c};return a}var z_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],rt=e=>e!=="false",Ii=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Ai=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],Mi=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",rt]],Li=[["width","width"],["height","height"]],Oi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",rt],["show-reasoning","showReasoning",rt],["show-tool-calls","showToolCalls",rt],["show-sources","showSources",rt],["disable-message-feedback","disableMessageFeedback",rt],["auto-send-suggestions","autoSendSuggestions",rt]],Ni=[["locale","locale"]],U_=new Set(z_),q_=e=>Ii(e).filter(t=>U_.has(t)),Di=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",rt]],$i=[["features-disable-file-upload","disableFileUpload",rt],["features-voice","voice",e=>e],["features-tools","tools",Ii]],Fi=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Bi=[["user-id","id"],["user-email","email"],["user-name","name"]],Hi=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],W_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],V_=[Ai,Mi,Li,Oi,Ni,Di,$i,Fi,Bi,Hi],K_=new Set(["iframe","start-minimized"]),Br=[...V_.flatMap(e=>e.map(([t])=>t).filter(t=>!K_.has(t))),...W_];function so(e){let t={},n=h=>{let f=e(h);return f===null||f===""?void 0:f};for(let[h,f,b]of Ai){let g=n(h);g!==void 0&&(t[f]=b?b(g):g)}let o=St(n,Mi),a=St(n,Li);(o||a)&&(t.presentation={...o,...a?{size:a}:{}});let i=St(n,Oi);i&&(t.behavior=i);let l=St(n,Ni);l&&(t.i18n=l);let s=j_(e,n);s&&(t.launcher=s);let c=St(n,$i);c&&(t.features=c);let d=St(n,Fi);d&&(t.endpoints=d);let u=Ri(n,Bi,"user-context");u&&(t.userContext=u);let m=Ri(n,Hi,"page-context");m&&(t.pageContext=m);let _=n("actions");return _!==void 0&&(t.header={actions:q_(_)}),t}function Hr(e){return e?so(t=>e[G_(t)]??null):{}}function G_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function St(e,t){let n={};for(let[o,a,i]of t){let l=e(o);l!==void 0&&(n[a]=i?i(l):l)}return Object.keys(n).length>0?n:null}function Ri(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let a={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(a=s)}catch{}let l={...a,...o};return Object.keys(l).length>0?l:null}function j_(e,t){let n=St(t,Di)??{},o=e("launcher-label");o!==null&&(n.label=o);let a=t("callout-text");if(a){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:a,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var mo,z,Vi,Wr,mt,zi,Ki,Gi,zr,co,fn,ji,Vr,Ur,qr,X_,uo={},po=[],Y_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,mn=Array.isArray;function at(e,t){for(var n in t)e[n]=t[n];return e}function Kr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function it(e,t,n){var o,a,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?a=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?mo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return _o(e,l,o,a,null)}function _o(e,t,n,o,a){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Vi,__i:-1,__u:0};return a==null&&z.vnode!=null&&z.vnode(i),i}function ee(e){return e.children}function $e(e,t){this.props=e,this.context=t}function Ut(e,t){if(t==null)return e.__?Ut(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Ut(e):null}function J_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=at({},t);i.__v=t.__v+1,z.vnode&&z.vnode(i),Gr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Ut(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,Zi(o,i,a),t.__e=t.__=null,i.__e!=n&&Xi(i)}}function Xi(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Xi(e)}function Ui(e){(!e.__d&&(e.__d=!0)&&mt.push(e)&&!fo.__r++||zi!=z.debounceRendering)&&((zi=z.debounceRendering)||Ki)(fo)}function fo(){try{for(var e,t=1;mt.length;)mt.length>t&&mt.sort(Gi),e=mt.shift(),t=mt.length,J_(e)}finally{mt.length=fo.__r=0}}function Yi(e,t,n,o,a,i,l,s,c,d,u){var m,_,h,f,b,g,x,C=o&&o.__k||po,v=t.length;for(c=Q_(n,t,C,c,v),m=0;m<v;m++)(h=n.__k[m])!=null&&(_=h.__i!=-1&&C[h.__i]||uo,h.__i=m,g=Gr(e,h,_,a,i,l,s,c,d,u),f=h.__e,h.ref&&_.ref!=h.ref&&(_.ref&&jr(_.ref,null,h),u.push(h.ref,h.__c||f,h)),b==null&&f!=null&&(b=f),(x=!!(4&h.__u))||_.__k===h.__k?(c=Ji(h,c,e,x),x&&_.__e&&(_.__e=null)):typeof h.type=="function"&&g!==void 0?c=g:f&&(c=f.nextSibling),h.__u&=-7);return n.__e=b,c}function Q_(e,t,n,o,a){var i,l,s,c,d,u=n.length,m=u,_=0;for(e.__k=new Array(a),i=0;i<a;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[i]=_o(null,l,null,null,null):mn(l)?l=e.__k[i]=_o(ee,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=_o(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,c=i+_,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=Z_(l,n,c,m))!=-1&&(m--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>u?_--:a<u&&_++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?_--:d==c+1?_++:(d>c?_--:_++,l.__u|=4))):e.__k[i]=null;if(m)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Ut(s)),ts(s,s));return o}function Ji(e,t,n,o){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=Ji(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Ut(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function gn(e,t){return t=t||[],e==null||typeof e=="boolean"||(mn(e)?e.some(function(n){gn(n,t)}):t.push(e)),t}function Z_(e,t,n,o){var a,i,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<t.length;)if((d=t[l=a>=0?a--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function qi(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Y_.test(t)?n:n+"px"}function lo(e,t,n,o,a){var i,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||qi(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||qi(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ji,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[fn]=o[fn]:(n[fn]=Vr,e.addEventListener(t,i?qr:Ur,i)):e.removeEventListener(t,i?qr:Ur,i);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Wi(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[co]==null)t[co]=Vr++;else if(t[co]<n[fn])return;return n(z.event?z.event(t):t)}}}function Gr(e,t,n,o,a,i,l,s,c,d){var u,m,_,h,f,b,g,x,C,v,S,U,te,j,ae,ie,N=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=z.__b)&&u(t);e:if(typeof N=="function"){m=l.length;try{if(C=t.props,v=N.prototype&&N.prototype.render,S=(u=N.contextType)&&o[u.__c],U=u?S?S.props.value:u.__:o,n.__c?x=(_=t.__c=n.__c).__=_.__E:(v?t.__c=_=new N(C,U):(t.__c=_=new $e(C,U),_.constructor=N,_.render=tu),S&&S.sub(_),_.state||(_.state={}),_.__n=o,h=_.__d=!0,_.__h=[],_._sb=[]),v&&_.__s==null&&(_.__s=_.state),v&&N.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=at({},_.__s)),at(_.__s,N.getDerivedStateFromProps(C,_.__s))),f=_.props,b=_.state,_.__v=t,h)v&&N.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),v&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(v&&N.getDerivedStateFromProps==null&&C!==f&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(C,U),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(C,_.__s,U)===!1){t.__v!=n.__v&&(_.props=C,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(I){I&&(I.__=t)}),po.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(C,_.__s,U),v&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(f,b,g)})}if(_.context=U,_.props=C,_.__P=e,_.__e=!1,te=z.__r,j=0,v)_.state=_.__s,_.__d=!1,te&&te(t),u=_.render(_.props,_.state,_.context),po.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,te&&te(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++j<25);_.state=_.__s,_.getChildContext!=null&&(o=at(at({},o),_.getChildContext())),v&&!h&&_.getSnapshotBeforeUpdate!=null&&(g=_.getSnapshotBeforeUpdate(f,b)),ae=u!=null&&u.type===ee&&u.key==null?es(u.props.children):u,s=Yi(e,mn(ae)?ae:[ae],t,n,o,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),x&&(_.__E=_.__=null)}catch(I){if(l.length=m,t.__v=null,c||i!=null){if(I.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i!=null&&(i[i.indexOf(s)]=null),t.__e=s}else if(i!=null)for(ie=i.length;ie--;)Kr(i[ie])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),I.then||Qi(t),z.__e(I,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=eu(n.__e,t,n,o,a,i,l,c,d);return(u=z.diffed)&&u(t),128&t.__u?void 0:s}function Qi(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Qi))}function Zi(e,t,n){for(var o=0;o<n.length;o++)jr(n[o],n[++o],n[++o]);z.__c&&z.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){z.__e(i,a.__v)}})}function es(e){return typeof e!="object"||e==null||e.__b>0?e:mn(e)?e.map(es):e.constructor!==void 0?null:at({},e)}function eu(e,t,n,o,a,i,l,s,c){var d,u,m,_,h,f,b,g=n.props||uo,x=t.props,C=t.type;if(C=="svg"?a="http://www.w3.org/2000/svg":C=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((h=i[d])&&"setAttribute"in h==!!C&&(C?h.localName==C:h.nodeType==3)){e=h,i[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(x);e=document.createElementNS(a,C,x.is&&x),s&&(z.__m&&z.__m(t,i),s=!1),i=null}if(C==null)g===x||s&&e.data==x||(e.data=x);else{if(i=C=="textarea"&&x.defaultValue!=null?null:i&&mo.call(e.childNodes),!s&&i!=null)for(g={},d=0;d<e.attributes.length;d++)g[(h=e.attributes[d]).name]=h.value;for(d in g)h=g[d],d=="dangerouslySetInnerHTML"?m=h:d=="children"||d in x||d=="value"&&"defaultValue"in x||d=="checked"&&"defaultChecked"in x||lo(e,d,null,h,a);for(d in x)h=x[d],d=="children"?_=h:d=="dangerouslySetInnerHTML"?u=h:d=="value"?f=h:d=="checked"?b=h:s&&typeof h!="function"||g[d]===h||lo(e,d,h,g[d],a);if(u)s||m&&(u.__html==m.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(m&&(e.innerHTML=""),Yi(t.type=="template"?e.content:e,mn(_)?_:[_],t,n,o,C=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&Ut(n,0),s,c),i!=null)for(d=i.length;d--;)Kr(i[d]);s&&C!="textarea"||(d="value",C=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[d]||C=="progress"&&!f||C=="option"&&f!=g[d])&&lo(e,d,f,g[d],a),d="checked",b!=null&&b!=e[d]&&lo(e,d,b,g[d],a))}return e}function jr(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(a){z.__e(a,n)}}function ts(e,t,n){var o,a;if(z.unmount&&z.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||jr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){z.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&ts(o[a],t,n||typeof e.type!="function");n||Kr(e.__e),e.__c=e.__=e.__e=void 0}function tu(e,t,n){return this.constructor(e,n)}function kt(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),z.__&&z.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Gr(t,e=(!o&&n||t).__k=it(ee,null,[e]),a||uo,uo,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?mo.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),Zi(i,e,l),e.props.children=null}mo=po.slice,z={__e:function(e,t,n,o){for(var a,i,l;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),l=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,o||{}),l=a.__d),l)return a.__E=a}catch(s){e=s}throw e}},Vi=0,Wr=function(e){return e!=null&&e.constructor===void 0},$e.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=at({},this.state),typeof e=="function"&&(e=e(at({},n),this.props)),e&&at(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ui(this))},$e.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ui(this))},$e.prototype.render=ee,mt=[],Ki=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Gi=function(e,t){return e.__v.__b-t.__v.__b},fo.__r=0,zr=Math.random().toString(8),co="__d"+zr,fn="__a"+zr,ji=/(PointerCapture)$|Capture$/i,Vr=0,Ur=Wi(!1),qr=Wi(!0),X_=0;var qt="0.68.5";function ns(e){return`${P.cssPrefix}:${e}`}function hn(e,t,n){e.dispatchEvent(new CustomEvent(ns(t),{detail:n}))}function os(e,t){let o=Object.entries(t).map(([a,i])=>{let l=ns(a),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[a,i]of o)e.removeEventListener(a,i)}}function ze(){let e=Date.now(),t=new Uint8Array(16);t[0]=Math.floor(e/2**40)&255,t[1]=Math.floor(e/2**32)&255,t[2]=e>>>24&255,t[3]=e>>>16&255,t[4]=e>>>8&255,t[5]=e&255,nu(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function nu(e){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){crypto.getRandomValues(e);return}for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}var wt=W.scope("persistence");function gt(e,t=no,n){let o=n?`${e}.${n}`:e,a=`${P.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${P.cssPrefix}.${o}${l}`,c=`${P.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,m=`${s}.panelOpen`,_=`${s}.panelSize`,h=`${s}.calloutDismissed`,f=`${s}.sidebarCollapsed`,b=`${s}.activeModule`,g=`${s}.historyCount`,x=`${s}.formsDone`,C={getVisitorId(){let v=t.get(c);if(v)return v;let S=ze();return t.set(c,S),S},setVisitorId(v){wt.debug("setVisitorId (rebind)",{id:v,scope:o}),t.set(c,v)},loadConversationId(){return t.get(d)??void 0},saveConversationId(v){wt.trace("saveConversationId",{id:v,scope:o}),v?t.set(d,v):t.remove(d)},loadUserPrefs(){let v=t.get(u);if(!v)return{};try{let S=JSON.parse(v);return rs(S)?S:{}}catch(S){return wt.warn("loadUserPrefs parse failed",{error:S}),{}}},saveUserPrefs(v){try{t.set(u,JSON.stringify(v))}catch(S){wt.warn("saveUserPrefs serialise failed",{error:S})}},patchUserPrefs(v){let S=C.loadUserPrefs();C.saveUserPrefs({...S,...v})},loadPanelOpen(){let v=t.get(m);return v==="1"?!0:v==="0"?!1:null},savePanelOpen(v){t.set(m,v?"1":"0")},loadPanelSize(){let v=t.get(_);return v==="normal"||v==="expanded"||v==="fullscreen"?v:null},savePanelSize(v){t.set(_,v)},loadCalloutDismissed(v){if(!v)return!1;let S=t.get(h);return!!S&&S===v},saveCalloutDismissed(v){v?t.set(h,v):t.remove(h)},loadSidebarCollapsed(){let v=t.get(f);return v==="1"?!0:v==="0"?!1:null},saveSidebarCollapsed(v){t.set(f,v?"1":"0")},loadActiveModule(){return t.get(b)||null},saveActiveModule(v){t.set(b,v)},loadHistoryCount(){let v=t.get(g);if(!v)return null;let S=Number.parseInt(v,10);return Number.isFinite(S)&&S>=0?S:null},saveHistoryCount(v){t.set(g,String(v))},loadFormsDone(){let v=t.get(x);if(!v)return{};try{let S=JSON.parse(v);return rs(S)?S:{}}catch(S){return wt.warn("loadFormsDone parse failed",{error:S}),{}}},saveFormDone(v){try{let S=C.loadFormsDone();S[v]=Date.now(),t.set(x,JSON.stringify(S))}catch(S){wt.warn("saveFormDone serialise failed",{error:S})}},rememberStorageVersion(v){v&&v!==t.get(a)&&(wt.debug("rememberStorageVersion (force-reset on next load)",{version:v}),t.set(a,v))},clearConversation(){t.remove(d)}};return C}function rs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var as=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-accent-fg: var(--__P__-accent);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-pill-l-min: .3;--__P__-pill-l-max: .46;--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-mode="modal"]),:host([data-mode="drawer"]){--__P__-conversation-max: 100%}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h);--__P__-accent-fg: oklch(from var(--__P__-accent-user) clamp(.3, l, .46) c h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
2
+ `;var is=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent-fg);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3
+ `;var ss=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent-fg);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent-fg);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border:1px solid var(--__P__-border);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{display:flex;align-items:stretch;padding:0;overflow:hidden;background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{display:flex;flex:0 0 auto;align-items:center;padding:0 .875rem;border-inline-end:1px solid color-mix(in oklab,var(--__P__-accent),transparent 60%);color:var(--__P__-accent);font-size:calc(13px * var(--__P__-text-scale));font-weight:600;letter-spacing:.025em;user-select:none}.__P__-bubble-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent-fg);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent-fg)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-operator-banner{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 var(--__P__-space-3) var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg-elevated),var(--__P__-accent) 6%);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);line-height:1.3;text-align:center}.__P__-operator-pulse{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-operator-cancel{flex:0 0 auto;padding:0;border:0;background:none;color:var(--__P__-accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.__P__-operator-cancel:hover{opacity:.8}.__P__-operator-cancel:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-radius:var(--__P__-radius-sm)}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent-fg)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent-fg);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent-fg);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent-fg)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent;user-select:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=completed]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=responded]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=awaiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=denied]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=error]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=superseded]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
4
+ `;var ls=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
5
+ `;var cs=`:host([data-mode="page"]){min-height:0}:host([data-mode="page"]) .__P__-page-shell{display:grid;grid-template-columns:280px 1fr;width:100%;height:100%;min-height:0;background:var(--__P__-bg);color:var(--__P__-fg);transition:grid-template-columns var(--__P__-dur-base) var(--__P__-ease-in-out)}:host([data-mode="page"]) .__P__-page-shell[data-sidebar-collapsed=true]{grid-template-columns:48px 1fr}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}:host([data-mode="page"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-width:0;min-height:0;flex:1 1 0}:host([data-mode="page"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;animation:none}:host([data-mode="page"]) .__P__-sidebar{border-inline-end:1px solid var(--__P__-border);display:flex;flex-direction:column;overflow:hidden;background:var(--__P__-surface)}:host([data-mode="page"]) .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-5);border-bottom:1px solid var(--__P__-border);display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2);min-height:56px;box-sizing:border-box}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-2);justify-content:center}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-logo,:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-title{display:none}:host([data-mode="page"]) .__P__-sidebar-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--__P__-border);border-radius:6px;background:transparent;color:var(--__P__-fg);cursor:pointer;transition:background .12s,border-color .12s}:host([data-mode="page"]) .__P__-sidebar-toggle:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-toggle:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-logo{height:32px;display:block}:host([data-mode="page"]) .__P__-sidebar-title{font-size:var(--__P__-text-md);font-weight:600}:host([data-mode="page"]) .__P__-sidebar-section{padding:var(--__P__-space-3) var(--__P__-space-4);border-bottom:1px solid var(--__P__-border)}:host([data-mode="page"]) .__P__-sidebar-nav{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}:host([data-mode="page"]) .__P__-sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);text-decoration:none;font-size:calc(14px * var(--__P__-text-scale));transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-nav-item:hover{background:var(--__P__-hover)}:host([data-mode="page"]) .__P__-sidebar-nav-item:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}:host([data-mode="page"]) .__P__-sidebar-cards{display:grid;grid-template-columns:1fr;gap:var(--__P__-space-2)}:host([data-mode="page"]) .__P__-sidebar-card{display:block;padding:10px 12px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);text-decoration:none;color:var(--__P__-fg);transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-card:hover{border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-card-label{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}:host([data-mode="page"]) .__P__-sidebar-card-desc{font-size:var(--__P__-text-xs);color:var(--__P__-muted);margin-top:2px}:host([data-mode="page"]) .__P__-sidebar-conversations{flex:1 1 auto;overflow-y:auto;padding:var(--__P__-space-3) var(--__P__-space-4)}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;overflow:hidden}@media(max-width:768px){:host([data-mode="page"]) .__P__-page-shell{grid-template-columns:1fr}:host([data-mode="page"]) .__P__-sidebar{display:none}}
6
+ `;var lu="helpai",cu="#5B5BD6",du="#FFFFFF",_u="12px",uu="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",Xr=[as,is,ss,ls,cs].join(`
7
+ `).replace(/__P__/g,lu).replaceAll("__BRAND_ACCENT_TEXT__",du).replaceAll("__BRAND_ACCENT__",cu).replaceAll("__BRAND_RADIUS__",_u).replaceAll("__BRAND_FONT__",uu);var pu=W.scope("mount"),ds=new WeakMap,_s={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function us(e,t){e.style.cssText=_s[t]}function Ct(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Wt(e={}){let t=e.position??"flow";pu.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${P.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let o;e.existingHost?o=e.existingHost:(o=document.createElement(n),(e.target??document.body).appendChild(o)),o.setAttribute("data-brand",P.id),o.style.cssText=_s[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!fu(a,i)){let s=i.createElement("style");s.textContent=Xr,a.appendChild(s)}let l=document.createElement("div");return l.className=`${P.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:a}}function fu(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=ds.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(Xr),ds.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function mu(e,t){let n=P.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function gu(e,t){e.dataset.theme=t}function hu(e,t){let n=P.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function vu(e,t){e.dataset.position=t}function go(e,t){e.dataset.mode=t}function ps(e,t){gu(e,t.themeMode),mu(e,t.themeOverrides),vu(e,t.position),hu(e,t.size)}var bu=W.scope("iframe"),yu='<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:transparent;overflow:hidden}</style></head><body></body></html>';function gs(e,t,n="closed",o="floating",a=null){bu.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!a});let i=document.createElement("iframe");i.title=`${P.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),ms(i,t,n,o),(o==="inline"&&a?a:document.body).appendChild(i);let s=i.contentDocument;if(!s)throw new Error("iframe contentDocument unavailable (cross-origin?)");s.open(),s.write(yu),s.close();let c=Wt({...e,target:s.body}),d=new MutationObserver(()=>{ms(i,t,c.hostElement.dataset.mode??"closed",o)});return d.observe(c.hostElement,{attributes:!0,attributeFilter:["data-mode"]}),{...c,iframeElement:i,destroy(){d.disconnect(),c.destroy(),i.remove()}}}var ho="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",fs={closed:{w:"88px",h:"88px"},expanded:{w:"min(calc(100vw - 32px), 680px)",h:"min(calc(100vh - 32px), 860px)"},open:{w:"min(calc(100vw - 32px), 440px)",h:"min(calc(100vh - 32px), 700px)"}};function ms(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${ho}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${ho}position:static;display:block;width:100%;height:100%;`;return}if(typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches&&(n==="open"||n==="expanded")){e.style.cssText=`${ho}position:fixed;inset:0;width:100vw;height:100vh;`;return}let i=t.startsWith("top-")?"top":"bottom",l=t.endsWith("-left")?"left":"right",{w:s,h:c}=fs[n]??fs.open;e.style.cssText=`${ho}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var Vt=class{constructor(){K(this,"handlers",new Map)}on(t,n){let o=this.handlers.get(t);return o||(o=new Set,this.handlers.set(t,o)),o.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let o=this.handlers.get(t);if(o)for(let a of o)try{a(n)}catch{}}clear(){this.handlers.clear()}};var Kt,ge,Yr,hs,vn=0,ws=[],ve=z,vs=ve.__b,bs=ve.__r,ys=ve.diffed,Ps=ve.__c,xs=ve.unmount,Ss=ve.__;function bo(e,t){ve.__h&&ve.__h(ge,e,vn||t),vn=0;var n=ge.__H||(ge.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function T(e){return vn=1,Cs(Es,e)}function Cs(e,t,n){var o=bo(Kt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Es(void 0,t),function(s){var c=o.__N?o.__N[0]:o.__[0],d=o.t(c,s);c!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=ge,!ge.__f)){var a=function(s,c,d){if(!o.__c.__H)return!0;var u=!1,m=o.__c.props!==s;if(o.__c.__H.__.some(function(h){if(h.__N){u=!0;var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(m=!0)}}),i){var _=i.call(this,s,c,d);return u?_||m:_}return!u||m};ge.__f=!0;var i=ge.shouldComponentUpdate,l=ge.componentWillUpdate;ge.componentWillUpdate=function(s,c,d){if(this.__e){var u=i;i=void 0,a(s,c,d),i=u}l&&l.call(this,s,c,d)},ge.shouldComponentUpdate=a}return o.__N||o.__}function E(e,t){var n=bo(Kt++,3);!ve.__s&&Qr(n.__H,t)&&(n.__=e,n.u=t,ge.__H.__h.push(n))}function ht(e,t){var n=bo(Kt++,4);!ve.__s&&Qr(n.__H,t)&&(n.__=e,n.u=t,ge.__h.push(n))}function F(e){return vn=5,Me(function(){return{current:e}},[])}function Me(e,t){var n=bo(Kt++,7);return Qr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D(e,t){return vn=8,Me(function(){return e},t)}function Pu(){for(var e;e=ws.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(vo),t.__h.some(Jr),t.__h=[]}catch(n){t.__h=[],ve.__e(n,e.__v)}}}ve.__b=function(e){ge=null,vs&&vs(e)},ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ss&&Ss(e,t)},ve.__r=function(e){bs&&bs(e),Kt=0;var t=(ge=e.__c).__H;t&&(Yr===ge?(t.__h=[],ge.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(vo),t.__h.some(Jr),t.__h=[],Kt=0)),Yr=ge},ve.diffed=function(e){ys&&ys(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ws.push(t)!==1&&hs===ve.requestAnimationFrame||((hs=ve.requestAnimationFrame)||xu)(Pu)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Yr=ge=null},ve.__c=function(e,t){t.some(function(n){try{n.__h.some(vo),n.__h=n.__h.filter(function(o){return!o.__||Jr(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],ve.__e(o,n.__v)}}),Ps&&Ps(e,t)},ve.unmount=function(e){xs&&xs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{vo(o)}catch(a){t=a}}),n.__H=void 0,t&&ve.__e(t,n.__v))};var ks=typeof requestAnimationFrame=="function";function xu(e){var t,n=function(){clearTimeout(o),ks&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);ks&&(t=requestAnimationFrame(n))}function vo(e){var t=ge,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ge=t}function Jr(e){var t=ge;e.__c=e.__(),ge=t}function Qr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Es(e,t){return typeof t=="function"?t(e):t}var Su=Symbol.for("preact-signals");function So(){if(st>1)st--;else{var e,t=!1;for((function(){var a=Po;for(Po=void 0;a!==void 0;){var i=a.S;if(i.v===a.v)for(var l=i.t;l!==void 0;l=l.x)l.i===a.i&&(l.i=i.i);a=a.o}})();yn!==void 0;){var n=yn;for(yn=void 0,yo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Rs(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(yo=0,st--,t)throw e}}function Gt(e){if(st>0)return e();Zr=++ku,st++;try{return e()}finally{So()}}var bn,ue=void 0;function Pn(e){var t=ue,n=bn;ue=void 0,bn=void 0;try{return e()}finally{ue=t,bn=n}}var yn=void 0,st=0,yo=0,ku=0,Zr=0,Po=void 0,xo=0;function Ts(e){if(ue!==void 0){var t=e.n;if(t===void 0||t.t!==ue)return t={i:0,S:e,p:ue.s,n:void 0,t:ue,e:void 0,x:void 0,r:t},ue.s!==void 0&&(ue.s.n=t),ue.s=t,e.n=t,32&ue.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=ue.s,t.n=void 0,ue.s.n=t,ue.s=t),t}}function ke(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ke.prototype.brand=Su;ke.prototype.h=function(){return!0};ke.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Pn(function(){var o;(o=t.W)==null||o.call(t)}))};ke.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&Pn(function(){var a;(a=t.Z)==null||a.call(t)}))}};ke.prototype.subscribe=function(e){var t=this;return lt(function(){var n=t.value;Pn(function(){return e(n)})},{name:"sub"})};ke.prototype.valueOf=function(){return this.value};ke.prototype.toString=function(){return this.value+""};ke.prototype.toJSON=function(){return this.value};ke.prototype.peek=function(){var e=this;return Pn(function(){return e.value})};Object.defineProperty(ke.prototype,"value",{get:function(){var e=Ts(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(yo>100)throw new Error("Cycle detected");(function(n){st!==0&&yo===0&&n.l!==Zr&&(n.l=Zr,Po={S:n,v:n.v,i:n.i,o:Po})})(this),this.v=e,this.i++,xo++,st++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{So()}}}});function q(e,t){return new ke(e,t)}function Rs(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Is(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function As(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function Et(e,t){ke.call(this,void 0,t),this.x=e,this.s=void 0,this.g=xo-1,this.f=4}Et.prototype=new ke;Et.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===xo))return!0;if(this.g=xo,this.f|=1,this.i>0&&!Rs(this))return this.f&=-2,!0;var e=ue;try{Is(this),ue=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return ue=e,As(this),this.f&=-2,!0};Et.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ke.prototype.S.call(this,e)};Et.prototype.U=function(e){if(this.t!==void 0&&(ke.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Et.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Et.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ts(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function xn(e,t){return new Et(e,t)}function Ms(e){var t=e.m;if(e.m=void 0,typeof t=="function"){st++;var n=ue;ue=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,ea(e),o}finally{ue=n,So()}}}function ea(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ms(e)}function wu(e){if(ue!==this)throw new Error("Out-of-order effect");As(this),ue=e,this.f&=-2,8&this.f&&ea(this),So()}function jt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,bn&&bn.push(this)}jt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};jt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ms(this),Is(this),st++;var e=ue;return ue=this,wu.bind(this,e)};jt.prototype.N=function(){2&this.f||(this.f|=2,this.u=yn,yn=this)};jt.prototype.d=function(){this.f|=8,1&this.f||ea(this)};jt.prototype.dispose=function(){this.d()};function lt(e,t){var n=new jt(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Ls,Co,ko,Cu=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Os=[];lt(function(){Ls=this.N})();function Xt(e,t){z[e]=t.bind(null,z[e]||function(){})}function wo(e){if(ko){var t=ko;ko=void 0,t()}ko=e&&e.S()}function Ns(e){var t=this,n=e.data,o=Qe(n);o.value=n;var a=Me(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=xn(function(){var h=o.value.value;return h===0?0:h===!0?"":h||""}),u=xn(function(){return!Array.isArray(d.value)&&!Wr(d.value)}),m=lt(function(){if(this.N=Ds,u.value){var h=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),_=t.__$u.d;return t.__$u.d=function(){m(),_.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}Ns.displayName="ReactiveTextNode";Object.defineProperties(ke.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ns},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Xt("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var a in o)if(a!=="children"){var i=o[a];i instanceof ke&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});Xt("__r",function(e,t){if(e(t),t.type!==ee){wo();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(a,i){var l;return lt(function(){l=this},{name:i}),l.c=a,l})(function(){var a;Cu&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Co=o,wo(n)}});Xt("__e",function(e,t,n,o){wo(),Co=void 0,e(t,n,o)});Xt("diffed",function(e,t){wo(),Co=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,a=t.props,i=n.U;if(i)for(var l in i){var s=i[l];s===void 0||o&&l in o||(s.d(),i[l]=void 0)}if(o){i||(i={},n.U=i);for(var c in o){var d=i[c],u=o[c];d===void 0?(d=Eu(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function Eu(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=q(n);return{o:function(l,s){i.value=l,o=s},d:lt(function(){this.N=Ds;var l=i.value.value;o[t]!==l&&(o[t]=l,a?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Xt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var a in o){var i=o[a];i&&i.d()}}}var l=t.__np;if(l){var s=t.props;for(var c in l)s[c]=l[c]}t.__np=void 0}else{var d=t.__c;if(d){var u=d.__$u;u&&(d.__$u=void 0,u.d())}}e(t)});Xt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});$e.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var a in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(o||i||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function Qe(e,t){return Me(function(){return q(e,t)},[])}function J(e,t){var n=F(e);return n.current=e,Co.__$f|=4,Me(function(){return xn(function(){return n.current()},t)},[])}var Tu=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Ru(){Gt(function(){for(var e;e=Os.shift();)Ls.call(e)})}function Ds(){Os.push(this)===1&&(z.requestAnimationFrame||Tu)(Ru)}function $s(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Fs(e){return $s(e)}function Bs(e){return!(!$s(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Eo(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var Iu=900,Au=640;function ta(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;return o==="expanded"||o==="fullscreen"||o==="normal"?o:n>0&&n<Au?"fullscreen":n>=(t.autoSizeBreakpoint??Iu)?"expanded":"normal"}function Sn(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:ta(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Yt(){return typeof window>"u"?0:window.innerWidth}var Mu="x-public-key",Lu="x-ai-agent-deployment-id";function Hs(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[Lu]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??Mu]=e.publicKey),t}}}function kn(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),a=()=>i();t?.addEventListener("abort",a,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",a),n()}})}var Xe=class extends Error{constructor(n,o,a,i){super(n);K(this,"code",o);K(this,"status",a);K(this,"cause",i);this.name="StreamError"}};var zs=W.scope("parser");async function*na(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Xe(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of Ou(e,t)){let o=Nu(n);if(o==="done")return;o&&(yield o)}}async function*Ou(e,t){if(!e.body)throw new Xe("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:a,value:i}=await n.read();if(a){let s=o.trim();s&&(yield s);return}o+=i;let l;for(;(l=o.indexOf(`
8
8
 
9
- `))!==-1;){let s=o.slice(0,l);o=o.slice(l+2),yield s}}}finally{n.releaseLock()}}function Du(e){let t="",n;for(let o of e.split(`
9
+ `))!==-1;){let s=o.slice(0,l);o=o.slice(l+2),yield s}}}finally{n.releaseLock()}}function Nu(e){let t="",n;for(let o of e.split(`
10
10
  `))if(!(o===""||o.startsWith(":"))){if(o.startsWith("data:")){let a=o.slice(5).replace(/^ /,"");t=t?`${t}
11
- ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(t==="[DONE]")return"done";if(!t)return null;try{let o=JSON.parse(t);return Vs.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Vs.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function $u(e){let t=new TextEncoder().encode(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Ks=e=>e&&Object.keys(e).length>0?e:void 0;function Gs(e,t){let n=Ks(e),o=Ks(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),$u(JSON.stringify(a))}function Ao(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Fu(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function js(e){return e.startsWith("tool-")?e.slice(5):e}var Fe={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",cancelRequestOperator:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Xs="context";function bt(e){let t=e??{},n=t.controlMode;return{controlMode:n==="awaiting_operator"||n==="operator"?n:"ai-agent",assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function Mo(e){let t=e?.suggestions;if(!Array.isArray(t))return[];let n=[];for(let o of t){if(!o||typeof o!="object")continue;let{id:a,label:i,text:l}=o;typeof i!="string"||!i||n.push({id:typeof a=="string"&&a?a:`s${n.length}`,label:i,text:typeof l=="string"&&l?l:i})}return n}function sa(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:zu(i),role:i.role,createdAt:i.createdAt!==void 0?new Date(i.createdAt).toISOString():void 0})),n={messages:t,conversationId:e.conversationId,trigger:e.trigger??"submit-message"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let a=e.tools?.map(Hu).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function Bu(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function Hu(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function zu(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&Bu(n)){let o={type:Fu(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(o.input=n.input),n.output!==void 0&&(o.output=n.output),n.error!==void 0&&(o.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(o.approval=n.approval),t.push(o)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var Y=W.scope("transport"),Uu=6e4,qu=1e4,Ys=3,Wu=400,Vu=new Set([408,425,429,500,502,503,504]);function Js(e){return Wu*2**e+Math.floor(Math.random()*250)}function Ku(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}var Lo=class{constructor(t){K(this,"ttlMs",t);K(this,"map",new Map)}getOrFetch(t,n){let o=this.map.get(t);if(o&&Date.now()-o.at<this.ttlMs)return o.result;let a={at:Date.now(),result:n().then(i=>(a.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,a),a.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&Date.now()-n.at<this.ttlMs)return n.value}clear(){this.map.clear()}},Oo=class{constructor(t){K(this,"opts",t);K(this,"visitorId");K(this,"conversationId");K(this,"userContext");K(this,"pageContext");K(this,"locale");K(this,"conversationsCache",new Lo(qu));K(this,"loadConversationInflight",new Map);K(this,"contentCache",new Lo(Uu))}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:Kt};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Gs(this.userContext,this.pageContext);return n&&(t[Xs]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,o]of Object.entries(this.envelope()))t.append(n,o);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[o,a]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,a);return n.toString()}async handshake(t){Y.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(Fe.handshake,t,"handshake");return Y.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),ju(n)||Y.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t){Y.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return Y.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){Y.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${Gu(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return Y.debug("transcribe \u2190",{textLen:a.text.length}),a}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={}){return this.conversationsCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchConversations(t))}async fetchConversations(t){let n=new URL(this.url(Fe.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),Y.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listConversations"),a=o.conversations??[];return Y.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a,nextCursor:o.nextCursor}}async loadConversation(t){let n=this.loadConversationInflight.get(t);if(n)return n;let o=this.loadConversationDirect(t).finally(()=>this.loadConversationInflight.delete(t));return this.loadConversationInflight.set(t,o),o}async loadConversationDirect(t){let n=new URL(this.url(Fe.listMessages));n.searchParams.set("conversationId",t),Y.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return Y.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:a.length,hasSuggestions:!!o.suggestions}),{...o,messages:a,canContinue:o.canContinue??!0}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),Y.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(Fe.markRead,{conversationId:t},"markRead")}catch(n){Y.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){Y.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Fe.requestOperator,{},"requestOperator")).controlState}catch(t){Y.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelRequestOperator(){if(!(!this.visitorId||!this.conversationId)){Y.debug("cancelRequestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Fe.cancelRequestOperator,{},"cancelRequestOperator")).controlState}catch(t){Y.debug("cancelRequestOperator failed (non-fatal)",{err:t});return}}}listContent(t={}){return this.contentCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchContent(t))}async fetchContent(t){let n=new URL(this.dataUrl(Fe.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));Y.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>Pi(i,this.locale));return Y.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(Fe.bootstrap));t&&n.searchParams.set("conversationId",t),Y.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return Y.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){Y.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(Fe.updateSettings,{userPrefs:t},"saveUserPrefs");return Y.debug("saveUserPrefs \u2190",{success:n.success}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??Fe.submitForm}async submitForm(t){Y.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){Y.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){Y.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(Fe.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){Y.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),Y.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageId:t.messageId,messageCount:t.messages.length,trigger:t.trigger,tools:t.data?.tools?.map(l=>l.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.conversationId),detach:()=>n.abort()}}async connectResumeStream(t){let n;try{n=await this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(o){return t.signal.aborted||Y.debug("resume-stream fetch failed \u2014 reconnecting",{err:o}),"held"}if(!n.ok||!n.body)return Y.debug("resume-stream \u2192 endpoint unavailable",{status:n.status}),"unavailable";if(!(n.headers.get("content-type")??"").includes("text/event-stream"))return Y.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";t.onConnected();try{for await(let{chunk:o}of ia(n,t.signal)){if(t.signal.aborted)return"held";t.onChunk(o)}}catch(o){if(t.signal.aborted)return"held";Y.debug("resume-stream segment dropped \u2014 reconnecting",{err:o})}return"held"}async*runStream(t,n,o){try{yield*this.drain(this.openMessageStream(t,n.signal),o,n)}finally{n.abort()}}async*drain(t,n,o){try{for await(let a of t){if(o.signal.aborted)return;if(a.eventId){if(n.has(a.eventId))continue;n.add(a.eventId)}yield a}}catch(a){if(o.signal.aborted)return;if(a instanceof Ye&&a.status!==void 0)throw a;Y.debug("stream segment dropped",{err:a})}}cancelStream(t,n){t.signal.aborted||(Y.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(Fe.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>Y.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(Fe.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*ia(o,n)}resumeUrl(){return this.withEnvelopeQuery(Fe.streamResume)}async postJson(t,n,o){let a=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],o);return this.assertOk(a,o)}async postForm(t,n,o){let a=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(a,o)}async getJson(t,n){let o=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(o,n)}async fetchWithRetry(t,n){for(let o=0;;o++){let[a,i]=t(),l;try{l=await this.fetchImpl(a,i)}catch(c){if(o>=Ys)throw new Ye(`${n} failed: network error`,"network",void 0,c);Y.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Tn(Js(o));continue}if(l.ok||!Vu.has(l.status)||o>=Ys)return l;let s=Ku(l.headers)??Js(o);Y.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await Tn(s)}}async assertOk(t,n){if(!t.ok)throw new Ye(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function Gu(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function ju(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function Qs(e,t){let n=e?[{kind:"text",id:"t0",textSig:q(e),doneSig:q(!0)}]:[];return{id:qe(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:q(n)}}function Rn(){return{id:qe(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:q([])}}function Zs(e){let t=qe();return Xu({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function Xu(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,feedback:e.feedback,partsSig:q(e.parts.map(ep))}}var el=new Set(["completed","failed","canceled"]);function Yu(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status!=null&&!el.has(e.status)?"streaming":"complete"}function Ju(e){let t=e.parts.map((o,a)=>o.type==="text"?{kind:"text",id:`${e.id}-t${a}`,textSig:q(o.text),doneSig:q(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${a}`,textSig:q(o.text),doneSig:q(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${a}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType}:o.type==="source-url"?{kind:"source",sourceId:o.sourceId,url:o.url,title:o.title}:o.type==="source-document"?{kind:"source",sourceId:o.sourceId,title:o.title,filename:o.filename,mediaType:o.mediaType}:o.type==="data-suggestions"?null:o.type.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:js(o.type),inputPartialSig:q(""),inputSig:q(o.input),outputSig:q(o.output),errorSig:q(o.errorText),stateSig:q(o.state),approvalSig:q(o.approval)}:null).filter(o=>o!==null),n=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:n?.type==="data-suggestions"?Mo(n.data):void 0,serverMessageId:e.id,createdAt:Ao(e.createdAt)??Date.now(),status:Yu(e),canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:q(t)}}function Qu(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function Zu(e){return e.role==="assistant"&&e.status!=null&&!el.has(e.status)&&Qu(e)}function No(e){let t=e.length-1;return e.filter((n,o)=>o===t||!Zu(n)).map(Ju)}function tl(e,t){return(!t&&e.at(-1)?.role==="assistant"?e.slice(0,-1):e).filter(o=>!o.ephemeral)}function ca(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,parts:e.partsSig.value.map(tp)}}function Rt(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function In(e){return Rt(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function _t(e){return e.role==="assistant"&&e.status!=="streaming"&&In(e)}function nl(e){return e.canceled===!0&&_t(e)}function ol(e,t){return e.operatorRoutedTurn?_t(e)?"drop":"complete-operator-routed":t||_t(e)?"error":"complete"}function ep(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:q(e.text),doneSig:q(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:q(e.inputPartial),inputSig:q(e.input),outputSig:q(e.output),errorSig:q(e.error),stateSig:q(e.state),approvalSig:q(e.approval)}:e}function tp(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var rl=W.scope("reducer"),Mn=class{constructor(t){K(this,"messagesSig",t);K(this,"active",null);K(this,"openTextParts",new Map);K(this,"partSeq",0);K(this,"resumeIgnore",!1)}attach(t){this.active=t,this.openTextParts.clear()}resetForReplay(t){t.partsSig.value=[],t.status="streaming",t.finishReason=void 0,t.errorText=void 0,t.suggestions=void 0,this.openTextParts.clear(),this.messagesSig.value=[...this.messagesSig.value]}detach(){this.active=null,this.openTextParts.clear()}applyResume(t,n=!1){if(t.type==="data-control-state"||t.type==="data-conversation-rebind")return null;if(t.type==="start"){let o=t.messageId,a=t.messageMetadata?.senderRole,i=o!==void 0?this.messagesSig.value.find(d=>d.serverMessageId===o||d.id===o):void 0;if(i!==void 0&&i.status!=="streaming"&&!In(i)||a===void 0&&n)return this.resumeIgnore=!0,this.detach(),null;if(this.resumeIgnore=!1,i!==void 0)return this.resetForReplay(i),this.attach(i),this.apply(t),null;let c=Rn();return this.attach(c),this.messagesSig.value=[...this.messagesSig.value,c],this.apply(t),null}if(this.resumeIgnore||!this.active)return null;if(this.apply(t),t.type==="finish"||t.type==="error"){let o=this.active;return this.detach(),o}return null}ensureTextPart(t,n,o){let a=`${n}:${o}`,i=this.openTextParts.get(a);if(i)return i;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:q(""),doneSig:q(!1)};return this.openTextParts.set(a,l),An(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let o=t.messageMetadata;o?.senderRole==="operator"?(n.role="operator",o.operatorInitials&&(n.operatorInitials=o.operatorInitials)):o?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":An(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":rl.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":rl.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let o=this.ensureTextPart(n,"text",t.id);o.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let o=this.ensureTextPart(n,"reasoning",t.id);o.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":np(n,t);return;case"file":An(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":al(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":al(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-notification":return;case"data-conversation-rebind":return;case"data-suggestions":n.suggestions=Mo(t.data);return;case"data-control-state":n.operatorRoutedTurn=!0;return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function It(e,t,n){let o=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(o)return o;let a={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:q(""),inputSig:q(void 0),outputSig:q(void 0),errorSig:q(void 0),stateSig:q("input-streaming"),approvalSig:q(void 0)};return An(e,a),a}function An(e,t){e.partsSig.value=[...e.partsSig.value,t]}function al(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||An(e,t)}function np(e,t){switch(t.type){case"tool-input-start":It(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=It(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=It(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=It(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=It(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=It(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=It(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function il(e){let t=1e3;for(;!e.signal.aborted;){let n,o="held";try{o=await e.connect(()=>{n=e.now(),e.backfill()})}catch{}if(e.signal.aborted||o==="unavailable")return;n!==void 0&&e.now()-n>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var sl=W.scope("feedback:audio"),Do=class{constructor(){K(this,"ctx",null);K(this,"master",null);K(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){sl.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((l,s)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=l;let d=n.createGain(),u=a+s*i;d.gain.setValueAtTime(1e-4,u),d.gain.exponentialRampToValueAtTime(t.peakGain,u+.005),d.gain.exponentialRampToValueAtTime(1e-4,u+i),c.connect(d).connect(o),c.start(u),c.stop(u+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=await this.getBuffer(t);if(!a)return;let i=n.createBufferSource();i.buffer=a,i.connect(o),i.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let o=this.ctx,a=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>o.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(sl.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var ll={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},cl={messageReceived:{notes:[880,1318.51],noteMs:90,type:"sine",peakGain:.45},messageSent:{notes:[1568],noteMs:60,type:"sine",peakGain:.25},error:{notes:[523.25,392],noteMs:120,type:"triangle",peakGain:.55},voiceStart:{notes:[1318.51],noteMs:50,type:"sine",peakGain:.3},voiceStop:{notes:[880],noteMs:50,type:"sine",peakGain:.3}};var yt=null,$o=0;function op(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function rp(){if(typeof document>"u")return null;let e=document.createElement("input");e.type="checkbox",e.setAttribute("switch",""),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.id=`__${P.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function dl(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(op())try{navigator.vibrate(e);return}catch{}if(yt||(yt=rp()),!!yt)try{yt.label.click()}catch{}}}function _l(){$o++;let e=!1;return()=>{e||(e=!0,$o=Math.max(0,$o-1),$o===0&&yt&&(yt.input.remove(),yt.label.remove(),yt=null))}}var ap=W.scope("feedback"),ip=100,Fo=class{constructor(t,n){K(this,"mutedSig",q(!1));K(this,"audio",new Do);K(this,"releaseHaptics");K(this,"sound");K(this,"haptics");K(this,"lastPlayed",new Map);K(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=_l(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<ip}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>ap.warn("audio play failed",{err:a,url:n}));return}let o=cl[t];o&&this.audio.playTone(o)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let o=n===!0||n===void 0?ll[t]:n;dl(o)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function en(e,t){return e instanceof Ye&&e.status===429?t.errorRateLimited:t.errorGeneric}var sp=0;function r(e,t,n,o,a,i){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--sp,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return z.vnode&&z.vnode(d),d}var H={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Ln=`${P.cssPrefix}-icon-dir`,da=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),tt=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),ul=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),pl=()=>r("svg",{...H,class:Ln,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),fl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),ml=()=>r("svg",{...H,class:Ln,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),tn=()=>r("svg",{...H,class:Ln,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),gl=()=>r("svg",{...H,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),hl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),vl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),bl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),yl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Pl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),xl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),Sl=()=>r("svg",{...H,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),kl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),wl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),Cl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),El=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),r("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),Tl=()=>r("svg",{...H,class:Ln,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),At=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),Rl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]}),Il=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M2 12h20"}),r("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),On=()=>r("svg",{...H,class:Ln,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Al=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Mt=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),Ml=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),lp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),_a=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),Nn=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),cp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),dp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),ua=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),_p=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),pa=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),Ll=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Ol=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Nl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Dn=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),Dl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),$l=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Fl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),up=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),pp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),fp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),mp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),Bl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),r("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),Hl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),r("path",{d:"M7 10l4-7a2.5 2.5 0 0 1 2.5 2.5V8h5a2 2 0 0 1 2 2.3l-1.2 8A2 2 0 0 1 17.3 20H7"})]}),zl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),r("path",{d:"M17 14l-4 7a2.5 2.5 0 0 1-2.5-2.5V16h-5a2 2 0 0 1-2-2.3l1.2-8A2 2 0 0 1 6.7 4H17"})]}),Ul=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"3.5"}),r("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9l-2.1 2.1M7 17l-2.1 2.1"})]}),ql=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Bo=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Ho=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),Wl={chat:da,message:_a,bubbles:Dn,spark:lp,wand:cp,bot:dp,help:Nn,lifebuoy:_p,headset:ua,search:up,sparkles:pp,concierge:fp,wave:mp};var A=P.cssPrefix,w={launcher:`${A}-launcher`,callout:`${A}-callout`,calloutDismiss:`${A}-callout-dismiss`,panel:`${A}-panel`,panelHeader:`${A}-panel-header`,resizeGrip:`${A}-resize-grip`,scrollToBottom:`${A}-scroll-to-bottom`,actionHistory:`${A}-action-history`,actionClose:`${A}-action-close`,langSegment:`${A}-lang-segment`,composer:`${A}-composer`,composerInput:`${A}-composer-input`,composerSend:`${A}-composer-send`,composerStop:`${A}-composer-stop`,composerAttach:`${A}-composer-attach`,composerFileInput:`${A}-composer-file-input`,composerVoice:`${A}-composer-voice`,attachmentChip:`${A}-attachment-chip`,attachmentRemove:`${A}-attachment-remove`,suggestion:`${A}-suggestion`,messageBubble:`${A}-message`,messageRetry:`${A}-message-retry`,messageFeedback:`${A}-message-feedback`,feedbackUp:`${A}-feedback-up`,feedbackDown:`${A}-feedback-down`,messageCopy:`${A}-message-copy`,historyPane:`${A}-history-pane`,historyBack:`${A}-history-back`,historyItem:`${A}-history-item`,sidebar:`${A}-sidebar`,sidebarToggle:`${A}-sidebar-toggle`,sidebarNewConversation:`${A}-sidebar-new-conversation`,sidebarItem:`${A}-sidebar-item`,messengerHome:`${A}-messenger-home`,modulesEmpty:`${A}-modules-empty`,tab:`${A}-tab`,tabBadge:`${A}-tab-badge`,homeView:`${A}-home-view`,homeGreeting:`${A}-home-greeting`,homeBrand:`${A}-home-brand`,backHeader:`${A}-back-header`,contentView:`${A}-content-view`,contentScroll:`${A}-content-scroll`,homeSearch:`${A}-home-search`,helpSearch:`${A}-help-search`,homeRecent:`${A}-home-recent`,homeContentRow:`${A}-home-content-row`,helpArticle:`${A}-help-article`,newsItem:`${A}-news-item`,formGate:`${A}-form-gate`,formDone:`${A}-form-done`,formDoneToggle:`${A}-form-done-toggle`,formAnswers:`${A}-form-answers`,formFill:`${A}-form-fill`,formSubmit:`${A}-form-submit`,formSkip:`${A}-form-skip`,formField:`${A}-form-field`,toolAskQuestions:`${A}-tool-ask-questions`,toolInputSubmit:`${A}-tool-input-submit`,toolInputSkip:`${A}-tool-input-skip`,toolApproval:`${A}-tool-approval`,toolApprove:`${A}-tool-approve`,toolReject:`${A}-tool-reject`,toolEdit:`${A}-tool-edit`,toolDecision:`${A}-tool-decision`,toolAskSummary:`${A}-ask-questions-summary`,toolAskOptions:`${A}-ask-questions-options-toggle`,toolCall:`${A}-tool-call`,source:`${A}-source`,operatorRequest:`${A}-operator-request`,operatorBanner:`${A}-operator-banner`,operatorCancelRequest:`${A}-operator-cancel-request`};function Ce(e,t){return`${e}-${t}`}var zo=P.cssPrefix;function Vl({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${zo}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":w.launcher,onClick:e,"aria-label":n.launcherOpen,children:[gp(t.icon),i?r("span",{class:`${zo}-fab-label`,children:Oe(n,t.label??"")}):null]})}function gp(e){let t=Wl[e];return t?r(t,{}):r(hp,{source:e})}function hp({source:e}){return r("span",{ref:t=>{t&&vp(t,e)},"aria-hidden":"true"})}function vp(e,t){if(e.dataset.svgMounted!==t)try{let o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;o&&o.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(o,!0)),e.dataset.svgMounted=t)}catch{}}function Kl({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=T(!1);return E(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${zo}-callout`,role:"status","data-shape":e.shape,"data-position":bp(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":w.callout,children:[r("span",{children:Oe(n,e.text)}),r("button",{type:"button",class:`${zo}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":w.calloutDismiss,children:r(tt,{})})]}):null}function bp(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Uo({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=P.cssPrefix,s=F(null);if(E(()=>{if(!e)return;let f=e.style;t.minWidth&&f.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&f.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&f.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&f.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(f.setProperty(`--${l}-widget-w`,`${o.width}px`),f.setProperty(`--${l}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,o]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),u=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,m=f=>{if(!e)return;let b=f.currentTarget,g=e.getBoundingClientRect();s.current={pointerId:f.pointerId,startX:f.clientX,startY:f.clientY,startW:g.width,startH:g.height,dirX:d?-1:1,dirY:c?1:-1},b.setPointerCapture(f.pointerId),e.setAttribute("data-resizing",""),f.preventDefault()},_=f=>{let b=s.current;if(!b||f.pointerId!==b.pointerId||!e)return;let g=(f.clientX-b.startX)*b.dirX,x=(f.clientY-b.startY)*b.dirY;e.style.setProperty(`--${l}-widget-w`,`${b.startW+g}px`),e.style.setProperty(`--${l}-widget-h`,`${b.startH+x}px`)},h=f=>{let b=s.current;if(!b||f.pointerId!==b.pointerId||!e)return;f.currentTarget.releasePointerCapture(f.pointerId),e.removeAttribute("data-resizing");let g=e.getBoundingClientRect();a({width:Math.round(g.width),height:Math.round(g.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:m,onPointerMove:_,onPointerUp:h,onPointerCancel:h,"data-testid":w.resizeGrip,children:r(Sl,{})})}var Lt=P.cssPrefix,yp=`.${Lt}-header, .${Lt}-back-header, .${Lt}-home-hero`,Pp='button, a, input, textarea, select, [role="tab"], [contenteditable]',Gl=56;function qo(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),a=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(yp)||d.closest(Pp))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Lt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Lt}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-Gl,maxY:(window.innerHeight+u.height)/2-Gl},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!a||c.pointerId!==a.id)return;let d=o(a.dx+c.clientX-a.x,a.maxX),u=o(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${Lt}-modal-dx`,`${d}px`),e.style.setProperty(`--${Lt}-modal-dy`,`${u}px`)},s=c=>{!a||c.pointerId!==a.id||(a=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",l),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}},[e,t])}function $n(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Wo(e,t,n){return $n("close",e,t)?n.includes("close"):!1}function jl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var xp='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Vo(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(xp)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let a=o[0],i=o[o.length-1];if(!a||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===a?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),a.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Ko(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var fa=P.cssPrefix;function Xl({agent:e,strings:t}){let n=e.status??"online",o=Oe(t,e.name),a=e.title?Oe(t,e.title):null;return r("div",{class:`${fa}-agent`,children:[r("div",{class:`${fa}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Ko(o)})}),r("div",{class:`${fa}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var Yl=W.scope("attachments");function Go(e,t,n){let o=kp(e),a=[],i=[],l=Ep(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=Sp(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(Cp(d)),s+=d.size,c+=1}return(a.length||i.length)&&Yl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function ma(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Yl.debug("revokeObjectURL failed",{error:t})}}function Sp(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Tp(e,a)?null:"mime"}function kp(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:wp(t)).filter(t=>t!==null):[]}function wp(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Cp(e){return{file:e,id:qe(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Ep(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",o="*"]=t.split("/");return{kind:"mime",type:n,subtype:o}})}function Tp(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),a=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?a.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var Fn=P.cssPrefix;function Jl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${Fn}-attachment-chip`,title:e.name,"data-testid":Ce(w.attachmentChip,e.id),children:[n?r("img",{class:`${Fn}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${Fn}-attachment-thumb`,"aria-hidden":"true",children:r(Ml,{})}),r("span",{class:`${Fn}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${Fn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":Ce(w.attachmentRemove,e.id),children:r(tt,{})})]})}var ga={isSupported:!1,start:()=>{},stop:()=>{}};function ha(e,t,n){return e==="disabled"?ga:e==="server"?Mp(n):Rp(t)}function Rp(e){let t=Ip();if(!t)return ga;let n=null;return{isSupported:!0,start(o,a){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let u=s.resultIndex;u<s.results.length;u++){let m=s.results[u];m&&(c+=m[0].transcript,m.isFinal&&(d=!0))}o(c,d)});let i=()=>{n=null,a()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function Ip(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Ap=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Mp(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ga;let t=null,n=null,o=[],a=()=>{for(let i of n?.getTracks()??[])i.stop();n=null};return{isSupported:!0,async start(i,l){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let s=Lp();t=new MediaRecorder(n,s?{mimeType:s}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";a();let d=new Blob(o,{type:c});o=[];try{let{text:u}=await e(d,c);u&&i(u,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function Lp(){for(let e of Ap)if(MediaRecorder.isTypeSupported(e))return e}var Ue=P.cssPrefix,Ot=W.scope("composer");function nn(e){return e.reduce((t,n)=>t+n.size,0)}var Op={arrowUp:fl,paperPlane:pl,send:ml,chevron:tn};function Ql({options:e,transport:t,feedback:n,bus:o,isStreaming:a,operatorRequestEnabled:i,controlMode:l,onRequestOperator:s,onSend:c,onStop:d,attachApiRef:u}){let m=e.strings,[_,h]=T(""),[f,b]=T([]),[g,x]=T(!1),C=F(null),v=F(null),S=e.features.fileUpload,U=e.features.voice,[te,j]=T(()=>ha(U,e.locale,(O,G)=>t.transcribe(O,G)));E(()=>{g||U==="disabled"||j(ha(U,e.locale,(O,G)=>t.transcribe(O,G)))},[e.locale,U,t,g]),E(()=>{let O=C.current;if(!O)return;let G=O.getRootNode(),Z="activeElement"in G?G.activeElement:null;Z&&O.closest(`.${Ue}-panel`)?.contains(Z)||O.focus({preventScroll:!0})},[]),E(()=>{let O=C.current;if(!O)return;if(_.length===0){O.style.height="";return}O.style.height="auto";let G=parseFloat(getComputedStyle(O).fontSize)*.7,Z=Math.min(O.scrollHeight,160);O.style.height=`${Z<40+G?40:Z}px`},[_]);let ie=F(f);ie.current=f,E(()=>()=>ie.current.forEach(ma),[]),E(()=>{if(u)return u.current={attachFromDrop:O=>{let G=Go(O,ie.current,e.attachments);G.accepted.length!==0&&(Ot.info("attach (drop)",{count:G.accepted.length,totalBytes:nn(G.accepted)}),o.emit("attach",{count:G.accepted.length,totalBytes:nn(G.accepted)}),b(Z=>[...Z,...G.accepted]))},fill:O=>{h(O);let G=C.current;G&&(G.focus({preventScroll:!0}),requestAnimationFrame(()=>G.setSelectionRange(G.value.length,G.value.length)))}},()=>{u.current&&(u.current=null)}},[u,e.attachments]),E(()=>{let O=C.current;if(!O)return;let G=O.closest(`.${Ue}-panel`);if(!G)return;let Z=Re=>{let De=Re.clipboardData;if(!De)return;let Xe=Re.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(Xe&&Xe!==O)return;if(S){let xe=Go(De.items,ie.current,e.attachments);if(xe.accepted.length>0){Re.preventDefault(),Ot.info("attach (paste)",{count:xe.accepted.length,totalBytes:nn(xe.accepted)}),o.emit("attach",{count:xe.accepted.length,totalBytes:nn(xe.accepted)}),b(Se=>[...Se,...xe.accepted]);return}}if(Xe===O)return;let Ve=De.getData("text/plain");Ve&&(Re.preventDefault(),h(xe=>xe+Ve),O.focus())};return G.addEventListener("paste",Z),()=>G.removeEventListener("paste",Z)},[S,e.attachments,Ue]);let se=()=>{let O=_.trim();!O&&f.length===0||a||(c(O,f),h(""),b([]))},N=O=>{O.key!=="Enter"||O.shiftKey||O.isComposing||(O.preventDefault(),a?d():se())},I=O=>{let G=O.target,Z=Go(G.files,f,e.attachments);Z.accepted.length>0&&(Ot.info("attach (file picker)",{count:Z.accepted.length,totalBytes:nn(Z.accepted)}),o.emit("attach",{count:Z.accepted.length,totalBytes:nn(Z.accepted)}),b(Re=>[...Re,...Z.accepted])),G.value=""},ne=O=>{Ot.info("removeAttachment",{id:O}),o.emit("removeAttachment",{id:O}),b(G=>{let Z=G.find(Re=>Re.id===O);return Z&&ma(Z),G.filter(Re=>Re.id!==O)})},$=F(null),Be=()=>{if(te.isSupported){if(g){let O=$.current?Date.now()-$.current:0;Ot.info("voiceStop",{durationMs:O}),o.emit("voiceStop",{durationMs:O}),te.stop(),x(!1),n.play("voiceStop"),$.current=null;return}$.current=Date.now(),Ot.info("voiceStart"),o.emit("voiceStart",void 0),x(!0),n.play("voiceStart"),te.start((O,G)=>h(Z=>G?`${Z}${O} `:Z),()=>{if(x(!1),$.current){let O=Date.now()-$.current;Ot.debug("voiceStop (auto)",{durationMs:O}),o.emit("voiceStop",{durationMs:O}),$.current=null}})}},Ne=Op[e.composer.sendButton.icon];return r("div",{class:`${Ue}-composer`,"data-testid":w.composer,children:[f.length>0?r("div",{class:`${Ue}-attachments`,children:f.map(O=>r(Jl,{attachment:O,onRemove:()=>ne(O.id)},O.id))}):null,r("div",{class:`${Ue}-composer-row`,children:[r("div",{class:`${Ue}-composer-actions`,children:[S?r("button",{type:"button",class:`${Ue}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":m.attach,"data-testid":w.composerAttach,children:r(hl,{})}):null,te.isSupported?r("button",{type:"button",class:`${Ue}-icon-btn`,onClick:Be,"aria-label":g?m.micStop:m.micStart,"aria-pressed":g,"data-recording":g?"true":void 0,"data-testid":w.composerVoice,children:r(vl,{})}):null,i&&l==="ai-agent"&&s?r("button",{type:"button",class:`${Ue}-icon-btn`,onClick:s,"aria-label":m.talkToOperator,title:m.talkToOperator,"data-testid":w.operatorRequest,children:r(ua,{})}):null]}),r("textarea",{ref:C,class:`${Ue}-textarea`,rows:1,value:_,placeholder:m.composerPlaceholder,onInput:O=>h(O.target.value),onKeyDown:N,"aria-label":m.composerPlaceholder,"data-testid":w.composerInput}),a?r("button",{type:"button",class:`${Ue}-send`,onClick:d,"aria-label":m.stop,"data-testid":w.composerStop,children:r(gl,{})}):r("button",{type:"button",class:`${Ue}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:se,disabled:!_.trim()&&f.length===0,"aria-label":m.send,"data-testid":w.composerSend,children:r(Ne,{})})]}),r("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:I,class:`${Ue}-sr-only`,"data-testid":w.composerFileInput})]})}var Np=P.cssPrefix;function Zl({visible:e,strings:t}){return e?r("div",{class:`${Np}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function jo({containerRef:e,onDrop:t}){let[n,o]=T(!1);return E(()=>{let a=e.current;if(!a)return;let i=0,l=u=>{i+=1,u.dataTransfer?.types.includes("Files")&&(u.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=u=>{u.dataTransfer?.types.includes("Files")&&u.preventDefault()},d=u=>{i=0,o(!1),u.dataTransfer&&(u.preventDefault(),t(u.dataTransfer.items))};return a.addEventListener("dragenter",l),a.addEventListener("dragleave",s),a.addEventListener("dragover",c),a.addEventListener("drop",d),()=>{a.removeEventListener("dragenter",l),a.removeEventListener("dragleave",s),a.removeEventListener("dragover",c),a.removeEventListener("drop",d)}},[e,t]),{visible:n}}function ec({itemCount:e,initialFocusIndex:t}){let[n,o]=T(!1),a=F(null),i=F(null),[l,s]=T(-1),c=D(()=>{o(!1),s(-1),a.current?.focus()},[]),d=D(()=>o(_=>!_),[]);E(()=>{if(!n)return;let _=h=>{let f=i.current,b=a.current;if(!f||!b)return;let g=h.composedPath();g.includes(f)||g.includes(b)||(o(!1),s(-1))};return document.addEventListener("click",_,!0),()=>document.removeEventListener("click",_,!0)},[n]),E(()=>{if(!n||e===0)return;let _=t?.()??0,h=_<0||_>=e?0:_;s(h)},[n,e,t]),E(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=D(_=>{(_.key==="ArrowDown"||_.key==="Enter"||_.key===" ")&&(_.preventDefault(),o(!0))},[]),m=D(_=>{if(e!==0)switch(_.key){case"Escape":_.preventDefault(),c();return;case"ArrowDown":_.preventDefault(),s(h=>(h+1)%e);return;case"ArrowUp":_.preventDefault(),s(h=>(h-1+e)%e);return;case"Home":_.preventDefault(),s(0);return;case"End":_.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:u,onMenuKey:m}}function tc({items:e,triggerLabel:t}){let n=P.cssPrefix,o=ec({itemCount:e.length}),a=s=>{s.disabled||(s.onSelect?.(),s.keepOpen||o.close())},i=(s,c)=>s.onSelectValue?.(c),l=(s,c)=>{let d=c.segments;if(!d?.length)return;let u=Math.max(0,d.findIndex(_=>_.value===c.value)),m=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")m=(u+1)%d.length;else if(s.key==="ArrowLeft")m=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[m].value)};return r("div",{class:`${n}-menu-wrap`,children:[r("button",{ref:o.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":o.open,title:t,onClick:o.toggle,onKeyDown:o.onTriggerKey,children:r(kl,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?r("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":s.label,tabIndex:-1,onKeyDown:c=>l(c,s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),r("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return r("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${w.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>a(s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(At,{})}):null]},s.id))}):null]})}var va=P.cssPrefix;function Dp(e){let t=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)").matches:!0;return e==="auto"?t?"light":"dark":t?e==="light"?"dark":"auto":e==="dark"?"light":"auto"}var $p={normal:"large",large:"small",small:"normal"};function Fp(e){return e==="light"?r(Dl,{}):e==="dark"?r($l,{}):r(Fl,{})}function Bp(e){return(e.split("-")[0]??e).toUpperCase()}function nt({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:u,onLocaleChange:m,onThemeChange:_,onTextSizeChange:h}=e,f=n.strings,b=n.mode,g=t==="chat",x=J(()=>a.mutedSig.value).value,C=new Set(n.actions),v=$=>C.has($),S=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,U=$=>S?!1:$n($,b,o),te=n.themeMode,j={auto:f.themeAuto,light:f.themeLight,dark:f.themeDark},ie=n.textSize,se={small:f.textSizeSmall,normal:f.textSizeNormal,large:f.textSizeLarge},N=[];if(g&&v("clear")&&N.push({id:"clear",icon:r(Al,{}),label:f.newConversation,onSelect:l}),v("expand")&&U("expand")){let $=o==="expanded";N.push({id:"expand",icon:$?r(yl,{}):r(bl,{}),label:$?f.collapse:f.expand,type:"switch",on:$,onSelect:s})}if(v("fullscreen")&&U("fullscreen")){let $=o==="fullscreen";N.push({id:"fullscreen",icon:$?r(xl,{}):r(Pl,{}),label:$?f.exitFullscreen:f.fullscreen,type:"switch",on:$,onSelect:c})}g&&v("sound")&&N.push({id:"sound",icon:x?r(Cl,{}):r(wl,{}),label:x?f.soundOff:f.soundOn,type:"switch",on:!x,onSelect:d}),v("theme")&&N.push({id:"theme",icon:Fp(te),label:`${f.theme}: ${j[te]}`,onSelect:()=>_(Dp(te)),keepOpen:!0}),v("textSize")&&N.push({id:"textSize",icon:r(El,{}),label:`${f.textSize}: ${se[ie]}`,onSelect:()=>h($p[ie]),keepOpen:!0}),v("language")&&n.availableLocales.length>1&&N.push({id:"language",icon:r(Il,{}),label:f.language,segments:n.availableLocales.map($=>({value:$,label:Bp($),lang:$})),value:n.locale,onSelectValue:m});let I=!!i&&Wo(b,o,n.actions),ne=g&&v("history");return r("div",{class:`${va}-header-actions`,children:[ne?r("button",{type:"button",class:`${va}-icon-btn`,onClick:u,"aria-label":f.history,title:f.history,"data-testid":w.actionHistory,children:r(Rl,{})}):null,N.length>0?r(tc,{items:N,triggerLabel:f.moreActions}):null,I?r("button",{type:"button",class:`${va}-icon-btn`,onClick:i,"aria-label":f.close,title:f.close,"data-testid":w.actionClose,children:r(tt,{})}):null]})}var Hp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,zp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Up=/^[+]?[\d\s().-]{6,}$/;function on(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function qp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function Wp(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=qp(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?on(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?on(n.formChooseAtMost,{max:a.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!Hp.test(i))return n.formInvalidEmail;break;case"url":if(!zp.test(i))return n.formInvalidUrl;break;case"tel":if(!Up.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(a?.min!=null&&l<a.min)return on(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return on(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return on(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return on(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function nc(e,t,n){let o={};for(let a of e){let i=Wp(a,t[a.name],n);i&&(o[a.name]=i)}return o}function oc(e){let t={};for(let[n,o]of Object.entries(e)){let a=Array.isArray(o)?o.join(", "):o;a&&a.trim()&&(t[n]=a.trim())}return t}var de=P.cssPrefix,Xo="__other__";function Bn({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:u,fieldTypeLabels:m,rootTestId:_,submitTestId:h,skipTestId:f}){let[b,g]=T(()=>({...jp(e),...d})),[x,C]=T({}),[v,S]=T({}),U=N=>{v[N]&&S(I=>({...I,[N]:""}))},te=(N,I)=>{g(ne=>({...ne,[N]:I})),U(N)},j=(N,I)=>{C(ne=>({...ne,[N]:I})),U(N)},ie=N=>{if(N.preventDefault(),c)return;let I=Xp(e,b,x),ne=nc(e,I,t);if(Object.keys(ne).length>0){S(ne);return}o(oc(I))},se=N=>{!s||N.key!=="Enter"||N.shiftKey||N.isComposing||N.target?.tagName==="TEXTAREA"&&ie(N)};return r("form",{class:`${de}-form`,onSubmit:ie,onKeyDown:se,"data-testid":_,noValidate:!0,children:[e.map(N=>r(Vp,{field:N,value:b[N.name],otherText:x[N.name]??"",error:v[N.name],disabled:c,typeLabel:m?.[N.name],strings:t,onChange:I=>te(N.name,I),onOtherChange:I=>j(N.name,I)},N.name)),u?null:r("div",{class:`${de}-form-actions`,children:[l?r("span",{class:`${de}-form-hint`,children:l}):null,a&&i?r("button",{type:"button",class:`${de}-form-skip`,onClick:i,disabled:c,"data-testid":f,children:a}):null,r("button",{type:"submit",class:`${de}-form-submit`,disabled:c,"data-testid":h,children:n})]})]})}function Vp({field:e,value:t,otherText:n,error:o,disabled:a,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=Ce(w.formField,e.name),u=Kp({field:e,value:t,otherText:n,disabled:a,strings:l,onChange:s,onOtherChange:c,fieldTid:d});return r("label",{class:`${de}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${de}-field-head`,children:[r("span",{class:`${de}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${de}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?r("span",{class:`${de}-field-type`,children:i}):null]}),u,e.validationHint&&!o?r("span",{class:`${de}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${de}-field-error`,role:"alert",children:o}):null]})}function Kp(e){let{field:t,value:n,otherText:o,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return r("textarea",{class:`${de}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c});case"select":return r("select",{class:`${de}-field-input`,value:d,disabled:a,onChange:u=>l(u.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(u=>r("option",{value:u.value,children:u.label??u.value},u.value))]});case"radio":{let u=t.allowOther&&d===Xo;return r("div",{class:`${de}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(m=>r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===m.value,disabled:a,onChange:()=>l(m.value)}),r("span",{children:m.label??m.value})]},m.value)),t.allowOther?r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===Xo,disabled:a,onChange:()=>l(Xo)}),r("span",{children:i.formOther})]}):null,u?r("input",{class:`${de}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:m=>s(m.target.value)}):null]})}case"checkbox":return r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:u=>l(u.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let u=Array.isArray(n)?n:[],m=(_,h)=>l(h?[...u,_]:u.filter(f=>f!==_));return r("div",{class:`${de}-field-choices`,"data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(_.value),disabled:a,onChange:h=>m(_.value,h.target.checked)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${de}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}default:return r("input",{class:`${de}-field-input`,type:Gp(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function Gp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function jp(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(o=>o.trim()).filter(Boolean):n.defaultValue);return t}function Xp(e,t,n){let o={...t};for(let a of e){let i=n[a.name]?.trim();if(a.type==="radio"&&a.allowOther&&t[a.name]===Xo)o[a.name]=i??"";else if(a.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[a.name])?t[a.name]:[];o[a.name]=[...s,...l]}}return o}var ot=P.cssPrefix;function ba({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${ot}-form-gate`,"data-testid":w.formGate,children:[e.title?r("h3",{class:`${ot}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${ot}-form-gate-desc`,children:e.description}):null,r(Bn,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?o:void 0,submitTestId:w.formSubmit,skipTestId:w.formSkip})]})}function rc({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(ee,{children:[r("span",{children:e.title}),r("span",{class:`${ot}-sr-only`,children:a})]}):r("span",{children:a}),l=e.form?.reviewable??!1,s=!o&&l&&e.values&&Object.keys(e.values).length>0?e.values:null;if(s){let c=d=>e.form?.fields.find(u=>u.name===d)?.label??d;return r("details",{class:`${ot}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,children:[r("summary",{class:`${ot}-form-done-summary`,"data-testid":w.formDoneToggle,children:[r(At,{}),i,r(tn,{})]}),r("dl",{class:`${ot}-form-answers`,"data-testid":w.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${ot}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${ot}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,role:"status",children:[o?r(Tl,{}):r(At,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${ot}-form-done-fill`,"data-testid":w.formFill,onClick:n,children:t.formFillOut}):null]})}function Qp(e,t){for(var n in t)e[n]=t[n];return e}function Pa(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function ac(e,t){this.props=e,this.context=t}function pc(e,t){function n(a){var i=this.props.ref;return i!=a.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,a)||i!=a.ref:Pa(this.props,a)}function o(a){return this.shouldComponentUpdate=n,lt(e,a)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o}(ac.prototype=new $e).isPureReactComponent=!0,ac.prototype.shouldComponentUpdate=function(e,t){return Pa(this.props,e)||Pa(this.state,t)};var ic=z.__b;z.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ic&&ic(e)};var jb=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Zp=z.__e;z.__e=function(e,t,n,o){if(e.then){for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),a.__c(e,t)}Zp(e,t,n,o)};var sc=z.unmount;function fc(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=Qp({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return fc(o,t,n)})),e}function mc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return mc(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ya(){this.__u=0,this.o=null,this.__b=null}function gc(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Yo(){this.i=null,this.l=null}z.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),sc&&sc(e)},(ya.prototype=new $e).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var a=gc(o.__v),i=!1,l=function(){i||o.__z||(i=!0,n.__R=null,a?a(c):c())};n.__R=l;var s=n.__P;n.__P=null;var c=function(){if(!--o.__u){if(o.state.__a){var d=o.state.__a;o.__v.__k[0]=mc(d,d.__c.__P,d.__c.__O)}var u;for(o.setState({__a:o.__b=null});u=o.o.pop();)u.__P=s,u.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},ya.prototype.componentWillUnmount=function(){this.o=[]},ya.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=fc(this.__b,n,o.__O=o.__P)}this.__b=null}var a=t.__a&&lt(ee,null,e.fallback);return a&&(a.__u&=-33),[lt(ee,null,t.__a?null:e.children),a]};var lc=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Yo.prototype=new $e).__a=function(e){var t=this,n=gc(t.__v),o=t.l.get(e);return o[0]++,function(a){var i=function(){t.props.revealOrder?(o.push(a),lc(t,e,o)):a()};n?n(i):i()}},Yo.prototype.render=function(e){this.i=null,this.l=new Map;var t=yn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Yo.prototype.componentDidUpdate=Yo.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){lc(e,n,t)})};var ef=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,tf=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,nf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,of=/[A-Z0-9]/g,rf=typeof document<"u",af=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};$e.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty($e.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var cc=z.event;z.event=function(e){return cc&&(e=cc(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var hc,sf={configurable:!0,get:function(){return this.class}},dc=z.vnode;z.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,a={},i=o.indexOf("-")==-1;for(var l in n){var s=n[l];if(!(l==="value"&&"defaultValue"in n&&s==null||rf&&l==="children"&&o==="noscript"||l==="class"||l==="className")){var c=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&s===!0?s="":c==="translate"&&s==="no"?s=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?l="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||af(n.type)?c==="onfocus"?l="onfocusin":c==="onblur"?l="onfocusout":nf.test(l)&&(l=c):c=l="oninput":i&&tf.test(l)?l=l.replace(of,"-$&").toLowerCase():s===null&&(s=void 0),c==="oninput"&&a[l=c]&&(l="oninputCapture"),a[l]=s}}o=="select"&&(a.multiple&&Array.isArray(a.value)&&(a.value=yn(n.children).forEach(function(d){d.props.selected=a.value.indexOf(d.props.value)!=-1})),a.defaultValue!=null&&(a.value=yn(n.children).forEach(function(d){d.props.selected=a.multiple?a.defaultValue.indexOf(d.props.value)!=-1:a.defaultValue==d.props.value}))),n.class&&!n.className?(a.class=n.class,Object.defineProperty(a,"className",sf)):n.className&&(a.class=a.className=n.className),t.props=a})(e),e.$$typeof=ef,dc&&dc(e)};var _c=z.__r;z.__r=function(e){_c&&_c(e),hc=e.__c};var uc=z.diffed;z.diffed=function(e){uc&&uc(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),hc=null};function vc(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var ka=1,yc=2,Pc=4,xc=8,Sc=16;function lf(e){switch(e){case ka:return"href";case yc:return"src";case Pc:return"class";case xc:return"checked";case Sc:return"start"}}var cf=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},df=cf;var bc=24;function Ca(e){let t=new Uint32Array(bc);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(bc),indent:"",indent_len:0,table_state:0}}function kc(e){e.pending.length>0&&Ie(e,`
12
- `)}function oe(e){e.text.length!==0&&(console.assert(e.len>0,"Never adding text to root"),e.renderer.add_text(e.renderer.data,e.text),e.text="")}function ve(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function ae(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&ve(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function _f(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Nt(e,t){for(e.fence_start=0;e.len>t;)ve(e)}function Jo(e,t){let n=0;for(let o=0;o<=e.len&&(t-=e.spaces[o],!(t<0));o+=1)switch(e.tokens[o]){case 9:case 10:case 20:case 25:n=o;break}for(;e.len>n;)ve(e);return t}function xa(e,t){let n=-1,o=-1;for(let a=e.blockquote_idx+1;a<=e.len;a+=1)if(e.tokens[a]===25){if(e.indent_len<e.spaces[a]){o=-1;break}o=a}else e.tokens[a]===t&&(n=a);return o===-1?n===-1?(Nt(e,e.blockquote_idx),ae(e,t),!0):(Nt(e,n),!1):(Nt(e,o),ae(e,t),!0)}function Sa(e,t){ae(e,25),e.spaces[e.len]=e.indent_len+t,ut(e),e.token=103}function ut(e){e.indent="",e.indent_len=0,e.pending=""}function wa(e){switch(e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return!0;default:return!1}}function uf(e){switch(e){case 32:case 58:case 59:case 41:case 44:case 33:case 46:case 63:case 93:case 10:return!0;default:return!1}}function pf(e){return wa(e)||uf(e)}function Ie(e,t){for(let n of t){if(e.token===101){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let a=Jo(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],a>0&&Ie(e," ".repeat(a))}let o=e.pending+n;switch(e.token){case 21:case 1:case 20:case 24:case 23:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
13
- `:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){ve(e),ut(e),e.pending=n;continue}Nt(e,e.blockquote_idx),ut(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=o;continue}break;case" ":Jo(e,e.indent_len),ae(e,df(e.pending.length)),ut(e);continue}break;case">":{let i=_f(e,20,e.blockquote_idx+1);i===-1?(Nt(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,ae(e,20)):e.blockquote_idx=i,ut(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=o;continue;case" ":e.pending=o;continue;case`
14
- `:if(e.hr_chars<3)break;Jo(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),ut(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){xa(e,23),Sa(e,2),Ie(e,o.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=o,e.fence_start=o.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=o,e.fence_start=o.length):(ae(e,2),ut(e),e.fence_start=0,Ie(e,o));continue;case`
15
- `:{Jo(e,e.indent_len),ae(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,Pc,e.pending.slice(e.fence_start)),ut(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;xa(e,23),Sa(e,2);continue;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(e.pending[e.pending.length-1]==="."){if(n!==" ")break;xa(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,Sc,e.pending.slice(0,-1)),Sa(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||wa(i)){e.pending=o;continue}}break;case"|":Nt(e,e.blockquote_idx),ae(e,27),ae(e,28),e.pending="",Ie(e,n);continue}let a=o;if(e.token===21)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let i=0;for(;i<4;i+=1)if(e.indent[i]===" "){i=i+1;break}a=e.indent.slice(i)+o,ae(e,9)}else ae(e,2);ut(e),Ie(e,a);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;case`
16
- `:e.table_state=2,e.pending="";continue;default:ve(e),e.table_state=0;break}else switch(e.pending){case"|":ae(e,28),e.pending="",Ie(e,n);continue;case`
17
- `:ve(e),e.pending="",e.table_state=0,Ie(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":ae(e,29),ve(e),e.pending="",Ie(e,n);continue;case`
18
- `:ve(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Ie(e,n);continue;default:ae(e,29),Ie(e,n);continue}break;case 29:if(e.pending==="|"){oe(e),ve(e),e.pending="",Ie(e,n);continue}break;case 9:switch(o){case`
11
+ ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(t==="[DONE]")return"done";if(!t)return null;try{let o=JSON.parse(t);return zs.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return zs.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function Du(e){let t=new TextEncoder().encode(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Us=e=>e&&Object.keys(e).length>0?e:void 0;function qs(e,t){let n=Us(e),o=Us(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),Du(JSON.stringify(a))}function To(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function $u(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Ws(e){return e.startsWith("tool-")?e.slice(5):e}var Fe={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",cancelRequestOperator:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Vs="context";function vt(e){let t=e??{},n=t.controlMode;return{controlMode:n==="awaiting_operator"||n==="operator"?n:"ai-agent",assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function Ro(e){let t=e?.suggestions;if(!Array.isArray(t))return[];let n=[];for(let o of t){if(!o||typeof o!="object")continue;let{id:a,label:i,text:l}=o;typeof i!="string"||!i||n.push({id:typeof a=="string"&&a?a:`s${n.length}`,label:i,text:typeof l=="string"&&l?l:i})}return n}function oa(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:Hu(i),role:i.role,createdAt:i.createdAt!==void 0?new Date(i.createdAt).toISOString():void 0})),n={messages:t,conversationId:e.conversationId,trigger:e.trigger??"submit-message"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let a=e.tools?.map(Bu).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function Fu(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function Bu(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function Hu(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&Fu(n)){let o={type:$u(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(o.input=n.input),n.output!==void 0&&(o.output=n.output),n.error!==void 0&&(o.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(o.approval=n.approval),t.push(o)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var Y=W.scope("transport"),zu=6e4,Uu=1e4,Ks=3,qu=400,Wu=new Set([408,425,429,500,502,503,504]);function Gs(e){return qu*2**e+Math.floor(Math.random()*250)}function Vu(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}var Io=class{constructor(t){K(this,"ttlMs",t);K(this,"map",new Map)}getOrFetch(t,n){let o=this.map.get(t);if(o&&Date.now()-o.at<this.ttlMs)return o.result;let a={at:Date.now(),result:n().then(i=>(a.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,a),a.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&Date.now()-n.at<this.ttlMs)return n.value}clear(){this.map.clear()}},Ao=class{constructor(t){K(this,"opts",t);K(this,"visitorId");K(this,"conversationId");K(this,"userContext");K(this,"pageContext");K(this,"locale");K(this,"conversationsCache",new Io(Uu));K(this,"loadConversationInflight",new Map);K(this,"contentCache",new Io(zu))}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:qt};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=qs(this.userContext,this.pageContext);return n&&(t[Vs]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,o]of Object.entries(this.envelope()))t.append(n,o);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[o,a]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,a);return n.toString()}async handshake(t){Y.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(Fe.handshake,t,"handshake");return Y.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),Gu(n)||Y.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t){Y.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return Y.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){Y.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${Ku(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return Y.debug("transcribe \u2190",{textLen:a.text.length}),a}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={}){return this.conversationsCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchConversations(t))}async fetchConversations(t){let n=new URL(this.url(Fe.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),Y.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listConversations"),a=o.conversations??[];return Y.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a,nextCursor:o.nextCursor}}async loadConversation(t){let n=this.loadConversationInflight.get(t);if(n)return n;let o=this.loadConversationDirect(t).finally(()=>this.loadConversationInflight.delete(t));return this.loadConversationInflight.set(t,o),o}async loadConversationDirect(t){let n=new URL(this.url(Fe.listMessages));n.searchParams.set("conversationId",t),Y.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return Y.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:a.length,hasSuggestions:!!o.suggestions}),{...o,messages:a,canContinue:o.canContinue??!0}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),Y.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(Fe.markRead,{conversationId:t},"markRead")}catch(n){Y.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){Y.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Fe.requestOperator,{},"requestOperator")).controlState}catch(t){Y.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelRequestOperator(){if(!(!this.visitorId||!this.conversationId)){Y.debug("cancelRequestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Fe.cancelRequestOperator,{},"cancelRequestOperator")).controlState}catch(t){Y.debug("cancelRequestOperator failed (non-fatal)",{err:t});return}}}listContent(t={}){return this.contentCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchContent(t))}async fetchContent(t){let n=new URL(this.dataUrl(Fe.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));Y.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>hi(i,this.locale));return Y.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(Fe.bootstrap));t&&n.searchParams.set("conversationId",t),Y.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return Y.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){Y.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(Fe.updateSettings,{userPrefs:t},"saveUserPrefs");return Y.debug("saveUserPrefs \u2190",{success:n.success}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??Fe.submitForm}async submitForm(t){Y.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){Y.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){Y.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(Fe.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){Y.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),Y.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageId:t.messageId,messageCount:t.messages.length,trigger:t.trigger,tools:t.data?.tools?.map(l=>l.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.conversationId),detach:()=>n.abort()}}async connectResumeStream(t){let n;try{n=await this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(o){return t.signal.aborted||Y.debug("resume-stream fetch failed \u2014 reconnecting",{err:o}),"held"}if(!n.ok||!n.body)return Y.debug("resume-stream \u2192 endpoint unavailable",{status:n.status}),"unavailable";if(!(n.headers.get("content-type")??"").includes("text/event-stream"))return Y.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";t.onConnected();try{for await(let{chunk:o}of na(n,t.signal)){if(t.signal.aborted)return"held";t.onChunk(o)}}catch(o){if(t.signal.aborted)return"held";Y.debug("resume-stream segment dropped \u2014 reconnecting",{err:o})}return"held"}async*runStream(t,n,o){try{yield*this.drain(this.openMessageStream(t,n.signal),o,n)}finally{n.abort()}}async*drain(t,n,o){try{for await(let a of t){if(o.signal.aborted)return;if(a.eventId){if(n.has(a.eventId))continue;n.add(a.eventId)}yield a}}catch(a){if(o.signal.aborted)return;if(a instanceof Xe&&a.status!==void 0)throw a;Y.debug("stream segment dropped",{err:a})}}cancelStream(t,n){t.signal.aborted||(Y.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(Fe.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>Y.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(Fe.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*na(o,n)}resumeUrl(){return this.withEnvelopeQuery(Fe.streamResume)}async postJson(t,n,o){let a=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],o);return this.assertOk(a,o)}async postForm(t,n,o){let a=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(a,o)}async getJson(t,n){let o=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(o,n)}async fetchWithRetry(t,n){for(let o=0;;o++){let[a,i]=t(),l;try{l=await this.fetchImpl(a,i)}catch(c){if(o>=Ks)throw new Xe(`${n} failed: network error`,"network",void 0,c);Y.debug("request network error \u2014 retrying",{label:n,attempt:o}),await kn(Gs(o));continue}if(l.ok||!Wu.has(l.status)||o>=Ks)return l;let s=Vu(l.headers)??Gs(o);Y.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await kn(s)}}async assertOk(t,n){if(!t.ok)throw new Xe(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function Ku(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function Gu(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function js(e,t){let n=e?[{kind:"text",id:"t0",textSig:q(e),doneSig:q(!0)}]:[];return{id:ze(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:q(n)}}function wn(){return{id:ze(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:q([])}}function Xs(e){let t=ze();return ju({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function ju(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,feedback:e.feedback,partsSig:q(e.parts.map(Zu))}}var Ys=new Set(["completed","failed","canceled"]);function Xu(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status!=null&&!Ys.has(e.status)?"streaming":"complete"}function Yu(e){let t=e.parts.map((o,a)=>o.type==="text"?{kind:"text",id:`${e.id}-t${a}`,textSig:q(o.text),doneSig:q(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${a}`,textSig:q(o.text),doneSig:q(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${a}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType}:o.type==="source-url"?{kind:"source",sourceId:o.sourceId,url:o.url,title:o.title}:o.type==="source-document"?{kind:"source",sourceId:o.sourceId,title:o.title,filename:o.filename,mediaType:o.mediaType}:o.type==="data-suggestions"?null:o.type.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:Ws(o.type),inputPartialSig:q(""),inputSig:q(o.input),outputSig:q(o.output),errorSig:q(o.errorText),stateSig:q(o.state),approvalSig:q(o.approval)}:null).filter(o=>o!==null),n=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:n?.type==="data-suggestions"?Ro(n.data):void 0,serverMessageId:e.id,createdAt:To(e.createdAt)??Date.now(),status:Xu(e),canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:q(t)}}function Ju(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function Qu(e){return e.role==="assistant"&&e.status!=null&&!Ys.has(e.status)&&Ju(e)}function Mo(e){let t=e.length-1;return e.filter((n,o)=>o===t||!Qu(n)).map(Yu)}function Js(e,t){return(!t&&e.at(-1)?.role==="assistant"?e.slice(0,-1):e).filter(o=>!o.ephemeral)}function aa(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,parts:e.partsSig.value.map(ep)}}function ct(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function Cn(e){return ct(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function Qs(e){return e.status!=="streaming"&&Cn(e)}function Zs(e,t){let n=t.filter(s=>!s.ephemeral&&(s.status==="streaming"||Cn(s))),o=new Map(n.filter(s=>s.serverMessageId!==void 0).map(s=>[s.serverMessageId,s])),a=new Set,i=e.map(s=>{let c=s.serverMessageId!==void 0?o.get(s.serverMessageId):void 0;return c===void 0||(a.add(s.serverMessageId),c.role!==s.role)?s:c.status==="streaming"||ct(c).length>=ct(s).length?c:(s.id=c.id,s)}),l=n.filter(s=>s.serverMessageId===void 0||!a.has(s.serverMessageId));return[...i,...l]}function el(e,t){let n=new Map(t.filter(s=>s.serverMessageId!==void 0).map(s=>[s.serverMessageId,s])),o=new Set(e.flatMap(s=>[s.serverMessageId,s.id].filter(c=>c!==void 0))),a=!1,i=e.map(s=>{if(s.serverMessageId===void 0)return s;let c=n.get(s.serverMessageId);return c!==void 0&&c.role===s.role&&ct(c).length>ct(s).length?(a=!0,c.id=s.id,c):s}),l=[...n.values()].filter(s=>!o.has(s.serverMessageId));return{messages:a||l.length?[...i,...l]:e,changed:a||l.length>0}}function dt(e){return e.role==="assistant"&&e.status!=="streaming"&&!Cn(e)}function tl(e){return e.canceled===!0&&dt(e)}function nl(e,t){return e.operatorRoutedTurn?dt(e)?"drop":"complete-operator-routed":t||dt(e)?"error":"complete"}function Zu(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:q(e.text),doneSig:q(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:q(e.inputPartial),inputSig:q(e.input),outputSig:q(e.output),errorSig:q(e.error),stateSig:q(e.state),approvalSig:q(e.approval)}:e}function ep(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var ol=W.scope("reducer"),Tn=class{constructor(t){K(this,"messagesSig",t);K(this,"active",null);K(this,"openTextParts",new Map);K(this,"partSeq",0);K(this,"resumeIgnore",!1)}attach(t){this.active=t,this.openTextParts.clear()}resetForReplay(t){t.partsSig.value=[],t.status="streaming",t.finishReason=void 0,t.errorText=void 0,t.suggestions=void 0,this.openTextParts.clear(),this.messagesSig.value=[...this.messagesSig.value]}detach(){this.active=null,this.openTextParts.clear()}applyResume(t,n=!1){if(t.type==="data-control-state"||t.type==="data-conversation-rebind")return null;if(t.type==="start"){let o=t.messageId,a=t.messageMetadata?.senderRole,i=o!==void 0?this.messagesSig.value.find(d=>d.serverMessageId===o||d.id===o):void 0;if(i!==void 0&&Qs(i)||a===void 0&&n)return this.resumeIgnore=!0,this.detach(),null;if(this.resumeIgnore=!1,i!==void 0)return this.resetForReplay(i),this.attach(i),this.apply(t),null;let c=wn();return this.attach(c),this.messagesSig.value=[...this.messagesSig.value,c],this.apply(t),null}if(this.resumeIgnore||!this.active)return null;if(this.apply(t),t.type==="finish"||t.type==="error"){let o=this.active;return this.detach(),o}return null}ensureTextPart(t,n,o){let a=`${n}:${o}`,i=this.openTextParts.get(a);if(i)return i;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:q(""),doneSig:q(!1)};return this.openTextParts.set(a,l),En(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let o=t.messageMetadata;o?.senderRole==="operator"?(n.role="operator",o.operatorInitials&&(n.operatorInitials=o.operatorInitials)):o?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":En(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":ol.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":ol.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let o=this.ensureTextPart(n,"text",t.id);o.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let o=this.ensureTextPart(n,"reasoning",t.id);o.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":tp(n,t);return;case"file":En(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":rl(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":rl(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-notification":return;case"data-conversation-rebind":return;case"data-suggestions":n.suggestions=Ro(t.data);return;case"data-control-state":n.operatorRoutedTurn=!0;return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function Tt(e,t,n){let o=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(o)return o;let a={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:q(""),inputSig:q(void 0),outputSig:q(void 0),errorSig:q(void 0),stateSig:q("input-streaming"),approvalSig:q(void 0)};return En(e,a),a}function En(e,t){e.partsSig.value=[...e.partsSig.value,t]}function rl(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||En(e,t)}function tp(e,t){switch(t.type){case"tool-input-start":Tt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=Tt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Tt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=Tt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=Tt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Tt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Tt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function al(e){let t=1e3;for(;!e.signal.aborted;){let n,o="held";try{o=await e.connect(()=>{n=e.now(),e.backfill()})}catch{}if(e.signal.aborted||o==="unavailable")return;n!==void 0&&e.now()-n>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var il=W.scope("feedback:audio"),Lo=class{constructor(){K(this,"ctx",null);K(this,"master",null);K(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){il.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((l,s)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=l;let d=n.createGain(),u=a+s*i;d.gain.setValueAtTime(1e-4,u),d.gain.exponentialRampToValueAtTime(t.peakGain,u+.005),d.gain.exponentialRampToValueAtTime(1e-4,u+i),c.connect(d).connect(o),c.start(u),c.stop(u+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=await this.getBuffer(t);if(!a)return;let i=n.createBufferSource();i.buffer=a,i.connect(o),i.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let o=this.ctx,a=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>o.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(il.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var sl={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},ll={messageReceived:{notes:[880,1318.51],noteMs:90,type:"sine",peakGain:.45},messageSent:{notes:[1568],noteMs:60,type:"sine",peakGain:.25},error:{notes:[523.25,392],noteMs:120,type:"triangle",peakGain:.55},voiceStart:{notes:[1318.51],noteMs:50,type:"sine",peakGain:.3},voiceStop:{notes:[880],noteMs:50,type:"sine",peakGain:.3}};var bt=null,Oo=0;function np(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function op(){if(typeof document>"u")return null;let e=document.createElement("input");e.type="checkbox",e.setAttribute("switch",""),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.id=`__${P.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function cl(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(np())try{navigator.vibrate(e);return}catch{}if(bt||(bt=op()),!!bt)try{bt.label.click()}catch{}}}function dl(){Oo++;let e=!1;return()=>{e||(e=!0,Oo=Math.max(0,Oo-1),Oo===0&&bt&&(bt.input.remove(),bt.label.remove(),bt=null))}}var rp=W.scope("feedback"),ap=100,No=class{constructor(t,n){K(this,"mutedSig",q(!1));K(this,"audio",new Lo);K(this,"releaseHaptics");K(this,"sound");K(this,"haptics");K(this,"lastPlayed",new Map);K(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=dl(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<ap}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>rp.warn("audio play failed",{err:a,url:n}));return}let o=ll[t];o&&this.audio.playTone(o)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let o=n===!0||n===void 0?sl[t]:n;cl(o)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function Jt(e,t){return e instanceof Xe&&e.status===429?t.errorRateLimited:t.errorGeneric}var ip=0;function r(e,t,n,o,a,i){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ip,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return z.vnode&&z.vnode(d),d}var H={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Rn=`${P.cssPrefix}-icon-dir`,ia=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Ze=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),_l=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),ul=()=>r("svg",{...H,class:Rn,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),pl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),fl=()=>r("svg",{...H,class:Rn,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),Qt=()=>r("svg",{...H,class:Rn,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),ml=()=>r("svg",{...H,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),gl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),hl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),vl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),bl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),yl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),Pl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),xl=()=>r("svg",{...H,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),Sl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),kl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),wl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Cl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),r("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),El=()=>r("svg",{...H,class:Rn,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Rt=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),Tl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]}),Rl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M2 12h20"}),r("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),In=()=>r("svg",{...H,class:Rn,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Il=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),It=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),Al=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),sp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),sa=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),An=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),lp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),cp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),la=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),dp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),ca=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),Ml=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Ll=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Ol=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Mn=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),Nl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),Dl=()=>r("svg",{...H,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),$l=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),_p=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),up=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),pp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),fp=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),Fl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),r("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),Bl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),r("path",{d:"M7 10l4-7a2.5 2.5 0 0 1 2.5 2.5V8h5a2 2 0 0 1 2 2.3l-1.2 8A2 2 0 0 1 17.3 20H7"})]}),Hl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),r("path",{d:"M17 14l-4 7a2.5 2.5 0 0 1-2.5-2.5V16h-5a2 2 0 0 1-2-2.3l1.2-8A2 2 0 0 1 6.7 4H17"})]}),zl=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"3.5"}),r("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9l-2.1 2.1M7 17l-2.1 2.1"})]}),Ul=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Do=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),$o=()=>r("svg",{...H,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),ql={chat:ia,message:sa,bubbles:Mn,spark:sp,wand:lp,bot:cp,help:An,lifebuoy:dp,headset:la,search:_p,sparkles:up,concierge:pp,wave:fp};var A=P.cssPrefix,w={launcher:`${A}-launcher`,callout:`${A}-callout`,calloutDismiss:`${A}-callout-dismiss`,panel:`${A}-panel`,panelHeader:`${A}-panel-header`,resizeGrip:`${A}-resize-grip`,scrollToBottom:`${A}-scroll-to-bottom`,actionHistory:`${A}-action-history`,actionClose:`${A}-action-close`,langSegment:`${A}-lang-segment`,composer:`${A}-composer`,composerInput:`${A}-composer-input`,composerSend:`${A}-composer-send`,composerStop:`${A}-composer-stop`,composerAttach:`${A}-composer-attach`,composerFileInput:`${A}-composer-file-input`,composerVoice:`${A}-composer-voice`,attachmentChip:`${A}-attachment-chip`,attachmentRemove:`${A}-attachment-remove`,suggestion:`${A}-suggestion`,messageBubble:`${A}-message`,messageRetry:`${A}-message-retry`,messageFeedback:`${A}-message-feedback`,feedbackUp:`${A}-feedback-up`,feedbackDown:`${A}-feedback-down`,messageCopy:`${A}-message-copy`,historyPane:`${A}-history-pane`,historyBack:`${A}-history-back`,historyItem:`${A}-history-item`,sidebar:`${A}-sidebar`,sidebarToggle:`${A}-sidebar-toggle`,sidebarNewConversation:`${A}-sidebar-new-conversation`,sidebarItem:`${A}-sidebar-item`,messengerHome:`${A}-messenger-home`,modulesEmpty:`${A}-modules-empty`,tab:`${A}-tab`,tabBadge:`${A}-tab-badge`,homeView:`${A}-home-view`,homeGreeting:`${A}-home-greeting`,homeBrand:`${A}-home-brand`,backHeader:`${A}-back-header`,contentView:`${A}-content-view`,contentScroll:`${A}-content-scroll`,homeSearch:`${A}-home-search`,helpSearch:`${A}-help-search`,homeRecent:`${A}-home-recent`,homeContentRow:`${A}-home-content-row`,helpArticle:`${A}-help-article`,newsItem:`${A}-news-item`,formGate:`${A}-form-gate`,formDone:`${A}-form-done`,formDoneToggle:`${A}-form-done-toggle`,formAnswers:`${A}-form-answers`,formFill:`${A}-form-fill`,formSubmit:`${A}-form-submit`,formSkip:`${A}-form-skip`,formField:`${A}-form-field`,toolAskQuestions:`${A}-tool-ask-questions`,toolInputSubmit:`${A}-tool-input-submit`,toolInputSkip:`${A}-tool-input-skip`,toolApproval:`${A}-tool-approval`,toolApprove:`${A}-tool-approve`,toolReject:`${A}-tool-reject`,toolEdit:`${A}-tool-edit`,toolDecision:`${A}-tool-decision`,toolAskSummary:`${A}-ask-questions-summary`,toolAskOptions:`${A}-ask-questions-options-toggle`,toolCall:`${A}-tool-call`,source:`${A}-source`,operatorRequest:`${A}-operator-request`,operatorBanner:`${A}-operator-banner`,operatorCancelRequest:`${A}-operator-cancel-request`};function we(e,t){return`${e}-${t}`}var Fo=P.cssPrefix;function Wl({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${Fo}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":w.launcher,onClick:e,"aria-label":n.launcherOpen,children:[mp(t.icon),i?r("span",{class:`${Fo}-fab-label`,children:Le(n,t.label??"")}):null]})}function mp(e){let t=ql[e];return t?r(t,{}):r(gp,{source:e})}function gp({source:e}){return r("span",{ref:t=>{t&&hp(t,e)},"aria-hidden":"true"})}function hp(e,t){if(e.dataset.svgMounted!==t)try{let o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;o&&o.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(o,!0)),e.dataset.svgMounted=t)}catch{}}function Vl({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=T(!1);return E(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${Fo}-callout`,role:"status","data-shape":e.shape,"data-position":vp(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":w.callout,children:[r("span",{children:Le(n,e.text)}),r("button",{type:"button",class:`${Fo}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":w.calloutDismiss,children:r(Ze,{})})]}):null}function vp(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Bo({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=P.cssPrefix,s=F(null);if(E(()=>{if(!e)return;let f=e.style;t.minWidth&&f.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&f.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&f.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&f.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(f.setProperty(`--${l}-widget-w`,`${o.width}px`),f.setProperty(`--${l}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,o]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),u=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,m=f=>{if(!e)return;let b=f.currentTarget,g=e.getBoundingClientRect();s.current={pointerId:f.pointerId,startX:f.clientX,startY:f.clientY,startW:g.width,startH:g.height,dirX:d?-1:1,dirY:c?1:-1},b.setPointerCapture(f.pointerId),e.setAttribute("data-resizing",""),f.preventDefault()},_=f=>{let b=s.current;if(!b||f.pointerId!==b.pointerId||!e)return;let g=(f.clientX-b.startX)*b.dirX,x=(f.clientY-b.startY)*b.dirY;e.style.setProperty(`--${l}-widget-w`,`${b.startW+g}px`),e.style.setProperty(`--${l}-widget-h`,`${b.startH+x}px`)},h=f=>{let b=s.current;if(!b||f.pointerId!==b.pointerId||!e)return;f.currentTarget.releasePointerCapture(f.pointerId),e.removeAttribute("data-resizing");let g=e.getBoundingClientRect();a({width:Math.round(g.width),height:Math.round(g.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:m,onPointerMove:_,onPointerUp:h,onPointerCancel:h,"data-testid":w.resizeGrip,children:r(xl,{})})}var At=P.cssPrefix,bp=`.${At}-header, .${At}-back-header, .${At}-home-hero`,yp='button, a, input, textarea, select, [role="tab"], [contenteditable]',Kl=56;function Ho(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),a=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(bp)||d.closest(yp))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${At}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${At}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-Kl,maxY:(window.innerHeight+u.height)/2-Kl},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!a||c.pointerId!==a.id)return;let d=o(a.dx+c.clientX-a.x,a.maxX),u=o(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${At}-modal-dx`,`${d}px`),e.style.setProperty(`--${At}-modal-dy`,`${u}px`)},s=c=>{!a||c.pointerId!==a.id||(a=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",l),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}},[e,t])}function Ln(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function zo(e,t,n){return Ln("close",e,t)?n.includes("close"):!1}function Gl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Pp='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Uo(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Pp)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let a=o[0],i=o[o.length-1];if(!a||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===a?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),a.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function qo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var da=P.cssPrefix;function jl({agent:e,strings:t}){let n=e.status??"online",o=Le(t,e.name),a=e.title?Le(t,e.title):null;return r("div",{class:`${da}-agent`,children:[r("div",{class:`${da}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:qo(o)})}),r("div",{class:`${da}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var Xl=W.scope("attachments");function Wo(e,t,n){let o=Sp(e),a=[],i=[],l=Cp(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=xp(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(wp(d)),s+=d.size,c+=1}return(a.length||i.length)&&Xl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function _a(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Xl.debug("revokeObjectURL failed",{error:t})}}function xp(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Ep(e,a)?null:"mime"}function Sp(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:kp(t)).filter(t=>t!==null):[]}function kp(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function wp(e){return{file:e,id:ze(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Cp(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",o="*"]=t.split("/");return{kind:"mime",type:n,subtype:o}})}function Ep(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),a=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?a.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var On=P.cssPrefix;function Yl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${On}-attachment-chip`,title:e.name,"data-testid":we(w.attachmentChip,e.id),children:[n?r("img",{class:`${On}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${On}-attachment-thumb`,"aria-hidden":"true",children:r(Al,{})}),r("span",{class:`${On}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${On}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":we(w.attachmentRemove,e.id),children:r(Ze,{})})]})}var ua={isSupported:!1,start:()=>{},stop:()=>{}};function pa(e,t,n){return e==="disabled"?ua:e==="server"?Ap(n):Tp(t)}function Tp(e){let t=Rp();if(!t)return ua;let n=null;return{isSupported:!0,start(o,a){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let u=s.resultIndex;u<s.results.length;u++){let m=s.results[u];m&&(c+=m[0].transcript,m.isFinal&&(d=!0))}o(c,d)});let i=()=>{n=null,a()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function Rp(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Ip=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Ap(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ua;let t=null,n=null,o=[],a=()=>{for(let i of n?.getTracks()??[])i.stop();n=null};return{isSupported:!0,async start(i,l){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let s=Mp();t=new MediaRecorder(n,s?{mimeType:s}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";a();let d=new Blob(o,{type:c});o=[];try{let{text:u}=await e(d,c);u&&i(u,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function Mp(){for(let e of Ip)if(MediaRecorder.isTypeSupported(e))return e}var He=P.cssPrefix,Mt=W.scope("composer");function Zt(e){return e.reduce((t,n)=>t+n.size,0)}var Lp={arrowUp:pl,paperPlane:ul,send:fl,chevron:Qt};function Jl({options:e,transport:t,feedback:n,bus:o,isStreaming:a,operatorRequestEnabled:i,controlMode:l,onRequestOperator:s,onSend:c,onStop:d,attachApiRef:u}){let m=e.strings,[_,h]=T(""),[f,b]=T([]),[g,x]=T(!1),C=F(null),v=F(null),S=e.features.fileUpload,U=e.features.voice,[te,j]=T(()=>pa(U,e.locale,(O,G)=>t.transcribe(O,G)));E(()=>{g||U==="disabled"||j(pa(U,e.locale,(O,G)=>t.transcribe(O,G)))},[e.locale,U,t,g]),E(()=>{let O=C.current;if(!O)return;let G=O.getRootNode(),Z="activeElement"in G?G.activeElement:null;Z&&O.closest(`.${He}-panel`)?.contains(Z)||O.focus({preventScroll:!0})},[]),E(()=>{let O=C.current;if(!O)return;if(_.length===0){O.style.height="";return}O.style.height="auto";let G=parseFloat(getComputedStyle(O).fontSize)*.7,Z=Math.min(O.scrollHeight,160);O.style.height=`${Z<40+G?40:Z}px`},[_]);let ae=F(f);ae.current=f,E(()=>()=>ae.current.forEach(_a),[]),E(()=>{if(u)return u.current={attachFromDrop:O=>{let G=Wo(O,ae.current,e.attachments);G.accepted.length!==0&&(Mt.info("attach (drop)",{count:G.accepted.length,totalBytes:Zt(G.accepted)}),o.emit("attach",{count:G.accepted.length,totalBytes:Zt(G.accepted)}),b(Z=>[...Z,...G.accepted]))},fill:O=>{h(O);let G=C.current;G&&(G.focus({preventScroll:!0}),requestAnimationFrame(()=>G.setSelectionRange(G.value.length,G.value.length)))}},()=>{u.current&&(u.current=null)}},[u,e.attachments]),E(()=>{let O=C.current;if(!O)return;let G=O.closest(`.${He}-panel`);if(!G)return;let Z=Te=>{let De=Te.clipboardData;if(!De)return;let je=Te.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(je&&je!==O)return;if(S){let Pe=Wo(De.items,ae.current,e.attachments);if(Pe.accepted.length>0){Te.preventDefault(),Mt.info("attach (paste)",{count:Pe.accepted.length,totalBytes:Zt(Pe.accepted)}),o.emit("attach",{count:Pe.accepted.length,totalBytes:Zt(Pe.accepted)}),b(xe=>[...xe,...Pe.accepted]);return}}if(je===O)return;let qe=De.getData("text/plain");qe&&(Te.preventDefault(),h(Pe=>Pe+qe),O.focus())};return G.addEventListener("paste",Z),()=>G.removeEventListener("paste",Z)},[S,e.attachments,He]);let ie=()=>{let O=_.trim();!O&&f.length===0||a||(c(O,f),h(""),b([]))},N=O=>{O.key!=="Enter"||O.shiftKey||O.isComposing||(O.preventDefault(),a?d():ie())},I=O=>{let G=O.target,Z=Wo(G.files,f,e.attachments);Z.accepted.length>0&&(Mt.info("attach (file picker)",{count:Z.accepted.length,totalBytes:Zt(Z.accepted)}),o.emit("attach",{count:Z.accepted.length,totalBytes:Zt(Z.accepted)}),b(Te=>[...Te,...Z.accepted])),G.value=""},ne=O=>{Mt.info("removeAttachment",{id:O}),o.emit("removeAttachment",{id:O}),b(G=>{let Z=G.find(Te=>Te.id===O);return Z&&_a(Z),G.filter(Te=>Te.id!==O)})},$=F(null),Oe=()=>{if(te.isSupported){if(g){let O=$.current?Date.now()-$.current:0;Mt.info("voiceStop",{durationMs:O}),o.emit("voiceStop",{durationMs:O}),te.stop(),x(!1),n.play("voiceStop"),$.current=null;return}$.current=Date.now(),Mt.info("voiceStart"),o.emit("voiceStart",void 0),x(!0),n.play("voiceStart"),te.start((O,G)=>h(Z=>G?`${Z}${O} `:Z),()=>{if(x(!1),$.current){let O=Date.now()-$.current;Mt.debug("voiceStop (auto)",{durationMs:O}),o.emit("voiceStop",{durationMs:O}),$.current=null}})}},Ne=Lp[e.composer.sendButton.icon];return r("div",{class:`${He}-composer`,"data-testid":w.composer,children:[f.length>0?r("div",{class:`${He}-attachments`,children:f.map(O=>r(Yl,{attachment:O,onRemove:()=>ne(O.id)},O.id))}):null,r("div",{class:`${He}-composer-row`,children:[r("div",{class:`${He}-composer-actions`,children:[S?r("button",{type:"button",class:`${He}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":m.attach,"data-testid":w.composerAttach,children:r(gl,{})}):null,te.isSupported?r("button",{type:"button",class:`${He}-icon-btn`,onClick:Oe,"aria-label":g?m.micStop:m.micStart,"aria-pressed":g,"data-recording":g?"true":void 0,"data-testid":w.composerVoice,children:r(hl,{})}):null,i&&l==="ai-agent"&&s?r("button",{type:"button",class:`${He}-icon-btn`,onClick:s,"aria-label":m.talkToOperator,title:m.talkToOperator,"data-testid":w.operatorRequest,children:r(la,{})}):null]}),r("textarea",{ref:C,class:`${He}-textarea`,rows:1,value:_,placeholder:m.composerPlaceholder,onInput:O=>h(O.target.value),onKeyDown:N,"aria-label":m.composerPlaceholder,"data-testid":w.composerInput}),a?r("button",{type:"button",class:`${He}-send`,onClick:d,"aria-label":m.stop,"data-testid":w.composerStop,children:r(ml,{})}):r("button",{type:"button",class:`${He}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:ie,disabled:!_.trim()&&f.length===0,"aria-label":m.send,"data-testid":w.composerSend,children:r(Ne,{})})]}),r("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:I,class:`${He}-sr-only`,"data-testid":w.composerFileInput})]})}var Op=P.cssPrefix;function Ql({visible:e,strings:t}){return e?r("div",{class:`${Op}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Vo({containerRef:e,onDrop:t}){let[n,o]=T(!1);return E(()=>{let a=e.current;if(!a)return;let i=0,l=u=>{i+=1,u.dataTransfer?.types.includes("Files")&&(u.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=u=>{u.dataTransfer?.types.includes("Files")&&u.preventDefault()},d=u=>{i=0,o(!1),u.dataTransfer&&(u.preventDefault(),t(u.dataTransfer.items))};return a.addEventListener("dragenter",l),a.addEventListener("dragleave",s),a.addEventListener("dragover",c),a.addEventListener("drop",d),()=>{a.removeEventListener("dragenter",l),a.removeEventListener("dragleave",s),a.removeEventListener("dragover",c),a.removeEventListener("drop",d)}},[e,t]),{visible:n}}function Zl({itemCount:e,initialFocusIndex:t}){let[n,o]=T(!1),a=F(null),i=F(null),[l,s]=T(-1),c=D(()=>{o(!1),s(-1),a.current?.focus()},[]),d=D(()=>o(_=>!_),[]);E(()=>{if(!n)return;let _=h=>{let f=i.current,b=a.current;if(!f||!b)return;let g=h.composedPath();g.includes(f)||g.includes(b)||(o(!1),s(-1))};return document.addEventListener("click",_,!0),()=>document.removeEventListener("click",_,!0)},[n]),E(()=>{if(!n||e===0)return;let _=t?.()??0,h=_<0||_>=e?0:_;s(h)},[n,e,t]),E(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=D(_=>{(_.key==="ArrowDown"||_.key==="Enter"||_.key===" ")&&(_.preventDefault(),o(!0))},[]),m=D(_=>{if(e!==0)switch(_.key){case"Escape":_.preventDefault(),c();return;case"ArrowDown":_.preventDefault(),s(h=>(h+1)%e);return;case"ArrowUp":_.preventDefault(),s(h=>(h-1+e)%e);return;case"Home":_.preventDefault(),s(0);return;case"End":_.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:u,onMenuKey:m}}function ec({items:e,triggerLabel:t}){let n=P.cssPrefix,o=Zl({itemCount:e.length}),a=s=>{s.disabled||(s.onSelect?.(),s.keepOpen||o.close())},i=(s,c)=>s.onSelectValue?.(c),l=(s,c)=>{let d=c.segments;if(!d?.length)return;let u=Math.max(0,d.findIndex(_=>_.value===c.value)),m=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")m=(u+1)%d.length;else if(s.key==="ArrowLeft")m=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[m].value)};return r("div",{class:`${n}-menu-wrap`,children:[r("button",{ref:o.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":o.open,title:t,onClick:o.toggle,onKeyDown:o.onTriggerKey,children:r(Sl,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?r("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":s.label,tabIndex:-1,onKeyDown:c=>l(c,s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),r("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return r("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${w.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>a(s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(Rt,{})}):null]},s.id))}):null]})}var fa=P.cssPrefix;function Np(e){let t=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)").matches:!0;return e==="auto"?t?"light":"dark":t?e==="light"?"dark":"auto":e==="dark"?"light":"auto"}var Dp={normal:"large",large:"small",small:"normal"};function $p(e){return e==="light"?r(Nl,{}):e==="dark"?r(Dl,{}):r($l,{})}function Fp(e){return(e.split("-")[0]??e).toUpperCase()}function et({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:u,onLocaleChange:m,onThemeChange:_,onTextSizeChange:h}=e,f=n.strings,b=n.mode,g=t==="chat",x=J(()=>a.mutedSig.value).value,C=new Set(n.actions),v=$=>C.has($),S=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,U=$=>S?!1:Ln($,b,o),te=n.themeMode,j={auto:f.themeAuto,light:f.themeLight,dark:f.themeDark},ae=n.textSize,ie={small:f.textSizeSmall,normal:f.textSizeNormal,large:f.textSizeLarge},N=[];if(g&&v("clear")&&N.push({id:"clear",icon:r(Il,{}),label:f.newConversation,onSelect:l}),v("expand")&&U("expand")){let $=o==="expanded";N.push({id:"expand",icon:$?r(bl,{}):r(vl,{}),label:$?f.collapse:f.expand,type:"switch",on:$,onSelect:s})}if(v("fullscreen")&&U("fullscreen")){let $=o==="fullscreen";N.push({id:"fullscreen",icon:$?r(Pl,{}):r(yl,{}),label:$?f.exitFullscreen:f.fullscreen,type:"switch",on:$,onSelect:c})}g&&v("sound")&&N.push({id:"sound",icon:x?r(wl,{}):r(kl,{}),label:x?f.soundOff:f.soundOn,type:"switch",on:!x,onSelect:d}),v("theme")&&N.push({id:"theme",icon:$p(te),label:`${f.theme}: ${j[te]}`,onSelect:()=>_(Np(te)),keepOpen:!0}),v("textSize")&&N.push({id:"textSize",icon:r(Cl,{}),label:`${f.textSize}: ${ie[ae]}`,onSelect:()=>h(Dp[ae]),keepOpen:!0}),v("language")&&n.availableLocales.length>1&&N.push({id:"language",icon:r(Rl,{}),label:f.language,segments:n.availableLocales.map($=>({value:$,label:Fp($),lang:$})),value:n.locale,onSelectValue:m});let I=!!i&&zo(b,o,n.actions),ne=g&&v("history");return r("div",{class:`${fa}-header-actions`,children:[ne?r("button",{type:"button",class:`${fa}-icon-btn`,onClick:u,"aria-label":f.history,title:f.history,"data-testid":w.actionHistory,children:r(Tl,{})}):null,N.length>0?r(ec,{items:N,triggerLabel:f.moreActions}):null,I?r("button",{type:"button",class:`${fa}-icon-btn`,onClick:i,"aria-label":f.close,title:f.close,"data-testid":w.actionClose,children:r(Ze,{})}):null]})}var Bp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Hp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,zp=/^[+]?[\d\s().-]{6,}$/;function en(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function Up(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function qp(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=Up(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?en(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?en(n.formChooseAtMost,{max:a.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!Bp.test(i))return n.formInvalidEmail;break;case"url":if(!Hp.test(i))return n.formInvalidUrl;break;case"tel":if(!zp.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(a?.min!=null&&l<a.min)return en(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return en(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return en(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return en(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function tc(e,t,n){let o={};for(let a of e){let i=qp(a,t[a.name],n);i&&(o[a.name]=i)}return o}function nc(e){let t={};for(let[n,o]of Object.entries(e)){let a=Array.isArray(o)?o.join(", "):o;a&&a.trim()&&(t[n]=a.trim())}return t}var ce=P.cssPrefix,Ko="__other__";function Nn({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:u,fieldTypeLabels:m,rootTestId:_,submitTestId:h,skipTestId:f}){let[b,g]=T(()=>({...Gp(e),...d})),[x,C]=T({}),[v,S]=T({}),U=N=>{v[N]&&S(I=>({...I,[N]:""}))},te=(N,I)=>{g(ne=>({...ne,[N]:I})),U(N)},j=(N,I)=>{C(ne=>({...ne,[N]:I})),U(N)},ae=N=>{if(N.preventDefault(),c)return;let I=jp(e,b,x),ne=tc(e,I,t);if(Object.keys(ne).length>0){S(ne);return}o(nc(I))},ie=N=>{!s||N.key!=="Enter"||N.shiftKey||N.isComposing||N.target?.tagName==="TEXTAREA"&&ae(N)};return r("form",{class:`${ce}-form`,onSubmit:ae,onKeyDown:ie,"data-testid":_,noValidate:!0,children:[e.map(N=>r(Wp,{field:N,value:b[N.name],otherText:x[N.name]??"",error:v[N.name],disabled:c,typeLabel:m?.[N.name],strings:t,onChange:I=>te(N.name,I),onOtherChange:I=>j(N.name,I)},N.name)),u?null:r("div",{class:`${ce}-form-actions`,children:[l?r("span",{class:`${ce}-form-hint`,children:l}):null,a&&i?r("button",{type:"button",class:`${ce}-form-skip`,onClick:i,disabled:c,"data-testid":f,children:a}):null,r("button",{type:"submit",class:`${ce}-form-submit`,disabled:c,"data-testid":h,children:n})]})]})}function Wp({field:e,value:t,otherText:n,error:o,disabled:a,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=we(w.formField,e.name),u=Vp({field:e,value:t,otherText:n,disabled:a,strings:l,onChange:s,onOtherChange:c,fieldTid:d});return r("label",{class:`${ce}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${ce}-field-head`,children:[r("span",{class:`${ce}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${ce}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?r("span",{class:`${ce}-field-type`,children:i}):null]}),u,e.validationHint&&!o?r("span",{class:`${ce}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${ce}-field-error`,role:"alert",children:o}):null]})}function Vp(e){let{field:t,value:n,otherText:o,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return r("textarea",{class:`${ce}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c});case"select":return r("select",{class:`${ce}-field-input`,value:d,disabled:a,onChange:u=>l(u.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(u=>r("option",{value:u.value,children:u.label??u.value},u.value))]});case"radio":{let u=t.allowOther&&d===Ko;return r("div",{class:`${ce}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(m=>r("label",{class:`${ce}-choice`,children:[r("input",{type:"radio",name:`${ce}-${t.name}`,checked:d===m.value,disabled:a,onChange:()=>l(m.value)}),r("span",{children:m.label??m.value})]},m.value)),t.allowOther?r("label",{class:`${ce}-choice`,children:[r("input",{type:"radio",name:`${ce}-${t.name}`,checked:d===Ko,disabled:a,onChange:()=>l(Ko)}),r("span",{children:i.formOther})]}):null,u?r("input",{class:`${ce}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:m=>s(m.target.value)}):null]})}case"checkbox":return r("label",{class:`${ce}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:u=>l(u.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let u=Array.isArray(n)?n:[],m=(_,h)=>l(h?[...u,_]:u.filter(f=>f!==_));return r("div",{class:`${ce}-field-choices`,"data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${ce}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(_.value),disabled:a,onChange:h=>m(_.value,h.target.checked)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${ce}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}default:return r("input",{class:`${ce}-field-input`,type:Kp(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function Kp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function Gp(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(o=>o.trim()).filter(Boolean):n.defaultValue);return t}function jp(e,t,n){let o={...t};for(let a of e){let i=n[a.name]?.trim();if(a.type==="radio"&&a.allowOther&&t[a.name]===Ko)o[a.name]=i??"";else if(a.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[a.name])?t[a.name]:[];o[a.name]=[...s,...l]}}return o}var tt=P.cssPrefix;function ma({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${tt}-form-gate`,"data-testid":w.formGate,children:[e.title?r("h3",{class:`${tt}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${tt}-form-gate-desc`,children:e.description}):null,r(Nn,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?o:void 0,submitTestId:w.formSubmit,skipTestId:w.formSkip})]})}function oc({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(ee,{children:[r("span",{children:e.title}),r("span",{class:`${tt}-sr-only`,children:a})]}):r("span",{children:a}),l=e.form?.reviewable??!1,s=!o&&l&&e.values&&Object.keys(e.values).length>0?e.values:null;if(s){let c=d=>e.form?.fields.find(u=>u.name===d)?.label??d;return r("details",{class:`${tt}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,children:[r("summary",{class:`${tt}-form-done-summary`,"data-testid":w.formDoneToggle,children:[r(Rt,{}),i,r(Qt,{})]}),r("dl",{class:`${tt}-form-answers`,"data-testid":w.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${tt}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${tt}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,role:"status",children:[o?r(El,{}):r(Rt,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${tt}-form-done-fill`,"data-testid":w.formFill,onClick:n,children:t.formFillOut}):null]})}function Jp(e,t){for(var n in t)e[n]=t[n];return e}function ha(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function rc(e,t){this.props=e,this.context=t}function uc(e,t){function n(a){var i=this.props.ref;return i!=a.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,a)||i!=a.ref:ha(this.props,a)}function o(a){return this.shouldComponentUpdate=n,it(e,a)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o}(rc.prototype=new $e).isPureReactComponent=!0,rc.prototype.shouldComponentUpdate=function(e,t){return ha(this.props,e)||ha(this.state,t)};var ac=z.__b;z.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ac&&ac(e)};var jb=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Qp=z.__e;z.__e=function(e,t,n,o){if(e.then){for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),a.__c(e,t)}Qp(e,t,n,o)};var ic=z.unmount;function pc(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=Jp({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return pc(o,t,n)})),e}function fc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return fc(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ga(){this.__u=0,this.o=null,this.__b=null}function mc(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Go(){this.i=null,this.l=null}z.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ic&&ic(e)},(ga.prototype=new $e).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var a=mc(o.__v),i=!1,l=function(){i||o.__z||(i=!0,n.__R=null,a?a(c):c())};n.__R=l;var s=n.__P;n.__P=null;var c=function(){if(!--o.__u){if(o.state.__a){var d=o.state.__a;o.__v.__k[0]=fc(d,d.__c.__P,d.__c.__O)}var u;for(o.setState({__a:o.__b=null});u=o.o.pop();)u.__P=s,u.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},ga.prototype.componentWillUnmount=function(){this.o=[]},ga.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=pc(this.__b,n,o.__O=o.__P)}this.__b=null}var a=t.__a&&it(ee,null,e.fallback);return a&&(a.__u&=-33),[it(ee,null,t.__a?null:e.children),a]};var sc=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Go.prototype=new $e).__a=function(e){var t=this,n=mc(t.__v),o=t.l.get(e);return o[0]++,function(a){var i=function(){t.props.revealOrder?(o.push(a),sc(t,e,o)):a()};n?n(i):i()}},Go.prototype.render=function(e){this.i=null,this.l=new Map;var t=gn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Go.prototype.componentDidUpdate=Go.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){sc(e,n,t)})};var Zp=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ef=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,tf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,nf=/[A-Z0-9]/g,of=typeof document<"u",rf=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};$e.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty($e.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var lc=z.event;z.event=function(e){return lc&&(e=lc(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var gc,af={configurable:!0,get:function(){return this.class}},cc=z.vnode;z.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,a={},i=o.indexOf("-")==-1;for(var l in n){var s=n[l];if(!(l==="value"&&"defaultValue"in n&&s==null||of&&l==="children"&&o==="noscript"||l==="class"||l==="className")){var c=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&s===!0?s="":c==="translate"&&s==="no"?s=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?l="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||rf(n.type)?c==="onfocus"?l="onfocusin":c==="onblur"?l="onfocusout":tf.test(l)&&(l=c):c=l="oninput":i&&ef.test(l)?l=l.replace(nf,"-$&").toLowerCase():s===null&&(s=void 0),c==="oninput"&&a[l=c]&&(l="oninputCapture"),a[l]=s}}o=="select"&&(a.multiple&&Array.isArray(a.value)&&(a.value=gn(n.children).forEach(function(d){d.props.selected=a.value.indexOf(d.props.value)!=-1})),a.defaultValue!=null&&(a.value=gn(n.children).forEach(function(d){d.props.selected=a.multiple?a.defaultValue.indexOf(d.props.value)!=-1:a.defaultValue==d.props.value}))),n.class&&!n.className?(a.class=n.class,Object.defineProperty(a,"className",af)):n.className&&(a.class=a.className=n.className),t.props=a})(e),e.$$typeof=Zp,cc&&cc(e)};var dc=z.__r;z.__r=function(e){dc&&dc(e),gc=e.__c};var _c=z.diffed;z.diffed=function(e){_c&&_c(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),gc=null};function hc(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var ya=1,bc=2,yc=4,Pc=8,xc=16;function sf(e){switch(e){case ya:return"href";case bc:return"src";case yc:return"class";case Pc:return"checked";case xc:return"start"}}var lf=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},cf=lf;var vc=24;function xa(e){let t=new Uint32Array(vc);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(vc),indent:"",indent_len:0,table_state:0}}function Sc(e){e.pending.length>0&&Re(e,`
12
+ `)}function oe(e){e.text.length!==0&&(console.assert(e.len>0,"Never adding text to root"),e.renderer.add_text(e.renderer.data,e.text),e.text="")}function he(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function re(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&he(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function df(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Lt(e,t){for(e.fence_start=0;e.len>t;)he(e)}function jo(e,t){let n=0;for(let o=0;o<=e.len&&(t-=e.spaces[o],!(t<0));o+=1)switch(e.tokens[o]){case 9:case 10:case 20:case 25:n=o;break}for(;e.len>n;)he(e);return t}function va(e,t){let n=-1,o=-1;for(let a=e.blockquote_idx+1;a<=e.len;a+=1)if(e.tokens[a]===25){if(e.indent_len<e.spaces[a]){o=-1;break}o=a}else e.tokens[a]===t&&(n=a);return o===-1?n===-1?(Lt(e,e.blockquote_idx),re(e,t),!0):(Lt(e,n),!1):(Lt(e,o),re(e,t),!0)}function ba(e,t){re(e,25),e.spaces[e.len]=e.indent_len+t,_t(e),e.token=103}function _t(e){e.indent="",e.indent_len=0,e.pending=""}function Pa(e){switch(e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return!0;default:return!1}}function _f(e){switch(e){case 32:case 58:case 59:case 41:case 44:case 33:case 46:case 63:case 93:case 10:return!0;default:return!1}}function uf(e){return Pa(e)||_f(e)}function Re(e,t){for(let n of t){if(e.token===101){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let a=jo(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],a>0&&Re(e," ".repeat(a))}let o=e.pending+n;switch(e.token){case 21:case 1:case 20:case 24:case 23:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
13
+ `:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){he(e),_t(e),e.pending=n;continue}Lt(e,e.blockquote_idx),_t(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=o;continue}break;case" ":jo(e,e.indent_len),re(e,cf(e.pending.length)),_t(e);continue}break;case">":{let i=df(e,20,e.blockquote_idx+1);i===-1?(Lt(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,re(e,20)):e.blockquote_idx=i,_t(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=o;continue;case" ":e.pending=o;continue;case`
14
+ `:if(e.hr_chars<3)break;jo(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),_t(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){va(e,23),ba(e,2),Re(e,o.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=o,e.fence_start=o.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=o,e.fence_start=o.length):(re(e,2),_t(e),e.fence_start=0,Re(e,o));continue;case`
15
+ `:{jo(e,e.indent_len),re(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,yc,e.pending.slice(e.fence_start)),_t(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;va(e,23),ba(e,2);continue;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(e.pending[e.pending.length-1]==="."){if(n!==" ")break;va(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,xc,e.pending.slice(0,-1)),ba(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||Pa(i)){e.pending=o;continue}}break;case"|":Lt(e,e.blockquote_idx),re(e,27),re(e,28),e.pending="",Re(e,n);continue}let a=o;if(e.token===21)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let i=0;for(;i<4;i+=1)if(e.indent[i]===" "){i=i+1;break}a=e.indent.slice(i)+o,re(e,9)}else re(e,2);_t(e),Re(e,a);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;case`
16
+ `:e.table_state=2,e.pending="";continue;default:he(e),e.table_state=0;break}else switch(e.pending){case"|":re(e,28),e.pending="",Re(e,n);continue;case`
17
+ `:he(e),e.pending="",e.table_state=0,Re(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":re(e,29),he(e),e.pending="",Re(e,n);continue;case`
18
+ `:he(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Re(e,n);continue;default:re(e,29),Re(e,n);continue}break;case 29:if(e.pending==="|"){oe(e),he(e),e.pending="",Re(e,n);continue}break;case 9:switch(o){case`
19
19
  `:case`
20
20
  `:case`
21
21
  `:case`
@@ -25,18 +25,18 @@ ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(t==="[DONE]")retu
25
25
  `:case`
26
26
  `:case`
27
27
  `:case`
28
- `:e.pending=o;continue;default:e.pending.length!==0?(oe(e),ve(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=o;continue;case`
29
- `:if(o.length===e.fence_start+e.fence_end+1){oe(e),ve(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
30
- `){e.pending=o,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":o.length===e.fence_start+ +(e.pending[0]===" ")?(oe(e),ve(e),e.pending="",e.fence_start=0):e.pending=o;continue;case`
31
- `:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,oe(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=o,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=o;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=o;continue;case 2:if(n!=="]")break;e.pending=o;continue;case 3:if(n!==" ")break;e.renderer.add_token(e.renderer.data,26),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,xc,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Ie(e,o);continue;case 14:case 15:{let i="*",l=12;if(e.token===15&&(i="_",l=13),i===e.pending){if(oe(e),i===n){ve(e),e.pending="";continue}ae(e,l),e.pending=n;continue}break}case 12:case 13:{let i="*",l=14;switch(e.token===13&&(i="_",l=15),e.pending){case i:i===n?e.tokens[e.len-1]===l?e.pending=o:(oe(e),ae(e,l),e.pending=""):(oe(e),ve(e),e.pending=n);continue;case i+i:let s=e.token;oe(e),ve(e),ve(e),i!==n?(ae(e,s),e.pending=n):e.pending="";continue}break}case 16:if(o==="~~"){oe(e),ve(e),e.pending="";continue}break;case 105:n===`
32
- `?(oe(e),ae(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Ie(e,n));continue;case 30:if(o==="\\]"||o==="$$"){oe(e),ve(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){oe(e),ve(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(oe(e),ae(e,18),e.pending=o,e.text=o):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=o:(e.token=e.tokens[e.len],Ie(e,n));continue;case 17:case 19:if(e.pending==="]"){oe(e),n==="("?e.pending=o:(ve(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?ka:yc,l=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,l),ve(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
33
- `||n==="\\"?(e.renderer.set_attr(e.renderer.data,ka,e.pending),oe(e),ve(e),e.pending=n):(e.text+=n,e.pending=o);continue;case 104:if(o.startsWith("<br")){if(o.length===3||n===" "||n==="/"&&(o.length===4||e.pending[e.pending.length-1]===" ")){e.pending=o;continue}if(n===">"){oe(e),e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data),e.pending="";continue}}e.token=e.tokens[e.len],e.text+="<",e.pending=e.pending.slice(1),Ie(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":oe(e),ae(e,31),e.pending="";continue;case"[":e.token=105,e.pending=o;continue;case`
34
- `:e.pending=n;continue;default:let a=n.charCodeAt(0);e.pending="",e.text+=wa(a)||a>=65&&a<=90||a>=97&&a<=122?o:n;continue}case`
35
- `:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:oe(e),Nt(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:oe(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){oe(e),e.pending=o,e.token=104;continue}break;case"`":if(e.token===19)break;n==="`"?(e.fence_start+=1,e.pending=o):(e.fence_start+=1,oe(e),ae(e,11),e.text=n===" "||n===`
28
+ `:e.pending=o;continue;default:e.pending.length!==0?(oe(e),he(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=o;continue;case`
29
+ `:if(o.length===e.fence_start+e.fence_end+1){oe(e),he(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
30
+ `){e.pending=o,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":o.length===e.fence_start+ +(e.pending[0]===" ")?(oe(e),he(e),e.pending="",e.fence_start=0):e.pending=o;continue;case`
31
+ `:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,oe(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=o,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=o;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=o;continue;case 2:if(n!=="]")break;e.pending=o;continue;case 3:if(n!==" ")break;e.renderer.add_token(e.renderer.data,26),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,Pc,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Re(e,o);continue;case 14:case 15:{let i="*",l=12;if(e.token===15&&(i="_",l=13),i===e.pending){if(oe(e),i===n){he(e),e.pending="";continue}re(e,l),e.pending=n;continue}break}case 12:case 13:{let i="*",l=14;switch(e.token===13&&(i="_",l=15),e.pending){case i:i===n?e.tokens[e.len-1]===l?e.pending=o:(oe(e),re(e,l),e.pending=""):(oe(e),he(e),e.pending=n);continue;case i+i:let s=e.token;oe(e),he(e),he(e),i!==n?(re(e,s),e.pending=n):e.pending="";continue}break}case 16:if(o==="~~"){oe(e),he(e),e.pending="";continue}break;case 105:n===`
32
+ `?(oe(e),re(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Re(e,n));continue;case 30:if(o==="\\]"||o==="$$"){oe(e),he(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){oe(e),he(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(oe(e),re(e,18),e.pending=o,e.text=o):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=o:(e.token=e.tokens[e.len],Re(e,n));continue;case 17:case 19:if(e.pending==="]"){oe(e),n==="("?e.pending=o:(he(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?ya:bc,l=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,l),he(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
33
+ `||n==="\\"?(e.renderer.set_attr(e.renderer.data,ya,e.pending),oe(e),he(e),e.pending=n):(e.text+=n,e.pending=o);continue;case 104:if(o.startsWith("<br")){if(o.length===3||n===" "||n==="/"&&(o.length===4||e.pending[e.pending.length-1]===" ")){e.pending=o;continue}if(n===">"){oe(e),e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data),e.pending="";continue}}e.token=e.tokens[e.len],e.text+="<",e.pending=e.pending.slice(1),Re(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":oe(e),re(e,31),e.pending="";continue;case"[":e.token=105,e.pending=o;continue;case`
34
+ `:e.pending=n;continue;default:let a=n.charCodeAt(0);e.pending="",e.text+=Pa(a)||a>=65&&a<=90||a>=97&&a<=122?o:n;continue}case`
35
+ `:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:oe(e),Lt(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:oe(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){oe(e),e.pending=o,e.token=104;continue}break;case"`":if(e.token===19)break;n==="`"?(e.fence_start+=1,e.pending=o):(e.fence_start+=1,oe(e),re(e,11),e.text=n===" "||n===`
36
36
  `?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let a=12,i=14,l=e.pending[0];if(l==="_"&&(a=13,i=15),e.pending.length===1){if(l===n){e.pending=o;continue}if(n!==" "&&n!==`
37
- `){oe(e),ae(e,a),e.pending=n;continue}}else{if(l===n){oe(e),ae(e,i),ae(e,a),e.pending="";continue}if(n!==" "&&n!==`
38
- `){oe(e),ae(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=o;continue}}else if(n!==" "&&n!==`
39
- `){oe(e),ae(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=o;continue}else{if(pf(n.charCodeAt(0)))break;oe(e),ae(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){oe(e),ae(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){oe(e),ae(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}oe(e)}function Ea(e){return{add_token:ff,end_token:mf,add_text:gf,set_attr:hf,data:{nodes:[e,,,,,],index:0}}}function ff(e,t){let n=e.nodes[e.index],o;switch(t){case 1:return;case 20:o=document.createElement("blockquote");break;case 2:o=document.createElement("p");break;case 21:o=document.createElement("br");break;case 22:o=document.createElement("hr");break;case 3:o=document.createElement("h1");break;case 4:o=document.createElement("h2");break;case 5:o=document.createElement("h3");break;case 6:o=document.createElement("h4");break;case 7:o=document.createElement("h5");break;case 8:o=document.createElement("h6");break;case 12:case 13:o=document.createElement("em");break;case 14:case 15:o=document.createElement("strong");break;case 16:o=document.createElement("s");break;case 11:o=document.createElement("code");break;case 18:case 17:o=document.createElement("a");break;case 19:o=document.createElement("img");break;case 23:o=document.createElement("ul");break;case 24:o=document.createElement("ol");break;case 25:o=document.createElement("li");break;case 26:let a=o=document.createElement("input");a.type="checkbox",a.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),o=document.createElement("code");break;case 27:o=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}o=document.createElement("tr");break;case 29:o=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:o=document.createElement("equation-block");break;case 31:o=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(o)}function mf(e){e.index-=1}function gf(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function hf(e,t,n){e.nodes[e.index].setAttribute(lf(t),n)}function Qo({textSig:e,doneSig:t}){let n=F(null);return vt(()=>{let o=n.current;if(!o)return;o.classList.add(`${P.cssPrefix}-md`);let a=Ea(o),i=Ca(a),l=0,s=dt(()=>{let u=e.value,m=t.value;u.length<l&&(o.replaceChildren(),a=Ea(o),i=Ca(a),l=0);let _=u.slice(l);_&&Ie(i,_),l=u.length,m&&kc(i)}),c=new MutationObserver(u=>{for(let m of u)for(let _ of m.addedNodes){if(!(_ instanceof HTMLElement))continue;let h=_.matches?.("a")?[_]:[..._.querySelectorAll?.("a")??[]];for(let f of h)wc(f)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))wc(u);let d=u=>{let m=u.target?.closest?.("a");if(!m||!(m instanceof HTMLAnchorElement))return;let _=m.getAttribute("href")??"";!_||_.startsWith("#")||(u.preventDefault(),window.open(_,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function Cc({text:e}){let t=Me(()=>q(e),[e]),n=Me(()=>q(!0),[]);return r(Qo,{textSig:t,doneSig:n})}function wc(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var Zo=P.cssPrefix;function Ec({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=T(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${Zo}-feedback`,role:"group","data-testid":w.messageFeedback,children:[r("button",{type:"button",class:`${Zo}-msg-action`,"data-active":a==="up"?"true":void 0,"aria-pressed":a==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>l("up"),"data-testid":w.feedbackUp,children:r(Hl,{})}),r("button",{type:"button",class:`${Zo}-msg-action`,"data-active":a==="down"?"true":void 0,"aria-pressed":a==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>l("down"),"data-testid":w.feedbackDown,children:r(zl,{})}),r("span",{class:`${Zo}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var rn=P.cssPrefix;function Tc({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${rn}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":w.source,children:[r("span",{class:`${rn}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${rn}-source-label`,children:n})]}):r("span",{class:`${rn}-source`,"data-testid":w.source,children:[r("span",{class:`${rn}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${rn}-source-label`,children:n})]})}var Ge=P.cssPrefix;function Ra(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function er(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",o=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:o,decided:n||o}}function Ia({status:e,icon:t,label:n}){return r("span",{class:`${Ge}-toolui-badge ${Ge}-toolui-status`,"data-status":e,children:[r("span",{class:`${Ge}-toolui-status-icon`,children:t}),n]})}function bf(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function yf({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(Ho,{}):e==="completed"||e==="responded"?r(Bo,{}):r(ql,{})}function Pf(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function xf({state:e,approval:t,strings:n,superseded:o}){let a=bf(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r(Ia,{status:i,icon:r(yf,{status:i}),label:Pf(i,n)})}function Sf({name:e,state:t,approval:n,strings:o,superseded:a}){return r(ee,{children:[r("span",{class:`${Ge}-toolui-name-pill`,children:[r(Ul,{}),r("span",{class:`${Ge}-toolui-name-text`,children:e})]}),r(xf,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${Ge}-toolui-chevron`,children:r(Mt,{})})]})}function tr({part:e,strings:t,testid:n,superseded:o}){let a=J(()=>e.inputSig.value),i=J(()=>e.outputSig.value),l=J(()=>e.errorSig.value),s=J(()=>e.stateSig.value),c=J(()=>e.approvalSig.value);return r("details",{class:`${Ge}-toolui ${Ge}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${Ge}-toolui-head`,children:r(Sf,{name:Ra(e.toolName),state:s.value,approval:c.value,strings:t,superseded:o})}),r(Ta,{label:t.toolParameters,value:a.value}),i.value!==void 0?r(Ta,{label:t.toolResult,value:i.value}):null,l.value?r(Ta,{label:t.statusError,value:l.value,error:!0}):null]})}function Ta({label:e,value:t,error:n}){let o=n?String(t??""):nr(Aa(t));return o?r("div",{class:`${Ge}-toolui-section`,children:[r("span",{class:`${Ge}-toolui-label`,children:e}),r("pre",{class:`${Ge}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function Aa(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function nr(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}var We=P.cssPrefix;function Rc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.approvalSig.value),s=J(()=>e.stateSig.value),c=Ra(e.toolName),d=l.value?.approved,{terminal:u,responded:m,decided:_}=er(s.value,l.value),h=m&&n&&!u,f=o&&!_,b=e.toolCallId;return r("div",{class:`${We}-toolui-group`,"data-testid":_?w.toolDecision:w.toolApproval,children:[r(tr,{part:e,strings:t,superseded:f}),f||u?null:r("div",{class:`${We}-toolui ${We}-toolui-body`,children:[m?r(ee,{children:[r("p",{class:`${We}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),h?r("p",{class:`${We}-toolui-subtle`,children:t.approvalEditHint}):null,!h&&!u?r("p",{class:`${We}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(ee,{children:[r("p",{class:`${We}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${We}-toolui-subtle`,children:t.approvalBody})]}),!_&&!o?r("div",{class:`${We}-toolui-actions`,children:[r("button",{type:"button",class:`${We}-form-skip`,onClick:()=>a(b,!1),"data-testid":w.toolReject,children:t.reject}),r("button",{type:"button",class:`${We}-form-submit`,onClick:()=>a(b,!0),"data-testid":w.toolApprove,children:t.approve})]}):null,h?r("div",{class:`${We}-toolui-actions`,children:r("button",{type:"button",class:`${We}-form-skip`,onClick:()=>i(b),"data-testid":w.toolEdit,children:t.edit})}):null]})]})}var kf=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Ic(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(wf).filter(a=>a!==null);return{intro:or(t.intro),questions:o}}function wf(e,t){if(!e||typeof e!="object")return null;let n=e,o=kf.has(n.type)?n.type:"text";return{key:or(n.key)??`q${t+1}`,question:or(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(a=>typeof a=="string"&&a.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:or(n.helpText)}}function Cf(e){switch(e){case"text":return"textarea";case"phone":return"tel";case"single-select":case"boolean":return"radio";case"multi-select":return"multiselect";default:return e}}function Ma(e,t,n){return e.questions.map(o=>{let a=Cf(o.type),i=o.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(o.options??[]).map(l=>({value:l,label:l}));return{name:o.key,label:o.question,type:a,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function or(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var Pe=P.cssPrefix,Ef={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Ac(e,t){let n={};for(let o of e)n[o.key]=t[Ef[o.type]];return n}function Mc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.stateSig.value).value,s=J(()=>e.approvalSig.value).value,c=J(()=>Ic(e.inputSig.value)).value,{terminal:d,decided:u}=er(l,s),m=u&&s?.approved===!0,_=!u&&!o,h=!_&&!m,f=m&&n&&!d,b=c.questions,[g,x]=T(null),v=g??(_||m),[S,U]=T(!1),te=b.length>1?da:Nn,j=_?t.inputRequired:t.inputBadge,ie=_?r(Tf,{req:c,strings:t,active:n,resolve:(se,N)=>a(e.toolCallId,N,se)}):S?r(Bn,{fields:Ma(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Ac(b,t),initialValues:m?Lf(b,s?.reason):void 0}):r(Rf,{questions:b,answers:m?Mf(s?.reason):{},strings:t});return r("details",{class:`${Pe}-toolui ${Pe}-toolui-collapsible${o?` ${Pe}-toolui-stale`:""}`,open:v,onToggle:se=>{let N=se.currentTarget.open;N!==v&&x(N)},"data-testid":_?w.toolAskQuestions:w.toolDecision,children:[r("summary",{class:`${Pe}-toolui-head`,children:[r("span",{class:`${Pe}-toolui-q-pill`,children:[r(te,{}),j]}),r("span",{class:`${Pe}-toolui-head-end`,children:[_?null:r(Ia,{status:h?"superseded":"completed",icon:h?r(Ho,{}):r(Bo,{}),label:h?t.inputSkipped:t.inputAnswered}),r("span",{class:`${Pe}-toolui-chevron`,children:r(Mt,{})})]})]}),r("div",{class:`${Pe}-toolui-collapse-body`,children:[c.intro?r("div",{class:`${Pe}-toolui-desc`,children:c.intro}):null,ie,_?null:r("div",{class:`${Pe}-toolui-footer`,children:[r("button",{type:"button",class:`${Pe}-toolui-options-toggle`,onClick:()=>U(se=>!se),"data-testid":w.toolAskOptions,children:[r("span",{class:`${Pe}-toolui-options-chevron${S?` ${Pe}-open`:""}`,children:r(Mt,{})}),S?t.hideOptions:t.showOptions]}),f?r("button",{type:"button",class:`${Pe}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":w.toolEdit,children:t.edit}):null]})]})]})}function Tf({req:e,strings:t,active:n,resolve:o}){let a=Ma(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return r(Bn,{fields:a,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:l=>o(Af(e.questions,l),!0),skipLabel:t.inputSkip,onSkip:()=>o(void 0,!1),submitOnEnter:i,fieldTypeLabels:Ac(e.questions,t),submitTestId:w.toolInputSubmit,skipTestId:w.toolInputSkip})}function Rf({questions:e,answers:t,strings:n}){return r("div",{class:`${Pe}-toolui-summary`,"data-testid":w.toolAskSummary,children:e.map(o=>r("div",{class:`${Pe}-field`,children:[r("span",{class:`${Pe}-field-head`,children:r("span",{class:`${Pe}-field-label`,children:[o.question,o.required?r("span",{class:`${Pe}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),r("p",{class:`${Pe}-toolui-answer`,children:If(o,t[o.key],n)||"\u2014"})]},o.key))})}function If(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Af(e,t){let n=e.flatMap(o=>{let a=t[o.key];if(a==null||a.trim()==="")return[];let i=o.type==="multi-select"?a.split(",").map(l=>l.trim()).filter(Boolean):a;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function Lc(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let a of n)if(a&&typeof a=="object"&&"key"in a){let{key:i,value:l}=a;if(typeof i!="string")continue;typeof l=="string"?o[i]=l:Array.isArray(l)&&(o[i]=l.filter(s=>typeof s=="string"))}return o}function Mf(e){let t=Lc(e),n={};for(let[o,a]of Object.entries(t))n[o]=Array.isArray(a)?a.join(", "):a;return n}function Lf(e,t){let n=Lc(t),o={};for(let a of e){let i=n[a.key];i!==void 0&&(a.type==="multi-select"?o[a.key]=Array.isArray(i)?i:[i]:o[a.key]=Array.isArray(i)?i[0]??"":i)}return o}function Oc({part:e,strings:t}){let n=J(()=>e.inputSig.value),o=J(()=>e.outputSig.value),a=J(()=>e.errorSig.value);return J(()=>!!nr(n.value)||!!a.value||!!nr(Aa(o.value))).value?r(tr,{part:e,strings:t,testid:w.toolCall}):null}var Ee=P.cssPrefix,Nc=pc(Of);function Of({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:u=!1,onFeedback:m}){let h=J(()=>e.partsSig.value).value,f=J(()=>_t(e)),b=J(()=>nl(e)),g=J(()=>e.partsSig.value.some($=>$.kind==="text"&&$.textSig.value.length>0)),x=J(()=>o&&e.partsSig.value.some($=>$.kind==="reasoning")),C=J(()=>{let $=e.partsSig.value,Be=-1;for(let Ne=0;Ne<$.length;Ne++){let O=$[Ne]?.kind;(O==="text"||O==="file"||O==="source")&&(Be=Ne)}return Be}),v=e.role==="assistant"&&e.status==="streaming",S=n==="buffered"&&v,U=v&&!g.value,te=v&&!S&&!(x.value&&U);if(b.value)return null;let j=Df(e.createdAt),ie=e.role==="assistant"||e.role==="operator",se=u&&!!m&&!!e.serverMessageId&&ie&&!v&&e.status!=="error"&&!f.value,N=h.filter($=>$.kind==="text").map($=>$.textSig.value).join(`
37
+ `){oe(e),re(e,a),e.pending=n;continue}}else{if(l===n){oe(e),re(e,i),re(e,a),e.pending="";continue}if(n!==" "&&n!==`
38
+ `){oe(e),re(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=o;continue}}else if(n!==" "&&n!==`
39
+ `){oe(e),re(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=o;continue}else{if(uf(n.charCodeAt(0)))break;oe(e),re(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){oe(e),re(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){oe(e),re(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}oe(e)}function Sa(e){return{add_token:pf,end_token:ff,add_text:mf,set_attr:gf,data:{nodes:[e,,,,,],index:0}}}function pf(e,t){let n=e.nodes[e.index],o;switch(t){case 1:return;case 20:o=document.createElement("blockquote");break;case 2:o=document.createElement("p");break;case 21:o=document.createElement("br");break;case 22:o=document.createElement("hr");break;case 3:o=document.createElement("h1");break;case 4:o=document.createElement("h2");break;case 5:o=document.createElement("h3");break;case 6:o=document.createElement("h4");break;case 7:o=document.createElement("h5");break;case 8:o=document.createElement("h6");break;case 12:case 13:o=document.createElement("em");break;case 14:case 15:o=document.createElement("strong");break;case 16:o=document.createElement("s");break;case 11:o=document.createElement("code");break;case 18:case 17:o=document.createElement("a");break;case 19:o=document.createElement("img");break;case 23:o=document.createElement("ul");break;case 24:o=document.createElement("ol");break;case 25:o=document.createElement("li");break;case 26:let a=o=document.createElement("input");a.type="checkbox",a.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),o=document.createElement("code");break;case 27:o=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}o=document.createElement("tr");break;case 29:o=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:o=document.createElement("equation-block");break;case 31:o=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(o)}function ff(e){e.index-=1}function mf(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function gf(e,t,n){e.nodes[e.index].setAttribute(sf(t),n)}function Xo({textSig:e,doneSig:t}){let n=F(null);return ht(()=>{let o=n.current;if(!o)return;o.classList.add(`${P.cssPrefix}-md`);let a=Sa(o),i=xa(a),l=0,s=lt(()=>{let u=e.value,m=t.value;u.length<l&&(o.replaceChildren(),a=Sa(o),i=xa(a),l=0);let _=u.slice(l);_&&Re(i,_),l=u.length,m&&Sc(i)}),c=new MutationObserver(u=>{for(let m of u)for(let _ of m.addedNodes){if(!(_ instanceof HTMLElement))continue;let h=_.matches?.("a")?[_]:[..._.querySelectorAll?.("a")??[]];for(let f of h)kc(f)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))kc(u);let d=u=>{let m=u.target?.closest?.("a");if(!m||!(m instanceof HTMLAnchorElement))return;let _=m.getAttribute("href")??"";!_||_.startsWith("#")||(u.preventDefault(),window.open(_,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function wc({text:e}){let t=Me(()=>q(e),[e]),n=Me(()=>q(!0),[]);return r(Xo,{textSig:t,doneSig:n})}function kc(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var Yo=P.cssPrefix;function Cc({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=T(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${Yo}-feedback`,role:"group","data-testid":w.messageFeedback,children:[r("button",{type:"button",class:`${Yo}-msg-action`,"data-active":a==="up"?"true":void 0,"aria-pressed":a==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>l("up"),"data-testid":w.feedbackUp,children:r(Bl,{})}),r("button",{type:"button",class:`${Yo}-msg-action`,"data-active":a==="down"?"true":void 0,"aria-pressed":a==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>l("down"),"data-testid":w.feedbackDown,children:r(Hl,{})}),r("span",{class:`${Yo}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var tn=P.cssPrefix;function Ec({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${tn}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":w.source,children:[r("span",{class:`${tn}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${tn}-source-label`,children:n})]}):r("span",{class:`${tn}-source`,"data-testid":w.source,children:[r("span",{class:`${tn}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${tn}-source-label`,children:n})]})}var Ke=P.cssPrefix;function wa(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function Jo(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",o=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:o,decided:n||o}}function Ca({status:e,icon:t,label:n}){return r("span",{class:`${Ke}-toolui-badge ${Ke}-toolui-status`,"data-status":e,children:[r("span",{class:`${Ke}-toolui-status-icon`,children:t}),n]})}function vf(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function bf({status:e}){return e==="denied"||e==="error"||e==="superseded"?r($o,{}):e==="completed"||e==="responded"?r(Do,{}):r(Ul,{})}function yf(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function Pf(e,t,n){return t&&(e==="awaiting"||e==="running")?"superseded":!n&&e==="running"?"error":e}function xf({state:e,approval:t,strings:n,superseded:o,live:a=!0}){let i=Pf(vf(e,t),o,a);return r(Ca,{status:i,icon:r(bf,{status:i}),label:yf(i,n)})}function Sf({name:e,state:t,approval:n,strings:o,superseded:a,live:i}){return r(ee,{children:[r("span",{class:`${Ke}-toolui-name-pill`,children:[r(zl,{}),r("span",{class:`${Ke}-toolui-name-text`,children:e})]}),r(xf,{state:t,approval:n,strings:o,superseded:a,live:i}),r("span",{class:`${Ke}-toolui-chevron`,children:r(It,{})})]})}function Qo({part:e,strings:t,testid:n,superseded:o,live:a}){let i=J(()=>e.inputSig.value),l=J(()=>e.outputSig.value),s=J(()=>e.errorSig.value),c=J(()=>e.stateSig.value),d=J(()=>e.approvalSig.value);return r("details",{class:`${Ke}-toolui ${Ke}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${Ke}-toolui-head`,children:r(Sf,{name:wa(e.toolName),state:c.value,approval:d.value,strings:t,superseded:o,live:a})}),r(ka,{label:t.toolParameters,value:i.value}),l.value!==void 0?r(ka,{label:t.toolResult,value:l.value}):null,s.value?r(ka,{label:t.statusError,value:s.value,error:!0}):null]})}function ka({label:e,value:t,error:n}){let o=n?String(t??""):Zo(Ea(t));return o?r("div",{class:`${Ke}-toolui-section`,children:[r("span",{class:`${Ke}-toolui-label`,children:e}),r("pre",{class:`${Ke}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function Ea(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Zo(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}var Ue=P.cssPrefix;function Tc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.approvalSig.value),s=J(()=>e.stateSig.value),c=wa(e.toolName),d=l.value?.approved,{terminal:u,responded:m,decided:_}=Jo(s.value,l.value),h=m&&n&&!u,f=o&&!_,b=e.toolCallId;return r("div",{class:`${Ue}-toolui-group`,"data-testid":_?w.toolDecision:w.toolApproval,children:[r(Qo,{part:e,strings:t,superseded:f}),f||u?null:r("div",{class:`${Ue}-toolui ${Ue}-toolui-body`,children:[m?r(ee,{children:[r("p",{class:`${Ue}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),h?r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalEditHint}):null,!h&&!u?r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(ee,{children:[r("p",{class:`${Ue}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalBody})]}),!_&&!o?r("div",{class:`${Ue}-toolui-actions`,children:[r("button",{type:"button",class:`${Ue}-form-skip`,onClick:()=>a(b,!1),"data-testid":w.toolReject,children:t.reject}),r("button",{type:"button",class:`${Ue}-form-submit`,onClick:()=>a(b,!0),"data-testid":w.toolApprove,children:t.approve})]}):null,h?r("div",{class:`${Ue}-toolui-actions`,children:r("button",{type:"button",class:`${Ue}-form-skip`,onClick:()=>i(b),"data-testid":w.toolEdit,children:t.edit})}):null]})]})}var kf=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Rc(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(wf).filter(a=>a!==null);return{intro:er(t.intro),questions:o}}function wf(e,t){if(!e||typeof e!="object")return null;let n=e,o=kf.has(n.type)?n.type:"text";return{key:er(n.key)??`q${t+1}`,question:er(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(a=>typeof a=="string"&&a.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:er(n.helpText)}}function Cf(e){switch(e){case"text":return"textarea";case"phone":return"tel";case"single-select":case"boolean":return"radio";case"multi-select":return"multiselect";default:return e}}function Ta(e,t,n){return e.questions.map(o=>{let a=Cf(o.type),i=o.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(o.options??[]).map(l=>({value:l,label:l}));return{name:o.key,label:o.question,type:a,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function er(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var ye=P.cssPrefix,Ef={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Ic(e,t){let n={};for(let o of e)n[o.key]=t[Ef[o.type]];return n}function Ac({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.stateSig.value).value,s=J(()=>e.approvalSig.value).value,c=J(()=>Rc(e.inputSig.value)).value,{terminal:d,decided:u}=Jo(l,s),m=u&&s?.approved===!0,_=!u&&!o,h=!_&&!m,f=m&&n&&!d,b=c.questions,[g,x]=T(null),v=g??(_||m),[S,U]=T(!1),te=b.length>1?ia:An,j=_?t.inputRequired:t.inputBadge,ae=_?r(Tf,{req:c,strings:t,active:n,resolve:(ie,N)=>a(e.toolCallId,N,ie)}):S?r(Nn,{fields:Ta(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Ic(b,t),initialValues:m?Lf(b,s?.reason):void 0}):r(Rf,{questions:b,answers:m?Mf(s?.reason):{},strings:t});return r("details",{class:`${ye}-toolui ${ye}-toolui-collapsible${o?` ${ye}-toolui-stale`:""}`,open:v,onToggle:ie=>{let N=ie.currentTarget.open;N!==v&&x(N)},"data-testid":_?w.toolAskQuestions:w.toolDecision,children:[r("summary",{class:`${ye}-toolui-head`,children:[r("span",{class:`${ye}-toolui-q-pill`,children:[r(te,{}),j]}),r("span",{class:`${ye}-toolui-head-end`,children:[_?null:r(Ca,{status:h?"superseded":"completed",icon:h?r($o,{}):r(Do,{}),label:h?t.inputSkipped:t.inputAnswered}),r("span",{class:`${ye}-toolui-chevron`,children:r(It,{})})]})]}),r("div",{class:`${ye}-toolui-collapse-body`,children:[c.intro?r("div",{class:`${ye}-toolui-desc`,children:c.intro}):null,ae,_?null:r("div",{class:`${ye}-toolui-footer`,children:[r("button",{type:"button",class:`${ye}-toolui-options-toggle`,onClick:()=>U(ie=>!ie),"data-testid":w.toolAskOptions,children:[r("span",{class:`${ye}-toolui-options-chevron${S?` ${ye}-open`:""}`,children:r(It,{})}),S?t.hideOptions:t.showOptions]}),f?r("button",{type:"button",class:`${ye}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":w.toolEdit,children:t.edit}):null]})]})]})}function Tf({req:e,strings:t,active:n,resolve:o}){let a=Ta(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return r(Nn,{fields:a,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:l=>o(Af(e.questions,l),!0),skipLabel:t.inputSkip,onSkip:()=>o(void 0,!1),submitOnEnter:i,fieldTypeLabels:Ic(e.questions,t),submitTestId:w.toolInputSubmit,skipTestId:w.toolInputSkip})}function Rf({questions:e,answers:t,strings:n}){return r("div",{class:`${ye}-toolui-summary`,"data-testid":w.toolAskSummary,children:e.map(o=>r("div",{class:`${ye}-field`,children:[r("span",{class:`${ye}-field-head`,children:r("span",{class:`${ye}-field-label`,children:[o.question,o.required?r("span",{class:`${ye}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),r("p",{class:`${ye}-toolui-answer`,children:If(o,t[o.key],n)||"\u2014"})]},o.key))})}function If(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Af(e,t){let n=e.flatMap(o=>{let a=t[o.key];if(a==null||a.trim()==="")return[];let i=o.type==="multi-select"?a.split(",").map(l=>l.trim()).filter(Boolean):a;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function Mc(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let a of n)if(a&&typeof a=="object"&&"key"in a){let{key:i,value:l}=a;if(typeof i!="string")continue;typeof l=="string"?o[i]=l:Array.isArray(l)&&(o[i]=l.filter(s=>typeof s=="string"))}return o}function Mf(e){let t=Mc(e),n={};for(let[o,a]of Object.entries(t))n[o]=Array.isArray(a)?a.join(", "):a;return n}function Lf(e,t){let n=Mc(t),o={};for(let a of e){let i=n[a.key];i!==void 0&&(a.type==="multi-select"?o[a.key]=Array.isArray(i)?i:[i]:o[a.key]=Array.isArray(i)?i[0]??"":i)}return o}function Lc({part:e,strings:t,live:n}){let o=J(()=>e.inputSig.value),a=J(()=>e.outputSig.value),i=J(()=>e.errorSig.value);return J(()=>!!Zo(o.value)||!!i.value||!!Zo(Ea(a.value))).value?r(Qo,{part:e,strings:t,testid:w.toolCall,live:n}):null}var Ce=P.cssPrefix,Oc=uc(Of);function Of({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:u=!1,onFeedback:m}){let h=J(()=>e.partsSig.value).value,f=J(()=>dt(e)),b=J(()=>tl(e)),g=J(()=>e.partsSig.value.some($=>$.kind==="text"&&$.textSig.value.length>0)),x=J(()=>o&&e.partsSig.value.some($=>$.kind==="reasoning")),C=J(()=>{let $=e.partsSig.value,Oe=-1;for(let Ne=0;Ne<$.length;Ne++){let O=$[Ne]?.kind;(O==="text"||O==="file"||O==="source")&&(Oe=Ne)}return Oe}),v=e.role==="assistant"&&e.status==="streaming",S=n==="buffered"&&v,U=v&&!g.value,te=v&&!S&&!(x.value&&U);if(b.value)return null;let j=Df(e.createdAt),ae=e.role==="assistant"||e.role==="operator",ie=u&&!!m&&!!e.serverMessageId&&ae&&!v&&e.status!=="error"&&!f.value,N=h.filter($=>$.kind==="text").map($=>$.textSig.value).join(`
40
40
 
41
- `).trim(),I=!v&&e.status!=="error"&&!f.value&&N.length>0,ne=se||I;return r("div",{class:`${Ee}-bubble-row`,"data-role":e.role,"data-testid":Ce(w.messageBubble,e.serverMessageId??e.id),children:r("div",{class:`${Ee}-bubble-col`,children:[r("div",{class:`${Ee}-bubble`,children:[e.role==="operator"&&e.operatorInitials?r("span",{class:`${Ee}-bubble-author`,children:e.operatorInitials}):null,r("div",{class:`${Ee}-bubble-body`,children:[S?r(Uf,{label:t.loading}):h.map(($,Be)=>r($f,{part:$,active:U,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&($.kind!=="tool"||Be>C.value),superseded:s,tool:c},Hf($))),te&&r(zf,{}),e.status==="error"&&e.errorText||f.value?r("div",{class:`${Ee}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Ee}-error-retry`,onClick:d,"data-testid":w.messageRetry,children:t.errorRetry}):null]}):null]})]}),j||ne?r("div",{class:`${Ee}-bubble-meta`,children:[j?r("time",{class:`${Ee}-bubble-time`,dateTime:j.iso,title:j.full,children:j.short}):null,ne?r("div",{class:`${Ee}-bubble-actions`,children:[se&&e.serverMessageId?r(Ec,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:m}):null,I?r(Nf,{text:N,strings:t}):null]}):null]}):null]})})}function Nf({text:e,strings:t}){let[n,o]=T(!1),a=()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return r("button",{type:"button",class:`${Ee}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:a,"data-testid":w.messageCopy,children:n?r(At,{}):r(Bl,{})})}function Df(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function $f({part:e,active:t,strings:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l,superseded:s,tool:c}){switch(e.kind){case"step-start":return null;case"text":return r(Qo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(Bf,{part:e,active:t,strings:n}):null;case"tool":return r(Ff,{part:e,strings:n,showToolCalls:a,interactive:l,superseded:s,tool:c});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return i?r(Tc,{part:e,strings:n}):null}}function Ff({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=J(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(vc(e.toolName))return r(Mc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(Rc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(Oc,{part:e,strings:t}):null}function Bf({part:e,active:t,strings:n}){return r("details",{class:`${Ee}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Ee}-reasoning-summary`,children:r("span",{class:`${Ee}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Ee}-reasoning-body`,children:r(Qo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Hf(e){switch(e.kind){case"text":case"reasoning":case"step-start":return`${e.kind}:${e.id}`;case"tool":return`tool:${e.toolCallId}`;case"file":return`file:${e.url}`;case"source":return`source:${e.sourceId}`}}function zf(){return r("span",{class:`${Ee}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Uf({label:e}){return r("span",{class:`${Ee}-loading`,role:"status",children:[r("span",{class:`${Ee}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Ee}-loading-label`,children:e})]})}var Dt=P.cssPrefix,La=120,qf=350;function Dc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,enableMessageFeedback:l,onFeedback:s,loading:c,idle:d,tool:u,onRetry:m,form:_,formMarkers:h,onFillForm:f}){let b=F(null),g=J(()=>e.value),[x,C]=T(!1),v=F(!1),S=F(!1),U=F(!1),te=F(0),j=()=>U.current||performance.now()-te.current<qf,ie=F(0),se=k=>{let B=k.scrollHeight-k.clientHeight>1;k.dataset.fadeTop=B&&k.scrollTop>1?"true":"false",k.dataset.fadeBottom=B&&k.scrollHeight-k.scrollTop-k.clientHeight>1?"true":"false"},N=k=>C(k.scrollHeight-k.scrollTop-k.clientHeight>La*2),I=k=>{ie.current=performance.now(),k.scrollTop=k.scrollHeight,se(k)},ne=(k,B)=>{I(k);let ue=B,me=0,ye=()=>{I(k),--ue>0&&(me=requestAnimationFrame(ye))};return B>0&&(me=requestAnimationFrame(ye)),()=>cancelAnimationFrame(me)},$=(k,B)=>{let ue,me,ye,ce=-1,Qe=()=>{ue.disconnect(),me.disconnect(),clearTimeout(ye)},Ae=()=>{if(S.current||j()||ce>=0&&k.scrollTop<ce-4)return Qe();I(k),ce=k.scrollTop};return ue=new ResizeObserver(Ae),me=new MutationObserver(Ae),Ae(),ue.observe(k),me.observe(k,{childList:!0,subtree:!0,characterData:!0}),ye=setTimeout(Qe,B),Qe},Be=g.value[0]?.id;vt(()=>{let k=b.current;if(k&&g.value.length!==0&&(v.current=!0,!!g.value.some(B=>B.role==="user")))return $(k,300)},[Be]);let Ne=F(0);E(()=>{let k=b.current,B=g.value,ue=Ne.current;if(Ne.current=B.length,!k||!v.current)return;if(B.slice(ue).some(ye=>ye.role==="user"))return S.current=!1,ne(k,3);if(!B.some(ye=>ye.role==="user")||S.current||j())return;k.scrollHeight-k.scrollTop-k.clientHeight<La&&I(k)},[g.value.length]);let O=F(null);E(()=>{let k=b.current,B=g.value.at(-1),ue=O.current;if(O.current=B?.id??null,!!k&&v.current&&!(!B||B.id!==ue||B.status!=="streaming"))return S.current=!1,ne(k,3)},[g.value]),E(()=>{let k=b.current;if(!k)return;let B=g.value.at(-1);if(!B||B.status!=="streaming"&&!g.value.some(ye=>ye.role==="user"))return;let ue=()=>{if(S.current||j())return;k.scrollHeight-k.scrollTop-k.clientHeight<La*2&&I(k)};if(B.status!=="streaming")return $(k,300);ue();let me=new MutationObserver(ue);return me.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>me.disconnect()},[g.value]);let G=_?.form.id,Z=!!_&&(h??[]).some(k=>k.formId===_.form.id);vt(()=>{let k=b.current;!k||!G||S.current||g.value.some(B=>B.role==="user")&&(Z?k.querySelector(`[data-testid="${w.formGate}"]`)?.scrollIntoView({block:"nearest"}):I(k))},[G,Z]),E(()=>{let k=b.current;if(!k)return;let B=()=>{N(k),se(k),performance.now()-ie.current>150&&(S.current=k.scrollHeight-k.scrollTop-k.clientHeight>8)},ue=()=>{S.current=!0},me=ft=>{ft.deltaY<0&&ue()},ye=0,ce=ft=>{ye=ft.touches[0]?.clientY??0,U.current=!0},Qe=ft=>{(ft.touches[0]?.clientY??0)>ye+4&&ue()},Ae=()=>{U.current=!1,te.current=performance.now()},Vn=()=>{U.current=!0};return k.addEventListener("scroll",B,{passive:!0}),k.addEventListener("wheel",me,{passive:!0}),k.addEventListener("touchstart",ce,{passive:!0}),k.addEventListener("touchmove",Qe,{passive:!0}),k.addEventListener("touchend",Ae,{passive:!0}),k.addEventListener("touchcancel",Ae,{passive:!0}),k.addEventListener("pointerdown",Vn,{passive:!0}),window.addEventListener("pointerup",Ae,{passive:!0}),window.addEventListener("pointercancel",Ae,{passive:!0}),N(k),()=>{k.removeEventListener("scroll",B),k.removeEventListener("wheel",me),k.removeEventListener("touchstart",ce),k.removeEventListener("touchmove",Qe),k.removeEventListener("touchend",Ae),k.removeEventListener("touchcancel",Ae),k.removeEventListener("pointerdown",Vn),window.removeEventListener("pointerup",Ae),window.removeEventListener("pointercancel",Ae)}},[]);let Re=()=>{let k=b.current;k&&(S.current=!1,I(k))},De=[],Xe="",Ve=g.value.at(-1)?.id,xe=[...h??[]].toSorted((k,B)=>(k.createdAt??1/0)-(B.createdAt??1/0)),Se=k=>_&&k.formId===_.form.id?r(ba,{form:_.form,strings:t,onSubmit:_.onSubmit,onSkip:_.onSkip},`gate:${k.formId}`):r(rc,{marker:k,strings:t,onFill:!_&&f?()=>f(k.formId):void 0},k.key),Je=k=>{for(let B=xe[0];B?.createdAt!==void 0&&!(k!==void 0&&B.createdAt>k);B=xe[0])xe.shift(),De.push(Se(B))};for(let k of g.value){if(k.role==="assistant"&&k.id!==Ve&&_t(k))continue;Je(k.createdAt);let B=Wf(k.createdAt);B&&B!==Xe&&(De.push(r("div",{class:`${Dt}-date-divider`,children:r("span",{class:`${Dt}-date-pill`,title:Vf(k.createdAt),children:Kf(k.createdAt,t)})},`day:${B}`)),Xe=B),De.push(r(Nc,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!d&&k.id===Ve,superseded:k.id!==Ve,tool:u,onRetry:d&&k.id===Ve?m:void 0,enableMessageFeedback:l,onFeedback:s},k.id))}for(let k of xe)De.push(Se(k));return r("div",{class:`${Dt}-list-wrap`,children:[r("div",{ref:b,class:`${Dt}-list ${Dt}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&g.value.length===0?r("div",{class:`${Dt}-list-loading`,role:"status",children:t.conversationLoading}):null,De,_&&!Z?r(ba,{form:_.form,strings:t,onSubmit:_.onSubmit,onSkip:_.onSkip}):null]}),x?r("button",{type:"button",class:`${Dt}-jump`,onClick:Re,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":w.scrollToBottom,children:r(Mt,{})}):null]})}function Wf(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Vf(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Kf(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),a=Math.round((o(new Date)-o(n))/864e5);return a<=0?t.dateToday:a===1?t.dateYesterday:a<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Gf=["today","yesterday","lastWeek","older"];function jf(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor(($c(e)-$c(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Fc(e,t){let n=new Map;for(let o of t){let a=jf(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return Gf.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function $c(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Xf=W.scope("history"),Yf=3,Jf=6,Qf={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Zf(e,t,n){let o=Date.parse(e);return Number.isFinite(o)?new Date(o).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(o):t-o<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(o):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(o):""}function rr({transport:e,strings:t,locale:n,persistence:o,visitorId:a,onSelect:i,onNewConversation:l}){let s=P.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=T(c?"loaded":"loading"),[m,_]=T(c?.conversations??[]);E(()=>{let g=!1;return e.listConversations({visitorId:a}).then(x=>{if(g)return;let C=x.conversations??[];_(C),u("loaded"),o.saveHistoryCount(C.length)}).catch(x=>{g||(Xf.warn("listConversations failed",{err:x}),u("error"))}),()=>{g=!0}},[e,a,o]);let h=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":w.sidebarNewConversation,children:[r(ul,{}),t.newConversation]})}):null;if(d==="loading"){let g=Math.min(o.loadHistoryCount()??Yf,Jf);return r(ee,{children:[r("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:r("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[r("div",{class:`${s}-history-heading`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),r("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,g)},(x,C)=>r("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[r("span",{class:`${s}-history-avatar ${s}-skeleton`}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),r("span",{class:`${s}-history-time`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),r("span",{class:`${s}-history-row`,children:r("span",{class:`${s}-history-preview`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},C))})]})}),h]})}if(d==="error"||m.length===0)return r(ee,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),h]});let f=Date.now(),b=Fc(f,m);return r(ee,{children:[r("div",{class:`${s}-history`,role:"list",children:b.map(g=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[Qf[g.bucket]]}),r("div",{class:`${s}-history-card`,children:g.conversations.map(x=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(x),"data-closed":x.canContinue?void 0:"true","data-unread":x.hasUnread?"true":void 0,"data-testid":Ce(w.historyItem,x.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(_a,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:x.title}),r("span",{class:`${s}-history-time`,children:Zf(x.lastMessageAt,f,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:x.preview??(x.canContinue?t.historyContinue:t.conversationClosed)}),x.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},x.conversationId))})]},g.bucket))}),h]})}var Bc=P.cssPrefix;function Hc({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${Bc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${Bc}-suggestion`,onClick:()=>t(n),"data-testid":Ce(w.suggestion,o),children:n.label},n.id))})}var Te=P.cssPrefix;function zc(e){let{options:t,onClose:n}=e,o=t.strings,a=F(null);E(()=>{let c=a.current;if(!c)return;let d=Vo(c),u=m=>{m.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=e.composerApiRef,l=D(c=>{i.current?.attachFromDrop(c)},[i]),{visible:s}=jo({containerRef:a,onDrop:l});return qo(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Te}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":w.panel,children:[r(Oa,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(Na,{poweredBy:e.options.poweredBy})]})}function Oa(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,controlMode:u,assignedOperatorInitials:m,operatorAvailable:_,operatorRequestEnabled:h,onRequestOperator:f,onCancelRequest:b,loadingMessages:g,messagesSig:x,agent:C,suggestions:v,initialWidgetSize:S,visitorId:U,onClose:te,onBack:j,onClear:ie,onToggleHistory:se,onSelectHistoryConversation:N,onNewConversation:I,onWidgetSizeChange:ne,onSend:$,onStop:Be,onSuggestion:Ne,activeForm:O,formMarkers:G,onFormSubmit:Z,onFormSkip:Re,onFormFill:De,tool:Xe,onRetry:Ve,onMessageFeedback:xe,containerEl:Se,dragOver:Je,composerAttachApiRef:k}=e,B=t.strings,ue;return O?ue=null:c?ue=r(ee,{children:[u&&u!=="ai-agent"?r(nm,{controlMode:u,operatorInitials:m,operatorAvailable:_,onCancelRequest:b,strings:B}):null,!d&&u==="ai-agent"&&r(Hc,{suggestions:v,onPick:Ne}),r(Ql,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,operatorRequestEnabled:h,controlMode:u,onRequestOperator:f,onSend:$,onStop:Be,attachApiRef:k})]}):ue=r(tm,{label:B.conversationClosed,ctaLabel:B.startNewConversation,onNewConversation:ie}),r(ee,{children:[s==="history"?r(em,{strings:B,onBack:se,onClose:te,showClose:Wo(t.mode,l,t.actions)}):r("header",{class:`${Te}-header`,"data-testid":w.panelHeader,children:[j?r("button",{type:"button",class:`${Te}-icon-btn`,onClick:j,"aria-label":B.moduleBack,title:B.moduleBack,children:r(On,{})}):null,C?r(Xl,{agent:C,strings:B}):r("h1",{children:B.panelTitle}),r(nt,{panelProps:e,variant:"chat"})]}),s==="history"?r(rr,{transport:n,strings:B,locale:t.locale,persistence:i,visitorId:U,onSelect:me=>N(me.conversationId),onNewConversation:I}):r(ee,{children:[r(Zl,{visible:Je,strings:B}),r(Dc,{messagesSig:x,strings:B,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:xe,loading:g,idle:!d,tool:Xe,onRetry:Ve,form:O?{form:O,onSubmit:Z,onSkip:Re}:null,formMarkers:G,onFillForm:De}),ue,r(rm,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(Uo,{panelEl:Se,resize:t.size.resize,position:t.position,initialSize:S,onSizeChange:ne,strings:B}):null]})}function em({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Te}-header`,children:[r("button",{type:"button",class:`${Te}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(On,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Te}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(tt,{})}):null]})}function tm({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Te}-readonly-banner`,role:"note",children:[r("span",{class:`${Te}-readonly-label`,children:e}),r("button",{type:"button",class:`${Te}-readonly-cta`,onClick:n,children:t})]})}function nm({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelRequest:o,strings:a}){let i=om(e,t,n,a);return r("div",{class:`${Te}-operator-banner`,role:"status","data-mode":e,"data-testid":w.operatorBanner,children:[r("span",{class:`${Te}-operator-pulse`,"aria-hidden":"true"}),r("span",{class:`${Te}-operator-label`,children:i}),e==="awaiting_operator"&&o?r("button",{type:"button",class:`${Te}-operator-cancel`,"data-testid":w.operatorCancelRequest,onClick:o,children:a.cancelOperatorRequest}):null]})}function om(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function rm({disclaimer:e}){return e?r("div",{class:`${Te}-composer-footer`,children:r("div",{class:`${Te}-disclaimer`,children:e})}):null}function Na({poweredBy:e}){return e?r("div",{class:`${Te}-poweredby-bar`,children:r(am,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function am({logoUrl:e,text:t,href:n}){let o=r(ee,{children:[e?r("img",{class:`${Te}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Te}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Te}-poweredby`,children:o})}function Uc(e){let t=F(e);t.current=e;let n=F(null);return n.current??(n.current=im(t)),n.current}function im(e){let t=q(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,a=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let m=u.forms.list.find(_=>_.id===d);m&&(t.value={form:m,trigger:"manual"});return}for(let m of u.forms.byTrigger[c]??[]){let _=m.triggers.find(h=>h.kind===c);if(!(!_||!sm(_,u)||a(m)||!lm(m,u))){t.value={form:m,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:m,trigger:_}=u;m.frequency==="conversation"?n.add(o(m.id)):m.frequency!=="always"&&e.current.persistence.saveFormDone(m.id),e.current.onComplete(m,_,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function sm(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function lm(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let a=t.userContext()??{};if(n.missingContext.some(i=>a[i]!==void 0&&a[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function qc(e){let t=P.cssPrefix,{site:n,blocks:o,strings:a,collapsed:i}=e,l=o?.navigation??[],s=o?.linkCards??[],c=i?a.expandSidebar:a.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":w.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(cm,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":w.sidebarToggle,children:r(dm,{collapsed:i})})]}),i?null:r(ee,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(_m,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(um,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(rr,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function cm({site:e}){let t=P.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return r("picture",{children:[e.logoDark?.url?r("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,r("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return r("div",{class:`${t}-sidebar-title`,children:e?.title??P.name})}function dm({collapsed:e}){return r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?r("polyline",{points:"9 6 15 12 9 18"}):r("polyline",{points:"15 6 9 12 15 18"})})}function _m({items:e}){let t=P.cssPrefix;return r("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>r("li",{children:r("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?r("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,r("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function um({items:e}){let t=P.cssPrefix;return r("div",{class:`${t}-sidebar-cards`,children:e.map(n=>r("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[r("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?r("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var Wc=P.cssPrefix;function Vc(e){return r("main",{class:`${Wc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(qc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),r("section",{class:`${Wc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Kc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Gc(e,t,n){let o=q({activeTab:e,stacks:Kc(t)});return{sig:o,switchTab(a){o.value.activeTab!==a&&(o.value={...o.value,activeTab:a},n?.(a))},push(a){let i=o.value,l=i.stacks[i.activeTab]??[];o.value={...i,stacks:{...i.stacks,[i.activeTab]:[...l,a]}}},pop(){let a=o.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(o.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){o.value={activeTab:a,stacks:Kc(t)}}}}var jc=e=>e.stacks[e.activeTab]??[],Xc=e=>jc(e).at(-1),Yc=e=>jc(e).length===0;var Jc={Icon:Dn};var Pt=P.cssPrefix;function ar({title:e,actions:t}){return r("header",{class:`${Pt}-back-header`,"data-variant":"title",children:[r("span",{class:`${Pt}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${Pt}-back-title`,children:e}),t??r("span",{class:`${Pt}-back-spacer`,"aria-hidden":"true"})]})}function ir({title:e,backLabel:t,onBack:n,actions:o,testid:a}){return r("header",{class:`${Pt}-back-header`,"data-testid":a,children:[r("button",{type:"button",class:`${Pt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(On,{})}),r("h1",{class:`${Pt}-back-title`,children:e}),o??r("span",{class:`${Pt}-back-spacer`,"aria-hidden":"true"})]})}var an=P.cssPrefix;function Qc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${an}-home-search`,onClick:t,"data-testid":w.homeSearch,children:[r("span",{class:`${an}-home-search-text`,children:e}),r("span",{class:`${an}-home-search-icon`,"aria-hidden":"true",children:r(pa,{})})]})}function Zc({placeholder:e,value:t,onInput:n}){return r("div",{class:`${an}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${an}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":w.helpSearch}),r("span",{class:`${an}-home-search-icon`,"aria-hidden":"true",children:r(pa,{})})]})}var Hn=P.cssPrefix;function sr({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${Hn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${Hn}-list-row-body`,children:[r("span",{class:`${Hn}-list-row-title`,children:e}),t?r("span",{class:`${Hn}-list-row-sub`,children:t}):null]}),r("span",{class:`${Hn}-list-row-chevron`,"aria-hidden":"true",children:r(tn,{})})]})}var ed=P.cssPrefix;function je({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${ed}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${ed}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var $t=P.cssPrefix,pm=W.scope("help"),fm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function mm(e){let t=new Map;for(let n of e){let o=n.categories?.[0]??"";(t.get(o)??t.set(o,[]).get(o)).push(n)}return[...t.entries()]}function td(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let a=0;for(let i of e){if(a=n.indexOf(i,a),a===-1)return 0;a+=1}return 1}function gm(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(td(n,o.title)*2,td(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function nd({article:e,nav:t}){return r(sr,{title:e.title,subtitle:e.description,onClick:()=>fm(t,e),testid:Ce(w.helpArticle,e.id)})}function hm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=T("loading"),[d,u]=T(t.errorGeneric),[m,_]=T([]),[h,f]=T(""),[b,g]=T(0);E(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(S=>{if(v)return;let U=S.items??[];_(U),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:U.length})}).catch(S=>{v||(pm.warn("listContent (help) failed",{err:S}),u(en(S,t)),c("error"))}),()=>{v=!0}},[e,l,b,a]);let x=Me(()=>gm(m,h),[m,h]);E(()=>{let v=h.trim();if(!v)return;let S=setTimeout(()=>a.emit("contentSearch",{queryLength:v.length,hitCount:x.length}),600);return()=>clearTimeout(S)},[h,x,a]);function C(){return h.trim().length>0?x.length===0?r(je,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${$t}-help-card`,children:x.map(v=>r(nd,{article:v,nav:o},v.id))}):s==="loading"?r(je,{message:t.helpLoading,strings:t}):s==="error"?r(je,{tone:"error",message:d,onRetry:()=>g(v=>v+1),strings:t}):m.length===0?r(je,{message:t.helpEmpty,strings:t}):mm(m).map(([v,S])=>r("section",{class:`${$t}-help-group`,children:[v?r("h2",{class:`${$t}-help-section-title`,children:v}):null,r("div",{class:`${$t}-help-card`,children:S.map(U=>r(nd,{article:U,nav:o},U.id))})]},v))}return r("div",{class:`${$t}-module`,children:[r(ar,{title:t.helpTitle,actions:r(nt,{panelProps:i,variant:"plain"})}),r("div",{class:`${$t}-module-pad`,children:r(Zc,{placeholder:t.helpSearchPlaceholder,value:h,onInput:f})}),r("div",{class:`${$t}-help-list`,children:C()})]})}var od={Icon:Nn,Root:e=>r(hm,{...e})};var rd=P.cssPrefix;function Da({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${rd}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${rd}-home-card`,"data-testid":n,children:t})}var _e=P.cssPrefix,ad=W.scope("home");function vm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Oe(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var bm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function ym(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=T(null),[d,u]=T([]),m=o.contentTags?.join(",");E(()=>{if(o.showRecentConversations===!1)return;let x=!1;return t.listConversations({limit:1}).then(C=>!x&&c(C.conversations?.[0]??null)).catch(C=>!x&&ad.warn("listConversations (home) failed",{err:C})),()=>{x=!0}},[t,o.showRecentConversations]),E(()=>{if(!o.contentTags?.length)return;let x=!1;return t.listContent({tags:o.contentTags,limit:6}).then(C=>{if(x)return;let v=C.items??[];u(v),i.emit("contentView",{section:"home",tags:m,count:v.length})}).catch(C=>!x&&ad.warn("listContent (home) failed",{err:C})),()=>{x=!0}},[t,m,i]);let _=vm(e),h=o.userAvatars??[],f=o.status,b=f?.text?Oe(n,f.text):n.homeStatus,g=o.contentBlockTitle?Oe(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${_e}-module ${_e}-home`,"data-testid":w.homeView,children:r("div",{class:`${_e}-home-scroll`,children:[r("div",{class:`${_e}-home-hero`,children:[r("div",{class:`${_e}-home-hero-top`,children:[o.brandName?r("span",{class:`${_e}-home-brand`,"data-testid":w.homeBrand,children:o.brandName}):r("span",{class:`${_e}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${_e}-home-hero-actions`,children:[h.length>0?r("div",{class:`${_e}-home-avatars`,children:h.map(x=>r("span",{class:`${_e}-home-avatar`,title:x.role?`${x.name} \xB7 ${x.role}`:x.name,children:x.avatar?r("img",{src:x.avatar,alt:"",loading:"lazy"}):r("span",{children:Ko(x.name)})},x.name))}):null,r(nt,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(ee,{children:[r("h1",{class:`${_e}-home-greeting`,"data-testid":w.homeGreeting,children:_.title}),_.subtitle?r("p",{class:`${_e}-home-lead`,children:_.subtitle}):null]}):null]}),r("div",{class:`${_e}-home-cards`,children:[o.showSearchBar!==!1?r(Qc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(Da,{onClick:()=>a.selectConversation(s.conversationId),testid:w.homeRecent,children:r("div",{class:`${_e}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[r("span",{class:`${_e}-home-recent-avatar`,"aria-hidden":"true",children:r(Dn,{})}),r("span",{class:`${_e}-home-recent-body`,children:[r("span",{class:`${_e}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${_e}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?r("span",{class:`${_e}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,f?r(Da,{onClick:f.url?()=>a.push({kind:"iframe",url:f.url,title:b}):void 0,children:r("div",{class:`${_e}-home-status`,"data-level":f.level??"operational",children:[r("span",{class:`${_e}-home-status-icon`,"aria-hidden":"true",children:r(Ll,{})}),r("span",{class:`${_e}-home-status-text`,children:b})]})}):null,d.length>0?r("section",{class:`${_e}-home-content`,children:[r("div",{class:`${_e}-home-content-title`,children:g}),r("div",{class:`${_e}-home-content-list`,children:d.map(x=>r(sr,{title:x.title,subtitle:x.description,onClick:()=>bm(a,x),testid:Ce(w.homeContentRow,x.id)},x.id))})]}):null]})]})})}var id={Icon:Ol,Root:e=>r(ym,{...e})};var xt=P.cssPrefix,Pm=W.scope("news");function xm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=T("loading"),[d,u]=T(t.errorGeneric),[m,_]=T([]),[h,f]=T(0);E(()=>{let g=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(x=>{if(g)return;let C=x.items??[];_(C),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:C.length})}).catch(x=>{g||(Pm.warn("listContent (news) failed",{err:x}),u(en(x,t)),c("error"))}),()=>{g=!0}},[e,l,h,a]);function b(){return s==="loading"?r(je,{message:t.newsLoading,strings:t}):s==="error"?r(je,{tone:"error",message:d,onRetry:()=>f(g=>g+1),strings:t}):m.length===0?r(je,{message:t.newsEmpty,strings:t}):r("div",{class:`${xt}-news-list`,children:m.map(g=>r("button",{type:"button",class:`${xt}-news-card`,onClick:()=>o.push({kind:"content",id:g.id,title:g.title}),"data-testid":Ce(w.newsItem,g.id),children:[g.image?r("img",{class:`${xt}-news-hero`,src:g.image,alt:"",loading:"lazy"}):null,r("span",{class:`${xt}-news-body`,children:[r("span",{class:`${xt}-news-title`,children:g.title}),g.description?r("span",{class:`${xt}-news-summary`,children:g.description}):null]})]},g.id))})}return r("div",{class:`${xt}-module`,children:[r(ar,{title:t.newsTitle,actions:r(nt,{panelProps:i,variant:"plain"})}),r("div",{class:`${xt}-module-scroll`,children:b()})]})}var sd={Icon:Nl,Root:e=>r(xm,{...e})};var lr={chat:Jc,home:id,help:od,news:sd};var zn=P.cssPrefix;function ld({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${zn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=lr[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${zn}-tab`,onClick:()=>a(i.id),"data-testid":Ce(w.tab,i.id),children:[r("span",{class:`${zn}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${zn}-tab-badge`,"data-testid":w.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${zn}-tab-label`,children:Oe(n,i.label)})]},i.id)})})}var cd=P.cssPrefix,Sm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function dd({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${cd}-module`,children:[r(ir,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${cd}-content-frame`,src:e,title:t||"content",sandbox:Sm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Un=P.cssPrefix,km=W.scope("content"),wm=5e3;function _d({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=T(null),[d,u]=T(!1),[m,_]=T(0),h=D(()=>{u(!1),c(null),_(g=>g+1)},[]);E(()=>{let g=!1;return n.listContent({ids:[e],limit:1}).then(x=>{if(g)return;let C=x.items[0];C?(c(C),a.emit("contentOpen",{contentId:e,tags:C.tags?.length?C.tags.join(","):void 0})):u(!0)}).catch(x=>{g||(km.warn("listContent (reader) failed",{err:x}),u(!0))}),()=>{g=!0}},[n,e,m,a]),E(()=>{if(!s)return;let g=setTimeout(()=>a.emit("contentRead",{contentId:e}),wm);return()=>clearTimeout(g)},[s,e,a]);let f=D(g=>{let C=g.target?.closest?.("a")?.getAttribute("href")??"";C&&!C.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function b(){return d?r(je,{tone:"error",message:o.errorGeneric,onRetry:h,strings:o}):s===null?r(je,{message:o.contentLoading,strings:o}):r("article",{class:`${Un}-content`,"data-testid":w.contentView,onClick:f,children:[s.image?r("img",{class:`${Un}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Un}-content-subtitle`,children:s.description}):null,r(Cc,{text:s.content??""})]})}return r("div",{class:`${Un}-module`,children:[r(ir,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:w.backHeader}),r("div",{class:`${Un}-module-scroll`,"data-testid":w.contentScroll,children:b()})]})}var cr=P.cssPrefix;function ud({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=F(null),m=F(new Set);E(()=>{let I=u.current;if(!I)return;let ne=Vo(I),$=Be=>{Be.key==="Escape"&&e.onClose?.()};return I.addEventListener("keydown",$),()=>{ne(),I.removeEventListener("keydown",$)}},[e.onClose]);let _=e.composerApiRef,h=D(I=>{_.current?.attachFromDrop(I)},[_]),{visible:f}=jo({containerRef:u,onDrop:h});qo(u.current,c.mode==="modal");let b=J(()=>n.sig.value).value,g=Xc(b),x=c.modules.byId[b.activeTab],C=g?.kind==="iframe"||g?.kind==="content",v=t.length>1&&(Yc(b)||!C),S=F(null);E(()=>{if(C&&S.current===null)S.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!C&&S.current!==null){let I=S.current;S.current=null,s(I)}},[C]);let U={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:I=>{let ne=t.find($=>$.layout===I);ne&&n.switchTab(ne.id)},selectConversation:i,startNewConversation:l},te=I=>({options:c,transport:e.transport,strings:d,config:I,visitorId:e.visitorId,nav:U,bus:o,panelProps:e}),j=r(nt,{panelProps:e,variant:"plain"});x&&m.current.add(x.id);let ie=t.filter(I=>m.current.has(I.id)),se=I=>{if(I.layout==="chat")return r(Oa,{...e,containerEl:u.current,dragOver:f,composerAttachApiRef:_});let ne=lr[I.layout].Root;return ne?r(ne,{...te(I)}):null},N=()=>g?.kind==="iframe"?r(dd,{url:g.url,title:g.title,strings:d,onBack:n.pop,actions:j}):g?.kind==="content"?r(_d,{id:g.id,title:g.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:j}):null;return r("div",{ref:u,class:`${cr}-panel ${cr}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":w.messengerHome,children:[r("div",{class:`${cr}-messenger-body`,children:[ie.map(I=>r("div",{class:`${cr}-messenger-pane`,hidden:C||I.id!==x?.id,children:se(I)},I.id)),N()]}),v?r(ld,{modules:t,activeTab:b.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(Na,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(x?.layout==="chat"&&!g)?r(Uo,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var qn=P.cssPrefix;function pd({strings:e,onClose:t}){return r("div",{class:`${qn}-panel ${qn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":w.modulesEmpty,children:[t?r("button",{type:"button",class:`${qn}-icon-btn ${qn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(tt,{})}):null,r("p",{class:`${qn}-modules-empty-text`,children:e.modulesEmpty})]})}function fd({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=T(()=>o?!1:t.loadCalloutDismissed(n));E(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=D(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}function md(e){let{transport:t}=e,n=et("ai-agent"),o=et(void 0),a=et(void 0),i=D(d=>{n.value=d.controlMode,o.value=d.assignedOperatorInitials,d.operatorAvailable!==void 0&&(a.value=d.operatorAvailable)},[n,o,a]),l=D(d=>{d.type==="data-control-state"&&i(bt(d.data))},[i]),s=D(async()=>{if(n.value!=="ai-agent")return;let d=await t.requestOperator();d&&i(bt(d))},[t,n,i]),c=D(async()=>{if(n.value!=="awaiting_operator")return;let d=await t.cancelRequestOperator();d&&i(bt(d))},[t,n,i]);return{controlModeSig:n,assignedOperatorInitialsSig:o,operatorAvailableSig:a,applyControlState:i,adoptControlStateChunk:l,requestOperator:s,cancelRequestOperator:c}}var Cm=W.scope("unread"),Em=300;function gd(e){let{transport:t,options:n,conversationIdSig:o,isChatActiveRef:a,activated:i,conversationReady:l}=e,s=et(!1),c=F(new Set),d=F();E(()=>()=>clearTimeout(d.current),[]);let u=D(()=>{let b=a.current()?o.value:void 0;s.value=[...c.current].some(g=>g!==b)},[s,o,a]),m=D(()=>{n.modules.list.some(b=>b.layout==="chat")&&t.listConversations({limit:50}).then(b=>{c.current=new Set(b.conversations.filter(g=>g.hasUnread).map(g=>g.conversationId)),u()}).catch(b=>Cm.debug("refreshUnread failed (non-fatal)",{err:b}))},[t,n.modules,u]),_=D(b=>{c.current.delete(b),u()},[u]),h=D(()=>{if(!a.current())return;let b=o.value;b&&(clearTimeout(d.current),d.current=setTimeout(()=>{_(b),t.markRead(b)},Em))},[t,o,_,a]),f=F(!1);return E(()=>{!i||!l||f.current||(f.current=!0,m())},[i,l,m]),E(()=>{if(!i)return;let b=()=>{document.visibilityState==="visible"&&m()};return document.addEventListener("visibilitychange",b),()=>document.removeEventListener("visibilitychange",b)},[i,m]),{hasUnreadSig:s,refreshUnread:m,clearUnread:_,markActiveConversationRead:h}}var Wn=W.scope("settings");function hd(e){let{options:t,persistence:n,transport:o,feedback:a,hostElement:i,bus:l}=e,s=n.loadUserPrefs(),[c,d]=T(()=>s.locale??t.locale),[u,m]=T(()=>s.themeMode??t.themeMode),[_,h]=T(()=>s.textSize??t.textSize),f=D(S=>{n.patchUserPrefs(S),o.saveUserPrefs(n.loadUserPrefs()).catch(U=>Wn.warn("saveUserPrefs failed",{err:U}))},[n,o]);E(()=>{s.soundMuted!==void 0&&a.setMuted(s.soundMuted)},[]),E(()=>{i.dataset.theme=u},[i,u,t]),E(()=>{i.dataset.textSize=_},[i,_,t]),E(()=>{let S=!0;return a.mutedSig.subscribe(U=>{if(S){S=!1;return}f({soundMuted:U})})},[a,f]);let b=Wt(c,t.availableLocales,t.defaultLocale);E(()=>{o.setLocale(b)},[o,b]),E(()=>{i.dir=bi(b)?"rtl":"ltr"},[i,b]),E(()=>{b!==c&&d(b)},[b,c]);let g=D(S=>{Wn.info("localeChange",{locale:S}),d(S),f({locale:S}),l.emit("localeChange",S)},[f,l]),x=D(S=>{Wn.info("themeChange",{mode:S}),m(S),i.dataset.theme=S,f({themeMode:S}),l.emit("themeChange",S)},[i,f,l]),C=D(S=>{Wn.info("textSizeChange",{size:S}),h(S),i.dataset.textSize=S,f({textSize:S}),l.emit("textSizeChange",S)},[i,f,l]),v=D(()=>{a.toggleMuted();let S=a.mutedSig.value;Wn.info("soundToggle",{muted:S}),l.emit("soundToggle",{muted:S})},[a,l]);return{activeLocale:c,activeThemeMode:u,activeTextSize:_,effectiveLocale:b,setActiveLocale:d,setActiveThemeMode:m,setActiveTextSize:h,patchAndSync:f,handleLocaleChange:g,handleThemeChange:x,handleTextSizeChange:C,handleSoundToggle:v}}var Q=W.scope("app"),dr=P.cssPrefix,Tm=2500,Rm=30;function vd(e,t){return Zs({...e,text:Oe(t,e.text)})}function Im(e){let t=e.partsSig.value.filter(n=>n.kind==="tool");return t.length>0&&t.every(n=>{let o=n.stateSig.value;return o==="output-available"||o==="output-error"||o==="output-denied"||o==="approval-responded"})}function bd(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function yd({options:e,hostElement:t,bus:n}){let[o]=T(()=>ht(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=T(()=>o.getVisitorId()),l=o.loadUserPrefs(),s=et(o.loadConversationId()),c=et([]),[d,u]=T(!1),[m,_]=T([]);function h(){let p=e.modules.list,y=new Set(p.map(L=>L.id)),M=o.loadActiveModule();return M&&y.has(M)?M:p[0]?.id??""}function f(){return e.modules.list.find(p=>p.layout==="chat")?.id}function b(){let p=f();return p?e.modules.list.length===1?!0:C.sig.value.activeTab===p:!1}let g=F(b);g.current=b;let x=F();if(!x.current){let p=e.modules.list.map(y=>y.id);x.current=Gc(h(),p,y=>o.saveActiveModule(y))}let C=x.current,[v,S]=T(!1),[U,te]=T(null),[j,ie]=T(!1),se=e.mode==="standalone"||e.mode==="inline",N=F(En(e,Zt(),o.loadPanelOpen(),o.loadPanelSize())),[I,ne]=T(N.current.panelOpen),[$,Be]=T(N.current.panelOpen),Ne=F(!1),O=F(void 0);E(()=>{I&&Be(!0)},[I]);let G=F(!1),[Z,Re]=T(!1),{dismissed:De,dismissCallout:Xe}=fd({callout:e.launcher.callout,persistence:o}),Ve=e.launcher.callout?.persistent??!0,xe=D(()=>{Q.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Xe()},[n,Xe]),[Se,Je]=T(N.current.panelSize),k=F(!1),[B,ue]=T("chat"),[me,ye]=T(!0),[ce,Qe]=T(!1),Ae=F(ce);Ae.current=ce;let[Vn,ft]=T(null),[Kn,sn]=T([]),[Ga,ja]=T(null),[Gn,Xa]=T(null),jn=F(e.strings),gr=F(e);gr.current=e;let[Rd,Id]=T(void 0),[Ad,Md]=T(void 0),[Ld,Od]=T(()=>o.loadSidebarCollapsed()??!1),[hr,Nd]=T({}),[X]=T(()=>new Oo({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ws({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[at]=T(()=>new Mn(c)),[ke]=T(()=>new Fo(e.sound,e.haptics)),{activeLocale:Xn,activeThemeMode:Ya,activeTextSize:Ja,effectiveLocale:Ft,setActiveLocale:Dd,setActiveThemeMode:$d,setActiveTextSize:Fd,patchAndSync:Qa,handleLocaleChange:Bd,handleThemeChange:Hd,handleTextSizeChange:zd,handleSoundToggle:Ud}=hd({options:e,persistence:o,transport:X,feedback:ke,hostElement:t,bus:n}),{controlModeSig:vr,assignedOperatorInitialsSig:qd,operatorAvailableSig:Wd,applyControlState:br,adoptControlStateChunk:ln,requestOperator:Vd,cancelRequestOperator:Kd}=md({transport:X}),{hasUnreadSig:Gd,refreshUnread:Za,clearUnread:ei,markActiveConversationRead:jd}=gd({transport:X,options:e,conversationIdSig:s,isChatActiveRef:g,activated:$,conversationReady:v});E(()=>{ke.update(e.sound,e.haptics)},[ke,e.sound,e.haptics]),E(()=>()=>ke.destroy(),[ke]),E(()=>{k.current||!e.size.initialSize||(k.current=!0,!o.loadPanelSize()&&Je(aa(e.mode,e.size,Zt())))},[e.mode,e.size,o]),E(()=>{if(!v||G.current)return;G.current=!0;let p=En(e,Zt(),o.loadPanelOpen(),o.loadPanelSize());ne(p.panelOpen),Je(p.panelSize)},[v,e,o]);let ti=F(!1),ni=F(null);E(()=>{!v||ti.current||(ti.current=!0,C.reset(h()))},[v]);let Yn=D(p=>{!p||p.length===0||(c.value=p.map(y=>vd(y,jn.current)))},[c]),yr=F(null),Jn=D(async p=>{try{let{formSubmissions:y}=await(p?X.bootstrap(p):yr.current??X.bootstrap()),M=new Map;return y.forEach((L,V)=>M.set(L.formId,V)),y.filter((L,V)=>!L.skipped||M.get(L.formId)===V).map((L,V)=>({key:`wire:${L.formId}:${L.createdAt??V}`,formId:L.formId,outcome:L.skipped?"skipped":"submitted",createdAt:Ao(L.createdAt),values:L.values}))}catch(y){return Q.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:y}),[]}},[X]),cn=F(0),Qn=D((p,y)=>{let M=[...p.map(R=>R.createdAt),...y.map(R=>R.createdAt)].filter(R=>R!==void 0),L=(M.length?Math.min(...M):Date.now())-1;return[...(O.current?.messages??[]).map(R=>{let pe=vd(R,jn.current);return pe.createdAt=L,pe}),...p]},[]),oi=D(async p=>{let y=cn.current,M=()=>y!==cn.current;u(!0);try{let[L,V]=await Promise.all([X.loadConversation(p),Jn()]);if(M())return;let R=No(L.messages??[]);_(V);let pe=c.value.filter(re=>re.status==="streaming"&&!re.ephemeral),le=new Set(pe.map(re=>re.serverMessageId).filter(re=>re!==void 0)),ze=R.filter(re=>re.serverMessageId===void 0||!le.has(re.serverMessageId));if(c.value=[...Qn(ze,V),...pe],R.length){ye(L.canContinue??!0),br(bt(L.controlState));let re=R.findLast(Ze=>Ze.role==="assistant"&&!Ze.ephemeral);sn(re?.suggestions??L.suggestions??[])}}catch(L){if(M())return;Q.warn("loadThread failed; resetting conversationId",{err:L,conversationId:p}),s.value=void 0,o.saveConversationId(void 0)}finally{M()||u(!1)}},[X,Jn,c,s,o,Qn]),dn=D(async({newConversation:p})=>{let y=++cn.current,M=()=>y!==cn.current,L=s.value,V=p||!L?qe():L;V!==L&&(s.value=V,o.saveConversationId(V));let R;try{R=await X.handshake({visitorId:a,conversationId:V,userPrefs:o.loadUserPrefs(),locale:Xn})}catch(le){if(M())return;n.emit("error",le),e.onError?.(le),p||S(!0);return}if(M())return;if(R.visitorId&&R.visitorId!==a&&(Q.info("visitor rebound",{previous:a,current:R.visitorId,reason:R.rebind?.visitorId}),o.setVisitorId(R.visitorId),i(R.visitorId),n.emit("visitorRebound",{previous:a,current:R.visitorId,reason:R.rebind?.visitorId})),R.conversationId&&R.conversationId!==V&&(Q.info("conversation rebound",{previous:V,current:R.conversationId,reason:R.rebind?.conversationId}),n.emit("conversationRebound",{previous:V,current:R.conversationId,reason:R.rebind?.conversationId})),R.agent&&ft(R.agent),br(bt(R.controlState)),e.mode==="page"&&(R.site&&Us(R.site)?Id(R.site):R.site&&Q.warn("invalid site config, using fallback",{site:R.site}),R.blocks&&qs(R.blocks)?Md(R.blocks):R.blocks&&Q.warn("invalid blocks config, using fallback",{blocks:R.blocks})),R.userPrefs&&!p&&(o.saveUserPrefs(R.userPrefs),R.userPrefs.locale&&Dd(R.userPrefs.locale),R.userPrefs.soundMuted!==void 0&&ke.setMuted(R.userPrefs.soundMuted),R.userPrefs.themeMode&&$d(R.userPrefs.themeMode),R.userPrefs.textSize&&Fd(R.userPrefs.textSize)),O.current=R.welcome,p||n.emit("handshake",R),R.welcome?.suggestions){let le=jn.current;sn(R.welcome.suggestions.map(ze=>({...ze,label:Oe(le,ze.label),...ze.text===void 0?{}:{text:Oe(le,ze.text)}})))}!p&&L&&R.conversationId===L?Ne.current=!0:(s.value=R.conversationId,o.saveConversationId(R.conversationId),Yn(R.welcome?.messages)),p||S(!0)},[X,a,o,e,n,s,ke,Yn,oi,Xn]),_n=JSON.stringify(e.userContext??null),Xd=JSON.stringify(e.pageContext??null),Yd=JSON.stringify(hr);E(()=>{let p=Object.keys(hr).length?{...hr,...e.userContext}:e.userContext;X.setContext(p,Am(e.pageContext))},[X,_n,Xd,Yd]);let Jd=D((p,y=[])=>sn(p.suggestions??y),[]),Zn=D(p=>{if(p.type!=="data-conversation-rebind")return!1;let y=p.data?.conversationId;if(y&&y!==s.value){let M=s.value;s.value=y,o.saveConversationId(y),X.primeIdentity(void 0,y),Q.info("conversation rebound (in-stream)",{previous:M,current:y}),M&&n.emit("conversationRebound",{previous:M,current:y,reason:y})}return!0},[s,o,X,n]);E(()=>(X.primeIdentity(a,s.value),dn({newConversation:!1}),()=>{cn.current++}),[]);let ri=F(!1);E(()=>{if(!(!$||!v||ri.current)&&(ri.current=!0,yr.current=X.bootstrap(),(async()=>{try{let p=await yr.current;te(hn((p??{forms:[]}).forms,Ft))}catch(p){Q.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{ie(!0)}})(),Ne.current)){Ne.current=!1;let p=s.value;p&&oi(p)}},[$,v]);let eo=F(null);E(()=>{if(!$||!v)return;if(eo.current===null){eo.current=Ft;return}if(eo.current===Ft)return;eo.current=Ft;let p=!1;return X.bootstrap().then(y=>{p||te(hn((y??{forms:[]}).forms,Ft))}).catch(y=>Q.debug("forms re-localize failed \u2014 keeping current copy",{err:y})),()=>{p=!0}},[$,v,Ft,X]);let ai=F(_n);E(()=>{!v||ai.current===_n||(ai.current=_n,dn({newConversation:!1}))},[_n,v,dn]),E(()=>{if(!$||!v||!s.value)return;let p=s.value,y=new AbortController,M=new Mn(c);X.primeIdentity(a,p),Q.debug("resume stream opened",{conversationId:p});let L=re=>{ln(re);let Ze=c.value.length,Ke=M.applyResume(re,Ae.current);if(c.value.length>Ze){let zt=gr.current.modules.list.find(fn=>fn.layout==="chat")?.id;zt&&C.switchTab(zt)}Ke?.role==="operator"&&(ke.play("messageReceived"),_r(n,gr.current,"operator",Rt(Ke)),!document.hidden&&g.current()&&X.markRead(p).catch(()=>{}))},V=async()=>{let re=await X.loadConversation(p).catch(()=>null);if(y.signal.aborted||!re?.messages?.length)return!1;let Ze=new Map(No(re.messages).filter(Le=>Le.serverMessageId!==void 0).map(Le=>[Le.serverMessageId,Le])),Ke=c.value,zt=new Set(Ke.flatMap(Le=>[Le.serverMessageId,Le.id].filter(Ut=>Ut!==void 0))),fn=!1,d_=Ke.map(Le=>{if(Le.serverMessageId===void 0)return Le;let Ut=Ze.get(Le.serverMessageId);return Ut!==void 0&&Rt(Ut).length>Rt(Le).length?(fn=!0,Ut.id=Le.id,Ut):Le}),Rr=[...Ze.values()].filter(Le=>!zt.has(Le.serverMessageId));return(fn||Rr.length)&&(c.value=[...d_,...Rr]),fn||Rr.length>0};il({signal:y.signal,now:()=>performance.now(),sleep:re=>Tn(re,y.signal),connect:re=>X.connectResumeStream({signal:y.signal,onChunk:L,onConnected:re}),backfill:()=>{Ae.current||V()}});let R=re=>re.partsSig.value.reduce((Ze,Ke)=>Ze+(Ke.kind==="text"||Ke.kind==="reasoning"?Ke.textSig.value.length:1),0),pe=0,le=-1,ze=setInterval(()=>{let re=c.value.at(-1);if(!(!Ae.current&&re!==void 0&&re.role!=="user"&&!re.ephemeral&&re.status==="streaming")){pe=0,le=-1;return}let Ke=R(re);if(Ke!==le){le=Ke,pe=0;return}pe++>=Rm||V().then(zt=>{zt&&(pe=0)})},Tm);return()=>{y.abort(),clearInterval(ze),M.detach(),Q.debug("resume stream closed",{conversationId:p})}},[$,v,s,s.value,a,X,ln,c,n,ke,C]),vt(()=>{bo(t,Io(e.mode,Se,I))},[t,I,Se,e.mode]),E(()=>{if(e.mode!=="modal"||!I)return;let p=y=>{y.composedPath().some(V=>V instanceof HTMLElement&&V.classList.contains(`${P.cssPrefix}-panel`))||ne(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,I,e.mode]),E(()=>{if(e.mode!=="drawer"||!I)return;let p=y=>{y.key==="Escape"&&ne(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[I,e.mode]);let Bt=D(async(p,{continueExisting:y})=>{let M=s.value??qe();s.value||(s.value=M,o.saveConversationId(M));let L=tl(c.value,y),V=sa({messages:L.map(ca),conversationId:M,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});Qe(!0);let R=X.sendMessage(V);ja(()=>R.cancel),Xa(()=>R.detach);try{for await(let le of R.iter)Zn(le.chunk)||(ln(le.chunk),at.apply(le.chunk),le.chunk.type==="finish"&&le.chunk.canContinue===!1&&ye(!1));let pe=p.status==="error";switch(ol(p,pe)){case"drop":c.value=c.value.filter(le=>le!==p);break;case"complete-operator-routed":p.status="complete",ke.play("messageReceived"),_r(n,e,"assistant",Rt(p));break;case"error":{p.status="error",p.errorText=e.strings.errorGeneric,ke.play("error");let le=new Error(pe?"stream error chunk":"empty reply");n.emit("error",le),e.onError?.(le);break}case"complete":p.status="complete",ke.play("messageReceived"),_r(n,e,"assistant",Rt(p)),Jd(p);break}}catch(pe){bd(pe)?In(p)?c.value=c.value.filter(le=>le!==p):p.status="complete":(p.status="error",p.errorText=en(pe,e.strings),ke.play("error"),n.emit("error",pe),e.onError?.(pe))}finally{at.detach(),Qe(!1),ja(null),Xa(null),c.value=[...c.value],jd()}},[X,at,c,s,e,n,ke,o,a,Zn]),to=D((p,y)=>{if(ce)return;let M=c.value.at(-1),L=M?.partsSig.value.find(V=>V.kind==="tool"&&V.toolCallId===p);if(!M||!L){Q.warn("decideTool: tool part not found",{toolCallId:p});return}y(L),M.partsSig.value=[...M.partsSig.value],Im(M)&&(M.status="streaming",c.value=[...c.value],at.attach(M),Bt(M,{continueExisting:!0}))},[ce,c,at,Bt]),ii=D((p,y)=>{Q.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),to(p,M=>{M.outputSig.value=y,M.stateSig.value="output-available"})},[n,to]),si=D((p,y,M)=>{Q.info("toolDecision",{toolCallId:p,approved:y}),n.emit("toolDecision",{toolCallId:p,approved:y}),to(p,L=>{let V=L.approvalSig.value?.id??p;L.approvalSig.value={id:V,approved:y,reason:M},L.stateSig.value="approval-responded"})},[n,to]),li=D(p=>{if(ce)return;let y=c.value.at(-1),M=y?.partsSig.value.find(V=>V.kind==="tool"&&V.toolCallId===p);if(!y||!M)return;let L=M.approvalSig.value?.id??p;M.approvalSig.value={id:L},M.stateSig.value="approval-requested",y.partsSig.value=[...y.partsSig.value]},[ce,c]),Qd=D((p,y)=>{Q.info("messageFeedback",{messageId:p,value:y}),n.emit("messageFeedback",{messageId:p,value:y}),X.submitFeedback({messageId:p,value:y})},[n,X]),Zd=Me(()=>({humanInLoop:e.features.humanInLoop,onResult:ii,onDecision:si,onEdit:li}),[e.features.humanInLoop,ii,si,li]),e_=()=>c.value.reduce((p,y)=>p+(y.role==="user"?1:0),0),Ht=e.forms.list.length>0?e.forms:U??e.forms,ge=Uc({forms:Ht,persistence:o,userContext:()=>e.userContext,messageCount:e_,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>s.value,onComplete:(p,y,M,L)=>{Q.info("formSubmit",{formId:p.id,trigger:y,skipped:L}),n.emit("formSubmit",{formId:p.id,values:M,skipped:L}),_(R=>{let le=R.find(ze=>ze.formId===p.id&&ze.outcome==="skipped")?.createdAt??Date.now();return[...R.filter(ze=>!(ze.formId===p.id&&ze.outcome==="skipped")),{key:`local:${p.id}:${le}`,formId:p.id,outcome:L?"skipped":"submitted",createdAt:le,...L?{}:{values:M}}]});let V=s.value??qe();s.value||(s.value=V,o.saveConversationId(V),X.primeIdentity(void 0,V)),!L&&p.mirrorToContext&&Nd(R=>({...R,...M})),X.submitForm({formId:p.id,conversationId:V,trigger:y,values:M,skipped:L})}}),t_=J(()=>ge.activeForm.value);E(()=>{ge.refresh()},[Ht,ge]);let ci=e.pageContext?.area?String(e.pageContext.area):void 0,n_=J(()=>c.value.length);E(()=>{v&&j&&ge.fire("pre-chat")},[v,j,ge]),E(()=>{j&&!me&&ge.fire("conversation-closed")},[j,me,ge]),E(()=>{v&&j&&ci&&ge.fire("page-area")},[v,j,ci,ge]);let Pr=Me(()=>{let p=Ht.list.flatMap(y=>y.triggers).filter(y=>y.kind==="idle").map(y=>Number(y.param));return p.length?Math.min(...p)*1e3:0},[Ht]);E(()=>{if(!Pr||!I)return;let p=setTimeout(()=>ge.fire("idle"),Pr);return()=>clearTimeout(p)},[Pr,I,ge,n_.value]);let di=D(async p=>{let y=s.value??qe();s.value||(s.value=y,o.saveConversationId(y));let M=sa({messages:[ca(p)],conversationId:y,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});try{for await(let L of X.sendMessage(M).iter)Zn(L.chunk)||(ln(L.chunk),L.chunk.type==="start"&&L.chunk.messageId&&L.chunk.messageMetadata?.senderRole==="visitor"&&(p.serverMessageId=L.chunk.messageId))}catch(L){if(bd(L))return;Q.debug("operator-routed send failed (non-fatal)",{error:L}),n.emit("error",L instanceof Error?L:new Error(String(L))),e.onError?.(L instanceof Error?L:new Error(String(L)))}},[X,s,o,e,a,Zn,ln,n]),_i=D(async(p,y)=>{let M=vr.value!=="ai-agent";if(Q.info("send",{textLen:p.length,attachments:y.length,streaming:ce,routedToOperator:M}),ce&&!M)return;n.emit("send",{text:p,attachmentCount:y.length}),Kn.length>0&&sn([]);let L=await Lm(X,y,pe=>{Q.warn("upload failed",{err:pe}),n.emit("error",pe),e.onError?.(pe)});ke.unlock(),ke.play("messageSent");let V=Qs(p,L);if(_r(n,e,"user",p),M){c.value=[...c.value,V],di(V);return}let R=Rn();c.value=[...c.value,V,R],at.attach(R),await Bt(R,{continueExisting:!1}),ge.fire("after-messages")},[ce,X,n,e,Kn.length,c,at,Bt,di,ge,vr]),o_=D(()=>{Q.info("stop"),n.emit("stop",void 0),Ga?.()},[Ga,n]),r_=D(()=>{if(ce)return;let p=c.value,y=p.at(-1);if(!y||y.role!=="assistant"||y.status!=="error"&&!_t(y))return;let M=Rn();c.value=[...p.slice(0,-1),M],at.attach(M),Q.info("retry"),Bt(M,{continueExisting:!1})},[ce,c,at,Bt]),un=D(()=>{if(jl(e.mode,Se)==="exit-fullscreen"){Q.info("close \u2192 exit-fullscreen",{mode:e.mode}),Je("normal"),n.emit("fullscreen",!1);return}Q.info("close \u2192 panel closed",{mode:e.mode}),ge.fire("panel-close"),ne(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Se,ge]),xr=D(()=>{Q.info("open",{mode:e.mode}),ke.unlock(),Re(!0),ne(!0),o.savePanelOpen(!0),!De&&!Ve&&xe(),setTimeout(()=>Re(!1),Mm),Za(),n.emit("open",void 0),e.onOpen?.()},[n,e,ke,o,De,Ve,xe,Za]),Sr=D(()=>{if(!c.value.some(y=>y.role==="user")&&me&&s.value){Q.info("clear \u2192 reusing empty conversation",{conversationId:s.value}),c.value.length===0&&Yn(O.current?.messages);return}Q.info("clear \u2192 new conversation",{wasStreaming:ce}),n.emit("clear",void 0),ce&&Gn?.(),Yt(()=>{c.value=[],s.value=void 0}),o.clearConversation(),ye(!0),_([]),dn({newConversation:!0})},[ce,Gn,c,s,o,dn,n,me,Yn]),kr=D(()=>{Sr(),ue("chat");let p=e.modules.list.find(y=>y.layout==="chat")?.id;p&&C.switchTab(p)},[Sr,C,e]),wr=D(()=>{let p=Se==="expanded"?"normal":"expanded";Q.info("expand",{from:Se,expanded:p==="expanded"}),Je(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,Se,o]),Cr=D(()=>{let p=Se==="fullscreen"?"normal":"fullscreen";Q.info("fullscreen",{from:Se,fullscreen:p==="fullscreen"}),Je(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,Se,o]),a_=D(()=>{ue(p=>{let y=p==="history"?"chat":"history";return Q.info("toggleHistory",{view:y}),n.emit("toggleHistory",{view:y}),y})},[n]),i_=D(()=>{Od(p=>{let y=!p;return Q.info("sidebarToggle",{collapsed:y}),o.saveSidebarCollapsed(y),n.emit("sidebarToggle",{collapsed:y}),y})},[o,n]),s_=D(p=>{Q.info("resize",p),Qa({widgetSize:p}),n.emit("resize",p)},[Qa,n]),Er=D(async p=>{Q.info("selectConversation",{conversationId:p,wasStreaming:ce}),n.emit("selectConversation",{conversationId:p}),ce&&Gn?.();try{let[y,M]=await Promise.all([X.loadConversation(p),Jn(p)]),L=No(y.messages);Yt(()=>{c.value=Qn(L,M),s.value=y.conversationId}),_(M),o.saveConversationId(y.conversationId),X.primeIdentity(a,y.conversationId),y.agent&&ft(y.agent),ye(y.canContinue),br(bt(y.controlState));let V=L.findLast(R=>R.role==="assistant"&&!R.ephemeral);sn(V?.suggestions??y.suggestions??[]),ue("chat"),await X.markRead(p),ei(p)}catch(y){n.emit("error",y),e.onError?.(y)}},[X,c,s,n,e,o,ei,Jn,Qn,ce,Gn,a]),no=F(null),ui=D(p=>{typeof p=="string"&&(j?ge.fire("manual",p):no.current=p)},[j,ge]);E(()=>{!j||!no.current||(ge.fire("manual",no.current),no.current=null)},[j,ge]),E(()=>ss(t,{open:xr,close:un,expand:wr,fullscreen:Cr,openForm:ui}),[t,xr,un,wr,Cr,ui]);let He=Me(()=>zr(e,Xn,Ya,Ja),[e,Xn,Ya,Ja]);jn.current=He.strings;let l_=Me(()=>m.map(p=>{let y=Ht.list.find(M=>M.id===p.formId);return{...p,title:y?.title,form:y}}),[m,Ht]),pi={options:He,transport:X,feedback:ke,bus:n,persistence:o,composerApiRef:ni,view:B,canSend:me,isStreaming:ce,controlMode:vr.value,assignedOperatorInitials:qd.value,operatorAvailable:Wd.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Vd,onCancelRequest:Kd,loadingMessages:d,messagesSig:c,agent:Vn,suggestions:Kn,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:un,onClear:Sr,onExpand:wr,onFullscreen:Cr,onSoundToggle:Ud,onToggleHistory:a_,onSelectHistoryConversation:Er,onNewConversation:kr,onLocaleChange:Bd,onThemeChange:Hd,onTextSizeChange:zd,onWidgetSizeChange:s_,onSend:_i,onStop:o_,onSuggestion:p=>{let y=p.text??p.label;Q.info("suggestion",{text:y,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:y}),e.autoSendSuggestions?_i(y,[]):ni.current?.fill(y)},activeForm:t_.value?.form??null,formMarkers:l_,onFormSubmit:ge.complete,onFormSkip:ge.skip,onFormFill:p=>ge.fire("manual",p),tool:Zd,onRetry:r_,onMessageFeedback:Qd},c_=p=>{Er(p);let y=f();y&&C.switchTab(y)};if(!v)return null;let pn=He.modules.list,Tr=p=>{let y=$n("close",He.mode,p);return pn.length===0?r(pd,{strings:He.strings,onClose:y?un:void 0}):pn.length===1&&pn[0]?.layout==="chat"?r(zc,{...pi,panelSize:p}):r(ud,{panelProps:{...pi,panelSize:p,onClose:y?un:void 0},enabledModules:pn,nav:C,bus:n,hasUnread:Gd.value,onSelectConversation:c_,onStartNewConversation:kr,onSetPanelSize:Je})};if(e.mode==="page"){let p=M=>{Er(M.conversationId)},y=pn.some(M=>M.layout==="chat");return r("div",{class:`${dr}-anchor`,children:r(Vc,{site:Rd,blocks:Ad,transport:X,strings:He.strings,locale:He.locale,persistence:o,visitorId:a,showConversations:y,onSelectConversation:p,onNewConversation:kr,sidebarCollapsed:Ld,onToggleSidebarCollapsed:i_,children:Tr("fullscreen")})})}if(se){let p=e.mode==="standalone"?"fullscreen":Se;return r("div",{class:`${dr}-anchor`,children:Tr(p)})}let fi=e.mode==="drawer",mi=!(e.mode==="modal")&&!e.launcher.hidden&&(!I||Z),gi=mi&&!Z&&!De&&!fi?He.launcher.callout:null;return r("div",{class:`${dr}-anchor`,"data-launcher-size":He.launcher.size,children:[I||$?r("div",{class:`${dr}-surface`,hidden:!I,children:Tr(Se)}):null,mi?r(Vl,{onToggle:xr,launcher:He.launcher,strings:He.strings,leaving:Z,edgeTab:fi}):null,gi?r(Kl,{callout:gi,launcherPosition:He.position,strings:He.strings,closeLabel:He.strings.close,onDismiss:xe}):null]})}function Am(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Mm=120;async function Lm(e,t,n){let o=[];for(let a of t)try{let{id:i,url:l}=await e.uploadFile(a.file);o.push({id:i,name:a.name,mediaType:a.mediaType,size:a.size,url:l})}catch(i){n(i)}return o}function _r(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var Om=W.scope("error-boundary"),ur=class extends $e{constructor(){super(...arguments);K(this,"state",{crashed:!1})}componentDidCatch(n,o){Om.error("widget render crashed",{error:n,componentStack:o?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,o?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Nm="1",Dm=60,$m=2e3,Pd={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function Fm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Bm(){return location.origin+location.pathname}function Hm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function xd(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:m,aiAgentDeploymentId:_,mode:h,themeMode:f}=t.getOptions();if(!u.enabled||Fm()||n>=u.sampleRate)return;let b=performance.now();if(b-o>6e4&&(o=b,a=0),++a>Dm)return;let g=new URLSearchParams;g.set("v",Nm),g.set("_ev",Kt),g.set("e",c),u.token&&g.set("tk",u.token),m&&g.set("pk",m),_&&g.set("dep",_),g.set("vid",t.getVisitorId());let x=t.getConversationId();x&&g.set("cid",x),g.set("url",Bm());let C=Hm();C&&g.set("ref",C),g.set("sw",String(screen.width)),g.set("sh",String(screen.height)),g.set("vw",String(innerWidth)),g.set("vh",String(innerHeight)),g.set("dpr",String(devicePixelRatio)),g.set("lang",navigator.language);try{g.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(g.set("m",h),g.set("th",f),d)for(let[te,j]of Object.entries(d))j!==void 0&&g.set(te,String(j));g.set("ts",String(Date.now()));let v=`${u.endpoint}?${g}`;if(v.length>$m)return;let S=new Image(1,1);i.add(S);let U=()=>i.delete(S);S.addEventListener("load",U,{once:!0}),S.addEventListener("error",U,{once:!0}),S.src=v},s=Object.keys(Pd).map(c=>e.on(c,d=>l(c,Pd[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function pr(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=mt(l),d=!0,u=()=>{c=mt(s?Ur(l,s):l)},m=()=>{gs(n,Et(c.mode));let f=a.loadUserPrefs().themeMode;hs(n,f?{...c,themeMode:f}:c),d&&(bo(n,$a(c)),d=!1)},_=()=>{m(),wt(lt(ur,{onError:i},lt(yd,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",f=>{f.config&&(f.config.storageVersion&&a.rememberStorageVersion(f.config.storageVersion),s=f.config,u(),_())});let h=xd(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:_,setUserOptions:f=>{l=f,u(),_()},patchUserOptions:f=>{l={...l,...f},u(),_()},destroy:()=>h()}}function $a(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=ht(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=En(e,Zt(),t.loadPanelOpen(),t.loadPanelSize());return Io(e.mode,o,n)}var zm=W.scope("hooks"),Ba="*",Fa=new Set;function Ha(e,t,n){let o={widgetId:e,event:t,listener:n};return Fa.add(o),()=>{Fa.delete(o)}}function Um(e,t,n){let o=[...Fa];for(let a of o)if(qm(a.widgetId,e.widgetId)&&!(a.event!==Ba&&a.event!==t))try{a.listener(e,t,n)}catch(i){zm.warn("hook listener threw",{event:t,error:i})}}function Sd(e,t){let n=[];for(let o of Wm)n.push(t.on(o,a=>{Um(e,o,a)}));return()=>{for(let o of n)o()}}function za(e){if(Array.isArray(e))for(let t of e){let n=Vm(t);n&&Ha(n.widgetId,n.event,n.listener)}}function qm(e,t){return e===Ba||e===t}var Wm=["open","close","expand","fullscreen","resize","message","send","stop","clear","selectConversation","suggestion","toggleHistory","formSubmit","toolResult","toolDecision","messageFeedback","contentView","contentOpen","contentSearch","contentRead","contentLinkClick","attach","removeAttachment","voiceStart","voiceStop","voiceCancel","localeChange","themeChange","textSizeChange","soundToggle","sidebarToggle","calloutDismiss","error","handshake","visitorRebound","conversationRebound"];function Vm(e){let t,n,o;if(Array.isArray(e))[t,n,o]=e;else if(e&&typeof e=="object")({widgetId:t,event:n,listener:o}=e);else return null;return typeof t!="string"||typeof n!="string"||typeof o!="function"?null:{widgetId:t,event:n,listener:o}}var pt=new Map;function fr(e){e.debug!==void 0&&so(e.debug);let t=W.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=mt(e),o=n.widgetId,a=pt.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=$a(n),l=n.iframe?ys({position:Et(n.mode)},n.position,i,n.mode,e.target??null):Gt({position:Et(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new jt,c=ht(o,n.storage,n.aiAgentDeploymentId),d=b=>{s.emit("error",b),u.getOptions().onError?.(b)},u=pr({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let m=l.hostElement,_=null,h=b=>{b.debug!==void 0&&so(b.debug),u.patchUserOptions(b)},f={widgetId:o,open:()=>Pn(m,"open"),close:()=>Pn(m,"close"),expand:()=>Pn(m,"expand"),openForm:b=>Pn(m,"openForm",b),on:(b,g)=>s.on(b,g),update:b=>{t.debug("update",{patch:b}),h(b)},setUserContext:b=>{t.debug("setUserContext",{keys:Object.keys(b)}),h({userContext:{...u.getUserOptions().userContext,...b}})},clearUserContext:()=>{t.debug("clearUserContext"),h({userContext:void 0})},setPageContext:b=>{t.debug("setPageContext",{keys:Object.keys(b)}),h({pageContext:{...u.getUserOptions().pageContext,...b}})},clearPageContext:()=>{t.debug("clearPageContext"),h({pageContext:void 0})},setDebug:b=>{so(b),t.info("debug level set",{level:mn()})},debugLevel:()=>mn(),onLog:b=>gn(b),destroy:()=>{t.info("destroy",{widgetId:o}),_?.(),u.destroy(),s.clear(),wt(null,l.appRoot),l.destroy(),pt.get(o)===f&&pt.delete(o)}};return _=Sd(f,s),pt.set(o,f),f}function mr(e){let t=e.widgetId??"default",n=pt.get(t);return n?(n.update(e),n):fr(e)}function Ua(e){if(e!==void 0){pt.get(e)?.destroy();return}let t=[...pt.values()];for(let n of t)n.destroy()}function rt(e="default"){return pt.get(e)??null}function kd(){return[...pt.values()]}function qa(e,t,n){return Ha(e,t,n)}var wd=Kt;var Wa=class extends HTMLElement{constructor(){super(...arguments);K(this,"bus",new jt);K(this,"mountResult",null);K(this,"runtime",null)}static get observedAttributes(){return qr}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,wt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=_o(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=mt(n);this.mountResult||(this.mountResult=Gt({existingHost:this,position:Et(o.mode)}));let a=ht(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=pr({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:a,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},Cd=!1;function Va(){if(Cd||typeof customElements>"u")return;let e=P.tagName;customElements.get(e)||customElements.define(e,Wa),Cd=!0}typeof customElements<"u"&&Va();var Ed=W.scope("iife"),Ka={close:()=>rt()?.close(),destroy:()=>Ua(),expand:()=>rt()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?qa(e,t,n):void 0,init:e=>mr(e),mount:e=>fr(e),on:(e,t)=>rt()?.on(e,t),onLog:e=>gn(e),open:()=>rt()?.open(),setDebug:e=>rt()?.setDebug(e),update:e=>rt()?.update(e)};function Td(e,...t){let n=Ka[e];if(!n){Ed.warn("unknown command",{command:e});return}return n(...t)}function Km(){let e=((n,...o)=>Td(n,...o));e.init=mr,e.mount=fr,e.destroy=Ua,e.getInstance=rt,e.getAllInstances=kd,e.version=wd,e.hook=qa,e.debugLevel=()=>mn(),e.onLog=gn;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(Ka)){if(t.has(n))continue;let o=Ka[n];Reflect.set(e,n,(...a)=>o(...a))}return e}function Gm(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[a,...i]=o;if(typeof a=="string")try{Td(a,...i)}catch(l){Ed.warn("queued command failed",{command:a,error:l})}}}function jm(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)za([o]);return t(...n)},e}function Xm(){let e=document.scripts;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.src.includes("elements"))return n}return null}function Ym(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[P.global],t=Km();globalThis[P.global]=t,Va();let n=`${P.global}Hooks`,o=globalThis[n];if(za(o),globalThis[n]=jm(),Gm(e),rt())return;let a=document.currentScript??Xm(),i=Wr(a?.dataset);if(!i.publicKey)return;let l=()=>{rt()||mr(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}Ym();return g_(Jm);})();
41
+ `).trim(),I=!v&&e.status!=="error"&&!f.value&&N.length>0,ne=ie||I;return r("div",{class:`${Ce}-bubble-row`,"data-role":e.role,"data-testid":we(w.messageBubble,e.serverMessageId??e.id),children:r("div",{class:`${Ce}-bubble-col`,children:[r("div",{class:`${Ce}-bubble`,children:[e.role==="operator"&&e.operatorInitials?r("span",{class:`${Ce}-bubble-author`,children:e.operatorInitials}):null,r("div",{class:`${Ce}-bubble-body`,children:[S?r(Uf,{label:t.loading}):h.map(($,Oe)=>r($f,{part:$,active:U,live:v,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&($.kind!=="tool"||Oe>C.value),superseded:s,tool:c},`${Hf($)}#${Oe}`)),te&&r(zf,{}),e.status==="error"&&e.errorText||f.value?r("div",{class:`${Ce}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Ce}-error-retry`,onClick:d,"data-testid":w.messageRetry,children:t.errorRetry}):null]}):null]})]}),j||ne?r("div",{class:`${Ce}-bubble-meta`,children:[j?r("time",{class:`${Ce}-bubble-time`,dateTime:j.iso,title:j.full,children:j.short}):null,ne?r("div",{class:`${Ce}-bubble-actions`,children:[ie&&e.serverMessageId?r(Cc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:m}):null,I?r(Nf,{text:N,strings:t}):null]}):null]}):null]})})}function Nf({text:e,strings:t}){let[n,o]=T(!1),a=()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return r("button",{type:"button",class:`${Ce}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:a,"data-testid":w.messageCopy,children:n?r(Rt,{}):r(Fl,{})})}function Df(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function $f({part:e,active:t,live:n,strings:o,showReasoning:a,showToolCalls:i,showSources:l,interactive:s,superseded:c,tool:d}){switch(e.kind){case"step-start":return null;case"text":return r(Xo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return a?r(Bf,{part:e,active:t,strings:o}):null;case"tool":return r(Ff,{part:e,strings:o,showToolCalls:i,interactive:s,superseded:c,live:n,tool:d});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return l?r(Ec,{part:e,strings:o}):null}}function Ff({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,live:i,tool:l}){let s=J(()=>e.approvalSig.value!==void 0);if(l?.humanInLoop){if(hc(e.toolName))return r(Ac,{part:e,strings:t,active:o,superseded:a,onDecision:l.onDecision,onEdit:l.onEdit});if(s.value)return r(Tc,{part:e,strings:t,active:o,superseded:a,onDecision:l.onDecision,onEdit:l.onEdit})}return n?r(Lc,{part:e,strings:t,live:i}):null}function Bf({part:e,active:t,strings:n}){return r("details",{class:`${Ce}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Ce}-reasoning-summary`,children:r("span",{class:`${Ce}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Ce}-reasoning-body`,children:r(Xo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Hf(e){switch(e.kind){case"text":case"reasoning":case"step-start":return`${e.kind}:${e.id}`;case"tool":return`tool:${e.toolCallId}`;case"file":return`file:${e.url}`;case"source":return`source:${e.sourceId}`}}function zf(){return r("span",{class:`${Ce}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Uf({label:e}){return r("span",{class:`${Ce}-loading`,role:"status",children:[r("span",{class:`${Ce}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Ce}-loading-label`,children:e})]})}var Ot=P.cssPrefix,Ra=120,qf=350;function Nc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,enableMessageFeedback:l,onFeedback:s,loading:c,idle:d,tool:u,onRetry:m,form:_,formMarkers:h,onFillForm:f}){let b=F(null),g=J(()=>e.value),[x,C]=T(!1),v=F(!1),S=F(!1),U=F(!1),te=F(0),j=()=>U.current||performance.now()-te.current<qf,ae=F(0),ie=k=>{let B=k.scrollHeight-k.clientHeight>1;k.dataset.fadeTop=B&&k.scrollTop>1?"true":"false",k.dataset.fadeBottom=B&&k.scrollHeight-k.scrollTop-k.clientHeight>1?"true":"false"},N=k=>C(k.scrollHeight-k.scrollTop-k.clientHeight>Ra*2),I=k=>{ae.current=performance.now(),k.scrollTop=k.scrollHeight,ie(k)},ne=(k,B)=>{I(k);let _e=B,fe=0,be=()=>{I(k),--_e>0&&(fe=requestAnimationFrame(be))};return B>0&&(fe=requestAnimationFrame(be)),()=>cancelAnimationFrame(fe)},$=(k,B)=>{let _e,fe,be,le=-1,Je=()=>{_e.disconnect(),fe.disconnect(),clearTimeout(be)},Ie=()=>{if(S.current||j()||le>=0&&k.scrollTop<le-4)return Je();I(k),le=k.scrollTop};return _e=new ResizeObserver(Ie),fe=new MutationObserver(Ie),Ie(),_e.observe(k),fe.observe(k,{childList:!0,subtree:!0,characterData:!0}),be=setTimeout(Je,B),Je},Oe=g.value[0]?.id;ht(()=>{let k=b.current;if(k&&g.value.length!==0&&(v.current=!0,!!g.value.some(B=>B.role==="user")))return $(k,300)},[Oe]);let Ne=F(0);E(()=>{let k=b.current,B=g.value,_e=Ne.current;if(Ne.current=B.length,!k||!v.current)return;if(B.slice(_e).some(be=>be.role==="user"))return S.current=!1,ne(k,3);if(!B.some(be=>be.role==="user")||S.current||j())return;k.scrollHeight-k.scrollTop-k.clientHeight<Ra&&I(k)},[g.value.length]);let O=F(null);E(()=>{let k=b.current,B=g.value.at(-1),_e=O.current;if(O.current=B?.id??null,!!k&&v.current&&!(!B||B.id!==_e||B.status!=="streaming"))return S.current=!1,ne(k,3)},[g.value]),E(()=>{let k=b.current;if(!k)return;let B=g.value.at(-1);if(!B||B.status!=="streaming"&&!g.value.some(be=>be.role==="user"))return;let _e=()=>{if(S.current||j())return;k.scrollHeight-k.scrollTop-k.clientHeight<Ra*2&&I(k)};if(B.status!=="streaming")return $(k,300);_e();let fe=new MutationObserver(_e);return fe.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>fe.disconnect()},[g.value]);let G=_?.form.id,Z=!!_&&(h??[]).some(k=>k.formId===_.form.id);ht(()=>{let k=b.current;!k||!G||S.current||g.value.some(B=>B.role==="user")&&(Z?k.querySelector(`[data-testid="${w.formGate}"]`)?.scrollIntoView({block:"nearest"}):I(k))},[G,Z]),E(()=>{let k=b.current;if(!k)return;let B=()=>{N(k),ie(k),performance.now()-ae.current>150&&(S.current=k.scrollHeight-k.scrollTop-k.clientHeight>8)},_e=()=>{S.current=!0},fe=pt=>{pt.deltaY<0&&_e()},be=0,le=pt=>{be=pt.touches[0]?.clientY??0,U.current=!0},Je=pt=>{(pt.touches[0]?.clientY??0)>be+4&&_e()},Ie=()=>{U.current=!1,te.current=performance.now()},zn=()=>{U.current=!0};return k.addEventListener("scroll",B,{passive:!0}),k.addEventListener("wheel",fe,{passive:!0}),k.addEventListener("touchstart",le,{passive:!0}),k.addEventListener("touchmove",Je,{passive:!0}),k.addEventListener("touchend",Ie,{passive:!0}),k.addEventListener("touchcancel",Ie,{passive:!0}),k.addEventListener("pointerdown",zn,{passive:!0}),window.addEventListener("pointerup",Ie,{passive:!0}),window.addEventListener("pointercancel",Ie,{passive:!0}),N(k),()=>{k.removeEventListener("scroll",B),k.removeEventListener("wheel",fe),k.removeEventListener("touchstart",le),k.removeEventListener("touchmove",Je),k.removeEventListener("touchend",Ie),k.removeEventListener("touchcancel",Ie),k.removeEventListener("pointerdown",zn),window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie)}},[]);let Te=()=>{let k=b.current;k&&(S.current=!1,I(k))},De=[],je="",qe=g.value.at(-1)?.id,Pe=[...h??[]].toSorted((k,B)=>(k.createdAt??1/0)-(B.createdAt??1/0)),xe=k=>_&&k.formId===_.form.id?r(ma,{form:_.form,strings:t,onSubmit:_.onSubmit,onSkip:_.onSkip},`gate:${k.formId}`):r(oc,{marker:k,strings:t,onFill:!_&&f?()=>f(k.formId):void 0},k.key),Ye=k=>{for(let B=Pe[0];B?.createdAt!==void 0&&!(k!==void 0&&B.createdAt>k);B=Pe[0])Pe.shift(),De.push(xe(B))};for(let k of g.value){if(k.role==="assistant"&&k.id!==qe&&dt(k))continue;Ye(k.createdAt);let B=Wf(k.createdAt);B&&B!==je&&(De.push(r("div",{class:`${Ot}-date-divider`,children:r("span",{class:`${Ot}-date-pill`,title:Vf(k.createdAt),children:Kf(k.createdAt,t)})},`day:${B}`)),je=B),De.push(r(Oc,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!d&&k.id===qe,superseded:k.id!==qe,tool:u,onRetry:d&&k.id===qe?m:void 0,enableMessageFeedback:l,onFeedback:s},k.id))}for(let k of Pe)De.push(xe(k));return r("div",{class:`${Ot}-list-wrap`,children:[r("div",{ref:b,class:`${Ot}-list ${Ot}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&g.value.length===0?r("div",{class:`${Ot}-list-loading`,role:"status",children:t.conversationLoading}):null,De,_&&!Z?r(ma,{form:_.form,strings:t,onSubmit:_.onSubmit,onSkip:_.onSkip}):null]}),x?r("button",{type:"button",class:`${Ot}-jump`,onClick:Te,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":w.scrollToBottom,children:r(It,{})}):null]})}function Wf(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Vf(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Kf(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),a=Math.round((o(new Date)-o(n))/864e5);return a<=0?t.dateToday:a===1?t.dateYesterday:a<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Gf=["today","yesterday","lastWeek","older"];function jf(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((Dc(e)-Dc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function $c(e,t){let n=new Map;for(let o of t){let a=jf(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return Gf.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function Dc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Xf=W.scope("history"),Yf=3,Jf=6,Qf={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Zf(e,t,n){let o=Date.parse(e);return Number.isFinite(o)?new Date(o).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(o):t-o<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(o):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(o):""}function tr({transport:e,strings:t,locale:n,persistence:o,visitorId:a,onSelect:i,onNewConversation:l}){let s=P.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=T(c?"loaded":"loading"),[m,_]=T(c?.conversations??[]);E(()=>{let g=!1;return e.listConversations({visitorId:a}).then(x=>{if(g)return;let C=x.conversations??[];_(C),u("loaded"),o.saveHistoryCount(C.length)}).catch(x=>{g||(Xf.warn("listConversations failed",{err:x}),u("error"))}),()=>{g=!0}},[e,a,o]);let h=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":w.sidebarNewConversation,children:[r(_l,{}),t.newConversation]})}):null;if(d==="loading"){let g=Math.min(o.loadHistoryCount()??Yf,Jf);return r(ee,{children:[r("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:r("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[r("div",{class:`${s}-history-heading`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),r("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,g)},(x,C)=>r("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[r("span",{class:`${s}-history-avatar ${s}-skeleton`}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),r("span",{class:`${s}-history-time`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),r("span",{class:`${s}-history-row`,children:r("span",{class:`${s}-history-preview`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},C))})]})}),h]})}if(d==="error"||m.length===0)return r(ee,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),h]});let f=Date.now(),b=$c(f,m);return r(ee,{children:[r("div",{class:`${s}-history`,role:"list",children:b.map(g=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[Qf[g.bucket]]}),r("div",{class:`${s}-history-card`,children:g.conversations.map(x=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(x),"data-closed":x.canContinue?void 0:"true","data-unread":x.hasUnread?"true":void 0,"data-testid":we(w.historyItem,x.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(sa,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:x.title}),r("span",{class:`${s}-history-time`,children:Zf(x.lastMessageAt,f,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:x.preview??(x.canContinue?t.historyContinue:t.conversationClosed)}),x.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},x.conversationId))})]},g.bucket))}),h]})}var Fc=P.cssPrefix;function Bc({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${Fc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${Fc}-suggestion`,onClick:()=>t(n),"data-testid":we(w.suggestion,o),children:n.label},n.id))})}var Ee=P.cssPrefix;function Hc(e){let{options:t,onClose:n}=e,o=t.strings,a=F(null);E(()=>{let c=a.current;if(!c)return;let d=Uo(c),u=m=>{m.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=e.composerApiRef,l=D(c=>{i.current?.attachFromDrop(c)},[i]),{visible:s}=Vo({containerRef:a,onDrop:l});return Ho(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Ee}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":w.panel,children:[r(Ia,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(Aa,{poweredBy:e.options.poweredBy})]})}function Ia(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,controlMode:u,assignedOperatorInitials:m,operatorAvailable:_,operatorRequestEnabled:h,onRequestOperator:f,onCancelRequest:b,loadingMessages:g,messagesSig:x,agent:C,suggestions:v,initialWidgetSize:S,visitorId:U,onClose:te,onBack:j,onClear:ae,onToggleHistory:ie,onSelectHistoryConversation:N,onNewConversation:I,onWidgetSizeChange:ne,onSend:$,onStop:Oe,onSuggestion:Ne,activeForm:O,formMarkers:G,onFormSubmit:Z,onFormSkip:Te,onFormFill:De,tool:je,onRetry:qe,onMessageFeedback:Pe,containerEl:xe,dragOver:Ye,composerAttachApiRef:k}=e,B=t.strings,_e;return O?_e=null:c?_e=r(ee,{children:[u&&u!=="ai-agent"?r(nm,{controlMode:u,operatorInitials:m,operatorAvailable:_,onCancelRequest:b,strings:B}):null,!d&&u==="ai-agent"&&r(Bc,{suggestions:v,onPick:Ne}),r(Jl,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,operatorRequestEnabled:h,controlMode:u,onRequestOperator:f,onSend:$,onStop:Oe,attachApiRef:k})]}):_e=r(tm,{label:B.conversationClosed,ctaLabel:B.startNewConversation,onNewConversation:ae}),r(ee,{children:[s==="history"?r(em,{strings:B,onBack:ie,onClose:te,showClose:zo(t.mode,l,t.actions)}):r("header",{class:`${Ee}-header`,"data-testid":w.panelHeader,children:[j?r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:j,"aria-label":B.moduleBack,title:B.moduleBack,children:r(In,{})}):null,C?r(jl,{agent:C,strings:B}):r("h1",{children:B.panelTitle}),r(et,{panelProps:e,variant:"chat"})]}),s==="history"?r(tr,{transport:n,strings:B,locale:t.locale,persistence:i,visitorId:U,onSelect:fe=>N(fe.conversationId),onNewConversation:I}):r(ee,{children:[r(Ql,{visible:Ye,strings:B}),r(Nc,{messagesSig:x,strings:B,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Pe,loading:g,idle:!d,tool:je,onRetry:qe,form:O?{form:O,onSubmit:Z,onSkip:Te}:null,formMarkers:G,onFillForm:De}),_e,r(rm,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(Bo,{panelEl:xe,resize:t.size.resize,position:t.position,initialSize:S,onSizeChange:ne,strings:B}):null]})}function em({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Ee}-header`,children:[r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(In,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Ze,{})}):null]})}function tm({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Ee}-readonly-banner`,role:"note",children:[r("span",{class:`${Ee}-readonly-label`,children:e}),r("button",{type:"button",class:`${Ee}-readonly-cta`,onClick:n,children:t})]})}function nm({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelRequest:o,strings:a}){let i=om(e,t,n,a);return r("div",{class:`${Ee}-operator-banner`,role:"status","data-mode":e,"data-testid":w.operatorBanner,children:[r("span",{class:`${Ee}-operator-pulse`,"aria-hidden":"true"}),r("span",{class:`${Ee}-operator-label`,children:i}),e==="awaiting_operator"&&o?r("button",{type:"button",class:`${Ee}-operator-cancel`,"data-testid":w.operatorCancelRequest,onClick:o,children:a.cancelOperatorRequest}):null]})}function om(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function rm({disclaimer:e}){return e?r("div",{class:`${Ee}-composer-footer`,children:r("div",{class:`${Ee}-disclaimer`,children:e})}):null}function Aa({poweredBy:e}){return e?r("div",{class:`${Ee}-poweredby-bar`,children:r(am,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function am({logoUrl:e,text:t,href:n}){let o=r(ee,{children:[e?r("img",{class:`${Ee}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Ee}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Ee}-poweredby`,children:o})}function zc(e){let t=F(e);t.current=e;let n=F(null);return n.current??(n.current=im(t)),n.current}function im(e){let t=q(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,a=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let m=u.forms.list.find(_=>_.id===d);m&&(t.value={form:m,trigger:"manual"});return}for(let m of u.forms.byTrigger[c]??[]){let _=m.triggers.find(h=>h.kind===c);if(!(!_||!sm(_,u)||a(m)||!lm(m,u))){t.value={form:m,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:m,trigger:_}=u;m.frequency==="conversation"?n.add(o(m.id)):m.frequency!=="always"&&e.current.persistence.saveFormDone(m.id),e.current.onComplete(m,_,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function sm(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function lm(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let a=t.userContext()??{};if(n.missingContext.some(i=>a[i]!==void 0&&a[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function Uc(e){let t=P.cssPrefix,{site:n,blocks:o,strings:a,collapsed:i}=e,l=o?.navigation??[],s=o?.linkCards??[],c=i?a.expandSidebar:a.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":w.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(cm,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":w.sidebarToggle,children:r(dm,{collapsed:i})})]}),i?null:r(ee,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(_m,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(um,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(tr,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function cm({site:e}){let t=P.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return r("picture",{children:[e.logoDark?.url?r("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,r("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return r("div",{class:`${t}-sidebar-title`,children:e?.title??P.name})}function dm({collapsed:e}){return r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?r("polyline",{points:"9 6 15 12 9 18"}):r("polyline",{points:"15 6 9 12 15 18"})})}function _m({items:e}){let t=P.cssPrefix;return r("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>r("li",{children:r("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?r("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,r("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function um({items:e}){let t=P.cssPrefix;return r("div",{class:`${t}-sidebar-cards`,children:e.map(n=>r("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[r("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?r("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var qc=P.cssPrefix;function Wc(e){return r("main",{class:`${qc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(Uc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),r("section",{class:`${qc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Vc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Kc(e,t,n){let o=q({activeTab:e,stacks:Vc(t)});return{sig:o,switchTab(a){o.value.activeTab!==a&&(o.value={...o.value,activeTab:a},n?.(a))},push(a){let i=o.value,l=i.stacks[i.activeTab]??[];o.value={...i,stacks:{...i.stacks,[i.activeTab]:[...l,a]}}},pop(){let a=o.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(o.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){o.value={activeTab:a,stacks:Vc(t)}}}}var Gc=e=>e.stacks[e.activeTab]??[],jc=e=>Gc(e).at(-1),Xc=e=>Gc(e).length===0;var Yc={Icon:Mn};var yt=P.cssPrefix;function nr({title:e,actions:t}){return r("header",{class:`${yt}-back-header`,"data-variant":"title",children:[r("span",{class:`${yt}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${yt}-back-title`,children:e}),t??r("span",{class:`${yt}-back-spacer`,"aria-hidden":"true"})]})}function or({title:e,backLabel:t,onBack:n,actions:o,testid:a}){return r("header",{class:`${yt}-back-header`,"data-testid":a,children:[r("button",{type:"button",class:`${yt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(In,{})}),r("h1",{class:`${yt}-back-title`,children:e}),o??r("span",{class:`${yt}-back-spacer`,"aria-hidden":"true"})]})}var nn=P.cssPrefix;function Jc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${nn}-home-search`,onClick:t,"data-testid":w.homeSearch,children:[r("span",{class:`${nn}-home-search-text`,children:e}),r("span",{class:`${nn}-home-search-icon`,"aria-hidden":"true",children:r(ca,{})})]})}function Qc({placeholder:e,value:t,onInput:n}){return r("div",{class:`${nn}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${nn}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":w.helpSearch}),r("span",{class:`${nn}-home-search-icon`,"aria-hidden":"true",children:r(ca,{})})]})}var Dn=P.cssPrefix;function rr({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${Dn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${Dn}-list-row-body`,children:[r("span",{class:`${Dn}-list-row-title`,children:e}),t?r("span",{class:`${Dn}-list-row-sub`,children:t}):null]}),r("span",{class:`${Dn}-list-row-chevron`,"aria-hidden":"true",children:r(Qt,{})})]})}var Zc=P.cssPrefix;function Ge({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${Zc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${Zc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Nt=P.cssPrefix,pm=W.scope("help"),fm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function mm(e){let t=new Map;for(let n of e){let o=n.categories?.[0]??"";(t.get(o)??t.set(o,[]).get(o)).push(n)}return[...t.entries()]}function ed(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let a=0;for(let i of e){if(a=n.indexOf(i,a),a===-1)return 0;a+=1}return 1}function gm(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(ed(n,o.title)*2,ed(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function td({article:e,nav:t}){return r(rr,{title:e.title,subtitle:e.description,onClick:()=>fm(t,e),testid:we(w.helpArticle,e.id)})}function hm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=T("loading"),[d,u]=T(t.errorGeneric),[m,_]=T([]),[h,f]=T(""),[b,g]=T(0);E(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(S=>{if(v)return;let U=S.items??[];_(U),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:U.length})}).catch(S=>{v||(pm.warn("listContent (help) failed",{err:S}),u(Jt(S,t)),c("error"))}),()=>{v=!0}},[e,l,b,a]);let x=Me(()=>gm(m,h),[m,h]);E(()=>{let v=h.trim();if(!v)return;let S=setTimeout(()=>a.emit("contentSearch",{queryLength:v.length,hitCount:x.length}),600);return()=>clearTimeout(S)},[h,x,a]);function C(){return h.trim().length>0?x.length===0?r(Ge,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${Nt}-help-card`,children:x.map(v=>r(td,{article:v,nav:o},v.id))}):s==="loading"?r(Ge,{message:t.helpLoading,strings:t}):s==="error"?r(Ge,{tone:"error",message:d,onRetry:()=>g(v=>v+1),strings:t}):m.length===0?r(Ge,{message:t.helpEmpty,strings:t}):mm(m).map(([v,S])=>r("section",{class:`${Nt}-help-group`,children:[v?r("h2",{class:`${Nt}-help-section-title`,children:v}):null,r("div",{class:`${Nt}-help-card`,children:S.map(U=>r(td,{article:U,nav:o},U.id))})]},v))}return r("div",{class:`${Nt}-module`,children:[r(nr,{title:t.helpTitle,actions:r(et,{panelProps:i,variant:"plain"})}),r("div",{class:`${Nt}-module-pad`,children:r(Qc,{placeholder:t.helpSearchPlaceholder,value:h,onInput:f})}),r("div",{class:`${Nt}-help-list`,children:C()})]})}var nd={Icon:An,Root:e=>r(hm,{...e})};var od=P.cssPrefix;function Ma({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${od}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${od}-home-card`,"data-testid":n,children:t})}var de=P.cssPrefix,rd=W.scope("home");function vm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Le(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var bm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function ym(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=T(null),[d,u]=T([]),m=o.contentTags?.join(",");E(()=>{if(o.showRecentConversations===!1)return;let x=!1;return t.listConversations({limit:1}).then(C=>!x&&c(C.conversations?.[0]??null)).catch(C=>!x&&rd.warn("listConversations (home) failed",{err:C})),()=>{x=!0}},[t,o.showRecentConversations]),E(()=>{if(!o.contentTags?.length)return;let x=!1;return t.listContent({tags:o.contentTags,limit:6}).then(C=>{if(x)return;let v=C.items??[];u(v),i.emit("contentView",{section:"home",tags:m,count:v.length})}).catch(C=>!x&&rd.warn("listContent (home) failed",{err:C})),()=>{x=!0}},[t,m,i]);let _=vm(e),h=o.userAvatars??[],f=o.status,b=f?.text?Le(n,f.text):n.homeStatus,g=o.contentBlockTitle?Le(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${de}-module ${de}-home`,"data-testid":w.homeView,children:r("div",{class:`${de}-home-scroll`,children:[r("div",{class:`${de}-home-hero`,children:[r("div",{class:`${de}-home-hero-top`,children:[o.brandName?r("span",{class:`${de}-home-brand`,"data-testid":w.homeBrand,children:o.brandName}):r("span",{class:`${de}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${de}-home-hero-actions`,children:[h.length>0?r("div",{class:`${de}-home-avatars`,children:h.map(x=>r("span",{class:`${de}-home-avatar`,title:x.role?`${x.name} \xB7 ${x.role}`:x.name,children:x.avatar?r("img",{src:x.avatar,alt:"",loading:"lazy"}):r("span",{children:qo(x.name)})},x.name))}):null,r(et,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(ee,{children:[r("h1",{class:`${de}-home-greeting`,"data-testid":w.homeGreeting,children:_.title}),_.subtitle?r("p",{class:`${de}-home-lead`,children:_.subtitle}):null]}):null]}),r("div",{class:`${de}-home-cards`,children:[o.showSearchBar!==!1?r(Jc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(Ma,{onClick:()=>a.selectConversation(s.conversationId),testid:w.homeRecent,children:r("div",{class:`${de}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[r("span",{class:`${de}-home-recent-avatar`,"aria-hidden":"true",children:r(Mn,{})}),r("span",{class:`${de}-home-recent-body`,children:[r("span",{class:`${de}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${de}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?r("span",{class:`${de}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,f?r(Ma,{onClick:f.url?()=>a.push({kind:"iframe",url:f.url,title:b}):void 0,children:r("div",{class:`${de}-home-status`,"data-level":f.level??"operational",children:[r("span",{class:`${de}-home-status-icon`,"aria-hidden":"true",children:r(Ml,{})}),r("span",{class:`${de}-home-status-text`,children:b})]})}):null,d.length>0?r("section",{class:`${de}-home-content`,children:[r("div",{class:`${de}-home-content-title`,children:g}),r("div",{class:`${de}-home-content-list`,children:d.map(x=>r(rr,{title:x.title,subtitle:x.description,onClick:()=>bm(a,x),testid:we(w.homeContentRow,x.id)},x.id))})]}):null]})]})})}var ad={Icon:Ll,Root:e=>r(ym,{...e})};var Pt=P.cssPrefix,Pm=W.scope("news");function xm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=T("loading"),[d,u]=T(t.errorGeneric),[m,_]=T([]),[h,f]=T(0);E(()=>{let g=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(x=>{if(g)return;let C=x.items??[];_(C),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:C.length})}).catch(x=>{g||(Pm.warn("listContent (news) failed",{err:x}),u(Jt(x,t)),c("error"))}),()=>{g=!0}},[e,l,h,a]);function b(){return s==="loading"?r(Ge,{message:t.newsLoading,strings:t}):s==="error"?r(Ge,{tone:"error",message:d,onRetry:()=>f(g=>g+1),strings:t}):m.length===0?r(Ge,{message:t.newsEmpty,strings:t}):r("div",{class:`${Pt}-news-list`,children:m.map(g=>r("button",{type:"button",class:`${Pt}-news-card`,onClick:()=>o.push({kind:"content",id:g.id,title:g.title}),"data-testid":we(w.newsItem,g.id),children:[g.image?r("img",{class:`${Pt}-news-hero`,src:g.image,alt:"",loading:"lazy"}):null,r("span",{class:`${Pt}-news-body`,children:[r("span",{class:`${Pt}-news-title`,children:g.title}),g.description?r("span",{class:`${Pt}-news-summary`,children:g.description}):null]})]},g.id))})}return r("div",{class:`${Pt}-module`,children:[r(nr,{title:t.newsTitle,actions:r(et,{panelProps:i,variant:"plain"})}),r("div",{class:`${Pt}-module-scroll`,children:b()})]})}var id={Icon:Ol,Root:e=>r(xm,{...e})};var ar={chat:Yc,home:ad,help:nd,news:id};var $n=P.cssPrefix;function sd({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${$n}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=ar[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${$n}-tab`,onClick:()=>a(i.id),"data-testid":we(w.tab,i.id),children:[r("span",{class:`${$n}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${$n}-tab-badge`,"data-testid":w.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${$n}-tab-label`,children:Le(n,i.label)})]},i.id)})})}var ld=P.cssPrefix,Sm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function cd({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${ld}-module`,children:[r(or,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${ld}-content-frame`,src:e,title:t||"content",sandbox:Sm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Fn=P.cssPrefix,km=W.scope("content"),wm=5e3;function dd({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=T(null),[d,u]=T(!1),[m,_]=T(0),h=D(()=>{u(!1),c(null),_(g=>g+1)},[]);E(()=>{let g=!1;return n.listContent({ids:[e],limit:1}).then(x=>{if(g)return;let C=x.items[0];C?(c(C),a.emit("contentOpen",{contentId:e,tags:C.tags?.length?C.tags.join(","):void 0})):u(!0)}).catch(x=>{g||(km.warn("listContent (reader) failed",{err:x}),u(!0))}),()=>{g=!0}},[n,e,m,a]),E(()=>{if(!s)return;let g=setTimeout(()=>a.emit("contentRead",{contentId:e}),wm);return()=>clearTimeout(g)},[s,e,a]);let f=D(g=>{let C=g.target?.closest?.("a")?.getAttribute("href")??"";C&&!C.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function b(){return d?r(Ge,{tone:"error",message:o.errorGeneric,onRetry:h,strings:o}):s===null?r(Ge,{message:o.contentLoading,strings:o}):r("article",{class:`${Fn}-content`,"data-testid":w.contentView,onClick:f,children:[s.image?r("img",{class:`${Fn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Fn}-content-subtitle`,children:s.description}):null,r(wc,{text:s.content??""})]})}return r("div",{class:`${Fn}-module`,children:[r(or,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:w.backHeader}),r("div",{class:`${Fn}-module-scroll`,"data-testid":w.contentScroll,children:b()})]})}var ir=P.cssPrefix;function _d({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=F(null),m=F(new Set);E(()=>{let I=u.current;if(!I)return;let ne=Uo(I),$=Oe=>{Oe.key==="Escape"&&e.onClose?.()};return I.addEventListener("keydown",$),()=>{ne(),I.removeEventListener("keydown",$)}},[e.onClose]);let _=e.composerApiRef,h=D(I=>{_.current?.attachFromDrop(I)},[_]),{visible:f}=Vo({containerRef:u,onDrop:h});Ho(u.current,c.mode==="modal");let b=J(()=>n.sig.value).value,g=jc(b),x=c.modules.byId[b.activeTab],C=g?.kind==="iframe"||g?.kind==="content",v=t.length>1&&(Xc(b)||!C),S=F(null);E(()=>{if(C&&S.current===null)S.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!C&&S.current!==null){let I=S.current;S.current=null,s(I)}},[C]);let U={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:I=>{let ne=t.find($=>$.layout===I);ne&&n.switchTab(ne.id)},selectConversation:i,startNewConversation:l},te=I=>({options:c,transport:e.transport,strings:d,config:I,visitorId:e.visitorId,nav:U,bus:o,panelProps:e}),j=r(et,{panelProps:e,variant:"plain"});x&&m.current.add(x.id);let ae=t.filter(I=>m.current.has(I.id)),ie=I=>{if(I.layout==="chat")return r(Ia,{...e,containerEl:u.current,dragOver:f,composerAttachApiRef:_});let ne=ar[I.layout].Root;return ne?r(ne,{...te(I)}):null},N=()=>g?.kind==="iframe"?r(cd,{url:g.url,title:g.title,strings:d,onBack:n.pop,actions:j}):g?.kind==="content"?r(dd,{id:g.id,title:g.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:j}):null;return r("div",{ref:u,class:`${ir}-panel ${ir}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":w.messengerHome,children:[r("div",{class:`${ir}-messenger-body`,children:[ae.map(I=>r("div",{class:`${ir}-messenger-pane`,hidden:C||I.id!==x?.id,children:ie(I)},I.id)),N()]}),v?r(sd,{modules:t,activeTab:b.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(Aa,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(x?.layout==="chat"&&!g)?r(Bo,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Bn=P.cssPrefix;function ud({strings:e,onClose:t}){return r("div",{class:`${Bn}-panel ${Bn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":w.modulesEmpty,children:[t?r("button",{type:"button",class:`${Bn}-icon-btn ${Bn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Ze,{})}):null,r("p",{class:`${Bn}-modules-empty-text`,children:e.modulesEmpty})]})}function pd({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=T(()=>o?!1:t.loadCalloutDismissed(n));E(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=D(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}function fd(e){let{transport:t}=e,n=Qe("ai-agent"),o=Qe(void 0),a=Qe(void 0),i=D(d=>{n.value=d.controlMode,o.value=d.assignedOperatorInitials,d.operatorAvailable!==void 0&&(a.value=d.operatorAvailable)},[n,o,a]),l=D(d=>{d.type==="data-control-state"&&i(vt(d.data))},[i]),s=D(async()=>{if(n.value!=="ai-agent")return;let d=await t.requestOperator();d&&i(vt(d))},[t,n,i]),c=D(async()=>{if(n.value!=="awaiting_operator")return;let d=await t.cancelRequestOperator();d&&i(vt(d))},[t,n,i]);return{controlModeSig:n,assignedOperatorInitialsSig:o,operatorAvailableSig:a,applyControlState:i,adoptControlStateChunk:l,requestOperator:s,cancelRequestOperator:c}}var Cm=W.scope("unread"),Em=300;function md(e){let{transport:t,options:n,conversationIdSig:o,isChatActiveRef:a,activated:i,conversationReady:l}=e,s=Qe(!1),c=F(new Set),d=F();E(()=>()=>clearTimeout(d.current),[]);let u=D(()=>{let b=a.current()?o.value:void 0;s.value=[...c.current].some(g=>g!==b)},[s,o,a]),m=D(()=>{n.modules.list.some(b=>b.layout==="chat")&&t.listConversations({limit:50}).then(b=>{c.current=new Set(b.conversations.filter(g=>g.hasUnread).map(g=>g.conversationId)),u()}).catch(b=>Cm.debug("refreshUnread failed (non-fatal)",{err:b}))},[t,n.modules,u]),_=D(b=>{c.current.delete(b),u()},[u]),h=D(()=>{if(!a.current())return;let b=o.value;b&&(clearTimeout(d.current),d.current=setTimeout(()=>{_(b),t.markRead(b)},Em))},[t,o,_,a]),f=F(!1);return E(()=>{!i||!l||f.current||(f.current=!0,m())},[i,l,m]),E(()=>{if(!i)return;let b=()=>{document.visibilityState==="visible"&&m()};return document.addEventListener("visibilitychange",b),()=>document.removeEventListener("visibilitychange",b)},[i,m]),{hasUnreadSig:s,refreshUnread:m,clearUnread:_,markActiveConversationRead:h}}var Hn=W.scope("settings");function gd(e){let{options:t,persistence:n,transport:o,feedback:a,hostElement:i,bus:l}=e,s=n.loadUserPrefs(),[c,d]=T(()=>s.locale??t.locale),[u,m]=T(()=>s.themeMode??t.themeMode),[_,h]=T(()=>s.textSize??t.textSize),f=D(S=>{n.patchUserPrefs(S),o.saveUserPrefs(n.loadUserPrefs()).catch(U=>Hn.warn("saveUserPrefs failed",{err:U}))},[n,o]);E(()=>{s.soundMuted!==void 0&&a.setMuted(s.soundMuted)},[]),E(()=>{i.dataset.theme=u},[i,u,t]),E(()=>{i.dataset.textSize=_},[i,_,t]),E(()=>{let S=!0;return a.mutedSig.subscribe(U=>{if(S){S=!1;return}f({soundMuted:U})})},[a,f]);let b=zt(c,t.availableLocales,t.defaultLocale);E(()=>{o.setLocale(b)},[o,b]),E(()=>{i.dir=mi(b)?"rtl":"ltr"},[i,b]),E(()=>{b!==c&&d(b)},[b,c]);let g=D(S=>{Hn.info("localeChange",{locale:S}),d(S),f({locale:S}),l.emit("localeChange",S)},[f,l]),x=D(S=>{Hn.info("themeChange",{mode:S}),m(S),i.dataset.theme=S,f({themeMode:S}),l.emit("themeChange",S)},[i,f,l]),C=D(S=>{Hn.info("textSizeChange",{size:S}),h(S),i.dataset.textSize=S,f({textSize:S}),l.emit("textSizeChange",S)},[i,f,l]),v=D(()=>{a.toggleMuted();let S=a.mutedSig.value;Hn.info("soundToggle",{muted:S}),l.emit("soundToggle",{muted:S})},[a,l]);return{activeLocale:c,activeThemeMode:u,activeTextSize:_,effectiveLocale:b,setActiveLocale:d,setActiveThemeMode:m,setActiveTextSize:h,patchAndSync:f,handleLocaleChange:g,handleThemeChange:x,handleTextSizeChange:C,handleSoundToggle:v}}var Q=W.scope("app"),sr=P.cssPrefix,Tm=2500,Rm=30;function hd(e,t){return Xs({...e,text:Le(t,e.text)})}function Im(e){let t=e.partsSig.value.filter(n=>n.kind==="tool");return t.length>0&&t.every(n=>{let o=n.stateSig.value;return o==="output-available"||o==="output-error"||o==="output-denied"||o==="approval-responded"})}function vd(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function bd({options:e,hostElement:t,bus:n}){let[o]=T(()=>gt(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=T(()=>o.getVisitorId()),l=o.loadUserPrefs(),s=Qe(o.loadConversationId()),c=Qe([]),[d,u]=T(!1),[m,_]=T([]);function h(){let p=e.modules.list,y=new Set(p.map(L=>L.id)),M=o.loadActiveModule();return M&&y.has(M)?M:p[0]?.id??""}function f(){return e.modules.list.find(p=>p.layout==="chat")?.id}function b(){let p=f();return p?e.modules.list.length===1?!0:C.sig.value.activeTab===p:!1}let g=F(b);g.current=b;let x=F();if(!x.current){let p=e.modules.list.map(y=>y.id);x.current=Kc(h(),p,y=>o.saveActiveModule(y))}let C=x.current,[v,S]=T(!1),[U,te]=T(null),[j,ae]=T(!1),ie=e.mode==="standalone"||e.mode==="inline",N=F(Sn(e,Yt(),o.loadPanelOpen(),o.loadPanelSize())),[I,ne]=T(N.current.panelOpen),[$,Oe]=T(N.current.panelOpen),Ne=F(!1),O=F(void 0);E(()=>{I&&Oe(!0)},[I]);let G=F(!1),[Z,Te]=T(!1),{dismissed:De,dismissCallout:je}=pd({callout:e.launcher.callout,persistence:o}),qe=e.launcher.callout?.persistent??!0,Pe=D(()=>{Q.info("calloutDismiss"),n.emit("calloutDismiss",void 0),je()},[n,je]),[xe,Ye]=T(N.current.panelSize),k=F(!1),[B,_e]=T("chat"),[fe,be]=T(!0),[le,Je]=T(!1),Ie=F(le);Ie.current=le;let[zn,pt]=T(null),[Un,on]=T([]),[qa,Wa]=T(null),[qn,Va]=T(null),Wn=F(e.strings),pr=F(e);pr.current=e;let[Td,Rd]=T(void 0),[Id,Ad]=T(void 0),[Md,Ld]=T(()=>o.loadSidebarCollapsed()??!1),[fr,Od]=T({}),[X]=T(()=>new Ao({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Hs({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[ot]=T(()=>new Tn(c)),[Se]=T(()=>new No(e.sound,e.haptics)),{activeLocale:Vn,activeThemeMode:Ka,activeTextSize:Ga,effectiveLocale:Dt,setActiveLocale:Nd,setActiveThemeMode:Dd,setActiveTextSize:$d,patchAndSync:ja,handleLocaleChange:Fd,handleThemeChange:Bd,handleTextSizeChange:Hd,handleSoundToggle:zd}=gd({options:e,persistence:o,transport:X,feedback:Se,hostElement:t,bus:n}),{controlModeSig:mr,assignedOperatorInitialsSig:Ud,operatorAvailableSig:qd,applyControlState:gr,adoptControlStateChunk:rn,requestOperator:Wd,cancelRequestOperator:Vd}=fd({transport:X}),{hasUnreadSig:Kd,refreshUnread:Xa,clearUnread:Ya,markActiveConversationRead:Gd}=md({transport:X,options:e,conversationIdSig:s,isChatActiveRef:g,activated:$,conversationReady:v});E(()=>{Se.update(e.sound,e.haptics)},[Se,e.sound,e.haptics]),E(()=>()=>Se.destroy(),[Se]),E(()=>{k.current||!e.size.initialSize||(k.current=!0,!o.loadPanelSize()&&Ye(ta(e.mode,e.size,Yt())))},[e.mode,e.size,o]),E(()=>{if(!v||G.current)return;G.current=!0;let p=Sn(e,Yt(),o.loadPanelOpen(),o.loadPanelSize());ne(p.panelOpen),Ye(p.panelSize)},[v,e,o]);let Ja=F(!1),Qa=F(null);E(()=>{!v||Ja.current||(Ja.current=!0,C.reset(h()))},[v]);let Kn=D(p=>{!p||p.length===0||(c.value=p.map(y=>hd(y,Wn.current)))},[c]),hr=F(null),Gn=D(async p=>{try{let{formSubmissions:y}=await(p?X.bootstrap(p):hr.current??X.bootstrap()),M=new Map;return y.forEach((L,V)=>M.set(L.formId,V)),y.filter((L,V)=>!L.skipped||M.get(L.formId)===V).map((L,V)=>({key:`wire:${L.formId}:${L.createdAt??V}`,formId:L.formId,outcome:L.skipped?"skipped":"submitted",createdAt:To(L.createdAt),values:L.values}))}catch(y){return Q.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:y}),[]}},[X]),an=F(0),jn=D((p,y)=>{let M=[...p.map(R=>R.createdAt),...y.map(R=>R.createdAt)].filter(R=>R!==void 0),L=(M.length?Math.min(...M):Date.now())-1;return[...(O.current?.messages??[]).map(R=>{let pe=hd(R,Wn.current);return pe.createdAt=L,pe}),...p]},[]),Za=D(async p=>{let y=an.current,M=()=>y!==an.current;u(!0);try{let[L,V]=await Promise.all([X.loadConversation(p),Gn()]);if(M())return;let R=Mo(L.messages??[]);if(_(V),c.value=jn(Zs(R,c.value),V),R.length){be(L.canContinue??!0),gr(vt(L.controlState));let pe=R.findLast(se=>se.role==="assistant"&&!se.ephemeral);on(pe?.suggestions??L.suggestions??[])}}catch(L){if(M())return;Q.warn("loadThread failed; resetting conversationId",{err:L,conversationId:p}),s.value=void 0,o.saveConversationId(void 0)}finally{M()||u(!1)}},[X,Gn,c,s,o,jn]),sn=D(async({newConversation:p})=>{let y=++an.current,M=()=>y!==an.current,L=s.value,V=p||!L?ze():L;V!==L&&(s.value=V,o.saveConversationId(V));let R;try{R=await X.handshake({visitorId:a,conversationId:V,userPrefs:o.loadUserPrefs(),locale:Vn})}catch(se){if(M())return;n.emit("error",se),e.onError?.(se),p||S(!0);return}if(M())return;if(R.visitorId&&R.visitorId!==a&&(Q.info("visitor rebound",{previous:a,current:R.visitorId,reason:R.rebind?.visitorId}),o.setVisitorId(R.visitorId),i(R.visitorId),n.emit("visitorRebound",{previous:a,current:R.visitorId,reason:R.rebind?.visitorId})),R.conversationId&&R.conversationId!==V&&(Q.info("conversation rebound",{previous:V,current:R.conversationId,reason:R.rebind?.conversationId}),n.emit("conversationRebound",{previous:V,current:R.conversationId,reason:R.rebind?.conversationId})),R.agent&&pt(R.agent),gr(vt(R.controlState)),e.mode==="page"&&(R.site&&Fs(R.site)?Rd(R.site):R.site&&Q.warn("invalid site config, using fallback",{site:R.site}),R.blocks&&Bs(R.blocks)?Ad(R.blocks):R.blocks&&Q.warn("invalid blocks config, using fallback",{blocks:R.blocks})),R.userPrefs&&!p&&(o.saveUserPrefs(R.userPrefs),R.userPrefs.locale&&Nd(R.userPrefs.locale),R.userPrefs.soundMuted!==void 0&&Se.setMuted(R.userPrefs.soundMuted),R.userPrefs.themeMode&&Dd(R.userPrefs.themeMode),R.userPrefs.textSize&&$d(R.userPrefs.textSize)),O.current=R.welcome,p||n.emit("handshake",R),R.welcome?.suggestions){let se=Wn.current;on(R.welcome.suggestions.map(We=>({...We,label:Le(se,We.label),...We.text===void 0?{}:{text:Le(se,We.text)}})))}!p&&L&&R.conversationId===L?Ne.current=!0:(s.value=R.conversationId,o.saveConversationId(R.conversationId),Kn(R.welcome?.messages)),p||S(!0)},[X,a,o,e,n,s,Se,Kn,Za,Vn]),ln=JSON.stringify(e.userContext??null),jd=JSON.stringify(e.pageContext??null),Xd=JSON.stringify(fr);E(()=>{let p=Object.keys(fr).length?{...fr,...e.userContext}:e.userContext;X.setContext(p,Am(e.pageContext))},[X,ln,jd,Xd]);let Yd=D((p,y=[])=>on(p.suggestions??y),[]),Xn=D(p=>{if(p.type!=="data-conversation-rebind")return!1;let y=p.data?.conversationId;if(y&&y!==s.value){let M=s.value;s.value=y,o.saveConversationId(y),X.primeIdentity(void 0,y),Q.info("conversation rebound (in-stream)",{previous:M,current:y}),M&&n.emit("conversationRebound",{previous:M,current:y,reason:y})}return!0},[s,o,X,n]);E(()=>(X.primeIdentity(a,s.value),sn({newConversation:!1}),()=>{an.current++}),[]);let ei=F(!1);E(()=>{if(!(!$||!v||ei.current)&&(ei.current=!0,hr.current=X.bootstrap(),(async()=>{try{let p=await hr.current;te(pn((p??{forms:[]}).forms,Dt))}catch(p){Q.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{ae(!0)}})(),Ne.current)){Ne.current=!1;let p=s.value;p&&Za(p)}},[$,v]);let Yn=F(null);E(()=>{if(!$||!v)return;if(Yn.current===null){Yn.current=Dt;return}if(Yn.current===Dt)return;Yn.current=Dt;let p=!1;return X.bootstrap().then(y=>{p||te(pn((y??{forms:[]}).forms,Dt))}).catch(y=>Q.debug("forms re-localize failed \u2014 keeping current copy",{err:y})),()=>{p=!0}},[$,v,Dt,X]);let ti=F(ln);E(()=>{!v||ti.current===ln||(ti.current=ln,sn({newConversation:!1}))},[ln,v,sn]),E(()=>{if(!$||!v||!s.value)return;let p=s.value,y=new AbortController,M=new Tn(c);X.primeIdentity(a,p),Q.debug("resume stream opened",{conversationId:p});let L=Ae=>{rn(Ae);let Bt=c.value.length,Ve=M.applyResume(Ae,Ie.current);if(c.value.length>Bt){let Zn=pr.current.modules.list.find(c_=>c_.layout==="chat")?.id;Zn&&C.switchTab(Zn)}Ve?.role==="operator"&&(Se.play("messageReceived"),lr(n,pr.current,"operator",ct(Ve)),!document.hidden&&g.current()&&X.markRead(p).catch(()=>{}))},V=async()=>{let Ae=await X.loadConversation(p).catch(()=>null);if(y.signal.aborted||!Ae?.messages?.length)return!1;let{messages:Bt,changed:Ve}=el(c.value,Mo(Ae.messages));return Ve&&(c.value=Bt),Ve};al({signal:y.signal,now:()=>performance.now(),sleep:Ae=>kn(Ae,y.signal),connect:Ae=>X.connectResumeStream({signal:y.signal,onChunk:L,onConnected:Ae}),backfill:()=>{Ie.current||V()}});let R=Ae=>Ae.partsSig.value.reduce((Bt,Ve)=>Bt+(Ve.kind==="text"||Ve.kind==="reasoning"?Ve.textSig.value.length:1),0),pe=0,se=-1,We=setInterval(()=>{let Ae=c.value.at(-1);if(!(!Ie.current&&Ae!==void 0&&Ae.role!=="user"&&!Ae.ephemeral&&Ae.status==="streaming")){pe=0,se=-1;return}let Ve=R(Ae);if(Ve!==se){se=Ve,pe=0;return}pe++>=Rm||V().then(Zn=>{Zn&&(pe=0)})},Tm);return()=>{y.abort(),clearInterval(We),M.detach(),Q.debug("resume stream closed",{conversationId:p})}},[$,v,s,s.value,a,X,rn,c,n,Se,C]),ht(()=>{go(t,Eo(e.mode,xe,I))},[t,I,xe,e.mode]),E(()=>{if(e.mode!=="modal"||!I)return;let p=y=>{y.composedPath().some(V=>V instanceof HTMLElement&&V.classList.contains(`${P.cssPrefix}-panel`))||ne(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,I,e.mode]),E(()=>{if(e.mode!=="drawer"||!I)return;let p=y=>{y.key==="Escape"&&ne(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[I,e.mode]);let $t=D(async(p,{continueExisting:y})=>{let M=s.value??ze();s.value||(s.value=M,o.saveConversationId(M));let L=Js(c.value,y),V=oa({messages:L.map(aa),conversationId:M,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});Je(!0);let R=X.sendMessage(V);Wa(()=>R.cancel),Va(()=>R.detach);try{for await(let se of R.iter)Xn(se.chunk)||(rn(se.chunk),ot.apply(se.chunk),se.chunk.type==="finish"&&se.chunk.canContinue===!1&&be(!1));let pe=p.status==="error";switch(nl(p,pe)){case"drop":c.value=c.value.filter(se=>se!==p);break;case"complete-operator-routed":p.status="complete",Se.play("messageReceived"),lr(n,e,"assistant",ct(p));break;case"error":{p.status="error",p.errorText=e.strings.errorGeneric,Se.play("error");let se=new Error(pe?"stream error chunk":"empty reply");n.emit("error",se),e.onError?.(se);break}case"complete":p.status="complete",Se.play("messageReceived"),lr(n,e,"assistant",ct(p)),Yd(p);break}}catch(pe){vd(pe)?Cn(p)?p.status="complete":c.value=c.value.filter(se=>se!==p):(p.status="error",p.errorText=Jt(pe,e.strings),Se.play("error"),n.emit("error",pe),e.onError?.(pe))}finally{ot.detach(),Je(!1),Wa(null),Va(null),c.value=[...c.value],Gd()}},[X,ot,c,s,e,n,Se,o,a,Xn]),Jn=D((p,y)=>{if(le)return;let M=c.value.at(-1),L=M?.partsSig.value.find(V=>V.kind==="tool"&&V.toolCallId===p);if(!M||!L){Q.warn("decideTool: tool part not found",{toolCallId:p});return}y(L),M.partsSig.value=[...M.partsSig.value],Im(M)&&(M.status="streaming",c.value=[...c.value],ot.attach(M),$t(M,{continueExisting:!0}))},[le,c,ot,$t]),ni=D((p,y)=>{Q.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),Jn(p,M=>{M.outputSig.value=y,M.stateSig.value="output-available"})},[n,Jn]),oi=D((p,y,M)=>{Q.info("toolDecision",{toolCallId:p,approved:y}),n.emit("toolDecision",{toolCallId:p,approved:y}),Jn(p,L=>{let V=L.approvalSig.value?.id??p;L.approvalSig.value={id:V,approved:y,reason:M},L.stateSig.value="approval-responded"})},[n,Jn]),ri=D(p=>{if(le)return;let y=c.value.at(-1),M=y?.partsSig.value.find(V=>V.kind==="tool"&&V.toolCallId===p);if(!y||!M)return;let L=M.approvalSig.value?.id??p;M.approvalSig.value={id:L},M.stateSig.value="approval-requested",y.partsSig.value=[...y.partsSig.value]},[le,c]),Jd=D((p,y)=>{Q.info("messageFeedback",{messageId:p,value:y}),n.emit("messageFeedback",{messageId:p,value:y}),X.submitFeedback({messageId:p,value:y})},[n,X]),Qd=Me(()=>({humanInLoop:e.features.humanInLoop,onResult:ni,onDecision:oi,onEdit:ri}),[e.features.humanInLoop,ni,oi,ri]),Zd=()=>c.value.reduce((p,y)=>p+(y.role==="user"?1:0),0),Ft=e.forms.list.length>0?e.forms:U??e.forms,me=zc({forms:Ft,persistence:o,userContext:()=>e.userContext,messageCount:Zd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>s.value,onComplete:(p,y,M,L)=>{Q.info("formSubmit",{formId:p.id,trigger:y,skipped:L}),n.emit("formSubmit",{formId:p.id,values:M,skipped:L}),_(R=>{let se=R.find(We=>We.formId===p.id&&We.outcome==="skipped")?.createdAt??Date.now();return[...R.filter(We=>!(We.formId===p.id&&We.outcome==="skipped")),{key:`local:${p.id}:${se}`,formId:p.id,outcome:L?"skipped":"submitted",createdAt:se,...L?{}:{values:M}}]});let V=s.value??ze();s.value||(s.value=V,o.saveConversationId(V),X.primeIdentity(void 0,V)),!L&&p.mirrorToContext&&Od(R=>({...R,...M})),X.submitForm({formId:p.id,conversationId:V,trigger:y,values:M,skipped:L})}}),e_=J(()=>me.activeForm.value);E(()=>{me.refresh()},[Ft,me]);let ai=e.pageContext?.area?String(e.pageContext.area):void 0,t_=J(()=>c.value.length);E(()=>{v&&j&&me.fire("pre-chat")},[v,j,me]),E(()=>{j&&!fe&&me.fire("conversation-closed")},[j,fe,me]),E(()=>{v&&j&&ai&&me.fire("page-area")},[v,j,ai,me]);let vr=Me(()=>{let p=Ft.list.flatMap(y=>y.triggers).filter(y=>y.kind==="idle").map(y=>Number(y.param));return p.length?Math.min(...p)*1e3:0},[Ft]);E(()=>{if(!vr||!I)return;let p=setTimeout(()=>me.fire("idle"),vr);return()=>clearTimeout(p)},[vr,I,me,t_.value]);let ii=D(async p=>{let y=s.value??ze();s.value||(s.value=y,o.saveConversationId(y));let M=oa({messages:[aa(p)],conversationId:y,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});try{for await(let L of X.sendMessage(M).iter)Xn(L.chunk)||(rn(L.chunk),L.chunk.type==="start"&&L.chunk.messageId&&L.chunk.messageMetadata?.senderRole==="visitor"&&(p.serverMessageId=L.chunk.messageId))}catch(L){if(vd(L))return;Q.debug("operator-routed send failed (non-fatal)",{error:L}),n.emit("error",L instanceof Error?L:new Error(String(L))),e.onError?.(L instanceof Error?L:new Error(String(L)))}},[X,s,o,e,a,Xn,rn,n]),si=D(async(p,y)=>{let M=mr.value!=="ai-agent";if(Q.info("send",{textLen:p.length,attachments:y.length,streaming:le,routedToOperator:M}),le&&!M)return;n.emit("send",{text:p,attachmentCount:y.length}),Un.length>0&&on([]);let L=await Lm(X,y,pe=>{Q.warn("upload failed",{err:pe}),n.emit("error",pe),e.onError?.(pe)});Se.unlock(),Se.play("messageSent");let V=js(p,L);if(lr(n,e,"user",p),M){c.value=[...c.value,V],ii(V);return}let R=wn();c.value=[...c.value,V,R],ot.attach(R),await $t(R,{continueExisting:!1}),me.fire("after-messages")},[le,X,n,e,Un.length,c,ot,$t,ii,me,mr]),n_=D(()=>{Q.info("stop"),n.emit("stop",void 0),qa?.()},[qa,n]),o_=D(()=>{if(le)return;let p=c.value,y=p.at(-1);if(!y||y.role!=="assistant"||y.status!=="error"&&!dt(y))return;let M=wn();c.value=[...p.slice(0,-1),M],ot.attach(M),Q.info("retry"),$t(M,{continueExisting:!1})},[le,c,ot,$t]),cn=D(()=>{if(Gl(e.mode,xe)==="exit-fullscreen"){Q.info("close \u2192 exit-fullscreen",{mode:e.mode}),Ye("normal"),n.emit("fullscreen",!1);return}Q.info("close \u2192 panel closed",{mode:e.mode}),me.fire("panel-close"),ne(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,xe,me]),br=D(()=>{Q.info("open",{mode:e.mode}),Se.unlock(),Te(!0),ne(!0),o.savePanelOpen(!0),!De&&!qe&&Pe(),setTimeout(()=>Te(!1),Mm),Xa(),n.emit("open",void 0),e.onOpen?.()},[n,e,Se,o,De,qe,Pe,Xa]),yr=D(()=>{if(!c.value.some(y=>y.role==="user")&&fe&&s.value){Q.info("clear \u2192 reusing empty conversation",{conversationId:s.value}),c.value.length===0&&Kn(O.current?.messages);return}Q.info("clear \u2192 new conversation",{wasStreaming:le}),n.emit("clear",void 0),le&&qn?.(),Gt(()=>{c.value=[],s.value=void 0}),o.clearConversation(),be(!0),_([]),sn({newConversation:!0})},[le,qn,c,s,o,sn,n,fe,Kn]),Pr=D(()=>{yr(),_e("chat");let p=e.modules.list.find(y=>y.layout==="chat")?.id;p&&C.switchTab(p)},[yr,C,e]),xr=D(()=>{let p=xe==="expanded"?"normal":"expanded";Q.info("expand",{from:xe,expanded:p==="expanded"}),Ye(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,xe,o]),Sr=D(()=>{let p=xe==="fullscreen"?"normal":"fullscreen";Q.info("fullscreen",{from:xe,fullscreen:p==="fullscreen"}),Ye(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,xe,o]),r_=D(()=>{_e(p=>{let y=p==="history"?"chat":"history";return Q.info("toggleHistory",{view:y}),n.emit("toggleHistory",{view:y}),y})},[n]),a_=D(()=>{Ld(p=>{let y=!p;return Q.info("sidebarToggle",{collapsed:y}),o.saveSidebarCollapsed(y),n.emit("sidebarToggle",{collapsed:y}),y})},[o,n]),i_=D(p=>{Q.info("resize",p),ja({widgetSize:p}),n.emit("resize",p)},[ja,n]),kr=D(async p=>{Q.info("selectConversation",{conversationId:p,wasStreaming:le}),n.emit("selectConversation",{conversationId:p}),le&&qn?.();try{let[y,M]=await Promise.all([X.loadConversation(p),Gn(p)]),L=Mo(y.messages);Gt(()=>{c.value=jn(L,M),s.value=y.conversationId}),_(M),o.saveConversationId(y.conversationId),X.primeIdentity(a,y.conversationId),y.agent&&pt(y.agent),be(y.canContinue),gr(vt(y.controlState));let V=L.findLast(R=>R.role==="assistant"&&!R.ephemeral);on(V?.suggestions??y.suggestions??[]),_e("chat"),await X.markRead(p),Ya(p)}catch(y){n.emit("error",y),e.onError?.(y)}},[X,c,s,n,e,o,Ya,Gn,jn,le,qn,a]),Qn=F(null),li=D(p=>{typeof p=="string"&&(j?me.fire("manual",p):Qn.current=p)},[j,me]);E(()=>{!j||!Qn.current||(me.fire("manual",Qn.current),Qn.current=null)},[j,me]),E(()=>os(t,{open:br,close:cn,expand:xr,fullscreen:Sr,openForm:li}),[t,br,cn,xr,Sr,li]);let Be=Me(()=>$r(e,Vn,Ka,Ga),[e,Vn,Ka,Ga]);Wn.current=Be.strings;let s_=Me(()=>m.map(p=>{let y=Ft.list.find(M=>M.id===p.formId);return{...p,title:y?.title,form:y}}),[m,Ft]),ci={options:Be,transport:X,feedback:Se,bus:n,persistence:o,composerApiRef:Qa,view:B,canSend:fe,isStreaming:le,controlMode:mr.value,assignedOperatorInitials:Ud.value,operatorAvailable:qd.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Wd,onCancelRequest:Vd,loadingMessages:d,messagesSig:c,agent:zn,suggestions:Un,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:cn,onClear:yr,onExpand:xr,onFullscreen:Sr,onSoundToggle:zd,onToggleHistory:r_,onSelectHistoryConversation:kr,onNewConversation:Pr,onLocaleChange:Fd,onThemeChange:Bd,onTextSizeChange:Hd,onWidgetSizeChange:i_,onSend:si,onStop:n_,onSuggestion:p=>{let y=p.text??p.label;Q.info("suggestion",{text:y,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:y}),e.autoSendSuggestions?si(y,[]):Qa.current?.fill(y)},activeForm:e_.value?.form??null,formMarkers:s_,onFormSubmit:me.complete,onFormSkip:me.skip,onFormFill:p=>me.fire("manual",p),tool:Qd,onRetry:o_,onMessageFeedback:Jd},l_=p=>{kr(p);let y=f();y&&C.switchTab(y)};if(!v)return null;let dn=Be.modules.list,wr=p=>{let y=Ln("close",Be.mode,p);return dn.length===0?r(ud,{strings:Be.strings,onClose:y?cn:void 0}):dn.length===1&&dn[0]?.layout==="chat"?r(Hc,{...ci,panelSize:p}):r(_d,{panelProps:{...ci,panelSize:p,onClose:y?cn:void 0},enabledModules:dn,nav:C,bus:n,hasUnread:Kd.value,onSelectConversation:l_,onStartNewConversation:Pr,onSetPanelSize:Ye})};if(e.mode==="page"){let p=M=>{kr(M.conversationId)},y=dn.some(M=>M.layout==="chat");return r("div",{class:`${sr}-anchor`,children:r(Wc,{site:Td,blocks:Id,transport:X,strings:Be.strings,locale:Be.locale,persistence:o,visitorId:a,showConversations:y,onSelectConversation:p,onNewConversation:Pr,sidebarCollapsed:Md,onToggleSidebarCollapsed:a_,children:wr("fullscreen")})})}if(ie){let p=e.mode==="standalone"?"fullscreen":xe;return r("div",{class:`${sr}-anchor`,children:wr(p)})}let di=e.mode==="drawer",_i=!(e.mode==="modal")&&!e.launcher.hidden&&(!I||Z),ui=_i&&!Z&&!De&&!di?Be.launcher.callout:null;return r("div",{class:`${sr}-anchor`,"data-launcher-size":Be.launcher.size,children:[I||$?r("div",{class:`${sr}-surface`,hidden:!I,children:wr(xe)}):null,_i?r(Wl,{onToggle:br,launcher:Be.launcher,strings:Be.strings,leaving:Z,edgeTab:di}):null,ui?r(Vl,{callout:ui,launcherPosition:Be.position,strings:Be.strings,closeLabel:Be.strings.close,onDismiss:Pe}):null]})}function Am(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Mm=120;async function Lm(e,t,n){let o=[];for(let a of t)try{let{id:i,url:l}=await e.uploadFile(a.file);o.push({id:i,name:a.name,mediaType:a.mediaType,size:a.size,url:l})}catch(i){n(i)}return o}function lr(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var Om=W.scope("error-boundary"),cr=class extends $e{constructor(){super(...arguments);K(this,"state",{crashed:!1})}componentDidCatch(n,o){Om.error("widget render crashed",{error:n,componentStack:o?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,o?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Nm="1",Dm=60,$m=2e3,yd={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function Fm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Bm(){return location.origin+location.pathname}function Hm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Pd(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:m,aiAgentDeploymentId:_,mode:h,themeMode:f}=t.getOptions();if(!u.enabled||Fm()||n>=u.sampleRate)return;let b=performance.now();if(b-o>6e4&&(o=b,a=0),++a>Dm)return;let g=new URLSearchParams;g.set("v",Nm),g.set("_ev",qt),g.set("e",c),u.token&&g.set("tk",u.token),m&&g.set("pk",m),_&&g.set("dep",_),g.set("vid",t.getVisitorId());let x=t.getConversationId();x&&g.set("cid",x),g.set("url",Bm());let C=Hm();C&&g.set("ref",C),g.set("sw",String(screen.width)),g.set("sh",String(screen.height)),g.set("vw",String(innerWidth)),g.set("vh",String(innerHeight)),g.set("dpr",String(devicePixelRatio)),g.set("lang",navigator.language);try{g.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(g.set("m",h),g.set("th",f),d)for(let[te,j]of Object.entries(d))j!==void 0&&g.set(te,String(j));g.set("ts",String(Date.now()));let v=`${u.endpoint}?${g}`;if(v.length>$m)return;let S=new Image(1,1);i.add(S);let U=()=>i.delete(S);S.addEventListener("load",U,{once:!0}),S.addEventListener("error",U,{once:!0}),S.src=v},s=Object.keys(yd).map(c=>e.on(c,d=>l(c,yd[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function dr(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=ft(l),d=!0,u=()=>{c=ft(s?Fr(l,s):l)},m=()=>{us(n,Ct(c.mode));let f=a.loadUserPrefs().themeMode;ps(n,f?{...c,themeMode:f}:c),d&&(go(n,La(c)),d=!1)},_=()=>{m(),kt(it(cr,{onError:i},it(bd,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",f=>{f.config&&(f.config.storageVersion&&a.rememberStorageVersion(f.config.storageVersion),s=f.config,u(),_())});let h=Pd(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:_,setUserOptions:f=>{l=f,u(),_()},patchUserOptions:f=>{l={...l,...f},u(),_()},destroy:()=>h()}}function La(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=gt(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=Sn(e,Yt(),t.loadPanelOpen(),t.loadPanelSize());return Eo(e.mode,o,n)}var zm=W.scope("hooks"),Na="*",Oa=new Set;function Da(e,t,n){let o={widgetId:e,event:t,listener:n};return Oa.add(o),()=>{Oa.delete(o)}}function Um(e,t,n){let o=[...Oa];for(let a of o)if(qm(a.widgetId,e.widgetId)&&!(a.event!==Na&&a.event!==t))try{a.listener(e,t,n)}catch(i){zm.warn("hook listener threw",{event:t,error:i})}}function xd(e,t){let n=[];for(let o of Wm)n.push(t.on(o,a=>{Um(e,o,a)}));return()=>{for(let o of n)o()}}function $a(e){if(Array.isArray(e))for(let t of e){let n=Vm(t);n&&Da(n.widgetId,n.event,n.listener)}}function qm(e,t){return e===Na||e===t}var Wm=["open","close","expand","fullscreen","resize","message","send","stop","clear","selectConversation","suggestion","toggleHistory","formSubmit","toolResult","toolDecision","messageFeedback","contentView","contentOpen","contentSearch","contentRead","contentLinkClick","attach","removeAttachment","voiceStart","voiceStop","voiceCancel","localeChange","themeChange","textSizeChange","soundToggle","sidebarToggle","calloutDismiss","error","handshake","visitorRebound","conversationRebound"];function Vm(e){let t,n,o;if(Array.isArray(e))[t,n,o]=e;else if(e&&typeof e=="object")({widgetId:t,event:n,listener:o}=e);else return null;return typeof t!="string"||typeof n!="string"||typeof o!="function"?null:{widgetId:t,event:n,listener:o}}var ut=new Map;function _r(e){e.debug!==void 0&&ro(e.debug);let t=W.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=ft(e),o=n.widgetId,a=ut.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=La(n),l=n.iframe?gs({position:Ct(n.mode)},n.position,i,n.mode,e.target??null):Wt({position:Ct(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Vt,c=gt(o,n.storage,n.aiAgentDeploymentId),d=b=>{s.emit("error",b),u.getOptions().onError?.(b)},u=dr({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let m=l.hostElement,_=null,h=b=>{b.debug!==void 0&&ro(b.debug),u.patchUserOptions(b)},f={widgetId:o,open:()=>hn(m,"open"),close:()=>hn(m,"close"),expand:()=>hn(m,"expand"),openForm:b=>hn(m,"openForm",b),on:(b,g)=>s.on(b,g),update:b=>{t.debug("update",{patch:b}),h(b)},setUserContext:b=>{t.debug("setUserContext",{keys:Object.keys(b)}),h({userContext:{...u.getUserOptions().userContext,...b}})},clearUserContext:()=>{t.debug("clearUserContext"),h({userContext:void 0})},setPageContext:b=>{t.debug("setPageContext",{keys:Object.keys(b)}),h({pageContext:{...u.getUserOptions().pageContext,...b}})},clearPageContext:()=>{t.debug("clearPageContext"),h({pageContext:void 0})},setDebug:b=>{ro(b),t.info("debug level set",{level:_n()})},debugLevel:()=>_n(),onLog:b=>un(b),destroy:()=>{t.info("destroy",{widgetId:o}),_?.(),u.destroy(),s.clear(),kt(null,l.appRoot),l.destroy(),ut.get(o)===f&&ut.delete(o)}};return _=xd(f,s),ut.set(o,f),f}function ur(e){let t=e.widgetId??"default",n=ut.get(t);return n?(n.update(e),n):_r(e)}function Fa(e){if(e!==void 0){ut.get(e)?.destroy();return}let t=[...ut.values()];for(let n of t)n.destroy()}function nt(e="default"){return ut.get(e)??null}function Sd(){return[...ut.values()]}function Ba(e,t,n){return Da(e,t,n)}var kd=qt;var Ha=class extends HTMLElement{constructor(){super(...arguments);K(this,"bus",new Vt);K(this,"mountResult",null);K(this,"runtime",null)}static get observedAttributes(){return Br}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,kt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=so(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=ft(n);this.mountResult||(this.mountResult=Wt({existingHost:this,position:Ct(o.mode)}));let a=gt(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=dr({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:a,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},wd=!1;function za(){if(wd||typeof customElements>"u")return;let e=P.tagName;customElements.get(e)||customElements.define(e,Ha),wd=!0}typeof customElements<"u"&&za();var Cd=W.scope("iife"),Ua={close:()=>nt()?.close(),destroy:()=>Fa(),expand:()=>nt()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Ba(e,t,n):void 0,init:e=>ur(e),mount:e=>_r(e),on:(e,t)=>nt()?.on(e,t),onLog:e=>un(e),open:()=>nt()?.open(),setDebug:e=>nt()?.setDebug(e),update:e=>nt()?.update(e)};function Ed(e,...t){let n=Ua[e];if(!n){Cd.warn("unknown command",{command:e});return}return n(...t)}function Km(){let e=((n,...o)=>Ed(n,...o));e.init=ur,e.mount=_r,e.destroy=Fa,e.getInstance=nt,e.getAllInstances=Sd,e.version=kd,e.hook=Ba,e.debugLevel=()=>_n(),e.onLog=un;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(Ua)){if(t.has(n))continue;let o=Ua[n];Reflect.set(e,n,(...a)=>o(...a))}return e}function Gm(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[a,...i]=o;if(typeof a=="string")try{Ed(a,...i)}catch(l){Cd.warn("queued command failed",{command:a,error:l})}}}function jm(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)$a([o]);return t(...n)},e}function Xm(){let e=document.scripts;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.src.includes("elements"))return n}return null}function Ym(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[P.global],t=Km();globalThis[P.global]=t,za();let n=`${P.global}Hooks`,o=globalThis[n];if($a(o),globalThis[n]=jm(),Gm(e),nt())return;let a=document.currentScript??Xm(),i=Hr(a?.dataset);if(!i.publicKey)return;let l=()=>{nt()||ur(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}Ym();return m_(Jm);})();
42
42
  //# sourceMappingURL=elements.js.map