@helpai/elements 0.63.0 → 0.63.2

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,18 +1,18 @@
1
- "use strict";var HelpAI=(()=>{var $r=Object.defineProperty;var Gd=Object.getOwnPropertyDescriptor;var Kd=Object.getOwnPropertyNames;var jd=Object.prototype.hasOwnProperty;var Xd=(e,t,n)=>t in e?$r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Yd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Kd(t))!jd.call(e,a)&&a!==n&&$r(e,a,{get:()=>t[a],enumerable:!(o=Gd(t,a))||o.enumerable});return e};var Jd=e=>Yd($r({},"__esModule",{value:!0}),e);var J=(e,t,n)=>Xd(e,typeof t!="symbol"?t+"":t,n);var gf={};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}",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"},Qd={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}",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"},Zd={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}",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"},e_={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}",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"},t_={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}",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"},n_={en:Pi,fr:Qd,ar:Zd,es:e_,he:t_};function eo(e,t){let n=xi(e),o=to(t),a=n==="en"?{}:n_[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...Pi,...a,...l,...i}}function xi(e){return(e.split("-")[0]??"en").toLowerCase()}var o_=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function Si(e){return o_.has(xi(e))}function Ne(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 ki(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function wi(e,t){let{translations:n,defaultLocale:o,...a}=e,i=ki(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function Ci(e,t){let{translations:n,defaultLocale:o,...a}=e,i=ki(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 p=new Map((d.options??[]).map(h=>[h.value,h]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(h=>{let u=p.get(h.value);return u?{...h,label:u.label??h.label,description:u.description??h.description}:h})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var Fr=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 Fr;var zr=["off","error","warn","info","debug","trace"],Ur=P.cssPrefix,Ti=`${Ur}.debug`,r_=`__${P.global}_DEBUG__`,a_=`${Ur}-debug`,oo=2,Hr=null;function i_(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(a_);if(e!==null){let t=Br(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Ti);if(e){let t=Br(e);if(t>=0)return t}}catch{}return Reflect.get(window,r_)?4:2}function Br(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=zr.indexOf(e);if(t>=0)return t}return-1}function ro(e){let t=Br(e);if(!(t<0)){oo=t;try{window.localStorage?.setItem(Ti,zr[t])}catch{}}}function gn(){return zr[oo]}oo=i_();function Ei(e){let t=`[${Ur}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(oo<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),Hr))try{Hr({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=>Ei(`${e}:${o}`)}}var K=Ei("core");function hn(e){Hr=e}var St=K.scope("context"),s_=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),Ri=50,qr=1024,l_=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Wr(e){return Ai(e,"userContext",!0)}function Vr(e){return Ai(e,"pageContext",!1)}function Ai(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(s_.has(i)){St.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=Ri){St.warn(`${t} truncated at ${Ri} keys \u2014 dropped "${i}"`);continue}let s=c_(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!l_.test(o.email)&&(St.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function c_(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>qr?(St.warn(`truncated ${e}.${t} to ${qr} chars`),o.slice(0,qr)):o}St.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var ao={maxBytes:10485760,maxCount:10,accept:"*/*"},Ii={voice:"local"},Li={list:[],byTrigger:{}},Gr={enabled:!0,sampleRate:1},io={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Ut={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Mi={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"]},Kr={enabled:!0,volume:.3,events:void 0},Oi={enabled:!0,events:void 0},Ni=[{label:"tabConversations",layout:"chat"}];function pt(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}=d_(t.theme),p=n.mode??"floating",h=__(a.defaultLocale),u=a.availableLocales??[a.locale??h],f=qt(a.locale??h,u,h),m=(t.baseUrl??P.defaultBaseUrl).replace(/\/$/,""),x=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:x,dataApiBaseUrl:v,userContext:Wr(t.userContext),pageContext:Vr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:p,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??Ii.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0,tools:t.features?.tools},forms:vn(t.forms,f),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:f,defaultLocale:h,availableLocales:u,startMinimized:o.startMinimized??!0,actions:u_(p,s.actions),size:n.size??{},launcher:y_(t.launcher),sound:p_(i.sound),haptics:m_(i.haptics),strings:eo(f,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:g_(l.poweredBy),composer:h_(t.composer),modules:v_(t.modules),tracking:f_(t.tracking,v),storage:t.storage??no,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function d_(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function __(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function qt(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function u_(e,t){return t??Mi[e]}function p_(e){return{enabled:e?.enabled??Kr.enabled,volume:e?.volume??Kr.volume,events:e?.events}}function m_(e){return{enabled:e?.enabled??Oi.enabled,events:e?.events}}function f_(e,t){let n=e?.sampleRate??Gr.sampleRate;return{enabled:e?.enabled??Gr.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 g_(e){let n={...{text:`Powered by ${P.displayName}`,href:P.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function h_(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function v_(e){let t=e===void 0?Ni: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 vn(e,t){var i;if(!e?.length)return Li;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=Ci(l,t),c=(s.fields??[]).filter(p=>!!(p&&p.name&&p.label&&p.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(b_).filter(p=>p!==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 b_(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 y_(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??Ut.variant,size:e?.size??Ut.size,label:e?.label??Ut.label,icon:e?.icon??Ut.icon,hidden:e?.hidden??Ut.hidden,callout:t}}function jr(e,t,n,o){let a=qt(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 P_=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Xr(e,t){if(!t)return e;let n={...e};for(let i of P_){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]=Di(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=Di(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=x_(s,l)),n.i18n=i}return n}function Di(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 x_(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 S_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],at=e=>e!=="false",Fi=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Hi=[["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]],Bi=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",at]],zi=[["width","width"],["height","height"]],Ui=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",at],["show-reasoning","showReasoning",at],["show-tool-calls","showToolCalls",at],["show-sources","showSources",at],["disable-message-feedback","disableMessageFeedback",at],["auto-send-suggestions","autoSendSuggestions",at]],qi=[["locale","locale"]],k_=new Set(S_),w_=e=>Fi(e).filter(t=>k_.has(t)),Wi=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",at]],Vi=[["features-disable-file-upload","disableFileUpload",at],["features-voice","voice",e=>e],["features-tools","tools",Fi]],Gi=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Ki=[["user-id","id"],["user-email","email"],["user-name","name"]],ji=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],C_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],T_=[Hi,Bi,zi,Ui,qi,Wi,Vi,Gi,Ki,ji],E_=new Set(["iframe","start-minimized"]),Yr=[...T_.flatMap(e=>e.map(([t])=>t).filter(t=>!E_.has(t))),...C_];function so(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,x]of Hi){let v=n(f);v!==void 0&&(t[m]=x?x(v):v)}let o=kt(n,Bi),a=kt(n,zi);(o||a)&&(t.presentation={...o,...a?{size:a}:{}});let i=kt(n,Ui);i&&(t.behavior=i);let l=kt(n,qi);l&&(t.i18n=l);let s=A_(e,n);s&&(t.launcher=s);let c=kt(n,Vi);c&&(t.features=c);let d=kt(n,Gi);d&&(t.endpoints=d);let p=$i(n,Ki,"user-context");p&&(t.userContext=p);let h=$i(n,ji,"page-context");h&&(t.pageContext=h);let u=n("actions");return u!==void 0&&(t.header={actions:w_(u)}),t}function Jr(e){return e?so(t=>e[R_(t)]??null):{}}function R_(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 $i(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 A_(e,t){let n=kt(t,Wi)??{},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 fo,te,Zi,ta,mt,Xi,es,ts,Qr,co,bn,ns,na,Zr,ea,I_,uo={},po=[],L_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,go=Array.isArray;function it(e,t){for(var n in t)e[n]=t[n];return e}function oa(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ho(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?fo.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??++Zi,__i:-1,__u:0};return a==null&&te.vnode!=null&&te.vnode(i),i}function ae(e){return e.children}function ft(e,t){this.props=e,this.context=t}function Wt(e,t){if(t==null)return e.__?Wt(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"?Wt(e):null}function M_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=it({},t);i.__v=t.__v+1,te.vnode&&te.vnode(i),ra(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Wt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,ss(o,i,a),t.__e=t.__=null,i.__e!=n&&os(i)}}function os(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}),os(e)}function Yi(e){(!e.__d&&(e.__d=!0)&&mt.push(e)&&!mo.__r++||Xi!=te.debounceRendering)&&((Xi=te.debounceRendering)||es)(mo)}function mo(){try{for(var e,t=1;mt.length;)mt.length>t&&mt.sort(ts),e=mt.shift(),t=mt.length,M_(e)}finally{mt.length=mo.__r=0}}function rs(e,t,n,o,a,i,l,s,c,d,p){var h,u,f,m,x,v,b,w=o&&o.__k||po,y=t.length;for(c=O_(n,t,w,c,y),h=0;h<y;h++)(f=n.__k[h])!=null&&(u=f.__i!=-1&&w[f.__i]||uo,f.__i=h,v=ra(e,f,u,a,i,l,s,c,d,p),m=f.__e,f.ref&&u.ref!=f.ref&&(u.ref&&aa(u.ref,null,f),p.push(f.ref,f.__c||m,f)),x==null&&m!=null&&(x=m),(b=!!(4&f.__u))||u.__k===f.__k?(c=as(f,c,e,b),b&&u.__e&&(u.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=x,c}function O_(e,t,n,o,a){var i,l,s,c,d,p=n.length,h=p,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):go(l)?l=e.__k[i]=_o(ae,{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+u,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=N_(l,n,c,h))!=-1&&(h--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>p?u--:a<p&&u++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?u--:d==c+1?u++:(d>c?u--:u++,l.__u|=4))):e.__k[i]=null;if(h)for(i=0;i<p;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Wt(s)),cs(s,s));return o}function as(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=as(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Wt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function N_(e,t,n,o){var a,i,l,s=e.key,c=e.type,d=t[n],p=d!=null&&(2&d.__u)==0;if(d===null&&s==null||p&&s==d.key&&c==d.type)return n;if(o>(p?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 Ji(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||L_.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||Ji(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ji(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ns,"$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[bn]=o[bn]:(n[bn]=na,e.addEventListener(t,i?ea:Zr,i)):e.removeEventListener(t,i?ea:Zr,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 Qi(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[co]==null)t[co]=na++;else if(t[co]<n[bn])return;return n(te.event?te.event(t):t)}}}function ra(e,t,n,o,a,i,l,s,c,d){var p,h,u,f,m,x,v,b,w,y,E,H,Q,ie,ne,ee,O=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(p=te.__b)&&p(t);e:if(typeof O=="function"){h=l.length;try{if(w=t.props,y=O.prototype&&O.prototype.render,E=(p=O.contextType)&&o[p.__c],H=p?E?E.props.value:p.__:o,n.__c?b=(u=t.__c=n.__c).__=u.__E:(y?t.__c=u=new O(w,H):(t.__c=u=new ft(w,H),u.constructor=O,u.render=$_),E&&E.sub(u),u.state||(u.state={}),u.__n=o,f=u.__d=!0,u.__h=[],u._sb=[]),y&&u.__s==null&&(u.__s=u.state),y&&O.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=it({},u.__s)),it(u.__s,O.getDerivedStateFromProps(w,u.__s))),m=u.props,x=u.state,u.__v=t,f)y&&O.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),y&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(y&&O.getDerivedStateFromProps==null&&w!==m&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,H),t.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,H)===!1){t.__v!=n.__v&&(u.props=w,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(D){D&&(D.__=t)}),po.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&l.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,H),y&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(m,x,v)})}if(u.context=H,u.props=w,u.__P=e,u.__e=!1,Q=te.__r,ie=0,y)u.state=u.__s,u.__d=!1,Q&&Q(t),p=u.render(u.props,u.state,u.context),po.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,Q&&Q(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++ie<25);u.state=u.__s,u.getChildContext!=null&&(o=it(it({},o),u.getChildContext())),y&&!f&&u.getSnapshotBeforeUpdate!=null&&(v=u.getSnapshotBeforeUpdate(m,x)),ne=p!=null&&p.type===ae&&p.key==null?ls(p.props.children):p,s=rs(e,go(ne)?ne:[ne],t,n,o,a,i,l,s,c,d),u.base=t.__e,t.__u&=-161,u.__h.length&&l.push(u),b&&(u.__E=u.__=null)}catch(D){if(l.length=h,t.__v=null,c||i!=null){if(D.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(ee=i.length;ee--;)oa(i[ee])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),D.then||is(t),te.__e(D,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=D_(n.__e,t,n,o,a,i,l,c,d);return(p=te.diffed)&&p(t),128&t.__u?void 0:s}function is(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(is))}function ss(e,t,n){for(var o=0;o<n.length;o++)aa(n[o],n[++o],n[++o]);te.__c&&te.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){te.__e(i,a.__v)}})}function ls(e){return typeof e!="object"||e==null||e.__b>0?e:go(e)?e.map(ls):e.constructor!==void 0?null:it({},e)}function D_(e,t,n,o,a,i,l,s,c){var d,p,h,u,f,m,x,v=n.props||uo,b=t.props,w=t.type;if(w=="svg"?a="http://www.w3.org/2000/svg":w=="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((f=i[d])&&"setAttribute"in f==!!w&&(w?f.localName==w:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(w==null)return document.createTextNode(b);e=document.createElementNS(a,w,b.is&&b),s&&(te.__m&&te.__m(t,i),s=!1),i=null}if(w==null)v===b||s&&e.data==b||(e.data=b);else{if(i=w=="textarea"&&b.defaultValue!=null?null:i&&fo.call(e.childNodes),!s&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?h=f:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||lo(e,d,null,f,a);for(d in b)f=b[d],d=="children"?u=f:d=="dangerouslySetInnerHTML"?p=f:d=="value"?m=f:d=="checked"?x=f:s&&typeof f!="function"||v[d]===f||lo(e,d,f,v[d],a);if(p)s||h&&(p.__html==h.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(h&&(e.innerHTML=""),rs(t.type=="template"?e.content:e,go(u)?u:[u],t,n,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&Wt(n,0),s,c),i!=null)for(d=i.length;d--;)oa(i[d]);s&&w!="textarea"||(d="value",w=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||w=="progress"&&!m||w=="option"&&m!=v[d])&&lo(e,d,m,v[d],a),d="checked",x!=null&&x!=e[d]&&lo(e,d,x,v[d],a))}return e}function aa(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){te.__e(a,n)}}function cs(e,t,n){var o,a;if(te.unmount&&te.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||aa(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){te.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&cs(o[a],t,n||typeof e.type!="function");n||oa(e.__e),e.__c=e.__=e.__e=void 0}function $_(e,t,n){return this.constructor(e,n)}function Vt(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),te.__&&te.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],ra(t,e=(!o&&n||t).__k=ho(ae,null,[e]),a||uo,uo,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?fo.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),ss(i,e,l),e.props.children=null}fo=po.slice,te={__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}},Zi=0,ta=function(e){return e!=null&&e.constructor===void 0},ft.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=it({},this.state),typeof e=="function"&&(e=e(it({},n),this.props)),e&&it(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Yi(this))},ft.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Yi(this))},ft.prototype.render=ae,mt=[],es=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ts=function(e,t){return e.__v.__b-t.__v.__b},mo.__r=0,Qr=Math.random().toString(8),co="__d"+Qr,bn="__a"+Qr,ns=/(PointerCapture)$|Capture$/i,na=0,Zr=Qi(!1),ea=Qi(!0),I_=0;var Gt="0.63.0";function ds(e){return`${P.cssPrefix}:${e}`}function yn(e,t,n){e.dispatchEvent(new CustomEvent(ds(t),{detail:n}))}function _s(e,t){let o=Object.entries(t).map(([a,i])=>{let l=ds(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 Ge(){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,F_(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 F_(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=K.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`,p=`${s}.userPrefs`,h=`${s}.panelOpen`,u=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,x=`${s}.activeModule`,v=`${s}.historyCount`,b=`${s}.formsDone`,w={getVisitorId(){let y=t.get(c);if(y)return y;let E=Ge();return t.set(c,E),E},setVisitorId(y){wt.debug("setVisitorId (rebind)",{id:y,scope:o}),t.set(c,y)},loadConversationId(){return t.get(d)??void 0},saveConversationId(y){wt.trace("saveConversationId",{id:y,scope:o}),y?t.set(d,y):t.remove(d)},loadUserPrefs(){let y=t.get(p);if(!y)return{};try{let E=JSON.parse(y);return us(E)?E:{}}catch(E){return wt.warn("loadUserPrefs parse failed",{error:E}),{}}},saveUserPrefs(y){try{t.set(p,JSON.stringify(y))}catch(E){wt.warn("saveUserPrefs serialise failed",{error:E})}},patchUserPrefs(y){let E=w.loadUserPrefs();w.saveUserPrefs({...E,...y})},loadPanelOpen(){let y=t.get(h);return y==="1"?!0:y==="0"?!1:null},savePanelOpen(y){t.set(h,y?"1":"0")},loadPanelSize(){let y=t.get(u);return y==="normal"||y==="expanded"||y==="fullscreen"?y:null},savePanelSize(y){t.set(u,y)},loadCalloutDismissed(y){if(!y)return!1;let E=t.get(f);return!!E&&E===y},saveCalloutDismissed(y){y?t.set(f,y):t.remove(f)},loadSidebarCollapsed(){let y=t.get(m);return y==="1"?!0:y==="0"?!1:null},saveSidebarCollapsed(y){t.set(m,y?"1":"0")},loadActiveModule(){return t.get(x)||null},saveActiveModule(y){t.set(x,y)},loadHistoryCount(){let y=t.get(v);if(!y)return null;let E=Number.parseInt(y,10);return Number.isFinite(E)&&E>=0?E:null},saveHistoryCount(y){t.set(v,String(y))},loadFormsDone(){let y=t.get(b);if(!y)return{};try{let E=JSON.parse(y);return us(E)?E:{}}catch(E){return wt.warn("loadFormsDone parse failed",{error:E}),{}}},saveFormDone(y){try{let E=w.loadFormsDone();E[y]=Date.now(),t.set(b,JSON.stringify(E))}catch(E){wt.warn("saveFormDone serialise failed",{error:E})}},rememberStorageVersion(y){y&&y!==t.get(a)&&(wt.debug("rememberStorageVersion (force-reset on next load)",{version:y}),t.set(a,y))},clearConversation(){t.remove(d)}};return w}function us(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ps=`: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 ms=`*,*: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 fs=`.__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-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{background:color-mix(in oklab,var(--__P__-bubble-assistant),var(--__P__-brand-accent-solid, var(--__P__-primary)) 9%);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px;border-inline-start:2px solid color-mix(in oklab,var(--__P__-brand-accent-solid, var(--__P__-primary)),transparent 45%)}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{font-size:.72rem;font-weight:600;color:var(--__P__-brand-accent, var(--__P__-primary));opacity:.85}.__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__-brand-accent-solid, var(--__P__-primary)) 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__-brand-accent-solid, var(--__P__-primary))}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}@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 gs=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
5
- `;var hs=`: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 W_="helpai",V_="#5B5BD6",G_="#FFFFFF",K_="12px",j_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",ia=[ps,ms,fs,gs,hs].join(`
7
- `).replace(/__P__/g,W_).replaceAll("__BRAND_ACCENT_TEXT__",G_).replaceAll("__BRAND_ACCENT__",V_).replaceAll("__BRAND_RADIUS__",K_).replaceAll("__BRAND_FONT__",j_);var X_=K.scope("mount"),vs=new WeakMap,bs={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 ys(e,t){e.style.cssText=bs[t]}function Ct(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Kt(e={}){let t=e.position??"flow";X_.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=bs[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!Y_(a,i)){let s=i.createElement("style");s.textContent=ia,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 Y_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=vs.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(ia),vs.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function J_(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 Q_(e,t){e.dataset.theme=t}function Z_(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 eu(e,t){e.dataset.position=t}function vo(e,t){e.dataset.mode=t}function Ps(e,t){Q_(e,t.themeMode),J_(e,t.themeOverrides),eu(e,t.position),Z_(e,t.size)}var tu=K.scope("iframe"),nu='<!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 ks(e,t,n="closed",o="floating",a=null){tu.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"),Ss(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(nu),s.close();let c=Kt({...e,target:s.body}),d=new MutationObserver(()=>{Ss(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 bo="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",xs={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 Ss(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${bo}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${bo}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=`${bo}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}=xs[n]??xs.open;e.style.cssText=`${bo}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var jt=class{constructor(){J(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,sa,ws,Pn=0,Ms=[],Pe=te,Cs=Pe.__b,Ts=Pe.__r,Es=Pe.diffed,Rs=Pe.__c,As=Pe.unmount,Is=Pe.__;function Po(e,t){Pe.__h&&Pe.__h(he,e,Pn||t),Pn=0;var n=he.__H||(he.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return Pn=1,ou(Os,e)}function ou(e,t,n){var o=Po(Xt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Os(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 p=!1,h=o.__c.props!==s;if(o.__c.__H.__.some(function(f){if(f.__N){p=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(h=!0)}}),i){var u=i.call(this,s,c,d);return p?u||h:u}return!p||h};he.__f=!0;var i=he.shouldComponentUpdate,l=he.componentWillUpdate;he.componentWillUpdate=function(s,c,d){if(this.__e){var p=i;i=void 0,a(s,c,d),i=p}l&&l.call(this,s,c,d)},he.shouldComponentUpdate=a}return o.__N||o.__}function T(e,t){var n=Po(Xt++,3);!Pe.__s&&ca(n.__H,t)&&(n.__=e,n.u=t,he.__H.__h.push(n))}function Tt(e,t){var n=Po(Xt++,4);!Pe.__s&&ca(n.__H,t)&&(n.__=e,n.u=t,he.__h.push(n))}function N(e){return Pn=5,De(function(){return{current:e}},[])}function De(e,t){var n=Po(Xt++,7);return ca(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return Pn=8,De(function(){return e},t)}function ru(){for(var e;e=Ms.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(yo),t.__h.some(la),t.__h=[]}catch(n){t.__h=[],Pe.__e(n,e.__v)}}}Pe.__b=function(e){he=null,Cs&&Cs(e)},Pe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Is&&Is(e,t)},Pe.__r=function(e){Ts&&Ts(e),Xt=0;var t=(he=e.__c).__H;t&&(sa===he?(t.__h=[],he.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(yo),t.__h.some(la),t.__h=[],Xt=0)),sa=he},Pe.diffed=function(e){Es&&Es(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ms.push(t)!==1&&ws===Pe.requestAnimationFrame||((ws=Pe.requestAnimationFrame)||au)(ru)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),sa=he=null},Pe.__c=function(e,t){t.some(function(n){try{n.__h.some(yo),n.__h=n.__h.filter(function(o){return!o.__||la(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],Pe.__e(o,n.__v)}}),Rs&&Rs(e,t)},Pe.unmount=function(e){As&&As(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{yo(o)}catch(a){t=a}}),n.__H=void 0,t&&Pe.__e(t,n.__v))};var Ls=typeof requestAnimationFrame=="function";function au(e){var t,n=function(){clearTimeout(o),Ls&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Ls&&(t=requestAnimationFrame(n))}function yo(e){var t=he,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),he=t}function la(e){var t=he;e.__c=e.__(),he=t}function ca(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Os(e,t){return typeof t=="function"?t(e):t}var iu=Symbol.for("preact-signals");function wo(){if(st>1)st--;else{var e,t=!1;for((function(){var a=So;for(So=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}})();Sn!==void 0;){var n=Sn;for(Sn=void 0,xo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ds(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(xo=0,st--,t)throw e}}function Yt(e){if(st>0)return e();da=++su,st++;try{return e()}finally{wo()}}var xn,pe=void 0;function kn(e){var t=pe,n=xn;pe=void 0,xn=void 0;try{return e()}finally{pe=t,xn=n}}var Sn=void 0,st=0,xo=0,su=0,da=0,So=void 0,ko=0;function Ns(e){if(pe!==void 0){var t=e.n;if(t===void 0||t.t!==pe)return t={i:0,S:e,p:pe.s,n:void 0,t:pe,e:void 0,x:void 0,r:t},pe.s!==void 0&&(pe.s.n=t),pe.s=t,e.n=t,32&pe.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=pe.s,t.n=void 0,pe.s.n=t,pe.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=iu;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:kn(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&&kn(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;kn(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 kn(function(){return e.value})};Object.defineProperty(ke.prototype,"value",{get:function(){var e=Ns(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(xo>100)throw new Error("Cycle detected");(function(n){st!==0&&xo===0&&n.l!==da&&(n.l=da,So={S:n,v:n.v,i:n.i,o:So})})(this),this.v=e,this.i++,ko++,st++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{wo()}}}});function B(e,t){return new ke(e,t)}function Ds(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 $s(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 Fs(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=ko-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===ko))return!0;if(this.g=ko,this.f|=1,this.i>0&&!Ds(this))return this.f&=-2,!0;var e=pe;try{$s(this),pe=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 pe=e,Fs(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=Ns(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function wn(e,t){return new Et(e,t)}function Hs(e){var t=e.m;if(e.m=void 0,typeof t=="function"){st++;var n=pe;pe=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,_a(e),o}finally{pe=n,wo()}}}function _a(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Hs(e)}function lu(e){if(pe!==this)throw new Error("Out-of-order effect");Fs(this),pe=e,this.f&=-2,8&this.f&&_a(this),wo()}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,xn&&xn.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,Hs(this),$s(this),st++;var e=pe;return pe=this,lu.bind(this,e)};Jt.prototype.N=function(){2&this.f||(this.f|=2,this.u=Sn,Sn=this)};Jt.prototype.d=function(){this.f|=8,1&this.f||_a(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 Bs,Eo,Co,cu=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var zs=[];lt(function(){Bs=this.N})();function Qt(e,t){te[e]=t.bind(null,te[e]||function(){})}function To(e){if(Co){var t=Co;Co=void 0,t()}Co=e&&e.S()}function Us(e){var t=this,n=e.data,o=ht(n);o.value=n;var a=De(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=wn(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),p=wn(function(){return!Array.isArray(d.value)&&!ta(d.value)}),h=lt(function(){if(this.N=qs,p.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),u=t.__$u.d;return t.__$u.d=function(){h(),u.call(this)},[p,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}Us.displayName="ReactiveTextNode";Object.defineProperties(ke.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Us},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 ke&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});Qt("__r",function(e,t){if(e(t),t.type!==ae){To();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:""))),Eo=o,To(n)}});Qt("__e",function(e,t,n,o){To(),Eo=void 0,e(t,n,o)});Qt("diffed",function(e,t){To(),Eo=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],p=o[c];d===void 0?(d=du(n,c,p,a),i[c]=d):d.o(p,a)}}}e(t)});function du(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=B(n);return{o:function(l,s){i.value=l,o=s},d:lt(function(){this.N=qs;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 p=d.__$u;p&&(d.__$u=void 0,p.d())}}e(t)});Qt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});ft.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 ht(e,t){return De(function(){return B(e,t)},[])}function Z(e,t){var n=N(e);return n.current=e,Eo.__$f|=4,De(function(){return wn(function(){return n.current()},t)},[])}var _u=function(e){queueMicrotask(function(){queueMicrotask(e)})};function uu(){Yt(function(){for(var e;e=zs.shift();)Bs.call(e)})}function qs(){zs.push(this)===1&&(te.requestAnimationFrame||_u)(uu)}function Ws(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Vs(e){return Ws(e)}function Gs(e){return!(!Ws(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Ro(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 pu=900;function ua(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;if(o==="expanded"||o==="fullscreen"||o==="normal")return o;if(o==="auto"){let a=t.autoSizeBreakpoint??pu;return n>=a?"expanded":"normal"}return"normal"}function Cn(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:ua(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Zt(){return typeof window>"u"?0:window.innerWidth}var mu="x-public-key",fu="x-ai-agent-deployment-id";function Ks(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[fu]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??mu]=e.publicKey),t}}}var Ke=class extends Error{constructor(n,o,a,i){super(n);J(this,"code",o);J(this,"status",a);J(this,"cause",i);this.name="StreamError"}};var js=K.scope("parser");async function*Ao(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Ke(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of gu(e,t)){let o=hu(n);if(o==="done")return;o&&(yield o)}}async function*gu(e,t){if(!e.body)throw new Ke("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 Fr=Object.defineProperty;var Kd=Object.getOwnPropertyDescriptor;var jd=Object.getOwnPropertyNames;var Xd=Object.prototype.hasOwnProperty;var Yd=(e,t,n)=>t in e?Fr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Jd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of jd(t))!Xd.call(e,a)&&a!==n&&Fr(e,a,{get:()=>t[a],enumerable:!(o=Kd(t,a))||o.enumerable});return e};var Qd=e=>Jd(Fr({},"__esModule",{value:!0}),e);var X=(e,t,n)=>Yd(e,typeof t!="symbol"?t+"":t,n);var vf={};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 Si={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}",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"},Zd={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}",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"},e_={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}",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"},t_={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}",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"},n_={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}",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"},o_={en:Si,fr:Zd,ar:e_,es:t_,he:n_};function to(e,t){let n=ki(e),o=no(t),a=n==="en"?{}:o_[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...Si,...a,...l,...i}}function ki(e){return(e.split("-")[0]??"en").toLowerCase()}var r_=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function wi(e){return r_.has(ki(e))}function Ne(e,t){return e[t]??t}function no(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Ci(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function Ti(e,t){let{translations:n,defaultLocale:o,...a}=e,i=Ci(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function Ei(e,t){let{translations:n,defaultLocale:o,...a}=e,i=Ci(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 p=new Map((d.options??[]).map(h=>[h.value,h]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(h=>{let u=p.get(h.value);return u?{...h,label:u.label??h.label,description:u.description??h.description}:h})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var Hr=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{}}},oo=new Hr;var Ur=["off","error","warn","info","debug","trace"],qr=P.cssPrefix,Ri=`${qr}.debug`,a_=`__${P.global}_DEBUG__`,i_=`${qr}-debug`,ro=2,Br=null;function s_(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(i_);if(e!==null){let t=zr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Ri);if(e){let t=zr(e);if(t>=0)return t}}catch{}return Reflect.get(window,a_)?4:2}function zr(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=Ur.indexOf(e);if(t>=0)return t}return-1}function ao(e){let t=zr(e);if(!(t<0)){ro=t;try{window.localStorage?.setItem(Ri,Ur[t])}catch{}}}function vn(){return Ur[ro]}ro=s_();function Ai(e){let t=`[${qr}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(ro<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),Br))try{Br({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=>Ai(`${e}:${o}`)}}var K=Ai("core");function bn(e){Br=e}var St=K.scope("context"),l_=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),Ii=50,Wr=1024,c_=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Vr(e){return Li(e,"userContext",!0)}function Gr(e){return Li(e,"pageContext",!1)}function Li(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(l_.has(i)){St.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=Ii){St.warn(`${t} truncated at ${Ii} keys \u2014 dropped "${i}"`);continue}let s=d_(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!c_.test(o.email)&&(St.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function d_(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>Wr?(St.warn(`truncated ${e}.${t} to ${Wr} chars`),o.slice(0,Wr)):o}St.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var io={maxBytes:10485760,maxCount:10,accept:"*/*"},Mi={voice:"local"},Oi={list:[],byTrigger:{}},Kr={enabled:!0,sampleRate:1},so={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},qt={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Ni={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"]},jr={enabled:!0,volume:.3,events:void 0},Di={enabled:!0,events:void 0},$i=[{label:"tabConversations",layout:"chat"}];function pt(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.theme),p=n.mode??"floating",h=u_(a.defaultLocale),u=a.availableLocales??[a.locale??h],f=Wt(a.locale??h,u,h),m=(t.baseUrl??P.defaultBaseUrl).replace(/\/$/,""),x=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:x,dataApiBaseUrl:v,userContext:Vr(t.userContext),pageContext:Gr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:p,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??Mi.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0,tools:t.features?.tools},forms:yn(t.forms,f),endpoints:{upload:t.endpoints?.upload??so.upload,transcribe:t.endpoints?.transcribe??so.transcribe,submitForm:t.endpoints?.submitForm??so.submitForm},attachments:{accept:t.composer?.attachments?.accept??io.accept,maxBytes:t.composer?.attachments?.maxBytes??io.maxBytes,maxCount:t.composer?.attachments?.maxCount??io.maxCount},locale:f,defaultLocale:h,availableLocales:u,startMinimized:o.startMinimized??!0,actions:p_(p,s.actions),size:n.size??{},launcher:P_(t.launcher),sound:m_(i.sound),haptics:f_(i.haptics),strings:to(f,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:h_(l.poweredBy),composer:v_(t.composer),modules:b_(t.modules),tracking:g_(t.tracking,v),storage:t.storage??oo,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function __(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function u_(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 p_(e,t){return t??Ni[e]}function m_(e){return{enabled:e?.enabled??jr.enabled,volume:e?.volume??jr.volume,events:e?.events}}function f_(e){return{enabled:e?.enabled??Di.enabled,events:e?.events}}function g_(e,t){let n=e?.sampleRate??Kr.sampleRate;return{enabled:e?.enabled??Kr.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 h_(e){let n={...{text:`Powered by ${P.displayName}`,href:P.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function v_(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function b_(e){let t=e===void 0?$i: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 yn(e,t){var i;if(!e?.length)return Oi;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=Ei(l,t),c=(s.fields??[]).filter(p=>!!(p&&p.name&&p.label&&p.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(y_).filter(p=>p!==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 y_(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 P_(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 Xr(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=to(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var x_=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Yr(e,t){if(!t)return e;let n={...e};for(let i of x_){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]=Fi(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=Fi(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=S_(s,l)),n.i18n=i}return n}function Fi(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 S_(e,t){if(!e)return t;if(!t)return e;let n=no(e),o=no(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 k_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],at=e=>e!=="false",Bi=e=>e.split(",").map(t=>t.trim()).filter(Boolean),zi=[["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]],Ui=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",at]],qi=[["width","width"],["height","height"]],Wi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",at],["show-reasoning","showReasoning",at],["show-tool-calls","showToolCalls",at],["show-sources","showSources",at],["disable-message-feedback","disableMessageFeedback",at],["auto-send-suggestions","autoSendSuggestions",at]],Vi=[["locale","locale"]],w_=new Set(k_),C_=e=>Bi(e).filter(t=>w_.has(t)),Gi=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",at]],Ki=[["features-disable-file-upload","disableFileUpload",at],["features-voice","voice",e=>e],["features-tools","tools",Bi]],ji=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Xi=[["user-id","id"],["user-email","email"],["user-name","name"]],Yi=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],T_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],E_=[zi,Ui,qi,Wi,Vi,Gi,Ki,ji,Xi,Yi],R_=new Set(["iframe","start-minimized"]),Jr=[...E_.flatMap(e=>e.map(([t])=>t).filter(t=>!R_.has(t))),...T_];function lo(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,x]of zi){let v=n(f);v!==void 0&&(t[m]=x?x(v):v)}let o=kt(n,Ui),a=kt(n,qi);(o||a)&&(t.presentation={...o,...a?{size:a}:{}});let i=kt(n,Wi);i&&(t.behavior=i);let l=kt(n,Vi);l&&(t.i18n=l);let s=I_(e,n);s&&(t.launcher=s);let c=kt(n,Ki);c&&(t.features=c);let d=kt(n,ji);d&&(t.endpoints=d);let p=Hi(n,Xi,"user-context");p&&(t.userContext=p);let h=Hi(n,Yi,"page-context");h&&(t.pageContext=h);let u=n("actions");return u!==void 0&&(t.header={actions:C_(u)}),t}function Qr(e){return e?lo(t=>e[A_(t)]??null):{}}function A_(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 Hi(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 I_(e,t){let n=kt(t,Gi)??{},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 go,te,ts,na,mt,Ji,ns,os,Zr,_o,Pn,rs,oa,ea,ta,L_,po={},mo=[],M_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ho=Array.isArray;function it(e,t){for(var n in t)e[n]=t[n];return e}function ra(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vo(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?go.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 uo(e,l,o,a,null)}function uo(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??++ts,__i:-1,__u:0};return a==null&&te.vnode!=null&&te.vnode(i),i}function ae(e){return e.children}function ft(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 O_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=it({},t);i.__v=t.__v+1,te.vnode&&te.vnode(i),aa(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,cs(o,i,a),t.__e=t.__=null,i.__e!=n&&as(i)}}function as(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}),as(e)}function Qi(e){(!e.__d&&(e.__d=!0)&&mt.push(e)&&!fo.__r++||Ji!=te.debounceRendering)&&((Ji=te.debounceRendering)||ns)(fo)}function fo(){try{for(var e,t=1;mt.length;)mt.length>t&&mt.sort(os),e=mt.shift(),t=mt.length,O_(e)}finally{mt.length=fo.__r=0}}function is(e,t,n,o,a,i,l,s,c,d,p){var h,u,f,m,x,v,b,w=o&&o.__k||mo,y=t.length;for(c=N_(n,t,w,c,y),h=0;h<y;h++)(f=n.__k[h])!=null&&(u=f.__i!=-1&&w[f.__i]||po,f.__i=h,v=aa(e,f,u,a,i,l,s,c,d,p),m=f.__e,f.ref&&u.ref!=f.ref&&(u.ref&&ia(u.ref,null,f),p.push(f.ref,f.__c||m,f)),x==null&&m!=null&&(x=m),(b=!!(4&f.__u))||u.__k===f.__k?(c=ss(f,c,e,b),b&&u.__e&&(u.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=x,c}function N_(e,t,n,o,a){var i,l,s,c,d,p=n.length,h=p,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]=uo(null,l,null,null,null):ho(l)?l=e.__k[i]=uo(ae,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=uo(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,c=i+u,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=D_(l,n,c,h))!=-1&&(h--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>p?u--:a<p&&u++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?u--:d==c+1?u++:(d>c?u--:u++,l.__u|=4))):e.__k[i]=null;if(h)for(i=0;i<p;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Vt(s)),_s(s,s));return o}function ss(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=ss(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 D_(e,t,n,o){var a,i,l,s=e.key,c=e.type,d=t[n],p=d!=null&&(2&d.__u)==0;if(d===null&&s==null||p&&s==d.key&&c==d.type)return n;if(o>(p?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 Zi(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||M_.test(t)?n:n+"px"}function co(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||Zi(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Zi(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(rs,"$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[Pn]=o[Pn]:(n[Pn]=oa,e.addEventListener(t,i?ta:ea,i)):e.removeEventListener(t,i?ta:ea,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 es(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[_o]==null)t[_o]=oa++;else if(t[_o]<n[Pn])return;return n(te.event?te.event(t):t)}}}function aa(e,t,n,o,a,i,l,s,c,d){var p,h,u,f,m,x,v,b,w,y,E,H,Q,ie,ne,ee,O=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(p=te.__b)&&p(t);e:if(typeof O=="function"){h=l.length;try{if(w=t.props,y=O.prototype&&O.prototype.render,E=(p=O.contextType)&&o[p.__c],H=p?E?E.props.value:p.__:o,n.__c?b=(u=t.__c=n.__c).__=u.__E:(y?t.__c=u=new O(w,H):(t.__c=u=new ft(w,H),u.constructor=O,u.render=F_),E&&E.sub(u),u.state||(u.state={}),u.__n=o,f=u.__d=!0,u.__h=[],u._sb=[]),y&&u.__s==null&&(u.__s=u.state),y&&O.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=it({},u.__s)),it(u.__s,O.getDerivedStateFromProps(w,u.__s))),m=u.props,x=u.state,u.__v=t,f)y&&O.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),y&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(y&&O.getDerivedStateFromProps==null&&w!==m&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,H),t.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,H)===!1){t.__v!=n.__v&&(u.props=w,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(D){D&&(D.__=t)}),mo.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&l.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,H),y&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(m,x,v)})}if(u.context=H,u.props=w,u.__P=e,u.__e=!1,Q=te.__r,ie=0,y)u.state=u.__s,u.__d=!1,Q&&Q(t),p=u.render(u.props,u.state,u.context),mo.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,Q&&Q(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++ie<25);u.state=u.__s,u.getChildContext!=null&&(o=it(it({},o),u.getChildContext())),y&&!f&&u.getSnapshotBeforeUpdate!=null&&(v=u.getSnapshotBeforeUpdate(m,x)),ne=p!=null&&p.type===ae&&p.key==null?ds(p.props.children):p,s=is(e,ho(ne)?ne:[ne],t,n,o,a,i,l,s,c,d),u.base=t.__e,t.__u&=-161,u.__h.length&&l.push(u),b&&(u.__E=u.__=null)}catch(D){if(l.length=h,t.__v=null,c||i!=null){if(D.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(ee=i.length;ee--;)ra(i[ee])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),D.then||ls(t),te.__e(D,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=$_(n.__e,t,n,o,a,i,l,c,d);return(p=te.diffed)&&p(t),128&t.__u?void 0:s}function ls(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ls))}function cs(e,t,n){for(var o=0;o<n.length;o++)ia(n[o],n[++o],n[++o]);te.__c&&te.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){te.__e(i,a.__v)}})}function ds(e){return typeof e!="object"||e==null||e.__b>0?e:ho(e)?e.map(ds):e.constructor!==void 0?null:it({},e)}function $_(e,t,n,o,a,i,l,s,c){var d,p,h,u,f,m,x,v=n.props||po,b=t.props,w=t.type;if(w=="svg"?a="http://www.w3.org/2000/svg":w=="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((f=i[d])&&"setAttribute"in f==!!w&&(w?f.localName==w:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(w==null)return document.createTextNode(b);e=document.createElementNS(a,w,b.is&&b),s&&(te.__m&&te.__m(t,i),s=!1),i=null}if(w==null)v===b||s&&e.data==b||(e.data=b);else{if(i=w=="textarea"&&b.defaultValue!=null?null:i&&go.call(e.childNodes),!s&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?h=f:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||co(e,d,null,f,a);for(d in b)f=b[d],d=="children"?u=f:d=="dangerouslySetInnerHTML"?p=f:d=="value"?m=f:d=="checked"?x=f:s&&typeof f!="function"||v[d]===f||co(e,d,f,v[d],a);if(p)s||h&&(p.__html==h.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(h&&(e.innerHTML=""),is(t.type=="template"?e.content:e,ho(u)?u:[u],t,n,o,w=="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--;)ra(i[d]);s&&w!="textarea"||(d="value",w=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||w=="progress"&&!m||w=="option"&&m!=v[d])&&co(e,d,m,v[d],a),d="checked",x!=null&&x!=e[d]&&co(e,d,x,v[d],a))}return e}function ia(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){te.__e(a,n)}}function _s(e,t,n){var o,a;if(te.unmount&&te.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||ia(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){te.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&_s(o[a],t,n||typeof e.type!="function");n||ra(e.__e),e.__c=e.__=e.__e=void 0}function F_(e,t,n){return this.constructor(e,n)}function Gt(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),te.__&&te.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],aa(t,e=(!o&&n||t).__k=vo(ae,null,[e]),a||po,po,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?go.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),cs(i,e,l),e.props.children=null}go=mo.slice,te={__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}},ts=0,na=function(e){return e!=null&&e.constructor===void 0},ft.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=it({},this.state),typeof e=="function"&&(e=e(it({},n),this.props)),e&&it(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Qi(this))},ft.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Qi(this))},ft.prototype.render=ae,mt=[],ns=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,os=function(e,t){return e.__v.__b-t.__v.__b},fo.__r=0,Zr=Math.random().toString(8),_o="__d"+Zr,Pn="__a"+Zr,rs=/(PointerCapture)$|Capture$/i,oa=0,ea=es(!1),ta=es(!0),L_=0;var Kt="0.63.2";function us(e){return`${P.cssPrefix}:${e}`}function xn(e,t,n){e.dispatchEvent(new CustomEvent(us(t),{detail:n}))}function ps(e,t){let o=Object.entries(t).map(([a,i])=>{let l=us(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 Ge(){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,H_(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 H_(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=K.scope("persistence");function gt(e,t=oo,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`,p=`${s}.userPrefs`,h=`${s}.panelOpen`,u=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,x=`${s}.activeModule`,v=`${s}.historyCount`,b=`${s}.formsDone`,w={getVisitorId(){let y=t.get(c);if(y)return y;let E=Ge();return t.set(c,E),E},setVisitorId(y){wt.debug("setVisitorId (rebind)",{id:y,scope:o}),t.set(c,y)},loadConversationId(){return t.get(d)??void 0},saveConversationId(y){wt.trace("saveConversationId",{id:y,scope:o}),y?t.set(d,y):t.remove(d)},loadUserPrefs(){let y=t.get(p);if(!y)return{};try{let E=JSON.parse(y);return ms(E)?E:{}}catch(E){return wt.warn("loadUserPrefs parse failed",{error:E}),{}}},saveUserPrefs(y){try{t.set(p,JSON.stringify(y))}catch(E){wt.warn("saveUserPrefs serialise failed",{error:E})}},patchUserPrefs(y){let E=w.loadUserPrefs();w.saveUserPrefs({...E,...y})},loadPanelOpen(){let y=t.get(h);return y==="1"?!0:y==="0"?!1:null},savePanelOpen(y){t.set(h,y?"1":"0")},loadPanelSize(){let y=t.get(u);return y==="normal"||y==="expanded"||y==="fullscreen"?y:null},savePanelSize(y){t.set(u,y)},loadCalloutDismissed(y){if(!y)return!1;let E=t.get(f);return!!E&&E===y},saveCalloutDismissed(y){y?t.set(f,y):t.remove(f)},loadSidebarCollapsed(){let y=t.get(m);return y==="1"?!0:y==="0"?!1:null},saveSidebarCollapsed(y){t.set(m,y?"1":"0")},loadActiveModule(){return t.get(x)||null},saveActiveModule(y){t.set(x,y)},loadHistoryCount(){let y=t.get(v);if(!y)return null;let E=Number.parseInt(y,10);return Number.isFinite(E)&&E>=0?E:null},saveHistoryCount(y){t.set(v,String(y))},loadFormsDone(){let y=t.get(b);if(!y)return{};try{let E=JSON.parse(y);return ms(E)?E:{}}catch(E){return wt.warn("loadFormsDone parse failed",{error:E}),{}}},saveFormDone(y){try{let E=w.loadFormsDone();E[y]=Date.now(),t.set(b,JSON.stringify(E))}catch(E){wt.warn("saveFormDone serialise failed",{error:E})}},rememberStorageVersion(y){y&&y!==t.get(a)&&(wt.debug("rememberStorageVersion (force-reset on next load)",{version:y}),t.set(a,y))},clearConversation(){t.remove(d)}};return w}function ms(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var fs=`: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 gs=`*,*: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 hs=`.__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-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{background:color-mix(in oklab,var(--__P__-bubble-assistant),var(--__P__-brand-accent-solid, var(--__P__-primary)) 9%);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px;border-inline-start:2px solid color-mix(in oklab,var(--__P__-brand-accent-solid, var(--__P__-primary)),transparent 45%)}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{font-size:.72rem;font-weight:600;color:var(--__P__-brand-accent, var(--__P__-primary));opacity:.85}.__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__-brand-accent-solid, var(--__P__-primary)) 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__-brand-accent-solid, var(--__P__-primary))}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}@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 vs=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
5
+ `;var bs=`: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 V_="helpai",G_="#5B5BD6",K_="#FFFFFF",j_="12px",X_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",sa=[fs,gs,hs,vs,bs].join(`
7
+ `).replace(/__P__/g,V_).replaceAll("__BRAND_ACCENT_TEXT__",K_).replaceAll("__BRAND_ACCENT__",G_).replaceAll("__BRAND_RADIUS__",j_).replaceAll("__BRAND_FONT__",X_);var Y_=K.scope("mount"),ys=new WeakMap,Ps={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 xs(e,t){e.style.cssText=Ps[t]}function Ct(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function jt(e={}){let t=e.position??"flow";Y_.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=Ps[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!J_(a,i)){let s=i.createElement("style");s.textContent=sa,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 J_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=ys.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(sa),ys.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function Q_(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 Z_(e,t){e.dataset.theme=t}function eu(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 tu(e,t){e.dataset.position=t}function bo(e,t){e.dataset.mode=t}function Ss(e,t){Z_(e,t.themeMode),Q_(e,t.themeOverrides),tu(e,t.position),eu(e,t.size)}var nu=K.scope("iframe"),ou='<!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 Cs(e,t,n="closed",o="floating",a=null){nu.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"),ws(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(ou),s.close();let c=jt({...e,target:s.body}),d=new MutationObserver(()=>{ws(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;",ks={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 ws(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}=ks[n]??ks.open;e.style.cssText=`${yo}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var Xt=class{constructor(){X(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 Yt,he,la,Ts,Sn=0,Ns=[],Pe=te,Es=Pe.__b,Rs=Pe.__r,As=Pe.diffed,Is=Pe.__c,Ls=Pe.unmount,Ms=Pe.__;function xo(e,t){Pe.__h&&Pe.__h(he,e,Sn||t),Sn=0;var n=he.__H||(he.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return Sn=1,ru(Ds,e)}function ru(e,t,n){var o=xo(Yt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Ds(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 p=!1,h=o.__c.props!==s;if(o.__c.__H.__.some(function(f){if(f.__N){p=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(h=!0)}}),i){var u=i.call(this,s,c,d);return p?u||h:u}return!p||h};he.__f=!0;var i=he.shouldComponentUpdate,l=he.componentWillUpdate;he.componentWillUpdate=function(s,c,d){if(this.__e){var p=i;i=void 0,a(s,c,d),i=p}l&&l.call(this,s,c,d)},he.shouldComponentUpdate=a}return o.__N||o.__}function T(e,t){var n=xo(Yt++,3);!Pe.__s&&da(n.__H,t)&&(n.__=e,n.u=t,he.__H.__h.push(n))}function Tt(e,t){var n=xo(Yt++,4);!Pe.__s&&da(n.__H,t)&&(n.__=e,n.u=t,he.__h.push(n))}function N(e){return Sn=5,De(function(){return{current:e}},[])}function De(e,t){var n=xo(Yt++,7);return da(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return Sn=8,De(function(){return e},t)}function au(){for(var e;e=Ns.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Po),t.__h.some(ca),t.__h=[]}catch(n){t.__h=[],Pe.__e(n,e.__v)}}}Pe.__b=function(e){he=null,Es&&Es(e)},Pe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ms&&Ms(e,t)},Pe.__r=function(e){Rs&&Rs(e),Yt=0;var t=(he=e.__c).__H;t&&(la===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(ca),t.__h=[],Yt=0)),la=he},Pe.diffed=function(e){As&&As(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ns.push(t)!==1&&Ts===Pe.requestAnimationFrame||((Ts=Pe.requestAnimationFrame)||iu)(au)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),la=he=null},Pe.__c=function(e,t){t.some(function(n){try{n.__h.some(Po),n.__h=n.__h.filter(function(o){return!o.__||ca(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],Pe.__e(o,n.__v)}}),Is&&Is(e,t)},Pe.unmount=function(e){Ls&&Ls(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&&Pe.__e(t,n.__v))};var Os=typeof requestAnimationFrame=="function";function iu(e){var t,n=function(){clearTimeout(o),Os&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Os&&(t=requestAnimationFrame(n))}function Po(e){var t=he,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),he=t}function ca(e){var t=he;e.__c=e.__(),he=t}function da(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Ds(e,t){return typeof t=="function"?t(e):t}var su=Symbol.for("preact-signals");function Co(){if(st>1)st--;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}})();wn!==void 0;){var n=wn;for(wn=void 0,So++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Fs(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(So=0,st--,t)throw e}}function Jt(e){if(st>0)return e();_a=++lu,st++;try{return e()}finally{Co()}}var kn,ue=void 0;function Cn(e){var t=ue,n=kn;ue=void 0,kn=void 0;try{return e()}finally{ue=t,kn=n}}var wn=void 0,st=0,So=0,lu=0,_a=0,ko=void 0,wo=0;function $s(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:Cn(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&&Cn(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;Cn(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 Cn(function(){return e.value})};Object.defineProperty(ke.prototype,"value",{get:function(){var e=$s(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){st!==0&&So===0&&n.l!==_a&&(n.l=_a,ko={S:n,v:n.v,i:n.i,o:ko})})(this),this.v=e,this.i++,wo++,st++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Co()}}}});function B(e,t){return new ke(e,t)}function Fs(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 Hs(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 Bs(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=wo-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===wo))return!0;if(this.g=wo,this.f|=1,this.i>0&&!Fs(this))return this.f&=-2,!0;var e=ue;try{Hs(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,Bs(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=$s(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Tn(e,t){return new Et(e,t)}function zs(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,ua(e),o}finally{ue=n,Co()}}}function ua(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,zs(e)}function cu(e){if(ue!==this)throw new Error("Out-of-order effect");Bs(this),ue=e,this.f&=-2,8&this.f&&ua(this),Co()}function Qt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,kn&&kn.push(this)}Qt.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()}};Qt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,zs(this),Hs(this),st++;var e=ue;return ue=this,cu.bind(this,e)};Qt.prototype.N=function(){2&this.f||(this.f|=2,this.u=wn,wn=this)};Qt.prototype.d=function(){this.f|=8,1&this.f||ua(this)};Qt.prototype.dispose=function(){this.d()};function lt(e,t){var n=new Qt(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Us,Ro,To,du=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var qs=[];lt(function(){Us=this.N})();function Zt(e,t){te[e]=t.bind(null,te[e]||function(){})}function Eo(e){if(To){var t=To;To=void 0,t()}To=e&&e.S()}function Ws(e){var t=this,n=e.data,o=ht(n);o.value=n;var a=De(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=Tn(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),p=Tn(function(){return!Array.isArray(d.value)&&!na(d.value)}),h=lt(function(){if(this.N=Vs,p.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),u=t.__$u.d;return t.__$u.d=function(){h(),u.call(this)},[p,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}Ws.displayName="ReactiveTextNode";Object.defineProperties(ke.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ws},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Zt("__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)});Zt("__r",function(e,t){if(e(t),t.type!==ae){Eo();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;du&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Ro=o,Eo(n)}});Zt("__e",function(e,t,n,o){Eo(),Ro=void 0,e(t,n,o)});Zt("diffed",function(e,t){Eo(),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],p=o[c];d===void 0?(d=_u(n,c,p,a),i[c]=d):d.o(p,a)}}}e(t)});function _u(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=B(n);return{o:function(l,s){i.value=l,o=s},d:lt(function(){this.N=Vs;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))})}}Zt("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 p=d.__$u;p&&(d.__$u=void 0,p.d())}}e(t)});Zt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});ft.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 ht(e,t){return De(function(){return B(e,t)},[])}function Z(e,t){var n=N(e);return n.current=e,Ro.__$f|=4,De(function(){return Tn(function(){return n.current()},t)},[])}var uu=function(e){queueMicrotask(function(){queueMicrotask(e)})};function pu(){Jt(function(){for(var e;e=qs.shift();)Us.call(e)})}function Vs(){qs.push(this)===1&&(te.requestAnimationFrame||uu)(pu)}function Gs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ks(e){return Gs(e)}function js(e){return!(!Gs(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Ao(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 mu=900;function pa(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;if(o==="expanded"||o==="fullscreen"||o==="normal")return o;if(o==="auto"){let a=t.autoSizeBreakpoint??mu;return n>=a?"expanded":"normal"}return"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:pa(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function en(){return typeof window>"u"?0:window.innerWidth}var fu="x-public-key",gu="x-ai-agent-deployment-id";function Xs(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[gu]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??fu]=e.publicKey),t}}}var Ke=class extends Error{constructor(n,o,a,i){super(n);X(this,"code",o);X(this,"status",a);X(this,"cause",i);this.name="StreamError"}};var Ys=K.scope("parser");async function*Io(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Ke(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of hu(e,t)){let o=vu(n);if(o==="done")return;o&&(yield o)}}async function*hu(e,t){if(!e.body)throw new Ke("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 hu(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 vu(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 js.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return js.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function vu(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 Xs=e=>e&&Object.keys(e).length>0?e:void 0;function Ys(e,t){let n=Xs(e),o=Xs(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),vu(JSON.stringify(a))}function Io(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function bu(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Js(e){return e.startsWith("tool-")?e.slice(5):e}var Ue={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",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Qs="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 Lo(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 Zs(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:xu(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(Pu).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function yu(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function Pu(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function xu(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"&&yu(n)){let o={type:bu(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 j=K.scope("transport"),el=3,rl=400,Su=250,ku=5e3,wu=6e4,tl=1e4,nl=3,Cu=new Set([408,425,429,500,502,503,504]);function ol(e){return rl*2**e+Math.floor(Math.random()*250)}function Tu(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}function Mo(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 Oo=class{constructor(t){J(this,"opts",t);J(this,"visitorId");J(this,"conversationId");J(this,"resumeStatus");J(this,"userContext");J(this,"pageContext");J(this,"locale");J(this,"conversationsCache",new Map);J(this,"contentCache",new Map)}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:Gt};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Ys(this.userContext,this.pageContext);return n&&(t[Qs]=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){j.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(Ue.handshake,t,"handshake");return j.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),Ru(n)||j.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){j.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 j.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){j.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${Eu(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return j.debug("transcribe \u2190",{textLen:a.text.length}),a}conversationsKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){let n=this.conversationsCache.get(this.conversationsKey(t));if(n?.value&&Date.now()-n.at<tl)return n.value}listConversations(t={}){let n=this.conversationsKey(t),o=this.conversationsCache.get(n);if(o&&Date.now()-o.at<tl)return j.debug("listConversations \u2192 cache",t),o.result;let a={at:Date.now(),result:this.fetchConversations(t).then(i=>(a.value=i,i)).catch(i=>{throw this.conversationsCache.delete(n),i})};return this.conversationsCache.set(n,a),a.result}async fetchConversations(t){let n=new URL(this.url(Ue.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),j.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 j.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a,nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url(Ue.listMessages));n.searchParams.set("conversationId",t),j.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return j.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(),j.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(Ue.markRead,{conversationId:t},"markRead")}catch(n){j.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){j.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Ue.requestOperator,{},"requestOperator")).controlState}catch(t){j.debug("requestOperator failed (non-fatal)",{err:t});return}}}listContent(t={}){let n=`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`,o=this.contentCache.get(n);if(o&&Date.now()-o.at<wu)return j.debug("listContent \u2192 cache",t),o.result;let a=this.fetchContent(t).catch(i=>{throw this.contentCache.delete(n),i});return this.contentCache.set(n,{at:Date.now(),result:a}),a}async fetchContent(t){let n=new URL(this.dataUrl(Ue.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));j.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>wi(i,this.locale));return j.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(Ue.bootstrap));t&&n.searchParams.set("conversationId",t),j.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return j.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){j.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(Ue.updateSettings,{userPrefs:t},"saveUserPrefs");return j.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??Ue.submitForm}async submitForm(t){j.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){j.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){j.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(Ue.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){j.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),j.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()}}resumeStream(){let t=new AbortController,n=new Set;this.resumeStatus=void 0;let o=this.resumeStreamGen(t,n,!0),a=()=>t.abort();return{iter:o,cancel:a,detach:a}}resumeChannel(){let t=new AbortController;return{iter:this.resumeChannelGen(t),stop:()=>t.abort()}}async*resumeChannelGen(t){for(let n=1;!t.signal.aborted;n++){if(n>1&&(await Mo(Math.min(Su*(n-1),ku),t.signal),t.signal.aborted))return;let o;try{o=await this.fetchImpl(this.resumeUrl(0),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(a){if(t.signal.aborted)return;j.debug("resume-channel fetch failed \u2014 reconnecting",{attempt:n,err:a});continue}if(!o.ok||!o.body){j.debug("resume-channel \u2192 endpoint unavailable",{status:o.status});return}if(!(o.headers.get("content-type")??"").includes("text/event-stream")){let a=await o.json().then(i=>i.status).catch(()=>{});if(a==="pending"){j.debug("resume-channel \u2192 pending (still registering); reconnecting",{attempt:n});continue}j.debug("resume-channel \u2192 no live operator-control stream (status); stopping",{status:a});return}try{for await(let a of Ao(o,t.signal)){if(t.signal.aborted)return;n=0,yield a}}catch(a){if(t.signal.aborted)return;j.debug("resume-channel segment dropped \u2014 reconnecting",{err:a})}}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let a=1;a<=el&&!t.signal.aborted;a++){if((!o||a>1)&&(await Mo(rl*a,t.signal),t.signal.aborted))return;let i;try{i=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(c){if(t.signal.aborted)return;j.debug("resume fetch failed \u2014 retrying",{attempt:a,err:c});continue}if(i.status===204||!i.ok){j.debug("resume \u2192 no in-flight stream",{status:i.status});return}if(!(i.headers.get("content-type")??"").includes("text/event-stream")){let c=await i.json().then(d=>d.status).catch(()=>{});if(j.debug("resume \u2192 no live stream (status response)",{status:c,attempt:a}),c==="pending"&&a<el)continue;this.resumeStatus=c==="needs-generation"?"needs-generation":"completed";return}this.resumeStatus="live";let s=n.size;if(yield*this.drain(Ao(i,t.signal),n,t))return;if(n.size===s){j.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new Ke("stream incomplete after resume attempts","server")}async*drain(t,n,o){let a=!1;try{for await(let i of t){if(o.signal.aborted)return!0;if(i.eventId){if(n.has(i.eventId))continue;n.add(i.eventId)}yield i,(i.chunk.type==="finish"||i.chunk.type==="error")&&(a=!0)}}catch(i){if(o.signal.aborted)return!0;if(i instanceof Ke&&i.status!==void 0)throw i;j.debug("stream segment dropped",{err:i})}return a}cancelStream(t,n){t.signal.aborted||(j.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(Ue.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>j.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(Ue.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*Ao(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(Ue.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}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>=nl)throw new Ke(`${n} failed: network error`,"network",void 0,c);j.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Mo(ol(o));continue}if(l.ok||!Cu.has(l.status)||o>=nl)return l;let s=Tu(l.headers)??ol(o);j.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await Mo(s)}}async assertOk(t,n){if(!t.ok)throw new Ke(`${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 Eu(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 Ru(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function al(e,t){let n=e?[{kind:"text",id:"t0",textSig:B(e),doneSig:B(!0)}]:[];return{id:Ge(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:B(n)}}function Tn(){return{id:Ge(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:B([])}}function il(e){let t=Ge();return Au({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function Au(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:B(e.parts.map(Ou))}}function ma(e){let t=e.parts.map((o,a)=>o.type==="text"?{kind:"text",id:`${e.id}-t${a}`,textSig:B(o.text),doneSig:B(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${a}`,textSig:B(o.text),doneSig:B(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:B(""),inputSig:B(o.input),outputSig:B(o.output),errorSig:B(o.errorText),stateSig:B(o.state),approvalSig:B(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"?Lo(n.data):void 0,serverMessageId:e.id,createdAt:Io(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:B(t)}}function sl(e,t){let n=e.findIndex(o=>o.id===t.id);return n>=0?{list:e.map((o,a)=>a===n?t:o),appended:!1}:{list:[...e,t],appended:!0}}var Iu=new Set(["completed","failed","canceled"]);function Lu(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 Mu(e){return e.role==="assistant"&&e.status!=null&&!Iu.has(e.status)&&Lu(e)}function fa(e){return e.filter(t=>!Mu(t)).map(ma)}function ll(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(Nu)}}function En(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function No(e){return En(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function ct(e){return e.role==="assistant"&&e.status!=="streaming"&&No(e)}function cl(e){return e.canceled===!0&&ct(e)}function Ou(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:B(e.text),doneSig:B(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:B(e.inputPartial),inputSig:B(e.input),outputSig:B(e.output),errorSig:B(e.error),stateSig:B(e.state),approvalSig:B(e.approval)}:e}function Nu(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 dl=K.scope("reducer"),Do=class{constructor(t){J(this,"messagesSig",t);J(this,"active",null);J(this,"openTextParts",new Map);J(this,"partSeq",0)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}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:B(""),doneSig:B(!1)};return this.openTextParts.set(a,l),Rn(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":t.messageId&&(n.serverMessageId=t.messageId);return;case"finish-step":this.openTextParts.clear();return;case"start-step":Rn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":dl.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":dl.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":Du(n,t);return;case"file":Rn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":_l(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":_l(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=Lo(t.data);return;case"data-control-state":n.pausedTurn=!0;return;case"data-message":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function Rt(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:B(""),inputSig:B(void 0),outputSig:B(void 0),errorSig:B(void 0),stateSig:B("input-streaming"),approvalSig:B(void 0)};return Rn(e,a),a}function Rn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function _l(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||Rn(e,t)}function Du(e,t){switch(t.type){case"tool-input-start":Rt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=Rt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Rt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=Rt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=Rt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Rt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Rt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}var ul=K.scope("feedback:audio"),$o=class{constructor(){J(this,"ctx",null);J(this,"master",null);J(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){ul.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(),p=a+s*i;d.gain.setValueAtTime(1e-4,p),d.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),d.gain.exponentialRampToValueAtTime(1e-4,p+i),c.connect(d).connect(o),c.start(p),c.stop(p+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=>(ul.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var pl={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},ml={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,Fo=0;function $u(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function Fu(){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 fl(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if($u())try{navigator.vibrate(e);return}catch{}if(bt||(bt=Fu()),!!bt)try{bt.label.click()}catch{}}}function gl(){Fo++;let e=!1;return()=>{e||(e=!0,Fo=Math.max(0,Fo-1),Fo===0&&bt&&(bt.input.remove(),bt.label.remove(),bt=null))}}var Hu=K.scope("feedback"),Bu=100,Ho=class{constructor(t,n){J(this,"mutedSig",B(!1));J(this,"audio",new $o);J(this,"releaseHaptics");J(this,"sound");J(this,"haptics");J(this,"lastPlayed",new Map);J(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=gl(),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<Bu}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>Hu.warn("audio play failed",{err:a,url:n}));return}let o=ml[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?pl[t]:n;fl(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 At(e,t){return e instanceof Ke&&e.status===429?t.errorRateLimited:t.errorGeneric}var zu=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:--zu,__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 te.vnode&&te.vnode(d),d}var F={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},An=`${P.cssPrefix}-icon-dir`,ga=()=>r("svg",{...F,"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"})}),et=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),hl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),vl=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),bl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),yl=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),en=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),Pl=()=>r("svg",{...F,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),xl=()=>r("svg",{...F,"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"})}),Sl=()=>r("svg",{...F,"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"})]}),kl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),wl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Cl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),Tl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),El=()=>r("svg",{...F,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),Rl=()=>r("svg",{...F,"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"})]}),Al=()=>r("svg",{...F,"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"})}),Il=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Ll=()=>r("svg",{...F,"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"})]}),Ml=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),It=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),Ol=()=>r("svg",{...F,"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"})]}),Nl=()=>r("svg",{...F,"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",{...F,class:An,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Dl=()=>r("svg",{...F,"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"})]}),Lt=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),$l=()=>r("svg",{...F,"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"})]}),Uu=()=>r("svg",{...F,"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"})]}),ha=()=>r("svg",{...F,"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"})}),Ln=()=>r("svg",{...F,"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"})]}),qu=()=>r("svg",{...F,"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"})]}),Wu=()=>r("svg",{...F,"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"})]}),va=()=>r("svg",{...F,"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"})]}),Vu=()=>r("svg",{...F,"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"})]}),ba=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),Fl=()=>r("svg",{...F,"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"})]}),Hl=()=>r("svg",{...F,"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"})]}),Bl=()=>r("svg",{...F,"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",{...F,"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"})]}),zl=()=>r("svg",{...F,"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"})]}),Ul=()=>r("svg",{...F,"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"})}),ql=()=>r("svg",{...F,"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"})]}),Gu=()=>r("svg",{...F,"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"})]}),Ku=()=>r("svg",{...F,"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"})]}),ju=()=>r("svg",{...F,"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"})]}),Xu=()=>r("svg",{...F,"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"})]}),Wl=()=>r("svg",{...F,"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"})]}),Vl=()=>r("svg",{...F,"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"})]}),Gl=()=>r("svg",{...F,"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"})]}),Kl=()=>r("svg",{...F,"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"})]}),jl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Bo=()=>r("svg",{...F,"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"})]}),zo=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),Xl={chat:ga,message:ha,bubbles:Mn,spark:Uu,wand:qu,bot:Wu,help:Ln,lifebuoy:Vu,headset:va,search:Gu,sparkles:Ku,concierge:ju,wave:Xu};var I=P.cssPrefix,k={launcher:`${I}-launcher`,callout:`${I}-callout`,calloutDismiss:`${I}-callout-dismiss`,panel:`${I}-panel`,panelHeader:`${I}-panel-header`,resizeGrip:`${I}-resize-grip`,scrollToBottom:`${I}-scroll-to-bottom`,actionHistory:`${I}-action-history`,actionClose:`${I}-action-close`,langSegment:`${I}-lang-segment`,composer:`${I}-composer`,composerInput:`${I}-composer-input`,composerSend:`${I}-composer-send`,composerStop:`${I}-composer-stop`,composerAttach:`${I}-composer-attach`,composerFileInput:`${I}-composer-file-input`,composerVoice:`${I}-composer-voice`,attachmentChip:`${I}-attachment-chip`,attachmentRemove:`${I}-attachment-remove`,suggestion:`${I}-suggestion`,messageBubble:`${I}-message`,messageRetry:`${I}-message-retry`,messageFeedback:`${I}-message-feedback`,feedbackUp:`${I}-feedback-up`,feedbackDown:`${I}-feedback-down`,messageCopy:`${I}-message-copy`,historyPane:`${I}-history-pane`,historyBack:`${I}-history-back`,historyItem:`${I}-history-item`,sidebar:`${I}-sidebar`,sidebarToggle:`${I}-sidebar-toggle`,sidebarNewConversation:`${I}-sidebar-new-conversation`,sidebarItem:`${I}-sidebar-item`,messengerHome:`${I}-messenger-home`,modulesEmpty:`${I}-modules-empty`,tab:`${I}-tab`,tabBadge:`${I}-tab-badge`,homeView:`${I}-home-view`,homeGreeting:`${I}-home-greeting`,homeBrand:`${I}-home-brand`,backHeader:`${I}-back-header`,contentView:`${I}-content-view`,contentScroll:`${I}-content-scroll`,homeSearch:`${I}-home-search`,helpSearch:`${I}-help-search`,homeRecent:`${I}-home-recent`,homeContentRow:`${I}-home-content-row`,helpArticle:`${I}-help-article`,newsItem:`${I}-news-item`,formGate:`${I}-form-gate`,formDone:`${I}-form-done`,formDoneToggle:`${I}-form-done-toggle`,formAnswers:`${I}-form-answers`,formFill:`${I}-form-fill`,formSubmit:`${I}-form-submit`,formSkip:`${I}-form-skip`,formField:`${I}-form-field`,toolAskQuestions:`${I}-tool-ask-questions`,toolInputSubmit:`${I}-tool-input-submit`,toolInputSkip:`${I}-tool-input-skip`,toolApproval:`${I}-tool-approval`,toolApprove:`${I}-tool-approve`,toolReject:`${I}-tool-reject`,toolEdit:`${I}-tool-edit`,toolDecision:`${I}-tool-decision`,toolAskSummary:`${I}-ask-questions-summary`,toolAskOptions:`${I}-ask-questions-options-toggle`,toolCall:`${I}-tool-call`,source:`${I}-source`,operatorRequest:`${I}-operator-request`,operatorBanner:`${I}-operator-banner`};function we(e,t){return`${e}-${t}`}var Uo=P.cssPrefix;function Yl({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${Uo}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":k.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Yu(t.icon),i?r("span",{class:`${Uo}-fab-label`,children:Ne(n,t.label??"")}):null]})}function Yu(e){let t=Xl[e];return t?r(t,{}):r(Ju,{source:e})}function Ju({source:e}){return r("span",{ref:t=>{t&&Qu(t,e)},"aria-hidden":"true"})}function Qu(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 Jl({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=R(!1);return T(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),T(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${Uo}-callout`,role:"status","data-shape":e.shape,"data-position":Zu(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":k.callout,children:[r("span",{children:Ne(n,e.text)}),r("button",{type:"button",class:`${Uo}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":k.calloutDismiss,children:r(et,{})})]}):null}function Zu(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function qo({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=P.cssPrefix,s=N(null);if(T(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${l}-widget-w`,`${o.width}px`),m.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"),p=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,h=m=>{if(!e)return;let x=m.currentTarget,v=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:d?-1:1,dirY:c?1:-1},x.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},u=m=>{let x=s.current;if(!x||m.pointerId!==x.pointerId||!e)return;let v=(m.clientX-x.startX)*x.dirX,b=(m.clientY-x.startY)*x.dirY;e.style.setProperty(`--${l}-widget-w`,`${x.startW+v}px`),e.style.setProperty(`--${l}-widget-h`,`${x.startH+b}px`)},f=m=>{let x=s.current;if(!x||m.pointerId!==x.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();a({width:Math.round(v.width),height:Math.round(v.height)}),s.current=null};return r("div",{class:p,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:h,onPointerMove:u,onPointerUp:f,onPointerCancel:f,"data-testid":k.resizeGrip,children:r(El,{})})}var Mt=P.cssPrefix,ep=`.${Mt}-header, .${Mt}-back-header, .${Mt}-home-hero`,tp='button, a, input, textarea, select, [role="tab"], [contenteditable]',Ql=56;function Wo(e,t){T(()=>{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(ep)||d.closest(tp))return;let p=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Mt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Mt}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-Ql,maxY:(window.innerHeight+p.height)/2-Ql},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),p=o(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${Mt}-modal-dx`,`${d}px`),e.style.setProperty(`--${Mt}-modal-dy`,`${p}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 On(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 Vo(e,t,n){return On("close",e,t)?n.includes("close"):!1}function Zl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var np='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Go(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(np)].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 ya=P.cssPrefix;function ec({agent:e,strings:t}){let n=e.status??"online",o=Ne(t,e.name),a=e.title?Ne(t,e.title):null;return r("div",{class:`${ya}-agent`,children:[r("div",{class:`${ya}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Ko(o)})}),r("div",{class:`${ya}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var tc=K.scope("attachments");function jo(e,t,n){let o=rp(e),a=[],i=[],l=sp(n.accept),s=t.reduce((d,p)=>d+p.size,0),c=t.length;for(let d of o){let p=op(d,c,s,n,l);if(p){i.push({file:d,reason:p});continue}a.push(ip(d)),s+=d.size,c+=1}return(a.length||i.length)&&tc.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function Pa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){tc.debug("revokeObjectURL failed",{error:t})}}function op(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":lp(e,a)?null:"mime"}function rp(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:ap(t)).filter(t=>t!==null):[]}function ap(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function ip(e){return{file:e,id:Ge(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function sp(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 lp(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 Nn=P.cssPrefix;function nc({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${Nn}-attachment-chip`,title:e.name,"data-testid":we(k.attachmentChip,e.id),children:[n?r("img",{class:`${Nn}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${Nn}-attachment-thumb`,"aria-hidden":"true",children:r($l,{})}),r("span",{class:`${Nn}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${Nn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":we(k.attachmentRemove,e.id),children:r(et,{})})]})}var xa={isSupported:!1,start:()=>{},stop:()=>{}};function Sa(e,t,n){return e==="disabled"?xa:e==="server"?up(n):cp(t)}function cp(e){let t=dp();if(!t)return xa;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 p=s.resultIndex;p<s.results.length;p++){let h=s.results[p];h&&(c+=h[0].transcript,h.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 dp(){return window.SpeechRecognition??window.webkitSpeechRecognition}var _p=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function up(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return xa;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=pp();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:p}=await e(d,c);p&&i(p,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function pp(){for(let e of _p)if(MediaRecorder.isTypeSupported(e))return e}var qe=P.cssPrefix,Ot=K.scope("composer");function tn(e){return e.reduce((t,n)=>t+n.size,0)}var mp={arrowUp:bl,paperPlane:vl,send:yl,chevron:en};function oc({options:e,transport:t,feedback:n,bus:o,isStreaming:a,operatorRequestEnabled:i,controlMode:l,onRequestOperator:s,onSend:c,onStop:d,attachApiRef:p}){let h=e.strings,[u,f]=R(""),[m,x]=R([]),[v,b]=R(!1),w=N(null),y=N(null),E=e.features.fileUpload,H=e.features.voice,[Q,ie]=R(()=>Sa(H,e.locale,(L,z)=>t.transcribe(L,z)));T(()=>{v||H==="disabled"||ie(Sa(H,e.locale,(L,z)=>t.transcribe(L,z)))},[e.locale,H,t,v]),T(()=>{let L=w.current;if(!L)return;let z=L.getRootNode(),V="activeElement"in z?z.activeElement:null;V&&L.closest(`.${qe}-panel`)?.contains(V)||L.focus({preventScroll:!0})},[]),T(()=>{let L=w.current;if(!L)return;if(u.length===0){L.style.height="";return}L.style.height="auto";let z=parseFloat(getComputedStyle(L).fontSize)*.7,V=Math.min(L.scrollHeight,160);L.style.height=`${V<40+z?40:V}px`},[u]);let ne=N(m);ne.current=m,T(()=>()=>ne.current.forEach(Pa),[]),T(()=>{if(p)return p.current={attachFromDrop:L=>{let z=jo(L,ne.current,e.attachments);z.accepted.length!==0&&(Ot.info("attach (drop)",{count:z.accepted.length,totalBytes:tn(z.accepted)}),o.emit("attach",{count:z.accepted.length,totalBytes:tn(z.accepted)}),x(V=>[...V,...z.accepted]))},fill:L=>{f(L);let z=w.current;z&&(z.focus({preventScroll:!0}),requestAnimationFrame(()=>z.setSelectionRange(z.value.length,z.value.length)))}},()=>{p.current&&(p.current=null)}},[p,e.attachments]),T(()=>{let L=w.current;if(!L)return;let z=L.closest(`.${qe}-panel`);if(!z)return;let V=Se=>{let rt=Se.clipboardData;if(!rt)return;let $e=Se.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if($e&&$e!==L)return;if(E){let ye=jo(rt.items,ne.current,e.attachments);if(ye.accepted.length>0){Se.preventDefault(),Ot.info("attach (paste)",{count:ye.accepted.length,totalBytes:tn(ye.accepted)}),o.emit("attach",{count:ye.accepted.length,totalBytes:tn(ye.accepted)}),x(fe=>[...fe,...ye.accepted]);return}}if($e===L)return;let be=rt.getData("text/plain");be&&(Se.preventDefault(),f(ye=>ye+be),L.focus())};return z.addEventListener("paste",V),()=>z.removeEventListener("paste",V)},[E,e.attachments,qe]);let ee=()=>{let L=u.trim();!L&&m.length===0||a||(c(L,m),f(""),x([]))},O=L=>{L.key!=="Enter"||L.shiftKey||L.isComposing||(L.preventDefault(),a?d():ee())},D=L=>{let z=L.target,V=jo(z.files,m,e.attachments);V.accepted.length>0&&(Ot.info("attach (file picker)",{count:V.accepted.length,totalBytes:tn(V.accepted)}),o.emit("attach",{count:V.accepted.length,totalBytes:tn(V.accepted)}),x(Se=>[...Se,...V.accepted])),z.value=""},X=L=>{Ot.info("removeAttachment",{id:L}),o.emit("removeAttachment",{id:L}),x(z=>{let V=z.find(Se=>Se.id===L);return V&&Pa(V),z.filter(Se=>Se.id!==L)})},Y=N(null),se=()=>{if(Q.isSupported){if(v){let L=Y.current?Date.now()-Y.current:0;Ot.info("voiceStop",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),Q.stop(),b(!1),n.play("voiceStop"),Y.current=null;return}Y.current=Date.now(),Ot.info("voiceStart"),o.emit("voiceStart",void 0),b(!0),n.play("voiceStart"),Q.start((L,z)=>f(V=>z?`${V}${L} `:V),()=>{if(b(!1),Y.current){let L=Date.now()-Y.current;Ot.debug("voiceStop (auto)",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),Y.current=null}})}},le=mp[e.composer.sendButton.icon];return r("div",{class:`${qe}-composer`,"data-testid":k.composer,children:[m.length>0?r("div",{class:`${qe}-attachments`,children:m.map(L=>r(nc,{attachment:L,onRemove:()=>X(L.id)},L.id))}):null,r("div",{class:`${qe}-composer-row`,children:[r("div",{class:`${qe}-composer-actions`,children:[E?r("button",{type:"button",class:`${qe}-icon-btn`,onClick:()=>y.current?.click(),"aria-label":h.attach,"data-testid":k.composerAttach,children:r(xl,{})}):null,Q.isSupported?r("button",{type:"button",class:`${qe}-icon-btn`,onClick:se,"aria-label":v?h.micStop:h.micStart,"aria-pressed":v,"data-recording":v?"true":void 0,"data-testid":k.composerVoice,children:r(Sl,{})}):null,i&&l==="ai-agent"&&s?r("button",{type:"button",class:`${qe}-icon-btn`,onClick:s,"aria-label":h.talkToOperator,title:h.talkToOperator,"data-testid":k.operatorRequest,children:r(va,{})}):null]}),r("textarea",{ref:w,class:`${qe}-textarea`,rows:1,value:u,placeholder:h.composerPlaceholder,onInput:L=>f(L.target.value),onKeyDown:O,"aria-label":h.composerPlaceholder,"data-testid":k.composerInput}),a?r("button",{type:"button",class:`${qe}-send`,onClick:d,"aria-label":h.stop,"data-testid":k.composerStop,children:r(Pl,{})}):r("button",{type:"button",class:`${qe}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:ee,disabled:!u.trim()&&m.length===0,"aria-label":h.send,"data-testid":k.composerSend,children:r(le,{})})]}),r("input",{ref:y,type:"file",multiple:!0,accept:e.attachments.accept,onChange:D,class:`${qe}-sr-only`,"data-testid":k.composerFileInput})]})}var fp=P.cssPrefix;function rc({visible:e,strings:t}){return e?r("div",{class:`${fp}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Xo({containerRef:e,onDrop:t}){let[n,o]=R(!1);return T(()=>{let a=e.current;if(!a)return;let i=0,l=p=>{i+=1,p.dataTransfer?.types.includes("Files")&&(p.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=p=>{p.dataTransfer?.types.includes("Files")&&p.preventDefault()},d=p=>{i=0,o(!1),p.dataTransfer&&(p.preventDefault(),t(p.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 ac({itemCount:e,initialFocusIndex:t}){let[n,o]=R(!1),a=N(null),i=N(null),[l,s]=R(-1),c=$(()=>{o(!1),s(-1),a.current?.focus()},[]),d=$(()=>o(u=>!u),[]);T(()=>{if(!n)return;let u=f=>{let m=i.current,x=a.current;if(!m||!x)return;let v=f.composedPath();v.includes(m)||v.includes(x)||(o(!1),s(-1))};return document.addEventListener("click",u,!0),()=>document.removeEventListener("click",u,!0)},[n]),T(()=>{if(!n||e===0)return;let u=t?.()??0,f=u<0||u>=e?0:u;s(f)},[n,e,t]),T(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let p=$(u=>{(u.key==="ArrowDown"||u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o(!0))},[]),h=$(u=>{if(e!==0)switch(u.key){case"Escape":u.preventDefault(),c();return;case"ArrowDown":u.preventDefault(),s(f=>(f+1)%e);return;case"ArrowUp":u.preventDefault(),s(f=>(f-1+e)%e);return;case"Home":u.preventDefault(),s(0);return;case"End":u.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:p,onMenuKey:h}}function ic({items:e,triggerLabel:t}){let n=P.cssPrefix,o=ac({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 p=Math.max(0,d.findIndex(u=>u.value===c.value)),h=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")h=(p+1)%d.length;else if(s.key==="ArrowLeft")h=(p-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[h].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(Rl,{})}),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":`${k.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(It,{})}):null]},s.id))}):null]})}var ka=P.cssPrefix;function gp(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 hp={normal:"large",large:"small",small:"normal"};function vp(e){return e==="light"?r(zl,{}):e==="dark"?r(Ul,{}):r(ql,{})}function bp(e){return(e.split("-")[0]??e).toUpperCase()}function tt({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:p,onLocaleChange:h,onThemeChange:u,onTextSizeChange:f}=e,m=n.strings,x=n.mode,v=t==="chat",b=Z(()=>a.mutedSig.value).value,w=new Set(n.actions),y=Y=>w.has(Y),E=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,H=Y=>E?!1:On(Y,x,o),Q=n.themeMode,ie={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},ne=n.textSize,ee={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},O=[];if(v&&y("clear")&&O.push({id:"clear",icon:r(Dl,{}),label:m.newConversation,onSelect:l}),y("expand")&&H("expand")){let Y=o==="expanded";O.push({id:"expand",icon:Y?r(wl,{}):r(kl,{}),label:Y?m.collapse:m.expand,type:"switch",on:Y,onSelect:s})}if(y("fullscreen")&&H("fullscreen")){let Y=o==="fullscreen";O.push({id:"fullscreen",icon:Y?r(Tl,{}):r(Cl,{}),label:Y?m.exitFullscreen:m.fullscreen,type:"switch",on:Y,onSelect:c})}v&&y("sound")&&O.push({id:"sound",icon:b?r(Il,{}):r(Al,{}),label:b?m.soundOff:m.soundOn,type:"switch",on:!b,onSelect:d}),y("theme")&&O.push({id:"theme",icon:vp(Q),label:`${m.theme}: ${ie[Q]}`,onSelect:()=>u(gp(Q)),keepOpen:!0}),y("textSize")&&O.push({id:"textSize",icon:r(Ll,{}),label:`${m.textSize}: ${ee[ne]}`,onSelect:()=>f(hp[ne]),keepOpen:!0}),y("language")&&n.availableLocales.length>1&&O.push({id:"language",icon:r(Nl,{}),label:m.language,segments:n.availableLocales.map(Y=>({value:Y,label:bp(Y),lang:Y})),value:n.locale,onSelectValue:h});let D=!!i&&Vo(x,o,n.actions),X=v&&y("history");return r("div",{class:`${ka}-header-actions`,children:[X?r("button",{type:"button",class:`${ka}-icon-btn`,onClick:p,"aria-label":m.history,title:m.history,"data-testid":k.actionHistory,children:r(Ol,{})}):null,O.length>0?r(ic,{items:O,triggerLabel:m.moreActions}):null,D?r("button",{type:"button",class:`${ka}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":k.actionClose,children:r(et,{})}):null]})}var yp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Pp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,xp=/^[+]?[\d\s().-]{6,}$/;function nn(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function Sp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function kp(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=Sp(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?nn(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?nn(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(!yp.test(i))return n.formInvalidEmail;break;case"url":if(!Pp.test(i))return n.formInvalidUrl;break;case"tel":if(!xp.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 nn(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return nn(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return nn(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return nn(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function sc(e,t,n){let o={};for(let a of e){let i=kp(a,t[a.name],n);i&&(o[a.name]=i)}return o}function lc(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,Yo="__other__";function Dn({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:p,fieldTypeLabels:h,rootTestId:u,submitTestId:f,skipTestId:m}){let[x,v]=R(()=>({...Ep(e),...d})),[b,w]=R({}),[y,E]=R({}),H=O=>{y[O]&&E(D=>({...D,[O]:""}))},Q=(O,D)=>{v(X=>({...X,[O]:D})),H(O)},ie=(O,D)=>{w(X=>({...X,[O]:D})),H(O)},ne=O=>{if(O.preventDefault(),c)return;let D=Rp(e,x,b),X=sc(e,D,t);if(Object.keys(X).length>0){E(X);return}o(lc(D))},ee=O=>{!s||O.key!=="Enter"||O.shiftKey||O.isComposing||O.target?.tagName==="TEXTAREA"&&ne(O)};return r("form",{class:`${de}-form`,onSubmit:ne,onKeyDown:ee,"data-testid":u,noValidate:!0,children:[e.map(O=>r(wp,{field:O,value:x[O.name],otherText:b[O.name]??"",error:y[O.name],disabled:c,typeLabel:h?.[O.name],strings:t,onChange:D=>Q(O.name,D),onOtherChange:D=>ie(O.name,D)},O.name)),p?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":m,children:a}):null,r("button",{type:"submit",class:`${de}-form-submit`,disabled:c,"data-testid":f,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(k.formField,e.name),p=Cp({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]}),p,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 Cp(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:p=>l(p.target.value),"data-testid":c});case"select":return r("select",{class:`${de}-field-input`,value:d,disabled:a,onChange:p=>l(p.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(p=>r("option",{value:p.value,children:p.label??p.value},p.value))]});case"radio":{let p=t.allowOther&&d===Yo;return r("div",{class:`${de}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(h=>r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===h.value,disabled:a,onChange:()=>l(h.value)}),r("span",{children:h.label??h.value})]},h.value)),t.allowOther?r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===Yo,disabled:a,onChange:()=>l(Yo)}),r("span",{children:i.formOther})]}):null,p?r("input",{class:`${de}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:h=>s(h.target.value)}):null]})}case"checkbox":return r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:p=>l(p.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let p=Array.isArray(n)?n:[],h=(u,f)=>l(f?[...p,u]:p.filter(m=>m!==u));return r("div",{class:`${de}-field-choices`,"data-testid":c,children:[(t.options??[]).map(u=>r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:p.includes(u.value),disabled:a,onChange:f=>h(u.value,f.target.checked)}),r("span",{children:u.label??u.value})]},u.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:u=>s(u.target.value)}):null]})}default:return r("input",{class:`${de}-field-input`,type:Tp(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:p=>l(p.target.value),"data-testid":c})}}function Tp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function Ep(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 Rp(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]===Yo)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 nt=P.cssPrefix;function wa({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${nt}-form-gate`,"data-testid":k.formGate,children:[e.title?r("h3",{class:`${nt}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${nt}-form-gate-desc`,children:e.description}):null,r(Dn,{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:k.formSubmit,skipTestId:k.formSkip})]})}function cc({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(ae,{children:[r("span",{children:e.title}),r("span",{class:`${nt}-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(p=>p.name===d)?.label??d;return r("details",{class:`${nt}-form-done`,"data-outcome":e.outcome,"data-testid":k.formDone,children:[r("summary",{class:`${nt}-form-done-summary`,"data-testid":k.formDoneToggle,children:[r(It,{}),i,r(en,{})]}),r("dl",{class:`${nt}-form-answers`,"data-testid":k.formAnswers,children:Object.entries(s).map(([d,p])=>r("div",{class:`${nt}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:p})]},d))})]})}return r("div",{class:`${nt}-form-done`,"data-outcome":e.outcome,"data-testid":k.formDone,role:"status",children:[o?r(Ml,{}):r(It,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${nt}-form-done-fill`,"data-testid":k.formFill,onClick:n,children:t.formFillOut}):null]})}function dc(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var Ea=1,uc=2,pc=4,mc=8,fc=16;function Ap(e){switch(e){case Ea:return"href";case uc:return"src";case pc:return"class";case mc:return"checked";case fc:return"start"}}var Ip=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}},Lp=Ip;var _c=24;function Aa(e){let t=new Uint32Array(_c);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(_c),indent:"",indent_len:0,table_state:0}}function gc(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 re(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 Mp(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 Ca(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),re(e,t),!0):(Nt(e,n),!1):(Nt(e,o),re(e,t),!0)}function Ta(e,t){re(e,25),e.spaces[e.len]=e.indent_len+t,dt(e),e.token=103}function dt(e){e.indent="",e.indent_len=0,e.pending=""}function Ra(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 Op(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 Np(e){return Ra(e)||Op(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),dt(e),e.pending=n;continue}Nt(e,e.blockquote_idx),dt(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,Lp(e.pending.length)),dt(e);continue}break;case">":{let i=Mp(e,20,e.blockquote_idx+1);i===-1?(Nt(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,re(e,20)):e.blockquote_idx=i,dt(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),dt(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Ca(e,23),Ta(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):(re(e,2),dt(e),e.fence_start=0,Ie(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,pc,e.pending.slice(e.fence_start)),dt(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;Ca(e,23),Ta(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;Ca(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,fc,e.pending.slice(0,-1)),Ta(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||Ra(i)){e.pending=o;continue}}break;case"|":Nt(e,e.blockquote_idx),re(e,27),re(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,re(e,9)}else re(e,2);dt(e),Ie(e,a);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;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 Ys.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Ys.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function bu(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 Js=e=>e&&Object.keys(e).length>0?e:void 0;function Qs(e,t){let n=Js(e),o=Js(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),bu(JSON.stringify(a))}function Lo(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function yu(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Zs(e){return e.startsWith("tool-")?e.slice(5):e}var ze={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",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},el="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 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 tl(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:Su(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(xu).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function Pu(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function xu(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function Su(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"&&Pu(n)){let o={type:yu(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 J=K.scope("transport"),nl=3,al=400,ku=250,wu=5e3,Cu=6e4,Tu=1e4,ol=3,Eu=new Set([408,425,429,500,502,503,504]);function rl(e){return al*2**e+Math.floor(Math.random()*250)}function Ru(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}function Oo(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 No=class{constructor(t){X(this,"ttlMs",t);X(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()}},Do=class{constructor(t){X(this,"opts",t);X(this,"visitorId");X(this,"conversationId");X(this,"resumeStatus");X(this,"userContext");X(this,"pageContext");X(this,"locale");X(this,"conversationsCache",new No(Tu));X(this,"contentCache",new No(Cu))}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=Qs(this.userContext,this.pageContext);return n&&(t[el]=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){J.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(ze.handshake,t,"handshake");return J.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),Iu(n)||J.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){J.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 J.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){J.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${Au(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return J.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(ze.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),J.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 J.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a,nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url(ze.listMessages));n.searchParams.set("conversationId",t),J.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return J.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(),J.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(ze.markRead,{conversationId:t},"markRead")}catch(n){J.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){J.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(ze.requestOperator,{},"requestOperator")).controlState}catch(t){J.debug("requestOperator 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(ze.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));J.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>Ti(i,this.locale));return J.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(ze.bootstrap));t&&n.searchParams.set("conversationId",t),J.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return J.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){J.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(ze.updateSettings,{userPrefs:t},"saveUserPrefs");return J.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??ze.submitForm}async submitForm(t){J.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){J.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){J.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(ze.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){J.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),J.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()}}resumeStream(){let t=new AbortController,n=new Set;this.resumeStatus=void 0;let o=this.resumeStreamGen(t,n,!0),a=()=>t.abort();return{iter:o,cancel:a,detach:a}}resumeChannel(){let t=new AbortController;return{iter:this.resumeChannelGen(t),stop:()=>t.abort()}}async*resumeChannelGen(t){for(let n=1;!t.signal.aborted;n++){if(n>1&&(await Oo(Math.min(ku*(n-1),wu),t.signal),t.signal.aborted))return;let o;try{o=await this.fetchImpl(this.resumeUrl(0),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(a){if(t.signal.aborted)return;J.debug("resume-channel fetch failed \u2014 reconnecting",{attempt:n,err:a});continue}if(!o.ok||!o.body){J.debug("resume-channel \u2192 endpoint unavailable",{status:o.status});return}if(!(o.headers.get("content-type")??"").includes("text/event-stream")){let a=await o.json().then(i=>i.status).catch(()=>{});if(a==="pending"){J.debug("resume-channel \u2192 pending (still registering); reconnecting",{attempt:n});continue}J.debug("resume-channel \u2192 no live operator-control stream (status); stopping",{status:a});return}try{for await(let a of Io(o,t.signal)){if(t.signal.aborted)return;n=1,yield a}}catch(a){if(t.signal.aborted)return;J.debug("resume-channel segment dropped \u2014 reconnecting",{err:a})}}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let a=1;a<=nl&&!t.signal.aborted;a++){if((!o||a>1)&&(await Oo(al*a,t.signal),t.signal.aborted))return;let i;try{i=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(c){if(t.signal.aborted)return;J.debug("resume fetch failed \u2014 retrying",{attempt:a,err:c});continue}if(i.status===204||!i.ok){J.debug("resume \u2192 no in-flight stream",{status:i.status});return}if(!(i.headers.get("content-type")??"").includes("text/event-stream")){let c=await i.json().then(d=>d.status).catch(()=>{});if(J.debug("resume \u2192 no live stream (status response)",{status:c,attempt:a}),c==="pending"&&a<nl)continue;this.resumeStatus=c==="needs-generation"?"needs-generation":"completed";return}this.resumeStatus="live";let s=n.size;if(yield*this.drain(Io(i,t.signal),n,t))return;if(n.size===s){J.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new Ke("stream incomplete after resume attempts","server")}async*drain(t,n,o){let a=!1;try{for await(let i of t){if(o.signal.aborted)return!0;if(i.eventId){if(n.has(i.eventId))continue;n.add(i.eventId)}yield i,(i.chunk.type==="finish"||i.chunk.type==="error")&&(a=!0)}}catch(i){if(o.signal.aborted)return!0;if(i instanceof Ke&&i.status!==void 0)throw i;J.debug("stream segment dropped",{err:i})}return a}cancelStream(t,n){t.signal.aborted||(J.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(ze.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>J.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(ze.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*Io(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(ze.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}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>=ol)throw new Ke(`${n} failed: network error`,"network",void 0,c);J.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Oo(rl(o));continue}if(l.ok||!Eu.has(l.status)||o>=ol)return l;let s=Ru(l.headers)??rl(o);J.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await Oo(s)}}async assertOk(t,n){if(!t.ok)throw new Ke(`${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 Au(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 Iu(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function il(e,t){let n=e?[{kind:"text",id:"t0",textSig:B(e),doneSig:B(!0)}]:[];return{id:Ge(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:B(n)}}function Rn(){return{id:Ge(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:B([])}}function sl(e){let t=Ge();return Lu({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function Lu(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:B(e.parts.map(Du))}}function fa(e){let t=e.parts.map((o,a)=>o.type==="text"?{kind:"text",id:`${e.id}-t${a}`,textSig:B(o.text),doneSig:B(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${a}`,textSig:B(o.text),doneSig:B(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:Zs(o.type),inputPartialSig:B(""),inputSig:B(o.input),outputSig:B(o.output),errorSig:B(o.errorText),stateSig:B(o.state),approvalSig:B(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:Lo(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:B(t)}}function ll(e,t){let n=e.findIndex(o=>o.id===t.id);return n>=0?{list:e.map((o,a)=>a===n?t:o),appended:!1}:{list:[...e,t],appended:!0}}var Mu=new Set(["completed","failed","canceled"]);function Ou(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 Nu(e){return e.role==="assistant"&&e.status!=null&&!Mu.has(e.status)&&Ou(e)}function ga(e){return e.filter(t=>!Nu(t)).map(fa)}function cl(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($u)}}function Rt(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function $o(e){return Rt(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function ct(e){return e.role==="assistant"&&e.status!=="streaming"&&$o(e)}function dl(e){return e.canceled===!0&&ct(e)}function ha(e,t){return e.pausedTurn?ct(e)?"drop":"complete-paused":t||ct(e)?"error":"complete"}function Du(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:B(e.text),doneSig:B(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:B(e.inputPartial),inputSig:B(e.input),outputSig:B(e.output),errorSig:B(e.error),stateSig:B(e.state),approvalSig:B(e.approval)}:e}function $u(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 _l=K.scope("reducer"),Fo=class{constructor(t){X(this,"messagesSig",t);X(this,"active",null);X(this,"openTextParts",new Map);X(this,"partSeq",0)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}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:B(""),doneSig:B(!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);return;case"finish-step":this.openTextParts.clear();return;case"start-step":An(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":_l.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":_l.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":Fu(n,t);return;case"file":An(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":ul(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":ul(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.pausedTurn=!0;return;case"data-message":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function At(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:B(""),inputSig:B(void 0),outputSig:B(void 0),errorSig:B(void 0),stateSig:B("input-streaming"),approvalSig:B(void 0)};return An(e,a),a}function An(e,t){e.partsSig.value=[...e.partsSig.value,t]}function ul(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||An(e,t)}function Fu(e,t){switch(t.type){case"tool-input-start":At(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=At(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=At(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=At(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=At(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=At(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=At(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}var pl=K.scope("feedback:audio"),Ho=class{constructor(){X(this,"ctx",null);X(this,"master",null);X(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){pl.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(),p=a+s*i;d.gain.setValueAtTime(1e-4,p),d.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),d.gain.exponentialRampToValueAtTime(1e-4,p+i),c.connect(d).connect(o),c.start(p),c.stop(p+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=>(pl.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var ml={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},fl={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,Bo=0;function Hu(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function Bu(){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 gl(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(Hu())try{navigator.vibrate(e);return}catch{}if(bt||(bt=Bu()),!!bt)try{bt.label.click()}catch{}}}function hl(){Bo++;let e=!1;return()=>{e||(e=!0,Bo=Math.max(0,Bo-1),Bo===0&&bt&&(bt.input.remove(),bt.label.remove(),bt=null))}}var zu=K.scope("feedback"),Uu=100,zo=class{constructor(t,n){X(this,"mutedSig",B(!1));X(this,"audio",new Ho);X(this,"releaseHaptics");X(this,"sound");X(this,"haptics");X(this,"lastPlayed",new Map);X(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=hl(),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<Uu}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>zu.warn("audio play failed",{err:a,url:n}));return}let o=fl[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?ml[t]:n;gl(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 It(e,t){return e instanceof Ke&&e.status===429?t.errorRateLimited:t.errorGeneric}var qu=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:--qu,__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 te.vnode&&te.vnode(d),d}var F={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},In=`${P.cssPrefix}-icon-dir`,va=()=>r("svg",{...F,"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"})}),et=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),vl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),bl=()=>r("svg",{...F,class:In,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),yl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Pl=()=>r("svg",{...F,class:In,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),tn=()=>r("svg",{...F,class:In,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),xl=()=>r("svg",{...F,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Sl=()=>r("svg",{...F,"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"})}),kl=()=>r("svg",{...F,"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"})]}),wl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),Cl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Tl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),El=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),Rl=()=>r("svg",{...F,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),Al=()=>r("svg",{...F,"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"})]}),Il=()=>r("svg",{...F,"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"})}),Ll=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Ml=()=>r("svg",{...F,"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"})]}),Ol=()=>r("svg",{...F,class:In,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Lt=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),Nl=()=>r("svg",{...F,"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"})]}),Dl=()=>r("svg",{...F,"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"})]}),Ln=()=>r("svg",{...F,class:In,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),$l=()=>r("svg",{...F,"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",{...F,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),Fl=()=>r("svg",{...F,"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"})]}),Wu=()=>r("svg",{...F,"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"})]}),ba=()=>r("svg",{...F,"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"})}),Mn=()=>r("svg",{...F,"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"})]}),Vu=()=>r("svg",{...F,"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"})]}),Gu=()=>r("svg",{...F,"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"})]}),ya=()=>r("svg",{...F,"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"})]}),Ku=()=>r("svg",{...F,"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",{...F,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),Hl=()=>r("svg",{...F,"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"})]}),Bl=()=>r("svg",{...F,"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"})]}),zl=()=>r("svg",{...F,"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"})]}),On=()=>r("svg",{...F,"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"})]}),Ul=()=>r("svg",{...F,"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"})]}),ql=()=>r("svg",{...F,"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"})}),Wl=()=>r("svg",{...F,"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"})]}),ju=()=>r("svg",{...F,"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"})]}),Xu=()=>r("svg",{...F,"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"})]}),Yu=()=>r("svg",{...F,"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"})]}),Ju=()=>r("svg",{...F,"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"})]}),Vl=()=>r("svg",{...F,"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"})]}),Gl=()=>r("svg",{...F,"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"})]}),Kl=()=>r("svg",{...F,"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"})]}),jl=()=>r("svg",{...F,"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"})]}),Xl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Uo=()=>r("svg",{...F,"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"})]}),qo=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),Yl={chat:va,message:ba,bubbles:On,spark:Wu,wand:Vu,bot:Gu,help:Mn,lifebuoy:Ku,headset:ya,search:ju,sparkles:Xu,concierge:Yu,wave:Ju};var I=P.cssPrefix,k={launcher:`${I}-launcher`,callout:`${I}-callout`,calloutDismiss:`${I}-callout-dismiss`,panel:`${I}-panel`,panelHeader:`${I}-panel-header`,resizeGrip:`${I}-resize-grip`,scrollToBottom:`${I}-scroll-to-bottom`,actionHistory:`${I}-action-history`,actionClose:`${I}-action-close`,langSegment:`${I}-lang-segment`,composer:`${I}-composer`,composerInput:`${I}-composer-input`,composerSend:`${I}-composer-send`,composerStop:`${I}-composer-stop`,composerAttach:`${I}-composer-attach`,composerFileInput:`${I}-composer-file-input`,composerVoice:`${I}-composer-voice`,attachmentChip:`${I}-attachment-chip`,attachmentRemove:`${I}-attachment-remove`,suggestion:`${I}-suggestion`,messageBubble:`${I}-message`,messageRetry:`${I}-message-retry`,messageFeedback:`${I}-message-feedback`,feedbackUp:`${I}-feedback-up`,feedbackDown:`${I}-feedback-down`,messageCopy:`${I}-message-copy`,historyPane:`${I}-history-pane`,historyBack:`${I}-history-back`,historyItem:`${I}-history-item`,sidebar:`${I}-sidebar`,sidebarToggle:`${I}-sidebar-toggle`,sidebarNewConversation:`${I}-sidebar-new-conversation`,sidebarItem:`${I}-sidebar-item`,messengerHome:`${I}-messenger-home`,modulesEmpty:`${I}-modules-empty`,tab:`${I}-tab`,tabBadge:`${I}-tab-badge`,homeView:`${I}-home-view`,homeGreeting:`${I}-home-greeting`,homeBrand:`${I}-home-brand`,backHeader:`${I}-back-header`,contentView:`${I}-content-view`,contentScroll:`${I}-content-scroll`,homeSearch:`${I}-home-search`,helpSearch:`${I}-help-search`,homeRecent:`${I}-home-recent`,homeContentRow:`${I}-home-content-row`,helpArticle:`${I}-help-article`,newsItem:`${I}-news-item`,formGate:`${I}-form-gate`,formDone:`${I}-form-done`,formDoneToggle:`${I}-form-done-toggle`,formAnswers:`${I}-form-answers`,formFill:`${I}-form-fill`,formSubmit:`${I}-form-submit`,formSkip:`${I}-form-skip`,formField:`${I}-form-field`,toolAskQuestions:`${I}-tool-ask-questions`,toolInputSubmit:`${I}-tool-input-submit`,toolInputSkip:`${I}-tool-input-skip`,toolApproval:`${I}-tool-approval`,toolApprove:`${I}-tool-approve`,toolReject:`${I}-tool-reject`,toolEdit:`${I}-tool-edit`,toolDecision:`${I}-tool-decision`,toolAskSummary:`${I}-ask-questions-summary`,toolAskOptions:`${I}-ask-questions-options-toggle`,toolCall:`${I}-tool-call`,source:`${I}-source`,operatorRequest:`${I}-operator-request`,operatorBanner:`${I}-operator-banner`};function we(e,t){return`${e}-${t}`}var Wo=P.cssPrefix;function Jl({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${Wo}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":k.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Qu(t.icon),i?r("span",{class:`${Wo}-fab-label`,children:Ne(n,t.label??"")}):null]})}function Qu(e){let t=Yl[e];return t?r(t,{}):r(Zu,{source:e})}function Zu({source:e}){return r("span",{ref:t=>{t&&ep(t,e)},"aria-hidden":"true"})}function ep(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 Ql({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=R(!1);return T(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),T(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${Wo}-callout`,role:"status","data-shape":e.shape,"data-position":tp(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":k.callout,children:[r("span",{children:Ne(n,e.text)}),r("button",{type:"button",class:`${Wo}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":k.calloutDismiss,children:r(et,{})})]}):null}function tp(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Vo({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=P.cssPrefix,s=N(null);if(T(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${l}-widget-w`,`${o.width}px`),m.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"),p=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,h=m=>{if(!e)return;let x=m.currentTarget,v=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:d?-1:1,dirY:c?1:-1},x.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},u=m=>{let x=s.current;if(!x||m.pointerId!==x.pointerId||!e)return;let v=(m.clientX-x.startX)*x.dirX,b=(m.clientY-x.startY)*x.dirY;e.style.setProperty(`--${l}-widget-w`,`${x.startW+v}px`),e.style.setProperty(`--${l}-widget-h`,`${x.startH+b}px`)},f=m=>{let x=s.current;if(!x||m.pointerId!==x.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();a({width:Math.round(v.width),height:Math.round(v.height)}),s.current=null};return r("div",{class:p,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:h,onPointerMove:u,onPointerUp:f,onPointerCancel:f,"data-testid":k.resizeGrip,children:r(Rl,{})})}var Ot=P.cssPrefix,np=`.${Ot}-header, .${Ot}-back-header, .${Ot}-home-hero`,op='button, a, input, textarea, select, [role="tab"], [contenteditable]',Zl=56;function Go(e,t){T(()=>{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(np)||d.closest(op))return;let p=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Ot}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Ot}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-Zl,maxY:(window.innerHeight+p.height)/2-Zl},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),p=o(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${Ot}-modal-dx`,`${d}px`),e.style.setProperty(`--${Ot}-modal-dy`,`${p}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 Nn(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 Ko(e,t,n){return Nn("close",e,t)?n.includes("close"):!1}function ec(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var rp='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function jo(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(rp)].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 Xo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var xa=P.cssPrefix;function tc({agent:e,strings:t}){let n=e.status??"online",o=Ne(t,e.name),a=e.title?Ne(t,e.title):null;return r("div",{class:`${xa}-agent`,children:[r("div",{class:`${xa}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Xo(o)})}),r("div",{class:`${xa}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var nc=K.scope("attachments");function Yo(e,t,n){let o=ip(e),a=[],i=[],l=cp(n.accept),s=t.reduce((d,p)=>d+p.size,0),c=t.length;for(let d of o){let p=ap(d,c,s,n,l);if(p){i.push({file:d,reason:p});continue}a.push(lp(d)),s+=d.size,c+=1}return(a.length||i.length)&&nc.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function Sa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){nc.debug("revokeObjectURL failed",{error:t})}}function ap(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":dp(e,a)?null:"mime"}function ip(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:sp(t)).filter(t=>t!==null):[]}function sp(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function lp(e){return{file:e,id:Ge(),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 dp(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 Dn=P.cssPrefix;function oc({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${Dn}-attachment-chip`,title:e.name,"data-testid":we(k.attachmentChip,e.id),children:[n?r("img",{class:`${Dn}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${Dn}-attachment-thumb`,"aria-hidden":"true",children:r(Fl,{})}),r("span",{class:`${Dn}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${Dn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":we(k.attachmentRemove,e.id),children:r(et,{})})]})}var ka={isSupported:!1,start:()=>{},stop:()=>{}};function wa(e,t,n){return e==="disabled"?ka:e==="server"?mp(n):_p(t)}function _p(e){let t=up();if(!t)return ka;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 p=s.resultIndex;p<s.results.length;p++){let h=s.results[p];h&&(c+=h[0].transcript,h.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 up(){return window.SpeechRecognition??window.webkitSpeechRecognition}var pp=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function mp(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ka;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=fp();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:p}=await e(d,c);p&&i(p,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function fp(){for(let e of pp)if(MediaRecorder.isTypeSupported(e))return e}var Ue=P.cssPrefix,Nt=K.scope("composer");function nn(e){return e.reduce((t,n)=>t+n.size,0)}var gp={arrowUp:yl,paperPlane:bl,send:Pl,chevron:tn};function rc({options:e,transport:t,feedback:n,bus:o,isStreaming:a,operatorRequestEnabled:i,controlMode:l,onRequestOperator:s,onSend:c,onStop:d,attachApiRef:p}){let h=e.strings,[u,f]=R(""),[m,x]=R([]),[v,b]=R(!1),w=N(null),y=N(null),E=e.features.fileUpload,H=e.features.voice,[Q,ie]=R(()=>wa(H,e.locale,(L,z)=>t.transcribe(L,z)));T(()=>{v||H==="disabled"||ie(wa(H,e.locale,(L,z)=>t.transcribe(L,z)))},[e.locale,H,t,v]),T(()=>{let L=w.current;if(!L)return;let z=L.getRootNode(),V="activeElement"in z?z.activeElement:null;V&&L.closest(`.${Ue}-panel`)?.contains(V)||L.focus({preventScroll:!0})},[]),T(()=>{let L=w.current;if(!L)return;if(u.length===0){L.style.height="";return}L.style.height="auto";let z=parseFloat(getComputedStyle(L).fontSize)*.7,V=Math.min(L.scrollHeight,160);L.style.height=`${V<40+z?40:V}px`},[u]);let ne=N(m);ne.current=m,T(()=>()=>ne.current.forEach(Sa),[]),T(()=>{if(p)return p.current={attachFromDrop:L=>{let z=Yo(L,ne.current,e.attachments);z.accepted.length!==0&&(Nt.info("attach (drop)",{count:z.accepted.length,totalBytes:nn(z.accepted)}),o.emit("attach",{count:z.accepted.length,totalBytes:nn(z.accepted)}),x(V=>[...V,...z.accepted]))},fill:L=>{f(L);let z=w.current;z&&(z.focus({preventScroll:!0}),requestAnimationFrame(()=>z.setSelectionRange(z.value.length,z.value.length)))}},()=>{p.current&&(p.current=null)}},[p,e.attachments]),T(()=>{let L=w.current;if(!L)return;let z=L.closest(`.${Ue}-panel`);if(!z)return;let V=Se=>{let rt=Se.clipboardData;if(!rt)return;let $e=Se.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if($e&&$e!==L)return;if(E){let ye=Yo(rt.items,ne.current,e.attachments);if(ye.accepted.length>0){Se.preventDefault(),Nt.info("attach (paste)",{count:ye.accepted.length,totalBytes:nn(ye.accepted)}),o.emit("attach",{count:ye.accepted.length,totalBytes:nn(ye.accepted)}),x(fe=>[...fe,...ye.accepted]);return}}if($e===L)return;let be=rt.getData("text/plain");be&&(Se.preventDefault(),f(ye=>ye+be),L.focus())};return z.addEventListener("paste",V),()=>z.removeEventListener("paste",V)},[E,e.attachments,Ue]);let ee=()=>{let L=u.trim();!L&&m.length===0||a||(c(L,m),f(""),x([]))},O=L=>{L.key!=="Enter"||L.shiftKey||L.isComposing||(L.preventDefault(),a?d():ee())},D=L=>{let z=L.target,V=Yo(z.files,m,e.attachments);V.accepted.length>0&&(Nt.info("attach (file picker)",{count:V.accepted.length,totalBytes:nn(V.accepted)}),o.emit("attach",{count:V.accepted.length,totalBytes:nn(V.accepted)}),x(Se=>[...Se,...V.accepted])),z.value=""},j=L=>{Nt.info("removeAttachment",{id:L}),o.emit("removeAttachment",{id:L}),x(z=>{let V=z.find(Se=>Se.id===L);return V&&Sa(V),z.filter(Se=>Se.id!==L)})},Y=N(null),se=()=>{if(Q.isSupported){if(v){let L=Y.current?Date.now()-Y.current:0;Nt.info("voiceStop",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),Q.stop(),b(!1),n.play("voiceStop"),Y.current=null;return}Y.current=Date.now(),Nt.info("voiceStart"),o.emit("voiceStart",void 0),b(!0),n.play("voiceStart"),Q.start((L,z)=>f(V=>z?`${V}${L} `:V),()=>{if(b(!1),Y.current){let L=Date.now()-Y.current;Nt.debug("voiceStop (auto)",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),Y.current=null}})}},ce=gp[e.composer.sendButton.icon];return r("div",{class:`${Ue}-composer`,"data-testid":k.composer,children:[m.length>0?r("div",{class:`${Ue}-attachments`,children:m.map(L=>r(oc,{attachment:L,onRemove:()=>j(L.id)},L.id))}):null,r("div",{class:`${Ue}-composer-row`,children:[r("div",{class:`${Ue}-composer-actions`,children:[E?r("button",{type:"button",class:`${Ue}-icon-btn`,onClick:()=>y.current?.click(),"aria-label":h.attach,"data-testid":k.composerAttach,children:r(Sl,{})}):null,Q.isSupported?r("button",{type:"button",class:`${Ue}-icon-btn`,onClick:se,"aria-label":v?h.micStop:h.micStart,"aria-pressed":v,"data-recording":v?"true":void 0,"data-testid":k.composerVoice,children:r(kl,{})}):null,i&&l==="ai-agent"&&s?r("button",{type:"button",class:`${Ue}-icon-btn`,onClick:s,"aria-label":h.talkToOperator,title:h.talkToOperator,"data-testid":k.operatorRequest,children:r(ya,{})}):null]}),r("textarea",{ref:w,class:`${Ue}-textarea`,rows:1,value:u,placeholder:h.composerPlaceholder,onInput:L=>f(L.target.value),onKeyDown:O,"aria-label":h.composerPlaceholder,"data-testid":k.composerInput}),a?r("button",{type:"button",class:`${Ue}-send`,onClick:d,"aria-label":h.stop,"data-testid":k.composerStop,children:r(xl,{})}):r("button",{type:"button",class:`${Ue}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:ee,disabled:!u.trim()&&m.length===0,"aria-label":h.send,"data-testid":k.composerSend,children:r(ce,{})})]}),r("input",{ref:y,type:"file",multiple:!0,accept:e.attachments.accept,onChange:D,class:`${Ue}-sr-only`,"data-testid":k.composerFileInput})]})}var hp=P.cssPrefix;function ac({visible:e,strings:t}){return e?r("div",{class:`${hp}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Jo({containerRef:e,onDrop:t}){let[n,o]=R(!1);return T(()=>{let a=e.current;if(!a)return;let i=0,l=p=>{i+=1,p.dataTransfer?.types.includes("Files")&&(p.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=p=>{p.dataTransfer?.types.includes("Files")&&p.preventDefault()},d=p=>{i=0,o(!1),p.dataTransfer&&(p.preventDefault(),t(p.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 ic({itemCount:e,initialFocusIndex:t}){let[n,o]=R(!1),a=N(null),i=N(null),[l,s]=R(-1),c=$(()=>{o(!1),s(-1),a.current?.focus()},[]),d=$(()=>o(u=>!u),[]);T(()=>{if(!n)return;let u=f=>{let m=i.current,x=a.current;if(!m||!x)return;let v=f.composedPath();v.includes(m)||v.includes(x)||(o(!1),s(-1))};return document.addEventListener("click",u,!0),()=>document.removeEventListener("click",u,!0)},[n]),T(()=>{if(!n||e===0)return;let u=t?.()??0,f=u<0||u>=e?0:u;s(f)},[n,e,t]),T(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let p=$(u=>{(u.key==="ArrowDown"||u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o(!0))},[]),h=$(u=>{if(e!==0)switch(u.key){case"Escape":u.preventDefault(),c();return;case"ArrowDown":u.preventDefault(),s(f=>(f+1)%e);return;case"ArrowUp":u.preventDefault(),s(f=>(f-1+e)%e);return;case"Home":u.preventDefault(),s(0);return;case"End":u.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:p,onMenuKey:h}}function sc({items:e,triggerLabel:t}){let n=P.cssPrefix,o=ic({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 p=Math.max(0,d.findIndex(u=>u.value===c.value)),h=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")h=(p+1)%d.length;else if(s.key==="ArrowLeft")h=(p-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[h].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(Al,{})}),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":`${k.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(Lt,{})}):null]},s.id))}):null]})}var Ca=P.cssPrefix;function vp(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 bp={normal:"large",large:"small",small:"normal"};function yp(e){return e==="light"?r(Ul,{}):e==="dark"?r(ql,{}):r(Wl,{})}function Pp(e){return(e.split("-")[0]??e).toUpperCase()}function tt({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:p,onLocaleChange:h,onThemeChange:u,onTextSizeChange:f}=e,m=n.strings,x=n.mode,v=t==="chat",b=Z(()=>a.mutedSig.value).value,w=new Set(n.actions),y=Y=>w.has(Y),E=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,H=Y=>E?!1:Nn(Y,x,o),Q=n.themeMode,ie={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},ne=n.textSize,ee={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},O=[];if(v&&y("clear")&&O.push({id:"clear",icon:r($l,{}),label:m.newConversation,onSelect:l}),y("expand")&&H("expand")){let Y=o==="expanded";O.push({id:"expand",icon:Y?r(Cl,{}):r(wl,{}),label:Y?m.collapse:m.expand,type:"switch",on:Y,onSelect:s})}if(y("fullscreen")&&H("fullscreen")){let Y=o==="fullscreen";O.push({id:"fullscreen",icon:Y?r(El,{}):r(Tl,{}),label:Y?m.exitFullscreen:m.fullscreen,type:"switch",on:Y,onSelect:c})}v&&y("sound")&&O.push({id:"sound",icon:b?r(Ll,{}):r(Il,{}),label:b?m.soundOff:m.soundOn,type:"switch",on:!b,onSelect:d}),y("theme")&&O.push({id:"theme",icon:yp(Q),label:`${m.theme}: ${ie[Q]}`,onSelect:()=>u(vp(Q)),keepOpen:!0}),y("textSize")&&O.push({id:"textSize",icon:r(Ml,{}),label:`${m.textSize}: ${ee[ne]}`,onSelect:()=>f(bp[ne]),keepOpen:!0}),y("language")&&n.availableLocales.length>1&&O.push({id:"language",icon:r(Dl,{}),label:m.language,segments:n.availableLocales.map(Y=>({value:Y,label:Pp(Y),lang:Y})),value:n.locale,onSelectValue:h});let D=!!i&&Ko(x,o,n.actions),j=v&&y("history");return r("div",{class:`${Ca}-header-actions`,children:[j?r("button",{type:"button",class:`${Ca}-icon-btn`,onClick:p,"aria-label":m.history,title:m.history,"data-testid":k.actionHistory,children:r(Nl,{})}):null,O.length>0?r(sc,{items:O,triggerLabel:m.moreActions}):null,D?r("button",{type:"button",class:`${Ca}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":k.actionClose,children:r(et,{})}):null]})}var xp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Sp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,kp=/^[+]?[\d\s().-]{6,}$/;function on(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function wp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function Cp(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=wp(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(!xp.test(i))return n.formInvalidEmail;break;case"url":if(!Sp.test(i))return n.formInvalidUrl;break;case"tel":if(!kp.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 lc(e,t,n){let o={};for(let a of e){let i=Cp(a,t[a.name],n);i&&(o[a.name]=i)}return o}function cc(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,Qo="__other__";function $n({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:p,fieldTypeLabels:h,rootTestId:u,submitTestId:f,skipTestId:m}){let[x,v]=R(()=>({...Ap(e),...d})),[b,w]=R({}),[y,E]=R({}),H=O=>{y[O]&&E(D=>({...D,[O]:""}))},Q=(O,D)=>{v(j=>({...j,[O]:D})),H(O)},ie=(O,D)=>{w(j=>({...j,[O]:D})),H(O)},ne=O=>{if(O.preventDefault(),c)return;let D=Ip(e,x,b),j=lc(e,D,t);if(Object.keys(j).length>0){E(j);return}o(cc(D))},ee=O=>{!s||O.key!=="Enter"||O.shiftKey||O.isComposing||O.target?.tagName==="TEXTAREA"&&ne(O)};return r("form",{class:`${de}-form`,onSubmit:ne,onKeyDown:ee,"data-testid":u,noValidate:!0,children:[e.map(O=>r(Tp,{field:O,value:x[O.name],otherText:b[O.name]??"",error:y[O.name],disabled:c,typeLabel:h?.[O.name],strings:t,onChange:D=>Q(O.name,D),onOtherChange:D=>ie(O.name,D)},O.name)),p?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":m,children:a}):null,r("button",{type:"submit",class:`${de}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function Tp({field:e,value:t,otherText:n,error:o,disabled:a,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=we(k.formField,e.name),p=Ep({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]}),p,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 Ep(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:p=>l(p.target.value),"data-testid":c});case"select":return r("select",{class:`${de}-field-input`,value:d,disabled:a,onChange:p=>l(p.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(p=>r("option",{value:p.value,children:p.label??p.value},p.value))]});case"radio":{let p=t.allowOther&&d===Qo;return r("div",{class:`${de}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(h=>r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===h.value,disabled:a,onChange:()=>l(h.value)}),r("span",{children:h.label??h.value})]},h.value)),t.allowOther?r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===Qo,disabled:a,onChange:()=>l(Qo)}),r("span",{children:i.formOther})]}):null,p?r("input",{class:`${de}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:h=>s(h.target.value)}):null]})}case"checkbox":return r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:p=>l(p.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let p=Array.isArray(n)?n:[],h=(u,f)=>l(f?[...p,u]:p.filter(m=>m!==u));return r("div",{class:`${de}-field-choices`,"data-testid":c,children:[(t.options??[]).map(u=>r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:p.includes(u.value),disabled:a,onChange:f=>h(u.value,f.target.checked)}),r("span",{children:u.label??u.value})]},u.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:u=>s(u.target.value)}):null]})}default:return r("input",{class:`${de}-field-input`,type:Rp(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:p=>l(p.target.value),"data-testid":c})}}function Rp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function Ap(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 Ip(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]===Qo)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 nt=P.cssPrefix;function Ta({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${nt}-form-gate`,"data-testid":k.formGate,children:[e.title?r("h3",{class:`${nt}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${nt}-form-gate-desc`,children:e.description}):null,r($n,{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:k.formSubmit,skipTestId:k.formSkip})]})}function dc({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(ae,{children:[r("span",{children:e.title}),r("span",{class:`${nt}-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(p=>p.name===d)?.label??d;return r("details",{class:`${nt}-form-done`,"data-outcome":e.outcome,"data-testid":k.formDone,children:[r("summary",{class:`${nt}-form-done-summary`,"data-testid":k.formDoneToggle,children:[r(Lt,{}),i,r(tn,{})]}),r("dl",{class:`${nt}-form-answers`,"data-testid":k.formAnswers,children:Object.entries(s).map(([d,p])=>r("div",{class:`${nt}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:p})]},d))})]})}return r("div",{class:`${nt}-form-done`,"data-outcome":e.outcome,"data-testid":k.formDone,role:"status",children:[o?r(Ol,{}):r(Lt,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${nt}-form-done-fill`,"data-testid":k.formFill,onClick:n,children:t.formFillOut}):null]})}function _c(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var Aa=1,pc=2,mc=4,fc=8,gc=16;function Lp(e){switch(e){case Aa:return"href";case pc:return"src";case mc:return"class";case fc:return"checked";case gc:return"start"}}var Mp=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}},Op=Mp;var uc=24;function La(e){let t=new Uint32Array(uc);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(uc),indent:"",indent_len:0,table_state:0}}function hc(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 re(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 Np(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Dt(e,t){for(e.fence_start=0;e.len>t;)ve(e)}function Zo(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 Ea(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?(Dt(e,e.blockquote_idx),re(e,t),!0):(Dt(e,n),!1):(Dt(e,o),re(e,t),!0)}function Ra(e,t){re(e,25),e.spaces[e.len]=e.indent_len+t,dt(e),e.token=103}function dt(e){e.indent="",e.indent_len=0,e.pending=""}function Ia(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 Dp(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 $p(e){return Ia(e)||Dp(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=Zo(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),dt(e),e.pending=n;continue}Dt(e,e.blockquote_idx),dt(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" ":Zo(e,e.indent_len),re(e,Op(e.pending.length)),dt(e);continue}break;case">":{let i=Np(e,20,e.blockquote_idx+1);i===-1?(Dt(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,re(e,20)):e.blockquote_idx=i,dt(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;Zo(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),dt(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Ea(e,23),Ra(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):(re(e,2),dt(e),e.fence_start=0,Ie(e,o));continue;case`
15
+ `:{Zo(e,e.indent_len),re(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,mc,e.pending.slice(e.fence_start)),dt(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;Ea(e,23),Ra(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;Ea(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,gc,e.pending.slice(0,-1)),Ra(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||Ia(i)){e.pending=o;continue}}break;case"|":Dt(e,e.blockquote_idx),re(e,27),re(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,re(e,9)}else re(e,2);dt(e),Ie(e,a);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;case`
16
16
  `:e.table_state=2,e.pending="";continue;default:ve(e),e.table_state=0;break}else switch(e.pending){case"|":re(e,28),e.pending="",Ie(e,n);continue;case`
17
17
  `:ve(e),e.pending="",e.table_state=0,Ie(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":re(e,29),ve(e),e.pending="",Ie(e,n);continue;case`
18
18
  `:ve(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Ie(e,n);continue;default:re(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`
@@ -28,15 +28,15 @@ ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(t==="[DONE]")retu
28
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
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
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,mc,""),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}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),ve(e),e.pending=n);continue;case i+i:let s=e.token;oe(e),ve(e),ve(e),i!==n?(re(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),re(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),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],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?Ea:uc,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,Ea,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),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+=Ra(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),re(e,11),e.text=n===" "||n===`
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,fc,""),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}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),ve(e),e.pending=n);continue;case i+i:let s=e.token;oe(e),ve(e),ve(e),i!==n?(re(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),re(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),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],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?Aa:pc,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,Aa,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),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+=Ia(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),Dt(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
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
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(Np(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 Ia(e){return{add_token:Dp,end_token:$p,add_text:Fp,set_attr:Hp,data:{nodes:[e,,,,,],index:0}}}function Dp(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 $p(e){e.index-=1}function Fp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Hp(e,t,n){e.nodes[e.index].setAttribute(Ap(t),n)}function Qo({textSig:e,doneSig:t}){let n=N(null);return Tt(()=>{let o=n.current;if(!o)return;o.classList.add(`${P.cssPrefix}-md`);let a=Ia(o),i=Aa(a),l=0,s=lt(()=>{let p=e.value,h=t.value;p.length<l&&(o.replaceChildren(),a=Ia(o),i=Aa(a),l=0);let u=p.slice(l);u&&Ie(i,u),l=p.length,h&&gc(i)}),c=new MutationObserver(p=>{for(let h of p)for(let u of h.addedNodes){if(!(u instanceof HTMLElement))continue;let f=u.matches?.("a")?[u]:[...u.querySelectorAll?.("a")??[]];for(let m of f)hc(m)}});c.observe(o,{childList:!0,subtree:!0});for(let p of o.querySelectorAll("a"))hc(p);let d=p=>{let h=p.target?.closest?.("a");if(!h||!(h instanceof HTMLAnchorElement))return;let u=h.getAttribute("href")??"";!u||u.startsWith("#")||(p.preventDefault(),window.open(u,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function vc({text:e}){let t=De(()=>B(e),[e]),n=De(()=>B(!0),[]);return r(Qo,{textSig:t,doneSig:n})}function hc(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 bc({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=R(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${Zo}-feedback`,role:"group","data-testid":k.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":k.feedbackUp,children:r(Vl,{})}),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":k.feedbackDown,children:r(Gl,{})}),r("span",{class:`${Zo}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var on=P.cssPrefix;function yc({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${on}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":k.source,children:[r("span",{class:`${on}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${on}-source-label`,children:n})]}):r("span",{class:`${on}-source`,"data-testid":k.source,children:[r("span",{class:`${on}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${on}-source-label`,children:n})]})}var je=P.cssPrefix;function Ma(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 Oa({status:e,icon:t,label:n}){return r("span",{class:`${je}-toolui-badge ${je}-toolui-status`,"data-status":e,children:[r("span",{class:`${je}-toolui-status-icon`,children:t}),n]})}function zp(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 Up({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(zo,{}):e==="completed"||e==="responded"?r(Bo,{}):r(jl,{})}function qp(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 Wp({state:e,approval:t,strings:n,superseded:o}){let a=zp(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r(Oa,{status:i,icon:r(Up,{status:i}),label:qp(i,n)})}function Vp({name:e,state:t,approval:n,strings:o,superseded:a}){return r(ae,{children:[r("span",{class:`${je}-toolui-name-pill`,children:[r(Kl,{}),r("span",{class:`${je}-toolui-name-text`,children:e})]}),r(Wp,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${je}-toolui-chevron`,children:r(Lt,{})})]})}function tr({part:e,strings:t,testid:n,superseded:o}){let a=Z(()=>e.inputSig.value),i=Z(()=>e.outputSig.value),l=Z(()=>e.errorSig.value),s=Z(()=>e.stateSig.value),c=Z(()=>e.approvalSig.value);return r("details",{class:`${je}-toolui ${je}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${je}-toolui-head`,children:r(Vp,{name:Ma(e.toolName),state:s.value,approval:c.value,strings:t,superseded:o})}),r(La,{label:t.toolParameters,value:a.value}),i.value!==void 0?r(La,{label:t.toolResult,value:i.value}):null,l.value?r(La,{label:t.statusError,value:l.value,error:!0}):null]})}function La({label:e,value:t,error:n}){let o=n?String(t??""):nr(Na(t));return o?r("div",{class:`${je}-toolui-section`,children:[r("span",{class:`${je}-toolui-label`,children:e}),r("pre",{class:`${je}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function Na(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 Ve=P.cssPrefix;function Pc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=Z(()=>e.approvalSig.value),s=Z(()=>e.stateSig.value),c=Ma(e.toolName),d=l.value?.approved,{terminal:p,responded:h,decided:u}=er(s.value,l.value),f=h&&n&&!p,m=o&&!u,x=e.toolCallId;return r("div",{class:`${Ve}-toolui-group`,"data-testid":u?k.toolDecision:k.toolApproval,children:[r(tr,{part:e,strings:t,superseded:m}),m||p?null:r("div",{class:`${Ve}-toolui ${Ve}-toolui-body`,children:[h?r(ae,{children:[r("p",{class:`${Ve}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?r("p",{class:`${Ve}-toolui-subtle`,children:t.approvalEditHint}):null,!f&&!p?r("p",{class:`${Ve}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(ae,{children:[r("p",{class:`${Ve}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${Ve}-toolui-subtle`,children:t.approvalBody})]}),!u&&!o?r("div",{class:`${Ve}-toolui-actions`,children:[r("button",{type:"button",class:`${Ve}-form-skip`,onClick:()=>a(x,!1),"data-testid":k.toolReject,children:t.reject}),r("button",{type:"button",class:`${Ve}-form-submit`,onClick:()=>a(x,!0),"data-testid":k.toolApprove,children:t.approve})]}):null,f?r("div",{class:`${Ve}-toolui-actions`,children:r("button",{type:"button",class:`${Ve}-form-skip`,onClick:()=>i(x),"data-testid":k.toolEdit,children:t.edit})}):null]})]})}var Gp=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function xc(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(Kp).filter(a=>a!==null);return{intro:or(t.intro),questions:o}}function Kp(e,t){if(!e||typeof e!="object")return null;let n=e,o=Gp.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 jp(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 Da(e,t,n){return e.questions.map(o=>{let a=jp(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 xe=P.cssPrefix,Xp={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Sc(e,t){let n={};for(let o of e)n[o.key]=t[Xp[o.type]];return n}function kc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=Z(()=>e.stateSig.value).value,s=Z(()=>e.approvalSig.value).value,c=Z(()=>xc(e.inputSig.value)).value,{terminal:d,decided:p}=er(l,s),h=p&&s?.approved===!0,u=!p&&!o,f=!u&&!h,m=h&&n&&!d,x=c.questions,[v,b]=R(null),y=v??(u||h),[E,H]=R(!1),Q=x.length>1?ga:Ln,ie=u?t.inputRequired:t.inputBadge,ne=u?r(Yp,{req:c,strings:t,resolve:(ee,O)=>a(e.toolCallId,O,ee)}):E?r(Dn,{fields:Da(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Sc(x,t),initialValues:h?tm(x,s?.reason):void 0}):r(Jp,{questions:x,answers:h?em(s?.reason):{},strings:t});return r("details",{class:`${xe}-toolui ${xe}-toolui-collapsible${o?` ${xe}-toolui-stale`:""}`,open:y,onToggle:ee=>{let O=ee.currentTarget.open;O!==y&&b(O)},"data-testid":u?k.toolAskQuestions:k.toolDecision,children:[r("summary",{class:`${xe}-toolui-head`,children:[r("span",{class:`${xe}-toolui-q-pill`,children:[r(Q,{}),ie]}),r("span",{class:`${xe}-toolui-head-end`,children:[u?null:r(Oa,{status:f?"superseded":"completed",icon:f?r(zo,{}):r(Bo,{}),label:f?t.inputSkipped:t.inputAnswered}),r("span",{class:`${xe}-toolui-chevron`,children:r(Lt,{})})]})]}),r("div",{class:`${xe}-toolui-collapse-body`,children:[c.intro?r("div",{class:`${xe}-toolui-desc`,children:c.intro}):null,ne,u?null:r("div",{class:`${xe}-toolui-footer`,children:[r("button",{type:"button",class:`${xe}-toolui-options-toggle`,onClick:()=>H(ee=>!ee),"data-testid":k.toolAskOptions,children:[r("span",{class:`${xe}-toolui-options-chevron${E?` ${xe}-open`:""}`,children:r(Lt,{})}),E?t.hideOptions:t.showOptions]}),m?r("button",{type:"button",class:`${xe}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":k.toolEdit,children:t.edit}):null]})]})]})}function Yp({req:e,strings:t,resolve:n}){let o=Da(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return r(Dn,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n(Zp(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,fieldTypeLabels:Sc(e.questions,t),submitTestId:k.toolInputSubmit,skipTestId:k.toolInputSkip})}function Jp({questions:e,answers:t,strings:n}){return r("div",{class:`${xe}-toolui-summary`,"data-testid":k.toolAskSummary,children:e.map(o=>r("div",{class:`${xe}-field`,children:[r("span",{class:`${xe}-field-head`,children:r("span",{class:`${xe}-field-label`,children:[o.question,o.required?r("span",{class:`${xe}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),r("p",{class:`${xe}-toolui-answer`,children:Qp(o,t[o.key],n)||"\u2014"})]},o.key))})}function Qp(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Zp(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 wc(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 em(e){let t=wc(e),n={};for(let[o,a]of Object.entries(t))n[o]=Array.isArray(a)?a.join(", "):a;return n}function tm(e,t){let n=wc(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 Cc({part:e,strings:t}){let n=Z(()=>e.inputSig.value),o=Z(()=>e.outputSig.value),a=Z(()=>e.errorSig.value);return Z(()=>!!nr(n.value)||!!a.value||!!nr(Na(o.value))).value?r(tr,{part:e,strings:t,testid:k.toolCall}):null}var Le=P.cssPrefix;function Tc({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:p=!1,onFeedback:h,controlMode:u}){let m=Z(()=>e.partsSig.value).value,x=Z(()=>ct(e)),v=Z(()=>cl(e)),b=Z(()=>e.partsSig.value.some(le=>le.kind==="text"&&le.textSig.value.length>0)),w=Z(()=>o&&e.partsSig.value.some(le=>le.kind==="reasoning")),y=Z(()=>{let le=e.partsSig.value,L=-1;for(let z=0;z<le.length;z++){let V=le[z]?.kind;(V==="text"||V==="file"||V==="source")&&(L=z)}return L}),E=u==="awaiting_operator"||u==="operator",H=e.role==="assistant"&&e.status==="streaming"&&!E,Q=n==="buffered"&&H,ie=H&&!b.value,ne=H&&!Q&&!(w.value&&ie);if(v.value)return null;let ee=om(e.createdAt),O=e.role==="assistant"||e.role==="operator",D=p&&!!h&&!!e.serverMessageId&&O&&!H&&e.status!=="error"&&!x.value,X=m.filter(le=>le.kind==="text").map(le=>le.textSig.value).join(`
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($p(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 Ma(e){return{add_token:Fp,end_token:Hp,add_text:Bp,set_attr:zp,data:{nodes:[e,,,,,],index:0}}}function Fp(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 Hp(e){e.index-=1}function Bp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function zp(e,t,n){e.nodes[e.index].setAttribute(Lp(t),n)}function er({textSig:e,doneSig:t}){let n=N(null);return Tt(()=>{let o=n.current;if(!o)return;o.classList.add(`${P.cssPrefix}-md`);let a=Ma(o),i=La(a),l=0,s=lt(()=>{let p=e.value,h=t.value;p.length<l&&(o.replaceChildren(),a=Ma(o),i=La(a),l=0);let u=p.slice(l);u&&Ie(i,u),l=p.length,h&&hc(i)}),c=new MutationObserver(p=>{for(let h of p)for(let u of h.addedNodes){if(!(u instanceof HTMLElement))continue;let f=u.matches?.("a")?[u]:[...u.querySelectorAll?.("a")??[]];for(let m of f)vc(m)}});c.observe(o,{childList:!0,subtree:!0});for(let p of o.querySelectorAll("a"))vc(p);let d=p=>{let h=p.target?.closest?.("a");if(!h||!(h instanceof HTMLAnchorElement))return;let u=h.getAttribute("href")??"";!u||u.startsWith("#")||(p.preventDefault(),window.open(u,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function bc({text:e}){let t=De(()=>B(e),[e]),n=De(()=>B(!0),[]);return r(er,{textSig:t,doneSig:n})}function vc(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 tr=P.cssPrefix;function yc({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=R(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${tr}-feedback`,role:"group","data-testid":k.messageFeedback,children:[r("button",{type:"button",class:`${tr}-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":k.feedbackUp,children:r(Gl,{})}),r("button",{type:"button",class:`${tr}-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":k.feedbackDown,children:r(Kl,{})}),r("span",{class:`${tr}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var rn=P.cssPrefix;function Pc({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":k.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":k.source,children:[r("span",{class:`${rn}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${rn}-source-label`,children:n})]})}var je=P.cssPrefix;function Na(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function nr(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 Da({status:e,icon:t,label:n}){return r("span",{class:`${je}-toolui-badge ${je}-toolui-status`,"data-status":e,children:[r("span",{class:`${je}-toolui-status-icon`,children:t}),n]})}function qp(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 Wp({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(qo,{}):e==="completed"||e==="responded"?r(Uo,{}):r(Xl,{})}function Vp(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 Gp({state:e,approval:t,strings:n,superseded:o}){let a=qp(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r(Da,{status:i,icon:r(Wp,{status:i}),label:Vp(i,n)})}function Kp({name:e,state:t,approval:n,strings:o,superseded:a}){return r(ae,{children:[r("span",{class:`${je}-toolui-name-pill`,children:[r(jl,{}),r("span",{class:`${je}-toolui-name-text`,children:e})]}),r(Gp,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${je}-toolui-chevron`,children:r(Mt,{})})]})}function or({part:e,strings:t,testid:n,superseded:o}){let a=Z(()=>e.inputSig.value),i=Z(()=>e.outputSig.value),l=Z(()=>e.errorSig.value),s=Z(()=>e.stateSig.value),c=Z(()=>e.approvalSig.value);return r("details",{class:`${je}-toolui ${je}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${je}-toolui-head`,children:r(Kp,{name:Na(e.toolName),state:s.value,approval:c.value,strings:t,superseded:o})}),r(Oa,{label:t.toolParameters,value:a.value}),i.value!==void 0?r(Oa,{label:t.toolResult,value:i.value}):null,l.value?r(Oa,{label:t.statusError,value:l.value,error:!0}):null]})}function Oa({label:e,value:t,error:n}){let o=n?String(t??""):rr($a(t));return o?r("div",{class:`${je}-toolui-section`,children:[r("span",{class:`${je}-toolui-label`,children:e}),r("pre",{class:`${je}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function $a(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function rr(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 Ve=P.cssPrefix;function xc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=Z(()=>e.approvalSig.value),s=Z(()=>e.stateSig.value),c=Na(e.toolName),d=l.value?.approved,{terminal:p,responded:h,decided:u}=nr(s.value,l.value),f=h&&n&&!p,m=o&&!u,x=e.toolCallId;return r("div",{class:`${Ve}-toolui-group`,"data-testid":u?k.toolDecision:k.toolApproval,children:[r(or,{part:e,strings:t,superseded:m}),m||p?null:r("div",{class:`${Ve}-toolui ${Ve}-toolui-body`,children:[h?r(ae,{children:[r("p",{class:`${Ve}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?r("p",{class:`${Ve}-toolui-subtle`,children:t.approvalEditHint}):null,!f&&!p?r("p",{class:`${Ve}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(ae,{children:[r("p",{class:`${Ve}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${Ve}-toolui-subtle`,children:t.approvalBody})]}),!u&&!o?r("div",{class:`${Ve}-toolui-actions`,children:[r("button",{type:"button",class:`${Ve}-form-skip`,onClick:()=>a(x,!1),"data-testid":k.toolReject,children:t.reject}),r("button",{type:"button",class:`${Ve}-form-submit`,onClick:()=>a(x,!0),"data-testid":k.toolApprove,children:t.approve})]}):null,f?r("div",{class:`${Ve}-toolui-actions`,children:r("button",{type:"button",class:`${Ve}-form-skip`,onClick:()=>i(x),"data-testid":k.toolEdit,children:t.edit})}):null]})]})}var jp=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Sc(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(Xp).filter(a=>a!==null);return{intro:ar(t.intro),questions:o}}function Xp(e,t){if(!e||typeof e!="object")return null;let n=e,o=jp.has(n.type)?n.type:"text";return{key:ar(n.key)??`q${t+1}`,question:ar(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:ar(n.helpText)}}function Yp(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 Fa(e,t,n){return e.questions.map(o=>{let a=Yp(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 ar(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var xe=P.cssPrefix,Jp={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function kc(e,t){let n={};for(let o of e)n[o.key]=t[Jp[o.type]];return n}function wc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=Z(()=>e.stateSig.value).value,s=Z(()=>e.approvalSig.value).value,c=Z(()=>Sc(e.inputSig.value)).value,{terminal:d,decided:p}=nr(l,s),h=p&&s?.approved===!0,u=!p&&!o,f=!u&&!h,m=h&&n&&!d,x=c.questions,[v,b]=R(null),y=v??(u||h),[E,H]=R(!1),Q=x.length>1?va:Mn,ie=u?t.inputRequired:t.inputBadge,ne=u?r(Qp,{req:c,strings:t,resolve:(ee,O)=>a(e.toolCallId,O,ee)}):E?r($n,{fields:Fa(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:kc(x,t),initialValues:h?om(x,s?.reason):void 0}):r(Zp,{questions:x,answers:h?nm(s?.reason):{},strings:t});return r("details",{class:`${xe}-toolui ${xe}-toolui-collapsible${o?` ${xe}-toolui-stale`:""}`,open:y,onToggle:ee=>{let O=ee.currentTarget.open;O!==y&&b(O)},"data-testid":u?k.toolAskQuestions:k.toolDecision,children:[r("summary",{class:`${xe}-toolui-head`,children:[r("span",{class:`${xe}-toolui-q-pill`,children:[r(Q,{}),ie]}),r("span",{class:`${xe}-toolui-head-end`,children:[u?null:r(Da,{status:f?"superseded":"completed",icon:f?r(qo,{}):r(Uo,{}),label:f?t.inputSkipped:t.inputAnswered}),r("span",{class:`${xe}-toolui-chevron`,children:r(Mt,{})})]})]}),r("div",{class:`${xe}-toolui-collapse-body`,children:[c.intro?r("div",{class:`${xe}-toolui-desc`,children:c.intro}):null,ne,u?null:r("div",{class:`${xe}-toolui-footer`,children:[r("button",{type:"button",class:`${xe}-toolui-options-toggle`,onClick:()=>H(ee=>!ee),"data-testid":k.toolAskOptions,children:[r("span",{class:`${xe}-toolui-options-chevron${E?` ${xe}-open`:""}`,children:r(Mt,{})}),E?t.hideOptions:t.showOptions]}),m?r("button",{type:"button",class:`${xe}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":k.toolEdit,children:t.edit}):null]})]})]})}function Qp({req:e,strings:t,resolve:n}){let o=Fa(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return r($n,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n(tm(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,fieldTypeLabels:kc(e.questions,t),submitTestId:k.toolInputSubmit,skipTestId:k.toolInputSkip})}function Zp({questions:e,answers:t,strings:n}){return r("div",{class:`${xe}-toolui-summary`,"data-testid":k.toolAskSummary,children:e.map(o=>r("div",{class:`${xe}-field`,children:[r("span",{class:`${xe}-field-head`,children:r("span",{class:`${xe}-field-label`,children:[o.question,o.required?r("span",{class:`${xe}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),r("p",{class:`${xe}-toolui-answer`,children:em(o,t[o.key],n)||"\u2014"})]},o.key))})}function em(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function tm(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 Cc(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 nm(e){let t=Cc(e),n={};for(let[o,a]of Object.entries(t))n[o]=Array.isArray(a)?a.join(", "):a;return n}function om(e,t){let n=Cc(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 Tc({part:e,strings:t}){let n=Z(()=>e.inputSig.value),o=Z(()=>e.outputSig.value),a=Z(()=>e.errorSig.value);return Z(()=>!!rr(n.value)||!!a.value||!!rr($a(o.value))).value?r(or,{part:e,strings:t,testid:k.toolCall}):null}var Le=P.cssPrefix;function Ec({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:p=!1,onFeedback:h,controlMode:u}){let m=Z(()=>e.partsSig.value).value,x=Z(()=>ct(e)),v=Z(()=>dl(e)),b=Z(()=>e.partsSig.value.some(ce=>ce.kind==="text"&&ce.textSig.value.length>0)),w=Z(()=>o&&e.partsSig.value.some(ce=>ce.kind==="reasoning")),y=Z(()=>{let ce=e.partsSig.value,L=-1;for(let z=0;z<ce.length;z++){let V=ce[z]?.kind;(V==="text"||V==="file"||V==="source")&&(L=z)}return L}),E=u==="awaiting_operator"||u==="operator",H=e.role==="assistant"&&e.status==="streaming"&&!E,Q=n==="buffered"&&H,ie=H&&!b.value,ne=H&&!Q&&!(w.value&&ie);if(v.value)return null;let ee=am(e.createdAt),O=e.role==="assistant"||e.role==="operator",D=p&&!!h&&!!e.serverMessageId&&O&&!H&&e.status!=="error"&&!x.value,j=m.filter(ce=>ce.kind==="text").map(ce=>ce.textSig.value).join(`
40
40
 
41
- `).trim(),Y=!H&&e.status!=="error"&&!x.value&&X.length>0,se=D||Y;return r("div",{class:`${Le}-bubble-row`,"data-role":e.role,"data-mid":e.serverMessageId??e.id,"data-testid":we(k.messageBubble,e.id),children:r("div",{class:`${Le}-bubble-col`,children:[r("div",{class:`${Le}-bubble`,children:[Q?r(cm,{label:t.loading}):m.map((le,L)=>r(rm,{part:le,active:ie,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&(le.kind!=="tool"||L>y.value),superseded:s,tool:c},sm(le))),ne&&r(lm,{}),e.status==="error"&&e.errorText||x.value?r("div",{class:`${Le}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Le}-error-retry`,onClick:d,"data-testid":k.messageRetry,children:t.errorRetry}):null]}):null]}),ee||se||e.role==="operator"?r("div",{class:`${Le}-bubble-meta`,children:[e.role==="operator"&&e.operatorInitials?r("span",{class:`${Le}-bubble-author`,children:e.operatorInitials}):null,ee?r("time",{class:`${Le}-bubble-time`,dateTime:ee.iso,title:ee.full,children:ee.short}):null,se?r("div",{class:`${Le}-bubble-actions`,children:[D&&e.serverMessageId?r(bc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:h}):null,Y?r(nm,{text:X,strings:t}):null]}):null]}):null]})})}function nm({text:e,strings:t}){let[n,o]=R(!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:`${Le}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:a,"data-testid":k.messageCopy,children:n?r(It,{}):r(Wl,{})})}function om(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 rm({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(im,{part:e,active:t,strings:n}):null;case"tool":return r(am,{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(yc,{part:e,strings:n}):null}}function am({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=Z(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(dc(e.toolName))return r(kc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(Pc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(Cc,{part:e,strings:t}):null}function im({part:e,active:t,strings:n}){return r("details",{class:`${Le}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Le}-reasoning-summary`,children:r("span",{class:`${Le}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Le}-reasoning-body`,children:r(Qo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function sm(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 lm(){return r("span",{class:`${Le}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function cm({label:e}){return r("span",{class:`${Le}-loading`,role:"status",children:[r("span",{class:`${Le}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Le}-loading-label`,children:e})]})}var Dt=P.cssPrefix,$a=120,dm=350;function Ec({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,enableMessageFeedback:l,onFeedback:s,loading:c,idle:d,controlMode:p,tool:h,onRetry:u,form:f,formMarkers:m,onFillForm:x}){let v=N(null),b=Z(()=>e.value),[w,y]=R(!1),E=N(!1),H=N(!1),Q=N(!1),ie=N(0),ne=()=>Q.current||performance.now()-ie.current<dm,ee=N(0),O=S=>{let q=S.scrollHeight-S.clientHeight>1;S.dataset.fadeTop=q&&S.scrollTop>1?"true":"false",S.dataset.fadeBottom=q&&S.scrollHeight-S.scrollTop-S.clientHeight>1?"true":"false"},D=S=>y(S.scrollHeight-S.scrollTop-S.clientHeight>$a*2),X=S=>{ee.current=performance.now(),S.scrollTop=S.scrollHeight,O(S)},Y=(S,q)=>{X(S);let Ce=q,Te=0,Ee=()=>{X(S),--Ce>0&&(Te=requestAnimationFrame(Ee))};return q>0&&(Te=requestAnimationFrame(Ee)),()=>cancelAnimationFrame(Te)},se=(S,q)=>{let Ce,Te,Ee,Je=-1,Qe=()=>{Ce.disconnect(),Te.disconnect(),clearTimeout(Ee)},Fe=()=>{if(H.current||ne()||Je>=0&&S.scrollTop<Je-4)return Qe();X(S),Je=S.scrollTop};return Ce=new ResizeObserver(Fe),Te=new MutationObserver(Fe),Fe(),Ce.observe(S),Te.observe(S,{childList:!0,subtree:!0,characterData:!0}),Ee=setTimeout(Qe,q),Qe},le=b.value[0]?.id;Tt(()=>{let S=v.current;if(S&&b.value.length!==0&&(E.current=!0,!!b.value.some(q=>q.role==="user")))return se(S,300)},[le]);let L=N(0);T(()=>{let S=v.current,q=b.value,Ce=L.current;if(L.current=q.length,!S||!E.current)return;if(q.slice(Ce).some(Ee=>Ee.role==="user"))return H.current=!1,Y(S,3);if(!q.some(Ee=>Ee.role==="user")||H.current||ne())return;S.scrollHeight-S.scrollTop-S.clientHeight<$a&&X(S)},[b.value.length]);let z=N(null);T(()=>{let S=v.current,q=b.value.at(-1),Ce=z.current;if(z.current=q?.id??null,!!S&&E.current&&!(!q||q.id!==Ce||q.status!=="streaming"))return H.current=!1,Y(S,3)},[b.value]),T(()=>{let S=v.current;if(!S)return;let q=b.value.at(-1);if(!q||q.status!=="streaming"&&!b.value.some(Ee=>Ee.role==="user"))return;let Ce=()=>{if(H.current||ne())return;S.scrollHeight-S.scrollTop-S.clientHeight<$a*2&&X(S)};if(q.status!=="streaming")return se(S,300);Ce();let Te=new MutationObserver(Ce);return Te.observe(S,{childList:!0,subtree:!0,characterData:!0}),()=>Te.disconnect()},[b.value]);let V=f?.form.id,Se=!!f&&(m??[]).some(S=>S.formId===f.form.id);Tt(()=>{let S=v.current;!S||!V||H.current||b.value.some(q=>q.role==="user")&&(Se?S.querySelector(`[data-testid="${k.formGate}"]`)?.scrollIntoView({block:"nearest"}):X(S))},[V,Se]),T(()=>{let S=v.current;if(!S)return;let q=()=>{D(S),O(S),performance.now()-ee.current>150&&(H.current=S.scrollHeight-S.scrollTop-S.clientHeight>8)},Ce=()=>{H.current=!0},Te=Re=>{Re.deltaY<0&&Ce()},Ee=0,Je=Re=>{Ee=Re.touches[0]?.clientY??0,Q.current=!0},Qe=Re=>{(Re.touches[0]?.clientY??0)>Ee+4&&Ce()},Fe=()=>{Q.current=!1,ie.current=performance.now()},Ht=()=>{Q.current=!0};return S.addEventListener("scroll",q,{passive:!0}),S.addEventListener("wheel",Te,{passive:!0}),S.addEventListener("touchstart",Je,{passive:!0}),S.addEventListener("touchmove",Qe,{passive:!0}),S.addEventListener("touchend",Fe,{passive:!0}),S.addEventListener("touchcancel",Fe,{passive:!0}),S.addEventListener("pointerdown",Ht,{passive:!0}),window.addEventListener("pointerup",Fe,{passive:!0}),window.addEventListener("pointercancel",Fe,{passive:!0}),D(S),()=>{S.removeEventListener("scroll",q),S.removeEventListener("wheel",Te),S.removeEventListener("touchstart",Je),S.removeEventListener("touchmove",Qe),S.removeEventListener("touchend",Fe),S.removeEventListener("touchcancel",Fe),S.removeEventListener("pointerdown",Ht),window.removeEventListener("pointerup",Fe),window.removeEventListener("pointercancel",Fe)}},[]);let rt=()=>{let S=v.current;S&&(H.current=!1,X(S))},$e=[],be="",ye=b.value.at(-1)?.id,fe=[...m??[]].toSorted((S,q)=>(S.createdAt??1/0)-(q.createdAt??1/0)),Ft=S=>f&&S.formId===f.form.id?r(wa,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip},`gate:${S.formId}`):r(cc,{marker:S,strings:t,onFill:!f&&x?()=>x(S.formId):void 0},S.key),Oe=S=>{for(let q=fe[0];q?.createdAt!==void 0&&!(S!==void 0&&q.createdAt>S);q=fe[0])fe.shift(),$e.push(Ft(q))};for(let S of b.value){if(S.role==="assistant"&&S.id!==ye&&ct(S))continue;Oe(S.createdAt);let q=_m(S.createdAt);q&&q!==be&&($e.push(r("div",{class:`${Dt}-date-divider`,children:r("span",{class:`${Dt}-date-pill`,title:um(S.createdAt),children:pm(S.createdAt,t)})},`day:${q}`)),be=q),$e.push(r(Tc,{message:S,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!d&&S.id===ye,controlMode:p,superseded:S.id!==ye,tool:h,onRetry:d&&S.id===ye?u:void 0,enableMessageFeedback:l,onFeedback:s},S.id))}for(let S of fe)$e.push(Ft(S));return r("div",{class:`${Dt}-list-wrap`,children:[r("div",{ref:v,class:`${Dt}-list ${Dt}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&b.value.length===0?r("div",{class:`${Dt}-list-loading`,role:"status",children:t.conversationLoading}):null,$e,f&&!Se?r(wa,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip}):null]}),w?r("button",{type:"button",class:`${Dt}-jump`,onClick:rt,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":k.scrollToBottom,children:r(Lt,{})}):null]})}function _m(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function um(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function pm(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 mm=["today","yesterday","lastWeek","older"];function fm(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((Rc(e)-Rc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Ac(e,t){let n=new Map;for(let o of t){let a=fm(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return mm.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function Rc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var gm=K.scope("history"),hm=3,vm=6,bm={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function ym(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,p]=R(c?"loaded":"loading"),[h,u]=R(c?.conversations??[]);T(()=>{let v=!1;return e.listConversations({visitorId:a}).then(b=>{if(v)return;let w=b.conversations??[];u(w),p("loaded"),o.saveHistoryCount(w.length)}).catch(b=>{v||(gm.warn("listConversations failed",{err:b}),p("error"))}),()=>{v=!0}},[e,a,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":k.sidebarNewConversation,children:[r(hl,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(o.loadHistoryCount()??hm,vm);return r(ae,{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,v)},(b,w)=>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`})})})]})]},w))})]})}),f]})}if(d==="error"||h.length===0)return r(ae,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),x=Ac(m,h);return r(ae,{children:[r("div",{class:`${s}-history`,role:"list",children:x.map(v=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[bm[v.bucket]]}),r("div",{class:`${s}-history-card`,children:v.conversations.map(b=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(b),"data-closed":b.canContinue?void 0:"true","data-unread":b.hasUnread?"true":void 0,"data-testid":we(k.historyItem,b.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(ha,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:b.title}),r("span",{class:`${s}-history-time`,children:ym(b.lastMessageAt,m,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:b.preview??(b.canContinue?t.historyContinue:t.conversationClosed)}),b.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},b.conversationId))})]},v.bucket))}),f]})}var Ic=P.cssPrefix;function Lc({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${Ic}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${Ic}-suggestion`,onClick:()=>t(n),"data-testid":we(k.suggestion,o),children:n.label},n.id))})}var Me=P.cssPrefix;function Mc(e){let{options:t,onClose:n}=e,o=t.strings,a=N(null);T(()=>{let c=a.current;if(!c)return;let d=Go(c),p=h=>{h.key==="Escape"&&n?.()};return c.addEventListener("keydown",p),()=>{d(),c.removeEventListener("keydown",p)}},[n]);let i=e.composerApiRef,l=$(c=>{i.current?.attachFromDrop(c)},[i]),{visible:s}=Xo({containerRef:a,onDrop:l});return Wo(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Me}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":k.panel,children:[r(Fa,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(Ha,{poweredBy:e.options.poweredBy})]})}function Fa(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,controlMode:p,assignedOperatorInitials:h,operatorAvailable:u,operatorRequestEnabled:f,onRequestOperator:m,loadingMessages:x,messagesSig:v,agent:b,suggestions:w,initialWidgetSize:y,visitorId:E,onClose:H,onBack:Q,onClear:ie,onToggleHistory:ne,onSelectHistoryConversation:ee,onNewConversation:O,onWidgetSizeChange:D,onSend:X,onStop:Y,onSuggestion:se,activeForm:le,formMarkers:L,onFormSubmit:z,onFormSkip:V,onFormFill:Se,tool:rt,onRetry:$e,onMessageFeedback:be,containerEl:ye,dragOver:fe,composerAttachApiRef:Ft}=e,Oe=t.strings,S;return le?S=null:c?S=r(ae,{children:[p&&p!=="ai-agent"?r(Sm,{controlMode:p,operatorInitials:h,operatorAvailable:u,strings:Oe}):null,!d&&p==="ai-agent"&&r(Lc,{suggestions:w,onPick:se}),r(oc,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,operatorRequestEnabled:f,controlMode:p,onRequestOperator:m,onSend:X,onStop:Y,attachApiRef:Ft})]}):S=r(xm,{label:Oe.conversationClosed,ctaLabel:Oe.startNewConversation,onNewConversation:ie}),r(ae,{children:[s==="history"?r(Pm,{strings:Oe,onBack:ne,onClose:H,showClose:Vo(t.mode,l,t.actions)}):r("header",{class:`${Me}-header`,"data-testid":k.panelHeader,children:[Q?r("button",{type:"button",class:`${Me}-icon-btn`,onClick:Q,"aria-label":Oe.moduleBack,title:Oe.moduleBack,children:r(In,{})}):null,b?r(ec,{agent:b,strings:Oe}):r("h1",{children:Oe.panelTitle}),r(tt,{panelProps:e,variant:"chat"})]}),s==="history"?r(rr,{transport:n,strings:Oe,locale:t.locale,persistence:i,visitorId:E,onSelect:q=>ee(q.conversationId),onNewConversation:O}):r(ae,{children:[r(rc,{visible:fe,strings:Oe}),r(Ec,{messagesSig:v,strings:Oe,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:be,loading:x,idle:!d,controlMode:p,tool:rt,onRetry:$e,form:le?{form:le,onSubmit:z,onSkip:V}:null,formMarkers:L,onFillForm:Se}),S,r(wm,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(qo,{panelEl:ye,resize:t.size.resize,position:t.position,initialSize:y,onSizeChange:D,strings:Oe}):null]})}function Pm({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Me}-header`,children:[r("button",{type:"button",class:`${Me}-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:`${Me}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(et,{})}):null]})}function xm({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Me}-readonly-banner`,role:"note",children:[r("span",{class:`${Me}-readonly-label`,children:e}),r("button",{type:"button",class:`${Me}-readonly-cta`,onClick:n,children:t})]})}function Sm({controlMode:e,operatorInitials:t,operatorAvailable:n,strings:o}){let a=km(e,t,n,o);return r("div",{class:`${Me}-operator-banner`,role:"status","data-mode":e,"data-testid":k.operatorBanner,children:[r("span",{class:`${Me}-operator-pulse`,"aria-hidden":"true"}),r("span",{class:`${Me}-operator-label`,children:a})]})}function km(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function wm({disclaimer:e}){return e?r("div",{class:`${Me}-composer-footer`,children:r("div",{class:`${Me}-disclaimer`,children:e})}):null}function Ha({poweredBy:e}){return e?r("div",{class:`${Me}-poweredby-bar`,children:r(Cm,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function Cm({logoUrl:e,text:t,href:n}){let o=r(ae,{children:[e?r("img",{class:`${Me}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Me}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Me}-poweredby`,children:o})}function Oc(e){let t=N(e);t.current=e;let n=N(null);return n.current??(n.current=Tm(t)),n.current}function Tm(e){let t=B(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 p=e.current;if(c==="manual"){let h=p.forms.list.find(u=>u.id===d);h&&(t.value={form:h,trigger:"manual"});return}for(let h of p.forms.byTrigger[c]??[]){let u=h.triggers.find(f=>f.kind===c);if(!(!u||!Em(u,p)||a(h)||!Rm(h,p))){t.value={form:h,trigger:c};return}}},l=(c,d)=>{let p=t.value;if(!p)return;t.value=null;let{form:h,trigger:u}=p;h.frequency==="conversation"?n.add(o(h.id)):h.frequency!=="always"&&e.current.persistence.saveFormDone(h.id),e.current.onComplete(h,u,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(p=>p.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function Em(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function Rm(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 Nc(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":k.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(Am,{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":k.sidebarToggle,children:r(Im,{collapsed:i})})]}),i?null:r(ae,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(Lm,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(Mm,{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 Am({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 Im({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 Lm({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 Mm({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 Dc=P.cssPrefix;function $c(e){return r("main",{class:`${Dc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(Nc,{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:`${Dc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Fc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Hc(e,t,n){let o=B({activeTab:e,stacks:Fc(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:Fc(t)}}}}var Bc=e=>e.stacks[e.activeTab]??[],zc=e=>Bc(e).at(-1),Uc=e=>Bc(e).length===0;var qc={Icon:Mn};var yt=P.cssPrefix;function ar({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 ir({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 rn=P.cssPrefix;function Wc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${rn}-home-search`,onClick:t,"data-testid":k.homeSearch,children:[r("span",{class:`${rn}-home-search-text`,children:e}),r("span",{class:`${rn}-home-search-icon`,"aria-hidden":"true",children:r(ba,{})})]})}function Vc({placeholder:e,value:t,onInput:n}){return r("div",{class:`${rn}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${rn}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":k.helpSearch}),r("span",{class:`${rn}-home-search-icon`,"aria-hidden":"true",children:r(ba,{})})]})}var $n=P.cssPrefix;function sr({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${$n}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${$n}-list-row-body`,children:[r("span",{class:`${$n}-list-row-title`,children:e}),t?r("span",{class:`${$n}-list-row-sub`,children:t}):null]}),r("span",{class:`${$n}-list-row-chevron`,"aria-hidden":"true",children:r(en,{})})]})}var Gc=P.cssPrefix;function Xe({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${Gc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${Gc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var $t=P.cssPrefix,Om=K.scope("help"),Nm=(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 Dm(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 Kc(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 $m(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(Kc(n,o.title)*2,Kc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function jc({article:e,nav:t}){return r(sr,{title:e.title,subtitle:e.description,onClick:()=>Nm(t,e),testid:we(k.helpArticle,e.id)})}function Fm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,p]=R(t.errorGeneric),[h,u]=R([]),[f,m]=R(""),[x,v]=R(0);T(()=>{let y=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(E=>{if(y)return;let H=E.items??[];u(H),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:H.length})}).catch(E=>{y||(Om.warn("listContent (help) failed",{err:E}),p(At(E,t)),c("error"))}),()=>{y=!0}},[e,l,x,a]);let b=De(()=>$m(h,f),[h,f]);T(()=>{let y=f.trim();if(!y)return;let E=setTimeout(()=>a.emit("contentSearch",{queryLength:y.length,hitCount:b.length}),600);return()=>clearTimeout(E)},[f,b,a]);function w(){return f.trim().length>0?b.length===0?r(Xe,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${$t}-help-card`,children:b.map(y=>r(jc,{article:y,nav:o},y.id))}):s==="loading"?r(Xe,{message:t.helpLoading,strings:t}):s==="error"?r(Xe,{tone:"error",message:d,onRetry:()=>v(y=>y+1),strings:t}):h.length===0?r(Xe,{message:t.helpEmpty,strings:t}):Dm(h).map(([y,E])=>r("section",{class:`${$t}-help-group`,children:[y?r("h2",{class:`${$t}-help-section-title`,children:y}):null,r("div",{class:`${$t}-help-card`,children:E.map(H=>r(jc,{article:H,nav:o},H.id))})]},y))}return r("div",{class:`${$t}-module`,children:[r(ar,{title:t.helpTitle,actions:r(tt,{panelProps:i,variant:"plain"})}),r("div",{class:`${$t}-module-pad`,children:r(Vc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),r("div",{class:`${$t}-help-list`,children:w()})]})}var Xc={Icon:Ln,Root:e=>r(Fm,{...e})};var Yc=P.cssPrefix;function Ba({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${Yc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${Yc}-home-card`,"data-testid":n,children:t})}var _e=P.cssPrefix,Jc=K.scope("home");function Hm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ne(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 zm(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=R(null),[d,p]=R([]),h=o.contentTags?.join(",");T(()=>{if(o.showRecentConversations===!1)return;let b=!1;return t.listConversations({limit:1}).then(w=>!b&&c(w.conversations?.[0]??null)).catch(w=>!b&&Jc.warn("listConversations (home) failed",{err:w})),()=>{b=!0}},[t,o.showRecentConversations]),T(()=>{if(!o.contentTags?.length)return;let b=!1;return t.listContent({tags:o.contentTags,limit:6}).then(w=>{if(b)return;let y=w.items??[];p(y),i.emit("contentView",{section:"home",tags:h,count:y.length})}).catch(w=>!b&&Jc.warn("listContent (home) failed",{err:w})),()=>{b=!0}},[t,h,i]);let u=Hm(e),f=o.userAvatars??[],m=o.status,x=m?.text?Ne(n,m.text):n.homeStatus,v=o.contentBlockTitle?Ne(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${_e}-module ${_e}-home`,"data-testid":k.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":k.homeBrand,children:o.brandName}):r("span",{class:`${_e}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${_e}-home-hero-actions`,children:[f.length>0?r("div",{class:`${_e}-home-avatars`,children:f.map(b=>r("span",{class:`${_e}-home-avatar`,title:b.role?`${b.name} \xB7 ${b.role}`:b.name,children:b.avatar?r("img",{src:b.avatar,alt:"",loading:"lazy"}):r("span",{children:Ko(b.name)})},b.name))}):null,r(tt,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(ae,{children:[r("h1",{class:`${_e}-home-greeting`,"data-testid":k.homeGreeting,children:u.title}),u.subtitle?r("p",{class:`${_e}-home-lead`,children:u.subtitle}):null]}):null]}),r("div",{class:`${_e}-home-cards`,children:[o.showSearchBar!==!1?r(Wc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(Ba,{onClick:()=>a.selectConversation(s.conversationId),testid:k.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(Mn,{})}),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,m?r(Ba,{onClick:m.url?()=>a.push({kind:"iframe",url:m.url,title:x}):void 0,children:r("div",{class:`${_e}-home-status`,"data-level":m.level??"operational",children:[r("span",{class:`${_e}-home-status-icon`,"aria-hidden":"true",children:r(Fl,{})}),r("span",{class:`${_e}-home-status-text`,children:x})]})}):null,d.length>0?r("section",{class:`${_e}-home-content`,children:[r("div",{class:`${_e}-home-content-title`,children:v}),r("div",{class:`${_e}-home-content-list`,children:d.map(b=>r(sr,{title:b.title,subtitle:b.description,onClick:()=>Bm(a,b),testid:we(k.homeContentRow,b.id)},b.id))})]}):null]})]})})}var Qc={Icon:Hl,Root:e=>r(zm,{...e})};var Pt=P.cssPrefix,Um=K.scope("news");function qm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,p]=R(t.errorGeneric),[h,u]=R([]),[f,m]=R(0);T(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(v)return;let w=b.items??[];u(w),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:w.length})}).catch(b=>{v||(Um.warn("listContent (news) failed",{err:b}),p(At(b,t)),c("error"))}),()=>{v=!0}},[e,l,f,a]);function x(){return s==="loading"?r(Xe,{message:t.newsLoading,strings:t}):s==="error"?r(Xe,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):h.length===0?r(Xe,{message:t.newsEmpty,strings:t}):r("div",{class:`${Pt}-news-list`,children:h.map(v=>r("button",{type:"button",class:`${Pt}-news-card`,onClick:()=>o.push({kind:"content",id:v.id,title:v.title}),"data-testid":we(k.newsItem,v.id),children:[v.image?r("img",{class:`${Pt}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,r("span",{class:`${Pt}-news-body`,children:[r("span",{class:`${Pt}-news-title`,children:v.title}),v.description?r("span",{class:`${Pt}-news-summary`,children:v.description}):null]})]},v.id))})}return r("div",{class:`${Pt}-module`,children:[r(ar,{title:t.newsTitle,actions:r(tt,{panelProps:i,variant:"plain"})}),r("div",{class:`${Pt}-module-scroll`,children:x()})]})}var Zc={Icon:Bl,Root:e=>r(qm,{...e})};var lr={chat:qc,home:Qc,help:Xc,news:Zc};var Fn=P.cssPrefix;function ed({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${Fn}-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:`${Fn}-tab`,onClick:()=>a(i.id),"data-testid":we(k.tab,i.id),children:[r("span",{class:`${Fn}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${Fn}-tab-badge`,"data-testid":k.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${Fn}-tab-label`,children:Ne(n,i.label)})]},i.id)})})}var td=P.cssPrefix,Wm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function nd({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${td}-module`,children:[r(ir,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${td}-content-frame`,src:e,title:t||"content",sandbox:Wm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Hn=P.cssPrefix,Vm=K.scope("content"),Gm=5e3;function od({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=R(null),[d,p]=R(!1),[h,u]=R(0),f=$(()=>{p(!1),c(null),u(v=>v+1)},[]);T(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(v)return;let w=b.items[0];w?(c(w),a.emit("contentOpen",{contentId:e,tags:w.tags?.length?w.tags.join(","):void 0})):p(!0)}).catch(b=>{v||(Vm.warn("listContent (reader) failed",{err:b}),p(!0))}),()=>{v=!0}},[n,e,h,a]),T(()=>{if(!s)return;let v=setTimeout(()=>a.emit("contentRead",{contentId:e}),Gm);return()=>clearTimeout(v)},[s,e,a]);let m=$(v=>{let w=v.target?.closest?.("a")?.getAttribute("href")??"";w&&!w.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function x(){return d?r(Xe,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(Xe,{message:o.contentLoading,strings:o}):r("article",{class:`${Hn}-content`,"data-testid":k.contentView,onClick:m,children:[s.image?r("img",{class:`${Hn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Hn}-content-subtitle`,children:s.description}):null,r(vc,{text:s.content??""})]})}return r("div",{class:`${Hn}-module`,children:[r(ir,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:k.backHeader}),r("div",{class:`${Hn}-module-scroll`,"data-testid":k.contentScroll,children:x()})]})}var cr=P.cssPrefix;function rd({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,p=N(null),h=N(new Set);T(()=>{let D=p.current;if(!D)return;let X=Go(D),Y=se=>{se.key==="Escape"&&e.onClose?.()};return D.addEventListener("keydown",Y),()=>{X(),D.removeEventListener("keydown",Y)}},[e.onClose]);let u=e.composerApiRef,f=$(D=>{u.current?.attachFromDrop(D)},[u]),{visible:m}=Xo({containerRef:p,onDrop:f});Wo(p.current,c.mode==="modal");let x=Z(()=>n.sig.value).value,v=zc(x),b=c.modules.byId[x.activeTab],w=v?.kind==="iframe"||v?.kind==="content",y=t.length>1&&(Uc(x)||!w),E=N(null);T(()=>{if(w&&E.current===null)E.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!w&&E.current!==null){let D=E.current;E.current=null,s(D)}},[w]);let H={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:D=>{let X=t.find(Y=>Y.layout===D);X&&n.switchTab(X.id)},selectConversation:i,startNewConversation:l},Q=D=>({options:c,transport:e.transport,strings:d,config:D,visitorId:e.visitorId,nav:H,bus:o,panelProps:e}),ie=r(tt,{panelProps:e,variant:"plain"});b&&h.current.add(b.id);let ne=t.filter(D=>h.current.has(D.id)),ee=D=>{if(D.layout==="chat")return r(Fa,{...e,containerEl:p.current,dragOver:m,composerAttachApiRef:u});let X=lr[D.layout].Root;return X?r(X,{...Q(D)}):null},O=()=>v?.kind==="iframe"?r(nd,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:ie}):v?.kind==="content"?r(od,{id:v.id,title:v.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:ie}):null;return r("div",{ref:p,class:`${cr}-panel ${cr}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":k.messengerHome,children:[r("div",{class:`${cr}-messenger-body`,children:[ne.map(D=>r("div",{class:`${cr}-messenger-pane`,hidden:w||D.id!==b?.id,children:ee(D)},D.id)),O()]}),y?r(ed,{modules:t,activeTab:x.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(Ha,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!v)?r(qo,{panelEl:p.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Bn=P.cssPrefix;function ad({strings:e,onClose:t}){return r("div",{class:`${Bn}-panel ${Bn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":k.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(et,{})}):null,r("p",{class:`${Bn}-modules-empty-text`,children:e.modulesEmpty})]})}function id({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=R(()=>o?!1:t.loadCalloutDismissed(n));T(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=$(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}var G=K.scope("app"),dr=P.cssPrefix;function sd(e,t){return il({...e,text:Ne(t,e.text)})}function Km(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 ld(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function cd({options:e,hostElement:t,bus:n}){let[o]=R(()=>gt(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=R(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=R(()=>l.locale??e.locale),[d,p]=R(()=>l.themeMode??e.themeMode),[h,u]=R(()=>l.textSize??e.textSize),f=ht(o.loadConversationId()),m=ht([]),x=ht(!1),v=ht("ai-agent"),b=ht(void 0),w=ht(void 0),[y,E]=R(!1),[H,Q]=R([]);function ie(){let _=e.modules.list,g=new Set(_.map(M=>M.id)),C=o.loadActiveModule();return C&&g.has(C)?C:_[0]?.id??""}function ne(){return e.modules.list.find(_=>_.layout==="chat")?.id}function ee(){let _=ne();return _?e.modules.list.length===1?!0:X.sig.value.activeTab===_:!1}let O=N(ee);O.current=ee;let D=N();if(!D.current){let _=e.modules.list.map(g=>g.id);D.current=Hc(ie(),_,g=>o.saveActiveModule(g))}let X=D.current,Y=N(void 0);Y.current=ne();let[se,le]=R(!1),[L,z]=R(null),[V,Se]=R(!1),rt=e.mode==="standalone"||e.mode==="inline",$e=N(Cn(e,Zt(),o.loadPanelOpen(),o.loadPanelSize())),[be,ye]=R($e.current.panelOpen),[fe,Ft]=R($e.current.panelOpen),Oe=N(fe);Oe.current=fe;let S=N(!1),q=N(void 0);T(()=>{be&&Ft(!0)},[be]);let Ce=N(!1),[Te,Ee]=R(!1),{dismissed:Je,dismissCallout:Qe}=id({callout:e.launcher.callout,persistence:o}),Fe=e.launcher.callout?.persistent??!0,Ht=$(()=>{G.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Qe()},[n,Qe]),[Re,xt]=R($e.current.panelSize),Ja=N(!1),[vd,gr]=R("chat"),[an,sn]=R(!0),[Ae,zn]=R(!1),[bd,Qa]=R(null),[hr,ln]=R([]),[Za,Un]=R(null),[qn,Wn]=R(null),Vn=N(e.strings),vr=N(e);vr.current=e;let[yd,Pd]=R(void 0),[xd,Sd]=R(void 0),[kd,wd]=R(()=>o.loadSidebarCollapsed()??!1),[br,Cd]=R({}),[U]=R(()=>new Oo({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ks({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[He]=R(()=>new Do(m)),[ce]=R(()=>new Ho(e.sound,e.haptics)),Ze=$(_=>{o.patchUserPrefs(_),U.saveUserPrefs(o.loadUserPrefs()).catch(g=>{G.warn("saveUserPrefs failed",{err:g})})},[o,U]);T(()=>{l.soundMuted!==void 0&&ce.setMuted(l.soundMuted)},[]),T(()=>{t.dataset.theme=d},[t,d,e]),T(()=>{t.dataset.textSize=h},[t,h,e]),T(()=>{ce.update(e.sound,e.haptics)},[ce,e.sound,e.haptics]),T(()=>()=>ce.destroy(),[ce]),T(()=>{let _=!0;return ce.mutedSig.subscribe(g=>{if(_){_=!1;return}Ze({soundMuted:g})})},[ce,Ze]),T(()=>{Ja.current||!e.size.initialSize||(Ja.current=!0,!o.loadPanelSize()&&xt(ua(e.mode,e.size,Zt())))},[e.mode,e.size,o]),T(()=>{if(!se||Ce.current)return;Ce.current=!0;let _=Cn(e,Zt(),o.loadPanelOpen(),o.loadPanelSize());ye(_.panelOpen),xt(_.panelSize)},[se,e,o]);let ei=N(!1),ti=N(!1),cn=N(null),yr=N(null),Pr=N(!1),ni=N(null),xr=N(null),Sr=N();T(()=>()=>clearTimeout(Sr.current),[]);let kr=N(new Set);T(()=>{if(!(!se||ei.current)){if(ei.current=!0,ti.current){let _=Y.current;_&&X.switchTab(_);return}X.reset(ie())}},[se]);let Gn=$(_=>{!_||_.length===0||(m.value=_.map(g=>sd(g,Vn.current)))},[m]),wr=N(null),Kn=$(async _=>{try{let{formSubmissions:g}=await(_?U.bootstrap(_):wr.current??U.bootstrap()),C=new Map;return g.forEach((M,W)=>C.set(M.formId,W)),g.filter((M,W)=>!M.skipped||C.get(M.formId)===W).map((M,W)=>({key:`wire:${M.formId}:${M.createdAt??W}`,formId:M.formId,outcome:M.skipped?"skipped":"submitted",createdAt:Io(M.createdAt),values:M.values}))}catch(g){return G.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:g}),[]}},[U]),dn=N(0),_n=$((_,g)=>{let C=[..._.map(A=>A.createdAt),...g.map(A=>A.createdAt)].filter(A=>A!==void 0),M=(C.length?Math.min(...C):Date.now())-1;return[...(q.current?.messages??[]).map(A=>{let me=sd(A,Vn.current);return me.createdAt=M,me}),..._]},[]),Cr=$(async _=>{let g=dn.current,C=()=>g!==dn.current;E(!0);try{let[M,W]=await Promise.all([U.loadConversation(_),Kn()]);if(C())return;let A=fa(M.messages??[]);Q(W);let me=cn.current?[cn.current]:[];if(A.length||me.length){m.value=[..._n(A,W),...me],sn(M.canContinue??!0),Ye(vt(M.controlState));let ze=A.findLast(ue=>ue.role==="assistant"&&!ue.ephemeral);ln(ze?.suggestions??M.suggestions??[])}else m.value=_n([],W);U.resumeStatus==="needs-generation"&&yr.current?.()}catch(M){if(C())return;G.warn("loadThread failed; resetting conversationId",{err:M,conversationId:_}),f.value=void 0,o.saveConversationId(void 0)}finally{C()||E(!1)}},[U,Kn,m,f,o,_n]),un=$(async({newConversation:_})=>{let g=++dn.current,C=()=>g!==dn.current,M=f.value,W=_||!M?Ge():M;W!==M&&(f.value=W,o.saveConversationId(W));let A;try{A=await U.handshake({visitorId:a,conversationId:W,userPrefs:o.loadUserPrefs(),locale:s})}catch(ze){if(C())return;n.emit("error",ze),e.onError?.(ze),_||le(!0);return}if(C())return;if(A.visitorId&&A.visitorId!==a&&(G.info("visitor rebound",{previous:a,current:A.visitorId,reason:A.rebind?.visitorId}),o.setVisitorId(A.visitorId),i(A.visitorId),n.emit("visitorRebound",{previous:a,current:A.visitorId,reason:A.rebind?.visitorId})),A.conversationId&&A.conversationId!==W&&(G.info("conversation rebound",{previous:W,current:A.conversationId,reason:A.rebind?.conversationId}),n.emit("conversationRebound",{previous:W,current:A.conversationId,reason:A.rebind?.conversationId})),A.agent&&Qa(A.agent),Ye(vt(A.controlState)),e.mode==="page"&&(A.site&&Vs(A.site)?Pd(A.site):A.site&&G.warn("invalid site config, using fallback",{site:A.site}),A.blocks&&Gs(A.blocks)?Sd(A.blocks):A.blocks&&G.warn("invalid blocks config, using fallback",{blocks:A.blocks})),A.userPrefs&&!_&&(o.saveUserPrefs(A.userPrefs),A.userPrefs.locale&&c(A.userPrefs.locale),A.userPrefs.soundMuted!==void 0&&ce.setMuted(A.userPrefs.soundMuted),A.userPrefs.themeMode&&p(A.userPrefs.themeMode),A.userPrefs.textSize&&u(A.userPrefs.textSize)),q.current=A.welcome,_||n.emit("handshake",A),A.welcome?.suggestions){let ze=Vn.current;ln(A.welcome.suggestions.map(ue=>({...ue,label:Ne(ze,ue.label),...ue.text===void 0?{}:{text:Ne(ze,ue.text)}})))}!_&&M&&A.conversationId===M?Oe.current?Cr(M):S.current=!0:(f.value=A.conversationId,o.saveConversationId(A.conversationId),Gn(A.welcome?.messages)),_||le(!0)},[U,a,o,e,n,f,ce,Gn,Cr,s]),pn=JSON.stringify(e.userContext??null),Td=JSON.stringify(e.pageContext??null),Ed=JSON.stringify(br);T(()=>{let _=Object.keys(br).length?{...br,...e.userContext}:e.userContext;U.setContext(_,jm(e.pageContext))},[U,pn,Td,Ed]);let We=qt(s,e.availableLocales,e.defaultLocale);T(()=>{U.setLocale(We)},[U,We]),T(()=>{t.dir=Si(We)?"rtl":"ltr"},[t,We]),T(()=>{We!==s&&c(We)},[We,s]);let oi=$((_,g=[])=>ln(_.suggestions??g),[]),jn=$(_=>{if(_.type!=="data-conversation-rebind")return!1;let g=_.data?.conversationId;if(g&&g!==f.value){let C=f.value;f.value=g,o.saveConversationId(g),U.primeIdentity(void 0,g),G.info("conversation rebound (in-stream)",{previous:C,current:g}),C&&n.emit("conversationRebound",{previous:C,current:g,reason:g})}return!0},[f,o,U,n]),Ye=$(_=>{v.value=_.controlMode,b.value=_.assignedOperatorInitials,_.operatorAvailable!==void 0&&(w.value=_.operatorAvailable)},[v,b,w]),ri=$(_=>{_.type==="data-control-state"&&Ye(vt(_.data))},[Ye]),Rd=$(async()=>{if(v.value!=="ai-agent")return;let _=await U.requestOperator();Ye(vt(_))},[U,v,Ye]),ai=$(async _=>{let g=null;try{for await(let C of _.iter)if(!jn(C.chunk)){if(ri(C.chunk),!g){g=Tn(),cn.current=g,He.attach(g),m.value=[...m.value,g],zn(!0),Un(()=>_.cancel),Wn(()=>_.detach),ti.current=!0;let M=Y.current;M&&X.switchTab(M),G.info("resumed in-flight reply on mount")}He.apply(C.chunk),C.chunk.type==="finish"&&C.chunk.canContinue===!1&&sn(!1)}g&&(g.pausedTurn?m.value=m.value.filter(C=>C!==g):g.status==="error"||ct(g)?(g.status="error",g.errorText=e.strings.errorGeneric,ce.play("error")):(g.status="complete",ce.play("messageReceived"),_r(n,e,"assistant",En(g)),oi(g)))}catch(C){g&&(ld(C)?No(g)?m.value=m.value.filter(M=>M!==g):g.status="complete":(g.status="error",g.errorText=At(C,e.strings),ce.play("error"))),G.debug("resume ended without completing",{err:C})}finally{cn.current=null,g&&(He.detach(),zn(!1),Un(null),Wn(null),m.value=[...m.value],xr.current?.())}},[He,m,ce,n,e,X,jn]),Tr=N(null),Er=$(async()=>{if(v.value!=="ai-agent")return;let _=U.resumeStream();Tr.current=_,await ai(_),U.resumeStatus==="needs-generation"&&yr.current?.()},[U,ai,v]);T(()=>{let _=f.value;return _&&U.primeIdentity(a,_),un({newConversation:!1}),()=>{dn.current++,Tr.current?.cancel()}},[]),T(()=>{fe&&(wr.current=U.bootstrap(),(async()=>{try{let _=await wr.current;z(vn((_??{forms:[]}).forms,We))}catch(_){G.debug("bootstrap failed \u2014 treating as no forms",{err:_})}finally{Se(!0)}})(),(async()=>{let _=[];if(S.current){S.current=!1;let g=f.value;g&&_.push(Cr(g))}f.value&&_.push(Er()),_.length!==0&&await Promise.allSettled(_)})())},[fe]);let Xn=N(null);T(()=>{if(!fe)return;if(Xn.current===null){Xn.current=We;return}if(Xn.current===We)return;Xn.current=We;let _=!1;return U.bootstrap().then(g=>{_||z(vn((g??{forms:[]}).forms,We))}).catch(g=>G.debug("forms re-localize failed \u2014 keeping current copy",{err:g})),()=>{_=!0}},[fe,We,U]);let ii=N(pn);T(()=>{!se||ii.current===pn||(ii.current=pn,un({newConversation:!1}))},[pn,se,un]);let si=v.value!=="ai-agent";T(()=>{if(!fe||!se||!vr.current.features.operatorRequest||!si)return;let _=f.value;if(!_)return;Tr.current?.cancel();let g=!1,C=U.resumeChannel();return G.debug("operator-control resume-channel opened",{conversationId:_}),(async()=>{try{for await(let{chunk:M}of C.iter){if(g)break;if(M.type==="data-control-state")Ye(vt(M.data));else if(M.type==="data-message"){let W=ma(M.data),{list:A,appended:me}=sl(m.value,W);m.value=A,me&&(_r(n,vr.current,"operator",En(W)),!document.hidden&&O.current()&&U.markRead(_).catch(()=>{}))}}}catch(M){g||G.debug("operator-control resume-channel ended",{err:M})}})(),()=>{g=!0,C.stop(),G.debug("operator-control resume-channel closed",{conversationId:_})}},[fe,se,si,f,U,Ye,m,n]),Tt(()=>{vo(t,Ro(e.mode,Re,be))},[t,be,Re,e.mode]),T(()=>{if(e.mode!=="modal"||!be)return;let _=g=>{g.composedPath().some(W=>W instanceof HTMLElement&&W.classList.contains(`${P.cssPrefix}-panel`))||ye(!1)};return t.addEventListener("click",_),()=>t.removeEventListener("click",_)},[t,be,e.mode]),T(()=>{if(e.mode!=="drawer"||!be)return;let _=g=>{g.key==="Escape"&&ye(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[be,e.mode]);let ut=$(async(_,{continueExisting:g})=>{let C=f.value??Ge();f.value||(f.value=C,o.saveConversationId(C));let M=(g?m.value:m.value.slice(0,-1)).filter(me=>!me.ephemeral),W=Zs({messages:M.map(ll),conversationId:C,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});zn(!0);let A=U.sendMessage(W);Un(()=>A.cancel),Wn(()=>A.detach);try{for await(let ue of A.iter)jn(ue.chunk)||(ri(ue.chunk),He.apply(ue.chunk),ue.chunk.type==="finish"&&ue.chunk.canContinue===!1&&sn(!1));let me=_.status==="error",ze=!_.pausedTurn&&ct(_);if(_.pausedTurn)m.value=m.value.filter(ue=>ue!==_);else if(me||ze){_.status="error",_.errorText=e.strings.errorGeneric,ce.play("error");let ue=new Error(me?"stream error chunk":"empty reply");n.emit("error",ue),e.onError?.(ue)}else _.status="complete",ce.play("messageReceived"),_r(n,e,"assistant",En(_)),oi(_)}catch(me){ld(me)?No(_)?m.value=m.value.filter(ze=>ze!==_):_.status="complete":(_.status="error",_.errorText=At(me,e.strings),ce.play("error"),n.emit("error",me),e.onError?.(me))}finally{He.detach(),zn(!1),Un(null),Wn(null),m.value=[...m.value],xr.current?.()}},[U,He,m,f,e,n,ce,o,a,jn]),li=$(()=>{if(Ae||Pr.current||cn.current||m.value.findLast(C=>!C.ephemeral)?.role!=="user")return;Pr.current=!0,G.info("regenerating dangling user turn (needs-generation)");let g=Tn();m.value=[...m.value,g],He.attach(g),ut(g,{continueExisting:!1}).finally(()=>{Pr.current=!1})},[Ae,m,He,ut]);T(()=>{yr.current=li},[li]);let Yn=$((_,g)=>{if(Ae)return;let C=m.value.at(-1),M=C?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===_);if(!C||!M){G.warn("decideTool: tool part not found",{toolCallId:_});return}g(M),C.partsSig.value=[...C.partsSig.value],Km(C)&&(C.status="streaming",m.value=[...m.value],He.attach(C),ut(C,{continueExisting:!0}))},[Ae,m,He,ut]),ci=$((_,g)=>{G.info("toolResult",{toolCallId:_}),n.emit("toolResult",{toolCallId:_}),Yn(_,C=>{C.outputSig.value=g,C.stateSig.value="output-available"})},[n,Yn]),di=$((_,g,C)=>{G.info("toolDecision",{toolCallId:_,approved:g}),n.emit("toolDecision",{toolCallId:_,approved:g}),Yn(_,M=>{let W=M.approvalSig.value?.id??_;M.approvalSig.value={id:W,approved:g,reason:C},M.stateSig.value="approval-responded"})},[n,Yn]),_i=$(_=>{if(Ae)return;let g=m.value.at(-1),C=g?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===_);if(!g||!C)return;let M=C.approvalSig.value?.id??_;C.approvalSig.value={id:M},C.stateSig.value="approval-requested",g.partsSig.value=[...g.partsSig.value]},[Ae,m]),Ad=$((_,g)=>{G.info("messageFeedback",{messageId:_,value:g}),n.emit("messageFeedback",{messageId:_,value:g}),U.submitFeedback({messageId:_,value:g})},[n,U]),Id=De(()=>({humanInLoop:e.features.humanInLoop,onResult:ci,onDecision:di,onEdit:_i}),[e.features.humanInLoop,ci,di,_i]),Ld=()=>m.value.reduce((_,g)=>_+(g.role==="user"?1:0),0),Bt=e.forms.list.length>0?e.forms:L??e.forms,ge=Oc({forms:Bt,persistence:o,userContext:()=>e.userContext,messageCount:Ld,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(_,g,C,M)=>{G.info("formSubmit",{formId:_.id,trigger:g,skipped:M}),n.emit("formSubmit",{formId:_.id,values:C,skipped:M}),Q(A=>{let ze=A.find(ue=>ue.formId===_.id&&ue.outcome==="skipped")?.createdAt??Date.now();return[...A.filter(ue=>!(ue.formId===_.id&&ue.outcome==="skipped")),{key:`local:${_.id}:${ze}`,formId:_.id,outcome:M?"skipped":"submitted",createdAt:ze,...M?{}:{values:C}}]});let W=f.value??Ge();f.value||(f.value=W,o.saveConversationId(W),U.primeIdentity(void 0,W)),!M&&_.mirrorToContext&&Cd(A=>({...A,...C})),U.submitForm({formId:_.id,conversationId:W,trigger:g,values:C,skipped:M})}}),Md=Z(()=>ge.activeForm.value);T(()=>{ge.refresh()},[Bt,ge]);let ui=e.pageContext?.area?String(e.pageContext.area):void 0,Od=Z(()=>m.value.length);T(()=>{se&&V&&ge.fire("pre-chat")},[se,V,ge]),T(()=>{V&&!an&&ge.fire("conversation-closed")},[V,an,ge]),T(()=>{se&&V&&ui&&ge.fire("page-area")},[se,V,ui,ge]);let Rr=De(()=>{let _=Bt.list.flatMap(g=>g.triggers).filter(g=>g.kind==="idle").map(g=>Number(g.param));return _.length?Math.min(..._)*1e3:0},[Bt]);T(()=>{if(!Rr||!be)return;let _=setTimeout(()=>ge.fire("idle"),Rr);return()=>clearTimeout(_)},[Rr,be,ge,Od.value]);let pi=$(async(_,g)=>{if(G.info("send",{textLen:_.length,attachments:g.length,streaming:Ae}),Ae)return;n.emit("send",{text:_,attachmentCount:g.length}),hr.length>0&&ln([]);let C=await Jm(U,g,me=>{G.warn("upload failed",{err:me}),n.emit("error",me),e.onError?.(me)});ce.unlock(),ce.play("messageSent");let M=al(_,C);_r(n,e,"user",_);let W=v.value!=="ai-agent",A=Tn();m.value=W?[...m.value,M]:[...m.value,M,A],He.attach(A),await ut(A,{continueExisting:!1}),W||ge.fire("after-messages")},[Ae,U,n,e,hr.length,m,He,ut,ge,v]),Nd=$(()=>{G.info("stop"),n.emit("stop",void 0),Za?.()},[Za,n]),Dd=$(()=>{if(Ae)return;let _=m.value,g=_.at(-1);if(!g||g.role!=="assistant"||g.status!=="error"&&!ct(g))return;let C=Tn();m.value=[..._.slice(0,-1),C],He.attach(C),G.info("retry"),ut(C,{continueExisting:!1})},[Ae,m,He,ut]),$d=$(()=>{ce.toggleMuted();let _=ce.mutedSig.value;G.info("soundToggle",{muted:_}),n.emit("soundToggle",{muted:_})},[ce,n]),mn=$(()=>{if(Zl(e.mode,Re)==="exit-fullscreen"){G.info("close \u2192 exit-fullscreen",{mode:e.mode}),xt("normal"),n.emit("fullscreen",!1);return}G.info("close \u2192 panel closed",{mode:e.mode}),ge.fire("panel-close"),ye(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Re,ge]),Jn=$(()=>{let _=ee()?f.value:void 0;x.value=[...kr.current].some(g=>g!==_)},[x,f]),zt=$(()=>{e.modules.list.some(_=>_.layout==="chat")&&U.listConversations({limit:50}).then(_=>{kr.current=new Set(_.conversations.filter(C=>C.hasUnread).map(C=>C.conversationId)),Jn();let g=_.conversations.find(C=>C.conversationId===f.value);g?.controlState&&Ye(vt(g.controlState))}).catch(_=>G.debug("refreshUnread failed (non-fatal)",{err:_}))},[U,e.modules,Jn,f,Ye]),Qn=$(_=>{kr.current.delete(_),Jn()},[Jn]),mi=$(()=>{if(!ee())return;let _=f.value;_&&(clearTimeout(Sr.current),Sr.current=setTimeout(()=>{Qn(_),U.markRead(_)},Ym))},[U,f,Qn]);T(()=>{xr.current=mi},[mi]);let fi=N(!1);T(()=>{!fe||!se||fi.current||(fi.current=!0,zt())},[fe,se,zt]),T(()=>{if(!fe)return;let _=()=>{document.visibilityState==="visible"&&zt()};return document.addEventListener("visibilitychange",_),()=>document.removeEventListener("visibilitychange",_)},[fe,zt]);let Ar=$(()=>{G.info("open",{mode:e.mode}),ce.unlock(),Ee(!0),ye(!0),o.savePanelOpen(!0),!Je&&!Fe&&Ht(),setTimeout(()=>Ee(!1),Xm),zt(),n.emit("open",void 0),e.onOpen?.()},[n,e,ce,o,Je,Fe,Ht,zt]),Ir=$(()=>{if(!m.value.some(g=>g.role==="user")&&an&&f.value){G.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),m.value.length===0&&Gn(q.current?.messages);return}G.info("clear \u2192 new conversation",{wasStreaming:Ae}),n.emit("clear",void 0),Ae&&qn?.(),Yt(()=>{m.value=[],f.value=void 0}),o.clearConversation(),sn(!0),Q([]),un({newConversation:!0})},[Ae,qn,m,f,o,un,n,an,Gn]),Lr=$(()=>{Ir(),gr("chat");let _=e.modules.list.find(g=>g.layout==="chat")?.id;_&&X.switchTab(_)},[Ir,X,e]),Mr=$(()=>{let _=Re==="expanded"?"normal":"expanded";G.info("expand",{from:Re,expanded:_==="expanded"}),xt(_),o.savePanelSize(_),n.emit("expand",_==="expanded")},[n,Re,o]),Or=$(()=>{let _=Re==="fullscreen"?"normal":"fullscreen";G.info("fullscreen",{from:Re,fullscreen:_==="fullscreen"}),xt(_),o.savePanelSize(_),n.emit("fullscreen",_==="fullscreen")},[n,Re,o]),Fd=$(()=>{gr(_=>{let g=_==="history"?"chat":"history";return G.info("toggleHistory",{view:g}),n.emit("toggleHistory",{view:g}),g})},[n]),Hd=$(_=>{G.info("localeChange",{locale:_}),c(_),Ze({locale:_}),n.emit("localeChange",_)},[Ze,n]),Bd=$(_=>{G.info("themeChange",{mode:_}),p(_),t.dataset.theme=_,Ze({themeMode:_}),n.emit("themeChange",_)},[t,Ze,n]),zd=$(_=>{G.info("textSizeChange",{size:_}),u(_),t.dataset.textSize=_,Ze({textSize:_}),n.emit("textSizeChange",_)},[t,Ze,n]),Ud=$(()=>{wd(_=>{let g=!_;return G.info("sidebarToggle",{collapsed:g}),o.saveSidebarCollapsed(g),n.emit("sidebarToggle",{collapsed:g}),g})},[o,n]),qd=$(_=>{G.info("resize",_),Ze({widgetSize:_}),n.emit("resize",_)},[Ze,n]),Nr=$(async _=>{G.info("selectConversation",{conversationId:_,wasStreaming:Ae}),n.emit("selectConversation",{conversationId:_}),Ae&&qn?.();try{let[g,C]=await Promise.all([U.loadConversation(_),Kn(_)]),M=fa(g.messages);Yt(()=>{m.value=_n(M,C),f.value=g.conversationId}),Q(C),o.saveConversationId(g.conversationId),U.primeIdentity(a,g.conversationId),g.agent&&Qa(g.agent),sn(g.canContinue),Ye(vt(g.controlState));let W=M.findLast(A=>A.role==="assistant"&&!A.ephemeral);ln(W?.suggestions??g.suggestions??[]),gr("chat"),Er(),await U.markRead(_),Qn(_)}catch(g){n.emit("error",g),e.onError?.(g)}},[U,m,f,n,e,o,Qn,Kn,_n,Ae,qn,a,Er]),Zn=N(null),gi=$(_=>{typeof _=="string"&&(V?ge.fire("manual",_):Zn.current=_)},[V,ge]);T(()=>{!V||!Zn.current||(ge.fire("manual",Zn.current),Zn.current=null)},[V,ge]),T(()=>_s(t,{open:Ar,close:mn,expand:Mr,fullscreen:Or,openForm:gi}),[t,Ar,mn,Mr,Or,gi]);let Be=De(()=>jr(e,s,d,h),[e,s,d,h]);Vn.current=Be.strings;let Wd=De(()=>H.map(_=>{let g=Bt.list.find(C=>C.id===_.formId);return{..._,title:g?.title,form:g}}),[H,Bt]),hi={options:Be,transport:U,feedback:ce,bus:n,persistence:o,composerApiRef:ni,view:vd,canSend:an,isStreaming:Ae,controlMode:v.value,assignedOperatorInitials:b.value,operatorAvailable:w.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Rd,loadingMessages:y,messagesSig:m,agent:bd,suggestions:hr,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:mn,onClear:Ir,onExpand:Mr,onFullscreen:Or,onSoundToggle:$d,onToggleHistory:Fd,onSelectHistoryConversation:Nr,onNewConversation:Lr,onLocaleChange:Hd,onThemeChange:Bd,onTextSizeChange:zd,onWidgetSizeChange:qd,onSend:pi,onStop:Nd,onSuggestion:_=>{let g=_.text??_.label;G.info("suggestion",{text:g,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:g}),e.autoSendSuggestions?pi(g,[]):ni.current?.fill(g)},activeForm:Md.value?.form??null,formMarkers:Wd,onFormSubmit:ge.complete,onFormSkip:ge.skip,onFormFill:_=>ge.fire("manual",_),tool:Id,onRetry:Dd,onMessageFeedback:Ad},Vd=_=>{Nr(_);let g=ne();g&&X.switchTab(g)};if(!se)return null;let fn=Be.modules.list,Dr=_=>{let g=On("close",Be.mode,_);return fn.length===0?r(ad,{strings:Be.strings,onClose:g?mn:void 0}):fn.length===1&&fn[0]?.layout==="chat"?r(Mc,{...hi,panelSize:_}):r(rd,{panelProps:{...hi,panelSize:_,onClose:g?mn:void 0},enabledModules:fn,nav:X,bus:n,hasUnread:x.value,onSelectConversation:Vd,onStartNewConversation:Lr,onSetPanelSize:xt})};if(e.mode==="page"){let _=C=>{Nr(C.conversationId)},g=fn.some(C=>C.layout==="chat");return r("div",{class:`${dr}-anchor`,children:r($c,{site:yd,blocks:xd,transport:U,strings:Be.strings,locale:Be.locale,persistence:o,visitorId:a,showConversations:g,onSelectConversation:_,onNewConversation:Lr,sidebarCollapsed:kd,onToggleSidebarCollapsed:Ud,children:Dr("fullscreen")})})}if(rt){let _=e.mode==="standalone"?"fullscreen":Re;return r("div",{class:`${dr}-anchor`,children:Dr(_)})}let vi=e.mode==="drawer",bi=!(e.mode==="modal")&&!e.launcher.hidden&&(!be||Te),yi=bi&&!Te&&!Je&&!vi?Be.launcher.callout:null;return r("div",{class:`${dr}-anchor`,"data-launcher-size":Be.launcher.size,children:[be||fe?r("div",{class:`${dr}-surface`,hidden:!be,children:Dr(Re)}):null,bi?r(Yl,{onToggle:Ar,launcher:Be.launcher,strings:Be.strings,leaving:Te,edgeTab:vi}):null,yi?r(Jl,{callout:yi,launcherPosition:Be.position,strings:Be.strings,closeLabel:Be.strings.close,onDismiss:Ht}):null]})}function jm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Xm=120,Ym=300;async function Jm(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 Qm=K.scope("error-boundary"),ur=class extends ft{constructor(){super(...arguments);J(this,"state",{crashed:!1})}componentDidCatch(n,o){Qm.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 Zm="1",ef=60,tf=2e3,dd={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 nf(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function of(){return location.origin+location.pathname}function rf(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function _d(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:p,publicKey:h,aiAgentDeploymentId:u,mode:f,themeMode:m}=t.getOptions();if(!p.enabled||nf()||n>=p.sampleRate)return;let x=performance.now();if(x-o>6e4&&(o=x,a=0),++a>ef)return;let v=new URLSearchParams;v.set("v",Zm),v.set("_ev",Gt),v.set("e",c),p.token&&v.set("tk",p.token),h&&v.set("pk",h),u&&v.set("dep",u),v.set("vid",t.getVisitorId());let b=t.getConversationId();b&&v.set("cid",b),v.set("url",of());let w=rf();w&&v.set("ref",w),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),d)for(let[Q,ie]of Object.entries(d))ie!==void 0&&v.set(Q,String(ie));v.set("ts",String(Date.now()));let y=`${p.endpoint}?${v}`;if(y.length>tf)return;let E=new Image(1,1);i.add(E);let H=()=>i.delete(E);E.addEventListener("load",H,{once:!0}),E.addEventListener("error",H,{once:!0}),E.src=y},s=Object.keys(dd).map(c=>e.on(c,d=>l(c,dd[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=pt(l),d=!0,p=()=>{c=pt(s?Xr(l,s):l)},h=()=>{ys(n,Ct(c.mode));let m=a.loadUserPrefs().themeMode;Ps(n,m?{...c,themeMode:m}:c),d&&(vo(n,za(c)),d=!1)},u=()=>{h(),Vt(ho(ur,{onError:i},ho(cd,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&a.rememberStorageVersion(m.config.storageVersion),s=m.config,p(),u())});let f=_d(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:u,setUserOptions:m=>{l=m,p(),u()},patchUserOptions:m=>{l={...l,...m},p(),u()},destroy:()=>f()}}function za(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}=Cn(e,Zt(),t.loadPanelOpen(),t.loadPanelSize());return Ro(e.mode,o,n)}var af=K.scope("hooks"),qa="*",Ua=new Set;function Wa(e,t,n){let o={widgetId:e,event:t,listener:n};return Ua.add(o),()=>{Ua.delete(o)}}function sf(e,t,n){let o=[...Ua];for(let a of o)if(lf(a.widgetId,e.widgetId)&&!(a.event!==qa&&a.event!==t))try{a.listener(e,t,n)}catch(i){af.warn("hook listener threw",{event:t,error:i})}}function ud(e,t){let n=[];for(let o of cf)n.push(t.on(o,a=>{sf(e,o,a)}));return()=>{for(let o of n)o()}}function Va(e){if(Array.isArray(e))for(let t of e){let n=df(t);n&&Wa(n.widgetId,n.event,n.listener)}}function lf(e,t){return e===qa||e===t}var cf=["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 df(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 _t=new Map;function mr(e){e.debug!==void 0&&ro(e.debug);let t=K.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=pt(e),o=n.widgetId,a=_t.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=za(n),l=n.iframe?ks({position:Ct(n.mode)},n.position,i,n.mode,e.target??null):Kt({position:Ct(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new jt,c=gt(o,n.storage,n.aiAgentDeploymentId),d=x=>{s.emit("error",x),p.getOptions().onError?.(x)},p=pr({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});p.render();let h=l.hostElement,u=null,f=x=>{x.debug!==void 0&&ro(x.debug),p.patchUserOptions(x)},m={widgetId:o,open:()=>yn(h,"open"),close:()=>yn(h,"close"),expand:()=>yn(h,"expand"),openForm:x=>yn(h,"openForm",x),on:(x,v)=>s.on(x,v),update:x=>{t.debug("update",{patch:x}),f(x)},setUserContext:x=>{t.debug("setUserContext",{keys:Object.keys(x)}),f({userContext:{...p.getUserOptions().userContext,...x}})},clearUserContext:()=>{t.debug("clearUserContext"),f({userContext:void 0})},setPageContext:x=>{t.debug("setPageContext",{keys:Object.keys(x)}),f({pageContext:{...p.getUserOptions().pageContext,...x}})},clearPageContext:()=>{t.debug("clearPageContext"),f({pageContext:void 0})},setDebug:x=>{ro(x),t.info("debug level set",{level:gn()})},debugLevel:()=>gn(),onLog:x=>hn(x),destroy:()=>{t.info("destroy",{widgetId:o}),u?.(),p.destroy(),s.clear(),Vt(null,l.appRoot),l.destroy(),_t.get(o)===m&&_t.delete(o)}};return u=ud(m,s),_t.set(o,m),m}function fr(e){let t=e.widgetId??"default",n=_t.get(t);return n?(n.update(e),n):mr(e)}function Ga(e){if(e!==void 0){_t.get(e)?.destroy();return}let t=[..._t.values()];for(let n of t)n.destroy()}function ot(e="default"){return _t.get(e)??null}function pd(){return[..._t.values()]}function Ka(e,t,n){return Wa(e,t,n)}var md=Gt;var ja=class extends HTMLElement{constructor(){super(...arguments);J(this,"bus",new jt);J(this,"mountResult",null);J(this,"runtime",null)}static get observedAttributes(){return Yr}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Vt(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=pt(n);this.mountResult||(this.mountResult=Kt({existingHost:this,position:Ct(o.mode)}));let a=gt(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()}},fd=!1;function Xa(){if(fd||typeof customElements>"u")return;let e=P.tagName;customElements.get(e)||customElements.define(e,ja),fd=!0}typeof customElements<"u"&&Xa();var gd=K.scope("iife"),Ya={close:()=>ot()?.close(),destroy:()=>Ga(),expand:()=>ot()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Ka(e,t,n):void 0,init:e=>fr(e),mount:e=>mr(e),on:(e,t)=>ot()?.on(e,t),onLog:e=>hn(e),open:()=>ot()?.open(),setDebug:e=>ot()?.setDebug(e),update:e=>ot()?.update(e)};function hd(e,...t){let n=Ya[e];if(!n){gd.warn("unknown command",{command:e});return}return n(...t)}function _f(){let e=((n,...o)=>hd(n,...o));e.init=fr,e.mount=mr,e.destroy=Ga,e.getInstance=ot,e.getAllInstances=pd,e.version=md,e.hook=Ka,e.debugLevel=()=>gn(),e.onLog=hn;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(Ya)){if(t.has(n))continue;let o=Ya[n];Reflect.set(e,n,(...a)=>o(...a))}return e}function uf(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[a,...i]=o;if(typeof a=="string")try{hd(a,...i)}catch(l){gd.warn("queued command failed",{command:a,error:l})}}}function pf(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)Va([o]);return t(...n)},e}function mf(){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 ff(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[P.global],t=_f();globalThis[P.global]=t,Xa();let n=`${P.global}Hooks`,o=globalThis[n];if(Va(o),globalThis[n]=pf(),uf(e),ot())return;let a=document.currentScript??mf(),i=Jr(a?.dataset);if(!i.publicKey)return;let l=()=>{ot()||fr(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}ff();return Jd(gf);})();
41
+ `).trim(),Y=!H&&e.status!=="error"&&!x.value&&j.length>0,se=D||Y;return r("div",{class:`${Le}-bubble-row`,"data-role":e.role,"data-mid":e.serverMessageId??e.id,"data-testid":we(k.messageBubble,e.id),children:r("div",{class:`${Le}-bubble-col`,children:[r("div",{class:`${Le}-bubble`,children:[Q?r(_m,{label:t.loading}):m.map((ce,L)=>r(im,{part:ce,active:ie,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&(ce.kind!=="tool"||L>y.value),superseded:s,tool:c},cm(ce))),ne&&r(dm,{}),e.status==="error"&&e.errorText||x.value?r("div",{class:`${Le}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Le}-error-retry`,onClick:d,"data-testid":k.messageRetry,children:t.errorRetry}):null]}):null]}),ee||se||e.role==="operator"?r("div",{class:`${Le}-bubble-meta`,children:[e.role==="operator"&&e.operatorInitials?r("span",{class:`${Le}-bubble-author`,children:e.operatorInitials}):null,ee?r("time",{class:`${Le}-bubble-time`,dateTime:ee.iso,title:ee.full,children:ee.short}):null,se?r("div",{class:`${Le}-bubble-actions`,children:[D&&e.serverMessageId?r(yc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:h}):null,Y?r(rm,{text:j,strings:t}):null]}):null]}):null]})})}function rm({text:e,strings:t}){let[n,o]=R(!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:`${Le}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:a,"data-testid":k.messageCopy,children:n?r(Lt,{}):r(Vl,{})})}function am(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 im({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(er,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(lm,{part:e,active:t,strings:n}):null;case"tool":return r(sm,{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(Pc,{part:e,strings:n}):null}}function sm({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=Z(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(_c(e.toolName))return r(wc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(xc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(Tc,{part:e,strings:t}):null}function lm({part:e,active:t,strings:n}){return r("details",{class:`${Le}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Le}-reasoning-summary`,children:r("span",{class:`${Le}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Le}-reasoning-body`,children:r(er,{textSig:e.textSig,doneSig:e.doneSig})})]})}function cm(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 dm(){return r("span",{class:`${Le}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function _m({label:e}){return r("span",{class:`${Le}-loading`,role:"status",children:[r("span",{class:`${Le}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Le}-loading-label`,children:e})]})}var $t=P.cssPrefix,Ha=120,um=350;function Rc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,enableMessageFeedback:l,onFeedback:s,loading:c,idle:d,controlMode:p,tool:h,onRetry:u,form:f,formMarkers:m,onFillForm:x}){let v=N(null),b=Z(()=>e.value),[w,y]=R(!1),E=N(!1),H=N(!1),Q=N(!1),ie=N(0),ne=()=>Q.current||performance.now()-ie.current<um,ee=N(0),O=S=>{let q=S.scrollHeight-S.clientHeight>1;S.dataset.fadeTop=q&&S.scrollTop>1?"true":"false",S.dataset.fadeBottom=q&&S.scrollHeight-S.scrollTop-S.clientHeight>1?"true":"false"},D=S=>y(S.scrollHeight-S.scrollTop-S.clientHeight>Ha*2),j=S=>{ee.current=performance.now(),S.scrollTop=S.scrollHeight,O(S)},Y=(S,q)=>{j(S);let Ce=q,Te=0,Ee=()=>{j(S),--Ce>0&&(Te=requestAnimationFrame(Ee))};return q>0&&(Te=requestAnimationFrame(Ee)),()=>cancelAnimationFrame(Te)},se=(S,q)=>{let Ce,Te,Ee,Je=-1,Qe=()=>{Ce.disconnect(),Te.disconnect(),clearTimeout(Ee)},Fe=()=>{if(H.current||ne()||Je>=0&&S.scrollTop<Je-4)return Qe();j(S),Je=S.scrollTop};return Ce=new ResizeObserver(Fe),Te=new MutationObserver(Fe),Fe(),Ce.observe(S),Te.observe(S,{childList:!0,subtree:!0,characterData:!0}),Ee=setTimeout(Qe,q),Qe},ce=b.value[0]?.id;Tt(()=>{let S=v.current;if(S&&b.value.length!==0&&(E.current=!0,!!b.value.some(q=>q.role==="user")))return se(S,300)},[ce]);let L=N(0);T(()=>{let S=v.current,q=b.value,Ce=L.current;if(L.current=q.length,!S||!E.current)return;if(q.slice(Ce).some(Ee=>Ee.role==="user"))return H.current=!1,Y(S,3);if(!q.some(Ee=>Ee.role==="user")||H.current||ne())return;S.scrollHeight-S.scrollTop-S.clientHeight<Ha&&j(S)},[b.value.length]);let z=N(null);T(()=>{let S=v.current,q=b.value.at(-1),Ce=z.current;if(z.current=q?.id??null,!!S&&E.current&&!(!q||q.id!==Ce||q.status!=="streaming"))return H.current=!1,Y(S,3)},[b.value]),T(()=>{let S=v.current;if(!S)return;let q=b.value.at(-1);if(!q||q.status!=="streaming"&&!b.value.some(Ee=>Ee.role==="user"))return;let Ce=()=>{if(H.current||ne())return;S.scrollHeight-S.scrollTop-S.clientHeight<Ha*2&&j(S)};if(q.status!=="streaming")return se(S,300);Ce();let Te=new MutationObserver(Ce);return Te.observe(S,{childList:!0,subtree:!0,characterData:!0}),()=>Te.disconnect()},[b.value]);let V=f?.form.id,Se=!!f&&(m??[]).some(S=>S.formId===f.form.id);Tt(()=>{let S=v.current;!S||!V||H.current||b.value.some(q=>q.role==="user")&&(Se?S.querySelector(`[data-testid="${k.formGate}"]`)?.scrollIntoView({block:"nearest"}):j(S))},[V,Se]),T(()=>{let S=v.current;if(!S)return;let q=()=>{D(S),O(S),performance.now()-ee.current>150&&(H.current=S.scrollHeight-S.scrollTop-S.clientHeight>8)},Ce=()=>{H.current=!0},Te=Re=>{Re.deltaY<0&&Ce()},Ee=0,Je=Re=>{Ee=Re.touches[0]?.clientY??0,Q.current=!0},Qe=Re=>{(Re.touches[0]?.clientY??0)>Ee+4&&Ce()},Fe=()=>{Q.current=!1,ie.current=performance.now()},Bt=()=>{Q.current=!0};return S.addEventListener("scroll",q,{passive:!0}),S.addEventListener("wheel",Te,{passive:!0}),S.addEventListener("touchstart",Je,{passive:!0}),S.addEventListener("touchmove",Qe,{passive:!0}),S.addEventListener("touchend",Fe,{passive:!0}),S.addEventListener("touchcancel",Fe,{passive:!0}),S.addEventListener("pointerdown",Bt,{passive:!0}),window.addEventListener("pointerup",Fe,{passive:!0}),window.addEventListener("pointercancel",Fe,{passive:!0}),D(S),()=>{S.removeEventListener("scroll",q),S.removeEventListener("wheel",Te),S.removeEventListener("touchstart",Je),S.removeEventListener("touchmove",Qe),S.removeEventListener("touchend",Fe),S.removeEventListener("touchcancel",Fe),S.removeEventListener("pointerdown",Bt),window.removeEventListener("pointerup",Fe),window.removeEventListener("pointercancel",Fe)}},[]);let rt=()=>{let S=v.current;S&&(H.current=!1,j(S))},$e=[],be="",ye=b.value.at(-1)?.id,fe=[...m??[]].toSorted((S,q)=>(S.createdAt??1/0)-(q.createdAt??1/0)),Ht=S=>f&&S.formId===f.form.id?r(Ta,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip},`gate:${S.formId}`):r(dc,{marker:S,strings:t,onFill:!f&&x?()=>x(S.formId):void 0},S.key),Oe=S=>{for(let q=fe[0];q?.createdAt!==void 0&&!(S!==void 0&&q.createdAt>S);q=fe[0])fe.shift(),$e.push(Ht(q))};for(let S of b.value){if(S.role==="assistant"&&S.id!==ye&&ct(S))continue;Oe(S.createdAt);let q=pm(S.createdAt);q&&q!==be&&($e.push(r("div",{class:`${$t}-date-divider`,children:r("span",{class:`${$t}-date-pill`,title:mm(S.createdAt),children:fm(S.createdAt,t)})},`day:${q}`)),be=q),$e.push(r(Ec,{message:S,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!d&&S.id===ye,controlMode:p,superseded:S.id!==ye,tool:h,onRetry:d&&S.id===ye?u:void 0,enableMessageFeedback:l,onFeedback:s},S.id))}for(let S of fe)$e.push(Ht(S));return r("div",{class:`${$t}-list-wrap`,children:[r("div",{ref:v,class:`${$t}-list ${$t}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&b.value.length===0?r("div",{class:`${$t}-list-loading`,role:"status",children:t.conversationLoading}):null,$e,f&&!Se?r(Ta,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip}):null]}),w?r("button",{type:"button",class:`${$t}-jump`,onClick:rt,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":k.scrollToBottom,children:r(Mt,{})}):null]})}function pm(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function mm(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function fm(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 gm=["today","yesterday","lastWeek","older"];function hm(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((Ac(e)-Ac(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Ic(e,t){let n=new Map;for(let o of t){let a=hm(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return gm.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function Ac(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var vm=K.scope("history"),bm=3,ym=6,Pm={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function xm(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 ir({transport:e,strings:t,locale:n,persistence:o,visitorId:a,onSelect:i,onNewConversation:l}){let s=P.cssPrefix,c=e.peekConversations({visitorId:a}),[d,p]=R(c?"loaded":"loading"),[h,u]=R(c?.conversations??[]);T(()=>{let v=!1;return e.listConversations({visitorId:a}).then(b=>{if(v)return;let w=b.conversations??[];u(w),p("loaded"),o.saveHistoryCount(w.length)}).catch(b=>{v||(vm.warn("listConversations failed",{err:b}),p("error"))}),()=>{v=!0}},[e,a,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":k.sidebarNewConversation,children:[r(vl,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(o.loadHistoryCount()??bm,ym);return r(ae,{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,v)},(b,w)=>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`})})})]})]},w))})]})}),f]})}if(d==="error"||h.length===0)return r(ae,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),x=Ic(m,h);return r(ae,{children:[r("div",{class:`${s}-history`,role:"list",children:x.map(v=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[Pm[v.bucket]]}),r("div",{class:`${s}-history-card`,children:v.conversations.map(b=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(b),"data-closed":b.canContinue?void 0:"true","data-unread":b.hasUnread?"true":void 0,"data-testid":we(k.historyItem,b.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(ba,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:b.title}),r("span",{class:`${s}-history-time`,children:xm(b.lastMessageAt,m,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:b.preview??(b.canContinue?t.historyContinue:t.conversationClosed)}),b.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},b.conversationId))})]},v.bucket))}),f]})}var Lc=P.cssPrefix;function Mc({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${Lc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${Lc}-suggestion`,onClick:()=>t(n),"data-testid":we(k.suggestion,o),children:n.label},n.id))})}var Me=P.cssPrefix;function Oc(e){let{options:t,onClose:n}=e,o=t.strings,a=N(null);T(()=>{let c=a.current;if(!c)return;let d=jo(c),p=h=>{h.key==="Escape"&&n?.()};return c.addEventListener("keydown",p),()=>{d(),c.removeEventListener("keydown",p)}},[n]);let i=e.composerApiRef,l=$(c=>{i.current?.attachFromDrop(c)},[i]),{visible:s}=Jo({containerRef:a,onDrop:l});return Go(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Me}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":k.panel,children:[r(Ba,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(za,{poweredBy:e.options.poweredBy})]})}function Ba(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,controlMode:p,assignedOperatorInitials:h,operatorAvailable:u,operatorRequestEnabled:f,onRequestOperator:m,loadingMessages:x,messagesSig:v,agent:b,suggestions:w,initialWidgetSize:y,visitorId:E,onClose:H,onBack:Q,onClear:ie,onToggleHistory:ne,onSelectHistoryConversation:ee,onNewConversation:O,onWidgetSizeChange:D,onSend:j,onStop:Y,onSuggestion:se,activeForm:ce,formMarkers:L,onFormSubmit:z,onFormSkip:V,onFormFill:Se,tool:rt,onRetry:$e,onMessageFeedback:be,containerEl:ye,dragOver:fe,composerAttachApiRef:Ht}=e,Oe=t.strings,S;return ce?S=null:c?S=r(ae,{children:[p&&p!=="ai-agent"?r(wm,{controlMode:p,operatorInitials:h,operatorAvailable:u,strings:Oe}):null,!d&&p==="ai-agent"&&r(Mc,{suggestions:w,onPick:se}),r(rc,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,operatorRequestEnabled:f,controlMode:p,onRequestOperator:m,onSend:j,onStop:Y,attachApiRef:Ht})]}):S=r(km,{label:Oe.conversationClosed,ctaLabel:Oe.startNewConversation,onNewConversation:ie}),r(ae,{children:[s==="history"?r(Sm,{strings:Oe,onBack:ne,onClose:H,showClose:Ko(t.mode,l,t.actions)}):r("header",{class:`${Me}-header`,"data-testid":k.panelHeader,children:[Q?r("button",{type:"button",class:`${Me}-icon-btn`,onClick:Q,"aria-label":Oe.moduleBack,title:Oe.moduleBack,children:r(Ln,{})}):null,b?r(tc,{agent:b,strings:Oe}):r("h1",{children:Oe.panelTitle}),r(tt,{panelProps:e,variant:"chat"})]}),s==="history"?r(ir,{transport:n,strings:Oe,locale:t.locale,persistence:i,visitorId:E,onSelect:q=>ee(q.conversationId),onNewConversation:O}):r(ae,{children:[r(ac,{visible:fe,strings:Oe}),r(Rc,{messagesSig:v,strings:Oe,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:be,loading:x,idle:!d,controlMode:p,tool:rt,onRetry:$e,form:ce?{form:ce,onSubmit:z,onSkip:V}:null,formMarkers:L,onFillForm:Se}),S,r(Tm,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(Vo,{panelEl:ye,resize:t.size.resize,position:t.position,initialSize:y,onSizeChange:D,strings:Oe}):null]})}function Sm({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Me}-header`,children:[r("button",{type:"button",class:`${Me}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(Ln,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Me}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(et,{})}):null]})}function km({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Me}-readonly-banner`,role:"note",children:[r("span",{class:`${Me}-readonly-label`,children:e}),r("button",{type:"button",class:`${Me}-readonly-cta`,onClick:n,children:t})]})}function wm({controlMode:e,operatorInitials:t,operatorAvailable:n,strings:o}){let a=Cm(e,t,n,o);return r("div",{class:`${Me}-operator-banner`,role:"status","data-mode":e,"data-testid":k.operatorBanner,children:[r("span",{class:`${Me}-operator-pulse`,"aria-hidden":"true"}),r("span",{class:`${Me}-operator-label`,children:a})]})}function Cm(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function Tm({disclaimer:e}){return e?r("div",{class:`${Me}-composer-footer`,children:r("div",{class:`${Me}-disclaimer`,children:e})}):null}function za({poweredBy:e}){return e?r("div",{class:`${Me}-poweredby-bar`,children:r(Em,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function Em({logoUrl:e,text:t,href:n}){let o=r(ae,{children:[e?r("img",{class:`${Me}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Me}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Me}-poweredby`,children:o})}function Nc(e){let t=N(e);t.current=e;let n=N(null);return n.current??(n.current=Rm(t)),n.current}function Rm(e){let t=B(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 p=e.current;if(c==="manual"){let h=p.forms.list.find(u=>u.id===d);h&&(t.value={form:h,trigger:"manual"});return}for(let h of p.forms.byTrigger[c]??[]){let u=h.triggers.find(f=>f.kind===c);if(!(!u||!Am(u,p)||a(h)||!Im(h,p))){t.value={form:h,trigger:c};return}}},l=(c,d)=>{let p=t.value;if(!p)return;t.value=null;let{form:h,trigger:u}=p;h.frequency==="conversation"?n.add(o(h.id)):h.frequency!=="always"&&e.current.persistence.saveFormDone(h.id),e.current.onComplete(h,u,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(p=>p.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function Am(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function Im(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 Dc(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":k.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(Lm,{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":k.sidebarToggle,children:r(Mm,{collapsed:i})})]}),i?null:r(ae,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(Om,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(Nm,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(ir,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function Lm({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 Mm({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 Om({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 Nm({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 $c=P.cssPrefix;function Fc(e){return r("main",{class:`${$c}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(Dc,{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:`${$c}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Hc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Bc(e,t,n){let o=B({activeTab:e,stacks:Hc(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:Hc(t)}}}}var zc=e=>e.stacks[e.activeTab]??[],Uc=e=>zc(e).at(-1),qc=e=>zc(e).length===0;var Wc={Icon:On};var yt=P.cssPrefix;function sr({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 lr({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(Ln,{})}),r("h1",{class:`${yt}-back-title`,children:e}),o??r("span",{class:`${yt}-back-spacer`,"aria-hidden":"true"})]})}var an=P.cssPrefix;function Vc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${an}-home-search`,onClick:t,"data-testid":k.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 Gc({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":k.helpSearch}),r("span",{class:`${an}-home-search-icon`,"aria-hidden":"true",children:r(Pa,{})})]})}var Fn=P.cssPrefix;function cr({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${Fn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${Fn}-list-row-body`,children:[r("span",{class:`${Fn}-list-row-title`,children:e}),t?r("span",{class:`${Fn}-list-row-sub`,children:t}):null]}),r("span",{class:`${Fn}-list-row-chevron`,"aria-hidden":"true",children:r(tn,{})})]})}var Kc=P.cssPrefix;function Xe({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${Kc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${Kc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Ft=P.cssPrefix,Dm=K.scope("help"),$m=(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 Fm(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 jc(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 Hm(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(jc(n,o.title)*2,jc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function Xc({article:e,nav:t}){return r(cr,{title:e.title,subtitle:e.description,onClick:()=>$m(t,e),testid:we(k.helpArticle,e.id)})}function Bm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,p]=R(t.errorGeneric),[h,u]=R([]),[f,m]=R(""),[x,v]=R(0);T(()=>{let y=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(E=>{if(y)return;let H=E.items??[];u(H),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:H.length})}).catch(E=>{y||(Dm.warn("listContent (help) failed",{err:E}),p(It(E,t)),c("error"))}),()=>{y=!0}},[e,l,x,a]);let b=De(()=>Hm(h,f),[h,f]);T(()=>{let y=f.trim();if(!y)return;let E=setTimeout(()=>a.emit("contentSearch",{queryLength:y.length,hitCount:b.length}),600);return()=>clearTimeout(E)},[f,b,a]);function w(){return f.trim().length>0?b.length===0?r(Xe,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${Ft}-help-card`,children:b.map(y=>r(Xc,{article:y,nav:o},y.id))}):s==="loading"?r(Xe,{message:t.helpLoading,strings:t}):s==="error"?r(Xe,{tone:"error",message:d,onRetry:()=>v(y=>y+1),strings:t}):h.length===0?r(Xe,{message:t.helpEmpty,strings:t}):Fm(h).map(([y,E])=>r("section",{class:`${Ft}-help-group`,children:[y?r("h2",{class:`${Ft}-help-section-title`,children:y}):null,r("div",{class:`${Ft}-help-card`,children:E.map(H=>r(Xc,{article:H,nav:o},H.id))})]},y))}return r("div",{class:`${Ft}-module`,children:[r(sr,{title:t.helpTitle,actions:r(tt,{panelProps:i,variant:"plain"})}),r("div",{class:`${Ft}-module-pad`,children:r(Gc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),r("div",{class:`${Ft}-help-list`,children:w()})]})}var Yc={Icon:Mn,Root:e=>r(Bm,{...e})};var Jc=P.cssPrefix;function Ua({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${Jc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${Jc}-home-card`,"data-testid":n,children:t})}var _e=P.cssPrefix,Qc=K.scope("home");function zm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ne(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 Um=(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 qm(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=R(null),[d,p]=R([]),h=o.contentTags?.join(",");T(()=>{if(o.showRecentConversations===!1)return;let b=!1;return t.listConversations({limit:1}).then(w=>!b&&c(w.conversations?.[0]??null)).catch(w=>!b&&Qc.warn("listConversations (home) failed",{err:w})),()=>{b=!0}},[t,o.showRecentConversations]),T(()=>{if(!o.contentTags?.length)return;let b=!1;return t.listContent({tags:o.contentTags,limit:6}).then(w=>{if(b)return;let y=w.items??[];p(y),i.emit("contentView",{section:"home",tags:h,count:y.length})}).catch(w=>!b&&Qc.warn("listContent (home) failed",{err:w})),()=>{b=!0}},[t,h,i]);let u=zm(e),f=o.userAvatars??[],m=o.status,x=m?.text?Ne(n,m.text):n.homeStatus,v=o.contentBlockTitle?Ne(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${_e}-module ${_e}-home`,"data-testid":k.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":k.homeBrand,children:o.brandName}):r("span",{class:`${_e}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${_e}-home-hero-actions`,children:[f.length>0?r("div",{class:`${_e}-home-avatars`,children:f.map(b=>r("span",{class:`${_e}-home-avatar`,title:b.role?`${b.name} \xB7 ${b.role}`:b.name,children:b.avatar?r("img",{src:b.avatar,alt:"",loading:"lazy"}):r("span",{children:Xo(b.name)})},b.name))}):null,r(tt,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(ae,{children:[r("h1",{class:`${_e}-home-greeting`,"data-testid":k.homeGreeting,children:u.title}),u.subtitle?r("p",{class:`${_e}-home-lead`,children:u.subtitle}):null]}):null]}),r("div",{class:`${_e}-home-cards`,children:[o.showSearchBar!==!1?r(Vc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(Ua,{onClick:()=>a.selectConversation(s.conversationId),testid:k.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(On,{})}),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,m?r(Ua,{onClick:m.url?()=>a.push({kind:"iframe",url:m.url,title:x}):void 0,children:r("div",{class:`${_e}-home-status`,"data-level":m.level??"operational",children:[r("span",{class:`${_e}-home-status-icon`,"aria-hidden":"true",children:r(Hl,{})}),r("span",{class:`${_e}-home-status-text`,children:x})]})}):null,d.length>0?r("section",{class:`${_e}-home-content`,children:[r("div",{class:`${_e}-home-content-title`,children:v}),r("div",{class:`${_e}-home-content-list`,children:d.map(b=>r(cr,{title:b.title,subtitle:b.description,onClick:()=>Um(a,b),testid:we(k.homeContentRow,b.id)},b.id))})]}):null]})]})})}var Zc={Icon:Bl,Root:e=>r(qm,{...e})};var Pt=P.cssPrefix,Wm=K.scope("news");function Vm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,p]=R(t.errorGeneric),[h,u]=R([]),[f,m]=R(0);T(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(v)return;let w=b.items??[];u(w),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:w.length})}).catch(b=>{v||(Wm.warn("listContent (news) failed",{err:b}),p(It(b,t)),c("error"))}),()=>{v=!0}},[e,l,f,a]);function x(){return s==="loading"?r(Xe,{message:t.newsLoading,strings:t}):s==="error"?r(Xe,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):h.length===0?r(Xe,{message:t.newsEmpty,strings:t}):r("div",{class:`${Pt}-news-list`,children:h.map(v=>r("button",{type:"button",class:`${Pt}-news-card`,onClick:()=>o.push({kind:"content",id:v.id,title:v.title}),"data-testid":we(k.newsItem,v.id),children:[v.image?r("img",{class:`${Pt}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,r("span",{class:`${Pt}-news-body`,children:[r("span",{class:`${Pt}-news-title`,children:v.title}),v.description?r("span",{class:`${Pt}-news-summary`,children:v.description}):null]})]},v.id))})}return r("div",{class:`${Pt}-module`,children:[r(sr,{title:t.newsTitle,actions:r(tt,{panelProps:i,variant:"plain"})}),r("div",{class:`${Pt}-module-scroll`,children:x()})]})}var ed={Icon:zl,Root:e=>r(Vm,{...e})};var dr={chat:Wc,home:Zc,help:Yc,news:ed};var Hn=P.cssPrefix;function td({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${Hn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=dr[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${Hn}-tab`,onClick:()=>a(i.id),"data-testid":we(k.tab,i.id),children:[r("span",{class:`${Hn}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${Hn}-tab-badge`,"data-testid":k.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${Hn}-tab-label`,children:Ne(n,i.label)})]},i.id)})})}var nd=P.cssPrefix,Gm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function od({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${nd}-module`,children:[r(lr,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${nd}-content-frame`,src:e,title:t||"content",sandbox:Gm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Bn=P.cssPrefix,Km=K.scope("content"),jm=5e3;function rd({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=R(null),[d,p]=R(!1),[h,u]=R(0),f=$(()=>{p(!1),c(null),u(v=>v+1)},[]);T(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(v)return;let w=b.items[0];w?(c(w),a.emit("contentOpen",{contentId:e,tags:w.tags?.length?w.tags.join(","):void 0})):p(!0)}).catch(b=>{v||(Km.warn("listContent (reader) failed",{err:b}),p(!0))}),()=>{v=!0}},[n,e,h,a]),T(()=>{if(!s)return;let v=setTimeout(()=>a.emit("contentRead",{contentId:e}),jm);return()=>clearTimeout(v)},[s,e,a]);let m=$(v=>{let w=v.target?.closest?.("a")?.getAttribute("href")??"";w&&!w.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function x(){return d?r(Xe,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(Xe,{message:o.contentLoading,strings:o}):r("article",{class:`${Bn}-content`,"data-testid":k.contentView,onClick:m,children:[s.image?r("img",{class:`${Bn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Bn}-content-subtitle`,children:s.description}):null,r(bc,{text:s.content??""})]})}return r("div",{class:`${Bn}-module`,children:[r(lr,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:k.backHeader}),r("div",{class:`${Bn}-module-scroll`,"data-testid":k.contentScroll,children:x()})]})}var _r=P.cssPrefix;function ad({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,p=N(null),h=N(new Set);T(()=>{let D=p.current;if(!D)return;let j=jo(D),Y=se=>{se.key==="Escape"&&e.onClose?.()};return D.addEventListener("keydown",Y),()=>{j(),D.removeEventListener("keydown",Y)}},[e.onClose]);let u=e.composerApiRef,f=$(D=>{u.current?.attachFromDrop(D)},[u]),{visible:m}=Jo({containerRef:p,onDrop:f});Go(p.current,c.mode==="modal");let x=Z(()=>n.sig.value).value,v=Uc(x),b=c.modules.byId[x.activeTab],w=v?.kind==="iframe"||v?.kind==="content",y=t.length>1&&(qc(x)||!w),E=N(null);T(()=>{if(w&&E.current===null)E.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!w&&E.current!==null){let D=E.current;E.current=null,s(D)}},[w]);let H={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:D=>{let j=t.find(Y=>Y.layout===D);j&&n.switchTab(j.id)},selectConversation:i,startNewConversation:l},Q=D=>({options:c,transport:e.transport,strings:d,config:D,visitorId:e.visitorId,nav:H,bus:o,panelProps:e}),ie=r(tt,{panelProps:e,variant:"plain"});b&&h.current.add(b.id);let ne=t.filter(D=>h.current.has(D.id)),ee=D=>{if(D.layout==="chat")return r(Ba,{...e,containerEl:p.current,dragOver:m,composerAttachApiRef:u});let j=dr[D.layout].Root;return j?r(j,{...Q(D)}):null},O=()=>v?.kind==="iframe"?r(od,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:ie}):v?.kind==="content"?r(rd,{id:v.id,title:v.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:ie}):null;return r("div",{ref:p,class:`${_r}-panel ${_r}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":k.messengerHome,children:[r("div",{class:`${_r}-messenger-body`,children:[ne.map(D=>r("div",{class:`${_r}-messenger-pane`,hidden:w||D.id!==b?.id,children:ee(D)},D.id)),O()]}),y?r(td,{modules:t,activeTab:x.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(za,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!v)?r(Vo,{panelEl:p.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var zn=P.cssPrefix;function id({strings:e,onClose:t}){return r("div",{class:`${zn}-panel ${zn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":k.modulesEmpty,children:[t?r("button",{type:"button",class:`${zn}-icon-btn ${zn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(et,{})}):null,r("p",{class:`${zn}-modules-empty-text`,children:e.modulesEmpty})]})}function sd({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=R(()=>o?!1:t.loadCalloutDismissed(n));T(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=$(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}var G=K.scope("app"),ur=P.cssPrefix;function ld(e,t){return sl({...e,text:Ne(t,e.text)})}function Xm(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 cd(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function dd({options:e,hostElement:t,bus:n}){let[o]=R(()=>gt(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=R(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=R(()=>l.locale??e.locale),[d,p]=R(()=>l.themeMode??e.themeMode),[h,u]=R(()=>l.textSize??e.textSize),f=ht(o.loadConversationId()),m=ht([]),x=ht(!1),v=ht("ai-agent"),b=ht(void 0),w=ht(void 0),[y,E]=R(!1),[H,Q]=R([]);function ie(){let _=e.modules.list,g=new Set(_.map(M=>M.id)),C=o.loadActiveModule();return C&&g.has(C)?C:_[0]?.id??""}function ne(){return e.modules.list.find(_=>_.layout==="chat")?.id}function ee(){let _=ne();return _?e.modules.list.length===1?!0:j.sig.value.activeTab===_:!1}let O=N(ee);O.current=ee;let D=N();if(!D.current){let _=e.modules.list.map(g=>g.id);D.current=Bc(ie(),_,g=>o.saveActiveModule(g))}let j=D.current,Y=N(void 0);Y.current=ne();let[se,ce]=R(!1),[L,z]=R(null),[V,Se]=R(!1),rt=e.mode==="standalone"||e.mode==="inline",$e=N(En(e,en(),o.loadPanelOpen(),o.loadPanelSize())),[be,ye]=R($e.current.panelOpen),[fe,Ht]=R($e.current.panelOpen),Oe=N(fe);Oe.current=fe;let S=N(!1),q=N(void 0);T(()=>{be&&Ht(!0)},[be]);let Ce=N(!1),[Te,Ee]=R(!1),{dismissed:Je,dismissCallout:Qe}=sd({callout:e.launcher.callout,persistence:o}),Fe=e.launcher.callout?.persistent??!0,Bt=$(()=>{G.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Qe()},[n,Qe]),[Re,xt]=R($e.current.panelSize),Za=N(!1),[bd,hr]=R("chat"),[ln,cn]=R(!0),[Ae,Un]=R(!1),[yd,ei]=R(null),[vr,dn]=R([]),[ti,qn]=R(null),[Wn,Vn]=R(null),Gn=N(e.strings),br=N(e);br.current=e;let[Pd,xd]=R(void 0),[Sd,kd]=R(void 0),[wd,Cd]=R(()=>o.loadSidebarCollapsed()??!1),[yr,Td]=R({}),[U]=R(()=>new Do({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Xs({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[He]=R(()=>new Fo(m)),[le]=R(()=>new zo(e.sound,e.haptics)),Ze=$(_=>{o.patchUserPrefs(_),U.saveUserPrefs(o.loadUserPrefs()).catch(g=>{G.warn("saveUserPrefs failed",{err:g})})},[o,U]);T(()=>{l.soundMuted!==void 0&&le.setMuted(l.soundMuted)},[]),T(()=>{t.dataset.theme=d},[t,d,e]),T(()=>{t.dataset.textSize=h},[t,h,e]),T(()=>{le.update(e.sound,e.haptics)},[le,e.sound,e.haptics]),T(()=>()=>le.destroy(),[le]),T(()=>{let _=!0;return le.mutedSig.subscribe(g=>{if(_){_=!1;return}Ze({soundMuted:g})})},[le,Ze]),T(()=>{Za.current||!e.size.initialSize||(Za.current=!0,!o.loadPanelSize()&&xt(pa(e.mode,e.size,en())))},[e.mode,e.size,o]),T(()=>{if(!se||Ce.current)return;Ce.current=!0;let _=En(e,en(),o.loadPanelOpen(),o.loadPanelSize());ye(_.panelOpen),xt(_.panelSize)},[se,e,o]);let ni=N(!1),oi=N(!1),_n=N(null),Pr=N(null),xr=N(!1),ri=N(null),Sr=N(null),kr=N();T(()=>()=>clearTimeout(kr.current),[]);let wr=N(new Set);T(()=>{if(!(!se||ni.current)){if(ni.current=!0,oi.current){let _=Y.current;_&&j.switchTab(_);return}j.reset(ie())}},[se]);let Kn=$(_=>{!_||_.length===0||(m.value=_.map(g=>ld(g,Gn.current)))},[m]),Cr=N(null),jn=$(async _=>{try{let{formSubmissions:g}=await(_?U.bootstrap(_):Cr.current??U.bootstrap()),C=new Map;return g.forEach((M,W)=>C.set(M.formId,W)),g.filter((M,W)=>!M.skipped||C.get(M.formId)===W).map((M,W)=>({key:`wire:${M.formId}:${M.createdAt??W}`,formId:M.formId,outcome:M.skipped?"skipped":"submitted",createdAt:Lo(M.createdAt),values:M.values}))}catch(g){return G.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:g}),[]}},[U]),un=N(0),pn=$((_,g)=>{let C=[..._.map(A=>A.createdAt),...g.map(A=>A.createdAt)].filter(A=>A!==void 0),M=(C.length?Math.min(...C):Date.now())-1;return[...(q.current?.messages??[]).map(A=>{let pe=ld(A,Gn.current);return pe.createdAt=M,pe}),..._]},[]),Tr=$(async _=>{let g=un.current,C=()=>g!==un.current;E(!0);try{let[M,W]=await Promise.all([U.loadConversation(_),jn()]);if(C())return;let A=ga(M.messages??[]);Q(W);let pe=_n.current?[_n.current]:[];if(A.length||pe.length){m.value=[...pn(A,W),...pe],cn(M.canContinue??!0),Ye(vt(M.controlState));let me=A.findLast(We=>We.role==="assistant"&&!We.ephemeral);dn(me?.suggestions??M.suggestions??[])}else m.value=pn([],W);U.resumeStatus==="needs-generation"&&Pr.current?.()}catch(M){if(C())return;G.warn("loadThread failed; resetting conversationId",{err:M,conversationId:_}),f.value=void 0,o.saveConversationId(void 0)}finally{C()||E(!1)}},[U,jn,m,f,o,pn]),mn=$(async({newConversation:_})=>{let g=++un.current,C=()=>g!==un.current,M=f.value,W=_||!M?Ge():M;W!==M&&(f.value=W,o.saveConversationId(W));let A;try{A=await U.handshake({visitorId:a,conversationId:W,userPrefs:o.loadUserPrefs(),locale:s})}catch(me){if(C())return;n.emit("error",me),e.onError?.(me),_||ce(!0);return}if(C())return;if(A.visitorId&&A.visitorId!==a&&(G.info("visitor rebound",{previous:a,current:A.visitorId,reason:A.rebind?.visitorId}),o.setVisitorId(A.visitorId),i(A.visitorId),n.emit("visitorRebound",{previous:a,current:A.visitorId,reason:A.rebind?.visitorId})),A.conversationId&&A.conversationId!==W&&(G.info("conversation rebound",{previous:W,current:A.conversationId,reason:A.rebind?.conversationId}),n.emit("conversationRebound",{previous:W,current:A.conversationId,reason:A.rebind?.conversationId})),A.agent&&ei(A.agent),Ye(vt(A.controlState)),e.mode==="page"&&(A.site&&Ks(A.site)?xd(A.site):A.site&&G.warn("invalid site config, using fallback",{site:A.site}),A.blocks&&js(A.blocks)?kd(A.blocks):A.blocks&&G.warn("invalid blocks config, using fallback",{blocks:A.blocks})),A.userPrefs&&!_&&(o.saveUserPrefs(A.userPrefs),A.userPrefs.locale&&c(A.userPrefs.locale),A.userPrefs.soundMuted!==void 0&&le.setMuted(A.userPrefs.soundMuted),A.userPrefs.themeMode&&p(A.userPrefs.themeMode),A.userPrefs.textSize&&u(A.userPrefs.textSize)),q.current=A.welcome,_||n.emit("handshake",A),A.welcome?.suggestions){let me=Gn.current;dn(A.welcome.suggestions.map(We=>({...We,label:Ne(me,We.label),...We.text===void 0?{}:{text:Ne(me,We.text)}})))}!_&&M&&A.conversationId===M?Oe.current?Tr(M):S.current=!0:(f.value=A.conversationId,o.saveConversationId(A.conversationId),Kn(A.welcome?.messages)),_||ce(!0)},[U,a,o,e,n,f,le,Kn,Tr,s]),fn=JSON.stringify(e.userContext??null),Ed=JSON.stringify(e.pageContext??null),Rd=JSON.stringify(yr);T(()=>{let _=Object.keys(yr).length?{...yr,...e.userContext}:e.userContext;U.setContext(_,Ym(e.pageContext))},[U,fn,Ed,Rd]);let qe=Wt(s,e.availableLocales,e.defaultLocale);T(()=>{U.setLocale(qe)},[U,qe]),T(()=>{t.dir=wi(qe)?"rtl":"ltr"},[t,qe]),T(()=>{qe!==s&&c(qe)},[qe,s]);let ai=$((_,g=[])=>dn(_.suggestions??g),[]),Xn=$(_=>{if(_.type!=="data-conversation-rebind")return!1;let g=_.data?.conversationId;if(g&&g!==f.value){let C=f.value;f.value=g,o.saveConversationId(g),U.primeIdentity(void 0,g),G.info("conversation rebound (in-stream)",{previous:C,current:g}),C&&n.emit("conversationRebound",{previous:C,current:g,reason:g})}return!0},[f,o,U,n]),Ye=$(_=>{v.value=_.controlMode,b.value=_.assignedOperatorInitials,_.operatorAvailable!==void 0&&(w.value=_.operatorAvailable)},[v,b,w]),ii=$(_=>{_.type==="data-control-state"&&Ye(vt(_.data))},[Ye]),Ad=$(async()=>{if(v.value!=="ai-agent")return;let _=await U.requestOperator();Ye(vt(_))},[U,v,Ye]),si=$(async _=>{let g=null;try{for await(let C of _.iter)if(!Xn(C.chunk)){if(ii(C.chunk),!g){g=Rn(),_n.current=g,He.attach(g),m.value=[...m.value,g],Un(!0),qn(()=>_.cancel),Vn(()=>_.detach),oi.current=!0;let M=Y.current;M&&j.switchTab(M),G.info("resumed in-flight reply on mount")}He.apply(C.chunk),C.chunk.type==="finish"&&C.chunk.canContinue===!1&&cn(!1)}if(g)switch(ha(g,g.status==="error")){case"drop":m.value=m.value.filter(C=>C!==g);break;case"complete-paused":g.status="complete",le.play("messageReceived"),sn(n,e,"assistant",Rt(g));break;case"error":g.status="error",g.errorText=e.strings.errorGeneric,le.play("error");break;case"complete":g.status="complete",le.play("messageReceived"),sn(n,e,"assistant",Rt(g)),ai(g);break}}catch(C){g&&(cd(C)?$o(g)?m.value=m.value.filter(M=>M!==g):g.status="complete":(g.status="error",g.errorText=It(C,e.strings),le.play("error"))),G.debug("resume ended without completing",{err:C})}finally{_n.current=null,g&&(He.detach(),Un(!1),qn(null),Vn(null),m.value=[...m.value],Sr.current?.())}},[He,m,le,n,e,j,Xn]),Er=N(null),Rr=$(async()=>{if(v.value!=="ai-agent")return;let _=U.resumeStream();Er.current=_,await si(_),U.resumeStatus==="needs-generation"&&Pr.current?.()},[U,si,v]);T(()=>{let _=f.value;return _&&U.primeIdentity(a,_),mn({newConversation:!1}),()=>{un.current++,Er.current?.cancel()}},[]),T(()=>{fe&&(Cr.current=U.bootstrap(),(async()=>{try{let _=await Cr.current;z(yn((_??{forms:[]}).forms,qe))}catch(_){G.debug("bootstrap failed \u2014 treating as no forms",{err:_})}finally{Se(!0)}})(),(async()=>{let _=[];if(S.current){S.current=!1;let g=f.value;g&&_.push(Tr(g))}f.value&&_.push(Rr()),_.length!==0&&await Promise.allSettled(_)})())},[fe]);let Yn=N(null);T(()=>{if(!fe)return;if(Yn.current===null){Yn.current=qe;return}if(Yn.current===qe)return;Yn.current=qe;let _=!1;return U.bootstrap().then(g=>{_||z(yn((g??{forms:[]}).forms,qe))}).catch(g=>G.debug("forms re-localize failed \u2014 keeping current copy",{err:g})),()=>{_=!0}},[fe,qe,U]);let li=N(fn);T(()=>{!se||li.current===fn||(li.current=fn,mn({newConversation:!1}))},[fn,se,mn]);let ci=v.value!=="ai-agent";T(()=>{if(!fe||!se||!br.current.features.operatorRequest||!ci)return;let _=f.value;if(!_)return;Er.current?.cancel();let g=!1,C=U.resumeChannel();return G.debug("operator-control resume-channel opened",{conversationId:_}),(async()=>{try{for await(let{chunk:M}of C.iter){if(g)break;if(M.type==="data-control-state")Ye(vt(M.data));else if(M.type==="data-message"){let W=fa(M.data),{list:A,appended:pe}=ll(m.value,W);m.value=A,pe&&(sn(n,br.current,"operator",Rt(W)),!document.hidden&&O.current()&&U.markRead(_).catch(()=>{}))}}}catch(M){g||G.debug("operator-control resume-channel ended",{err:M})}})(),()=>{g=!0,C.stop(),G.debug("operator-control resume-channel closed",{conversationId:_})}},[fe,se,ci,f,U,Ye,m,n]),Tt(()=>{bo(t,Ao(e.mode,Re,be))},[t,be,Re,e.mode]),T(()=>{if(e.mode!=="modal"||!be)return;let _=g=>{g.composedPath().some(W=>W instanceof HTMLElement&&W.classList.contains(`${P.cssPrefix}-panel`))||ye(!1)};return t.addEventListener("click",_),()=>t.removeEventListener("click",_)},[t,be,e.mode]),T(()=>{if(e.mode!=="drawer"||!be)return;let _=g=>{g.key==="Escape"&&ye(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[be,e.mode]);let ut=$(async(_,{continueExisting:g})=>{let C=f.value??Ge();f.value||(f.value=C,o.saveConversationId(C));let M=(g?m.value:m.value.slice(0,-1)).filter(pe=>!pe.ephemeral),W=tl({messages:M.map(cl),conversationId:C,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});Un(!0);let A=U.sendMessage(W);qn(()=>A.cancel),Vn(()=>A.detach);try{for await(let me of A.iter)Xn(me.chunk)||(ii(me.chunk),He.apply(me.chunk),me.chunk.type==="finish"&&me.chunk.canContinue===!1&&cn(!1));let pe=_.status==="error";switch(ha(_,pe)){case"drop":m.value=m.value.filter(me=>me!==_);break;case"complete-paused":_.status="complete",le.play("messageReceived"),sn(n,e,"assistant",Rt(_));break;case"error":{_.status="error",_.errorText=e.strings.errorGeneric,le.play("error");let me=new Error(pe?"stream error chunk":"empty reply");n.emit("error",me),e.onError?.(me);break}case"complete":_.status="complete",le.play("messageReceived"),sn(n,e,"assistant",Rt(_)),ai(_);break}}catch(pe){cd(pe)?$o(_)?m.value=m.value.filter(me=>me!==_):_.status="complete":(_.status="error",_.errorText=It(pe,e.strings),le.play("error"),n.emit("error",pe),e.onError?.(pe))}finally{He.detach(),Un(!1),qn(null),Vn(null),m.value=[...m.value],Sr.current?.()}},[U,He,m,f,e,n,le,o,a,Xn]),di=$(()=>{if(Ae||xr.current||_n.current||m.value.findLast(C=>!C.ephemeral)?.role!=="user")return;xr.current=!0,G.info("regenerating dangling user turn (needs-generation)");let g=Rn();m.value=[...m.value,g],He.attach(g),ut(g,{continueExisting:!1}).finally(()=>{xr.current=!1})},[Ae,m,He,ut]);T(()=>{Pr.current=di},[di]);let Jn=$((_,g)=>{if(Ae)return;let C=m.value.at(-1),M=C?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===_);if(!C||!M){G.warn("decideTool: tool part not found",{toolCallId:_});return}g(M),C.partsSig.value=[...C.partsSig.value],Xm(C)&&(C.status="streaming",m.value=[...m.value],He.attach(C),ut(C,{continueExisting:!0}))},[Ae,m,He,ut]),_i=$((_,g)=>{G.info("toolResult",{toolCallId:_}),n.emit("toolResult",{toolCallId:_}),Jn(_,C=>{C.outputSig.value=g,C.stateSig.value="output-available"})},[n,Jn]),ui=$((_,g,C)=>{G.info("toolDecision",{toolCallId:_,approved:g}),n.emit("toolDecision",{toolCallId:_,approved:g}),Jn(_,M=>{let W=M.approvalSig.value?.id??_;M.approvalSig.value={id:W,approved:g,reason:C},M.stateSig.value="approval-responded"})},[n,Jn]),pi=$(_=>{if(Ae)return;let g=m.value.at(-1),C=g?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===_);if(!g||!C)return;let M=C.approvalSig.value?.id??_;C.approvalSig.value={id:M},C.stateSig.value="approval-requested",g.partsSig.value=[...g.partsSig.value]},[Ae,m]),Id=$((_,g)=>{G.info("messageFeedback",{messageId:_,value:g}),n.emit("messageFeedback",{messageId:_,value:g}),U.submitFeedback({messageId:_,value:g})},[n,U]),Ld=De(()=>({humanInLoop:e.features.humanInLoop,onResult:_i,onDecision:ui,onEdit:pi}),[e.features.humanInLoop,_i,ui,pi]),Md=()=>m.value.reduce((_,g)=>_+(g.role==="user"?1:0),0),zt=e.forms.list.length>0?e.forms:L??e.forms,ge=Nc({forms:zt,persistence:o,userContext:()=>e.userContext,messageCount:Md,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(_,g,C,M)=>{G.info("formSubmit",{formId:_.id,trigger:g,skipped:M}),n.emit("formSubmit",{formId:_.id,values:C,skipped:M}),Q(A=>{let me=A.find(We=>We.formId===_.id&&We.outcome==="skipped")?.createdAt??Date.now();return[...A.filter(We=>!(We.formId===_.id&&We.outcome==="skipped")),{key:`local:${_.id}:${me}`,formId:_.id,outcome:M?"skipped":"submitted",createdAt:me,...M?{}:{values:C}}]});let W=f.value??Ge();f.value||(f.value=W,o.saveConversationId(W),U.primeIdentity(void 0,W)),!M&&_.mirrorToContext&&Td(A=>({...A,...C})),U.submitForm({formId:_.id,conversationId:W,trigger:g,values:C,skipped:M})}}),Od=Z(()=>ge.activeForm.value);T(()=>{ge.refresh()},[zt,ge]);let mi=e.pageContext?.area?String(e.pageContext.area):void 0,Nd=Z(()=>m.value.length);T(()=>{se&&V&&ge.fire("pre-chat")},[se,V,ge]),T(()=>{V&&!ln&&ge.fire("conversation-closed")},[V,ln,ge]),T(()=>{se&&V&&mi&&ge.fire("page-area")},[se,V,mi,ge]);let Ar=De(()=>{let _=zt.list.flatMap(g=>g.triggers).filter(g=>g.kind==="idle").map(g=>Number(g.param));return _.length?Math.min(..._)*1e3:0},[zt]);T(()=>{if(!Ar||!be)return;let _=setTimeout(()=>ge.fire("idle"),Ar);return()=>clearTimeout(_)},[Ar,be,ge,Nd.value]);let fi=$(async(_,g)=>{if(G.info("send",{textLen:_.length,attachments:g.length,streaming:Ae}),Ae)return;n.emit("send",{text:_,attachmentCount:g.length}),vr.length>0&&dn([]);let C=await Zm(U,g,pe=>{G.warn("upload failed",{err:pe}),n.emit("error",pe),e.onError?.(pe)});le.unlock(),le.play("messageSent");let M=il(_,C);sn(n,e,"user",_);let W=v.value!=="ai-agent",A=Rn();m.value=W?[...m.value,M]:[...m.value,M,A],He.attach(A),await ut(A,{continueExisting:!1}),W||ge.fire("after-messages")},[Ae,U,n,e,vr.length,m,He,ut,ge,v]),Dd=$(()=>{G.info("stop"),n.emit("stop",void 0),ti?.()},[ti,n]),$d=$(()=>{if(Ae)return;let _=m.value,g=_.at(-1);if(!g||g.role!=="assistant"||g.status!=="error"&&!ct(g))return;let C=Rn();m.value=[..._.slice(0,-1),C],He.attach(C),G.info("retry"),ut(C,{continueExisting:!1})},[Ae,m,He,ut]),Fd=$(()=>{le.toggleMuted();let _=le.mutedSig.value;G.info("soundToggle",{muted:_}),n.emit("soundToggle",{muted:_})},[le,n]),gn=$(()=>{if(ec(e.mode,Re)==="exit-fullscreen"){G.info("close \u2192 exit-fullscreen",{mode:e.mode}),xt("normal"),n.emit("fullscreen",!1);return}G.info("close \u2192 panel closed",{mode:e.mode}),ge.fire("panel-close"),ye(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Re,ge]),Qn=$(()=>{let _=ee()?f.value:void 0;x.value=[...wr.current].some(g=>g!==_)},[x,f]),Ut=$(()=>{e.modules.list.some(_=>_.layout==="chat")&&U.listConversations({limit:50}).then(_=>{wr.current=new Set(_.conversations.filter(C=>C.hasUnread).map(C=>C.conversationId)),Qn();let g=_.conversations.find(C=>C.conversationId===f.value);g?.controlState&&Ye(vt(g.controlState))}).catch(_=>G.debug("refreshUnread failed (non-fatal)",{err:_}))},[U,e.modules,Qn,f,Ye]),Zn=$(_=>{wr.current.delete(_),Qn()},[Qn]),gi=$(()=>{if(!ee())return;let _=f.value;_&&(clearTimeout(kr.current),kr.current=setTimeout(()=>{Zn(_),U.markRead(_)},Qm))},[U,f,Zn]);T(()=>{Sr.current=gi},[gi]);let hi=N(!1);T(()=>{!fe||!se||hi.current||(hi.current=!0,Ut())},[fe,se,Ut]),T(()=>{if(!fe)return;let _=()=>{document.visibilityState==="visible"&&Ut()};return document.addEventListener("visibilitychange",_),()=>document.removeEventListener("visibilitychange",_)},[fe,Ut]);let Ir=$(()=>{G.info("open",{mode:e.mode}),le.unlock(),Ee(!0),ye(!0),o.savePanelOpen(!0),!Je&&!Fe&&Bt(),setTimeout(()=>Ee(!1),Jm),Ut(),n.emit("open",void 0),e.onOpen?.()},[n,e,le,o,Je,Fe,Bt,Ut]),Lr=$(()=>{if(!m.value.some(g=>g.role==="user")&&ln&&f.value){G.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),m.value.length===0&&Kn(q.current?.messages);return}G.info("clear \u2192 new conversation",{wasStreaming:Ae}),n.emit("clear",void 0),Ae&&Wn?.(),Jt(()=>{m.value=[],f.value=void 0}),o.clearConversation(),cn(!0),Q([]),mn({newConversation:!0})},[Ae,Wn,m,f,o,mn,n,ln,Kn]),Mr=$(()=>{Lr(),hr("chat");let _=e.modules.list.find(g=>g.layout==="chat")?.id;_&&j.switchTab(_)},[Lr,j,e]),Or=$(()=>{let _=Re==="expanded"?"normal":"expanded";G.info("expand",{from:Re,expanded:_==="expanded"}),xt(_),o.savePanelSize(_),n.emit("expand",_==="expanded")},[n,Re,o]),Nr=$(()=>{let _=Re==="fullscreen"?"normal":"fullscreen";G.info("fullscreen",{from:Re,fullscreen:_==="fullscreen"}),xt(_),o.savePanelSize(_),n.emit("fullscreen",_==="fullscreen")},[n,Re,o]),Hd=$(()=>{hr(_=>{let g=_==="history"?"chat":"history";return G.info("toggleHistory",{view:g}),n.emit("toggleHistory",{view:g}),g})},[n]),Bd=$(_=>{G.info("localeChange",{locale:_}),c(_),Ze({locale:_}),n.emit("localeChange",_)},[Ze,n]),zd=$(_=>{G.info("themeChange",{mode:_}),p(_),t.dataset.theme=_,Ze({themeMode:_}),n.emit("themeChange",_)},[t,Ze,n]),Ud=$(_=>{G.info("textSizeChange",{size:_}),u(_),t.dataset.textSize=_,Ze({textSize:_}),n.emit("textSizeChange",_)},[t,Ze,n]),qd=$(()=>{Cd(_=>{let g=!_;return G.info("sidebarToggle",{collapsed:g}),o.saveSidebarCollapsed(g),n.emit("sidebarToggle",{collapsed:g}),g})},[o,n]),Wd=$(_=>{G.info("resize",_),Ze({widgetSize:_}),n.emit("resize",_)},[Ze,n]),Dr=$(async _=>{G.info("selectConversation",{conversationId:_,wasStreaming:Ae}),n.emit("selectConversation",{conversationId:_}),Ae&&Wn?.();try{let[g,C]=await Promise.all([U.loadConversation(_),jn(_)]),M=ga(g.messages);Jt(()=>{m.value=pn(M,C),f.value=g.conversationId}),Q(C),o.saveConversationId(g.conversationId),U.primeIdentity(a,g.conversationId),g.agent&&ei(g.agent),cn(g.canContinue),Ye(vt(g.controlState));let W=M.findLast(A=>A.role==="assistant"&&!A.ephemeral);dn(W?.suggestions??g.suggestions??[]),hr("chat"),Rr(),await U.markRead(_),Zn(_)}catch(g){n.emit("error",g),e.onError?.(g)}},[U,m,f,n,e,o,Zn,jn,pn,Ae,Wn,a,Rr]),eo=N(null),vi=$(_=>{typeof _=="string"&&(V?ge.fire("manual",_):eo.current=_)},[V,ge]);T(()=>{!V||!eo.current||(ge.fire("manual",eo.current),eo.current=null)},[V,ge]),T(()=>ps(t,{open:Ir,close:gn,expand:Or,fullscreen:Nr,openForm:vi}),[t,Ir,gn,Or,Nr,vi]);let Be=De(()=>Xr(e,s,d,h),[e,s,d,h]);Gn.current=Be.strings;let Vd=De(()=>H.map(_=>{let g=zt.list.find(C=>C.id===_.formId);return{..._,title:g?.title,form:g}}),[H,zt]),bi={options:Be,transport:U,feedback:le,bus:n,persistence:o,composerApiRef:ri,view:bd,canSend:ln,isStreaming:Ae,controlMode:v.value,assignedOperatorInitials:b.value,operatorAvailable:w.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Ad,loadingMessages:y,messagesSig:m,agent:yd,suggestions:vr,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:gn,onClear:Lr,onExpand:Or,onFullscreen:Nr,onSoundToggle:Fd,onToggleHistory:Hd,onSelectHistoryConversation:Dr,onNewConversation:Mr,onLocaleChange:Bd,onThemeChange:zd,onTextSizeChange:Ud,onWidgetSizeChange:Wd,onSend:fi,onStop:Dd,onSuggestion:_=>{let g=_.text??_.label;G.info("suggestion",{text:g,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:g}),e.autoSendSuggestions?fi(g,[]):ri.current?.fill(g)},activeForm:Od.value?.form??null,formMarkers:Vd,onFormSubmit:ge.complete,onFormSkip:ge.skip,onFormFill:_=>ge.fire("manual",_),tool:Ld,onRetry:$d,onMessageFeedback:Id},Gd=_=>{Dr(_);let g=ne();g&&j.switchTab(g)};if(!se)return null;let hn=Be.modules.list,$r=_=>{let g=Nn("close",Be.mode,_);return hn.length===0?r(id,{strings:Be.strings,onClose:g?gn:void 0}):hn.length===1&&hn[0]?.layout==="chat"?r(Oc,{...bi,panelSize:_}):r(ad,{panelProps:{...bi,panelSize:_,onClose:g?gn:void 0},enabledModules:hn,nav:j,bus:n,hasUnread:x.value,onSelectConversation:Gd,onStartNewConversation:Mr,onSetPanelSize:xt})};if(e.mode==="page"){let _=C=>{Dr(C.conversationId)},g=hn.some(C=>C.layout==="chat");return r("div",{class:`${ur}-anchor`,children:r(Fc,{site:Pd,blocks:Sd,transport:U,strings:Be.strings,locale:Be.locale,persistence:o,visitorId:a,showConversations:g,onSelectConversation:_,onNewConversation:Mr,sidebarCollapsed:wd,onToggleSidebarCollapsed:qd,children:$r("fullscreen")})})}if(rt){let _=e.mode==="standalone"?"fullscreen":Re;return r("div",{class:`${ur}-anchor`,children:$r(_)})}let yi=e.mode==="drawer",Pi=!(e.mode==="modal")&&!e.launcher.hidden&&(!be||Te),xi=Pi&&!Te&&!Je&&!yi?Be.launcher.callout:null;return r("div",{class:`${ur}-anchor`,"data-launcher-size":Be.launcher.size,children:[be||fe?r("div",{class:`${ur}-surface`,hidden:!be,children:$r(Re)}):null,Pi?r(Jl,{onToggle:Ir,launcher:Be.launcher,strings:Be.strings,leaving:Te,edgeTab:yi}):null,xi?r(Ql,{callout:xi,launcherPosition:Be.position,strings:Be.strings,closeLabel:Be.strings.close,onDismiss:Bt}):null]})}function Ym(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Jm=120,Qm=300;async function Zm(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 sn(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var ef=K.scope("error-boundary"),pr=class extends ft{constructor(){super(...arguments);X(this,"state",{crashed:!1})}componentDidCatch(n,o){ef.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 tf="1",nf=60,of=2e3,_d={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 rf(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function af(){return location.origin+location.pathname}function sf(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function ud(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:p,publicKey:h,aiAgentDeploymentId:u,mode:f,themeMode:m}=t.getOptions();if(!p.enabled||rf()||n>=p.sampleRate)return;let x=performance.now();if(x-o>6e4&&(o=x,a=0),++a>nf)return;let v=new URLSearchParams;v.set("v",tf),v.set("_ev",Kt),v.set("e",c),p.token&&v.set("tk",p.token),h&&v.set("pk",h),u&&v.set("dep",u),v.set("vid",t.getVisitorId());let b=t.getConversationId();b&&v.set("cid",b),v.set("url",af());let w=sf();w&&v.set("ref",w),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),d)for(let[Q,ie]of Object.entries(d))ie!==void 0&&v.set(Q,String(ie));v.set("ts",String(Date.now()));let y=`${p.endpoint}?${v}`;if(y.length>of)return;let E=new Image(1,1);i.add(E);let H=()=>i.delete(E);E.addEventListener("load",H,{once:!0}),E.addEventListener("error",H,{once:!0}),E.src=y},s=Object.keys(_d).map(c=>e.on(c,d=>l(c,_d[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function mr(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=pt(l),d=!0,p=()=>{c=pt(s?Yr(l,s):l)},h=()=>{xs(n,Ct(c.mode));let m=a.loadUserPrefs().themeMode;Ss(n,m?{...c,themeMode:m}:c),d&&(bo(n,qa(c)),d=!1)},u=()=>{h(),Gt(vo(pr,{onError:i},vo(dd,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&a.rememberStorageVersion(m.config.storageVersion),s=m.config,p(),u())});let f=ud(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:u,setUserOptions:m=>{l=m,p(),u()},patchUserOptions:m=>{l={...l,...m},p(),u()},destroy:()=>f()}}function qa(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}=En(e,en(),t.loadPanelOpen(),t.loadPanelSize());return Ao(e.mode,o,n)}var lf=K.scope("hooks"),Va="*",Wa=new Set;function Ga(e,t,n){let o={widgetId:e,event:t,listener:n};return Wa.add(o),()=>{Wa.delete(o)}}function cf(e,t,n){let o=[...Wa];for(let a of o)if(df(a.widgetId,e.widgetId)&&!(a.event!==Va&&a.event!==t))try{a.listener(e,t,n)}catch(i){lf.warn("hook listener threw",{event:t,error:i})}}function pd(e,t){let n=[];for(let o of _f)n.push(t.on(o,a=>{cf(e,o,a)}));return()=>{for(let o of n)o()}}function Ka(e){if(Array.isArray(e))for(let t of e){let n=uf(t);n&&Ga(n.widgetId,n.event,n.listener)}}function df(e,t){return e===Va||e===t}var _f=["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 uf(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 _t=new Map;function fr(e){e.debug!==void 0&&ao(e.debug);let t=K.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=pt(e),o=n.widgetId,a=_t.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=qa(n),l=n.iframe?Cs({position:Ct(n.mode)},n.position,i,n.mode,e.target??null):jt({position:Ct(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Xt,c=gt(o,n.storage,n.aiAgentDeploymentId),d=x=>{s.emit("error",x),p.getOptions().onError?.(x)},p=mr({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});p.render();let h=l.hostElement,u=null,f=x=>{x.debug!==void 0&&ao(x.debug),p.patchUserOptions(x)},m={widgetId:o,open:()=>xn(h,"open"),close:()=>xn(h,"close"),expand:()=>xn(h,"expand"),openForm:x=>xn(h,"openForm",x),on:(x,v)=>s.on(x,v),update:x=>{t.debug("update",{patch:x}),f(x)},setUserContext:x=>{t.debug("setUserContext",{keys:Object.keys(x)}),f({userContext:{...p.getUserOptions().userContext,...x}})},clearUserContext:()=>{t.debug("clearUserContext"),f({userContext:void 0})},setPageContext:x=>{t.debug("setPageContext",{keys:Object.keys(x)}),f({pageContext:{...p.getUserOptions().pageContext,...x}})},clearPageContext:()=>{t.debug("clearPageContext"),f({pageContext:void 0})},setDebug:x=>{ao(x),t.info("debug level set",{level:vn()})},debugLevel:()=>vn(),onLog:x=>bn(x),destroy:()=>{t.info("destroy",{widgetId:o}),u?.(),p.destroy(),s.clear(),Gt(null,l.appRoot),l.destroy(),_t.get(o)===m&&_t.delete(o)}};return u=pd(m,s),_t.set(o,m),m}function gr(e){let t=e.widgetId??"default",n=_t.get(t);return n?(n.update(e),n):fr(e)}function ja(e){if(e!==void 0){_t.get(e)?.destroy();return}let t=[..._t.values()];for(let n of t)n.destroy()}function ot(e="default"){return _t.get(e)??null}function md(){return[..._t.values()]}function Xa(e,t,n){return Ga(e,t,n)}var fd=Kt;var Ya=class extends HTMLElement{constructor(){super(...arguments);X(this,"bus",new Xt);X(this,"mountResult",null);X(this,"runtime",null)}static get observedAttributes(){return Jr}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Gt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=lo(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=pt(n);this.mountResult||(this.mountResult=jt({existingHost:this,position:Ct(o.mode)}));let a=gt(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=mr({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()}},gd=!1;function Ja(){if(gd||typeof customElements>"u")return;let e=P.tagName;customElements.get(e)||customElements.define(e,Ya),gd=!0}typeof customElements<"u"&&Ja();var hd=K.scope("iife"),Qa={close:()=>ot()?.close(),destroy:()=>ja(),expand:()=>ot()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Xa(e,t,n):void 0,init:e=>gr(e),mount:e=>fr(e),on:(e,t)=>ot()?.on(e,t),onLog:e=>bn(e),open:()=>ot()?.open(),setDebug:e=>ot()?.setDebug(e),update:e=>ot()?.update(e)};function vd(e,...t){let n=Qa[e];if(!n){hd.warn("unknown command",{command:e});return}return n(...t)}function pf(){let e=((n,...o)=>vd(n,...o));e.init=gr,e.mount=fr,e.destroy=ja,e.getInstance=ot,e.getAllInstances=md,e.version=fd,e.hook=Xa,e.debugLevel=()=>vn(),e.onLog=bn;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(Qa)){if(t.has(n))continue;let o=Qa[n];Reflect.set(e,n,(...a)=>o(...a))}return e}function mf(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[a,...i]=o;if(typeof a=="string")try{vd(a,...i)}catch(l){hd.warn("queued command failed",{command:a,error:l})}}}function ff(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)Ka([o]);return t(...n)},e}function gf(){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 hf(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[P.global],t=pf();globalThis[P.global]=t,Ja();let n=`${P.global}Hooks`,o=globalThis[n];if(Ka(o),globalThis[n]=ff(),mf(e),ot())return;let a=document.currentScript??gf(),i=Qr(a?.dataset);if(!i.publicKey)return;let l=()=>{ot()||gr(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}hf();return Qd(vf);})();
42
42
  //# sourceMappingURL=elements.js.map