@helpai/elements 0.71.0 → 0.71.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/configurator.mjs +1 -1
- package/elements-web-component.esm.js +25 -25
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +28 -28
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +25 -25
- package/elements.esm.js.map +3 -3
- package/elements.js +25 -25
- package/elements.js.map +3 -3
- package/index.mjs +5 -5
- package/package.json +1 -1
- package/schema.json +2 -2
- package/schema.mjs +1 -1
- package/web-component.mjs +5 -5
package/elements.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";var HelpAI=(()=>{var hr=Object.defineProperty;var bu=Object.getOwnPropertyDescriptor;var yu=Object.getOwnPropertyNames;var Pu=Object.prototype.hasOwnProperty;var xu=(e,t,n)=>t in e?hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Su=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of yu(t))!Pu.call(e,r)&&r!==n&&hr(e,r,{get:()=>t[r],enumerable:!(o=bu(t,r))||o.enumerable});return e};var ku=e=>Su(hr({},"__esModule",{value:!0}),e);var K=(e,t,n)=>xu(e,typeof t!="symbol"?t+"":t,n);var pg={};var S={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 ii={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",talkToOperator:"Talk to an operator",connectingOperator:"Connecting you to an operator\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",cancelOperatorRequest:"Keep chatting with the AI",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",reject:"Reject",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},wu={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",talkToOperator:"Parler \xE0 un op\xE9rateur",connectingOperator:"Mise en relation avec un op\xE9rateur\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",cancelOperatorRequest:"Continuer avec l'IA",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",reject:"Refuser",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Cu={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0645\u0648\u0638\u0641",connectingOperator:"\u062C\u0627\u0631\u064A \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0623\u062D\u062F \u0627\u0644\u0645\u0648\u0638\u0641\u064A\u0646\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0631\u062F",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},Tu={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",talkToOperator:"Hablar con un operador",connectingOperator:"Conect\xE1ndote con un operador\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",cancelOperatorRequest:"Seguir con la IA",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",reject:"Rechazar",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Eu={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",talkToOperator:"\u05D3\u05D1\u05E8 \u05E2\u05DD \u05E0\u05E6\u05D9\u05D2",connectingOperator:"\u05DE\u05D7\u05D1\u05E8 \u05D0\u05D5\u05EA\u05DA \u05DC\u05E0\u05E6\u05D9\u05D2\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E2\u05E0\u05D4",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},Ru={en:ii,fr:wu,ar:Cu,es:Tu,he:Eu};function Kn(e,t){let n=si(e),o=Gn(t),r=n==="en"?{}:Ru[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...ii,...r,...l,...i}}function si(e){return(e.split("-")[0]??"en").toLowerCase()}var Au=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function li(e){return Au.has(si(e))}function Ae(e,t){return e[t]??t}function Gn(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 di(e,t){let{translations:n,defaultLocale:o,...r}=e,i=ci(n,t);return i?{...r,title:i.title??r.title,description:i.description??r.description,content:i.content??r.content}:r}function ui(e,t){let{translations:n,defaultLocale:o,...r}=e,i=ci(n,t);if(!i)return r;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=r.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let _=new Map((d.options??[]).map(p=>[p.value,p]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(p=>{let u=_.get(p.value);return u?{...p,label:u.label??p.label,description:u.description??p.description}:p})}});return{...r,title:i.title??r.title,description:i.description??r.description,submitLabel:i.submitLabel??r.submitLabel,fields:s}}var vr=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{}}},jn=new vr;var Pr=["off","error","warn","info","debug","trace"],xr=S.cssPrefix,_i=`${xr}.debug`,Iu=`__${S.global}_DEBUG__`,Mu=`${xr}-debug`,Xn=2,br=null;function Lu(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Mu);if(e!==null){let t=yr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(_i);if(e){let t=yr(e);if(t>=0)return t}}catch{}return Reflect.get(window,Iu)?4:2}function yr(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=Pr.indexOf(e);if(t>=0)return t}return-1}function Yn(e){let t=yr(e);if(!(t<0)){Xn=t;try{window.localStorage?.setItem(_i,Pr[t])}catch{}}}function dn(){return Pr[Xn]}Xn=Lu();function pi(e){let t=`[${xr}:${e}]`,n=(o,r,i)=>(l,s)=>{if(!(Xn<o)&&(s===void 0?console[r](t,l):console[r](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=>pi(`${e}:${o}`)}}var H=pi("core");function un(e){br=e}var vt=H.scope("context"),Ou=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),fi=50,Sr=1024,Nu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function kr(e){return mi(e,"userContext",!0)}function wr(e){return mi(e,"pageContext",!1)}function mi(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){vt.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},r=0;for(let[i,l]of Object.entries(e)){if(Ou.has(i)){vt.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(r>=fi){vt.warn(`${t} truncated at ${fi} keys \u2014 dropped "${i}"`);continue}let s=Du(t,i,l);s!==void 0&&(o[i]=s,r++)}return n&&typeof o.email=="string"&&!Nu.test(o.email)&&(vt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Du(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){vt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Sr?(vt.warn(`truncated ${e}.${t} to ${Sr} chars`),o.slice(0,Sr)):o}vt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Jn={maxBytes:10485760,maxCount:10,accept:"*/*"},gi={voice:"local"},hi={list:[],byTrigger:{}},Cr={enabled:!0,sampleRate:1},Qn={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},$t={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},vi={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"]},Tr={enabled:!0,volume:.3,events:void 0},bi={enabled:!0,events:void 0},yi=[{label:"tabConversations",layout:"chat"}];function dt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},r=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=$u(t.theme),_=n.mode??"floating",p=Fu(r.defaultLocale),u=r.availableLocales??[r.locale??p],m=Ft(r.locale??p,u,p),f=(t.baseUrl??S.defaultBaseUrl).replace(/\/$/,""),h=(t.agentApiBaseUrl??`${f}/api/agent`).replace(/\/$/,""),g=(t.dataApiBaseUrl??`${f}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:f,agentApiBaseUrl:h,dataApiBaseUrl:g,userContext:kr(t.userContext),pageContext:wr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:_,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??gi.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0,tools:t.features?.tools},forms:_n(t.forms,m),endpoints:{upload:t.endpoints?.upload??Qn.upload,transcribe:t.endpoints?.transcribe??Qn.transcribe,submitForm:t.endpoints?.submitForm??Qn.submitForm},attachments:{accept:t.composer?.attachments?.accept??Jn.accept,maxBytes:t.composer?.attachments?.maxBytes??Jn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Jn.maxCount},locale:m,defaultLocale:p,availableLocales:u,startMinimized:o.startMinimized??!0,actions:Bu(_,s.actions),size:n.size??{},launcher:Gu(t.launcher),sound:Hu(i.sound),haptics:zu(i.haptics),strings:Kn(m,r.strings),stringsOverride:r.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:qu(l.poweredBy),composer:Wu(t.composer),modules:Vu(t.modules),tracking:Uu(t.tracking,g),storage:t.storage??jn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function $u(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function Fu(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function Ft(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function Bu(e,t){return t??vi[e]}function Hu(e){return{enabled:e?.enabled??Tr.enabled,volume:e?.volume??Tr.volume,events:e?.events}}function zu(e){return{enabled:e?.enabled??bi.enabled,events:e?.events}}function Uu(e,t){let n=e?.sampleRate??Cr.sampleRate;return{enabled:e?.enabled??Cr.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 qu(e){let n={...{text:`Powered by ${S.displayName}`,href:S.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function Wu(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Vu(e){let t=e===void 0?yi: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 r=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:r}}function _n(e,t){var i;if(!e?.length)return hi;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=ui(l,t),c=(s.fields??[]).filter(_=>!!(_&&_.name&&_.label&&_.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(Ku).filter(_=>_!==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 r={};for(let l of n)for(let s of l.triggers)(r[i=s.kind]??(r[i]=[])).push(l);return{list:n,byTrigger:r}}function Ku(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 Gu(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??$t.variant,size:e?.size??$t.size,label:e?.label??$t.label,icon:e?.icon??$t.icon,hidden:e?.hidden??$t.hidden,callout:t}}function Er(e,t,n,o){let r=Ft(t,e.availableLocales,e.defaultLocale);if(r===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return r!==e.locale&&(i.locale=r,i.strings=Kn(r,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var ju=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Rr(e,t){if(!t)return e;let n={...e};for(let i of ju){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]=Pi(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,r=t.i18n;if(o||r){let i=Pi(r??{},o);r?.availableLocales!==void 0&&(i.availableLocales=r.availableLocales),r?.defaultLocale!==void 0&&(i.defaultLocale=r.defaultLocale);let l=o?.strings,s=r?.strings;(l||s)&&(i.strings=Xu(s,l)),n.i18n=i}return n}function Pi(e,t){if(!t)return e;let n={...e};for(let[o,r]of Object.entries(t))r!==void 0&&(n[o]=r);return n}function Xu(e,t){if(!e)return t;if(!t)return e;let n=Gn(e),o=Gn(t);if(!n&&!o)return{...e,...t};let r={},i=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(i))r[s]={...c};for(let[s,c]of Object.entries(l))r[s]={...r[s],...c};return r}var Yu=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],tt=e=>e!=="false",Si=e=>e.split(",").map(t=>t.trim()).filter(Boolean),ki=[["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]],wi=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",tt]],Ci=[["width","width"],["height","height"]],Ti=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",tt],["show-reasoning","showReasoning",tt],["show-tool-calls","showToolCalls",tt],["show-sources","showSources",tt],["disable-message-feedback","disableMessageFeedback",tt],["auto-send-suggestions","autoSendSuggestions",tt]],Ei=[["locale","locale"]],Ju=new Set(Yu),Qu=e=>Si(e).filter(t=>Ju.has(t)),Ri=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",tt]],Ai=[["features-disable-file-upload","disableFileUpload",tt],["features-voice","voice",e=>e],["features-tools","tools",Si]],Ii=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Mi=[["user-id","id"],["user-email","email"],["user-name","name"]],Li=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Zu=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],e_=[ki,wi,Ci,Ti,Ei,Ri,Ai,Ii,Mi,Li],t_=new Set(["iframe","start-minimized"]),Ar=[...e_.flatMap(e=>e.map(([t])=>t).filter(t=>!t_.has(t))),...Zu];function Zn(e){let t={},n=m=>{let f=e(m);return f===null||f===""?void 0:f};for(let[m,f,h]of ki){let g=n(m);g!==void 0&&(t[f]=h?h(g):g)}let o=bt(n,wi),r=bt(n,Ci);(o||r)&&(t.presentation={...o,...r?{size:r}:{}});let i=bt(n,Ti);i&&(t.behavior=i);let l=bt(n,Ei);l&&(t.i18n=l);let s=o_(e,n);s&&(t.launcher=s);let c=bt(n,Ai);c&&(t.features=c);let d=bt(n,Ii);d&&(t.endpoints=d);let _=xi(n,Mi,"user-context");_&&(t.userContext=_);let p=xi(n,Li,"page-context");p&&(t.pageContext=p);let u=n("actions");return u!==void 0&&(t.header={actions:Qu(u)}),t}function Ir(e){return e?Zn(t=>e[n_(t)]??null):{}}function n_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function bt(e,t){let n={};for(let[o,r,i]of t){let l=e(o);l!==void 0&&(n[r]=i?i(l):l)}return Object.keys(n).length>0?n:null}function xi(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let r={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(r=s)}catch{}let l={...r,...o};return Object.keys(l).length>0?l:null}function o_(e,t){let n=bt(t,Ri)??{},o=e("launcher-label");o!==null&&(n.label=o);let r=t("callout-text");if(r){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:r,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var io,z,Fi,Nr,ut,Oi,Bi,Hi,Mr,to,pn,zi,Dr,Lr,Or,r_,oo={},ro=[],a_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fn=Array.isArray;function nt(e,t){for(var n in t)e[n]=t[n];return e}function $r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ot(e,t,n){var o,r,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?io.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 no(e,l,o,r,null)}function no(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Fi,__i:-1,__u:0};return r==null&&z.vnode!=null&&z.vnode(i),i}function ee(e){return e.children}function Me(e,t){this.props=e,this.context=t}function Bt(e,t){if(t==null)return e.__?Bt(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"?Bt(e):null}function i_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],r=[],i=nt({},t);i.__v=t.__v+1,z.vnode&&z.vnode(i),Fr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Bt(t),!!(32&t.__u),r),i.__v=t.__v,i.__.__k[i.__i]=i,Ki(o,i,r),t.__e=t.__=null,i.__e!=n&&Ui(i)}}function Ui(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}),Ui(e)}function Ni(e){(!e.__d&&(e.__d=!0)&&ut.push(e)&&!ao.__r++||Oi!=z.debounceRendering)&&((Oi=z.debounceRendering)||Bi)(ao)}function ao(){try{for(var e,t=1;ut.length;)ut.length>t&&ut.sort(Hi),e=ut.shift(),t=ut.length,i_(e)}finally{ut.length=ao.__r=0}}function qi(e,t,n,o,r,i,l,s,c,d,_){var p,u,m,f,h,g,y,x=o&&o.__k||ro,v=t.length;for(c=s_(n,t,x,c,v),p=0;p<v;p++)(m=n.__k[p])!=null&&(u=m.__i!=-1&&x[m.__i]||oo,m.__i=p,g=Fr(e,m,u,r,i,l,s,c,d,_),f=m.__e,m.ref&&u.ref!=m.ref&&(u.ref&&Br(u.ref,null,m),_.push(m.ref,m.__c||f,m)),h==null&&f!=null&&(h=f),(y=!!(4&m.__u))||u.__k===m.__k?(c=Wi(m,c,e,y),y&&u.__e&&(u.__e=null)):typeof m.type=="function"&&g!==void 0?c=g:f&&(c=f.nextSibling),m.__u&=-7);return n.__e=h,c}function s_(e,t,n,o,r){var i,l,s,c,d,_=n.length,p=_,u=0;for(e.__k=new Array(r),i=0;i<r;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]=no(null,l,null,null,null):fn(l)?l=e.__k[i]=no(ee,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=no(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=l_(l,n,c,p))!=-1&&(p--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(r>_?u--:r<_&&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(p)for(i=0;i<_;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Bt(s)),ji(s,s));return o}function Wi(e,t,n,o){var r,i;if(typeof e.type=="function"){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Wi(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Bt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function mn(e,t){return t=t||[],e==null||typeof e=="boolean"||(fn(e)?e.some(function(n){mn(n,t)}):t.push(e)),t}function l_(e,t,n,o){var r,i,l,s=e.key,c=e.type,d=t[n],_=d!=null&&(2&d.__u)==0;if(d===null&&s==null||_&&s==d.key&&c==d.type)return n;if(o>(_?1:0)){for(r=n-1,i=n+1;r>=0||i<t.length;)if((d=t[l=r>=0?r--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Di(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||a_.test(t)?n:n+"px"}function eo(e,t,n,o,r){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||Di(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Di(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(zi,"$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]=Dr,e.addEventListener(t,i?Or:Lr,i)):e.removeEventListener(t,i?Or:Lr,i);else{if(r=="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 $i(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[to]==null)t[to]=Dr++;else if(t[to]<n[pn])return;return n(z.event?z.event(t):t)}}}function Fr(e,t,n,o,r,i,l,s,c,d){var _,p,u,m,f,h,g,y,x,v,P,D,V,j,te,oe,L=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(_=z.__b)&&_(t);e:if(typeof L=="function"){p=l.length;try{if(x=t.props,v=L.prototype&&L.prototype.render,P=(_=L.contextType)&&o[_.__c],D=_?P?P.props.value:_.__:o,n.__c?y=(u=t.__c=n.__c).__=u.__E:(v?t.__c=u=new L(x,D):(t.__c=u=new Me(x,D),u.constructor=L,u.render=d_),P&&P.sub(u),u.state||(u.state={}),u.__n=o,m=u.__d=!0,u.__h=[],u._sb=[]),v&&u.__s==null&&(u.__s=u.state),v&&L.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=nt({},u.__s)),nt(u.__s,L.getDerivedStateFromProps(x,u.__s))),f=u.props,h=u.state,u.__v=t,m)v&&L.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),v&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(v&&L.getDerivedStateFromProps==null&&x!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(x,D),t.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(x,u.__s,D)===!1){t.__v!=n.__v&&(u.props=x,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(I){I&&(I.__=t)}),ro.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&l.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(x,u.__s,D),v&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,h,g)})}if(u.context=D,u.props=x,u.__P=e,u.__e=!1,V=z.__r,j=0,v)u.state=u.__s,u.__d=!1,V&&V(t),_=u.render(u.props,u.state,u.context),ro.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,V&&V(t),_=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++j<25);u.state=u.__s,u.getChildContext!=null&&(o=nt(nt({},o),u.getChildContext())),v&&!m&&u.getSnapshotBeforeUpdate!=null&&(g=u.getSnapshotBeforeUpdate(f,h)),te=_!=null&&_.type===ee&&_.key==null?Gi(_.props.children):_,s=qi(e,fn(te)?te:[te],t,n,o,r,i,l,s,c,d),u.base=t.__e,t.__u&=-161,u.__h.length&&l.push(u),y&&(u.__E=u.__=null)}catch(I){if(l.length=p,t.__v=null,c||i!=null){if(I.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i!=null&&(i[i.indexOf(s)]=null),t.__e=s}else if(i!=null)for(oe=i.length;oe--;)$r(i[oe])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),I.then||Vi(t),z.__e(I,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=c_(n.__e,t,n,o,r,i,l,c,d);return(_=z.diffed)&&_(t),128&t.__u?void 0:s}function Vi(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Vi))}function Ki(e,t,n){for(var o=0;o<n.length;o++)Br(n[o],n[++o],n[++o]);z.__c&&z.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(i){i.call(r)})}catch(i){z.__e(i,r.__v)}})}function Gi(e){return typeof e!="object"||e==null||e.__b>0?e:fn(e)?e.map(Gi):e.constructor!==void 0?null:nt({},e)}function c_(e,t,n,o,r,i,l,s,c){var d,_,p,u,m,f,h,g=n.props||oo,y=t.props,x=t.type;if(x=="svg"?r="http://www.w3.org/2000/svg":x=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((m=i[d])&&"setAttribute"in m==!!x&&(x?m.localName==x:m.nodeType==3)){e=m,i[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(y);e=document.createElementNS(r,x,y.is&&y),s&&(z.__m&&z.__m(t,i),s=!1),i=null}if(x==null)g===y||s&&e.data==y||(e.data=y);else{if(i=x=="textarea"&&y.defaultValue!=null?null:i&&io.call(e.childNodes),!s&&i!=null)for(g={},d=0;d<e.attributes.length;d++)g[(m=e.attributes[d]).name]=m.value;for(d in g)m=g[d],d=="dangerouslySetInnerHTML"?p=m:d=="children"||d in y||d=="value"&&"defaultValue"in y||d=="checked"&&"defaultChecked"in y||eo(e,d,null,m,r);for(d in y)m=y[d],d=="children"?u=m:d=="dangerouslySetInnerHTML"?_=m:d=="value"?f=m:d=="checked"?h=m:s&&typeof m!="function"||g[d]===m||eo(e,d,m,g[d],r);if(_)s||p&&(_.__html==p.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(p&&(e.innerHTML=""),qi(t.type=="template"?e.content:e,fn(u)?u:[u],t,n,o,x=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,l,i?i[0]:n.__k&&Bt(n,0),s,c),i!=null)for(d=i.length;d--;)$r(i[d]);s&&x!="textarea"||(d="value",x=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[d]||x=="progress"&&!f||x=="option"&&f!=g[d])&&eo(e,d,f,g[d],r),d="checked",h!=null&&h!=e[d]&&eo(e,d,h,g[d],r))}return e}function Br(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(r){z.__e(r,n)}}function ji(e,t,n){var o,r;if(z.unmount&&z.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Br(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){z.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&ji(o[r],t,n||typeof e.type!="function");n||$r(e.__e),e.__c=e.__=e.__e=void 0}function d_(e,t,n){return this.constructor(e,n)}function yt(e,t,n){var o,r,i,l;t==document&&(t=document.documentElement),z.__&&z.__(e,t),r=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Fr(t,e=(!o&&n||t).__k=ot(ee,null,[e]),r||oo,oo,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?io.call(t.childNodes):null,i,!o&&n?n:r?r.__e:t.firstChild,o,l),Ki(i,e,l),e.props.children=null}io=ro.slice,z={__e:function(e,t,n,o){for(var r,i,l;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),l=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),l=r.__d),l)return r.__E=r}catch(s){e=s}throw e}},Fi=0,Nr=function(e){return e!=null&&e.constructor===void 0},Me.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=nt({},this.state),typeof e=="function"&&(e=e(nt({},n),this.props)),e&&nt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ni(this))},Me.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ni(this))},Me.prototype.render=ee,ut=[],Bi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hi=function(e,t){return e.__v.__b-t.__v.__b},ao.__r=0,Mr=Math.random().toString(8),to="__d"+Mr,pn="__a"+Mr,zi=/(PointerCapture)$|Capture$/i,Dr=0,Lr=$i(!1),Or=$i(!0),r_=0;var Ht="0.71.0";function Xi(e){return`${S.cssPrefix}:${e}`}function gn(e,t,n){e.dispatchEvent(new CustomEvent(Xi(t),{detail:n}))}function Yi(e,t){let o=Object.entries(t).map(([r,i])=>{let l=Xi(r),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[r,i]of o)e.removeEventListener(r,i)}}function Be(){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,u_(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 u_(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 Pt=H.scope("persistence");function _t(e,t=jn,n){let o=n?`${e}.${n}`:e,r=`${S.cssPrefix}.storageVersion`,i=t.get(r)??void 0,l=i?`.v${i}`:"",s=`${S.cssPrefix}.${o}${l}`,c=`${S.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,_=`${s}.userPrefs`,p=`${s}.panelOpen`,u=`${s}.panelSize`,m=`${s}.calloutDismissed`,f=`${s}.sidebarCollapsed`,h=`${s}.activeModule`,g=`${s}.historyCount`,y=`${s}.formsDone`,x={getVisitorId(){let v=t.get(c);if(v)return v;let P=Be();return t.set(c,P),P},setVisitorId(v){Pt.debug("setVisitorId (rebind)",{id:v,scope:o}),t.set(c,v)},loadConversationId(){return t.get(d)??void 0},saveConversationId(v){Pt.trace("saveConversationId",{id:v,scope:o}),v?t.set(d,v):t.remove(d)},loadUserPrefs(){let v=t.get(_);if(!v)return{};try{let P=JSON.parse(v);return Ji(P)?P:{}}catch(P){return Pt.warn("loadUserPrefs parse failed",{error:P}),{}}},saveUserPrefs(v){try{t.set(_,JSON.stringify(v))}catch(P){Pt.warn("saveUserPrefs serialise failed",{error:P})}},patchUserPrefs(v){let P=x.loadUserPrefs();x.saveUserPrefs({...P,...v})},loadPanelOpen(){let v=t.get(p);return v==="1"?!0:v==="0"?!1:null},savePanelOpen(v){t.set(p,v?"1":"0")},loadPanelSize(){let v=t.get(u);return v==="normal"||v==="expanded"||v==="fullscreen"?v:null},savePanelSize(v){t.set(u,v)},loadCalloutDismissed(v){if(!v)return!1;let P=t.get(m);return!!P&&P===v},saveCalloutDismissed(v){v?t.set(m,v):t.remove(m)},loadSidebarCollapsed(){let v=t.get(f);return v==="1"?!0:v==="0"?!1:null},saveSidebarCollapsed(v){t.set(f,v?"1":"0")},loadActiveModule(){return t.get(h)||null},saveActiveModule(v){t.set(h,v)},loadHistoryCount(){let v=t.get(g);if(!v)return null;let P=Number.parseInt(v,10);return Number.isFinite(P)&&P>=0?P:null},saveHistoryCount(v){t.set(g,String(v))},loadFormsDone(){let v=t.get(y);if(!v)return{};try{let P=JSON.parse(v);return Ji(P)?P:{}}catch(P){return Pt.warn("loadFormsDone parse failed",{error:P}),{}}},saveFormDone(v){try{let P=x.loadFormsDone();P[v]=Date.now(),t.set(y,JSON.stringify(P))}catch(P){Pt.warn("saveFormDone serialise failed",{error:P})}},rememberStorageVersion(v){v&&v!==t.get(r)&&(Pt.debug("rememberStorageVersion (force-reset on next load)",{version:v}),t.set(r,v))},clearConversation(){t.remove(d)}};return x}function Ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Qi=`: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
|
|
3
|
-
`;var es=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent-fg);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent-fg);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border:1px solid var(--__P__-border);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{display:flex;align-items:stretch;padding:0;overflow:hidden;background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{display:flex;flex:0 0 auto;align-items:center;padding:0 .875rem;border-inline-end:1px solid color-mix(in oklab,var(--__P__-accent),transparent 60%);color:var(--__P__-accent);font-size:calc(13px * var(--__P__-text-scale));font-weight:600;letter-spacing:.025em;user-select:none}.__P__-bubble-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent-fg);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent-fg)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-operator-banner{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 var(--__P__-space-3) var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg-elevated),var(--__P__-accent) 6%);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);line-height:1.3;text-align:center}.__P__-operator-pulse{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-operator-cancel{flex:0 0 auto;padding:0;border:0;background:none;color:var(--__P__-accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.__P__-operator-cancel:hover{opacity:.8}.__P__-operator-cancel:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-radius:var(--__P__-radius-sm)}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent-fg)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent-fg);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent-fg);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent-fg)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent;user-select:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=completed]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=responded]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=awaiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=denied]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=error]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=superseded]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
|
|
4
|
-
`;var
|
|
5
|
-
`;var
|
|
6
|
-
`;var
|
|
7
|
-
`).replace(/__P__/g,h_).replaceAll("__BRAND_ACCENT_TEXT__",b_).replaceAll("__BRAND_ACCENT__",v_).replaceAll("__BRAND_RADIUS__",y_).replaceAll("__BRAND_FONT__",P_);var x_=H.scope("mount"),os=new WeakMap,rs={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 as(e,t){e.style.cssText=rs[t]}function xt(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function zt(e={}){let t=e.position??"flow";x_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${S.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",S.id),o.style.cssText=rs[t];let r=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!S_(r,i)){let s=i.createElement("style");s.textContent=Hr,r.appendChild(s)}let l=document.createElement("div");return l.className=`${S.cssPrefix}-app`,r.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:r}}function S_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=os.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(Hr),os.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function k_(e,t){let n=S.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 w_(e,t){e.dataset.theme=t}function C_(e,t){let n=S.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 T_(e,t){e.dataset.position=t}function so(e,t){e.dataset.mode=t}function is(e,t){w_(e,t.themeMode),k_(e,t.themeOverrides),T_(e,t.position),C_(e,t.size)}var E_=H.scope("iframe"),R_='<!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",r=null){E_.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!r});let i=document.createElement("iframe");i.title=`${S.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),ls(i,t,n,o),(o==="inline"&&r?r:document.body).appendChild(i);let s=i.contentDocument;if(!s)throw new Error("iframe contentDocument unavailable (cross-origin?)");s.open(),s.write(R_),s.close();let c=zt({...e,target:s.body}),d=new MutationObserver(()=>{ls(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 lo="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",ss={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 ls(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${lo}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${lo}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=`${lo}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}=ss[n]??ss.open;e.style.cssText=`${lo}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var Ut=class{constructor(){K(this,"handlers",new Map)}on(t,n){let o=this.handlers.get(t);return o||(o=new Set,this.handlers.set(t,o)),o.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let o=this.handlers.get(t);if(o)for(let r of o)try{r(n)}catch{}}clear(){this.handlers.clear()}};var qt,me,zr,ds,hn=0,vs=[],ve=z,us=ve.__b,_s=ve.__r,ps=ve.diffed,fs=ve.__c,ms=ve.unmount,gs=ve.__;function uo(e,t){ve.__h&&ve.__h(me,e,hn||t),hn=0;var n=me.__H||(me.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return hn=1,bs(ys,e)}function bs(e,t,n){var o=uo(qt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):ys(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=me,!me.__f)){var r=function(s,c,d){if(!o.__c.__H)return!0;var _=!1,p=o.__c.props!==s;if(o.__c.__H.__.some(function(m){if(m.__N){_=!0;var f=m.__[0];m.__=m.__N,m.__N=void 0,f!==m.__[0]&&(p=!0)}}),i){var u=i.call(this,s,c,d);return _?u||p:u}return!_||p};me.__f=!0;var i=me.shouldComponentUpdate,l=me.componentWillUpdate;me.componentWillUpdate=function(s,c,d){if(this.__e){var _=i;i=void 0,r(s,c,d),i=_}l&&l.call(this,s,c,d)},me.shouldComponentUpdate=r}return o.__N||o.__}function E(e,t){var n=uo(qt++,3);!ve.__s&&qr(n.__H,t)&&(n.__=e,n.u=t,me.__H.__h.push(n))}function pt(e,t){var n=uo(qt++,4);!ve.__s&&qr(n.__H,t)&&(n.__=e,n.u=t,me.__h.push(n))}function $(e){return hn=5,Ee(function(){return{current:e}},[])}function Ee(e,t){var n=uo(qt++,7);return qr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function N(e,t){return hn=8,Ee(function(){return e},t)}function A_(){for(var e;e=vs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(co),t.__h.some(Ur),t.__h=[]}catch(n){t.__h=[],ve.__e(n,e.__v)}}}ve.__b=function(e){me=null,us&&us(e)},ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),gs&&gs(e,t)},ve.__r=function(e){_s&&_s(e),qt=0;var t=(me=e.__c).__H;t&&(zr===me?(t.__h=[],me.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(co),t.__h.some(Ur),t.__h=[],qt=0)),zr=me},ve.diffed=function(e){ps&&ps(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(vs.push(t)!==1&&ds===ve.requestAnimationFrame||((ds=ve.requestAnimationFrame)||I_)(A_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),zr=me=null},ve.__c=function(e,t){t.some(function(n){try{n.__h.some(co),n.__h=n.__h.filter(function(o){return!o.__||Ur(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],ve.__e(o,n.__v)}}),fs&&fs(e,t)},ve.unmount=function(e){ms&&ms(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{co(o)}catch(r){t=r}}),n.__H=void 0,t&&ve.__e(t,n.__v))};var hs=typeof requestAnimationFrame=="function";function I_(e){var t,n=function(){clearTimeout(o),hs&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);hs&&(t=requestAnimationFrame(n))}function co(e){var t=me,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),me=t}function Ur(e){var t=me;e.__c=e.__(),me=t}function qr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function ys(e,t){return typeof t=="function"?t(e):t}var M_=Symbol.for("preact-signals");function mo(){if(rt>1)rt--;else{var e,t=!1;for((function(){var r=po;for(po=void 0;r!==void 0;){var i=r.S;if(i.v===r.v)for(var l=i.t;l!==void 0;l=l.x)l.i===r.i&&(l.i=i.i);r=r.o}})();bn!==void 0;){var n=bn;for(bn=void 0,_o++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&xs(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(_o=0,rt--,t)throw e}}function Wt(e){if(rt>0)return e();Wr=++L_,rt++;try{return e()}finally{mo()}}var vn,ue=void 0;function yn(e){var t=ue,n=vn;ue=void 0,vn=void 0;try{return e()}finally{ue=t,vn=n}}var bn=void 0,rt=0,_o=0,L_=0,Wr=0,po=void 0,fo=0;function Ps(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 xe(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}xe.prototype.brand=M_;xe.prototype.h=function(){return!0};xe.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:yn(function(){var o;(o=t.W)==null||o.call(t)}))};xe.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&&yn(function(){var r;(r=t.Z)==null||r.call(t)}))}};xe.prototype.subscribe=function(e){var t=this;return at(function(){var n=t.value;yn(function(){return e(n)})},{name:"sub"})};xe.prototype.valueOf=function(){return this.value};xe.prototype.toString=function(){return this.value+""};xe.prototype.toJSON=function(){return this.value};xe.prototype.peek=function(){var e=this;return yn(function(){return e.value})};Object.defineProperty(xe.prototype,"value",{get:function(){var e=Ps(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(_o>100)throw new Error("Cycle detected");(function(n){rt!==0&&_o===0&&n.l!==Wr&&(n.l=Wr,po={S:n,v:n.v,i:n.i,o:po})})(this),this.v=e,this.i++,fo++,rt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{mo()}}}});function q(e,t){return new xe(e,t)}function xs(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 Ss(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 ks(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 St(e,t){xe.call(this,void 0,t),this.x=e,this.s=void 0,this.g=fo-1,this.f=4}St.prototype=new xe;St.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===fo))return!0;if(this.g=fo,this.f|=1,this.i>0&&!xs(this))return this.f&=-2,!0;var e=ue;try{Ss(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,ks(this),this.f&=-2,!0};St.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)}xe.prototype.S.call(this,e)};St.prototype.U=function(e){if(this.t!==void 0&&(xe.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)}};St.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(St.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ps(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Pn(e,t){return new St(e,t)}function ws(e){var t=e.m;if(e.m=void 0,typeof t=="function"){rt++;var n=ue;ue=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Vr(e),o}finally{ue=n,mo()}}}function Vr(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ws(e)}function O_(e){if(ue!==this)throw new Error("Out-of-order effect");ks(this),ue=e,this.f&=-2,8&this.f&&Vr(this),mo()}function Vt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,vn&&vn.push(this)}Vt.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()}};Vt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ws(this),Ss(this),rt++;var e=ue;return ue=this,O_.bind(this,e)};Vt.prototype.N=function(){2&this.f||(this.f|=2,this.u=bn,bn=this)};Vt.prototype.d=function(){this.f|=8,1&this.f||Vr(this)};Vt.prototype.dispose=function(){this.d()};function at(e,t){var n=new Vt(e,t);try{n.c()}catch(r){throw n.d(),r}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Cs,vo,go,N_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Ts=[];at(function(){Cs=this.N})();function Kt(e,t){z[e]=t.bind(null,z[e]||function(){})}function ho(e){if(go){var t=go;go=void 0,t()}go=e&&e.S()}function Es(e){var t=this,n=e.data,o=Xe(n);o.value=n;var r=Ee(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=Pn(function(){var m=o.value.value;return m===0?0:m===!0?"":m||""}),_=Pn(function(){return!Array.isArray(d.value)&&!Nr(d.value)}),p=at(function(){if(this.N=Rs,_.value){var m=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=m)}}),u=t.__$u.d;return t.__$u.d=function(){p(),u.call(this)},[_,d]},[]),i=r[0],l=r[1];return i.value?l.peek():l.value}Es.displayName="ReactiveTextNode";Object.defineProperties(xe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Es},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Kt("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var r in o)if(r!=="children"){var i=o[r];i instanceof xe&&(n||(t.__np=n={}),n[r]=i,o[r]=i.peek())}}e(t)});Kt("__r",function(e,t){if(e(t),t.type!==ee){ho();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(r,i){var l;return at(function(){l=this},{name:i}),l.c=r,l})(function(){var r;N_&&((r=n.y)==null||r.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),vo=o,ho(n)}});Kt("__e",function(e,t,n,o){ho(),vo=void 0,e(t,n,o)});Kt("diffed",function(e,t){ho(),vo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,r=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],_=o[c];d===void 0?(d=D_(n,c,_,r),i[c]=d):d.o(_,r)}}}e(t)});function D_(e,t,n,o){var r=t in e&&e.ownerSVGElement===void 0,i=q(n);return{o:function(l,s){i.value=l,o=s},d:at(function(){this.N=Rs;var l=i.value.value;o[t]!==l&&(o[t]=l,r?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Kt("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 r in o){var i=o[r];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 _=d.__$u;_&&(d.__$u=void 0,_.d())}}e(t)});Kt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});Me.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var r 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 Xe(e,t){return Ee(function(){return q(e,t)},[])}function Z(e,t){var n=$(e);return n.current=e,vo.__$f|=4,Ee(function(){return Pn(function(){return n.current()},t)},[])}var $_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function F_(){Wt(function(){for(var e;e=Ts.shift();)Cs.call(e)})}function Rs(){Ts.push(this)===1&&(z.requestAnimationFrame||$_)(F_)}function As(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Is(e){return As(e)}function Ms(e){return!(!As(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function bo(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 B_=900,H_=640;function Kr(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;return o==="expanded"||o==="fullscreen"||o==="normal"?o:n>0&&n<H_?"fullscreen":n>=(t.autoSizeBreakpoint??B_)?"expanded":"normal"}function xn(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:Kr(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Gt(){return typeof window>"u"?0:window.innerWidth}var z_="x-public-key",U_="x-ai-agent-deployment-id";function Ls(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[U_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??z_]=e.publicKey),t}}}function jt(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),r=()=>i();t?.addEventListener("abort",r,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",r),n()}})}var Ye=class extends Error{constructor(n,o,r,i){super(n);K(this,"code",o);K(this,"status",r);K(this,"cause",i);this.name="StreamError"}};var Os=H.scope("parser");async function*Ns(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Ye(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of q_(e,t)){let o=W_(n);if(o==="done")return;o&&(yield o)}}async function*q_(e,t){if(!e.body)throw new Ye("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:r,value:i}=await n.read();if(r){let s=o.trim();s&&(yield s);return}o+=i;let l;for(;(l=o.indexOf(`
|
|
1
|
+
"use strict";var HelpAI=(()=>{var yr=Object.defineProperty;var yu=Object.getOwnPropertyDescriptor;var Pu=Object.getOwnPropertyNames;var xu=Object.prototype.hasOwnProperty;var Su=(e,t,n)=>t in e?yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ku=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Pu(t))!xu.call(e,r)&&r!==n&&yr(e,r,{get:()=>t[r],enumerable:!(o=yu(t,r))||o.enumerable});return e};var wu=e=>ku(yr({},"__esModule",{value:!0}),e);var K=(e,t,n)=>Su(e,typeof t!="symbol"?t+"":t,n);var gg={};var S={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 li={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",talkToOperator:"Talk to an operator",connectingOperator:"Connecting you to an operator\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",cancelOperatorRequest:"Keep chatting with the AI",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",reject:"Reject",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Submitted",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},Cu={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",talkToOperator:"Parler \xE0 un op\xE9rateur",connectingOperator:"Mise en relation avec un op\xE9rateur\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",cancelOperatorRequest:"Continuer avec l'IA",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",reject:"Refuser",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"Envoy\xE9",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Tu={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0645\u0648\u0638\u0641",connectingOperator:"\u062C\u0627\u0631\u064A \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0623\u062D\u062F \u0627\u0644\u0645\u0648\u0638\u0641\u064A\u0646\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644",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"},Eu={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",talkToOperator:"Hablar con un operador",connectingOperator:"Conect\xE1ndote con un operador\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",cancelOperatorRequest:"Seguir con la IA",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",reject:"Rechazar",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Enviado",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Ru={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",talkToOperator:"\u05D3\u05D1\u05E8 \u05E2\u05DD \u05E0\u05E6\u05D9\u05D2",connectingOperator:"\u05DE\u05D7\u05D1\u05E8 \u05D0\u05D5\u05EA\u05DA \u05DC\u05E0\u05E6\u05D9\u05D2\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E9\u05DC\u05D7",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"},Au={en:li,fr:Cu,ar:Tu,es:Eu,he:Ru};function jn(e,t){let n=ci(e),o=Xn(t),r=n==="en"?{}:Au[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...li,...r,...l,...i}}function ci(e){return(e.split("-")[0]??"en").toLowerCase()}var Iu=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function di(e){return Iu.has(ci(e))}function Me(e,t){return e[t]??t}function Xn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function ui(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function _i(e,t){let{translations:n,defaultLocale:o,...r}=e,i=ui(n,t);return i?{...r,title:i.title??r.title,description:i.description??r.description,content:i.content??r.content}:r}function pi(e,t){let{translations:n,defaultLocale:o,...r}=e,i=ui(n,t);if(!i)return r;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=r.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let _=new Map((d.options??[]).map(p=>[p.value,p]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(p=>{let u=_.get(p.value);return u?{...p,label:u.label??p.label,description:u.description??p.description}:p})}});return{...r,title:i.title??r.title,description:i.description??r.description,submitLabel:i.submitLabel??r.submitLabel,fields:s}}var Pr=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{}}},Yn=new Pr;var kr=["off","error","warn","info","debug","trace"],wr=S.cssPrefix,mi=`${wr}.debug`,Mu=`__${S.global}_DEBUG__`,Lu=`${wr}-debug`,Jn=2,xr=null;function Ou(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Lu);if(e!==null){let t=Sr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(mi);if(e){let t=Sr(e);if(t>=0)return t}}catch{}return Reflect.get(window,Mu)?4:2}function Sr(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=kr.indexOf(e);if(t>=0)return t}return-1}function Qn(e){let t=Sr(e);if(!(t<0)){Jn=t;try{window.localStorage?.setItem(mi,kr[t])}catch{}}}function un(){return kr[Jn]}Jn=Ou();function fi(e){let t=`[${wr}:${e}]`,n=(o,r,i)=>(l,s)=>{if(!(Jn<o)&&(s===void 0?console[r](t,l):console[r](t,l,s),xr))try{xr({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=>fi(`${e}:${o}`)}}var z=fi("core");function _n(e){xr=e}var vt=z.scope("context"),Nu=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),gi=50,Cr=1024,Du=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Tr(e){return hi(e,"userContext",!0)}function Er(e){return hi(e,"pageContext",!1)}function hi(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){vt.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},r=0;for(let[i,l]of Object.entries(e)){if(Nu.has(i)){vt.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(r>=gi){vt.warn(`${t} truncated at ${gi} keys \u2014 dropped "${i}"`);continue}let s=$u(t,i,l);s!==void 0&&(o[i]=s,r++)}return n&&typeof o.email=="string"&&!Du.test(o.email)&&(vt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function $u(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){vt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Cr?(vt.warn(`truncated ${e}.${t} to ${Cr} chars`),o.slice(0,Cr)):o}vt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Zn={maxBytes:10485760,maxCount:10,accept:"*/*"},vi={voice:"local"},bi={list:[],byTrigger:{}},Rr={enabled:!0,sampleRate:1},eo={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Ft={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},yi={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"]},Ar={enabled:!0,volume:.3,events:void 0},Pi={enabled:!0,events:void 0},xi=[{label:"tabConversations",layout:"chat"}];function dt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},r=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=Fu(t.theme),_=n.mode??"floating",p=Bu(r.defaultLocale),u=r.availableLocales??[r.locale??p],f=Bt(r.locale??p,u,p),m=(t.baseUrl??S.defaultBaseUrl).replace(/\/$/,""),h=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),g=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:h,dataApiBaseUrl:g,userContext:Tr(t.userContext),pageContext:Er(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:_,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??vi.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0,tools:t.features?.tools},forms:pn(t.forms,f),endpoints:{upload:t.endpoints?.upload??eo.upload,transcribe:t.endpoints?.transcribe??eo.transcribe,submitForm:t.endpoints?.submitForm??eo.submitForm},attachments:{accept:t.composer?.attachments?.accept??Zn.accept,maxBytes:t.composer?.attachments?.maxBytes??Zn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Zn.maxCount},locale:f,defaultLocale:p,availableLocales:u,startMinimized:o.startMinimized??!0,actions:Hu(_,s.actions),size:n.size??{},launcher:ju(t.launcher),sound:zu(i.sound),haptics:Uu(i.haptics),strings:jn(f,r.strings),stringsOverride:r.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:Wu(l.poweredBy),composer:Vu(t.composer),modules:Ku(t.modules),tracking:qu(t.tracking,g),storage:t.storage??Yn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Fu(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function Bu(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function Bt(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function Hu(e,t){return t??yi[e]}function zu(e){return{enabled:e?.enabled??Ar.enabled,volume:e?.volume??Ar.volume,events:e?.events}}function Uu(e){return{enabled:e?.enabled??Pi.enabled,events:e?.events}}function qu(e,t){let n=e?.sampleRate??Rr.sampleRate;return{enabled:e?.enabled??Rr.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 Wu(e){let n={...{text:`Powered by ${S.displayName}`,href:S.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function Vu(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Ku(e){let t=e===void 0?xi: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 r=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:r}}function pn(e,t){var i;if(!e?.length)return bi;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=pi(l,t),c=(s.fields??[]).filter(_=>!!(_&&_.name&&_.label&&_.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(Gu).filter(_=>_!==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 r={};for(let l of n)for(let s of l.triggers)(r[i=s.kind]??(r[i]=[])).push(l);return{list:n,byTrigger:r}}function Gu(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 ju(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??Ft.variant,size:e?.size??Ft.size,label:e?.label??Ft.label,icon:e?.icon??Ft.icon,hidden:e?.hidden??Ft.hidden,callout:t}}function Ir(e,t,n,o){let r=Bt(t,e.availableLocales,e.defaultLocale);if(r===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return r!==e.locale&&(i.locale=r,i.strings=jn(r,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var Xu=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Mr(e,t){if(!t)return e;let n={...e};for(let i of Xu){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]=Si(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,r=t.i18n;if(o||r){let i=Si(r??{},o);r?.availableLocales!==void 0&&(i.availableLocales=r.availableLocales),r?.defaultLocale!==void 0&&(i.defaultLocale=r.defaultLocale);let l=o?.strings,s=r?.strings;(l||s)&&(i.strings=Yu(s,l)),n.i18n=i}return n}function Si(e,t){if(!t)return e;let n={...e};for(let[o,r]of Object.entries(t))r!==void 0&&(n[o]=r);return n}function Yu(e,t){if(!e)return t;if(!t)return e;let n=Xn(e),o=Xn(t);if(!n&&!o)return{...e,...t};let r={},i=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(i))r[s]={...c};for(let[s,c]of Object.entries(l))r[s]={...r[s],...c};return r}var Ju=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],nt=e=>e!=="false",wi=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Ci=[["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]],Ti=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",nt]],Ei=[["width","width"],["height","height"]],Ri=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",nt],["show-reasoning","showReasoning",nt],["show-tool-calls","showToolCalls",nt],["show-sources","showSources",nt],["disable-message-feedback","disableMessageFeedback",nt],["auto-send-suggestions","autoSendSuggestions",nt]],Ai=[["locale","locale"]],Qu=new Set(Ju),Zu=e=>wi(e).filter(t=>Qu.has(t)),Ii=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",nt]],Mi=[["features-disable-file-upload","disableFileUpload",nt],["features-voice","voice",e=>e],["features-tools","tools",wi]],Li=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Oi=[["user-id","id"],["user-email","email"],["user-name","name"]],Ni=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],e_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],t_=[Ci,Ti,Ei,Ri,Ai,Ii,Mi,Li,Oi,Ni],n_=new Set(["iframe","start-minimized"]),Lr=[...t_.flatMap(e=>e.map(([t])=>t).filter(t=>!n_.has(t))),...e_];function to(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,h]of Ci){let g=n(f);g!==void 0&&(t[m]=h?h(g):g)}let o=bt(n,Ti),r=bt(n,Ei);(o||r)&&(t.presentation={...o,...r?{size:r}:{}});let i=bt(n,Ri);i&&(t.behavior=i);let l=bt(n,Ai);l&&(t.i18n=l);let s=r_(e,n);s&&(t.launcher=s);let c=bt(n,Mi);c&&(t.features=c);let d=bt(n,Li);d&&(t.endpoints=d);let _=ki(n,Oi,"user-context");_&&(t.userContext=_);let p=ki(n,Ni,"page-context");p&&(t.pageContext=p);let u=n("actions");return u!==void 0&&(t.header={actions:Zu(u)}),t}function Or(e){return e?to(t=>e[o_(t)]??null):{}}function o_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function bt(e,t){let n={};for(let[o,r,i]of t){let l=e(o);l!==void 0&&(n[r]=i?i(l):l)}return Object.keys(n).length>0?n:null}function ki(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let r={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(r=s)}catch{}let l={...r,...o};return Object.keys(l).length>0?l:null}function r_(e,t){let n=bt(t,Ii)??{},o=e("launcher-label");o!==null&&(n.label=o);let r=t("callout-text");if(r){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:r,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var lo,U,Hi,Fr,ut,Di,zi,Ui,Nr,oo,mn,qi,Br,Dr,$r,a_,ao={},io=[],i_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fn=Array.isArray;function ot(e,t){for(var n in t)e[n]=t[n];return e}function Hr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function rt(e,t,n){var o,r,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?lo.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 ro(e,l,o,r,null)}function ro(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Hi,__i:-1,__u:0};return r==null&&U.vnode!=null&&U.vnode(i),i}function Z(e){return e.children}function Oe(e,t){this.props=e,this.context=t}function Ht(e,t){if(t==null)return e.__?Ht(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"?Ht(e):null}function s_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],r=[],i=ot({},t);i.__v=t.__v+1,U.vnode&&U.vnode(i),zr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Ht(t),!!(32&t.__u),r),i.__v=t.__v,i.__.__k[i.__i]=i,ji(o,i,r),t.__e=t.__=null,i.__e!=n&&Wi(i)}}function Wi(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}),Wi(e)}function $i(e){(!e.__d&&(e.__d=!0)&&ut.push(e)&&!so.__r++||Di!=U.debounceRendering)&&((Di=U.debounceRendering)||zi)(so)}function so(){try{for(var e,t=1;ut.length;)ut.length>t&&ut.sort(Ui),e=ut.shift(),t=ut.length,s_(e)}finally{ut.length=so.__r=0}}function Vi(e,t,n,o,r,i,l,s,c,d,_){var p,u,f,m,h,g,y,P=o&&o.__k||io,v=t.length;for(c=l_(n,t,P,c,v),p=0;p<v;p++)(f=n.__k[p])!=null&&(u=f.__i!=-1&&P[f.__i]||ao,f.__i=p,g=zr(e,f,u,r,i,l,s,c,d,_),m=f.__e,f.ref&&u.ref!=f.ref&&(u.ref&&Ur(u.ref,null,f),_.push(f.ref,f.__c||m,f)),h==null&&m!=null&&(h=m),(y=!!(4&f.__u))||u.__k===f.__k?(c=Ki(f,c,e,y),y&&u.__e&&(u.__e=null)):typeof f.type=="function"&&g!==void 0?c=g:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=h,c}function l_(e,t,n,o,r){var i,l,s,c,d,_=n.length,p=_,u=0;for(e.__k=new Array(r),i=0;i<r;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]=ro(null,l,null,null,null):fn(l)?l=e.__k[i]=ro(Z,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=ro(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=c_(l,n,c,p))!=-1&&(p--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(r>_?u--:r<_&&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(p)for(i=0;i<_;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Ht(s)),Yi(s,s));return o}function Ki(e,t,n,o){var r,i;if(typeof e.type=="function"){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Ki(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Ht(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function gn(e,t){return t=t||[],e==null||typeof e=="boolean"||(fn(e)?e.some(function(n){gn(n,t)}):t.push(e)),t}function c_(e,t,n,o){var r,i,l,s=e.key,c=e.type,d=t[n],_=d!=null&&(2&d.__u)==0;if(d===null&&s==null||_&&s==d.key&&c==d.type)return n;if(o>(_?1:0)){for(r=n-1,i=n+1;r>=0||i<t.length;)if((d=t[l=r>=0?r--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Fi(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||i_.test(t)?n:n+"px"}function no(e,t,n,o,r){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||Fi(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Fi(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(qi,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[mn]=o[mn]:(n[mn]=Br,e.addEventListener(t,i?$r:Dr,i)):e.removeEventListener(t,i?$r:Dr,i);else{if(r=="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 Bi(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[oo]==null)t[oo]=Br++;else if(t[oo]<n[mn])return;return n(U.event?U.event(t):t)}}}function zr(e,t,n,o,r,i,l,s,c,d){var _,p,u,f,m,h,g,y,P,v,x,D,j,V,ne,le,O=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(_=U.__b)&&_(t);e:if(typeof O=="function"){p=l.length;try{if(P=t.props,v=O.prototype&&O.prototype.render,x=(_=O.contextType)&&o[_.__c],D=_?x?x.props.value:_.__:o,n.__c?y=(u=t.__c=n.__c).__=u.__E:(v?t.__c=u=new O(P,D):(t.__c=u=new Oe(P,D),u.constructor=O,u.render=u_),x&&x.sub(u),u.state||(u.state={}),u.__n=o,f=u.__d=!0,u.__h=[],u._sb=[]),v&&u.__s==null&&(u.__s=u.state),v&&O.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ot({},u.__s)),ot(u.__s,O.getDerivedStateFromProps(P,u.__s))),m=u.props,h=u.state,u.__v=t,f)v&&O.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),v&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(v&&O.getDerivedStateFromProps==null&&P!==m&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(P,D),t.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(P,u.__s,D)===!1){t.__v!=n.__v&&(u.props=P,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(A){A&&(A.__=t)}),io.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&l.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(P,u.__s,D),v&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(m,h,g)})}if(u.context=D,u.props=P,u.__P=e,u.__e=!1,j=U.__r,V=0,v)u.state=u.__s,u.__d=!1,j&&j(t),_=u.render(u.props,u.state,u.context),io.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,j&&j(t),_=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++V<25);u.state=u.__s,u.getChildContext!=null&&(o=ot(ot({},o),u.getChildContext())),v&&!f&&u.getSnapshotBeforeUpdate!=null&&(g=u.getSnapshotBeforeUpdate(m,h)),ne=_!=null&&_.type===Z&&_.key==null?Xi(_.props.children):_,s=Vi(e,fn(ne)?ne:[ne],t,n,o,r,i,l,s,c,d),u.base=t.__e,t.__u&=-161,u.__h.length&&l.push(u),y&&(u.__E=u.__=null)}catch(A){if(l.length=p,t.__v=null,c||i!=null){if(A.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(le=i.length;le--;)Hr(i[le])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),A.then||Gi(t),U.__e(A,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,r,i,l,c,d);return(_=U.diffed)&&_(t),128&t.__u?void 0:s}function Gi(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Gi))}function ji(e,t,n){for(var o=0;o<n.length;o++)Ur(n[o],n[++o],n[++o]);U.__c&&U.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(i){i.call(r)})}catch(i){U.__e(i,r.__v)}})}function Xi(e){return typeof e!="object"||e==null||e.__b>0?e:fn(e)?e.map(Xi):e.constructor!==void 0?null:ot({},e)}function d_(e,t,n,o,r,i,l,s,c){var d,_,p,u,f,m,h,g=n.props||ao,y=t.props,P=t.type;if(P=="svg"?r="http://www.w3.org/2000/svg":P=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((f=i[d])&&"setAttribute"in f==!!P&&(P?f.localName==P:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(P==null)return document.createTextNode(y);e=document.createElementNS(r,P,y.is&&y),s&&(U.__m&&U.__m(t,i),s=!1),i=null}if(P==null)g===y||s&&e.data==y||(e.data=y);else{if(i=P=="textarea"&&y.defaultValue!=null?null:i&&lo.call(e.childNodes),!s&&i!=null)for(g={},d=0;d<e.attributes.length;d++)g[(f=e.attributes[d]).name]=f.value;for(d in g)f=g[d],d=="dangerouslySetInnerHTML"?p=f:d=="children"||d in y||d=="value"&&"defaultValue"in y||d=="checked"&&"defaultChecked"in y||no(e,d,null,f,r);for(d in y)f=y[d],d=="children"?u=f:d=="dangerouslySetInnerHTML"?_=f:d=="value"?m=f:d=="checked"?h=f:s&&typeof f!="function"||g[d]===f||no(e,d,f,g[d],r);if(_)s||p&&(_.__html==p.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(p&&(e.innerHTML=""),Vi(t.type=="template"?e.content:e,fn(u)?u:[u],t,n,o,P=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,l,i?i[0]:n.__k&&Ht(n,0),s,c),i!=null)for(d=i.length;d--;)Hr(i[d]);s&&P!="textarea"||(d="value",P=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||P=="progress"&&!m||P=="option"&&m!=g[d])&&no(e,d,m,g[d],r),d="checked",h!=null&&h!=e[d]&&no(e,d,h,g[d],r))}return e}function Ur(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(r){U.__e(r,n)}}function Yi(e,t,n){var o,r;if(U.unmount&&U.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Ur(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){U.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&Yi(o[r],t,n||typeof e.type!="function");n||Hr(e.__e),e.__c=e.__=e.__e=void 0}function u_(e,t,n){return this.constructor(e,n)}function yt(e,t,n){var o,r,i,l;t==document&&(t=document.documentElement),U.__&&U.__(e,t),r=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],zr(t,e=(!o&&n||t).__k=rt(Z,null,[e]),r||ao,ao,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?lo.call(t.childNodes):null,i,!o&&n?n:r?r.__e:t.firstChild,o,l),ji(i,e,l),e.props.children=null}lo=io.slice,U={__e:function(e,t,n,o){for(var r,i,l;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),l=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),l=r.__d),l)return r.__E=r}catch(s){e=s}throw e}},Hi=0,Fr=function(e){return e!=null&&e.constructor===void 0},Oe.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ot({},this.state),typeof e=="function"&&(e=e(ot({},n),this.props)),e&&ot(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),$i(this))},Oe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$i(this))},Oe.prototype.render=Z,ut=[],zi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ui=function(e,t){return e.__v.__b-t.__v.__b},so.__r=0,Nr=Math.random().toString(8),oo="__d"+Nr,mn="__a"+Nr,qi=/(PointerCapture)$|Capture$/i,Br=0,Dr=Bi(!1),$r=Bi(!0),a_=0;var zt="0.71.1";function Ji(e){return`${S.cssPrefix}:${e}`}function hn(e,t,n){e.dispatchEvent(new CustomEvent(Ji(t),{detail:n}))}function Qi(e,t){let o=Object.entries(t).map(([r,i])=>{let l=Ji(r),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[r,i]of o)e.removeEventListener(r,i)}}function ze(){let e=Date.now(),t=new Uint8Array(16);t[0]=Math.floor(e/2**40)&255,t[1]=Math.floor(e/2**32)&255,t[2]=e>>>24&255,t[3]=e>>>16&255,t[4]=e>>>8&255,t[5]=e&255,__(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 __(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 Pt=z.scope("persistence");function _t(e,t=Yn,n){let o=n?`${e}.${n}`:e,r=`${S.cssPrefix}.storageVersion`,i=t.get(r)??void 0,l=i?`.v${i}`:"",s=`${S.cssPrefix}.${o}${l}`,c=`${S.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,_=`${s}.userPrefs`,p=`${s}.panelOpen`,u=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,h=`${s}.activeModule`,g=`${s}.historyCount`,y=`${s}.formsDone`,P={getVisitorId(){let v=t.get(c);if(v)return v;let x=ze();return t.set(c,x),x},setVisitorId(v){Pt.debug("setVisitorId (rebind)",{id:v,scope:o}),t.set(c,v)},loadConversationId(){return t.get(d)??void 0},saveConversationId(v){Pt.trace("saveConversationId",{id:v,scope:o}),v?t.set(d,v):t.remove(d)},loadUserPrefs(){let v=t.get(_);if(!v)return{};try{let x=JSON.parse(v);return Zi(x)?x:{}}catch(x){return Pt.warn("loadUserPrefs parse failed",{error:x}),{}}},saveUserPrefs(v){try{t.set(_,JSON.stringify(v))}catch(x){Pt.warn("saveUserPrefs serialise failed",{error:x})}},patchUserPrefs(v){let x=P.loadUserPrefs();P.saveUserPrefs({...x,...v})},loadPanelOpen(){let v=t.get(p);return v==="1"?!0:v==="0"?!1:null},savePanelOpen(v){t.set(p,v?"1":"0")},loadPanelSize(){let v=t.get(u);return v==="normal"||v==="expanded"||v==="fullscreen"?v:null},savePanelSize(v){t.set(u,v)},loadCalloutDismissed(v){if(!v)return!1;let x=t.get(f);return!!x&&x===v},saveCalloutDismissed(v){v?t.set(f,v):t.remove(f)},loadSidebarCollapsed(){let v=t.get(m);return v==="1"?!0:v==="0"?!1:null},saveSidebarCollapsed(v){t.set(m,v?"1":"0")},loadActiveModule(){return t.get(h)||null},saveActiveModule(v){t.set(h,v)},loadHistoryCount(){let v=t.get(g);if(!v)return null;let x=Number.parseInt(v,10);return Number.isFinite(x)&&x>=0?x:null},saveHistoryCount(v){t.set(g,String(v))},loadFormsDone(){let v=t.get(y);if(!v)return{};try{let x=JSON.parse(v);return Zi(x)?x:{}}catch(x){return Pt.warn("loadFormsDone parse failed",{error:x}),{}}},saveFormDone(v){try{let x=P.loadFormsDone();x[v]=Date.now(),t.set(y,JSON.stringify(x))}catch(x){Pt.warn("saveFormDone serialise failed",{error:x})}},rememberStorageVersion(v){v&&v!==t.get(r)&&(Pt.debug("rememberStorageVersion (force-reset on next load)",{version:v}),t.set(r,v))},clearConversation(){t.remove(d)}};return P}function Zi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var es=`: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 ts=`*,*: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 ns=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent-fg);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent-fg);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border:1px solid var(--__P__-border);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{display:flex;align-items:stretch;padding:0;overflow:hidden;background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{display:flex;flex:0 0 auto;align-items:center;padding:0 .875rem;border-inline-end:1px solid color-mix(in oklab,var(--__P__-accent),transparent 60%);color:var(--__P__-accent);font-size:calc(13px * var(--__P__-text-scale));font-weight:600;letter-spacing:.025em;user-select:none}.__P__-bubble-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent-fg);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent-fg)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-operator-banner{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 var(--__P__-space-3) var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg-elevated),var(--__P__-accent) 6%);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);line-height:1.3;text-align:center}.__P__-operator-pulse{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-operator-cancel{flex:0 0 auto;padding:0;border:0;background:none;color:var(--__P__-accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.__P__-operator-cancel:hover{opacity:.8}.__P__-operator-cancel:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-radius:var(--__P__-radius-sm)}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent-fg)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent-fg);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent-fg);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent-fg)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent;user-select:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=completed]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=responded]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=awaiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=denied]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=error]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=superseded]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
|
|
4
|
+
`;var os=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
|
+
`;var rs=`: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",b_="#5B5BD6",y_="#FFFFFF",P_="12px",x_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",qr=[es,ts,ns,os,rs].join(`
|
|
7
|
+
`).replace(/__P__/g,v_).replaceAll("__BRAND_ACCENT_TEXT__",y_).replaceAll("__BRAND_ACCENT__",b_).replaceAll("__BRAND_RADIUS__",P_).replaceAll("__BRAND_FONT__",x_);var S_=z.scope("mount"),as=new WeakMap,is={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 ss(e,t){e.style.cssText=is[t]}function xt(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Ut(e={}){let t=e.position??"flow";S_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${S.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",S.id),o.style.cssText=is[t];let r=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!k_(r,i)){let s=i.createElement("style");s.textContent=qr,r.appendChild(s)}let l=document.createElement("div");return l.className=`${S.cssPrefix}-app`,r.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:r}}function k_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=as.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(qr),as.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function w_(e,t){let n=S.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 C_(e,t){e.dataset.theme=t}function T_(e,t){let n=S.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 E_(e,t){e.dataset.position=t}function co(e,t){e.dataset.mode=t}function ls(e,t){C_(e,t.themeMode),w_(e,t.themeOverrides),E_(e,t.position),T_(e,t.size)}var R_=z.scope("iframe"),A_='<!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 us(e,t,n="closed",o="floating",r=null){R_.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!r});let i=document.createElement("iframe");i.title=`${S.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),ds(i,t,n,o),(o==="inline"&&r?r:document.body).appendChild(i);let s=i.contentDocument;if(!s)throw new Error("iframe contentDocument unavailable (cross-origin?)");s.open(),s.write(A_),s.close();let c=Ut({...e,target:s.body}),d=new MutationObserver(()=>{ds(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 uo="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",cs={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 ds(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${uo}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${uo}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=`${uo}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}=cs[n]??cs.open;e.style.cssText=`${uo}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var qt=class{constructor(){K(this,"handlers",new Map)}on(t,n){let o=this.handlers.get(t);return o||(o=new Set,this.handlers.set(t,o)),o.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let o=this.handlers.get(t);if(o)for(let r of o)try{r(n)}catch{}}clear(){this.handlers.clear()}};var Wt,ve,Wr,_s,vn=0,ys=[],Pe=U,ps=Pe.__b,ms=Pe.__r,fs=Pe.diffed,gs=Pe.__c,hs=Pe.unmount,vs=Pe.__;function po(e,t){Pe.__h&&Pe.__h(ve,e,vn||t),vn=0;var n=ve.__H||(ve.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return vn=1,Ps(xs,e)}function Ps(e,t,n){var o=po(Wt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):xs(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=ve,!ve.__f)){var r=function(s,c,d){if(!o.__c.__H)return!0;var _=!1,p=o.__c.props!==s;if(o.__c.__H.__.some(function(f){if(f.__N){_=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(p=!0)}}),i){var u=i.call(this,s,c,d);return _?u||p:u}return!_||p};ve.__f=!0;var i=ve.shouldComponentUpdate,l=ve.componentWillUpdate;ve.componentWillUpdate=function(s,c,d){if(this.__e){var _=i;i=void 0,r(s,c,d),i=_}l&&l.call(this,s,c,d)},ve.shouldComponentUpdate=r}return o.__N||o.__}function E(e,t){var n=po(Wt++,3);!Pe.__s&&Kr(n.__H,t)&&(n.__=e,n.u=t,ve.__H.__h.push(n))}function Xe(e,t){var n=po(Wt++,4);!Pe.__s&&Kr(n.__H,t)&&(n.__=e,n.u=t,ve.__h.push(n))}function B(e){return vn=5,Ae(function(){return{current:e}},[])}function Ae(e,t){var n=po(Wt++,7);return Kr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function N(e,t){return vn=8,Ae(function(){return e},t)}function I_(){for(var e;e=ys.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(_o),t.__h.some(Vr),t.__h=[]}catch(n){t.__h=[],Pe.__e(n,e.__v)}}}Pe.__b=function(e){ve=null,ps&&ps(e)},Pe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),vs&&vs(e,t)},Pe.__r=function(e){ms&&ms(e),Wt=0;var t=(ve=e.__c).__H;t&&(Wr===ve?(t.__h=[],ve.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(_o),t.__h.some(Vr),t.__h=[],Wt=0)),Wr=ve},Pe.diffed=function(e){fs&&fs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ys.push(t)!==1&&_s===Pe.requestAnimationFrame||((_s=Pe.requestAnimationFrame)||M_)(I_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Wr=ve=null},Pe.__c=function(e,t){t.some(function(n){try{n.__h.some(_o),n.__h=n.__h.filter(function(o){return!o.__||Vr(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],Pe.__e(o,n.__v)}}),gs&&gs(e,t)},Pe.unmount=function(e){hs&&hs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{_o(o)}catch(r){t=r}}),n.__H=void 0,t&&Pe.__e(t,n.__v))};var bs=typeof requestAnimationFrame=="function";function M_(e){var t,n=function(){clearTimeout(o),bs&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);bs&&(t=requestAnimationFrame(n))}function _o(e){var t=ve,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ve=t}function Vr(e){var t=ve;e.__c=e.__(),ve=t}function Kr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function xs(e,t){return typeof t=="function"?t(e):t}var L_=Symbol.for("preact-signals");function ho(){if(at>1)at--;else{var e,t=!1;for((function(){var r=fo;for(fo=void 0;r!==void 0;){var i=r.S;if(i.v===r.v)for(var l=i.t;l!==void 0;l=l.x)l.i===r.i&&(l.i=i.i);r=r.o}})();yn!==void 0;){var n=yn;for(yn=void 0,mo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ks(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(mo=0,at--,t)throw e}}function Vt(e){if(at>0)return e();Gr=++O_,at++;try{return e()}finally{ho()}}var bn,pe=void 0;function Pn(e){var t=pe,n=bn;pe=void 0,bn=void 0;try{return e()}finally{pe=t,bn=n}}var yn=void 0,at=0,mo=0,O_=0,Gr=0,fo=void 0,go=0;function Ss(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 we(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}we.prototype.brand=L_;we.prototype.h=function(){return!0};we.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Pn(function(){var o;(o=t.W)==null||o.call(t)}))};we.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&Pn(function(){var r;(r=t.Z)==null||r.call(t)}))}};we.prototype.subscribe=function(e){var t=this;return it(function(){var n=t.value;Pn(function(){return e(n)})},{name:"sub"})};we.prototype.valueOf=function(){return this.value};we.prototype.toString=function(){return this.value+""};we.prototype.toJSON=function(){return this.value};we.prototype.peek=function(){var e=this;return Pn(function(){return e.value})};Object.defineProperty(we.prototype,"value",{get:function(){var e=Ss(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(mo>100)throw new Error("Cycle detected");(function(n){at!==0&&mo===0&&n.l!==Gr&&(n.l=Gr,fo={S:n,v:n.v,i:n.i,o:fo})})(this),this.v=e,this.i++,go++,at++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{ho()}}}});function W(e,t){return new we(e,t)}function ks(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 ws(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 Cs(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 St(e,t){we.call(this,void 0,t),this.x=e,this.s=void 0,this.g=go-1,this.f=4}St.prototype=new we;St.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===go))return!0;if(this.g=go,this.f|=1,this.i>0&&!ks(this))return this.f&=-2,!0;var e=pe;try{ws(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,Cs(this),this.f&=-2,!0};St.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}we.prototype.S.call(this,e)};St.prototype.U=function(e){if(this.t!==void 0&&(we.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};St.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(St.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ss(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function xn(e,t){return new St(e,t)}function Ts(e){var t=e.m;if(e.m=void 0,typeof t=="function"){at++;var n=pe;pe=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,jr(e),o}finally{pe=n,ho()}}}function jr(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ts(e)}function N_(e){if(pe!==this)throw new Error("Out-of-order effect");Cs(this),pe=e,this.f&=-2,8&this.f&&jr(this),ho()}function Kt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,bn&&bn.push(this)}Kt.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()}};Kt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ts(this),ws(this),at++;var e=pe;return pe=this,N_.bind(this,e)};Kt.prototype.N=function(){2&this.f||(this.f|=2,this.u=yn,yn=this)};Kt.prototype.d=function(){this.f|=8,1&this.f||jr(this)};Kt.prototype.dispose=function(){this.d()};function it(e,t){var n=new Kt(e,t);try{n.c()}catch(r){throw n.d(),r}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Es,yo,vo,D_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Rs=[];it(function(){Es=this.N})();function Gt(e,t){U[e]=t.bind(null,U[e]||function(){})}function bo(e){if(vo){var t=vo;vo=void 0,t()}vo=e&&e.S()}function As(e){var t=this,n=e.data,o=Ye(n);o.value=n;var r=Ae(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=xn(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),_=xn(function(){return!Array.isArray(d.value)&&!Fr(d.value)}),p=it(function(){if(this.N=Is,_.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(){p(),u.call(this)},[_,d]},[]),i=r[0],l=r[1];return i.value?l.peek():l.value}As.displayName="ReactiveTextNode";Object.defineProperties(we.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:As},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Gt("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var r in o)if(r!=="children"){var i=o[r];i instanceof we&&(n||(t.__np=n={}),n[r]=i,o[r]=i.peek())}}e(t)});Gt("__r",function(e,t){if(e(t),t.type!==Z){bo();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(r,i){var l;return it(function(){l=this},{name:i}),l.c=r,l})(function(){var r;D_&&((r=n.y)==null||r.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),yo=o,bo(n)}});Gt("__e",function(e,t,n,o){bo(),yo=void 0,e(t,n,o)});Gt("diffed",function(e,t){bo(),yo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,r=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],_=o[c];d===void 0?(d=$_(n,c,_,r),i[c]=d):d.o(_,r)}}}e(t)});function $_(e,t,n,o){var r=t in e&&e.ownerSVGElement===void 0,i=W(n);return{o:function(l,s){i.value=l,o=s},d:it(function(){this.N=Is;var l=i.value.value;o[t]!==l&&(o[t]=l,r?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Gt("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 r in o){var i=o[r];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 _=d.__$u;_&&(d.__$u=void 0,_.d())}}e(t)});Gt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});Oe.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var r 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 Ye(e,t){return Ae(function(){return W(e,t)},[])}function ee(e,t){var n=B(e);return n.current=e,yo.__$f|=4,Ae(function(){return xn(function(){return n.current()},t)},[])}var F_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function B_(){Vt(function(){for(var e;e=Rs.shift();)Es.call(e)})}function Is(){Rs.push(this)===1&&(U.requestAnimationFrame||F_)(B_)}function Ms(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ls(e){return Ms(e)}function Os(e){return!(!Ms(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Po(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 H_=900,z_=640;function Xr(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;return o==="expanded"||o==="fullscreen"||o==="normal"?o:n>0&&n<z_?"fullscreen":n>=(t.autoSizeBreakpoint??H_)?"expanded":"normal"}function Sn(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:Xr(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function jt(){return typeof window>"u"?0:window.innerWidth}var U_="x-public-key",q_="x-ai-agent-deployment-id";function Ns(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[q_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??U_]=e.publicKey),t}}}function Xt(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),r=()=>i();t?.addEventListener("abort",r,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",r),n()}})}var Je=class extends Error{constructor(n,o,r,i){super(n);K(this,"code",o);K(this,"status",r);K(this,"cause",i);this.name="StreamError"}};var Ds=z.scope("parser");async function*$s(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Je(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of W_(e,t)){let o=V_(n);if(o==="done")return;o&&(yield o)}}async function*W_(e,t){if(!e.body)throw new Je("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:r,value:i}=await n.read();if(r){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
|
|
9
|
+
`))!==-1;){let s=o.slice(0,l);o=o.slice(l+2),yield s}}}finally{n.releaseLock()}}function V_(e){let t="",n;for(let o of e.split(`
|
|
10
10
|
`))if(!(o===""||o.startsWith(":"))){if(o.startsWith("data:")){let r=o.slice(5).replace(/^ /,"");t=t?`${t}
|
|
11
|
-
${r}`:r;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 Os.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Os.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function V_(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 Ds=e=>e&&Object.keys(e).length>0?e:void 0;function $s(e,t){let n=Ds(e),o=Ds(t);if(!n&&!o)return;let r={};return n&&(r.user=n),o&&(r.page=o),V_(JSON.stringify(r))}function yo(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function K_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Fs(e){return e.startsWith("tool-")?e.slice(5):e}var Le={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",cancelRequestOperator:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Bs="context";function ft(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 Po(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:r,label:i,text:l}=o;typeof i!="string"||!i||n.push({id:typeof r=="string"&&r?r:`s${n.length}`,label:i,text:typeof l=="string"&&l?l:i})}return n}function Gr(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:X_(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",responseType:"ack"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let r=e.tools?.map(j_).filter(i=>i!==null);return r?.length&&(n.data={tools:r}),n}function G_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function j_(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function X_(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"&&G_(n)){let o={type:K_(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=H.scope("transport"),Y_=6e4,J_=1e4,Hs=3,Q_=400,Z_=new Set([408,425,429,500,502,503,504]);function zs(e){return Q_*2**e+Math.floor(Math.random()*250)}function ep(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}var xo=class{constructor(t){K(this,"ttlMs",t);K(this,"map",new Map)}getOrFetch(t,n){let o=this.map.get(t);if(o&&Date.now()-o.at<this.ttlMs)return o.result;let r={at:Date.now(),result:n().then(i=>(r.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,r),r.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()}},So=class{constructor(t){K(this,"opts",t);K(this,"visitorId");K(this,"conversationId");K(this,"userContext");K(this,"pageContext");K(this,"locale");K(this,"conversationsCache",new xo(J_));K(this,"loadConversationInflight",new Map);K(this,"contentCache",new xo(Y_))}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:Ht};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=$s(this.userContext,this.pageContext);return n&&(t[Bs]=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,r]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,r);return n.toString()}async handshake(t){J.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(Le.handshake,t,"handshake");return J.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),np(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.${tp(n)}`),o.append("mimeType",n);let r=await this.postForm(this.transcribePath,o,"transcribe");return J.debug("transcribe \u2190",{textLen:r.text.length}),r}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(Le.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"),r=o.conversations??[];return J.debug("listConversations \u2190",{count:r.length,nextCursor:o.nextCursor}),{conversations:r,nextCursor:o.nextCursor}}async loadConversation(t){let n=this.loadConversationInflight.get(t);if(n)return n;let o=this.loadConversationDirect(t).finally(()=>this.loadConversationInflight.delete(t));return this.loadConversationInflight.set(t,o),o}async loadConversationDirect(t){let n=new URL(this.url(Le.listMessages));n.searchParams.set("conversationId",t),J.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),r=o.messages??[];return J.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:r.length,hasSuggestions:!!o.suggestions}),{...o,messages:r,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(Le.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(Le.requestOperator,{},"requestOperator")).controlState}catch(t){J.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelRequestOperator(){if(!(!this.visitorId||!this.conversationId)){J.debug("cancelRequestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Le.cancelRequestOperator,{},"cancelRequestOperator")).controlState}catch(t){J.debug("cancelRequestOperator failed (non-fatal)",{err:t});return}}}listContent(t={}){return this.contentCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchContent(t))}async fetchContent(t){let n=new URL(this.dataUrl(Le.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"),r=(o.items??[]).map(i=>di(i,this.locale));return J.debug("listContent \u2190",{count:r.length,total:o.pagination?.total}),{...o,items:r}}async bootstrap(t){let n=new URL(this.dataUrl(Le.bootstrap));t&&n.searchParams.set("conversationId",t),J.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),r=o.forms??[],i=o.formSubmissions??[];return J.debug("bootstrap \u2190",{forms:r.length,formSubmissions:i.length}),{forms:r,formSubmissions:i}}async saveUserPrefs(t){J.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(Le.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??Le.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(Le.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){J.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(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(r=>r.code)});let n=await this.fetchImpl(this.url(Le.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t))});return{status:"accepted",conversationId:(await this.assertOk(n,"sendTurn")).conversationId??t.conversationId}}cancelTurn(t){!this.visitorId||!t||(J.debug("cancel stream",{conversationId:t,visitorId:this.visitorId}),this.fetchImpl(this.url(Le.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(n=>J.debug("cancel POST failed (non-fatal)",{err:n})))}async connectResumeStream(t){let n;try{n=await this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(o){return t.signal.aborted||J.debug("resume-stream fetch failed \u2014 reconnecting",{err:o}),"held"}if(!n.ok||!n.body)return J.debug("resume-stream \u2192 endpoint unavailable",{status:n.status}),"unavailable";if(!(n.headers.get("content-type")??"").includes("text/event-stream"))return J.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";t.onConnected();try{for await(let{chunk:o}of Ns(n,t.signal)){if(t.signal.aborted)return"held";t.onChunk(o)}}catch(o){if(t.signal.aborted)return"held";J.debug("resume-stream segment dropped \u2014 reconnecting",{err:o})}return"held"}resumeUrl(){return this.withEnvelopeQuery(Le.streamResume)}async postJson(t,n,o){let r=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(r,o)}async postForm(t,n,o){let r=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(r,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[r,i]=t(),l;try{l=await this.fetchImpl(r,i)}catch(c){if(o>=Hs)throw new Ye(`${n} failed: network error`,"network",void 0,c);J.debug("request network error \u2014 retrying",{label:n,attempt:o}),await jt(zs(o));continue}if(l.ok||!Z_.has(l.status)||o>=Hs)return l;let s=ep(l.headers)??zs(o);J.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await jt(s)}}async assertOk(t,n){if(!t.ok)throw new Ye(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function tp(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 np(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function Us(e,t){let n=e?[{kind:"text",id:"t0",textSig:q(e),doneSig:q(!0)}]:[];return{id:Be(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:q(n)}}function kt(){return{id:Be(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:q([])}}function qs(e){let t=Be();return op({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function op(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,feedback:e.feedback,partsSig:q(e.parts.map(cp))}}var Ws=new Set(["completed","failed","canceled"]);function rp(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status!=null&&!Ws.has(e.status)?"streaming":"complete"}function ap(e){let t=new Set,n=e.parts.map((r,i)=>r.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:q(r.text),doneSig:q(!0)}:r.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:q(r.text),doneSig:q(r.state!=="streaming")}:r.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:r.type==="file"?{kind:"file",url:r.url,mediaType:r.mediaType}:r.type==="source-url"?{kind:"source",sourceId:r.sourceId,url:r.url,title:r.title}:r.type==="source-document"?{kind:"source",sourceId:r.sourceId,title:r.title,filename:r.filename,mediaType:r.mediaType}:r.type==="data-suggestions"?null:r.type.startsWith("tool-")?{kind:"tool",toolCallId:r.toolCallId,toolName:Fs(r.type),inputPartialSig:q(""),inputSig:q(r.input),outputSig:q(r.output),errorSig:q(r.errorText),stateSig:q(r.state),approvalSig:q(r.approval)}:null).filter(r=>r!==null).filter(r=>r.kind!=="source"?!0:t.has(r.sourceId)?!1:(t.add(r.sourceId),!0)),o=e.parts.find(r=>r.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:o?.type==="data-suggestions"?Po(o.data):void 0,serverMessageId:e.id,createdAt:yo(e.createdAt)??Date.now(),status:rp(e),canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:q(n)}}function ip(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 sp(e){return e.role==="assistant"&&e.status!=null&&!Ws.has(e.status)&&ip(e)}function Sn(e){let t=e.length-1;return e.filter((n,o)=>o===t||!sp(n)).map(ap)}function Vs(e,t){return(!t&&e.at(-1)?.role==="assistant"?e.slice(0,-1):e).filter(o=>!o.ephemeral)}function Xr(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(dp)}}function Ke(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function wt(e){return Ke(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function lp(e){return Ke(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function Ks(e){return e.status!=="streaming"&&wt(e)}function Gs(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}var js=e=>e.kind==="tool",Xs=e=>e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"||e.kind==="source";function Ys(e){let t=e.partsSig.value,n=t.findLastIndex(o=>o.kind==="tool");return t.slice(n+1).some(Xs)}function Yr(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(js);return t.length>0&&t.every(n=>Gs(n.stateSig.value))}function Js(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!Ys(e)}function Qs(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||Xs(n))}function ko(e){return e.partsSig.value.some(t=>js(t)&&!Gs(t.stateSig.value))}function Zs(e){return Yr(e)&&!Ys(e)}function el(e,t){let n=t.filter(s=>!s.ephemeral&&(s.status==="streaming"||wt(s))),o=new Map(n.filter(s=>s.serverMessageId!==void 0).map(s=>[s.serverMessageId,s])),r=new Set,i=e.map(s=>{let c=s.serverMessageId!==void 0?o.get(s.serverMessageId):void 0;return c===void 0||(r.add(s.serverMessageId),c.role!==s.role)?s:c.status==="streaming"||Ke(c).length>=Ke(s).length?c:(s.id=c.id,s)}),l=n.filter(s=>s.serverMessageId===void 0||!r.has(s.serverMessageId));return[...i,...l]}function tl(e,t){let n=new Map(t.filter(s=>s.serverMessageId!==void 0).map(s=>[s.serverMessageId,s])),o=new Set(e.flatMap(s=>[s.serverMessageId,s.id].filter(c=>c!==void 0))),r=!1,i=e.map(s=>{if(s.serverMessageId===void 0)return s;let c=n.get(s.serverMessageId);if(c===void 0||c.role!==s.role)return s;let d=Ke(c).length,_=Ke(s).length,p=ko(s)&&!ko(c)&&d>=_;return d>_||p?(r=!0,c.id=s.id,c):s}),l=[...n.values()].filter(s=>!o.has(s.serverMessageId));return{messages:r||l.length?[...i,...l]:e,changed:r||l.length>0}}function it(e){return e.role==="assistant"&&e.status!=="streaming"&&!wt(e)}function Jr(e){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!lp(e)}function nl(e,t){return e.operatorRoutedTurn?it(e)?"drop":"complete-operator-routed":t||it(e)?"error":"complete"}function cp(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:q(e.text),doneSig:q(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:q(e.inputPartial),inputSig:q(e.input),outputSig:q(e.output),errorSig:q(e.error),stateSig:q(e.state),approvalSig:q(e.approval)}:e}function dp(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var ol=H.scope("feedback:audio"),wo=class{constructor(){K(this,"ctx",null);K(this,"master",null);K(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){ol.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 r=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(),_=r+s*i;d.gain.setValueAtTime(1e-4,_),d.gain.exponentialRampToValueAtTime(t.peakGain,_+.005),d.gain.exponentialRampToValueAtTime(1e-4,_+i),c.connect(d).connect(o),c.start(_),c.stop(_+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let r=await this.getBuffer(t);if(!r)return;let i=n.createBufferSource();i.buffer=r,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,r=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=>(ol.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,r),r}};var rl={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},al={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 mt=null,Co=0;function up(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function _p(){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=`__${S.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 il(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(up())try{navigator.vibrate(e);return}catch{}if(mt||(mt=_p()),!!mt)try{mt.label.click()}catch{}}}function sl(){Co++;let e=!1;return()=>{e||(e=!0,Co=Math.max(0,Co-1),Co===0&&mt&&(mt.input.remove(),mt.label.remove(),mt=null))}}var pp=H.scope("feedback"),fp=100,To=class{constructor(t,n){K(this,"mutedSig",q(!1));K(this,"audio",new wo);K(this,"releaseHaptics");K(this,"sound");K(this,"haptics");K(this,"lastPlayed",new Map);K(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=sl(),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<fp}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(r=>pp.warn("audio play failed",{err:r,url:n}));return}let o=al[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?rl[t]:n;il(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}};var mp=0;function a(e,t,n,o,r,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:--mp,__i:-1,__u:0,__source:r,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return z.vnode&&z.vnode(d),d}var B={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},kn=`${S.cssPrefix}-icon-dir`,Qr=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Je=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})}),ll=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})}),cl=()=>a("svg",{...B,class:kn,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]}),dl=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})}),ul=()=>a("svg",{...B,class:kn,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})}),Xt=()=>a("svg",{...B,class:kn,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})}),_l=()=>a("svg",{...B,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),pl=()=>a("svg",{...B,"aria-hidden":"true",children:a("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"})}),fl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),a("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),ml=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),gl=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),hl=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),vl=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),bl=()=>a("svg",{...B,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),yl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),Pl=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),xl=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Sl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),a("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),kl=()=>a("svg",{...B,class:kn,"aria-hidden":"true",children:a("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Ct=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})}),wl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M3 3v6h6"}),a("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),a("path",{d:"M12 7v5l3 2"})]}),Cl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M2 12h20"}),a("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"})]}),wn=()=>a("svg",{...B,class:kn,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Tl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M12 20h9"}),a("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Tt=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})}),El=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),a("path",{d:"M14 2v6h6"})]}),gp=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),a("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),Zr=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),Cn=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),a("path",{d:"M12 17h.01"})]}),hp=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"m15 4 3 3-9 9-3-3z"}),a("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),vp=()=>a("svg",{...B,"aria-hidden":"true",children:[a("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),a("path",{d:"M12 8V4"}),a("circle",{cx:"12",cy:"3",r:"1"}),a("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),ea=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),a("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),a("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),a("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),bp=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("circle",{cx:"12",cy:"12",r:"4"}),a("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"})]}),ta=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]}),Rl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Al=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M3 9.5 12 3l9 6.5"}),a("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Il=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"m3 11 15-5v12L3 13z"}),a("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),a("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),a("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Tn=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),a("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),Ml=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"4"}),a("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"})]}),Ll=()=>a("svg",{...B,"aria-hidden":"true",children:a("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Ol=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 3v18"}),a("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),yp=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),a("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),a("path",{d:"m20 20-4.4-4.4"})]}),Pp=()=>a("svg",{...B,"aria-hidden":"true",children:[a("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"}),a("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),xp=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M4 18h16"}),a("path",{d:"M5 18a7 7 0 0 1 14 0"}),a("path",{d:"M12 8V6"}),a("path",{d:"M10 6h4"})]}),Sp=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),a("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"})]}),Nl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),a("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),Dl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),a("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"})]}),$l=()=>a("svg",{...B,"aria-hidden":"true",children:[a("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),a("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"})]}),Fl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"3.5"}),a("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"})]}),Bl=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]}),Eo=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Ro=()=>a("svg",{...B,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]}),Hl={chat:Qr,message:Zr,bubbles:Tn,spark:gp,wand:hp,bot:vp,help:Cn,lifebuoy:bp,headset:ea,search:yp,sparkles:Pp,concierge:xp,wave:Sp};var A=S.cssPrefix,w={launcher:`${A}-launcher`,callout:`${A}-callout`,calloutDismiss:`${A}-callout-dismiss`,panel:`${A}-panel`,panelHeader:`${A}-panel-header`,resizeGrip:`${A}-resize-grip`,scrollToBottom:`${A}-scroll-to-bottom`,actionHistory:`${A}-action-history`,actionClose:`${A}-action-close`,langSegment:`${A}-lang-segment`,composer:`${A}-composer`,composerInput:`${A}-composer-input`,composerSend:`${A}-composer-send`,composerStop:`${A}-composer-stop`,composerAttach:`${A}-composer-attach`,composerFileInput:`${A}-composer-file-input`,composerVoice:`${A}-composer-voice`,attachmentChip:`${A}-attachment-chip`,attachmentRemove:`${A}-attachment-remove`,suggestion:`${A}-suggestion`,messageBubble:`${A}-message`,messageRetry:`${A}-message-retry`,messageFeedback:`${A}-message-feedback`,feedbackUp:`${A}-feedback-up`,feedbackDown:`${A}-feedback-down`,messageCopy:`${A}-message-copy`,historyPane:`${A}-history-pane`,historyBack:`${A}-history-back`,historyItem:`${A}-history-item`,sidebar:`${A}-sidebar`,sidebarToggle:`${A}-sidebar-toggle`,sidebarNewConversation:`${A}-sidebar-new-conversation`,sidebarItem:`${A}-sidebar-item`,messengerHome:`${A}-messenger-home`,modulesEmpty:`${A}-modules-empty`,tab:`${A}-tab`,tabBadge:`${A}-tab-badge`,homeView:`${A}-home-view`,homeGreeting:`${A}-home-greeting`,homeBrand:`${A}-home-brand`,backHeader:`${A}-back-header`,contentView:`${A}-content-view`,contentScroll:`${A}-content-scroll`,homeSearch:`${A}-home-search`,helpSearch:`${A}-help-search`,homeRecent:`${A}-home-recent`,homeContentRow:`${A}-home-content-row`,helpArticle:`${A}-help-article`,newsItem:`${A}-news-item`,formGate:`${A}-form-gate`,formDone:`${A}-form-done`,formDoneToggle:`${A}-form-done-toggle`,formAnswers:`${A}-form-answers`,formFill:`${A}-form-fill`,formSubmit:`${A}-form-submit`,formSkip:`${A}-form-skip`,formField:`${A}-form-field`,toolAskQuestions:`${A}-tool-ask-questions`,toolInputSubmit:`${A}-tool-input-submit`,toolInputSkip:`${A}-tool-input-skip`,toolApproval:`${A}-tool-approval`,toolApprove:`${A}-tool-approve`,toolReject:`${A}-tool-reject`,toolEdit:`${A}-tool-edit`,toolDecision:`${A}-tool-decision`,typingDots:`${A}-typing-dots`,reasoning:`${A}-reasoning`,toolAskSummary:`${A}-ask-questions-summary`,toolAskOptions:`${A}-ask-questions-options-toggle`,toolCall:`${A}-tool-call`,source:`${A}-source`,operatorRequest:`${A}-operator-request`,operatorBanner:`${A}-operator-banner`,operatorCancelRequest:`${A}-operator-cancel-request`};function Se(e,t){return`${e}-${t}`}var Ao=S.cssPrefix;function zl({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:r}){let i=t.variant!=="circle"&&!!t.label;return a("button",{type:"button",class:`${Ao}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":r?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":w.launcher,onClick:e,"aria-label":n.launcherOpen,children:[kp(t.icon),i?a("span",{class:`${Ao}-fab-label`,children:Ae(n,t.label??"")}):null]})}function kp(e){let t=Hl[e];return t?a(t,{}):a(wp,{source:e})}function wp({source:e}){return a("span",{ref:t=>{t&&Cp(t,e)},"aria-hidden":"true"})}function Cp(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 Ul({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:r}){let[i,l]=R(!1);return E(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(r,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,r]),i?a("div",{class:`${Ao}-callout`,role:"status","data-shape":e.shape,"data-position":Tp(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":w.callout,children:[a("span",{children:Ae(n,e.text)}),a("button",{type:"button",class:`${Ao}-callout-close`,onClick:r,"aria-label":o,title:o,"data-testid":w.calloutDismiss,children:a(Je,{})})]}):null}function Tp(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Io({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:r,strings:i}){let l=S.cssPrefix,s=$(null);if(E(()=>{if(!e)return;let f=e.style;t.minWidth&&f.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&f.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&f.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&f.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(f.setProperty(`--${l}-widget-w`,`${o.width}px`),f.setProperty(`--${l}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,o]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),_=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,p=f=>{if(!e)return;let h=f.currentTarget,g=e.getBoundingClientRect();s.current={pointerId:f.pointerId,startX:f.clientX,startY:f.clientY,startW:g.width,startH:g.height,dirX:d?-1:1,dirY:c?1:-1},h.setPointerCapture(f.pointerId),e.setAttribute("data-resizing",""),f.preventDefault()},u=f=>{let h=s.current;if(!h||f.pointerId!==h.pointerId||!e)return;let g=(f.clientX-h.startX)*h.dirX,y=(f.clientY-h.startY)*h.dirY;e.style.setProperty(`--${l}-widget-w`,`${h.startW+g}px`),e.style.setProperty(`--${l}-widget-h`,`${h.startH+y}px`)},m=f=>{let h=s.current;if(!h||f.pointerId!==h.pointerId||!e)return;f.currentTarget.releasePointerCapture(f.pointerId),e.removeAttribute("data-resizing");let g=e.getBoundingClientRect();r({width:Math.round(g.width),height:Math.round(g.height)}),s.current=null};return a("div",{class:_,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:p,onPointerMove:u,onPointerUp:m,onPointerCancel:m,"data-testid":w.resizeGrip,children:a(bl,{})})}var Et=S.cssPrefix,Ep=`.${Et}-header, .${Et}-back-header, .${Et}-home-hero`,Rp='button, a, input, textarea, select, [role="tab"], [contenteditable]',ql=56;function Mo(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),r=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(Ep)||d.closest(Rp))return;let _=e.getBoundingClientRect();r={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Et}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Et}-modal-dy`)),maxX:(window.innerWidth+_.width)/2-ql,maxY:(window.innerHeight+_.height)/2-ql},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!r||c.pointerId!==r.id)return;let d=o(r.dx+c.clientX-r.x,r.maxX),_=o(r.dy+c.clientY-r.y,r.maxY);e.style.setProperty(`--${Et}-modal-dx`,`${d}px`),e.style.setProperty(`--${Et}-modal-dy`,`${_}px`)},s=c=>{!r||c.pointerId!==r.id||(r=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 En(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 Lo(e,t,n){return En("close",e,t)?n.includes("close"):!1}function Wl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Ap='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Oo(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Ap)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let r=o[0],i=o[o.length-1];if(!r||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===r?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),r.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function No(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var na=S.cssPrefix;function Vl({agent:e,strings:t}){let n=e.status??"online",o=Ae(t,e.name),r=e.title?Ae(t,e.title):null;return a("div",{class:`${na}-agent`,children:[a("div",{class:`${na}-agent-avatar`,"data-status":n,children:e.avatar?a("img",{src:e.avatar,alt:""}):a("span",{children:No(o)})}),a("div",{class:`${na}-agent-meta`,children:[a("strong",{children:o}),r?a("span",{children:r}):null]})]})}var Kl=H.scope("attachments");function Do(e,t,n){let o=Mp(e),r=[],i=[],l=Np(n.accept),s=t.reduce((d,_)=>d+_.size,0),c=t.length;for(let d of o){let _=Ip(d,c,s,n,l);if(_){i.push({file:d,reason:_});continue}r.push(Op(d)),s+=d.size,c+=1}return(r.length||i.length)&&Kl.debug("ingest",{accepted:r.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:r,rejected:i}}function oa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Kl.debug("revokeObjectURL failed",{error:t})}}function Ip(e,t,n,o,r){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Dp(e,r)?null:"mime"}function Mp(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Lp(t)).filter(t=>t!==null):[]}function Lp(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Op(e){return{file:e,id:Be(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Np(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("/"),r=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?r.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var Rn=S.cssPrefix;function Gl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return a("span",{class:`${Rn}-attachment-chip`,title:e.name,"data-testid":Se(w.attachmentChip,e.id),children:[n?a("img",{class:`${Rn}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${Rn}-attachment-thumb`,"aria-hidden":"true",children:a(El,{})}),a("span",{class:`${Rn}-attachment-name`,children:e.name}),a("button",{type:"button",class:`${Rn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":Se(w.attachmentRemove,e.id),children:a(Je,{})})]})}var ra={isSupported:!1,start:()=>{},stop:()=>{}};function aa(e,t,n){return e==="disabled"?ra:e==="server"?Hp(n):$p(t)}function $p(e){let t=Fp();if(!t)return ra;let n=null;return{isSupported:!0,start(o,r){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let _=s.resultIndex;_<s.results.length;_++){let p=s.results[_];p&&(c+=p[0].transcript,p.isFinal&&(d=!0))}o(c,d)});let i=()=>{n=null,r()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function Fp(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Bp=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Hp(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ra;let t=null,n=null,o=[],r=()=>{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=zp();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";r();let d=new Blob(o,{type:c});o=[];try{let{text:_}=await e(d,c);_&&i(_,!0)}catch{}finally{l()}}),t.start()}catch{r(),l()}},stop(){t?.stop()}}}function zp(){for(let e of Bp)if(MediaRecorder.isTypeSupported(e))return e}var Fe=S.cssPrefix,Rt=H.scope("composer");function Yt(e){return e.reduce((t,n)=>t+n.size,0)}var Up={arrowUp:dl,paperPlane:cl,send:ul,chevron:Xt};function jl({options:e,transport:t,feedback:n,bus:o,isStreaming:r,operatorRequestEnabled:i,controlMode:l,onRequestOperator:s,onSend:c,onStop:d,attachApiRef:_}){let p=e.strings,[u,m]=R(""),[f,h]=R([]),[g,y]=R(!1),x=$(null),v=$(null),P=e.features.fileUpload,D=e.features.voice,[V,j]=R(()=>aa(D,e.locale,(O,T)=>t.transcribe(O,T)));E(()=>{g||D==="disabled"||j(aa(D,e.locale,(O,T)=>t.transcribe(O,T)))},[e.locale,D,t,g]),E(()=>{let O=x.current;if(!O)return;let T=O.getRootNode(),U="activeElement"in T?T.activeElement:null;U&&O.closest(`.${Fe}-panel`)?.contains(U)||O.focus({preventScroll:!0})},[]),E(()=>{let O=x.current;if(!O)return;if(u.length===0){O.style.height="";return}O.style.height="auto";let T=parseFloat(getComputedStyle(O).fontSize)*.7,U=Math.min(O.scrollHeight,160);O.style.height=`${U<40+T?40:U}px`},[u]);let te=$(f);te.current=f,E(()=>()=>te.current.forEach(oa),[]),E(()=>{if(_)return _.current={attachFromDrop:O=>{let T=Do(O,te.current,e.attachments);T.accepted.length!==0&&(Rt.info("attach (drop)",{count:T.accepted.length,totalBytes:Yt(T.accepted)}),o.emit("attach",{count:T.accepted.length,totalBytes:Yt(T.accepted)}),h(U=>[...U,...T.accepted]))},fill:O=>{m(O);let T=x.current;T&&(T.focus({preventScroll:!0}),requestAnimationFrame(()=>T.setSelectionRange(T.value.length,T.value.length)))}},()=>{_.current&&(_.current=null)}},[_,e.attachments]),E(()=>{let O=x.current;if(!O)return;let T=O.closest(`.${Fe}-panel`);if(!T)return;let U=Y=>{let _e=Y.clipboardData;if(!_e)return;let Ce=Y.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(Ce&&Ce!==O)return;if(P){let Pe=Do(_e.items,te.current,e.attachments);if(Pe.accepted.length>0){Y.preventDefault(),Rt.info("attach (paste)",{count:Pe.accepted.length,totalBytes:Yt(Pe.accepted)}),o.emit("attach",{count:Pe.accepted.length,totalBytes:Yt(Pe.accepted)}),h(Te=>[...Te,...Pe.accepted]);return}}if(Ce===O)return;let ze=_e.getData("text/plain");ze&&(Y.preventDefault(),m(Pe=>Pe+ze),O.focus())};return T.addEventListener("paste",U),()=>T.removeEventListener("paste",U)},[P,e.attachments,Fe]);let oe=()=>{let O=u.trim();!O&&f.length===0||r||(c(O,f),m(""),h([]))},L=O=>{O.key!=="Enter"||O.shiftKey||O.isComposing||(O.preventDefault(),r?d():oe())},I=O=>{let T=O.target,U=Do(T.files,f,e.attachments);U.accepted.length>0&&(Rt.info("attach (file picker)",{count:U.accepted.length,totalBytes:Yt(U.accepted)}),o.emit("attach",{count:U.accepted.length,totalBytes:Yt(U.accepted)}),h(Y=>[...Y,...U.accepted])),T.value=""},X=O=>{Rt.info("removeAttachment",{id:O}),o.emit("removeAttachment",{id:O}),h(T=>{let U=T.find(Y=>Y.id===O);return U&&oa(U),T.filter(Y=>Y.id!==O)})},W=$(null),Oe=()=>{if(V.isSupported){if(g){let O=W.current?Date.now()-W.current:0;Rt.info("voiceStop",{durationMs:O}),o.emit("voiceStop",{durationMs:O}),V.stop(),y(!1),n.play("voiceStop"),W.current=null;return}W.current=Date.now(),Rt.info("voiceStart"),o.emit("voiceStart",void 0),y(!0),n.play("voiceStart"),V.start((O,T)=>m(U=>T?`${U}${O} `:U),()=>{if(y(!1),W.current){let O=Date.now()-W.current;Rt.debug("voiceStop (auto)",{durationMs:O}),o.emit("voiceStop",{durationMs:O}),W.current=null}})}},Ne=Up[e.composer.sendButton.icon];return a("div",{class:`${Fe}-composer`,"data-testid":w.composer,children:[f.length>0?a("div",{class:`${Fe}-attachments`,children:f.map(O=>a(Gl,{attachment:O,onRemove:()=>X(O.id)},O.id))}):null,a("div",{class:`${Fe}-composer-row`,children:[a("div",{class:`${Fe}-composer-actions`,children:[P?a("button",{type:"button",class:`${Fe}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":p.attach,"data-testid":w.composerAttach,children:a(pl,{})}):null,V.isSupported?a("button",{type:"button",class:`${Fe}-icon-btn`,onClick:Oe,"aria-label":g?p.micStop:p.micStart,"aria-pressed":g,"data-recording":g?"true":void 0,"data-testid":w.composerVoice,children:a(fl,{})}):null,i&&l==="ai-agent"&&s?a("button",{type:"button",class:`${Fe}-icon-btn`,onClick:s,"aria-label":p.talkToOperator,title:p.talkToOperator,"data-testid":w.operatorRequest,children:a(ea,{})}):null]}),a("textarea",{ref:x,class:`${Fe}-textarea`,rows:1,value:u,placeholder:p.composerPlaceholder,onInput:O=>m(O.target.value),onKeyDown:L,"aria-label":p.composerPlaceholder,"data-testid":w.composerInput}),r?a("button",{type:"button",class:`${Fe}-send`,onClick:d,"aria-label":p.stop,"data-testid":w.composerStop,children:a(_l,{})}):a("button",{type:"button",class:`${Fe}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:oe,disabled:!u.trim()&&f.length===0,"aria-label":p.send,"data-testid":w.composerSend,children:a(Ne,{})})]}),a("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:I,class:`${Fe}-sr-only`,"data-testid":w.composerFileInput})]})}var qp=S.cssPrefix;function Xl({visible:e,strings:t}){return e?a("div",{class:`${qp}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function $o({containerRef:e,onDrop:t}){let[n,o]=R(!1);return E(()=>{let r=e.current;if(!r)return;let i=0,l=_=>{i+=1,_.dataTransfer?.types.includes("Files")&&(_.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=_=>{_.dataTransfer?.types.includes("Files")&&_.preventDefault()},d=_=>{i=0,o(!1),_.dataTransfer&&(_.preventDefault(),t(_.dataTransfer.items))};return r.addEventListener("dragenter",l),r.addEventListener("dragleave",s),r.addEventListener("dragover",c),r.addEventListener("drop",d),()=>{r.removeEventListener("dragenter",l),r.removeEventListener("dragleave",s),r.removeEventListener("dragover",c),r.removeEventListener("drop",d)}},[e,t]),{visible:n}}function Yl({itemCount:e,initialFocusIndex:t}){let[n,o]=R(!1),r=$(null),i=$(null),[l,s]=R(-1),c=N(()=>{o(!1),s(-1),r.current?.focus()},[]),d=N(()=>o(u=>!u),[]);E(()=>{if(!n)return;let u=m=>{let f=i.current,h=r.current;if(!f||!h)return;let g=m.composedPath();g.includes(f)||g.includes(h)||(o(!1),s(-1))};return document.addEventListener("click",u,!0),()=>document.removeEventListener("click",u,!0)},[n]),E(()=>{if(!n||e===0)return;let u=t?.()??0,m=u<0||u>=e?0:u;s(m)},[n,e,t]),E(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let _=N(u=>{(u.key==="ArrowDown"||u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o(!0))},[]),p=N(u=>{if(e!==0)switch(u.key){case"Escape":u.preventDefault(),c();return;case"ArrowDown":u.preventDefault(),s(m=>(m+1)%e);return;case"ArrowUp":u.preventDefault(),s(m=>(m-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:r,menuRef:i,toggle:d,close:c,onTriggerKey:_,onMenuKey:p}}function Jl({items:e,triggerLabel:t}){let n=S.cssPrefix,o=Yl({itemCount:e.length}),r=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 _=Math.max(0,d.findIndex(u=>u.value===c.value)),p=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")p=(_+1)%d.length;else if(s.key==="ArrowLeft")p=(_-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[p].value)};return a("div",{class:`${n}-menu-wrap`,children:[a("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:a(yl,{})}),o.open?a("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?a("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?a("span",{class:`${n}-menu-icon`,children:s.icon}):null,a("span",{class:`${n}-menu-label`,children:s.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${w.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>r(s),children:[s.icon?a("span",{class:`${n}-menu-icon`,children:s.icon}):null,a("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(Ct,{})}):null]},s.id))}):null]})}var ia=S.cssPrefix;function Wp(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 Vp={normal:"large",large:"small",small:"normal"};function Kp(e){return e==="light"?a(Ml,{}):e==="dark"?a(Ll,{}):a(Ol,{})}function Gp(e){return(e.split("-")[0]??e).toUpperCase()}function Qe({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:r,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:_,onLocaleChange:p,onThemeChange:u,onTextSizeChange:m}=e,f=n.strings,h=n.mode,g=t==="chat",y=Z(()=>r.mutedSig.value).value,x=new Set(n.actions),v=W=>x.has(W),P=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,D=W=>P?!1:En(W,h,o),V=n.themeMode,j={auto:f.themeAuto,light:f.themeLight,dark:f.themeDark},te=n.textSize,oe={small:f.textSizeSmall,normal:f.textSizeNormal,large:f.textSizeLarge},L=[];if(g&&v("clear")&&L.push({id:"clear",icon:a(Tl,{}),label:f.newConversation,onSelect:l}),v("expand")&&D("expand")){let W=o==="expanded";L.push({id:"expand",icon:W?a(gl,{}):a(ml,{}),label:W?f.collapse:f.expand,type:"switch",on:W,onSelect:s})}if(v("fullscreen")&&D("fullscreen")){let W=o==="fullscreen";L.push({id:"fullscreen",icon:W?a(vl,{}):a(hl,{}),label:W?f.exitFullscreen:f.fullscreen,type:"switch",on:W,onSelect:c})}g&&v("sound")&&L.push({id:"sound",icon:y?a(xl,{}):a(Pl,{}),label:y?f.soundOff:f.soundOn,type:"switch",on:!y,onSelect:d}),v("theme")&&L.push({id:"theme",icon:Kp(V),label:`${f.theme}: ${j[V]}`,onSelect:()=>u(Wp(V)),keepOpen:!0}),v("textSize")&&L.push({id:"textSize",icon:a(Sl,{}),label:`${f.textSize}: ${oe[te]}`,onSelect:()=>m(Vp[te]),keepOpen:!0}),v("language")&&n.availableLocales.length>1&&L.push({id:"language",icon:a(Cl,{}),label:f.language,segments:n.availableLocales.map(W=>({value:W,label:Gp(W),lang:W})),value:n.locale,onSelectValue:p});let I=!!i&&Lo(h,o,n.actions),X=g&&v("history");return a("div",{class:`${ia}-header-actions`,children:[X?a("button",{type:"button",class:`${ia}-icon-btn`,onClick:_,"aria-label":f.history,title:f.history,"data-testid":w.actionHistory,children:a(wl,{})}):null,L.length>0?a(Jl,{items:L,triggerLabel:f.moreActions}):null,I?a("button",{type:"button",class:`${ia}-icon-btn`,onClick:i,"aria-label":f.close,title:f.close,"data-testid":w.actionClose,children:a(Je,{})}):null]})}var jp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Xp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Yp=/^[+]?[\d\s().-]{6,}$/;function Jt(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function Jp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function Qp(e,t,n){let o=e.required??!0,r=e.validation;if(e.type==="multiselect"){let l=Jp(t);return o&&l===0?n.formRequired:l===0?void 0:r?.minSelections!=null&&l<r.minSelections?Jt(n.formChooseAtLeast,{min:r.minSelections}):r?.maxSelections!=null&&l>r.maxSelections?Jt(n.formChooseAtMost,{max:r.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!jp.test(i))return n.formInvalidEmail;break;case"url":if(!Xp.test(i))return n.formInvalidUrl;break;case"tel":if(!Yp.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(r?.min!=null&&l<r.min)return Jt(n.formNumberTooSmall,{min:r.min});if(r?.max!=null&&l>r.max)return Jt(n.formNumberTooLarge,{max:r.max});break}default:break}if(r?.minLength!=null&&i.length<r.minLength)return Jt(n.formTooShort,{min:r.minLength});if(r?.maxLength!=null&&i.length>r.maxLength)return Jt(n.formTooLong,{max:r.maxLength});if(r?.pattern)try{if(!new RegExp(r.pattern).test(i))return n.formPatternMismatch}catch{}}function Ql(e,t,n){let o={};for(let r of e){let i=Qp(r,t[r.name],n);i&&(o[r.name]=i)}return o}function Zl(e){let t={};for(let[n,o]of Object.entries(e)){let r=Array.isArray(o)?o.join(", "):o;r&&r.trim()&&(t[n]=r.trim())}return t}var le=S.cssPrefix,Fo="__other__";function An({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:r,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:_,fieldTypeLabels:p,rootTestId:u,submitTestId:m,skipTestId:f}){let[h,g]=R(()=>({...nf(e),...d})),[y,x]=R({}),[v,P]=R({}),D=L=>{v[L]&&P(I=>({...I,[L]:""}))},V=(L,I)=>{g(X=>({...X,[L]:I})),D(L)},j=(L,I)=>{x(X=>({...X,[L]:I})),D(L)},te=L=>{if(L.preventDefault(),c)return;let I=of(e,h,y),X=Ql(e,I,t);if(Object.keys(X).length>0){P(X);return}o(Zl(I))},oe=L=>{!s||L.key!=="Enter"||L.shiftKey||L.isComposing||L.target?.tagName==="TEXTAREA"&&te(L)};return a("form",{class:`${le}-form`,onSubmit:te,onKeyDown:oe,"data-testid":u,noValidate:!0,children:[e.map(L=>a(Zp,{field:L,value:h[L.name],otherText:y[L.name]??"",error:v[L.name],disabled:c,typeLabel:p?.[L.name],strings:t,onChange:I=>V(L.name,I),onOtherChange:I=>j(L.name,I)},L.name)),_?null:a("div",{class:`${le}-form-actions`,children:[l?a("span",{class:`${le}-form-hint`,children:l}):null,r&&i?a("button",{type:"button",class:`${le}-form-skip`,onClick:i,disabled:c,"data-testid":f,children:r}):null,a("button",{type:"submit",class:`${le}-form-submit`,disabled:c,"data-testid":m,children:n})]})]})}function Zp({field:e,value:t,otherText:n,error:o,disabled:r,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=Se(w.formField,e.name),_=ef({field:e,value:t,otherText:n,disabled:r,strings:l,onChange:s,onOtherChange:c,fieldTid:d});return a("label",{class:`${le}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[a("span",{class:`${le}-field-head`,children:[a("span",{class:`${le}-field-label`,children:[e.label,e.required??!0?a("span",{class:`${le}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${le}-field-type`,children:i}):null]}),_,e.validationHint&&!o?a("span",{class:`${le}-field-hint`,children:e.validationHint}):null,o?a("span",{class:`${le}-field-error`,role:"alert",children:o}):null]})}function ef(e){let{field:t,value:n,otherText:o,disabled:r,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${le}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:r,onInput:_=>l(_.target.value),"data-testid":c});case"select":return a("select",{class:`${le}-field-input`,value:d,disabled:r,onChange:_=>l(_.target.value),"data-testid":c,children:[a("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(_=>a("option",{value:_.value,children:_.label??_.value},_.value))]});case"radio":{let _=t.allowOther&&d===Fo;return a("div",{class:`${le}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(p=>a("label",{class:`${le}-choice`,children:[a("input",{type:"radio",name:`${le}-${t.name}`,checked:d===p.value,disabled:r,onChange:()=>l(p.value)}),a("span",{children:p.label??p.value})]},p.value)),t.allowOther?a("label",{class:`${le}-choice`,children:[a("input",{type:"radio",name:`${le}-${t.name}`,checked:d===Fo,disabled:r,onChange:()=>l(Fo)}),a("span",{children:i.formOther})]}):null,_?a("input",{class:`${le}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:r,onInput:p=>s(p.target.value)}):null]})}case"checkbox":return a("label",{class:`${le}-choice`,children:[a("input",{type:"checkbox",checked:d==="true",disabled:r,onChange:_=>l(_.target.checked?"true":""),"data-testid":c}),a("span",{children:t.placeholder??t.label})]});case"multiselect":{let _=Array.isArray(n)?n:[],p=(u,m)=>l(m?[..._,u]:_.filter(f=>f!==u));return a("div",{class:`${le}-field-choices`,"data-testid":c,children:[(t.options??[]).map(u=>a("label",{class:`${le}-choice`,children:[a("input",{type:"checkbox",checked:_.includes(u.value),disabled:r,onChange:m=>p(u.value,m.target.checked)}),a("span",{children:u.label??u.value})]},u.value)),t.allowOther||(t.options??[]).length===0?a("textarea",{class:`${le}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:r,onInput:u=>s(u.target.value)}):null]})}default:return a("input",{class:`${le}-field-input`,type:tf(t.type),value:d,placeholder:t.placeholder,disabled:r,onInput:_=>l(_.target.value),"data-testid":c})}}function tf(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function nf(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 of(e,t,n){let o={...t};for(let r of e){let i=n[r.name]?.trim();if(r.type==="radio"&&r.allowOther&&t[r.name]===Fo)o[r.name]=i??"";else if(r.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[r.name])?t[r.name]:[];o[r.name]=[...s,...l]}}return o}var Ze=S.cssPrefix;function sa({form:e,strings:t,onSubmit:n,onSkip:o}){return a("div",{class:`${Ze}-form-gate`,"data-testid":w.formGate,children:[e.title?a("h3",{class:`${Ze}-form-gate-title`,children:e.title}):null,e.description?a("p",{class:`${Ze}-form-gate-desc`,children:e.description}):null,a(An,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?o:void 0,submitTestId:w.formSubmit,skipTestId:w.formSkip})]})}function ec({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",r=o?t.formSkipped:t.formSubmitted,i=e.title?a(ee,{children:[a("span",{children:e.title}),a("span",{class:`${Ze}-sr-only`,children:r})]}):a("span",{children:r}),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(_=>_.name===d)?.label??d;return a("details",{class:`${Ze}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,children:[a("summary",{class:`${Ze}-form-done-summary`,"data-testid":w.formDoneToggle,children:[a(Ct,{}),i,a(Xt,{})]}),a("dl",{class:`${Ze}-form-answers`,"data-testid":w.formAnswers,children:Object.entries(s).map(([d,_])=>a("div",{class:`${Ze}-form-answer`,children:[a("dt",{children:c(d)}),a("dd",{children:_})]},d))})]})}return a("div",{class:`${Ze}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,role:"status",children:[o?a(kl,{}):a(Ct,{}),i,o&&e.form?.reopenable&&n?a("button",{type:"button",class:`${Ze}-form-done-fill`,"data-testid":w.formFill,onClick:n,children:t.formFillOut}):null]})}function sf(e,t){for(var n in t)e[n]=t[n];return e}function ca(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function tc(e,t){this.props=e,this.context=t}function cc(e,t){function n(r){var i=this.props.ref;return i!=r.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,r)||i!=r.ref:ca(this.props,r)}function o(r){return this.shouldComponentUpdate=n,ot(e,r)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o}(tc.prototype=new Me).isPureReactComponent=!0,tc.prototype.shouldComponentUpdate=function(e,t){return ca(this.props,e)||ca(this.state,t)};var nc=z.__b;z.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),nc&&nc(e)};var ty=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var lf=z.__e;z.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),r.__c(e,t)}lf(e,t,n,o)};var oc=z.unmount;function dc(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=sf({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return dc(o,t,n)})),e}function uc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return uc(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function la(){this.__u=0,this.o=null,this.__b=null}function _c(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Bo(){this.i=null,this.l=null}z.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),oc&&oc(e)},(la.prototype=new Me).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=_c(o.__v),i=!1,l=function(){i||o.__z||(i=!0,n.__R=null,r?r(c):c())};n.__R=l;var s=n.__P;n.__P=null;var c=function(){if(!--o.__u){if(o.state.__a){var d=o.state.__a;o.__v.__k[0]=uc(d,d.__c.__P,d.__c.__O)}var _;for(o.setState({__a:o.__b=null});_=o.o.pop();)_.__P=s,_.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},la.prototype.componentWillUnmount=function(){this.o=[]},la.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=dc(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&ot(ee,null,e.fallback);return r&&(r.__u&=-33),[ot(ee,null,t.__a?null:e.children),r]};var rc=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Bo.prototype=new Me).__a=function(e){var t=this,n=_c(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),rc(t,e,o)):r()};n?n(i):i()}},Bo.prototype.render=function(e){this.i=null,this.l=new Map;var t=mn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Bo.prototype.componentDidUpdate=Bo.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){rc(e,n,t)})};var cf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,df=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,uf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,_f=/[A-Z0-9]/g,pf=typeof document<"u",ff=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Me.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Me.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ac=z.event;z.event=function(e){return ac&&(e=ac(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var pc,mf={configurable:!0,get:function(){return this.class}},ic=z.vnode;z.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,r={},i=o.indexOf("-")==-1;for(var l in n){var s=n[l];if(!(l==="value"&&"defaultValue"in n&&s==null||pf&&l==="children"&&o==="noscript"||l==="class"||l==="className")){var c=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&s===!0?s="":c==="translate"&&s==="no"?s=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?l="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||ff(n.type)?c==="onfocus"?l="onfocusin":c==="onblur"?l="onfocusout":uf.test(l)&&(l=c):c=l="oninput":i&&df.test(l)?l=l.replace(_f,"-$&").toLowerCase():s===null&&(s=void 0),c==="oninput"&&r[l=c]&&(l="oninputCapture"),r[l]=s}}o=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=mn(n.children).forEach(function(d){d.props.selected=r.value.indexOf(d.props.value)!=-1})),r.defaultValue!=null&&(r.value=mn(n.children).forEach(function(d){d.props.selected=r.multiple?r.defaultValue.indexOf(d.props.value)!=-1:r.defaultValue==d.props.value}))),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",mf)):n.className&&(r.class=r.className=n.className),t.props=r})(e),e.$$typeof=cf,ic&&ic(e)};var sc=z.__r;z.__r=function(e){sc&&sc(e),pc=e.__c};var lc=z.diffed;z.diffed=function(e){lc&&lc(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),pc=null};function fc(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var qe=S.cssPrefix;function ua(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function Ho(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 _a({status:e,icon:t,label:n}){return a("span",{class:`${qe}-toolui-badge ${qe}-toolui-status`,"data-status":e,children:[a("span",{class:`${qe}-toolui-status-icon`,children:t}),n]})}function gf(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 pa(e,t,n={}){return bf(gf(e,t),n.superseded,n.live??!0)}function hf({status:e}){return e==="denied"||e==="error"||e==="superseded"?a(Ro,{}):e==="completed"||e==="responded"?a(Eo,{}):a(Bl,{})}function vf(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 bf(e,t,n){return t&&(e==="awaiting"||e==="running")?"superseded":!n&&e==="running"?"error":e}function yf({state:e,approval:t,strings:n,superseded:o,live:r=!0}){let i=pa(e,t,{superseded:o,live:r});return a(_a,{status:i,icon:a(hf,{status:i}),label:vf(i,n)})}function Pf({name:e,state:t,approval:n,strings:o,superseded:r,live:i}){return a(ee,{children:[a("span",{class:`${qe}-toolui-name-pill`,children:[a(Fl,{}),a("span",{class:`${qe}-toolui-name-text`,children:e})]}),a(yf,{state:t,approval:n,strings:o,superseded:r,live:i}),a("span",{class:`${qe}-toolui-chevron`,children:a(Tt,{})})]})}function zo({part:e,strings:t,testid:n,superseded:o,live:r}){let i=Z(()=>e.inputSig.value),l=Z(()=>e.outputSig.value),s=Z(()=>e.errorSig.value),c=Z(()=>e.stateSig.value),d=Z(()=>e.approvalSig.value);return a("details",{class:`${qe}-toolui ${qe}-toolui-collapsible`,"data-testid":n,children:[a("summary",{class:`${qe}-toolui-head`,children:a(Pf,{name:ua(e.toolName),state:c.value,approval:d.value,strings:t,superseded:o,live:r})}),a(da,{label:t.toolParameters,value:i.value}),l.value!==void 0?a(da,{label:t.toolResult,value:l.value}):null,s.value?a(da,{label:t.statusError,value:s.value,error:!0}):null]})}function da({label:e,value:t,error:n}){let o=n?String(t??""):Uo(fa(t));return o?a("div",{class:`${qe}-toolui-section`,children:[a("span",{class:`${qe}-toolui-label`,children:e}),a("pre",{class:`${qe}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function fa(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Uo(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""}}function mc(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function gc(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function hc(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function vc(e,t){let n=e.stateSig.value,o=e.approvalSig.value,{terminal:r,responded:i,decided:l}=Ho(n,o),s=t.superseded&&!l;return{pill:pa(n,o,{superseded:s,live:t.live}),state:n,terminal:r,decided:l,showApproveReject:!l&&!t.superseded,showAnswered:i&&!r&&!s,showEdit:i&&t.active&&!r,skipped:s,answeredApproved:o?.approved}}var ha=1,yc=2,Pc=4,xc=8,Sc=16;function xf(e){switch(e){case ha:return"href";case yc:return"src";case Pc:return"class";case xc:return"checked";case Sc:return"start"}}var Sf=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}},kf=Sf;var bc=24;function ba(e){let t=new Uint32Array(bc);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(bc),indent:"",indent_len:0,table_state:0}}function kc(e){e.pending.length>0&&Re(e,`
|
|
12
|
-
`)}function re(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
|
|
13
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){
|
|
14
|
-
`:if(e.hr_chars<3)break;
|
|
15
|
-
`:{
|
|
16
|
-
`:e.table_state=2,e.pending="";continue;default:
|
|
17
|
-
`:
|
|
18
|
-
`:
|
|
11
|
+
${r}`:r;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 Ds.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Ds.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function K_(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 Fs=e=>e&&Object.keys(e).length>0?e:void 0;function Bs(e,t){let n=Fs(e),o=Fs(t);if(!n&&!o)return;let r={};return n&&(r.user=n),o&&(r.page=o),K_(JSON.stringify(r))}function xo(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function G_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Hs(e){return e.startsWith("tool-")?e.slice(5):e}var Ne={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",cancelRequestOperator:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},zs="context";function pt(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 So(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:r,label:i,text:l}=o;typeof i!="string"||!i||n.push({id:typeof r=="string"&&r?r:`s${n.length}`,label:i,text:typeof l=="string"&&l?l:i})}return n}function Yr(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:Y_(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",responseType:"ack"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let r=e.tools?.map(X_).filter(i=>i!==null);return r?.length&&(n.data={tools:r}),n}function j_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function X_(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function Y_(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"&&j_(n)){let o={type:G_(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=z.scope("transport"),J_=6e4,Q_=1e4,Us=3,Z_=400,ep=new Set([408,425,429,500,502,503,504]);function qs(e){return Z_*2**e+Math.floor(Math.random()*250)}function tp(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}var ko=class{constructor(t){K(this,"ttlMs",t);K(this,"map",new Map)}getOrFetch(t,n){let o=this.map.get(t);if(o&&Date.now()-o.at<this.ttlMs)return o.result;let r={at:Date.now(),result:n().then(i=>(r.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,r),r.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()}},wo=class{constructor(t){K(this,"opts",t);K(this,"visitorId");K(this,"conversationId");K(this,"userContext");K(this,"pageContext");K(this,"locale");K(this,"conversationsCache",new ko(Q_));K(this,"loadConversationInflight",new Map);K(this,"contentCache",new ko(J_))}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:zt};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Bs(this.userContext,this.pageContext);return n&&(t[zs]=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,r]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,r);return n.toString()}async handshake(t){J.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(Ne.handshake,t,"handshake");return J.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),rp(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.${op(n)}`),o.append("mimeType",n);let r=await this.postForm(this.transcribePath,o,"transcribe");return J.debug("transcribe \u2190",{textLen:r.text.length}),r}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(Ne.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"),r=o.conversations??[];return J.debug("listConversations \u2190",{count:r.length,nextCursor:o.nextCursor}),{conversations:r,nextCursor:o.nextCursor}}async loadConversation(t){let n=this.loadConversationInflight.get(t);if(n)return n;let o=this.loadConversationDirect(t).finally(()=>this.loadConversationInflight.delete(t));return this.loadConversationInflight.set(t,o),o}async loadConversationDirect(t){let n=new URL(this.url(Ne.listMessages));n.searchParams.set("conversationId",t),J.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),r=o.messages??[];return J.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:r.length,hasSuggestions:!!o.suggestions}),{...o,messages:r,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(Ne.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(Ne.requestOperator,{},"requestOperator")).controlState}catch(t){J.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelRequestOperator(){if(!(!this.visitorId||!this.conversationId)){J.debug("cancelRequestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Ne.cancelRequestOperator,{},"cancelRequestOperator")).controlState}catch(t){J.debug("cancelRequestOperator failed (non-fatal)",{err:t});return}}}listContent(t={}){return this.contentCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchContent(t))}async fetchContent(t){let n=new URL(this.dataUrl(Ne.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"),r=(o.items??[]).map(i=>_i(i,this.locale));return J.debug("listContent \u2190",{count:r.length,total:o.pagination?.total}),{...o,items:r}}async bootstrap(t){let n=new URL(this.dataUrl(Ne.bootstrap));t&&n.searchParams.set("conversationId",t),J.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),r=o.forms??[],i=o.formSubmissions??[];return J.debug("bootstrap \u2190",{forms:r.length,formSubmissions:i.length}),{forms:r,formSubmissions:i}}async saveUserPrefs(t){J.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(Ne.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??Ne.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(Ne.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){J.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(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(r=>r.code)});let n=await this.fetchImpl(this.url(Ne.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t))});if(n.status===409){let r=await n.json().catch(()=>{});if(np(r))return J.debug("message conflict already owned by server \u2014 awaiting resume",{error:r.error,originalStreamId:r.originalStreamId}),{status:"accepted",conversationId:t.conversationId}}return{status:"accepted",conversationId:(await this.assertOk(n,"sendTurn")).conversationId??t.conversationId}}cancelTurn(t){!this.visitorId||!t||(J.debug("cancel stream",{conversationId:t,visitorId:this.visitorId}),this.fetchImpl(this.url(Ne.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({conversationId:t})),keepalive:!0}).catch(n=>J.debug("cancel POST failed (non-fatal)",{err:n})))}async connectResumeStream(t){let n;try{n=await this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(o){return t.signal.aborted||J.debug("resume-stream fetch failed \u2014 reconnecting",{err:o}),"held"}if(!n.ok||!n.body)return J.debug("resume-stream \u2192 endpoint unavailable",{status:n.status}),"unavailable";if(!(n.headers.get("content-type")??"").includes("text/event-stream"))return J.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";t.onConnected();try{for await(let{chunk:o}of $s(n,t.signal)){if(t.signal.aborted)return"held";t.onChunk(o)}}catch(o){if(t.signal.aborted)return"held";J.debug("resume-stream segment dropped \u2014 reconnecting",{err:o})}return"held"}resumeUrl(){return this.withEnvelopeQuery(Ne.streamResume)}async postJson(t,n,o){let r=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(r,o)}async postForm(t,n,o){let r=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(r,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[r,i]=t(),l;try{l=await this.fetchImpl(r,i)}catch(c){if(o>=Us)throw new Je(`${n} failed: network error`,"network",void 0,c);J.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Xt(qs(o));continue}if(l.ok||!ep.has(l.status)||o>=Us)return l;let s=tp(l.headers)??qs(o);J.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await Xt(s)}}async assertOk(t,n){if(!t.ok)throw new Je(`${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 np(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"error"),n=Reflect.get(e,"message");return(t==="DUPLICATE_REQUEST"||t==="TOOL_APPROVAL_CONFLICT")&&typeof n=="string"}function op(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 rp(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function Vs(e,t){let n=e?[{kind:"text",id:"t0",textSig:W(e),doneSig:W(!0)}]:[];return{id:ze(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:W(n)}}function kt(){return{id:ze(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:W([])}}function Ks(e){let t=ze();return ap({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function ap(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:W(e.parts.map(_p))}}var Gs=new Set(["completed","failed","canceled"]);function ip(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status!=null&&!Gs.has(e.status)?"streaming":"complete"}function sp(e){let t=new Set,n=e.parts.map((r,i)=>r.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:W(r.text),doneSig:W(!0)}:r.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:W(r.text),doneSig:W(r.state!=="streaming")}:r.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:r.type==="file"?{kind:"file",url:r.url,mediaType:r.mediaType}:r.type==="source-url"?{kind:"source",sourceId:r.sourceId,url:r.url,title:r.title}:r.type==="source-document"?{kind:"source",sourceId:r.sourceId,title:r.title,filename:r.filename,mediaType:r.mediaType}:r.type==="data-suggestions"?null:r.type.startsWith("tool-")?{kind:"tool",toolCallId:r.toolCallId,toolName:Hs(r.type),inputPartialSig:W(""),inputSig:W(r.input),outputSig:W(r.output),errorSig:W(r.errorText),stateSig:W(r.state),approvalSig:W(r.approval)}:null).filter(r=>r!==null).filter(r=>r.kind!=="source"?!0:t.has(r.sourceId)?!1:(t.add(r.sourceId),!0)),o=e.parts.find(r=>r.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:o?.type==="data-suggestions"?So(o.data):void 0,serverMessageId:e.id,createdAt:xo(e.createdAt)??Date.now(),status:ip(e),canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:W(n)}}function lp(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 cp(e){return e.role==="assistant"&&e.status!=null&&!Gs.has(e.status)&&lp(e)}function kn(e){let t=e.length-1;return e.filter((n,o)=>o===t||!cp(n)).map(sp)}function js(e,t){return(!t&&e.at(-1)?.role==="assistant"?e.slice(0,-1):e).filter(o=>!o.ephemeral)}function Qr(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(pp)}}function Ue(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function wt(e){return Ue(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function dp(e){return Ue(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function Xs(e){return e.status!=="streaming"&&wt(e)}function Ys(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}var Co=e=>e.kind==="tool",Js=e=>e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"||e.kind==="source";function Qs(e){let t=e.partsSig.value,n=t.findLastIndex(o=>o.kind==="tool");return t.slice(n+1).some(Js)}function wn(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(Co);return t.length>0&&t.every(n=>Ys(n.stateSig.value))}function Zr(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!Qs(e)}function Zs(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||Js(n))}function To(e){return e.partsSig.value.some(t=>Co(t)&&!Ys(t.stateSig.value))}function el(e){return wn(e)&&!Qs(e)}function tl(e,t){let n=t.filter(s=>!s.ephemeral&&(s.status==="streaming"||wt(s))),o=new Map(n.filter(s=>s.serverMessageId!==void 0).map(s=>[s.serverMessageId,s])),r=new Set,i=e.map(s=>{let c=s.serverMessageId!==void 0?o.get(s.serverMessageId):void 0;return c===void 0||(r.add(s.serverMessageId),c.role!==s.role)?s:c.status==="streaming"||Ue(c).length>=Ue(s).length?c:(s.id=c.id,s)}),l=n.filter(s=>s.serverMessageId===void 0||!r.has(s.serverMessageId));return[...i,...l]}function nl(e,t){let n=new Map(t.filter(d=>d.serverMessageId!==void 0).map(d=>[d.serverMessageId,d])),o=new Set(e.flatMap(d=>[d.serverMessageId,d.id].filter(_=>_!==void 0))),r=!1,i=e.map(d=>{if(d.serverMessageId===void 0)return d;let _=n.get(d.serverMessageId);if(_===void 0||_.role!==d.role)return d;let p=Ue(_).length,u=Ue(d).length,f=_.status!=="streaming"&&p>=u&&up(d,_),m=d.status==="streaming"&&_.status!=="streaming"&&p>=u;return p>u||f||m?(r=!0,_.id=d.id,_):d}),l=[...n.values()].filter(d=>!o.has(d.serverMessageId)),s=i.at(-1),c=l.at(-1);return s?.role==="assistant"&&s.status==="streaming"&&s.serverMessageId===void 0&&c?.role==="assistant"&&c.status!=="streaming"&&Ue(c).length>=Ue(s).length&&(c.id=s.id,i.splice(-1,1,...l),l.length=0,r=!0),{messages:r||l.length?[...i,...l]:e,changed:r||l.length>0}}var Ws={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function up(e,t){let n=new Map(e.partsSig.value.filter(Co).map(o=>[o.toolCallId,o]));return t.partsSig.value.filter(Co).some(o=>{let r=n.get(o.toolCallId);if(!r||Ws[o.stateSig.value]>Ws[r.stateSig.value])return!0;let i=o.approvalSig.value?.approved;return i!==void 0&&i!==r.approvalSig.value?.approved})}function mt(e){return e.role==="assistant"&&e.status!=="streaming"&&!wt(e)}function ol(e){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!dp(e)}function rl(e,t){return e.operatorRoutedTurn?mt(e)?"drop":"complete-operator-routed":t||mt(e)?"error":"complete"}function _p(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:W(e.text),doneSig:W(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:W(e.inputPartial),inputSig:W(e.input),outputSig:W(e.output),errorSig:W(e.error),stateSig:W(e.state),approvalSig:W(e.approval)}:e}function pp(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 al=z.scope("feedback:audio"),Eo=class{constructor(){K(this,"ctx",null);K(this,"master",null);K(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){al.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 r=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(),_=r+s*i;d.gain.setValueAtTime(1e-4,_),d.gain.exponentialRampToValueAtTime(t.peakGain,_+.005),d.gain.exponentialRampToValueAtTime(1e-4,_+i),c.connect(d).connect(o),c.start(_),c.stop(_+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let r=await this.getBuffer(t);if(!r)return;let i=n.createBufferSource();i.buffer=r,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,r=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=>(al.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,r),r}};var il={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},sl={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 ft=null,Ro=0;function mp(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function fp(){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=`__${S.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 ll(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(mp())try{navigator.vibrate(e);return}catch{}if(ft||(ft=fp()),!!ft)try{ft.label.click()}catch{}}}function cl(){Ro++;let e=!1;return()=>{e||(e=!0,Ro=Math.max(0,Ro-1),Ro===0&&ft&&(ft.input.remove(),ft.label.remove(),ft=null))}}var gp=z.scope("feedback"),hp=100,Ao=class{constructor(t,n){K(this,"mutedSig",W(!1));K(this,"audio",new Eo);K(this,"releaseHaptics");K(this,"sound");K(this,"haptics");K(this,"lastPlayed",new Map);K(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=cl(),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<hp}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(r=>gp.warn("audio play failed",{err:r,url:n}));return}let o=sl[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?il[t]:n;ll(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}};var vp=0;function a(e,t,n,o,r,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:--vp,__i:-1,__u:0,__source:r,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return U.vnode&&U.vnode(d),d}var H={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Cn=`${S.cssPrefix}-icon-dir`,ea=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Qe=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})}),dl=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})}),ul=()=>a("svg",{...H,class:Cn,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]}),_l=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})}),pl=()=>a("svg",{...H,class:Cn,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})}),Yt=()=>a("svg",{...H,class:Cn,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})}),ml=()=>a("svg",{...H,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),fl=()=>a("svg",{...H,"aria-hidden":"true",children:a("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"})}),gl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),a("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),hl=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),vl=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),bl=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),yl=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),Pl=()=>a("svg",{...H,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),xl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),Sl=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),kl=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),wl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),a("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),Cl=()=>a("svg",{...H,class:Cn,"aria-hidden":"true",children:a("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Ct=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})}),Tl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M3 3v6h6"}),a("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),a("path",{d:"M12 7v5l3 2"})]}),El=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M2 12h20"}),a("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"})]}),Tn=()=>a("svg",{...H,class:Cn,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Rl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M12 20h9"}),a("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Tt=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})}),Al=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),a("path",{d:"M14 2v6h6"})]}),bp=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),a("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),ta=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),En=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),a("path",{d:"M12 17h.01"})]}),yp=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"m15 4 3 3-9 9-3-3z"}),a("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),Pp=()=>a("svg",{...H,"aria-hidden":"true",children:[a("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),a("path",{d:"M12 8V4"}),a("circle",{cx:"12",cy:"3",r:"1"}),a("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),na=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),a("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),a("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),a("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),xp=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("circle",{cx:"12",cy:"12",r:"4"}),a("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"})]}),oa=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]}),Il=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Ml=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M3 9.5 12 3l9 6.5"}),a("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Ll=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"m3 11 15-5v12L3 13z"}),a("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),a("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),a("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Rn=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),a("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),Ol=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"4"}),a("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"})]}),Nl=()=>a("svg",{...H,"aria-hidden":"true",children:a("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Dl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 3v18"}),a("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),Sp=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),a("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),a("path",{d:"m20 20-4.4-4.4"})]}),kp=()=>a("svg",{...H,"aria-hidden":"true",children:[a("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"}),a("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),wp=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M4 18h16"}),a("path",{d:"M5 18a7 7 0 0 1 14 0"}),a("path",{d:"M12 8V6"}),a("path",{d:"M10 6h4"})]}),Cp=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),a("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"})]}),$l=()=>a("svg",{...H,"aria-hidden":"true",children:[a("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),a("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),Fl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),a("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"})]}),Bl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),a("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"})]}),Hl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"3.5"}),a("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"})]}),zl=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]}),Io=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Mo=()=>a("svg",{...H,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]}),Ul={chat:ea,message:ta,bubbles:Rn,spark:bp,wand:yp,bot:Pp,help:En,lifebuoy:xp,headset:na,search:Sp,sparkles:kp,concierge:wp,wave:Cp};var I=S.cssPrefix,w={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`,typingDots:`${I}-typing-dots`,reasoning:`${I}-reasoning`,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`,operatorCancelRequest:`${I}-operator-cancel-request`};function Ce(e,t){return`${e}-${t}`}var Lo=S.cssPrefix;function ql({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:r}){let i=t.variant!=="circle"&&!!t.label;return a("button",{type:"button",class:`${Lo}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":r?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":w.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Tp(t.icon),i?a("span",{class:`${Lo}-fab-label`,children:Me(n,t.label??"")}):null]})}function Tp(e){let t=Ul[e];return t?a(t,{}):a(Ep,{source:e})}function Ep({source:e}){return a("span",{ref:t=>{t&&Rp(t,e)},"aria-hidden":"true"})}function Rp(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 Wl({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:r}){let[i,l]=R(!1);return E(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(r,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,r]),i?a("div",{class:`${Lo}-callout`,role:"status","data-shape":e.shape,"data-position":Ap(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":w.callout,children:[a("span",{children:Me(n,e.text)}),a("button",{type:"button",class:`${Lo}-callout-close`,onClick:r,"aria-label":o,title:o,"data-testid":w.calloutDismiss,children:a(Qe,{})})]}):null}function Ap(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Oo({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:r,strings:i}){let l=S.cssPrefix,s=B(null);if(E(()=>{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"),_=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,p=m=>{if(!e)return;let h=m.currentTarget,g=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:g.width,startH:g.height,dirX:d?-1:1,dirY:c?1:-1},h.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},u=m=>{let h=s.current;if(!h||m.pointerId!==h.pointerId||!e)return;let g=(m.clientX-h.startX)*h.dirX,y=(m.clientY-h.startY)*h.dirY;e.style.setProperty(`--${l}-widget-w`,`${h.startW+g}px`),e.style.setProperty(`--${l}-widget-h`,`${h.startH+y}px`)},f=m=>{let h=s.current;if(!h||m.pointerId!==h.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let g=e.getBoundingClientRect();r({width:Math.round(g.width),height:Math.round(g.height)}),s.current=null};return a("div",{class:_,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:p,onPointerMove:u,onPointerUp:f,onPointerCancel:f,"data-testid":w.resizeGrip,children:a(Pl,{})})}var Et=S.cssPrefix,Ip=`.${Et}-header, .${Et}-back-header, .${Et}-home-hero`,Mp='button, a, input, textarea, select, [role="tab"], [contenteditable]',Vl=56;function No(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),r=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(Ip)||d.closest(Mp))return;let _=e.getBoundingClientRect();r={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Et}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Et}-modal-dy`)),maxX:(window.innerWidth+_.width)/2-Vl,maxY:(window.innerHeight+_.height)/2-Vl},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!r||c.pointerId!==r.id)return;let d=o(r.dx+c.clientX-r.x,r.maxX),_=o(r.dy+c.clientY-r.y,r.maxY);e.style.setProperty(`--${Et}-modal-dx`,`${d}px`),e.style.setProperty(`--${Et}-modal-dy`,`${_}px`)},s=c=>{!r||c.pointerId!==r.id||(r=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 An(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 Do(e,t,n){return An("close",e,t)?n.includes("close"):!1}function Kl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Lp='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function $o(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Lp)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let r=o[0],i=o[o.length-1];if(!r||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===r?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),r.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Fo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var ra=S.cssPrefix;function Gl({agent:e,strings:t}){let n=e.status??"online",o=Me(t,e.name),r=e.title?Me(t,e.title):null;return a("div",{class:`${ra}-agent`,children:[a("div",{class:`${ra}-agent-avatar`,"data-status":n,children:e.avatar?a("img",{src:e.avatar,alt:""}):a("span",{children:Fo(o)})}),a("div",{class:`${ra}-agent-meta`,children:[a("strong",{children:o}),r?a("span",{children:r}):null]})]})}var jl=z.scope("attachments");function Bo(e,t,n){let o=Np(e),r=[],i=[],l=Fp(n.accept),s=t.reduce((d,_)=>d+_.size,0),c=t.length;for(let d of o){let _=Op(d,c,s,n,l);if(_){i.push({file:d,reason:_});continue}r.push($p(d)),s+=d.size,c+=1}return(r.length||i.length)&&jl.debug("ingest",{accepted:r.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:r,rejected:i}}function aa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){jl.debug("revokeObjectURL failed",{error:t})}}function Op(e,t,n,o,r){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Bp(e,r)?null:"mime"}function Np(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Dp(t)).filter(t=>t!==null):[]}function Dp(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function $p(e){return{file:e,id:ze(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Fp(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 Bp(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),r=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?r.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var In=S.cssPrefix;function Xl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return a("span",{class:`${In}-attachment-chip`,title:e.name,"data-testid":Ce(w.attachmentChip,e.id),children:[n?a("img",{class:`${In}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${In}-attachment-thumb`,"aria-hidden":"true",children:a(Al,{})}),a("span",{class:`${In}-attachment-name`,children:e.name}),a("button",{type:"button",class:`${In}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":Ce(w.attachmentRemove,e.id),children:a(Qe,{})})]})}var ia={isSupported:!1,start:()=>{},stop:()=>{}};function sa(e,t,n){return e==="disabled"?ia:e==="server"?qp(n):Hp(t)}function Hp(e){let t=zp();if(!t)return ia;let n=null;return{isSupported:!0,start(o,r){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let _=s.resultIndex;_<s.results.length;_++){let p=s.results[_];p&&(c+=p[0].transcript,p.isFinal&&(d=!0))}o(c,d)});let i=()=>{n=null,r()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function zp(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Up=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function qp(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ia;let t=null,n=null,o=[],r=()=>{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=Wp();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";r();let d=new Blob(o,{type:c});o=[];try{let{text:_}=await e(d,c);_&&i(_,!0)}catch{}finally{l()}}),t.start()}catch{r(),l()}},stop(){t?.stop()}}}function Wp(){for(let e of Up)if(MediaRecorder.isTypeSupported(e))return e}var Be=S.cssPrefix,Rt=z.scope("composer");function Jt(e){return e.reduce((t,n)=>t+n.size,0)}var Vp={arrowUp:_l,paperPlane:ul,send:pl,chevron:Yt};function Yl({options:e,transport:t,feedback:n,bus:o,isStreaming:r,operatorRequestEnabled:i,controlMode:l,onRequestOperator:s,onSend:c,onStop:d,attachApiRef:_}){let p=e.strings,[u,f]=R(""),[m,h]=R([]),[g,y]=R(!1),P=B(null),v=B(null),x=e.features.fileUpload,D=e.features.voice,[j,V]=R(()=>sa(D,e.locale,(L,C)=>t.transcribe(L,C)));E(()=>{g||D==="disabled"||V(sa(D,e.locale,(L,C)=>t.transcribe(L,C)))},[e.locale,D,t,g]),E(()=>{let L=P.current;if(!L)return;let C=L.getRootNode(),q="activeElement"in C?C.activeElement:null;q&&L.closest(`.${Be}-panel`)?.contains(q)||L.focus({preventScroll:!0})},[]),E(()=>{let L=P.current;if(!L)return;if(u.length===0){L.style.height="";return}L.style.height="auto";let C=parseFloat(getComputedStyle(L).fontSize)*.7,q=Math.min(L.scrollHeight,160);L.style.height=`${q<40+C?40:q}px`},[u]);let ne=B(m);ne.current=m,E(()=>()=>ne.current.forEach(aa),[]),E(()=>{if(_)return _.current={attachFromDrop:L=>{let C=Bo(L,ne.current,e.attachments);C.accepted.length!==0&&(Rt.info("attach (drop)",{count:C.accepted.length,totalBytes:Jt(C.accepted)}),o.emit("attach",{count:C.accepted.length,totalBytes:Jt(C.accepted)}),h(q=>[...q,...C.accepted]))},fill:L=>{f(L);let C=P.current;C&&(C.focus({preventScroll:!0}),requestAnimationFrame(()=>C.setSelectionRange(C.value.length,C.value.length)))}},()=>{_.current&&(_.current=null)}},[_,e.attachments]),E(()=>{let L=P.current;if(!L)return;let C=L.closest(`.${Be}-panel`);if(!C)return;let q=G=>{let oe=G.clipboardData;if(!oe)return;let ye=G.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(ye&&ye!==L)return;if(x){let Se=Bo(oe.items,ne.current,e.attachments);if(Se.accepted.length>0){G.preventDefault(),Rt.info("attach (paste)",{count:Se.accepted.length,totalBytes:Jt(Se.accepted)}),o.emit("attach",{count:Se.accepted.length,totalBytes:Jt(Se.accepted)}),h(Re=>[...Re,...Se.accepted]);return}}if(ye===L)return;let ce=oe.getData("text/plain");ce&&(G.preventDefault(),f(Se=>Se+ce),L.focus())};return C.addEventListener("paste",q),()=>C.removeEventListener("paste",q)},[x,e.attachments,Be]);let le=()=>{let L=u.trim();!L&&m.length===0||r||(c(L,m),f(""),h([]))},O=L=>{L.key!=="Enter"||L.shiftKey||L.isComposing||(L.preventDefault(),r?d():le())},A=L=>{let C=L.target,q=Bo(C.files,m,e.attachments);q.accepted.length>0&&(Rt.info("attach (file picker)",{count:q.accepted.length,totalBytes:Jt(q.accepted)}),o.emit("attach",{count:q.accepted.length,totalBytes:Jt(q.accepted)}),h(G=>[...G,...q.accepted])),C.value=""},Y=L=>{Rt.info("removeAttachment",{id:L}),o.emit("removeAttachment",{id:L}),h(C=>{let q=C.find(G=>G.id===L);return q&&aa(q),C.filter(G=>G.id!==L)})},$=B(null),me=()=>{if(j.isSupported){if(g){let L=$.current?Date.now()-$.current:0;Rt.info("voiceStop",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),j.stop(),y(!1),n.play("voiceStop"),$.current=null;return}$.current=Date.now(),Rt.info("voiceStart"),o.emit("voiceStart",void 0),y(!0),n.play("voiceStart"),j.start((L,C)=>f(q=>C?`${q}${L} `:q),()=>{if(y(!1),$.current){let L=Date.now()-$.current;Rt.debug("voiceStop (auto)",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),$.current=null}})}},De=Vp[e.composer.sendButton.icon];return a("div",{class:`${Be}-composer`,"data-testid":w.composer,children:[m.length>0?a("div",{class:`${Be}-attachments`,children:m.map(L=>a(Xl,{attachment:L,onRemove:()=>Y(L.id)},L.id))}):null,a("div",{class:`${Be}-composer-row`,children:[a("div",{class:`${Be}-composer-actions`,children:[x?a("button",{type:"button",class:`${Be}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":p.attach,"data-testid":w.composerAttach,children:a(fl,{})}):null,j.isSupported?a("button",{type:"button",class:`${Be}-icon-btn`,onClick:me,"aria-label":g?p.micStop:p.micStart,"aria-pressed":g,"data-recording":g?"true":void 0,"data-testid":w.composerVoice,children:a(gl,{})}):null,i&&l==="ai-agent"&&s?a("button",{type:"button",class:`${Be}-icon-btn`,onClick:s,"aria-label":p.talkToOperator,title:p.talkToOperator,"data-testid":w.operatorRequest,children:a(na,{})}):null]}),a("textarea",{ref:P,class:`${Be}-textarea`,rows:1,value:u,placeholder:p.composerPlaceholder,onInput:L=>f(L.target.value),onKeyDown:O,"aria-label":p.composerPlaceholder,"data-testid":w.composerInput}),r?a("button",{type:"button",class:`${Be}-send`,onClick:d,"aria-label":p.stop,"data-testid":w.composerStop,children:a(ml,{})}):a("button",{type:"button",class:`${Be}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:le,disabled:!u.trim()&&m.length===0,"aria-label":p.send,"data-testid":w.composerSend,children:a(De,{})})]}),a("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:A,class:`${Be}-sr-only`,"data-testid":w.composerFileInput})]})}var Kp=S.cssPrefix;function Jl({visible:e,strings:t}){return e?a("div",{class:`${Kp}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Ho({containerRef:e,onDrop:t}){let[n,o]=R(!1);return E(()=>{let r=e.current;if(!r)return;let i=0,l=_=>{i+=1,_.dataTransfer?.types.includes("Files")&&(_.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=_=>{_.dataTransfer?.types.includes("Files")&&_.preventDefault()},d=_=>{i=0,o(!1),_.dataTransfer&&(_.preventDefault(),t(_.dataTransfer.items))};return r.addEventListener("dragenter",l),r.addEventListener("dragleave",s),r.addEventListener("dragover",c),r.addEventListener("drop",d),()=>{r.removeEventListener("dragenter",l),r.removeEventListener("dragleave",s),r.removeEventListener("dragover",c),r.removeEventListener("drop",d)}},[e,t]),{visible:n}}function Ql({itemCount:e,initialFocusIndex:t}){let[n,o]=R(!1),r=B(null),i=B(null),[l,s]=R(-1),c=N(()=>{o(!1),s(-1),r.current?.focus()},[]),d=N(()=>o(u=>!u),[]);E(()=>{if(!n)return;let u=f=>{let m=i.current,h=r.current;if(!m||!h)return;let g=f.composedPath();g.includes(m)||g.includes(h)||(o(!1),s(-1))};return document.addEventListener("click",u,!0),()=>document.removeEventListener("click",u,!0)},[n]),E(()=>{if(!n||e===0)return;let u=t?.()??0,f=u<0||u>=e?0:u;s(f)},[n,e,t]),E(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let _=N(u=>{(u.key==="ArrowDown"||u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o(!0))},[]),p=N(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:r,menuRef:i,toggle:d,close:c,onTriggerKey:_,onMenuKey:p}}function Zl({items:e,triggerLabel:t}){let n=S.cssPrefix,o=Ql({itemCount:e.length}),r=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 _=Math.max(0,d.findIndex(u=>u.value===c.value)),p=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")p=(_+1)%d.length;else if(s.key==="ArrowLeft")p=(_-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[p].value)};return a("div",{class:`${n}-menu-wrap`,children:[a("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:a(xl,{})}),o.open?a("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?a("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?a("span",{class:`${n}-menu-icon`,children:s.icon}):null,a("span",{class:`${n}-menu-label`,children:s.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${w.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>r(s),children:[s.icon?a("span",{class:`${n}-menu-icon`,children:s.icon}):null,a("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(Ct,{})}):null]},s.id))}):null]})}var la=S.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 jp={normal:"large",large:"small",small:"normal"};function Xp(e){return e==="light"?a(Ol,{}):e==="dark"?a(Nl,{}):a(Dl,{})}function Yp(e){return(e.split("-")[0]??e).toUpperCase()}function Ze({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:r,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:_,onLocaleChange:p,onThemeChange:u,onTextSizeChange:f}=e,m=n.strings,h=n.mode,g=t==="chat",y=ee(()=>r.mutedSig.value).value,P=new Set(n.actions),v=$=>P.has($),x=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,D=$=>x?!1:An($,h,o),j=n.themeMode,V={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},ne=n.textSize,le={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},O=[];if(g&&v("clear")&&O.push({id:"clear",icon:a(Rl,{}),label:m.newConversation,onSelect:l}),v("expand")&&D("expand")){let $=o==="expanded";O.push({id:"expand",icon:$?a(vl,{}):a(hl,{}),label:$?m.collapse:m.expand,type:"switch",on:$,onSelect:s})}if(v("fullscreen")&&D("fullscreen")){let $=o==="fullscreen";O.push({id:"fullscreen",icon:$?a(yl,{}):a(bl,{}),label:$?m.exitFullscreen:m.fullscreen,type:"switch",on:$,onSelect:c})}g&&v("sound")&&O.push({id:"sound",icon:y?a(kl,{}):a(Sl,{}),label:y?m.soundOff:m.soundOn,type:"switch",on:!y,onSelect:d}),v("theme")&&O.push({id:"theme",icon:Xp(j),label:`${m.theme}: ${V[j]}`,onSelect:()=>u(Gp(j)),keepOpen:!0}),v("textSize")&&O.push({id:"textSize",icon:a(wl,{}),label:`${m.textSize}: ${le[ne]}`,onSelect:()=>f(jp[ne]),keepOpen:!0}),v("language")&&n.availableLocales.length>1&&O.push({id:"language",icon:a(El,{}),label:m.language,segments:n.availableLocales.map($=>({value:$,label:Yp($),lang:$})),value:n.locale,onSelectValue:p});let A=!!i&&Do(h,o,n.actions),Y=g&&v("history");return a("div",{class:`${la}-header-actions`,children:[Y?a("button",{type:"button",class:`${la}-icon-btn`,onClick:_,"aria-label":m.history,title:m.history,"data-testid":w.actionHistory,children:a(Tl,{})}):null,O.length>0?a(Zl,{items:O,triggerLabel:m.moreActions}):null,A?a("button",{type:"button",class:`${la}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":w.actionClose,children:a(Qe,{})}):null]})}var Jp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Qp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Zp=/^[+]?[\d\s().-]{6,}$/;function Qt(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function em(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function tm(e,t,n){let o=e.required??!0,r=e.validation;if(e.type==="multiselect"){let l=em(t);return o&&l===0?n.formRequired:l===0?void 0:r?.minSelections!=null&&l<r.minSelections?Qt(n.formChooseAtLeast,{min:r.minSelections}):r?.maxSelections!=null&&l>r.maxSelections?Qt(n.formChooseAtMost,{max:r.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!Jp.test(i))return n.formInvalidEmail;break;case"url":if(!Qp.test(i))return n.formInvalidUrl;break;case"tel":if(!Zp.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(r?.min!=null&&l<r.min)return Qt(n.formNumberTooSmall,{min:r.min});if(r?.max!=null&&l>r.max)return Qt(n.formNumberTooLarge,{max:r.max});break}default:break}if(r?.minLength!=null&&i.length<r.minLength)return Qt(n.formTooShort,{min:r.minLength});if(r?.maxLength!=null&&i.length>r.maxLength)return Qt(n.formTooLong,{max:r.maxLength});if(r?.pattern)try{if(!new RegExp(r.pattern).test(i))return n.formPatternMismatch}catch{}}function ec(e,t,n){let o={};for(let r of e){let i=tm(r,t[r.name],n);i&&(o[r.name]=i)}return o}function tc(e){let t={};for(let[n,o]of Object.entries(e)){let r=Array.isArray(o)?o.join(", "):o;r&&r.trim()&&(t[n]=r.trim())}return t}var ue=S.cssPrefix,zo="__other__";function Mn({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:r,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:_,fieldTypeLabels:p,rootTestId:u,submitTestId:f,skipTestId:m}){let[h,g]=R(()=>({...am(e),...d})),[y,P]=R({}),[v,x]=R({}),D=O=>{v[O]&&x(A=>({...A,[O]:""}))},j=(O,A)=>{g(Y=>({...Y,[O]:A})),D(O)},V=(O,A)=>{P(Y=>({...Y,[O]:A})),D(O)},ne=O=>{if(O.preventDefault(),c)return;let A=im(e,h,y),Y=ec(e,A,t);if(Object.keys(Y).length>0){x(Y);return}o(tc(A))},le=O=>{!s||O.key!=="Enter"||O.shiftKey||O.isComposing||O.target?.tagName==="TEXTAREA"&&ne(O)};return a("form",{class:`${ue}-form`,onSubmit:ne,onKeyDown:le,"data-testid":u,noValidate:!0,children:[e.map(O=>a(nm,{field:O,value:h[O.name],otherText:y[O.name]??"",error:v[O.name],disabled:c,typeLabel:p?.[O.name],strings:t,onChange:A=>j(O.name,A),onOtherChange:A=>V(O.name,A)},O.name)),_?null:a("div",{class:`${ue}-form-actions`,children:[l?a("span",{class:`${ue}-form-hint`,children:l}):null,r&&i?a("button",{type:"button",class:`${ue}-form-skip`,onClick:i,disabled:c,"data-testid":m,children:r}):null,a("button",{type:"submit",class:`${ue}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function nm({field:e,value:t,otherText:n,error:o,disabled:r,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=Ce(w.formField,e.name),_=om({field:e,value:t,otherText:n,disabled:r,strings:l,onChange:s,onOtherChange:c,fieldTid:d});return a("label",{class:`${ue}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[a("span",{class:`${ue}-field-head`,children:[a("span",{class:`${ue}-field-label`,children:[e.label,e.required??!0?a("span",{class:`${ue}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${ue}-field-type`,children:i}):null]}),_,e.validationHint&&!o?a("span",{class:`${ue}-field-hint`,children:e.validationHint}):null,o?a("span",{class:`${ue}-field-error`,role:"alert",children:o}):null]})}function om(e){let{field:t,value:n,otherText:o,disabled:r,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${ue}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:r,onInput:_=>l(_.target.value),"data-testid":c});case"select":return a("select",{class:`${ue}-field-input`,value:d,disabled:r,onChange:_=>l(_.target.value),"data-testid":c,children:[a("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(_=>a("option",{value:_.value,children:_.label??_.value},_.value))]});case"radio":{let _=t.allowOther&&d===zo;return a("div",{class:`${ue}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(p=>a("label",{class:`${ue}-choice`,children:[a("input",{type:"radio",name:`${ue}-${t.name}`,checked:d===p.value,disabled:r,onChange:()=>l(p.value)}),a("span",{children:p.label??p.value})]},p.value)),t.allowOther?a("label",{class:`${ue}-choice`,children:[a("input",{type:"radio",name:`${ue}-${t.name}`,checked:d===zo,disabled:r,onChange:()=>l(zo)}),a("span",{children:i.formOther})]}):null,_?a("input",{class:`${ue}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:r,onInput:p=>s(p.target.value)}):null]})}case"checkbox":return a("label",{class:`${ue}-choice`,children:[a("input",{type:"checkbox",checked:d==="true",disabled:r,onChange:_=>l(_.target.checked?"true":""),"data-testid":c}),a("span",{children:t.placeholder??t.label})]});case"multiselect":{let _=Array.isArray(n)?n:[],p=(u,f)=>l(f?[..._,u]:_.filter(m=>m!==u));return a("div",{class:`${ue}-field-choices`,"data-testid":c,children:[(t.options??[]).map(u=>a("label",{class:`${ue}-choice`,children:[a("input",{type:"checkbox",checked:_.includes(u.value),disabled:r,onChange:f=>p(u.value,f.target.checked)}),a("span",{children:u.label??u.value})]},u.value)),t.allowOther||(t.options??[]).length===0?a("textarea",{class:`${ue}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:r,onInput:u=>s(u.target.value)}):null]})}default:return a("input",{class:`${ue}-field-input`,type:rm(t.type),value:d,placeholder:t.placeholder,disabled:r,onInput:_=>l(_.target.value),"data-testid":c})}}function rm(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function am(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 im(e,t,n){let o={...t};for(let r of e){let i=n[r.name]?.trim();if(r.type==="radio"&&r.allowOther&&t[r.name]===zo)o[r.name]=i??"";else if(r.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[r.name])?t[r.name]:[];o[r.name]=[...s,...l]}}return o}var et=S.cssPrefix;function ca({form:e,strings:t,onSubmit:n,onSkip:o}){return a("div",{class:`${et}-form-gate`,"data-testid":w.formGate,children:[e.title?a("h3",{class:`${et}-form-gate-title`,children:e.title}):null,e.description?a("p",{class:`${et}-form-gate-desc`,children:e.description}):null,a(Mn,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?o:void 0,submitTestId:w.formSubmit,skipTestId:w.formSkip})]})}function nc({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",r=o?t.formSkipped:t.formSubmitted,i=e.title?a(Z,{children:[a("span",{children:e.title}),a("span",{class:`${et}-sr-only`,children:r})]}):a("span",{children:r}),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(_=>_.name===d)?.label??d;return a("details",{class:`${et}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,children:[a("summary",{class:`${et}-form-done-summary`,"data-testid":w.formDoneToggle,children:[a(Ct,{}),i,a(Yt,{})]}),a("dl",{class:`${et}-form-answers`,"data-testid":w.formAnswers,children:Object.entries(s).map(([d,_])=>a("div",{class:`${et}-form-answer`,children:[a("dt",{children:c(d)}),a("dd",{children:_})]},d))})]})}return a("div",{class:`${et}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,role:"status",children:[o?a(Cl,{}):a(Ct,{}),i,o&&e.form?.reopenable&&n?a("button",{type:"button",class:`${et}-form-done-fill`,"data-testid":w.formFill,onClick:n,children:t.formFillOut}):null]})}function cm(e,t){for(var n in t)e[n]=t[n];return e}function ua(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function oc(e,t){this.props=e,this.context=t}function uc(e,t){function n(r){var i=this.props.ref;return i!=r.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,r)||i!=r.ref:ua(this.props,r)}function o(r){return this.shouldComponentUpdate=n,rt(e,r)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o}(oc.prototype=new Oe).isPureReactComponent=!0,oc.prototype.shouldComponentUpdate=function(e,t){return ua(this.props,e)||ua(this.state,t)};var rc=U.__b;U.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),rc&&rc(e)};var ry=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var dm=U.__e;U.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),r.__c(e,t)}dm(e,t,n,o)};var ac=U.unmount;function _c(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=cm({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return _c(o,t,n)})),e}function pc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return pc(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function da(){this.__u=0,this.o=null,this.__b=null}function mc(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Uo(){this.i=null,this.l=null}U.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ac&&ac(e)},(da.prototype=new Oe).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=mc(o.__v),i=!1,l=function(){i||o.__z||(i=!0,n.__R=null,r?r(c):c())};n.__R=l;var s=n.__P;n.__P=null;var c=function(){if(!--o.__u){if(o.state.__a){var d=o.state.__a;o.__v.__k[0]=pc(d,d.__c.__P,d.__c.__O)}var _;for(o.setState({__a:o.__b=null});_=o.o.pop();)_.__P=s,_.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},da.prototype.componentWillUnmount=function(){this.o=[]},da.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=_c(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&rt(Z,null,e.fallback);return r&&(r.__u&=-33),[rt(Z,null,t.__a?null:e.children),r]};var ic=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Uo.prototype=new Oe).__a=function(e){var t=this,n=mc(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),ic(t,e,o)):r()};n?n(i):i()}},Uo.prototype.render=function(e){this.i=null,this.l=new Map;var t=gn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Uo.prototype.componentDidUpdate=Uo.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){ic(e,n,t)})};var um=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_m=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,pm=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,mm=/[A-Z0-9]/g,fm=typeof document<"u",gm=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Oe.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Oe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var sc=U.event;U.event=function(e){return sc&&(e=sc(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var fc,hm={configurable:!0,get:function(){return this.class}},lc=U.vnode;U.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,r={},i=o.indexOf("-")==-1;for(var l in n){var s=n[l];if(!(l==="value"&&"defaultValue"in n&&s==null||fm&&l==="children"&&o==="noscript"||l==="class"||l==="className")){var c=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&s===!0?s="":c==="translate"&&s==="no"?s=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?l="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||gm(n.type)?c==="onfocus"?l="onfocusin":c==="onblur"?l="onfocusout":pm.test(l)&&(l=c):c=l="oninput":i&&_m.test(l)?l=l.replace(mm,"-$&").toLowerCase():s===null&&(s=void 0),c==="oninput"&&r[l=c]&&(l="oninputCapture"),r[l]=s}}o=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=gn(n.children).forEach(function(d){d.props.selected=r.value.indexOf(d.props.value)!=-1})),r.defaultValue!=null&&(r.value=gn(n.children).forEach(function(d){d.props.selected=r.multiple?r.defaultValue.indexOf(d.props.value)!=-1:r.defaultValue==d.props.value}))),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",hm)):n.className&&(r.class=r.className=n.className),t.props=r})(e),e.$$typeof=um,lc&&lc(e)};var cc=U.__r;U.__r=function(e){cc&&cc(e),fc=e.__c};var dc=U.diffed;U.diffed=function(e){dc&&dc(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),fc=null};function gc(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var We=S.cssPrefix;function pa(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function qo(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 ma({status:e,icon:t,label:n}){return a("span",{class:`${We}-toolui-badge ${We}-toolui-status`,"data-status":e,children:[a("span",{class:`${We}-toolui-status-icon`,children:t}),n]})}function vm(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 fa(e,t,n={}){return n.submitted?"responded":Pm(vm(e,t),n.superseded,n.live??!0)}function bm({status:e}){return e==="denied"||e==="error"||e==="superseded"?a(Mo,{}):e==="completed"||e==="responded"?a(Io,{}):a(zl,{})}function ym(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 Pm(e,t,n){return t&&(e==="awaiting"||e==="running")?"superseded":!n&&e==="running"?"error":e}function xm({state:e,approval:t,strings:n,superseded:o,live:r=!0,submitted:i=!1}){let l=fa(e,t,{superseded:o,live:r,submitted:i});return a(ma,{status:l,icon:a(bm,{status:l}),label:ym(l,n)})}function Sm({name:e,state:t,approval:n,strings:o,superseded:r,live:i,submitted:l}){return a(Z,{children:[a("span",{class:`${We}-toolui-name-pill`,children:[a(Hl,{}),a("span",{class:`${We}-toolui-name-text`,children:e})]}),a(xm,{state:t,approval:n,strings:o,superseded:r,live:i,submitted:l}),a("span",{class:`${We}-toolui-chevron`,children:a(Tt,{})})]})}function Wo({part:e,strings:t,testid:n,superseded:o,live:r,submitted:i}){let l=ee(()=>e.inputSig.value),s=ee(()=>e.outputSig.value),c=ee(()=>e.errorSig.value),d=ee(()=>e.stateSig.value),_=ee(()=>e.approvalSig.value);return a("details",{class:`${We}-toolui ${We}-toolui-collapsible`,"data-testid":n,children:[a("summary",{class:`${We}-toolui-head`,children:a(Sm,{name:pa(e.toolName),state:d.value,approval:_.value,strings:t,superseded:o,live:r,submitted:i})}),a(_a,{label:t.toolParameters,value:l.value}),s.value!==void 0?a(_a,{label:t.toolResult,value:s.value}):null,c.value?a(_a,{label:t.statusError,value:c.value,error:!0}):null]})}function _a({label:e,value:t,error:n}){let o=n?String(t??""):Vo(ga(t));return o?a("div",{class:`${We}-toolui-section`,children:[a("span",{class:`${We}-toolui-label`,children:e}),a("pre",{class:`${We}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function ga(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Vo(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""}}function hc(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function vc(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function km(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function bc(e){let{streaming:t,reasoningVisible:n,emptyReply:o,hidden:r}=e,i=e.responseMode==="buffered"&&t,l=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:i,reasoningVisible:n,working:l,showStreamDots:km({streaming:t,bufferedHold:i,reasoningVisible:n,working:l}),emptyReply:o,hidden:r}}function yc(e,t){let n=e.stateSig.value,o=e.approvalSig.value,{terminal:r,responded:i,decided:l}=qo(n,o),s=t.continuationStreaming===!0&&!l,c=t.superseded&&!l&&!s;return{pill:fa(n,o,{superseded:c,live:t.live,submitted:s}),state:n,terminal:r,decided:l||s,showApproveReject:!l&&!t.superseded&&!s,showAnswered:i&&!r&&!c,showSubmitted:s,showEdit:i&&t.active&&!r,skipped:c,answeredApproved:o?.approved}}var ba=1,xc=2,Sc=4,kc=8,wc=16;function wm(e){switch(e){case ba:return"href";case xc:return"src";case Sc:return"class";case kc:return"checked";case wc:return"start"}}var Cm=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}},Tm=Cm;var Pc=24;function Pa(e){let t=new Uint32Array(Pc);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(Pc),indent:"",indent_len:0,table_state:0}}function Cc(e){e.pending.length>0&&Ie(e,`
|
|
12
|
+
`)}function re(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 be(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function ae(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&be(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function Em(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function At(e,t){for(e.fence_start=0;e.len>t;)be(e)}function Ko(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;)be(e);return t}function ha(e,t){let n=-1,o=-1;for(let r=e.blockquote_idx+1;r<=e.len;r+=1)if(e.tokens[r]===25){if(e.indent_len<e.spaces[r]){o=-1;break}o=r}else e.tokens[r]===t&&(n=r);return o===-1?n===-1?(At(e,e.blockquote_idx),ae(e,t),!0):(At(e,n),!1):(At(e,o),ae(e,t),!0)}function va(e,t){ae(e,25),e.spaces[e.len]=e.indent_len+t,st(e),e.token=103}function st(e){e.indent="",e.indent_len=0,e.pending=""}function ya(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 Rm(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 Am(e){return ya(e)||Rm(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 r=Ko(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],r>0&&Ie(e," ".repeat(r))}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){be(e),st(e),e.pending=n;continue}At(e,e.blockquote_idx),st(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" ":Ko(e,e.indent_len),ae(e,Tm(e.pending.length)),st(e);continue}break;case">":{let i=Em(e,20,e.blockquote_idx+1);i===-1?(At(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,ae(e,20)):e.blockquote_idx=i,st(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;Ko(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),st(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){ha(e,23),va(e,2),Ie(e,o.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=o,e.fence_start=o.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=o,e.fence_start=o.length):(ae(e,2),st(e),e.fence_start=0,Ie(e,o));continue;case`
|
|
15
|
+
`:{Ko(e,e.indent_len),ae(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,Sc,e.pending.slice(e.fence_start)),st(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;ha(e,23),va(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;ha(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,wc,e.pending.slice(0,-1)),va(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||ya(i)){e.pending=o;continue}}break;case"|":At(e,e.blockquote_idx),ae(e,27),ae(e,28),e.pending="",Ie(e,n);continue}let r=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}r=e.indent.slice(i)+o,ae(e,9)}else ae(e,2);st(e),Ie(e,r);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;case`
|
|
16
|
+
`:e.table_state=2,e.pending="";continue;default:be(e),e.table_state=0;break}else switch(e.pending){case"|":ae(e,28),e.pending="",Ie(e,n);continue;case`
|
|
17
|
+
`:be(e),e.pending="",e.table_state=0,Ie(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":ae(e,29),be(e),e.pending="",Ie(e,n);continue;case`
|
|
18
|
+
`:be(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Ie(e,n);continue;default:ae(e,29),Ie(e,n);continue}break;case 29:if(e.pending==="|"){re(e),be(e),e.pending="",Ie(e,n);continue}break;case 9:switch(o){case`
|
|
19
19
|
`:case`
|
|
20
20
|
`:case`
|
|
21
21
|
`:case`
|
|
@@ -25,18 +25,18 @@ ${r}`:r;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(t==="[DONE]")retu
|
|
|
25
25
|
`:case`
|
|
26
26
|
`:case`
|
|
27
27
|
`:case`
|
|
28
|
-
`:e.pending=o;continue;default:e.pending.length!==0?(re(e),
|
|
29
|
-
`:if(o.length===e.fence_start+e.fence_end+1){re(e),
|
|
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]===" ")?(re(e),
|
|
31
|
-
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,re(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,
|
|
32
|
-
`?(re(e),ae(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",
|
|
33
|
-
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,
|
|
34
|
-
`:e.pending=n;continue;default:let r=n.charCodeAt(0);e.pending="",e.text+=
|
|
28
|
+
`:e.pending=o;continue;default:e.pending.length!==0?(re(e),be(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=o;continue;case`
|
|
29
|
+
`:if(o.length===e.fence_start+e.fence_end+1){re(e),be(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
|
|
30
|
+
`){e.pending=o,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":o.length===e.fence_start+ +(e.pending[0]===" ")?(re(e),be(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,re(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,kc,""),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(re(e),i===n){be(e),e.pending="";continue}ae(e,l),e.pending=n;continue}break}case 12:case 13:{let i="*",l=14;switch(e.token===13&&(i="_",l=15),e.pending){case i:i===n?e.tokens[e.len-1]===l?e.pending=o:(re(e),ae(e,l),e.pending=""):(re(e),be(e),e.pending=n);continue;case i+i:let s=e.token;re(e),be(e),be(e),i!==n?(ae(e,s),e.pending=n):e.pending="";continue}break}case 16:if(o==="~~"){re(e),be(e),e.pending="";continue}break;case 105:n===`
|
|
32
|
+
`?(re(e),ae(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Ie(e,n));continue;case 30:if(o==="\\]"||o==="$$"){re(e),be(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){re(e),be(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(re(e),ae(e,18),e.pending=o,e.text=o):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=o:(e.token=e.tokens[e.len],Ie(e,n));continue;case 17:case 19:if(e.pending==="]"){re(e),n==="("?e.pending=o:(be(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?ba:xc,l=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,l),be(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
|
|
33
|
+
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,ba,e.pending),re(e),be(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===">"){re(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"(":re(e),ae(e,31),e.pending="";continue;case"[":e.token=105,e.pending=o;continue;case`
|
|
34
|
+
`:e.pending=n;continue;default:let r=n.charCodeAt(0);e.pending="",e.text+=ya(r)||r>=65&&r<=90||r>=97&&r<=122?o:n;continue}case`
|
|
35
35
|
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:re(e),At(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:re(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){re(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,re(e),ae(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 r=12,i=14,l=e.pending[0];if(l==="_"&&(r=13,i=15),e.pending.length===1){if(l===n){e.pending=o;continue}if(n!==" "&&n!==`
|
|
37
37
|
`){re(e),ae(e,r),e.pending=n;continue}}else{if(l===n){re(e),ae(e,i),ae(e,r),e.pending="";continue}if(n!==" "&&n!==`
|
|
38
38
|
`){re(e),ae(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=o;continue}}else if(n!==" "&&n!==`
|
|
39
|
-
`){re(e),ae(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=o;continue}else{if(Tf(n.charCodeAt(0)))break;re(e),ae(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){re(e),ae(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){re(e),ae(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}re(e)}function ya(e){return{add_token:Ef,end_token:Rf,add_text:Af,set_attr:If,data:{nodes:[e,,,,,],index:0}}}function Ef(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 r=o=document.createElement("input");r.type="checkbox",r.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 Rf(e){e.index-=1}function Af(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function If(e,t,n){e.nodes[e.index].setAttribute(xf(t),n)}function Wo({textSig:e,doneSig:t}){let n=$(null);return pt(()=>{let o=n.current;if(!o)return;o.classList.add(`${S.cssPrefix}-md`);let r=ya(o),i=ba(r),l=0,s=at(()=>{let _=e.value,p=t.value;_.length<l&&(o.replaceChildren(),r=ya(o),i=ba(r),l=0);let u=_.slice(l);u&&Re(i,u),l=_.length,p&&kc(i)}),c=new MutationObserver(_=>{for(let p of _)for(let u of p.addedNodes){if(!(u instanceof HTMLElement))continue;let m=u.matches?.("a")?[u]:[...u.querySelectorAll?.("a")??[]];for(let f of m)wc(f)}});c.observe(o,{childList:!0,subtree:!0});for(let _ of o.querySelectorAll("a"))wc(_);let d=_=>{let p=_.target?.closest?.("a");if(!p||!(p instanceof HTMLAnchorElement))return;let u=p.getAttribute("href")??"";!u||u.startsWith("#")||(_.preventDefault(),window.open(u,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),a("div",{ref:n})}function Cc({text:e}){let t=Ee(()=>q(e),[e]),n=Ee(()=>q(!0),[]);return a(Wo,{textSig:t,doneSig:n})}function wc(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var Vo=S.cssPrefix;function Tc({messageId:e,initial:t,strings:n,onFeedback:o}){let[r,i]=R(t),l=s=>{let c=r===s?null:s;i(c),o(e,c)};return a("div",{class:`${Vo}-feedback`,role:"group","data-testid":w.messageFeedback,children:[a("button",{type:"button",class:`${Vo}-msg-action`,"data-active":r==="up"?"true":void 0,"aria-pressed":r==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>l("up"),"data-testid":w.feedbackUp,children:a(Dl,{})}),a("button",{type:"button",class:`${Vo}-msg-action`,"data-active":r==="down"?"true":void 0,"aria-pressed":r==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>l("down"),"data-testid":w.feedbackDown,children:a($l,{})}),a("span",{class:`${Vo}-sr-only`,role:"status","aria-live":"polite",children:r?n.feedbackThanks:""})]})}var Qt=S.cssPrefix;function Ec({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${Qt}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":w.source,children:[a("span",{class:`${Qt}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${Qt}-source-label`,children:n})]}):a("span",{class:`${Qt}-source`,"data-testid":w.source,children:[a("span",{class:`${Qt}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${Qt}-source-label`,children:n})]})}var He=S.cssPrefix;function Rc({part:e,strings:t,active:n,superseded:o=!1,onDecision:r,onEdit:i}){let l=Z(()=>e.approvalSig.value),s=Z(()=>vc(e,{active:n,superseded:o})).value,{terminal:c,showApproveReject:d,showAnswered:_,showEdit:p,skipped:u}=s,m=ua(e.toolName),f=s.answeredApproved,h=e.toolCallId;return a("div",{class:`${He}-toolui-group`,"data-testid":s.decided?w.toolDecision:w.toolApproval,children:[a(zo,{part:e,strings:t,superseded:u}),u||c?null:a("div",{class:`${He}-toolui ${He}-toolui-body`,children:[_?a(ee,{children:[a("p",{class:`${He}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",f?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),p?a("p",{class:`${He}-toolui-subtle`,children:t.approvalEditHint}):null,p?null:a("p",{class:`${He}-toolui-subtle`,children:t.approvalSubmitting})]}):a(ee,{children:[a("p",{class:`${He}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",m)}),a("p",{class:`${He}-toolui-subtle`,children:t.approvalBody})]}),d?a("div",{class:`${He}-toolui-actions`,children:[a("button",{type:"button",class:`${He}-form-skip`,onClick:()=>r(h,!1),"data-testid":w.toolReject,children:t.reject}),a("button",{type:"button",class:`${He}-form-submit`,onClick:()=>r(h,!0),"data-testid":w.toolApprove,children:t.approve})]}):null,p?a("div",{class:`${He}-toolui-actions`,children:a("button",{type:"button",class:`${He}-form-skip`,onClick:()=>i(h),"data-testid":w.toolEdit,children:t.edit})}):null]})]})}var Lf=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Ac(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(Of).filter(r=>r!==null);return{intro:Ko(t.intro),questions:o}}function Of(e,t){if(!e||typeof e!="object")return null;let n=e,o=Lf.has(n.type)?n.type:"text";return{key:Ko(n.key)??`q${t+1}`,question:Ko(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(r=>typeof r=="string"&&r.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:Ko(n.helpText)}}function Nf(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 Pa(e,t,n){return e.questions.map(o=>{let r=Nf(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:r,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function Ko(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var ye=S.cssPrefix,Df={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Ic(e,t){let n={};for(let o of e)n[o.key]=t[Df[o.type]];return n}function Mc({part:e,strings:t,active:n,superseded:o=!1,onDecision:r,onEdit:i}){let l=Z(()=>e.stateSig.value).value,s=Z(()=>e.approvalSig.value).value,c=Z(()=>Ac(e.inputSig.value)).value,{terminal:d,decided:_}=Ho(l,s),p=_&&s?.approved===!0,u=!_&&!o,m=!u&&!p,f=p&&n&&!d,h=c.questions,[g,y]=R(null),v=g??(u||p),[P,D]=R(!1),V=h.length>1?Qr:Cn,j=u?t.inputRequired:t.inputBadge,te=u?a($f,{req:c,strings:t,active:n,resolve:(oe,L)=>r(e.toolCallId,L,oe)}):P?a(An,{fields:Pa(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Ic(h,t),initialValues:p?Uf(h,s?.reason):void 0}):a(Ff,{questions:h,answers:p?zf(s?.reason):{},strings:t});return a("details",{class:`${ye}-toolui ${ye}-toolui-collapsible${o?` ${ye}-toolui-stale`:""}`,open:v,onToggle:oe=>{let L=oe.currentTarget.open;L!==v&&y(L)},"data-testid":u?w.toolAskQuestions:w.toolDecision,children:[a("summary",{class:`${ye}-toolui-head`,children:[a("span",{class:`${ye}-toolui-q-pill`,children:[a(V,{}),j]}),a("span",{class:`${ye}-toolui-head-end`,children:[u?null:a(_a,{status:m?"superseded":"completed",icon:m?a(Ro,{}):a(Eo,{}),label:m?t.inputSkipped:t.inputAnswered}),a("span",{class:`${ye}-toolui-chevron`,children:a(Tt,{})})]})]}),a("div",{class:`${ye}-toolui-collapse-body`,children:[c.intro?a("div",{class:`${ye}-toolui-desc`,children:c.intro}):null,te,u?null:a("div",{class:`${ye}-toolui-footer`,children:[a("button",{type:"button",class:`${ye}-toolui-options-toggle`,onClick:()=>D(oe=>!oe),"data-testid":w.toolAskOptions,children:[a("span",{class:`${ye}-toolui-options-chevron${P?` ${ye}-open`:""}`,children:a(Tt,{})}),P?t.hideOptions:t.showOptions]}),f?a("button",{type:"button",class:`${ye}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":w.toolEdit,children:t.edit}):null]})]})]})}function $f({req:e,strings:t,active:n,resolve:o}){let r=Pa(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(An,{fields:r,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:l=>o(Hf(e.questions,l),!0),skipLabel:t.inputSkip,onSkip:()=>o(void 0,!1),submitOnEnter:i,fieldTypeLabels:Ic(e.questions,t),submitTestId:w.toolInputSubmit,skipTestId:w.toolInputSkip})}function Ff({questions:e,answers:t,strings:n}){return a("div",{class:`${ye}-toolui-summary`,"data-testid":w.toolAskSummary,children:e.map(o=>a("div",{class:`${ye}-field`,children:[a("span",{class:`${ye}-field-head`,children:a("span",{class:`${ye}-field-label`,children:[o.question,o.required?a("span",{class:`${ye}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${ye}-toolui-answer`,children:Bf(o,t[o.key],n)||"\u2014"})]},o.key))})}function Bf(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Hf(e,t){let n=e.flatMap(o=>{let r=t[o.key];if(r==null||r.trim()==="")return[];let i=o.type==="multi-select"?r.split(",").map(l=>l.trim()).filter(Boolean):r;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function Lc(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let r of n)if(r&&typeof r=="object"&&"key"in r){let{key:i,value:l}=r;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 zf(e){let t=Lc(e),n={};for(let[o,r]of Object.entries(t))n[o]=Array.isArray(r)?r.join(", "):r;return n}function Uf(e,t){let n=Lc(t),o={};for(let r of e){let i=n[r.key];i!==void 0&&(r.type==="multi-select"?o[r.key]=Array.isArray(i)?i:[i]:o[r.key]=Array.isArray(i)?i[0]??"":i)}return o}function Oc({part:e,strings:t,live:n}){let o=Z(()=>e.inputSig.value),r=Z(()=>e.outputSig.value),i=Z(()=>e.errorSig.value);return Z(()=>!!Uo(o.value)||!!i.value||!!Uo(fa(r.value))).value?a(zo,{part:e,strings:t,testid:w.toolCall,live:n}):null}var ke=S.cssPrefix,Nc=cc(qf);function qf({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:r,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:_=!1,onFeedback:p}){let m=Z(()=>e.partsSig.value).value,f=Z(()=>it(e)),h=Z(()=>Jr(e)),g=Z(()=>mc(e)),y=Z(()=>o&&gc(e)),x=e.role==="assistant"&&e.status==="streaming",v=n==="buffered"&&x,P=x&&!g.value,D=hc({streaming:x,bufferedHold:v,reasoningVisible:y.value,working:P});if(h.value)return null;let V=Vf(e.createdAt),j=e.role==="assistant"||e.role==="operator",te=_&&!!p&&!!e.serverMessageId&&j&&!x&&e.status!=="error"&&!f.value,oe=m.filter(X=>X.kind==="text").map(X=>X.textSig.value).join(`
|
|
39
|
+
`){re(e),ae(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=o;continue}else{if(Am(n.charCodeAt(0)))break;re(e),ae(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){re(e),ae(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){re(e),ae(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}re(e)}function xa(e){return{add_token:Im,end_token:Mm,add_text:Lm,set_attr:Om,data:{nodes:[e,,,,,],index:0}}}function Im(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 r=o=document.createElement("input");r.type="checkbox",r.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 Mm(e){e.index-=1}function Lm(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Om(e,t,n){e.nodes[e.index].setAttribute(wm(t),n)}function Go({textSig:e,doneSig:t}){let n=B(null);return Xe(()=>{let o=n.current;if(!o)return;o.classList.add(`${S.cssPrefix}-md`);let r=xa(o),i=Pa(r),l=0,s=it(()=>{let _=e.value,p=t.value;_.length<l&&(o.replaceChildren(),r=xa(o),i=Pa(r),l=0);let u=_.slice(l);u&&Ie(i,u),l=_.length,p&&Cc(i)}),c=new MutationObserver(_=>{for(let p of _)for(let u of p.addedNodes){if(!(u instanceof HTMLElement))continue;let f=u.matches?.("a")?[u]:[...u.querySelectorAll?.("a")??[]];for(let m of f)Tc(m)}});c.observe(o,{childList:!0,subtree:!0});for(let _ of o.querySelectorAll("a"))Tc(_);let d=_=>{let p=_.target?.closest?.("a");if(!p||!(p instanceof HTMLAnchorElement))return;let u=p.getAttribute("href")??"";!u||u.startsWith("#")||(_.preventDefault(),window.open(u,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),a("div",{ref:n})}function Ec({text:e}){let t=Ae(()=>W(e),[e]),n=Ae(()=>W(!0),[]);return a(Go,{textSig:t,doneSig:n})}function Tc(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 jo=S.cssPrefix;function Rc({messageId:e,initial:t,strings:n,onFeedback:o}){let[r,i]=R(t),l=s=>{let c=r===s?null:s;i(c),o(e,c)};return a("div",{class:`${jo}-feedback`,role:"group","data-testid":w.messageFeedback,children:[a("button",{type:"button",class:`${jo}-msg-action`,"data-active":r==="up"?"true":void 0,"aria-pressed":r==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>l("up"),"data-testid":w.feedbackUp,children:a(Fl,{})}),a("button",{type:"button",class:`${jo}-msg-action`,"data-active":r==="down"?"true":void 0,"aria-pressed":r==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>l("down"),"data-testid":w.feedbackDown,children:a(Bl,{})}),a("span",{class:`${jo}-sr-only`,role:"status","aria-live":"polite",children:r?n.feedbackThanks:""})]})}var Zt=S.cssPrefix;function Ac({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${Zt}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":w.source,children:[a("span",{class:`${Zt}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${Zt}-source-label`,children:n})]}):a("span",{class:`${Zt}-source`,"data-testid":w.source,children:[a("span",{class:`${Zt}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${Zt}-source-label`,children:n})]})}var He=S.cssPrefix;function Ic({part:e,strings:t,active:n,superseded:o=!1,continuationStreaming:r=!1,onDecision:i,onEdit:l}){let s=ee(()=>e.approvalSig.value),c=ee(()=>yc(e,{active:n,superseded:o,continuationStreaming:r})).value,{terminal:d,showApproveReject:_,showAnswered:p,showSubmitted:u,showEdit:f,skipped:m}=c,h=pa(e.toolName),g=c.answeredApproved,y=e.toolCallId,P=a(Z,{children:[a("p",{class:`${He}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",h)}),a("p",{class:`${He}-toolui-subtle`,children:t.approvalBody})]});u?P=a("p",{class:`${He}-toolui-subtle`,children:t.approvalSubmitting}):p&&g!==!1?P=a(Z,{children:[a("p",{class:`${He}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",g?t.approve:t.reject),s.value?.reason?` \u2014 ${s.value.reason}`:""]}),f?a("p",{class:`${He}-toolui-subtle`,children:t.approvalEditHint}):null,f?null:a("p",{class:`${He}-toolui-subtle`,children:t.approvalSubmitting})]}):p&&(P=a(Z,{}));let v=_||u||f||p&&g!==!1;return a("div",{class:`${He}-toolui-group`,"data-testid":c.decided?w.toolDecision:w.toolApproval,children:[a(Wo,{part:e,strings:t,superseded:m,submitted:u}),m||d||!v?null:a("div",{class:`${He}-toolui ${He}-toolui-body`,children:[P,_?a("div",{class:`${He}-toolui-actions`,children:[a("button",{type:"button",class:`${He}-form-skip`,disabled:!n,onClick:()=>i(y,!1),"data-testid":w.toolReject,children:t.reject}),a("button",{type:"button",class:`${He}-form-submit`,disabled:!n,onClick:()=>i(y,!0),"data-testid":w.toolApprove,children:t.approve})]}):null,f?a("div",{class:`${He}-toolui-actions`,children:a("button",{type:"button",class:`${He}-form-skip`,onClick:()=>l(y),"data-testid":w.toolEdit,children:t.edit})}):null]})]})}var Dm=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Mc(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map($m).filter(r=>r!==null);return{intro:Xo(t.intro),questions:o}}function $m(e,t){if(!e||typeof e!="object")return null;let n=e,o=Dm.has(n.type)?n.type:"text";return{key:Xo(n.key)??`q${t+1}`,question:Xo(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(r=>typeof r=="string"&&r.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:Xo(n.helpText)}}function Fm(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 Sa(e,t,n){return e.questions.map(o=>{let r=Fm(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:r,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function Xo(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var xe=S.cssPrefix,Bm={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Lc(e,t){let n={};for(let o of e)n[o.key]=t[Bm[o.type]];return n}function Oc({part:e,strings:t,active:n,superseded:o=!1,continuationStreaming:r=!1,onDecision:i,onEdit:l}){let s=ee(()=>e.stateSig.value).value,c=ee(()=>e.approvalSig.value).value,d=ee(()=>Mc(e.inputSig.value)).value,{terminal:_,decided:p}=qo(s,c),u=p&&c?.approved===!0,f=r&&!p,m=!p&&!o&&!f,h=!m&&!u&&!f,g=u&&n&&!_,y=d.questions,[P,v]=R(null),D=P??(m||u||f),[j,V]=R(!1),ne=y.length>1?ea:En,le=m?t.inputRequired:t.inputBadge,O=f?a("p",{class:`${xe}-toolui-subtle`,children:t.approvalSubmitting}):m?a(Hm,{req:d,strings:t,active:n,resolve:($,me)=>i(e.toolCallId,me,$)}):j?a(Mn,{fields:Sa(d,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Lc(y,t),initialValues:u?Vm(y,c?.reason):void 0}):a(zm,{questions:y,answers:u?Wm(c?.reason):{},strings:t}),A="completed",Y=t.inputAnswered;return h?(A="superseded",Y=t.inputSkipped):f&&(A="responded",Y=t.statusResponded),a("details",{class:`${xe}-toolui ${xe}-toolui-collapsible${o?` ${xe}-toolui-stale`:""}`,open:D,onToggle:$=>{let me=$.currentTarget.open;me!==D&&v(me)},"data-testid":m?w.toolAskQuestions:w.toolDecision,children:[a("summary",{class:`${xe}-toolui-head`,children:[a("span",{class:`${xe}-toolui-q-pill`,children:[a(ne,{}),le]}),a("span",{class:`${xe}-toolui-head-end`,children:[m?null:a(ma,{status:A,icon:h?a(Mo,{}):a(Io,{}),label:Y}),a("span",{class:`${xe}-toolui-chevron`,children:a(Tt,{})})]})]}),a("div",{class:`${xe}-toolui-collapse-body`,children:[d.intro?a("div",{class:`${xe}-toolui-desc`,children:d.intro}):null,O,m||f?null:a("div",{class:`${xe}-toolui-footer`,children:[a("button",{type:"button",class:`${xe}-toolui-options-toggle`,onClick:()=>V($=>!$),"data-testid":w.toolAskOptions,children:[a("span",{class:`${xe}-toolui-options-chevron${j?` ${xe}-open`:""}`,children:a(Tt,{})}),j?t.hideOptions:t.showOptions]}),g?a("button",{type:"button",class:`${xe}-form-skip`,onClick:()=>l(e.toolCallId),"data-testid":w.toolEdit,children:t.edit}):null]})]})]})}function Hm({req:e,strings:t,active:n,resolve:o}){let r=Sa(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(Mn,{fields:r,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:l=>o(qm(e.questions,l),!0),skipLabel:t.inputSkip,onSkip:()=>o(void 0,!1),submitOnEnter:i,fieldTypeLabels:Lc(e.questions,t),submitTestId:w.toolInputSubmit,skipTestId:w.toolInputSkip})}function zm({questions:e,answers:t,strings:n}){return a("div",{class:`${xe}-toolui-summary`,"data-testid":w.toolAskSummary,children:e.map(o=>a("div",{class:`${xe}-field`,children:[a("span",{class:`${xe}-field-head`,children:a("span",{class:`${xe}-field-label`,children:[o.question,o.required?a("span",{class:`${xe}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${xe}-toolui-answer`,children:Um(o,t[o.key],n)||"\u2014"})]},o.key))})}function Um(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function qm(e,t){let n=e.flatMap(o=>{let r=t[o.key];if(r==null||r.trim()==="")return[];let i=o.type==="multi-select"?r.split(",").map(l=>l.trim()).filter(Boolean):r;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function Nc(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let r of n)if(r&&typeof r=="object"&&"key"in r){let{key:i,value:l}=r;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 Wm(e){let t=Nc(e),n={};for(let[o,r]of Object.entries(t))n[o]=Array.isArray(r)?r.join(", "):r;return n}function Vm(e,t){let n=Nc(t),o={};for(let r of e){let i=n[r.key];i!==void 0&&(r.type==="multi-select"?o[r.key]=Array.isArray(i)?i:[i]:o[r.key]=Array.isArray(i)?i[0]??"":i)}return o}function Dc({part:e,strings:t,live:n}){let o=ee(()=>e.inputSig.value),r=ee(()=>e.outputSig.value),i=ee(()=>e.errorSig.value);return ee(()=>!!Vo(o.value)||!!i.value||!!Vo(ga(r.value))).value?a(Wo,{part:e,strings:t,testid:w.toolCall,live:n}):null}var Te=S.cssPrefix,$c=uc(Km);function Km({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:r,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:_=!1,onFeedback:p}){let f=ee(()=>e.partsSig.value).value,m=ee(()=>mt(e)),h=ee(()=>ol(e)),g=ee(()=>hc(e)),y=ee(()=>o&&vc(e)),P=e.role==="assistant"&&e.status==="streaming",v=bc({streaming:P,responseMode:n,reasoningVisible:y.value,hasAnswerText:g.value,emptyReply:m.value,hidden:h.value}),{bufferedHold:x,working:D,showStreamDots:j}=v;if(v.hidden)return null;let V=jm(e.createdAt),ne=e.role==="assistant"||e.role==="operator",le=_&&!!p&&!!e.serverMessageId&&ne&&!P&&e.status!=="error"&&!m.value,O=f.filter($=>$.kind==="text").map($=>$.textSig.value).join(`
|
|
40
40
|
|
|
41
|
-
`).trim(),L=!x&&e.status!=="error"&&!f.value&&oe.length>0,I=te||L;return a("div",{class:`${ke}-bubble-row`,"data-role":e.role,"data-testid":Se(w.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${ke}-bubble-col`,children:[a("div",{class:`${ke}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${ke}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${ke}-bubble-body`,children:[v?a(Jf,{label:t.loading}):m.map((X,W)=>a(Kf,{part:X,active:P,live:x,strings:t,showReasoning:o,showToolCalls:r,showSources:i,interactive:l&&(X.kind!=="tool"||Qs(e,W)),superseded:s,tool:c},`${Xf(X)}#${W}`)),D&&a(Yf,{}),e.status==="error"&&e.errorText||f.value?a("div",{class:`${ke}-error`,role:"alert",children:[a("span",{children:e.errorText??t.errorGeneric}),d?a("button",{type:"button",class:`${ke}-error-retry`,onClick:d,"data-testid":w.messageRetry,children:t.errorRetry}):null]}):null]})]}),V||I?a("div",{class:`${ke}-bubble-meta`,children:[V?a("time",{class:`${ke}-bubble-time`,dateTime:V.iso,title:V.full,children:V.short}):null,I?a("div",{class:`${ke}-bubble-actions`,children:[te&&e.serverMessageId?a(Tc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:p}):null,L?a(Wf,{text:oe,strings:t}):null]}):null]}):null]})})}function Wf({text:e,strings:t}){let[n,o]=R(!1),r=()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return a("button",{type:"button",class:`${ke}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:r,"data-testid":w.messageCopy,children:n?a(Ct,{}):a(Nl,{})})}function Vf(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 Kf({part:e,active:t,live:n,strings:o,showReasoning:r,showToolCalls:i,showSources:l,interactive:s,superseded:c,tool:d}){switch(e.kind){case"step-start":return null;case"text":return a(Wo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return r?a(jf,{part:e,active:t,strings:o}):null;case"tool":return a(Gf,{part:e,strings:o,showToolCalls:i,interactive:s,superseded:c,live:n,tool:d});case"file":return e.mediaType.startsWith("image/")?a("img",{src:e.url,alt:"",loading:"lazy"}):a("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return l?a(Ec,{part:e,strings:o}):null}}function Gf({part:e,strings:t,showToolCalls:n,interactive:o,superseded:r,live:i,tool:l}){let s=Z(()=>e.approvalSig.value!==void 0);if(l?.humanInLoop){if(fc(e.toolName))return a(Mc,{part:e,strings:t,active:o,superseded:r,onDecision:l.onDecision,onEdit:l.onEdit});if(s.value)return a(Rc,{part:e,strings:t,active:o,superseded:r,onDecision:l.onDecision,onEdit:l.onEdit})}return n?a(Oc,{part:e,strings:t,live:i}):null}function jf({part:e,active:t,strings:n}){return a("details",{class:`${ke}-reasoning`,"data-testid":w.reasoning,open:t,"data-active":t?"true":void 0,children:[a("summary",{class:`${ke}-reasoning-summary`,children:a("span",{class:`${ke}-reasoning-label`,children:t?n.thinking:n.thoughts})}),a("div",{class:`${ke}-reasoning-body`,children:a(Wo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Xf(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 Yf(){return a("span",{class:`${ke}-typing`,"data-testid":w.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function Jf({label:e}){return a("span",{class:`${ke}-loading`,role:"status",children:[a("span",{class:`${ke}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${ke}-loading-label`,children:e})]})}var It=S.cssPrefix,xa=120,Qf=350;function Dc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:r,showSources:i,enableMessageFeedback:l,onFeedback:s,loading:c,idle:d,tool:_,onRetry:p,form:u,formMarkers:m,onFillForm:f}){let h=$(null),g=Z(()=>e.value),[y,x]=R(!1),v=$(!1),P=$(!1),D=$(!1),V=$(0),j=()=>D.current||performance.now()-V.current<Qf,te=$(0),oe=k=>{let F=k.scrollHeight-k.clientHeight>1;k.dataset.fadeTop=F&&k.scrollTop>1?"true":"false",k.dataset.fadeBottom=F&&k.scrollHeight-k.scrollTop-k.clientHeight>1?"true":"false"},L=k=>x(k.scrollHeight-k.scrollTop-k.clientHeight>xa*2),I=k=>{te.current=performance.now(),k.scrollTop=k.scrollHeight,oe(k)},X=(k,F)=>{I(k);let de=F,pe=0,be=()=>{I(k),--de>0&&(pe=requestAnimationFrame(be))};return F>0&&(pe=requestAnimationFrame(be)),()=>cancelAnimationFrame(pe)},W=(k,F)=>{let de,pe,be,fe=-1,Ue=()=>{de.disconnect(),pe.disconnect(),clearTimeout(be)},Ie=()=>{if(P.current||j()||fe>=0&&k.scrollTop<fe-4)return Ue();I(k),fe=k.scrollTop};return de=new ResizeObserver(Ie),pe=new MutationObserver(Ie),Ie(),de.observe(k),pe.observe(k,{childList:!0,subtree:!0,characterData:!0}),be=setTimeout(Ue,F),Ue},Oe=g.value[0]?.id;pt(()=>{let k=h.current;if(k&&g.value.length!==0&&(v.current=!0,!!g.value.some(F=>F.role==="user")))return W(k,300)},[Oe]);let Ne=$(0);E(()=>{let k=h.current,F=g.value,de=Ne.current;if(Ne.current=F.length,!k||!v.current)return;if(F.slice(de).some(be=>be.role==="user"))return P.current=!1,X(k,3);if(!F.some(be=>be.role==="user")||P.current||j())return;k.scrollHeight-k.scrollTop-k.clientHeight<xa&&I(k)},[g.value.length]);let O=$(null);E(()=>{let k=h.current,F=g.value.at(-1),de=O.current;if(O.current=F?.id??null,!!k&&v.current&&!(!F||F.id!==de||F.status!=="streaming"))return P.current=!1,X(k,3)},[g.value]),E(()=>{let k=h.current;if(!k)return;let F=g.value.at(-1);if(!F||F.status!=="streaming"&&!g.value.some(be=>be.role==="user"))return;let de=()=>{if(P.current||j())return;k.scrollHeight-k.scrollTop-k.clientHeight<xa*2&&I(k)};if(F.status!=="streaming")return W(k,300);de();let pe=new MutationObserver(de);return pe.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>pe.disconnect()},[g.value]);let T=u?.form.id,U=!!u&&(m??[]).some(k=>k.formId===u.form.id);pt(()=>{let k=h.current;!k||!T||P.current||g.value.some(F=>F.role==="user")&&(U?k.querySelector(`[data-testid="${w.formGate}"]`)?.scrollIntoView({block:"nearest"}):I(k))},[T,U]),E(()=>{let k=h.current;if(!k)return;let F=()=>{L(k),oe(k),performance.now()-te.current>150&&(P.current=k.scrollHeight-k.scrollTop-k.clientHeight>8)},de=()=>{P.current=!0},pe=ct=>{ct.deltaY<0&&de()},be=0,fe=ct=>{be=ct.touches[0]?.clientY??0,D.current=!0},Ue=ct=>{(ct.touches[0]?.clientY??0)>be+4&&de()},Ie=()=>{D.current=!1,V.current=performance.now()},$n=()=>{D.current=!0};return k.addEventListener("scroll",F,{passive:!0}),k.addEventListener("wheel",pe,{passive:!0}),k.addEventListener("touchstart",fe,{passive:!0}),k.addEventListener("touchmove",Ue,{passive:!0}),k.addEventListener("touchend",Ie,{passive:!0}),k.addEventListener("touchcancel",Ie,{passive:!0}),k.addEventListener("pointerdown",$n,{passive:!0}),window.addEventListener("pointerup",Ie,{passive:!0}),window.addEventListener("pointercancel",Ie,{passive:!0}),L(k),()=>{k.removeEventListener("scroll",F),k.removeEventListener("wheel",pe),k.removeEventListener("touchstart",fe),k.removeEventListener("touchmove",Ue),k.removeEventListener("touchend",Ie),k.removeEventListener("touchcancel",Ie),k.removeEventListener("pointerdown",$n),window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie)}},[]);let Y=()=>{let k=h.current;k&&(P.current=!1,I(k))},_e=[],Ce="",ze=g.value.at(-1)?.id,Pe=[...m??[]].toSorted((k,F)=>(k.createdAt??1/0)-(F.createdAt??1/0)),Te=k=>u&&k.formId===u.form.id?a(sa,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip},`gate:${k.formId}`):a(ec,{marker:k,strings:t,onFill:!u&&f?()=>f(k.formId):void 0},k.key),Ge=k=>{for(let F=Pe[0];F?.createdAt!==void 0&&!(k!==void 0&&F.createdAt>k);F=Pe[0])Pe.shift(),_e.push(Te(F))};for(let k of g.value){if(k.role==="assistant"&&k.id!==ze&&it(k))continue;Ge(k.createdAt);let F=Zf(k.createdAt);F&&F!==Ce&&(_e.push(a("div",{class:`${It}-date-divider`,children:a("span",{class:`${It}-date-pill`,title:em(k.createdAt),children:tm(k.createdAt,t)})},`day:${F}`)),Ce=F),_e.push(a(Nc,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:r,showSources:i,interactive:!!d&&k.id===ze,superseded:k.id!==ze,tool:_,onRetry:d&&k.id===ze?p:void 0,enableMessageFeedback:l,onFeedback:s},k.id))}for(let k of Pe)_e.push(Te(k));return a("div",{class:`${It}-list-wrap`,children:[a("div",{ref:h,class:`${It}-list ${It}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&g.value.length===0?a("div",{class:`${It}-list-loading`,role:"status",children:t.conversationLoading}):null,_e,u&&!U?a(sa,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip}):null]}),y?a("button",{type:"button",class:`${It}-jump`,onClick:Y,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":w.scrollToBottom,children:a(Tt,{})}):null]})}function Zf(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function em(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function tm(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),r=Math.round((o(new Date)-o(n))/864e5);return r<=0?t.dateToday:r===1?t.dateYesterday:r<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var nm=["today","yesterday","lastWeek","older"];function om(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor(($c(e)-$c(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Fc(e,t){let n=new Map;for(let o of t){let r=om(e,o.lastMessageAt),i=n.get(r);i?i.push(o):n.set(r,[o])}return nm.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function $c(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var rm=H.scope("history"),am=3,im=6,sm={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function lm(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 Go({transport:e,strings:t,locale:n,persistence:o,visitorId:r,onSelect:i,onNewConversation:l}){let s=S.cssPrefix,c=e.peekConversations({visitorId:r}),[d,_]=R(c?"loaded":"loading"),[p,u]=R(c?.conversations??[]);E(()=>{let g=!1;return e.listConversations({visitorId:r}).then(y=>{if(g)return;let x=y.conversations??[];u(x),_("loaded"),o.saveHistoryCount(x.length)}).catch(y=>{g||(rm.warn("listConversations failed",{err:y}),_("error"))}),()=>{g=!0}},[e,r,o]);let m=l?a("div",{class:`${s}-history-footer`,children:a("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":w.sidebarNewConversation,children:[a(ll,{}),t.newConversation]})}):null;if(d==="loading"){let g=Math.min(o.loadHistoryCount()??am,im);return a(ee,{children:[a("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:a("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[a("div",{class:`${s}-history-heading`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),a("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,g)},(y,x)=>a("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[a("span",{class:`${s}-history-avatar ${s}-skeleton`}),a("span",{class:`${s}-history-body`,children:[a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-title`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),a("span",{class:`${s}-history-time`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),a("span",{class:`${s}-history-row`,children:a("span",{class:`${s}-history-preview`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},x))})]})}),m]})}if(d==="error"||p.length===0)return a(ee,{children:[a("div",{class:`${s}-history-empty`,children:t.historyEmpty}),m]});let f=Date.now(),h=Fc(f,p);return a(ee,{children:[a("div",{class:`${s}-history`,role:"list",children:h.map(g=>a("div",{class:`${s}-history-group`,children:[a("div",{class:`${s}-history-heading`,children:t[sm[g.bucket]]}),a("div",{class:`${s}-history-card`,children:g.conversations.map(y=>a("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(y),"data-closed":y.canContinue?void 0:"true","data-unread":y.hasUnread?"true":void 0,"data-testid":Se(w.historyItem,y.conversationId),children:[a("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:a(Zr,{})}),a("span",{class:`${s}-history-body`,children:[a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-title`,children:y.title}),a("span",{class:`${s}-history-time`,children:lm(y.lastMessageAt,f,n)})]}),a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-preview`,children:y.preview??(y.canContinue?t.historyContinue:t.conversationClosed)}),y.hasUnread?a("span",{class:`${s}-history-dot`}):null]})]})]},y.conversationId))})]},g.bucket))}),m]})}var Bc=S.cssPrefix;function Hc({suggestions:e,onPick:t}){return e.length===0?null:a("div",{class:`${Bc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>a("button",{type:"button",class:`${Bc}-suggestion`,onClick:()=>t(n),"data-testid":Se(w.suggestion,o),children:n.label},n.id))})}var we=S.cssPrefix;function zc(e){let{options:t,onClose:n}=e,o=t.strings,r=$(null);E(()=>{let c=r.current;if(!c)return;let d=Oo(c),_=p=>{p.key==="Escape"&&n?.()};return c.addEventListener("keydown",_),()=>{d(),c.removeEventListener("keydown",_)}},[n]);let i=e.composerApiRef,l=N(c=>{i.current?.attachFromDrop(c)},[i]),{visible:s}=$o({containerRef:r,onDrop:l});return Mo(r.current,t.mode==="modal"),a("div",{ref:r,class:`${we}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":w.panel,children:[a(Sa,{...e,containerEl:r.current,dragOver:s,composerAttachApiRef:i}),a(ka,{poweredBy:e.options.poweredBy})]})}function Sa(e){let{options:t,transport:n,feedback:o,bus:r,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,controlMode:_,assignedOperatorInitials:p,operatorAvailable:u,operatorRequestEnabled:m,onRequestOperator:f,onCancelRequest:h,loadingMessages:g,messagesSig:y,agent:x,suggestions:v,initialWidgetSize:P,visitorId:D,onClose:V,onBack:j,onClear:te,onToggleHistory:oe,onSelectHistoryConversation:L,onNewConversation:I,onWidgetSizeChange:X,onSend:W,onStop:Oe,onSuggestion:Ne,activeForm:O,formMarkers:T,onFormSubmit:U,onFormSkip:Y,onFormFill:_e,tool:Ce,onRetry:ze,onMessageFeedback:Pe,containerEl:Te,dragOver:Ge,composerAttachApiRef:k}=e,F=t.strings,de;return O?de=null:c?de=a(ee,{children:[_&&_!=="ai-agent"?a(um,{controlMode:_,operatorInitials:p,operatorAvailable:u,onCancelRequest:h,strings:F}):null,!d&&_==="ai-agent"&&a(Hc,{suggestions:v,onPick:Ne}),a(jl,{options:t,transport:n,feedback:o,bus:r,isStreaming:d,operatorRequestEnabled:m,controlMode:_,onRequestOperator:f,onSend:W,onStop:Oe,attachApiRef:k})]}):de=a(dm,{label:F.conversationClosed,ctaLabel:F.startNewConversation,onNewConversation:te}),a(ee,{children:[s==="history"?a(cm,{strings:F,onBack:oe,onClose:V,showClose:Lo(t.mode,l,t.actions)}):a("header",{class:`${we}-header`,"data-testid":w.panelHeader,children:[j?a("button",{type:"button",class:`${we}-icon-btn`,onClick:j,"aria-label":F.moduleBack,title:F.moduleBack,children:a(wn,{})}):null,x?a(Vl,{agent:x,strings:F}):a("h1",{children:F.panelTitle}),a(Qe,{panelProps:e,variant:"chat"})]}),s==="history"?a(Go,{transport:n,strings:F,locale:t.locale,persistence:i,visitorId:D,onSelect:pe=>L(pe.conversationId),onNewConversation:I}):a(ee,{children:[a(Xl,{visible:Ge,strings:F}),a(Dc,{messagesSig:y,strings:F,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Pe,loading:g,idle:!d,tool:Ce,onRetry:ze,form:O?{form:O,onSubmit:U,onSkip:Y}:null,formMarkers:T,onFillForm:_e}),de,a(pm,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?a(Io,{panelEl:Te,resize:t.size.resize,position:t.position,initialSize:P,onSizeChange:X,strings:F}):null]})}function cm({strings:e,onBack:t,onClose:n,showClose:o}){return a("header",{class:`${we}-header`,children:[a("button",{type:"button",class:`${we}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(wn,{})}),a("h1",{children:e.historyTitle}),o?a("button",{type:"button",class:`${we}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(Je,{})}):null]})}function dm({label:e,ctaLabel:t,onNewConversation:n}){return a("div",{class:`${we}-readonly-banner`,role:"note",children:[a("span",{class:`${we}-readonly-label`,children:e}),a("button",{type:"button",class:`${we}-readonly-cta`,onClick:n,children:t})]})}function um({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelRequest:o,strings:r}){let i=_m(e,t,n,r);return a("div",{class:`${we}-operator-banner`,role:"status","data-mode":e,"data-testid":w.operatorBanner,children:[a("span",{class:`${we}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${we}-operator-label`,children:i}),e==="awaiting_operator"&&o?a("button",{type:"button",class:`${we}-operator-cancel`,"data-testid":w.operatorCancelRequest,onClick:o,children:r.cancelOperatorRequest}):null]})}function _m(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function pm({disclaimer:e}){return e?a("div",{class:`${we}-composer-footer`,children:a("div",{class:`${we}-disclaimer`,children:e})}):null}function ka({poweredBy:e}){return e?a("div",{class:`${we}-poweredby-bar`,children:a(fm,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function fm({logoUrl:e,text:t,href:n}){let o=a(ee,{children:[e?a("img",{class:`${we}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${we}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):a("span",{class:`${we}-poweredby`,children:o})}function Uc(e){let t=$(e);t.current=e;let n=$(null);return n.current??(n.current=mm(t)),n.current}function mm(e){let t=q(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,r=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 _=e.current;if(c==="manual"){let p=_.forms.list.find(u=>u.id===d);p&&(t.value={form:p,trigger:"manual"});return}for(let p of _.forms.byTrigger[c]??[]){let u=p.triggers.find(m=>m.kind===c);if(!(!u||!gm(u,_)||r(p)||!hm(p,_))){t.value={form:p,trigger:c};return}}},l=(c,d)=>{let _=t.value;if(!_)return;t.value=null;let{form:p,trigger:u}=_;p.frequency==="conversation"?n.add(o(p.id)):p.frequency!=="always"&&e.current.persistence.saveFormDone(p.id),e.current.onComplete(p,u,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(_=>_.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function gm(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function hm(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let r=t.userContext()??{};if(n.missingContext.some(i=>r[i]!==void 0&&r[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function qc(e){let t=S.cssPrefix,{site:n,blocks:o,strings:r,collapsed:i}=e,l=o?.navigation??[],s=o?.linkCards??[],c=i?r.expandSidebar:r.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":w.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(vm,{site:n}),a("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":w.sidebarToggle,children:a(bm,{collapsed:i})})]}),i?null:a(ee,{children:[l.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(ym,{items:l})}):null,s.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(Pm,{items:s})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(Go,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function vm({site:e}){let t=S.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return a("picture",{children:[e.logoDark?.url?a("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,a("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return a("div",{class:`${t}-sidebar-title`,children:e?.title??S.name})}function bm({collapsed:e}){return a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?a("polyline",{points:"9 6 15 12 9 18"}):a("polyline",{points:"15 6 9 12 15 18"})})}function ym({items:e}){let t=S.cssPrefix;return a("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>a("li",{children:a("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?a("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,a("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function Pm({items:e}){let t=S.cssPrefix;return a("div",{class:`${t}-sidebar-cards`,children:e.map(n=>a("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[a("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?a("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var Wc=S.cssPrefix;function Vc(e){return a("main",{class:`${Wc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a(qc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),a("section",{class:`${Wc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Kc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Gc(e,t,n){let o=q({activeTab:e,stacks:Kc(t)});return{sig:o,switchTab(r){o.value.activeTab!==r&&(o.value={...o.value,activeTab:r},n?.(r))},push(r){let i=o.value,l=i.stacks[i.activeTab]??[];o.value={...i,stacks:{...i.stacks,[i.activeTab]:[...l,r]}}},pop(){let r=o.value,i=r.stacks[r.activeTab]??[];i.length!==0&&(o.value={...r,stacks:{...r.stacks,[r.activeTab]:i.slice(0,-1)}})},reset(r){o.value={activeTab:r,stacks:Kc(t)}}}}var jc=e=>e.stacks[e.activeTab]??[],Xc=e=>jc(e).at(-1),Yc=e=>jc(e).length===0;var Jc={Icon:Tn};var gt=S.cssPrefix;function jo({title:e,actions:t}){return a("header",{class:`${gt}-back-header`,"data-variant":"title",children:[a("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${gt}-back-title`,children:e}),t??a("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"})]})}function Xo({title:e,backLabel:t,onBack:n,actions:o,testid:r}){return a("header",{class:`${gt}-back-header`,"data-testid":r,children:[a("button",{type:"button",class:`${gt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(wn,{})}),a("h1",{class:`${gt}-back-title`,children:e}),o??a("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"})]})}function Zt(e,t){return e instanceof Ye&&e.status===429?t.errorRateLimited:t.errorGeneric}var en=S.cssPrefix;function Qc({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${en}-home-search`,onClick:t,"data-testid":w.homeSearch,children:[a("span",{class:`${en}-home-search-text`,children:e}),a("span",{class:`${en}-home-search-icon`,"aria-hidden":"true",children:a(ta,{})})]})}function Zc({placeholder:e,value:t,onInput:n}){return a("div",{class:`${en}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${en}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":w.helpSearch}),a("span",{class:`${en}-home-search-icon`,"aria-hidden":"true",children:a(ta,{})})]})}var In=S.cssPrefix;function Yo({title:e,subtitle:t,onClick:n,testid:o}){return a("button",{type:"button",class:`${In}-list-row`,onClick:n,"data-testid":o,children:[a("span",{class:`${In}-list-row-body`,children:[a("span",{class:`${In}-list-row-title`,children:e}),t?a("span",{class:`${In}-list-row-sub`,children:t}):null]}),a("span",{class:`${In}-list-row-chevron`,"aria-hidden":"true",children:a(Xt,{})})]})}var ed=S.cssPrefix;function We({tone:e="info",message:t,onRetry:n,strings:o}){return a("div",{class:`${ed}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${ed}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Mt=S.cssPrefix,xm=H.scope("help"),Sm=(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 km(e){let t=new Map;for(let n of e){let o=n.categories?.[0]??"";(t.get(o)??t.set(o,[]).get(o)).push(n)}return[...t.entries()]}function td(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let r=0;for(let i of e){if(r=n.indexOf(i,r),r===-1)return 0;r+=1}return 1}function wm(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(td(n,o.title)*2,td(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,r)=>r.score-o.score).map(o=>o.item):[]}function nd({article:e,nav:t}){return a(Yo,{title:e.title,subtitle:e.description,onClick:()=>Sm(t,e),testid:Se(w.helpArticle,e.id)})}function Cm({transport:e,strings:t,config:n,nav:o,bus:r,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,_]=R(t.errorGeneric),[p,u]=R([]),[m,f]=R(""),[h,g]=R(0);E(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(P=>{if(v)return;let D=P.items??[];u(D),c("loaded"),r.emit("contentView",{section:"help",tags:l?.join(","),count:D.length})}).catch(P=>{v||(xm.warn("listContent (help) failed",{err:P}),_(Zt(P,t)),c("error"))}),()=>{v=!0}},[e,l,h,r]);let y=Ee(()=>wm(p,m),[p,m]);E(()=>{let v=m.trim();if(!v)return;let P=setTimeout(()=>r.emit("contentSearch",{queryLength:v.length,hitCount:y.length}),600);return()=>clearTimeout(P)},[m,y,r]);function x(){return m.trim().length>0?y.length===0?a(We,{message:t.helpSearchEmpty,strings:t}):a("div",{class:`${Mt}-help-card`,children:y.map(v=>a(nd,{article:v,nav:o},v.id))}):s==="loading"?a(We,{message:t.helpLoading,strings:t}):s==="error"?a(We,{tone:"error",message:d,onRetry:()=>g(v=>v+1),strings:t}):p.length===0?a(We,{message:t.helpEmpty,strings:t}):km(p).map(([v,P])=>a("section",{class:`${Mt}-help-group`,children:[v?a("h2",{class:`${Mt}-help-section-title`,children:v}):null,a("div",{class:`${Mt}-help-card`,children:P.map(D=>a(nd,{article:D,nav:o},D.id))})]},v))}return a("div",{class:`${Mt}-module`,children:[a(jo,{title:t.helpTitle,actions:a(Qe,{panelProps:i,variant:"plain"})}),a("div",{class:`${Mt}-module-pad`,children:a(Zc,{placeholder:t.helpSearchPlaceholder,value:m,onInput:f})}),a("div",{class:`${Mt}-help-list`,children:x()})]})}var od={Icon:Cn,Root:e=>a(Cm,{...e})};var rd=S.cssPrefix;function wa({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${rd}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${rd}-home-card`,"data-testid":n,children:t})}var ce=S.cssPrefix,ad=H.scope("home");function Tm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ae(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 Em=(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 Rm(e){let{transport:t,strings:n,config:o,nav:r,bus:i,panelProps:l}=e,[s,c]=R(null),[d,_]=R([]),p=o.contentTags?.join(",");E(()=>{if(o.showRecentConversations===!1)return;let y=!1;return t.listConversations({limit:1}).then(x=>!y&&c(x.conversations?.[0]??null)).catch(x=>!y&&ad.warn("listConversations (home) failed",{err:x})),()=>{y=!0}},[t,o.showRecentConversations]),E(()=>{if(!o.contentTags?.length)return;let y=!1;return t.listContent({tags:o.contentTags,limit:6}).then(x=>{if(y)return;let v=x.items??[];_(v),i.emit("contentView",{section:"home",tags:p,count:v.length})}).catch(x=>!y&&ad.warn("listContent (home) failed",{err:x})),()=>{y=!0}},[t,p,i]);let u=Tm(e),m=o.userAvatars??[],f=o.status,h=f?.text?Ae(n,f.text):n.homeStatus,g=o.contentBlockTitle?Ae(n,o.contentBlockTitle):n.homeContentTitle;return a("div",{class:`${ce}-module ${ce}-home`,"data-testid":w.homeView,children:a("div",{class:`${ce}-home-scroll`,children:[a("div",{class:`${ce}-home-hero`,children:[a("div",{class:`${ce}-home-hero-top`,children:[o.brandName?a("span",{class:`${ce}-home-brand`,"data-testid":w.homeBrand,children:o.brandName}):a("span",{class:`${ce}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${ce}-home-hero-actions`,children:[m.length>0?a("div",{class:`${ce}-home-avatars`,children:m.map(y=>a("span",{class:`${ce}-home-avatar`,title:y.role?`${y.name} \xB7 ${y.role}`:y.name,children:y.avatar?a("img",{src:y.avatar,alt:"",loading:"lazy"}):a("span",{children:No(y.name)})},y.name))}):null,a(Qe,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?a(ee,{children:[a("h1",{class:`${ce}-home-greeting`,"data-testid":w.homeGreeting,children:u.title}),u.subtitle?a("p",{class:`${ce}-home-lead`,children:u.subtitle}):null]}):null]}),a("div",{class:`${ce}-home-cards`,children:[o.showSearchBar!==!1?a(Qc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>r.switchToLayout("help")}):null,s?a(wa,{onClick:()=>r.selectConversation(s.conversationId),testid:w.homeRecent,children:a("div",{class:`${ce}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[a("span",{class:`${ce}-home-recent-avatar`,"aria-hidden":"true",children:a(Tn,{})}),a("span",{class:`${ce}-home-recent-body`,children:[a("span",{class:`${ce}-home-recent-title`,children:s.title}),s.preview?a("span",{class:`${ce}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?a("span",{class:`${ce}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,f?a(wa,{onClick:f.url?()=>r.push({kind:"iframe",url:f.url,title:h}):void 0,children:a("div",{class:`${ce}-home-status`,"data-level":f.level??"operational",children:[a("span",{class:`${ce}-home-status-icon`,"aria-hidden":"true",children:a(Rl,{})}),a("span",{class:`${ce}-home-status-text`,children:h})]})}):null,d.length>0?a("section",{class:`${ce}-home-content`,children:[a("div",{class:`${ce}-home-content-title`,children:g}),a("div",{class:`${ce}-home-content-list`,children:d.map(y=>a(Yo,{title:y.title,subtitle:y.description,onClick:()=>Em(r,y),testid:Se(w.homeContentRow,y.id)},y.id))})]}):null]})]})})}var id={Icon:Al,Root:e=>a(Rm,{...e})};var ht=S.cssPrefix,Am=H.scope("news");function Im({transport:e,strings:t,config:n,nav:o,bus:r,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,_]=R(t.errorGeneric),[p,u]=R([]),[m,f]=R(0);E(()=>{let g=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(y=>{if(g)return;let x=y.items??[];u(x),c("loaded"),r.emit("contentView",{section:"news",tags:l?.join(","),count:x.length})}).catch(y=>{g||(Am.warn("listContent (news) failed",{err:y}),_(Zt(y,t)),c("error"))}),()=>{g=!0}},[e,l,m,r]);function h(){return s==="loading"?a(We,{message:t.newsLoading,strings:t}):s==="error"?a(We,{tone:"error",message:d,onRetry:()=>f(g=>g+1),strings:t}):p.length===0?a(We,{message:t.newsEmpty,strings:t}):a("div",{class:`${ht}-news-list`,children:p.map(g=>a("button",{type:"button",class:`${ht}-news-card`,onClick:()=>o.push({kind:"content",id:g.id,title:g.title}),"data-testid":Se(w.newsItem,g.id),children:[g.image?a("img",{class:`${ht}-news-hero`,src:g.image,alt:"",loading:"lazy"}):null,a("span",{class:`${ht}-news-body`,children:[a("span",{class:`${ht}-news-title`,children:g.title}),g.description?a("span",{class:`${ht}-news-summary`,children:g.description}):null]})]},g.id))})}return a("div",{class:`${ht}-module`,children:[a(jo,{title:t.newsTitle,actions:a(Qe,{panelProps:i,variant:"plain"})}),a("div",{class:`${ht}-module-scroll`,children:h()})]})}var sd={Icon:Il,Root:e=>a(Im,{...e})};var Jo={chat:Jc,home:id,help:od,news:sd};var Mn=S.cssPrefix;function ld({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:r}){return a("nav",{class:`${Mn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=Jo[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return a("button",{type:"button",role:"tab","aria-selected":s,class:`${Mn}-tab`,onClick:()=>r(i.id),"data-testid":Se(w.tab,i.id),children:[a("span",{class:`${Mn}-tab-icon`,"aria-hidden":"true",children:[a(l,{}),c?a("span",{class:`${Mn}-tab-badge`,"data-testid":w.tabBadge,"aria-label":"Unread"}):null]}),a("span",{class:`${Mn}-tab-label`,children:Ae(n,i.label)})]},i.id)})})}var cd=S.cssPrefix,Mm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function dd({url:e,title:t,strings:n,onBack:o,actions:r}){return a("div",{class:`${cd}-module`,children:[a(Xo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:r}),a("iframe",{class:`${cd}-content-frame`,src:e,title:t||"content",sandbox:Mm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Ln=S.cssPrefix,Lm=H.scope("content"),Om=5e3;function ud({id:e,title:t,transport:n,strings:o,bus:r,onBack:i,actions:l}){let[s,c]=R(null),[d,_]=R(!1),[p,u]=R(0),m=N(()=>{_(!1),c(null),u(g=>g+1)},[]);E(()=>{let g=!1;return n.listContent({ids:[e],limit:1}).then(y=>{if(g)return;let x=y.items[0];x?(c(x),r.emit("contentOpen",{contentId:e,tags:x.tags?.length?x.tags.join(","):void 0})):_(!0)}).catch(y=>{g||(Lm.warn("listContent (reader) failed",{err:y}),_(!0))}),()=>{g=!0}},[n,e,p,r]),E(()=>{if(!s)return;let g=setTimeout(()=>r.emit("contentRead",{contentId:e}),Om);return()=>clearTimeout(g)},[s,e,r]);let f=N(g=>{let x=g.target?.closest?.("a")?.getAttribute("href")??"";x&&!x.startsWith("#")&&r.emit("contentLinkClick",{contentId:e})},[r,e]);function h(){return d?a(We,{tone:"error",message:o.errorGeneric,onRetry:m,strings:o}):s===null?a(We,{message:o.contentLoading,strings:o}):a("article",{class:`${Ln}-content`,"data-testid":w.contentView,onClick:f,children:[s.image?a("img",{class:`${Ln}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?a("p",{class:`${Ln}-content-subtitle`,children:s.description}):null,a(Cc,{text:s.content??""})]})}return a("div",{class:`${Ln}-module`,children:[a(Xo,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:w.backHeader}),a("div",{class:`${Ln}-module-scroll`,"data-testid":w.contentScroll,children:h()})]})}var Qo=S.cssPrefix;function _d({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:r,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,_=$(null),p=$(new Set);E(()=>{let I=_.current;if(!I)return;let X=Oo(I),W=Oe=>{Oe.key==="Escape"&&e.onClose?.()};return I.addEventListener("keydown",W),()=>{X(),I.removeEventListener("keydown",W)}},[e.onClose]);let u=e.composerApiRef,m=N(I=>{u.current?.attachFromDrop(I)},[u]),{visible:f}=$o({containerRef:_,onDrop:m});Mo(_.current,c.mode==="modal");let h=Z(()=>n.sig.value).value,g=Xc(h),y=c.modules.byId[h.activeTab],x=g?.kind==="iframe"||g?.kind==="content",v=t.length>1&&(Yc(h)||!x),P=$(null);E(()=>{if(x&&P.current===null)P.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!x&&P.current!==null){let I=P.current;P.current=null,s(I)}},[x]);let D={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:I=>{let X=t.find(W=>W.layout===I);X&&n.switchTab(X.id)},selectConversation:i,startNewConversation:l},V=I=>({options:c,transport:e.transport,strings:d,config:I,visitorId:e.visitorId,nav:D,bus:o,panelProps:e}),j=a(Qe,{panelProps:e,variant:"plain"});y&&p.current.add(y.id);let te=t.filter(I=>p.current.has(I.id)),oe=I=>{if(I.layout==="chat")return a(Sa,{...e,containerEl:_.current,dragOver:f,composerAttachApiRef:u});let X=Jo[I.layout].Root;return X?a(X,{...V(I)}):null},L=()=>g?.kind==="iframe"?a(dd,{url:g.url,title:g.title,strings:d,onBack:n.pop,actions:j}):g?.kind==="content"?a(ud,{id:g.id,title:g.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:j}):null;return a("div",{ref:_,class:`${Qo}-panel ${Qo}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":w.messengerHome,children:[a("div",{class:`${Qo}-messenger-body`,children:[te.map(I=>a("div",{class:`${Qo}-messenger-pane`,hidden:x||I.id!==y?.id,children:oe(I)},I.id)),L()]}),v?a(ld,{modules:t,activeTab:h.activeTab,strings:d,hasUnread:r,onSelect:n.switchTab}):null,a(ka,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(y?.layout==="chat"&&!g)?a(Io,{panelEl:_.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var On=S.cssPrefix;function pd({strings:e,onClose:t}){return a("div",{class:`${On}-panel ${On}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":w.modulesEmpty,children:[t?a("button",{type:"button",class:`${On}-icon-btn ${On}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:a(Je,{})}):null,a("p",{class:`${On}-modules-empty-text`,children:e.modulesEmpty})]})}function tn(e,t,n,o){let r={role:n,text:o};e.emit("message",r),t.onMessage?.(r)}var Ca=H.scope("hitl");function Nm(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 fd(e){let{streaming:t,messagesSig:n,sendAiTurn:o,bus:r,humanInLoop:i}=e,l=N((p,u)=>{if(t)return;let m=n.value.at(-1),f=m?.partsSig.value.find(h=>h.kind==="tool"&&h.toolCallId===p);if(!m||!f){Ca.warn("decideTool: tool part not found",{toolCallId:p});return}u(f),m.partsSig.value=[...m.partsSig.value],Nm(m)&&(m.status="streaming",m.awaitingContinuation=!0,n.value=[...n.value],o({continueExisting:!0}))},[t,n,o]),s=N((p,u)=>{Ca.info("toolResult",{toolCallId:p}),r.emit("toolResult",{toolCallId:p}),l(p,m=>{m.outputSig.value=u,m.stateSig.value="output-available"})},[r,l]),c=N((p,u,m)=>{Ca.info("toolDecision",{toolCallId:p,approved:u}),r.emit("toolDecision",{toolCallId:p,approved:u}),l(p,f=>{let h=f.approvalSig.value?.id??p;f.approvalSig.value={id:h,approved:u,reason:m},f.stateSig.value="approval-responded"})},[r,l]),d=N(p=>{if(t)return;let u=n.value.at(-1),m=u?.partsSig.value.find(h=>h.kind==="tool"&&h.toolCallId===p);if(!u||!m)return;let f=m.approvalSig.value?.id??p;m.approvalSig.value={id:f},m.stateSig.value="approval-requested",u.partsSig.value=[...u.partsSig.value]},[t,n]);return{toolInteraction:Ee(()=>({humanInLoop:i,onResult:s,onDecision:c,onEdit:d}),[i,s,c,d])}}function md({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[r,i]=R(()=>o?!1:t.loadCalloutDismissed(n));E(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=N(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:r,dismissCallout:l}}function gd(e){let{transport:t}=e,n=Xe("ai-agent"),o=Xe(void 0),r=Xe(void 0),i=N(d=>{n.value=d.controlMode,o.value=d.assignedOperatorInitials,d.operatorAvailable!==void 0&&(r.value=d.operatorAvailable)},[n,o,r]),l=N(d=>{d.type==="data-control-state"&&i(ft(d.data))},[i]),s=N(async()=>{if(n.value!=="ai-agent")return;let d=await t.requestOperator();d&&i(ft(d))},[t,n,i]),c=N(async()=>{if(n.value!=="awaiting_operator")return;let d=await t.cancelRequestOperator();d&&i(ft(d))},[t,n,i]);return{controlModeSig:n,assignedOperatorInitialsSig:o,operatorAvailableSig:r,applyControlState:i,adoptControlStateChunk:l,requestOperator:s,cancelRequestOperator:c}}function hd(e){let{hostElement:t,mode:n,panelSize:o,isOpen:r,setIsOpen:i}=e;pt(()=>{so(t,bo(n,o,r))},[t,r,o,n]),E(()=>{if(n!=="modal"||!r)return;let l=s=>{s.composedPath().some(d=>d instanceof HTMLElement&&d.classList.contains(`${S.cssPrefix}-panel`))||i(!1)};return t.addEventListener("click",l),()=>t.removeEventListener("click",l)},[t,r,n,i]),E(()=>{if(n!=="drawer"||!r)return;let l=s=>{s.key==="Escape"&&i(!1)};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r,n,i])}var Ta=H.scope("reducer"),Zo=class{constructor(t,n){K(this,"messagesSig",t);K(this,"onReconcileNeeded",n);K(this,"active",null);K(this,"openTextParts",new Map);K(this,"partSeq",0);K(this,"resumeIgnore",!1)}attach(t){this.active=t,this.openTextParts.clear()}resetForReplay(t){t.partsSig.value=[],t.status="streaming",t.finishReason=void 0,t.errorText=void 0,t.suggestions=void 0,this.openTextParts.clear(),this.messagesSig.value=[...this.messagesSig.value]}truncateAfterLastTool(t){let n=t.partsSig.value,o=n.findLastIndex(r=>r.kind==="tool");t.partsSig.value=n.slice(0,o+1),t.status="streaming",t.finishReason=void 0,t.errorText=void 0,t.suggestions=void 0,this.openTextParts.clear(),this.messagesSig.value=[...this.messagesSig.value]}detach(){this.active=null,this.openTextParts.clear()}applyResume(t){if(t.type==="data-control-state"||t.type==="data-conversation-rebind")return null;if(t.type==="start"){let n=t.messageId,o=n!==void 0?this.messagesSig.value.find(d=>d.serverMessageId===n||d.id===n):void 0,r=o!==void 0&&(o.awaitingContinuation===!0||Zs(o));if(o!==void 0&&!r&&Ks(o))return o!==void 0&&Js(o)&&this.onReconcileNeeded?.(),this.resumeIgnore=!0,this.detach(),null;if(this.resumeIgnore=!1,o!==void 0)return r?(o.awaitingContinuation=!1,o.status="streaming",this.messagesSig.value=[...this.messagesSig.value]):o.status==="streaming"&&Yr(o)?this.truncateAfterLastTool(o):this.resetForReplay(o),this.attach(o),this.apply(t),null;let l=t.messageMetadata?.senderRole,s=this.messagesSig.value.at(-1);if(l===void 0&&s?.role==="assistant"&&s.status==="streaming"&&s.serverMessageId===void 0&&!wt(s))return this.attach(s),this.apply(t),null;let c=kt();return this.attach(c),this.messagesSig.value=[...this.messagesSig.value,c],this.apply(t),null}if(this.resumeIgnore||!this.active)return null;if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let n=this.active;return this.detach(),n}return null}ensureTextPart(t,n,o){let r=`${n}:${o}`,i=this.openTextParts.get(r);if(i)return i;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:q(""),doneSig:q(!1)};return this.openTextParts.set(r,l),Nn(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let o=t.messageMetadata;o?.senderRole==="operator"?(n.role="operator",o.operatorInitials&&(n.operatorInitials=o.operatorInitials)):o?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":Nn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":Ta.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Ta.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"abort":Ta.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,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":Dm(n,t);return;case"file":Nn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":vd(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":vd(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=Po(t.data);return;case"data-control-state":n.operatorRoutedTurn=!0;return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function Lt(e,t,n){let o=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(o)return o;let r={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:q(""),inputSig:q(void 0),outputSig:q(void 0),errorSig:q(void 0),stateSig:q("input-streaming"),approvalSig:q(void 0)};return Nn(e,r),r}function Nn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function vd(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||Nn(e,t)}function Dm(e,t){switch(t.type){case"tool-input-start":Lt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=Lt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Lt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=Lt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=Lt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Lt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Lt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function bd(e){let t=1e3;for(;!e.signal.aborted;){let n,o="held";try{o=await e.connect(()=>{n=e.now(),e.backfill()})}catch{}if(e.signal.aborted||o==="unavailable")return;n!==void 0&&e.now()-n>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var yd=H.scope("resume-stream"),$m=2500,Fm=30,Bm=2e3,Hm=8,zm=400,Um=200,qm=1200;function Pd(e){let{activated:t,conversationReady:n,conversationIdSig:o,messagesSig:r,streamingRef:i,optionsRef:l,isChatActiveRef:s,transport:c,visitorId:d,adoptControlStateChunk:_,settleSuggestions:p,markActiveConversationRead:u,onReplyLanded:m,setStreaming:f,setActiveCancel:h,setCanSend:g,feedback:y,bus:x,homeNav:v}=e;E(()=>{if(!t||!n||!o.value)return;let P=o.value,D=new AbortController,V=()=>{},j=new Zo(r,()=>V());c.primeIdentity(d,P),yd.debug("resume stream opened",{conversationId:P});let te=()=>{f(!1),h(null),u(),m()},oe=T=>{let U=i.current,Y=l.current;if(T.canceled){U&&te(),r.value=[...r.value];return}let _e=T.status==="error";switch(nl(T,_e)){case"drop":r.value=r.value.filter(Ce=>Ce!==T);break;case"complete-operator-routed":T.status="complete",U&&(y.play("messageReceived"),tn(x,Y,"assistant",Ke(T)));break;case"error":{if(T.status="error",T.errorText=Y.strings.errorGeneric,U){y.play("error");let Ce=new Error(_e?"stream error chunk":"empty reply");x.emit("error",Ce),Y.onError?.(Ce)}break}case"complete":T.status="complete",U&&(y.play("messageReceived"),tn(x,Y,"assistant",Ke(T))),p(T);break}U&&te(),r.value=[...r.value]},L=T=>{_(T);let U=r.value.length,Y=j.applyResume(T);if(T.type==="finish"&&T.canContinue===!1&&g(!1),r.value.length>U){let _e=l.current.modules.list.find(Ce=>Ce.layout==="chat")?.id;_e&&v?.switchTab(_e)}if(Y){if(Y.role==="operator"){y.play("messageReceived"),tn(x,l.current,"operator",Ke(Y)),!document.hidden&&s.current()&&c.markRead(P).catch(()=>{});return}oe(Y)}},I=async()=>{let T=await c.loadConversation(P).catch(()=>null);if(D.signal.aborted||!T?.messages?.length)return!1;let{messages:U,changed:Y}=tl(r.value,Sn(T.messages));return Y&&(r.value=U),Y};V=()=>{(async()=>{for(let T=0;T<Hm&&!D.signal.aborted;T++){if(await I()||D.signal.aborted)return;await jt(Math.min(zm+T*Um,qm),D.signal)}})()};let X=0;bd({signal:D.signal,now:()=>performance.now(),sleep:T=>jt(T,D.signal),connect:T=>c.connectResumeStream({signal:D.signal,onChunk:L,onConnected:T}),backfill:()=>{let T=performance.now();T-X<Bm||(X=T,I())}});let W=T=>T.partsSig.value.reduce((U,Y)=>U+(Y.kind==="text"||Y.kind==="reasoning"?Y.textSig.value.length:1),0),Oe=0,Ne=-1,O=setInterval(()=>{let T=r.value.at(-1);if(i.current&&T&&T.role!=="user"&&T.status!=="streaming"&&(f(!1),h(null)),!(!i.current&&T!==void 0&&T.role!=="user"&&!T.ephemeral&&(T.status==="streaming"||wt(T)&&Ke(T).trim()===""||ko(T)))){Oe=0,Ne=-1;return}let Y=W(T);if(Y!==Ne){Ne=Y,Oe=0;return}Oe++>=Fm||I().then(_e=>{_e&&(Oe=0)})},$m);return()=>{D.abort(),clearInterval(O),j.detach(),yd.debug("resume stream closed",{conversationId:P})}},[t,n,o,o.value,d,c,_,p,u,m,f,h,g,r,x,y,v])}var Wm=H.scope("send");function xd(e){let{transport:t,messagesSig:n,conversationIdSig:o,options:r,bus:i,feedback:l,persistence:s,visitorId:c,adoptConversationId:d,setStreaming:_,setActiveCancel:p}=e,u=N(()=>{let h=o.value??Be();return o.value||(o.value=h,s.saveConversationId(h)),h},[o,s]),m=N(async({continueExisting:h})=>{let g=u(),y=Vs(n.value,h),x=Gr({messages:y.map(Xr),conversationId:g,tools:r.features.tools,visitorId:c,userPrefs:s.loadUserPrefs()});_(!0),p(()=>()=>t.cancelTurn(o.value));try{let v=await t.sendTurn(x);d(v.conversationId)}catch(v){let P=Zt(v,r.strings),D=n.value.at(-1);if(h&&D?.role==="assistant")D.status="error",D.errorText=P,n.value=[...n.value];else{let V=kt();V.status="error",V.errorText=P,n.value=[...n.value,V]}_(!1),p(null),l.play("error"),i.emit("error",v),r.onError?.(v)}},[t,n,o,r,i,l,s,c,d,u,_,p]),f=N(async h=>{let g=u(),y=Gr({messages:[Xr(h)],conversationId:g,tools:r.features.tools,visitorId:c,userPrefs:s.loadUserPrefs()});try{let x=await t.sendTurn(y);d(x.conversationId)}catch(x){Wm.debug("operator-routed send failed (non-fatal)",{error:x});let v=x instanceof Error?x:new Error(String(x));i.emit("error",v),r.onError?.(v)}},[t,r,i,s,c,d,u]);return{sendAiTurn:m,sendRoutedTurn:f}}var Vm=H.scope("unread"),Km=300;function Sd(e){let{transport:t,options:n,conversationIdSig:o,isChatActiveRef:r,activated:i,conversationReady:l}=e,s=Xe(!1),c=$(new Set),d=$();E(()=>()=>clearTimeout(d.current),[]);let _=N(()=>{let h=r.current()?o.value:void 0;s.value=[...c.current].some(g=>g!==h)},[s,o,r]),p=N(()=>{n.modules.list.some(h=>h.layout==="chat")&&t.listConversations({limit:50}).then(h=>{c.current=new Set(h.conversations.filter(g=>g.hasUnread).map(g=>g.conversationId)),_()}).catch(h=>Vm.debug("refreshUnread failed (non-fatal)",{err:h}))},[t,n.modules,_]),u=N(h=>{c.current.delete(h),_()},[_]),m=N(()=>{if(!r.current())return;let h=o.value;h&&(clearTimeout(d.current),d.current=setTimeout(()=>{u(h),t.markRead(h)},Km))},[t,o,u,r]),f=$(!1);return E(()=>{!i||!l||f.current||(f.current=!0,p())},[i,l,p]),E(()=>{if(!i)return;let h=()=>{document.visibilityState==="visible"&&p()};return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[i,p]),{hasUnreadSig:s,refreshUnread:p,clearUnread:u,markActiveConversationRead:m}}var Dn=H.scope("settings");function kd(e){let{options:t,persistence:n,transport:o,feedback:r,hostElement:i,bus:l}=e,s=n.loadUserPrefs(),[c,d]=R(()=>s.locale??t.locale),[_,p]=R(()=>s.themeMode??t.themeMode),[u,m]=R(()=>s.textSize??t.textSize),f=N(P=>{n.patchUserPrefs(P),o.saveUserPrefs(n.loadUserPrefs()).catch(D=>Dn.warn("saveUserPrefs failed",{err:D}))},[n,o]);E(()=>{s.soundMuted!==void 0&&r.setMuted(s.soundMuted)},[]),E(()=>{i.dataset.theme=_},[i,_,t]),E(()=>{i.dataset.textSize=u},[i,u,t]),E(()=>{let P=!0;return r.mutedSig.subscribe(D=>{if(P){P=!1;return}f({soundMuted:D})})},[r,f]);let h=Ft(c,t.availableLocales,t.defaultLocale);E(()=>{o.setLocale(h)},[o,h]),E(()=>{i.dir=li(h)?"rtl":"ltr"},[i,h]),E(()=>{h!==c&&d(h)},[h,c]);let g=N(P=>{Dn.info("localeChange",{locale:P}),d(P),f({locale:P}),l.emit("localeChange",P)},[f,l]),y=N(P=>{Dn.info("themeChange",{mode:P}),p(P),i.dataset.theme=P,f({themeMode:P}),l.emit("themeChange",P)},[i,f,l]),x=N(P=>{Dn.info("textSizeChange",{size:P}),m(P),i.dataset.textSize=P,f({textSize:P}),l.emit("textSizeChange",P)},[i,f,l]),v=N(()=>{r.toggleMuted();let P=r.mutedSig.value;Dn.info("soundToggle",{muted:P}),l.emit("soundToggle",{muted:P})},[r,l]);return{activeLocale:c,activeThemeMode:_,activeTextSize:u,effectiveLocale:h,setActiveLocale:d,setActiveThemeMode:p,setActiveTextSize:m,patchAndSync:f,handleLocaleChange:g,handleThemeChange:y,handleTextSizeChange:x,handleSoundToggle:v}}var se=H.scope("app"),er=S.cssPrefix;function wd(e,t){return qs({...e,text:Ae(t,e.text)})}function Cd({options:e,hostElement:t,bus:n}){let[o]=R(()=>_t(e.widgetId,e.storage,e.aiAgentDeploymentId)),[r,i]=R(()=>o.getVisitorId()),l=o.loadUserPrefs(),s=Xe(o.loadConversationId()),c=Xe([]),[d,_]=R(!1),[p,u]=R([]);function m(){let b=e.modules.list,C=new Set(b.map(G=>G.id)),Q=o.loadActiveModule();return Q&&C.has(Q)?Q:b[0]?.id??""}function f(){return e.modules.list.find(b=>b.layout==="chat")?.id}function h(){let b=f();return b?e.modules.list.length===1?!0:x.sig.value.activeTab===b:!1}let g=$(h);g.current=h;let y=$();if(!y.current){let b=e.modules.list.map(C=>C.id);y.current=Gc(m(),b,C=>o.saveActiveModule(C))}let x=y.current,[v,P]=R(!1),[D,V]=R(null),[j,te]=R(!1),oe=e.mode==="standalone"||e.mode==="inline",L=$(xn(e,Gt(),o.loadPanelOpen(),o.loadPanelSize())),[I,X]=R(L.current.panelOpen),[W,Oe]=R(L.current.panelOpen),Ne=$(!1),O=$(void 0);E(()=>{I&&Oe(!0)},[I]);let T=$(!1),[U,Y]=R(!1),{dismissed:_e,dismissCallout:Ce}=md({callout:e.launcher.callout,persistence:o}),ze=e.launcher.callout?.persistent??!0,Pe=N(()=>{se.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Ce()},[n,Ce]),[Te,Ge]=R(L.current.panelSize),k=$(!1),[F,de]=R("chat"),[pe,be]=R(!0),[fe,Ue]=R(!1),Ie=$(fe);Ie.current=fe;let[$n,ct]=R(null),[Fn,nn]=R([]),[Fa,Ba]=R(null),Bn=$(e.strings),Ha=$(e);Ha.current=e;let[Nd,Dd]=R(void 0),[$d,Fd]=R(void 0),[Bd,Hd]=R(()=>o.loadSidebarCollapsed()??!1),[ar,zd]=R({}),[ne]=R(()=>new So({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ls({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[De]=R(()=>new To(e.sound,e.haptics)),{activeLocale:Hn,activeThemeMode:za,activeTextSize:Ua,effectiveLocale:Ot,setActiveLocale:Ud,setActiveThemeMode:qd,setActiveTextSize:Wd,patchAndSync:qa,handleLocaleChange:Vd,handleThemeChange:Kd,handleTextSizeChange:Gd,handleSoundToggle:jd}=kd({options:e,persistence:o,transport:ne,feedback:De,hostElement:t,bus:n}),{controlModeSig:ir,assignedOperatorInitialsSig:Xd,operatorAvailableSig:Yd,applyControlState:sr,adoptControlStateChunk:Jd,requestOperator:Qd,cancelRequestOperator:Zd}=gd({transport:ne}),{hasUnreadSig:eu,refreshUnread:Wa,clearUnread:Va,markActiveConversationRead:tu}=Sd({transport:ne,options:e,conversationIdSig:s,isChatActiveRef:g,activated:W,conversationReady:v});E(()=>{De.update(e.sound,e.haptics)},[De,e.sound,e.haptics]),E(()=>()=>De.destroy(),[De]),E(()=>{k.current||!e.size.initialSize||(k.current=!0,!o.loadPanelSize()&&Ge(Kr(e.mode,e.size,Gt())))},[e.mode,e.size,o]),E(()=>{if(!v||T.current)return;T.current=!0;let b=xn(e,Gt(),o.loadPanelOpen(),o.loadPanelSize());X(b.panelOpen),Ge(b.panelSize)},[v,e,o]);let Ka=$(!1),Ga=$(null);E(()=>{!v||Ka.current||(Ka.current=!0,x.reset(m()))},[v]);let zn=N(b=>{!b||b.length===0||(c.value=b.map(C=>wd(C,Bn.current)))},[c]),lr=$(null),Un=N(async b=>{try{let{formSubmissions:C}=await(b?ne.bootstrap(b):lr.current??ne.bootstrap()),Q=new Map;return C.forEach((G,ie)=>Q.set(G.formId,ie)),C.filter((G,ie)=>!G.skipped||Q.get(G.formId)===ie).map((G,ie)=>({key:`wire:${G.formId}:${G.createdAt??ie}`,formId:G.formId,outcome:G.skipped?"skipped":"submitted",createdAt:yo(G.createdAt),values:G.values}))}catch(C){return se.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:C}),[]}},[ne]),on=$(0),qn=N((b,C)=>{let Q=[...b.map(M=>M.createdAt),...C.map(M=>M.createdAt)].filter(M=>M!==void 0),G=(Q.length?Math.min(...Q):Date.now())-1;return[...(O.current?.messages??[]).map(M=>{let Dt=wd(M,Bn.current);return Dt.createdAt=G,Dt}),...b]},[]),ja=N(async b=>{let C=on.current,Q=()=>C!==on.current;_(!0);try{let[G,ie]=await Promise.all([ne.loadConversation(b),Un()]);if(Q())return;let M=Sn(G.messages??[]);if(u(ie),c.value=qn(el(M,c.value),ie),M.length){be(G.canContinue??!0),sr(ft(G.controlState));let Dt=M.findLast(Ve=>Ve.role==="assistant"&&!Ve.ephemeral);nn(Dt?.suggestions??G.suggestions??[])}}catch(G){if(Q())return;se.warn("loadThread failed; resetting conversationId",{err:G,conversationId:b}),s.value=void 0,o.saveConversationId(void 0)}finally{Q()||_(!1)}},[ne,Un,c,s,o,qn]),rn=N(async({newConversation:b})=>{let C=++on.current,Q=()=>C!==on.current,G=s.value,ie=b||!G?Be():G;ie!==G&&(s.value=ie,o.saveConversationId(ie));let M;try{M=await ne.handshake({visitorId:r,conversationId:ie,userPrefs:o.loadUserPrefs(),locale:Hn})}catch(Ve){if(Q())return;n.emit("error",Ve),e.onError?.(Ve),b||P(!0);return}if(Q())return;if(M.visitorId&&M.visitorId!==r&&(se.info("visitor rebound",{previous:r,current:M.visitorId,reason:M.rebind?.visitorId}),o.setVisitorId(M.visitorId),i(M.visitorId),n.emit("visitorRebound",{previous:r,current:M.visitorId,reason:M.rebind?.visitorId})),M.conversationId&&M.conversationId!==ie&&(se.info("conversation rebound",{previous:ie,current:M.conversationId,reason:M.rebind?.conversationId}),n.emit("conversationRebound",{previous:ie,current:M.conversationId,reason:M.rebind?.conversationId})),M.agent&&ct(M.agent),sr(ft(M.controlState)),e.mode==="page"&&(M.site&&Is(M.site)?Dd(M.site):M.site&&se.warn("invalid site config, using fallback",{site:M.site}),M.blocks&&Ms(M.blocks)?Fd(M.blocks):M.blocks&&se.warn("invalid blocks config, using fallback",{blocks:M.blocks})),M.userPrefs&&!b&&(o.saveUserPrefs(M.userPrefs),M.userPrefs.locale&&Ud(M.userPrefs.locale),M.userPrefs.soundMuted!==void 0&&De.setMuted(M.userPrefs.soundMuted),M.userPrefs.themeMode&&qd(M.userPrefs.themeMode),M.userPrefs.textSize&&Wd(M.userPrefs.textSize)),O.current=M.welcome,b||n.emit("handshake",M),M.welcome?.suggestions){let Ve=Bn.current;nn(M.welcome.suggestions.map(je=>({...je,label:Ae(Ve,je.label),...je.text===void 0?{}:{text:Ae(Ve,je.text)}})))}!b&&G&&M.conversationId===G?Ne.current=!0:(s.value=M.conversationId,o.saveConversationId(M.conversationId),zn(M.welcome?.messages)),b||P(!0)},[ne,r,o,e,n,s,De,zn,ja,Hn]),an=JSON.stringify(e.userContext??null),nu=JSON.stringify(e.pageContext??null),ou=JSON.stringify(ar);E(()=>{let b=Object.keys(ar).length?{...ar,...e.userContext}:e.userContext;ne.setContext(b,Gm(e.pageContext))},[ne,an,nu,ou]);let ru=N((b,C=[])=>nn(b.suggestions??C),[]),au=N(b=>{if(!b||b===s.value)return;let C=s.value;s.value=b,o.saveConversationId(b),ne.primeIdentity(void 0,b),se.info("conversation rebound",{previous:C,current:b}),C&&n.emit("conversationRebound",{previous:C,current:b,reason:b})},[s,o,ne,n]);E(()=>(ne.primeIdentity(r,s.value),rn({newConversation:!1}),()=>{on.current++}),[]);let Xa=$(!1);E(()=>{if(!(!W||!v||Xa.current)&&(Xa.current=!0,lr.current=ne.bootstrap(),(async()=>{try{let b=await lr.current;V(_n((b??{forms:[]}).forms,Ot))}catch(b){se.debug("bootstrap failed \u2014 treating as no forms",{err:b})}finally{te(!0)}})(),Ne.current)){Ne.current=!1;let b=s.value;b&&ja(b)}},[W,v]);let Wn=$(null);E(()=>{if(!W||!v)return;if(Wn.current===null){Wn.current=Ot;return}if(Wn.current===Ot)return;Wn.current=Ot;let b=!1;return ne.bootstrap().then(C=>{b||V(_n((C??{forms:[]}).forms,Ot))}).catch(C=>se.debug("forms re-localize failed \u2014 keeping current copy",{err:C})),()=>{b=!0}},[W,v,Ot,ne]);let Ya=$(an);E(()=>{!v||Ya.current===an||(Ya.current=an,rn({newConversation:!1}))},[an,v,rn]);let Ja=$(()=>{}),iu=N(()=>Ja.current(),[]);Pd({activated:W,conversationReady:v,conversationIdSig:s,messagesSig:c,streamingRef:Ie,optionsRef:Ha,isChatActiveRef:g,transport:ne,visitorId:r,adoptControlStateChunk:Jd,settleSuggestions:ru,markActiveConversationRead:tu,onReplyLanded:iu,setStreaming:Ue,setActiveCancel:Ba,setCanSend:be,feedback:De,bus:n,homeNav:x}),hd({hostElement:t,mode:e.mode,panelSize:Te,isOpen:I,setIsOpen:X});let{sendAiTurn:sn,sendRoutedTurn:Qa}=xd({transport:ne,messagesSig:c,conversationIdSig:s,options:e,bus:n,feedback:De,persistence:o,visitorId:r,adoptConversationId:au,setStreaming:Ue,setActiveCancel:Ba}),{toolInteraction:su}=fd({streaming:fe,messagesSig:c,sendAiTurn:sn,bus:n,humanInLoop:e.features.humanInLoop}),lu=N((b,C)=>{se.info("messageFeedback",{messageId:b,value:C}),n.emit("messageFeedback",{messageId:b,value:C}),ne.submitFeedback({messageId:b,value:C})},[n,ne]),cu=()=>c.value.reduce((b,C)=>b+(C.role==="user"?1:0),0),Nt=e.forms.list.length>0?e.forms:D??e.forms,he=Uc({forms:Nt,persistence:o,userContext:()=>e.userContext,messageCount:cu,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>s.value,onComplete:(b,C,Q,G)=>{se.info("formSubmit",{formId:b.id,trigger:C,skipped:G}),n.emit("formSubmit",{formId:b.id,values:Q,skipped:G}),u(M=>{let Ve=M.find(je=>je.formId===b.id&&je.outcome==="skipped")?.createdAt??Date.now();return[...M.filter(je=>!(je.formId===b.id&&je.outcome==="skipped")),{key:`local:${b.id}:${Ve}`,formId:b.id,outcome:G?"skipped":"submitted",createdAt:Ve,...G?{}:{values:Q}}]});let ie=s.value??Be();s.value||(s.value=ie,o.saveConversationId(ie),ne.primeIdentity(void 0,ie)),!G&&b.mirrorToContext&&zd(M=>({...M,...Q})),ne.submitForm({formId:b.id,conversationId:ie,trigger:C,values:Q,skipped:G})}}),du=Z(()=>he.activeForm.value);Ja.current=()=>he.fire("after-messages"),E(()=>{he.refresh()},[Nt,he]);let Za=e.pageContext?.area?String(e.pageContext.area):void 0,uu=Z(()=>c.value.length);E(()=>{v&&j&&he.fire("pre-chat")},[v,j,he]),E(()=>{j&&!pe&&he.fire("conversation-closed")},[j,pe,he]),E(()=>{v&&j&&Za&&he.fire("page-area")},[v,j,Za,he]);let cr=Ee(()=>{let b=Nt.list.flatMap(C=>C.triggers).filter(C=>C.kind==="idle").map(C=>Number(C.param));return b.length?Math.min(...b)*1e3:0},[Nt]);E(()=>{if(!cr||!I)return;let b=setTimeout(()=>he.fire("idle"),cr);return()=>clearTimeout(b)},[cr,I,he,uu.value]);let ei=N(async(b,C)=>{let Q=ir.value!=="ai-agent";if(se.info("send",{textLen:b.length,attachments:C.length,streaming:fe,routedToOperator:Q}),fe&&!Q)return;n.emit("send",{text:b,attachmentCount:C.length}),Fn.length>0&&nn([]);let G=await Xm(ne,C,M=>{se.warn("upload failed",{err:M}),n.emit("error",M),e.onError?.(M)});De.unlock(),De.play("messageSent");let ie=Us(b,G);if(tn(n,e,"user",b),Q){c.value=[...c.value,ie],Qa(ie);return}c.value=[...c.value,ie,kt()],sn({continueExisting:!1})},[fe,ne,n,e,Fn.length,c,sn,Qa,ir]),_u=N(()=>{se.info("stop"),n.emit("stop",void 0);let b=c.value.at(-1);b&&b.role!=="user"&&b.status==="streaming"&&(b.canceled=!0,c.value=[...c.value]),Fa?.()},[Fa,n,c]),pu=N(()=>{if(fe)return;let b=c.value,C=b.at(-1);!C||C.role!=="assistant"||C.status!=="error"&&!it(C)||(c.value=[...b.slice(0,-1),kt()],se.info("retry"),sn({continueExisting:!1}))},[fe,c,sn]),ln=N(()=>{if(Wl(e.mode,Te)==="exit-fullscreen"){se.info("close \u2192 exit-fullscreen",{mode:e.mode}),Ge("normal"),n.emit("fullscreen",!1);return}se.info("close \u2192 panel closed",{mode:e.mode}),he.fire("panel-close"),X(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Te,he]),dr=N(()=>{se.info("open",{mode:e.mode}),De.unlock(),Y(!0),X(!0),o.savePanelOpen(!0),!_e&&!ze&&Pe(),setTimeout(()=>Y(!1),jm),Wa(),n.emit("open",void 0),e.onOpen?.()},[n,e,De,o,_e,ze,Pe,Wa]),ur=N(()=>{if(!c.value.some(C=>C.role==="user")&&pe&&s.value){se.info("clear \u2192 reusing empty conversation",{conversationId:s.value}),c.value.length===0&&zn(O.current?.messages);return}se.info("clear \u2192 new conversation",{wasStreaming:fe}),n.emit("clear",void 0),fe&&Ue(!1),Wt(()=>{c.value=[],s.value=void 0}),o.clearConversation(),be(!0),u([]),rn({newConversation:!0})},[fe,c,s,o,rn,n,pe,zn]),_r=N(()=>{ur(),de("chat");let b=e.modules.list.find(C=>C.layout==="chat")?.id;b&&x.switchTab(b)},[ur,x,e]),pr=N(()=>{let b=Te==="expanded"?"normal":"expanded";se.info("expand",{from:Te,expanded:b==="expanded"}),Ge(b),o.savePanelSize(b),n.emit("expand",b==="expanded")},[n,Te,o]),fr=N(()=>{let b=Te==="fullscreen"?"normal":"fullscreen";se.info("fullscreen",{from:Te,fullscreen:b==="fullscreen"}),Ge(b),o.savePanelSize(b),n.emit("fullscreen",b==="fullscreen")},[n,Te,o]),fu=N(()=>{de(b=>{let C=b==="history"?"chat":"history";return se.info("toggleHistory",{view:C}),n.emit("toggleHistory",{view:C}),C})},[n]),mu=N(()=>{Hd(b=>{let C=!b;return se.info("sidebarToggle",{collapsed:C}),o.saveSidebarCollapsed(C),n.emit("sidebarToggle",{collapsed:C}),C})},[o,n]),gu=N(b=>{se.info("resize",b),qa({widgetSize:b}),n.emit("resize",b)},[qa,n]),mr=N(async b=>{se.info("selectConversation",{conversationId:b,wasStreaming:fe}),n.emit("selectConversation",{conversationId:b}),fe&&Ue(!1);try{let[C,Q]=await Promise.all([ne.loadConversation(b),Un(b)]),G=Sn(C.messages);Wt(()=>{c.value=qn(G,Q),s.value=C.conversationId}),u(Q),o.saveConversationId(C.conversationId),ne.primeIdentity(r,C.conversationId),C.agent&&ct(C.agent),be(C.canContinue),sr(ft(C.controlState));let ie=G.findLast(M=>M.role==="assistant"&&!M.ephemeral);nn(ie?.suggestions??C.suggestions??[]),de("chat"),await ne.markRead(b),Va(b)}catch(C){n.emit("error",C),e.onError?.(C)}},[ne,c,s,n,e,o,Va,Un,qn,fe,r]),Vn=$(null),ti=N(b=>{typeof b=="string"&&(j?he.fire("manual",b):Vn.current=b)},[j,he]);E(()=>{!j||!Vn.current||(he.fire("manual",Vn.current),Vn.current=null)},[j,he]),E(()=>Yi(t,{open:dr,close:ln,expand:pr,fullscreen:fr,openForm:ti}),[t,dr,ln,pr,fr,ti]);let $e=Ee(()=>Er(e,Hn,za,Ua),[e,Hn,za,Ua]);Bn.current=$e.strings;let hu=Ee(()=>p.map(b=>{let C=Nt.list.find(Q=>Q.id===b.formId);return{...b,title:C?.title,form:C}}),[p,Nt]),ni={options:$e,transport:ne,feedback:De,bus:n,persistence:o,composerApiRef:Ga,view:F,canSend:pe,isStreaming:fe,controlMode:ir.value,assignedOperatorInitials:Xd.value,operatorAvailable:Yd.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Qd,onCancelRequest:Zd,loadingMessages:d,messagesSig:c,agent:$n,suggestions:Fn,initialWidgetSize:l.widgetSize??null,visitorId:r,onClose:ln,onClear:ur,onExpand:pr,onFullscreen:fr,onSoundToggle:jd,onToggleHistory:fu,onSelectHistoryConversation:mr,onNewConversation:_r,onLocaleChange:Vd,onThemeChange:Kd,onTextSizeChange:Gd,onWidgetSizeChange:gu,onSend:ei,onStop:_u,onSuggestion:b=>{let C=b.text??b.label;se.info("suggestion",{text:C,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:C}),e.autoSendSuggestions?ei(C,[]):Ga.current?.fill(C)},activeForm:du.value?.form??null,formMarkers:hu,onFormSubmit:he.complete,onFormSkip:he.skip,onFormFill:b=>he.fire("manual",b),tool:su,onRetry:pu,onMessageFeedback:lu},vu=b=>{mr(b);let C=f();C&&x.switchTab(C)};if(!v)return null;let cn=$e.modules.list,gr=b=>{let C=En("close",$e.mode,b);return cn.length===0?a(pd,{strings:$e.strings,onClose:C?ln:void 0}):cn.length===1&&cn[0]?.layout==="chat"?a(zc,{...ni,panelSize:b}):a(_d,{panelProps:{...ni,panelSize:b,onClose:C?ln:void 0},enabledModules:cn,nav:x,bus:n,hasUnread:eu.value,onSelectConversation:vu,onStartNewConversation:_r,onSetPanelSize:Ge})};if(e.mode==="page"){let b=Q=>{mr(Q.conversationId)},C=cn.some(Q=>Q.layout==="chat");return a("div",{class:`${er}-anchor`,children:a(Vc,{site:Nd,blocks:$d,transport:ne,strings:$e.strings,locale:$e.locale,persistence:o,visitorId:r,showConversations:C,onSelectConversation:b,onNewConversation:_r,sidebarCollapsed:Bd,onToggleSidebarCollapsed:mu,children:gr("fullscreen")})})}if(oe){let b=e.mode==="standalone"?"fullscreen":Te;return a("div",{class:`${er}-anchor`,children:gr(b)})}let oi=e.mode==="drawer",ri=!(e.mode==="modal")&&!e.launcher.hidden&&(!I||U),ai=ri&&!U&&!_e&&!oi?$e.launcher.callout:null;return a("div",{class:`${er}-anchor`,"data-launcher-size":$e.launcher.size,children:[I||W?a("div",{class:`${er}-surface`,hidden:!I,children:gr(Te)}):null,ri?a(zl,{onToggle:dr,launcher:$e.launcher,strings:$e.strings,leaving:U,edgeTab:oi}):null,ai?a(Ul,{callout:ai,launcherPosition:$e.position,strings:$e.strings,closeLabel:$e.strings.close,onDismiss:Pe}):null]})}function Gm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var jm=120;async function Xm(e,t,n){let o=[];for(let r of t)try{let{id:i,url:l}=await e.uploadFile(r.file);o.push({id:i,name:r.name,mediaType:r.mediaType,size:r.size,url:l})}catch(i){n(i)}return o}var Ym=H.scope("error-boundary"),tr=class extends Me{constructor(){super(...arguments);K(this,"state",{crashed:!1})}componentDidCatch(n,o){Ym.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 Jm="1",Qm=60,Zm=2e3,Td={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 eg(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function tg(){return location.origin+location.pathname}function ng(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Ed(e,t){let n=Math.random(),o=0,r=0,i=new Set,l=(c,d)=>{let{tracking:_,publicKey:p,aiAgentDeploymentId:u,mode:m,themeMode:f}=t.getOptions();if(!_.enabled||eg()||n>=_.sampleRate)return;let h=performance.now();if(h-o>6e4&&(o=h,r=0),++r>Qm)return;let g=new URLSearchParams;g.set("v",Jm),g.set("_ev",Ht),g.set("e",c),_.token&&g.set("tk",_.token),p&&g.set("pk",p),u&&g.set("dep",u),g.set("vid",t.getVisitorId());let y=t.getConversationId();y&&g.set("cid",y),g.set("url",tg());let x=ng();x&&g.set("ref",x),g.set("sw",String(screen.width)),g.set("sh",String(screen.height)),g.set("vw",String(innerWidth)),g.set("vh",String(innerHeight)),g.set("dpr",String(devicePixelRatio)),g.set("lang",navigator.language);try{g.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(g.set("m",m),g.set("th",f),d)for(let[V,j]of Object.entries(d))j!==void 0&&g.set(V,String(j));g.set("ts",String(Date.now()));let v=`${_.endpoint}?${g}`;if(v.length>Zm)return;let P=new Image(1,1);i.add(P);let D=()=>i.delete(P);P.addEventListener("load",D,{once:!0}),P.addEventListener("error",D,{once:!0}),P.src=v},s=Object.keys(Td).map(c=>e.on(c,d=>l(c,Td[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function nr(e){let{bus:t,host:n,appRoot:o,persistence:r,reportError:i}=e,l=e.initialRaw,s,c=dt(l),d=!0,_=()=>{c=dt(s?Rr(l,s):l)},p=()=>{as(n,xt(c.mode));let f=r.loadUserPrefs().themeMode;is(n,f?{...c,themeMode:f}:c),d&&(so(n,Ea(c)),d=!1)},u=()=>{p(),yt(ot(tr,{onError:i},ot(Cd,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",f=>{f.config&&(f.config.storageVersion&&r.rememberStorageVersion(f.config.storageVersion),s=f.config,_(),u())});let m=Ed(t,{getOptions:()=>c,getVisitorId:()=>r.getVisitorId(),getConversationId:()=>r.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:u,setUserOptions:f=>{l=f,_(),u()},patchUserOptions:f=>{l={...l,...f},_(),u()},destroy:()=>m()}}function Ea(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=_t(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=xn(e,Gt(),t.loadPanelOpen(),t.loadPanelSize());return bo(e.mode,o,n)}var og=H.scope("hooks"),Aa="*",Ra=new Set;function Ia(e,t,n){let o={widgetId:e,event:t,listener:n};return Ra.add(o),()=>{Ra.delete(o)}}function rg(e,t,n){let o=[...Ra];for(let r of o)if(ag(r.widgetId,e.widgetId)&&!(r.event!==Aa&&r.event!==t))try{r.listener(e,t,n)}catch(i){og.warn("hook listener threw",{event:t,error:i})}}function Rd(e,t){let n=[];for(let o of ig)n.push(t.on(o,r=>{rg(e,o,r)}));return()=>{for(let o of n)o()}}function Ma(e){if(Array.isArray(e))for(let t of e){let n=sg(t);n&&Ia(n.widgetId,n.event,n.listener)}}function ag(e,t){return e===Aa||e===t}var ig=["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 sg(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 lt=new Map;function or(e){e.debug!==void 0&&Yn(e.debug);let t=H.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=dt(e),o=n.widgetId,r=lt.get(o);r&&(t.debug("destroy existing instance at slot",{widgetId:o}),r.destroy());let i=Ea(n),l=n.iframe?cs({position:xt(n.mode)},n.position,i,n.mode,e.target??null):zt({position:xt(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Ut,c=_t(o,n.storage,n.aiAgentDeploymentId),d=h=>{s.emit("error",h),_.getOptions().onError?.(h)},_=nr({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});_.render();let p=l.hostElement,u=null,m=h=>{h.debug!==void 0&&Yn(h.debug),_.patchUserOptions(h)},f={widgetId:o,open:()=>gn(p,"open"),close:()=>gn(p,"close"),expand:()=>gn(p,"expand"),openForm:h=>gn(p,"openForm",h),on:(h,g)=>s.on(h,g),update:h=>{t.debug("update",{patch:h}),m(h)},setUserContext:h=>{t.debug("setUserContext",{keys:Object.keys(h)}),m({userContext:{..._.getUserOptions().userContext,...h}})},clearUserContext:()=>{t.debug("clearUserContext"),m({userContext:void 0})},setPageContext:h=>{t.debug("setPageContext",{keys:Object.keys(h)}),m({pageContext:{..._.getUserOptions().pageContext,...h}})},clearPageContext:()=>{t.debug("clearPageContext"),m({pageContext:void 0})},setDebug:h=>{Yn(h),t.info("debug level set",{level:dn()})},debugLevel:()=>dn(),onLog:h=>un(h),destroy:()=>{t.info("destroy",{widgetId:o}),u?.(),_.destroy(),s.clear(),yt(null,l.appRoot),l.destroy(),lt.get(o)===f&<.delete(o)}};return u=Rd(f,s),lt.set(o,f),f}function rr(e){let t=e.widgetId??"default",n=lt.get(t);return n?(n.update(e),n):or(e)}function La(e){if(e!==void 0){lt.get(e)?.destroy();return}let t=[...lt.values()];for(let n of t)n.destroy()}function et(e="default"){return lt.get(e)??null}function Ad(){return[...lt.values()]}function Oa(e,t,n){return Ia(e,t,n)}var Id=Ht;var Na=class extends HTMLElement{constructor(){super(...arguments);K(this,"bus",new Ut);K(this,"mountResult",null);K(this,"runtime",null)}static get observedAttributes(){return Ar}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,yt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=Zn(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=dt(n);this.mountResult||(this.mountResult=zt({existingHost:this,position:xt(o.mode)}));let r=_t(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=nr({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:r,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},Md=!1;function Da(){if(Md||typeof customElements>"u")return;let e=S.tagName;customElements.get(e)||customElements.define(e,Na),Md=!0}typeof customElements<"u"&&Da();var Ld=H.scope("iife"),$a={close:()=>et()?.close(),destroy:()=>La(),expand:()=>et()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Oa(e,t,n):void 0,init:e=>rr(e),mount:e=>or(e),on:(e,t)=>et()?.on(e,t),onLog:e=>un(e),open:()=>et()?.open(),setDebug:e=>et()?.setDebug(e),update:e=>et()?.update(e)};function Od(e,...t){let n=$a[e];if(!n){Ld.warn("unknown command",{command:e});return}return n(...t)}function lg(){let e=((n,...o)=>Od(n,...o));e.init=rr,e.mount=or,e.destroy=La,e.getInstance=et,e.getAllInstances=Ad,e.version=Id,e.hook=Oa,e.debugLevel=()=>dn(),e.onLog=un;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys($a)){if(t.has(n))continue;let o=$a[n];Reflect.set(e,n,(...r)=>o(...r))}return e}function cg(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[r,...i]=o;if(typeof r=="string")try{Od(r,...i)}catch(l){Ld.warn("queued command failed",{command:r,error:l})}}}function dg(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)Ma([o]);return t(...n)},e}function ug(){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 _g(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[S.global],t=lg();globalThis[S.global]=t,Da();let n=`${S.global}Hooks`,o=globalThis[n];if(Ma(o),globalThis[n]=dg(),cg(e),et())return;let r=document.currentScript??ug(),i=Ir(r?.dataset);if(!i.publicKey)return;let l=()=>{et()||rr(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}_g();return ku(pg);})();
|
|
41
|
+
`).trim(),A=!P&&e.status!=="error"&&!m.value&&O.length>0,Y=le||A;return a("div",{class:`${Te}-bubble-row`,"data-role":e.role,"data-testid":Ce(w.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${Te}-bubble-col`,children:[a("div",{class:`${Te}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${Te}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${Te}-bubble-body`,children:[x?a(ef,{label:t.loading}):f.map(($,me)=>a(Xm,{part:$,active:D,live:P,strings:t,showReasoning:o,showToolCalls:r,showSources:i,interactive:l&&($.kind!=="tool"||Zs(e,me)),superseded:s,continuationStreaming:e.continuationStreaming===!0,tool:c},`${Qm($)}#${me}`)),j&&a(Zm,{}),e.status==="error"&&e.errorText||m.value?a("div",{class:`${Te}-error`,role:"alert",children:[a("span",{children:e.errorText??t.errorGeneric}),d?a("button",{type:"button",class:`${Te}-error-retry`,onClick:d,"data-testid":w.messageRetry,children:t.errorRetry}):null]}):null]})]}),V||Y?a("div",{class:`${Te}-bubble-meta`,children:[V?a("time",{class:`${Te}-bubble-time`,dateTime:V.iso,title:V.full,children:V.short}):null,Y?a("div",{class:`${Te}-bubble-actions`,children:[le&&e.serverMessageId?a(Rc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:p}):null,A?a(Gm,{text:O,strings:t}):null]}):null]}):null]})})}function Gm({text:e,strings:t}){let[n,o]=R(!1),r=()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return a("button",{type:"button",class:`${Te}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:r,"data-testid":w.messageCopy,children:n?a(Ct,{}):a($l,{})})}function jm(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 Xm({part:e,active:t,live:n,strings:o,showReasoning:r,showToolCalls:i,showSources:l,interactive:s,superseded:c,continuationStreaming:d,tool:_}){switch(e.kind){case"step-start":return null;case"text":return a(Go,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return r?a(Jm,{part:e,active:t,strings:o}):null;case"tool":return a(Ym,{part:e,strings:o,showToolCalls:i,interactive:s,superseded:c,continuationStreaming:d,live:n,tool:_});case"file":return e.mediaType.startsWith("image/")?a("img",{src:e.url,alt:"",loading:"lazy"}):a("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return l?a(Ac,{part:e,strings:o}):null}}function Ym({part:e,strings:t,showToolCalls:n,interactive:o,superseded:r,continuationStreaming:i,live:l,tool:s}){let c=ee(()=>e.approvalSig.value!==void 0);if(s?.humanInLoop){if(gc(e.toolName))return a(Oc,{part:e,strings:t,active:o,superseded:r,continuationStreaming:i,onDecision:s.onDecision,onEdit:s.onEdit});if(c.value)return a(Ic,{part:e,strings:t,active:o,superseded:r,continuationStreaming:i,onDecision:s.onDecision,onEdit:s.onEdit})}return n?a(Dc,{part:e,strings:t,live:l}):null}function Jm({part:e,active:t,strings:n}){return a("details",{class:`${Te}-reasoning`,"data-testid":w.reasoning,open:t,"data-active":t?"true":void 0,children:[a("summary",{class:`${Te}-reasoning-summary`,children:a("span",{class:`${Te}-reasoning-label`,children:t?n.thinking:n.thoughts})}),a("div",{class:`${Te}-reasoning-body`,children:a(Go,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Qm(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 Zm(){return a("span",{class:`${Te}-typing`,"data-testid":w.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function ef({label:e}){return a("span",{class:`${Te}-loading`,role:"status",children:[a("span",{class:`${Te}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${Te}-loading-label`,children:e})]})}var It=S.cssPrefix,ka=120,tf=350;function Fc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:r,showSources:i,enableMessageFeedback:l,onFeedback:s,loading:c,idle:d,tool:_,onRetry:p,form:u,formMarkers:f,onFillForm:m}){let h=B(null),g=ee(()=>e.value),[y,P]=R(!1),v=B(!1),x=B(!1),D=B(!1),j=B(0),V=()=>D.current||performance.now()-j.current<tf,ne=B(0),le=k=>{let F=k.scrollHeight-k.clientHeight>1;k.dataset.fadeTop=F&&k.scrollTop>1?"true":"false",k.dataset.fadeBottom=F&&k.scrollHeight-k.scrollTop-k.clientHeight>1?"true":"false"},O=k=>P(k.scrollHeight-k.scrollTop-k.clientHeight>ka*2),A=k=>{ne.current=performance.now(),k.scrollTop=k.scrollHeight,le(k)},Y=(k,F)=>{A(k);let de=F,fe=0,ke=()=>{x.current||V()||(A(k),--de>0&&(fe=requestAnimationFrame(ke)))};return F>0&&(fe=requestAnimationFrame(ke)),()=>cancelAnimationFrame(fe)},$=(k,F)=>{let de,fe,ke,ge=-1,qe=()=>{de.disconnect(),fe.disconnect(),clearTimeout(ke)},Le=()=>{if(x.current||V()||ge>=0&&k.scrollTop<ge-4)return qe();A(k),ge=k.scrollTop};return de=new ResizeObserver(Le),fe=new MutationObserver(Le),Le(),de.observe(k),fe.observe(k,{childList:!0,subtree:!0,characterData:!0}),ke=setTimeout(qe,F),qe},me=g.value[0]?.id;Xe(()=>{let k=h.current;if(k&&g.value.length!==0&&(v.current=!0,!!g.value.some(F=>F.role==="user")))return $(k,300)},[me]);let De=B(0);E(()=>{let k=h.current,F=g.value,de=De.current;if(De.current=F.length,!k||!v.current)return;if(F.slice(de).some(ke=>ke.role==="user"))return x.current=!1,Y(k,3);if(!F.some(ke=>ke.role==="user")||x.current||V())return;k.scrollHeight-k.scrollTop-k.clientHeight<ka&&A(k)},[g.value.length]);let L=B(null);E(()=>{let k=h.current,F=g.value.at(-1),de=L.current;if(L.current=F?{id:F.id,streaming:F.status==="streaming"}:null,!!k&&v.current&&!(!F||F.id!==de?.id||de.streaming||F.status!=="streaming"))return x.current=!1,Y(k,3)},[g.value]),E(()=>{let k=h.current;if(!k)return;let F=g.value.at(-1);if(!F||F.status!=="streaming"&&!g.value.some(ke=>ke.role==="user"))return;let de=()=>{if(x.current||V())return;k.scrollHeight-k.scrollTop-k.clientHeight<ka*2&&A(k)};if(F.status!=="streaming")return $(k,300);de();let fe=new MutationObserver(de);return fe.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>fe.disconnect()},[g.value]);let C=u?.form.id,q=!!u&&(f??[]).some(k=>k.formId===u.form.id);Xe(()=>{let k=h.current;!k||!C||x.current||g.value.some(F=>F.role==="user")&&(q?k.querySelector(`[data-testid="${w.formGate}"]`)?.scrollIntoView({block:"nearest"}):A(k))},[C,q]),E(()=>{let k=h.current;if(!k)return;let F=()=>{O(k),le(k),performance.now()-ne.current>150&&(x.current=k.scrollHeight-k.scrollTop-k.clientHeight>8)},de=()=>{x.current=!0},fe=ct=>{ct.deltaY<0&&de()},ke=0,ge=ct=>{ke=ct.touches[0]?.clientY??0,D.current=!0},qe=ct=>{(ct.touches[0]?.clientY??0)>ke+4&&de()},Le=()=>{D.current=!1,j.current=performance.now()},Bn=()=>{D.current=!0};return k.addEventListener("scroll",F,{passive:!0}),k.addEventListener("wheel",fe,{passive:!0}),k.addEventListener("touchstart",ge,{passive:!0}),k.addEventListener("touchmove",qe,{passive:!0}),k.addEventListener("touchend",Le,{passive:!0}),k.addEventListener("touchcancel",Le,{passive:!0}),k.addEventListener("pointerdown",Bn,{passive:!0}),window.addEventListener("pointerup",Le,{passive:!0}),window.addEventListener("pointercancel",Le,{passive:!0}),O(k),()=>{k.removeEventListener("scroll",F),k.removeEventListener("wheel",fe),k.removeEventListener("touchstart",ge),k.removeEventListener("touchmove",qe),k.removeEventListener("touchend",Le),k.removeEventListener("touchcancel",Le),k.removeEventListener("pointerdown",Bn),window.removeEventListener("pointerup",Le),window.removeEventListener("pointercancel",Le)}},[]);let G=()=>{let k=h.current;k&&(x.current=!1,A(k))},oe=[],ye="",ce=g.value.at(-1)?.id,Se=[...f??[]].toSorted((k,F)=>(k.createdAt??1/0)-(F.createdAt??1/0)),Re=k=>u&&k.formId===u.form.id?a(ca,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip},`gate:${k.formId}`):a(nc,{marker:k,strings:t,onFill:!u&&m?()=>m(k.formId):void 0},k.key),Ge=k=>{for(let F=Se[0];F?.createdAt!==void 0&&!(k!==void 0&&F.createdAt>k);F=Se[0])Se.shift(),oe.push(Re(F))};for(let k of g.value){if(k.role==="assistant"&&k.id!==ce&&mt(k))continue;Ge(k.createdAt);let F=nf(k.createdAt);F&&F!==ye&&(oe.push(a("div",{class:`${It}-date-divider`,children:a("span",{class:`${It}-date-pill`,title:of(k.createdAt),children:rf(k.createdAt,t)})},`day:${F}`)),ye=F),oe.push(a($c,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:r,showSources:i,interactive:!!d&&k.id===ce,superseded:k.id!==ce,tool:_,onRetry:d&&k.id===ce?p:void 0,enableMessageFeedback:l,onFeedback:s},k.id))}for(let k of Se)oe.push(Re(k));return a("div",{class:`${It}-list-wrap`,children:[a("div",{ref:h,class:`${It}-list ${It}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&g.value.length===0?a("div",{class:`${It}-list-loading`,role:"status",children:t.conversationLoading}):null,oe,u&&!q?a(ca,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip}):null]}),y?a("button",{type:"button",class:`${It}-jump`,onClick:G,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":w.scrollToBottom,children:a(Tt,{})}):null]})}function nf(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function of(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function rf(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),r=Math.round((o(new Date)-o(n))/864e5);return r<=0?t.dateToday:r===1?t.dateYesterday:r<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var af=["today","yesterday","lastWeek","older"];function sf(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((Bc(e)-Bc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Hc(e,t){let n=new Map;for(let o of t){let r=sf(e,o.lastMessageAt),i=n.get(r);i?i.push(o):n.set(r,[o])}return af.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function Bc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var lf=z.scope("history"),cf=3,df=6,uf={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function _f(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 Yo({transport:e,strings:t,locale:n,persistence:o,visitorId:r,onSelect:i,onNewConversation:l}){let s=S.cssPrefix,c=e.peekConversations({visitorId:r}),[d,_]=R(c?"loaded":"loading"),[p,u]=R(c?.conversations??[]);E(()=>{let g=!1;return e.listConversations({visitorId:r}).then(y=>{if(g)return;let P=y.conversations??[];u(P),_("loaded"),o.saveHistoryCount(P.length)}).catch(y=>{g||(lf.warn("listConversations failed",{err:y}),_("error"))}),()=>{g=!0}},[e,r,o]);let f=l?a("div",{class:`${s}-history-footer`,children:a("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":w.sidebarNewConversation,children:[a(dl,{}),t.newConversation]})}):null;if(d==="loading"){let g=Math.min(o.loadHistoryCount()??cf,df);return a(Z,{children:[a("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:a("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[a("div",{class:`${s}-history-heading`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),a("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,g)},(y,P)=>a("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[a("span",{class:`${s}-history-avatar ${s}-skeleton`}),a("span",{class:`${s}-history-body`,children:[a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-title`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),a("span",{class:`${s}-history-time`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),a("span",{class:`${s}-history-row`,children:a("span",{class:`${s}-history-preview`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},P))})]})}),f]})}if(d==="error"||p.length===0)return a(Z,{children:[a("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),h=Hc(m,p);return a(Z,{children:[a("div",{class:`${s}-history`,role:"list",children:h.map(g=>a("div",{class:`${s}-history-group`,children:[a("div",{class:`${s}-history-heading`,children:t[uf[g.bucket]]}),a("div",{class:`${s}-history-card`,children:g.conversations.map(y=>a("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(y),"data-closed":y.canContinue?void 0:"true","data-unread":y.hasUnread?"true":void 0,"data-testid":Ce(w.historyItem,y.conversationId),children:[a("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:a(ta,{})}),a("span",{class:`${s}-history-body`,children:[a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-title`,children:y.title}),a("span",{class:`${s}-history-time`,children:_f(y.lastMessageAt,m,n)})]}),a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-preview`,children:y.preview??(y.canContinue?t.historyContinue:t.conversationClosed)}),y.hasUnread?a("span",{class:`${s}-history-dot`}):null]})]})]},y.conversationId))})]},g.bucket))}),f]})}var zc=S.cssPrefix;function Uc({suggestions:e,onPick:t}){return e.length===0?null:a("div",{class:`${zc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>a("button",{type:"button",class:`${zc}-suggestion`,onClick:()=>t(n),"data-testid":Ce(w.suggestion,o),children:n.label},n.id))})}var Ee=S.cssPrefix;function qc(e){let{options:t,onClose:n}=e,o=t.strings,r=B(null);E(()=>{let c=r.current;if(!c)return;let d=$o(c),_=p=>{p.key==="Escape"&&n?.()};return c.addEventListener("keydown",_),()=>{d(),c.removeEventListener("keydown",_)}},[n]);let i=e.composerApiRef,l=N(c=>{i.current?.attachFromDrop(c)},[i]),{visible:s}=Ho({containerRef:r,onDrop:l});return No(r.current,t.mode==="modal"),a("div",{ref:r,class:`${Ee}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":w.panel,children:[a(wa,{...e,containerEl:r.current,dragOver:s,composerAttachApiRef:i}),a(Ca,{poweredBy:e.options.poweredBy})]})}function wa(e){let{options:t,transport:n,feedback:o,bus:r,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,controlMode:_,assignedOperatorInitials:p,operatorAvailable:u,operatorRequestEnabled:f,onRequestOperator:m,onCancelRequest:h,loadingMessages:g,messagesSig:y,agent:P,suggestions:v,initialWidgetSize:x,visitorId:D,onClose:j,onBack:V,onClear:ne,onToggleHistory:le,onSelectHistoryConversation:O,onNewConversation:A,onWidgetSizeChange:Y,onSend:$,onStop:me,onSuggestion:De,activeForm:L,formMarkers:C,onFormSubmit:q,onFormSkip:G,onFormFill:oe,tool:ye,onRetry:ce,onMessageFeedback:Se,containerEl:Re,dragOver:Ge,composerAttachApiRef:k}=e,F=t.strings,de;return L?de=null:c?de=a(Z,{children:[_&&_!=="ai-agent"?a(ff,{controlMode:_,operatorInitials:p,operatorAvailable:u,onCancelRequest:h,strings:F}):null,!d&&_==="ai-agent"&&a(Uc,{suggestions:v,onPick:De}),a(Yl,{options:t,transport:n,feedback:o,bus:r,isStreaming:d,operatorRequestEnabled:f,controlMode:_,onRequestOperator:m,onSend:$,onStop:me,attachApiRef:k})]}):de=a(mf,{label:F.conversationClosed,ctaLabel:F.startNewConversation,onNewConversation:ne}),a(Z,{children:[s==="history"?a(pf,{strings:F,onBack:le,onClose:j,showClose:Do(t.mode,l,t.actions)}):a("header",{class:`${Ee}-header`,"data-testid":w.panelHeader,children:[V?a("button",{type:"button",class:`${Ee}-icon-btn`,onClick:V,"aria-label":F.moduleBack,title:F.moduleBack,children:a(Tn,{})}):null,P?a(Gl,{agent:P,strings:F}):a("h1",{children:F.panelTitle}),a(Ze,{panelProps:e,variant:"chat"})]}),s==="history"?a(Yo,{transport:n,strings:F,locale:t.locale,persistence:i,visitorId:D,onSelect:fe=>O(fe.conversationId),onNewConversation:A}):a(Z,{children:[a(Jl,{visible:Ge,strings:F}),a(Fc,{messagesSig:y,strings:F,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Se,loading:g,idle:!d,tool:ye,onRetry:ce,form:L?{form:L,onSubmit:q,onSkip:G}:null,formMarkers:C,onFillForm:oe}),de,a(hf,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?a(Oo,{panelEl:Re,resize:t.size.resize,position:t.position,initialSize:x,onSizeChange:Y,strings:F}):null]})}function pf({strings:e,onBack:t,onClose:n,showClose:o}){return a("header",{class:`${Ee}-header`,children:[a("button",{type:"button",class:`${Ee}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(Tn,{})}),a("h1",{children:e.historyTitle}),o?a("button",{type:"button",class:`${Ee}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(Qe,{})}):null]})}function mf({label:e,ctaLabel:t,onNewConversation:n}){return a("div",{class:`${Ee}-readonly-banner`,role:"note",children:[a("span",{class:`${Ee}-readonly-label`,children:e}),a("button",{type:"button",class:`${Ee}-readonly-cta`,onClick:n,children:t})]})}function ff({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelRequest:o,strings:r}){let i=gf(e,t,n,r);return a("div",{class:`${Ee}-operator-banner`,role:"status","data-mode":e,"data-testid":w.operatorBanner,children:[a("span",{class:`${Ee}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${Ee}-operator-label`,children:i}),e==="awaiting_operator"&&o?a("button",{type:"button",class:`${Ee}-operator-cancel`,"data-testid":w.operatorCancelRequest,onClick:o,children:r.cancelOperatorRequest}):null]})}function gf(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function hf({disclaimer:e}){return e?a("div",{class:`${Ee}-composer-footer`,children:a("div",{class:`${Ee}-disclaimer`,children:e})}):null}function Ca({poweredBy:e}){return e?a("div",{class:`${Ee}-poweredby-bar`,children:a(vf,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function vf({logoUrl:e,text:t,href:n}){let o=a(Z,{children:[e?a("img",{class:`${Ee}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${Ee}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):a("span",{class:`${Ee}-poweredby`,children:o})}function Wc(e){let t=B(e);t.current=e;let n=B(null);return n.current??(n.current=bf(t)),n.current}function bf(e){let t=W(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,r=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 _=e.current;if(c==="manual"){let p=_.forms.list.find(u=>u.id===d);p&&(t.value={form:p,trigger:"manual"});return}for(let p of _.forms.byTrigger[c]??[]){let u=p.triggers.find(f=>f.kind===c);if(!(!u||!yf(u,_)||r(p)||!Pf(p,_))){t.value={form:p,trigger:c};return}}},l=(c,d)=>{let _=t.value;if(!_)return;t.value=null;let{form:p,trigger:u}=_;p.frequency==="conversation"?n.add(o(p.id)):p.frequency!=="always"&&e.current.persistence.saveFormDone(p.id),e.current.onComplete(p,u,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(_=>_.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function yf(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function Pf(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let r=t.userContext()??{};if(n.missingContext.some(i=>r[i]!==void 0&&r[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 Vc(e){let t=S.cssPrefix,{site:n,blocks:o,strings:r,collapsed:i}=e,l=o?.navigation??[],s=o?.linkCards??[],c=i?r.expandSidebar:r.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":w.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(xf,{site:n}),a("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":w.sidebarToggle,children:a(Sf,{collapsed:i})})]}),i?null:a(Z,{children:[l.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(kf,{items:l})}):null,s.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(wf,{items:s})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(Yo,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function xf({site:e}){let t=S.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return a("picture",{children:[e.logoDark?.url?a("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,a("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return a("div",{class:`${t}-sidebar-title`,children:e?.title??S.name})}function Sf({collapsed:e}){return a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?a("polyline",{points:"9 6 15 12 9 18"}):a("polyline",{points:"15 6 9 12 15 18"})})}function kf({items:e}){let t=S.cssPrefix;return a("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>a("li",{children:a("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?a("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,a("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function wf({items:e}){let t=S.cssPrefix;return a("div",{class:`${t}-sidebar-cards`,children:e.map(n=>a("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[a("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?a("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var Kc=S.cssPrefix;function Gc(e){return a("main",{class:`${Kc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a(Vc,{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}),a("section",{class:`${Kc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var jc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Ta(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}function Xc(e,t,n){let o=[...new Set(t)],r=Ta(o,e,""),i=W({activeTab:r,stacks:jc(o)});return{sig:i,reconcile(l,s){let c=[...new Set(l)],d=i.value,_=Ta(c,d.activeTab,s),p=Object.fromEntries(c.map(f=>[f,d.stacks[f]??[]])),u=_===d.activeTab&&c.length===Object.keys(d.stacks).length&&c.every(f=>d.stacks[f]===p[f]);o=c,!u&&(i.value={activeTab:_,stacks:p},_!==d.activeTab&&_&&n?.(_))},switchTab(l){!(l in i.value.stacks)||i.value.activeTab===l||(i.value={...i.value,activeTab:l},n?.(l))},push(l){let s=i.value,c=s.stacks[s.activeTab]??[];i.value={...s,stacks:{...s.stacks,[s.activeTab]:[...c,l]}}},pop(){let l=i.value,s=l.stacks[l.activeTab]??[];s.length!==0&&(i.value={...l,stacks:{...l.stacks,[l.activeTab]:s.slice(0,-1)}})},reset(l){i.value={activeTab:Ta(o,l,""),stacks:jc(o)}}}}var Yc=e=>e.stacks[e.activeTab]??[],Jc=e=>Yc(e).at(-1),Qc=e=>Yc(e).length===0;var Zc={Icon:Rn};var gt=S.cssPrefix;function Jo({title:e,actions:t}){return a("header",{class:`${gt}-back-header`,"data-variant":"title",children:[a("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${gt}-back-title`,children:e}),t??a("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"})]})}function Qo({title:e,backLabel:t,onBack:n,actions:o,testid:r}){return a("header",{class:`${gt}-back-header`,"data-testid":r,children:[a("button",{type:"button",class:`${gt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(Tn,{})}),a("h1",{class:`${gt}-back-title`,children:e}),o??a("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"})]})}function en(e,t){return e instanceof Je&&e.status===429?t.errorRateLimited:t.errorGeneric}var tn=S.cssPrefix;function ed({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${tn}-home-search`,onClick:t,"data-testid":w.homeSearch,children:[a("span",{class:`${tn}-home-search-text`,children:e}),a("span",{class:`${tn}-home-search-icon`,"aria-hidden":"true",children:a(oa,{})})]})}function td({placeholder:e,value:t,onInput:n}){return a("div",{class:`${tn}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${tn}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":w.helpSearch}),a("span",{class:`${tn}-home-search-icon`,"aria-hidden":"true",children:a(oa,{})})]})}var Ln=S.cssPrefix;function Zo({title:e,subtitle:t,onClick:n,testid:o}){return a("button",{type:"button",class:`${Ln}-list-row`,onClick:n,"data-testid":o,children:[a("span",{class:`${Ln}-list-row-body`,children:[a("span",{class:`${Ln}-list-row-title`,children:e}),t?a("span",{class:`${Ln}-list-row-sub`,children:t}):null]}),a("span",{class:`${Ln}-list-row-chevron`,"aria-hidden":"true",children:a(Yt,{})})]})}var nd=S.cssPrefix;function Ve({tone:e="info",message:t,onRetry:n,strings:o}){return a("div",{class:`${nd}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${nd}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Mt=S.cssPrefix,Cf=z.scope("help"),Tf=(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 Ef(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 od(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let r=0;for(let i of e){if(r=n.indexOf(i,r),r===-1)return 0;r+=1}return 1}function Rf(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(od(n,o.title)*2,od(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,r)=>r.score-o.score).map(o=>o.item):[]}function rd({article:e,nav:t}){return a(Zo,{title:e.title,subtitle:e.description,onClick:()=>Tf(t,e),testid:Ce(w.helpArticle,e.id)})}function Af({transport:e,strings:t,config:n,nav:o,bus:r,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,_]=R(t.errorGeneric),[p,u]=R([]),[f,m]=R(""),[h,g]=R(0);E(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(x=>{if(v)return;let D=x.items??[];u(D),c("loaded"),r.emit("contentView",{section:"help",tags:l?.join(","),count:D.length})}).catch(x=>{v||(Cf.warn("listContent (help) failed",{err:x}),_(en(x,t)),c("error"))}),()=>{v=!0}},[e,l,h,r]);let y=Ae(()=>Rf(p,f),[p,f]);E(()=>{let v=f.trim();if(!v)return;let x=setTimeout(()=>r.emit("contentSearch",{queryLength:v.length,hitCount:y.length}),600);return()=>clearTimeout(x)},[f,y,r]);function P(){return f.trim().length>0?y.length===0?a(Ve,{message:t.helpSearchEmpty,strings:t}):a("div",{class:`${Mt}-help-card`,children:y.map(v=>a(rd,{article:v,nav:o},v.id))}):s==="loading"?a(Ve,{message:t.helpLoading,strings:t}):s==="error"?a(Ve,{tone:"error",message:d,onRetry:()=>g(v=>v+1),strings:t}):p.length===0?a(Ve,{message:t.helpEmpty,strings:t}):Ef(p).map(([v,x])=>a("section",{class:`${Mt}-help-group`,children:[v?a("h2",{class:`${Mt}-help-section-title`,children:v}):null,a("div",{class:`${Mt}-help-card`,children:x.map(D=>a(rd,{article:D,nav:o},D.id))})]},v))}return a("div",{class:`${Mt}-module`,children:[a(Jo,{title:t.helpTitle,actions:a(Ze,{panelProps:i,variant:"plain"})}),a("div",{class:`${Mt}-module-pad`,children:a(td,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),a("div",{class:`${Mt}-help-list`,children:P()})]})}var ad={Icon:En,Root:e=>a(Af,{...e})};var id=S.cssPrefix;function Ea({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${id}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${id}-home-card`,"data-testid":n,children:t})}var _e=S.cssPrefix,sd=z.scope("home");function If(e){let t=e.options.userContext?.name,n=e.config.greetingText?Me(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 Mf=(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 Lf(e){let{transport:t,strings:n,config:o,nav:r,bus:i,panelProps:l}=e,[s,c]=R(null),[d,_]=R([]),p=o.contentTags?.join(",");E(()=>{if(o.showRecentConversations===!1)return;let y=!1;return t.listConversations({limit:1}).then(P=>!y&&c(P.conversations?.[0]??null)).catch(P=>!y&&sd.warn("listConversations (home) failed",{err:P})),()=>{y=!0}},[t,o.showRecentConversations]),E(()=>{if(!o.contentTags?.length)return;let y=!1;return t.listContent({tags:o.contentTags,limit:6}).then(P=>{if(y)return;let v=P.items??[];_(v),i.emit("contentView",{section:"home",tags:p,count:v.length})}).catch(P=>!y&&sd.warn("listContent (home) failed",{err:P})),()=>{y=!0}},[t,p,i]);let u=If(e),f=o.userAvatars??[],m=o.status,h=m?.text?Me(n,m.text):n.homeStatus,g=o.contentBlockTitle?Me(n,o.contentBlockTitle):n.homeContentTitle;return a("div",{class:`${_e}-module ${_e}-home`,"data-testid":w.homeView,children:a("div",{class:`${_e}-home-scroll`,children:[a("div",{class:`${_e}-home-hero`,children:[a("div",{class:`${_e}-home-hero-top`,children:[o.brandName?a("span",{class:`${_e}-home-brand`,"data-testid":w.homeBrand,children:o.brandName}):a("span",{class:`${_e}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${_e}-home-hero-actions`,children:[f.length>0?a("div",{class:`${_e}-home-avatars`,children:f.map(y=>a("span",{class:`${_e}-home-avatar`,title:y.role?`${y.name} \xB7 ${y.role}`:y.name,children:y.avatar?a("img",{src:y.avatar,alt:"",loading:"lazy"}):a("span",{children:Fo(y.name)})},y.name))}):null,a(Ze,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?a(Z,{children:[a("h1",{class:`${_e}-home-greeting`,"data-testid":w.homeGreeting,children:u.title}),u.subtitle?a("p",{class:`${_e}-home-lead`,children:u.subtitle}):null]}):null]}),a("div",{class:`${_e}-home-cards`,children:[o.showSearchBar!==!1?a(ed,{placeholder:n.homeSearchPlaceholder,onActivate:()=>r.switchToLayout("help")}):null,s?a(Ea,{onClick:()=>r.selectConversation(s.conversationId),testid:w.homeRecent,children:a("div",{class:`${_e}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[a("span",{class:`${_e}-home-recent-avatar`,"aria-hidden":"true",children:a(Rn,{})}),a("span",{class:`${_e}-home-recent-body`,children:[a("span",{class:`${_e}-home-recent-title`,children:s.title}),s.preview?a("span",{class:`${_e}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?a("span",{class:`${_e}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,m?a(Ea,{onClick:m.url?()=>r.push({kind:"iframe",url:m.url,title:h}):void 0,children:a("div",{class:`${_e}-home-status`,"data-level":m.level??"operational",children:[a("span",{class:`${_e}-home-status-icon`,"aria-hidden":"true",children:a(Il,{})}),a("span",{class:`${_e}-home-status-text`,children:h})]})}):null,d.length>0?a("section",{class:`${_e}-home-content`,children:[a("div",{class:`${_e}-home-content-title`,children:g}),a("div",{class:`${_e}-home-content-list`,children:d.map(y=>a(Zo,{title:y.title,subtitle:y.description,onClick:()=>Mf(r,y),testid:Ce(w.homeContentRow,y.id)},y.id))})]}):null]})]})})}var ld={Icon:Ml,Root:e=>a(Lf,{...e})};var ht=S.cssPrefix,Of=z.scope("news");function Nf({transport:e,strings:t,config:n,nav:o,bus:r,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,_]=R(t.errorGeneric),[p,u]=R([]),[f,m]=R(0);E(()=>{let g=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(y=>{if(g)return;let P=y.items??[];u(P),c("loaded"),r.emit("contentView",{section:"news",tags:l?.join(","),count:P.length})}).catch(y=>{g||(Of.warn("listContent (news) failed",{err:y}),_(en(y,t)),c("error"))}),()=>{g=!0}},[e,l,f,r]);function h(){return s==="loading"?a(Ve,{message:t.newsLoading,strings:t}):s==="error"?a(Ve,{tone:"error",message:d,onRetry:()=>m(g=>g+1),strings:t}):p.length===0?a(Ve,{message:t.newsEmpty,strings:t}):a("div",{class:`${ht}-news-list`,children:p.map(g=>a("button",{type:"button",class:`${ht}-news-card`,onClick:()=>o.push({kind:"content",id:g.id,title:g.title}),"data-testid":Ce(w.newsItem,g.id),children:[g.image?a("img",{class:`${ht}-news-hero`,src:g.image,alt:"",loading:"lazy"}):null,a("span",{class:`${ht}-news-body`,children:[a("span",{class:`${ht}-news-title`,children:g.title}),g.description?a("span",{class:`${ht}-news-summary`,children:g.description}):null]})]},g.id))})}return a("div",{class:`${ht}-module`,children:[a(Jo,{title:t.newsTitle,actions:a(Ze,{panelProps:i,variant:"plain"})}),a("div",{class:`${ht}-module-scroll`,children:h()})]})}var cd={Icon:Ll,Root:e=>a(Nf,{...e})};var er={chat:Zc,home:ld,help:ad,news:cd};var On=S.cssPrefix;function dd({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:r}){return a("nav",{class:`${On}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=er[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return a("button",{type:"button",role:"tab","aria-selected":s,class:`${On}-tab`,onClick:()=>r(i.id),"data-testid":Ce(w.tab,i.id),children:[a("span",{class:`${On}-tab-icon`,"aria-hidden":"true",children:[a(l,{}),c?a("span",{class:`${On}-tab-badge`,"data-testid":w.tabBadge,"aria-label":"Unread"}):null]}),a("span",{class:`${On}-tab-label`,children:Me(n,i.label)})]},i.id)})})}var ud=S.cssPrefix,Df="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function _d({url:e,title:t,strings:n,onBack:o,actions:r}){return a("div",{class:`${ud}-module`,children:[a(Qo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:r}),a("iframe",{class:`${ud}-content-frame`,src:e,title:t||"content",sandbox:Df,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Nn=S.cssPrefix,$f=z.scope("content"),Ff=5e3;function pd({id:e,title:t,transport:n,strings:o,bus:r,onBack:i,actions:l}){let[s,c]=R(null),[d,_]=R(!1),[p,u]=R(0),f=N(()=>{_(!1),c(null),u(g=>g+1)},[]);E(()=>{let g=!1;return n.listContent({ids:[e],limit:1}).then(y=>{if(g)return;let P=y.items[0];P?(c(P),r.emit("contentOpen",{contentId:e,tags:P.tags?.length?P.tags.join(","):void 0})):_(!0)}).catch(y=>{g||($f.warn("listContent (reader) failed",{err:y}),_(!0))}),()=>{g=!0}},[n,e,p,r]),E(()=>{if(!s)return;let g=setTimeout(()=>r.emit("contentRead",{contentId:e}),Ff);return()=>clearTimeout(g)},[s,e,r]);let m=N(g=>{let P=g.target?.closest?.("a")?.getAttribute("href")??"";P&&!P.startsWith("#")&&r.emit("contentLinkClick",{contentId:e})},[r,e]);function h(){return d?a(Ve,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?a(Ve,{message:o.contentLoading,strings:o}):a("article",{class:`${Nn}-content`,"data-testid":w.contentView,onClick:m,children:[s.image?a("img",{class:`${Nn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?a("p",{class:`${Nn}-content-subtitle`,children:s.description}):null,a(Ec,{text:s.content??""})]})}return a("div",{class:`${Nn}-module`,children:[a(Qo,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:w.backHeader}),a("div",{class:`${Nn}-module-scroll`,"data-testid":w.contentScroll,children:h()})]})}var tr=S.cssPrefix;function md({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:r,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,_=B(null),p=B(new Set);E(()=>{let A=_.current;if(!A)return;let Y=$o(A),$=me=>{me.key==="Escape"&&e.onClose?.()};return A.addEventListener("keydown",$),()=>{Y(),A.removeEventListener("keydown",$)}},[e.onClose]);let u=e.composerApiRef,f=N(A=>{u.current?.attachFromDrop(A)},[u]),{visible:m}=Ho({containerRef:_,onDrop:f});No(_.current,c.mode==="modal");let h=ee(()=>n.sig.value).value,g=Jc(h),y=c.modules.byId[h.activeTab],P=g?.kind==="iframe"||g?.kind==="content",v=t.length>1&&(Qc(h)||!P),x=B(null);E(()=>{if(P&&x.current===null)x.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!P&&x.current!==null){let A=x.current;x.current=null,s(A)}},[P]);let D={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:A=>{let Y=t.find($=>$.layout===A);Y&&n.switchTab(Y.id)},selectConversation:i,startNewConversation:l},j=A=>({options:c,transport:e.transport,strings:d,config:A,visitorId:e.visitorId,nav:D,bus:o,panelProps:e}),V=a(Ze,{panelProps:e,variant:"plain"});y&&p.current.add(y.id);let ne=t.filter(A=>p.current.has(A.id)),le=A=>{if(A.layout==="chat")return a(wa,{...e,containerEl:_.current,dragOver:m,composerAttachApiRef:u});let Y=er[A.layout].Root;return Y?a(Y,{...j(A)}):null},O=()=>g?.kind==="iframe"?a(_d,{url:g.url,title:g.title,strings:d,onBack:n.pop,actions:V}):g?.kind==="content"?a(pd,{id:g.id,title:g.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:V}):null;return a("div",{ref:_,class:`${tr}-panel ${tr}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":w.messengerHome,children:[a("div",{class:`${tr}-messenger-body`,children:[ne.map(A=>a("div",{class:`${tr}-messenger-pane`,hidden:P||A.id!==y?.id,children:le(A)},A.id)),O()]}),v?a(dd,{modules:t,activeTab:h.activeTab,strings:d,hasUnread:r,onSelect:n.switchTab}):null,a(Ca,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(y?.layout==="chat"&&!g)?a(Oo,{panelEl:_.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Dn=S.cssPrefix;function fd({strings:e,onClose:t}){return a("div",{class:`${Dn}-panel ${Dn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":w.modulesEmpty,children:[t?a("button",{type:"button",class:`${Dn}-icon-btn ${Dn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:a(Qe,{})}):null,a("p",{class:`${Dn}-modules-empty-text`,children:e.modulesEmpty})]})}function nn(e,t,n,o){let r={role:n,text:o};e.emit("message",r),t.onMessage?.(r)}var Ra=z.scope("hitl");function gd(e){let{streaming:t,messagesSig:n,sendAiTurn:o,bus:r,humanInLoop:i}=e,l=N((p,u)=>{if(t)return;let f=n.value.at(-1),m=f?.partsSig.value.find(h=>h.kind==="tool"&&h.toolCallId===p);if(!f||!m){Ra.warn("decideTool: tool part not found",{toolCallId:p});return}u(m),f.partsSig.value=[...f.partsSig.value],wn(f)&&(f.status="streaming",f.awaitingContinuation=!0,n.value=[...n.value],o({continueExisting:!0}))},[t,n,o]),s=N((p,u)=>{Ra.info("toolResult",{toolCallId:p}),r.emit("toolResult",{toolCallId:p}),l(p,f=>{f.outputSig.value=u,f.stateSig.value="output-available"})},[r,l]),c=N((p,u,f)=>{Ra.info("toolDecision",{toolCallId:p,approved:u}),r.emit("toolDecision",{toolCallId:p,approved:u}),l(p,m=>{let h=m.approvalSig.value?.id??p;m.approvalSig.value={id:h,approved:u,reason:f},m.stateSig.value="approval-responded"})},[r,l]),d=N(p=>{if(t)return;let u=n.value.at(-1),f=u?.partsSig.value.find(h=>h.kind==="tool"&&h.toolCallId===p);if(!u||!f)return;let m=f.approvalSig.value?.id??p;f.approvalSig.value={id:m},f.stateSig.value="approval-requested",u.partsSig.value=[...u.partsSig.value]},[t,n]);return{toolInteraction:Ae(()=>({humanInLoop:i,onResult:s,onDecision:c,onEdit:d}),[i,s,c,d])}}function hd({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[r,i]=R(()=>o?!1:t.loadCalloutDismissed(n));E(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=N(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:r,dismissCallout:l}}function vd(e){let{transport:t}=e,n=Ye("ai-agent"),o=Ye(void 0),r=Ye(void 0),i=N(d=>{n.value=d.controlMode,o.value=d.assignedOperatorInitials,d.operatorAvailable!==void 0&&(r.value=d.operatorAvailable)},[n,o,r]),l=N(d=>{d.type==="data-control-state"&&i(pt(d.data))},[i]),s=N(async()=>{if(n.value!=="ai-agent")return;let d=await t.requestOperator();d&&i(pt(d))},[t,n,i]),c=N(async()=>{if(n.value!=="awaiting_operator")return;let d=await t.cancelRequestOperator();d&&i(pt(d))},[t,n,i]);return{controlModeSig:n,assignedOperatorInitialsSig:o,operatorAvailableSig:r,applyControlState:i,adoptControlStateChunk:l,requestOperator:s,cancelRequestOperator:c}}function bd(e){let{hostElement:t,mode:n,panelSize:o,isOpen:r,setIsOpen:i}=e;Xe(()=>{co(t,Po(n,o,r))},[t,r,o,n]),E(()=>{if(n!=="modal"||!r)return;let l=s=>{s.composedPath().some(d=>d instanceof HTMLElement&&d.classList.contains(`${S.cssPrefix}-panel`))||i(!1)};return t.addEventListener("click",l),()=>t.removeEventListener("click",l)},[t,r,n,i]),E(()=>{if(n!=="drawer"||!r)return;let l=s=>{s.key==="Escape"&&i(!1)};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r,n,i])}var Aa=z.scope("reducer"),nr=class{constructor(t,n){K(this,"messagesSig",t);K(this,"onReconcileNeeded",n);K(this,"active",null);K(this,"openTextParts",new Map);K(this,"partSeq",0);K(this,"resumeIgnore",!1)}attach(t){this.active=t,this.openTextParts.clear()}resetForReplay(t){t.partsSig.value=[],t.status="streaming",t.finishReason=void 0,t.errorText=void 0,t.suggestions=void 0,this.openTextParts.clear(),this.messagesSig.value=[...this.messagesSig.value]}truncateAfterLastTool(t){let n=t.partsSig.value,o=n.findLastIndex(r=>r.kind==="tool");t.partsSig.value=n.slice(0,o+1),t.status="streaming",t.finishReason=void 0,t.errorText=void 0,t.suggestions=void 0,this.openTextParts.clear(),this.messagesSig.value=[...this.messagesSig.value]}detach(){this.active=null,this.openTextParts.clear()}applyResume(t){if(t.type==="data-conversation-rebind")return null;if(t.type==="start"){let n=t.messageId,o=n!==void 0?this.messagesSig.value.find(_=>_.serverMessageId===n||_.id===n):void 0,r=o!==void 0&&o.status!=="streaming"&&To(o)&&Zr(o),i=o!==void 0&&(o.awaitingContinuation===!0||el(o)||r);if(o!==void 0&&!i&&Xs(o))return o!==void 0&&Zr(o)&&this.onReconcileNeeded?.(),this.resumeIgnore=!0,this.detach(),null;if(this.resumeIgnore=!1,o!==void 0)return i?(o.awaitingContinuation=!1,o.continuationStreaming=r,o.status="streaming",this.messagesSig.value=[...this.messagesSig.value]):o.status==="streaming"&&wn(o)?this.truncateAfterLastTool(o):this.resetForReplay(o),this.attach(o),this.apply(t),null;let s=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(s===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!wt(c))return this.attach(c),this.apply(t),null;let d=kt();return this.attach(d),this.messagesSig.value=[...this.messagesSig.value,d],this.apply(t),null}if(this.resumeIgnore||!this.active)return null;if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let n=this.active;return n.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.(n.serverMessageId??n.id):n.continuationStreaming=!1),this.detach(),n}return null}ensureTextPart(t,n,o){let r=`${n}:${o}`,i=this.openTextParts.get(r);if(i)return i;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:W(""),doneSig:W(!1)};return this.openTextParts.set(r,l),$n(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let o=t.messageMetadata;o?.senderRole==="operator"?(n.role="operator",o.operatorInitials&&(n.operatorInitials=o.operatorInitials)):o?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":$n(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":Aa.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Aa.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"abort":Aa.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,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":Bf(n,t);return;case"file":$n(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":yd(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":yd(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=So(t.data);return;case"data-control-state":n.operatorRoutedTurn=!0;return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function Lt(e,t,n){let o=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(o)return o;let r={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:W(""),inputSig:W(void 0),outputSig:W(void 0),errorSig:W(void 0),stateSig:W("input-streaming"),approvalSig:W(void 0)};return $n(e,r),r}function $n(e,t){e.partsSig.value=[...e.partsSig.value,t]}function yd(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||$n(e,t)}function Bf(e,t){switch(t.type){case"tool-input-start":Lt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=Lt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Lt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=Lt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=Lt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Lt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Lt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function Pd(e){let t=1e3;for(;!e.signal.aborted;){let n,o="held";try{o=await e.connect(()=>{n=e.now(),e.backfill()})}catch{}if(e.signal.aborted||o==="unavailable")return;n!==void 0&&e.now()-n>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var Ia=z.scope("resume-stream"),Hf=2500,zf=30,Uf=2e3,qf=8,Wf=400,Vf=200,Kf=1200;function xd(e){let{activated:t,conversationReady:n,conversationIdSig:o,messagesSig:r,streamingRef:i,optionsRef:l,isChatActiveRef:s,transport:c,visitorId:d,adoptControlStateChunk:_,settleSuggestions:p,markActiveConversationRead:u,onReplyLanded:f,setStreaming:m,setActiveCancel:h,setCanSend:g,feedback:y,bus:P,homeNav:v}=e;E(()=>{if(!t||!n||!o.value)return;let x=o.value,D=new AbortController,j=C=>{},V=new nr(r,C=>j(C));c.primeIdentity(d,x),Ia.debug("resume stream opened",{conversationId:x});let ne=()=>{m(!1),h(null),u(),f()},le=(C,q=[])=>{let G=i.current,oe=l.current;if(C.canceled){G&&ne(),r.value=[...r.value];return}let ye=C.status==="error";switch(rl(C,ye)){case"drop":r.value=r.value.filter(ce=>ce!==C);break;case"complete-operator-routed":C.status="complete",G&&(y.play("messageReceived"),nn(P,oe,"assistant",Ue(C)));break;case"error":{if(C.status="error",C.errorText=oe.strings.errorGeneric,G){y.play("error");let ce=new Error(ye?"stream error chunk":"empty reply");P.emit("error",ce),oe.onError?.(ce)}break}case"complete":C.status="complete",G&&(y.play("messageReceived"),nn(P,oe,"assistant",Ue(C))),p(C,q);break}G&&ne(),r.value=[...r.value]},O=C=>{_(C);let q=r.value.length,G=V.applyResume(C);if(C.type==="finish"&&C.canContinue===!1&&g(!1),r.value.length>q){let oe=l.current.modules.list.find(ye=>ye.layout==="chat")?.id;oe&&v?.switchTab(oe)}if(G){if(G.role==="operator"){y.play("messageReceived"),nn(P,l.current,"operator",Ue(G)),!document.hidden&&s.current()&&c.markRead(x).catch(()=>{});return}le(G)}},A=async()=>{let C=await c.loadConversation(x).catch(()=>null);if(D.signal.aborted||!C||(g(C.canContinue??!0),!C.messages?.length))return!1;let q=r.value,G=q.at(-1),{messages:oe,changed:ye}=nl(q,kn(C.messages));if(!ye)return!1;r.value=oe;let ce=oe.at(-1);return G?.role==="assistant"&&G.status==="streaming"&&ce?.role==="assistant"&&ce.status!=="streaming"&&ce.id===G.id?le(ce,C.suggestions??[]):ce?.role==="assistant"&&ce.status!=="streaming"&&p(ce,C.suggestions??[]),!0};j=C=>{(async()=>{for(let q=0;q<qf&&!D.signal.aborted;q++){let G=await A(),oe=C===void 0?void 0:r.value.find(ye=>ye.serverMessageId===C||ye.id===C);if(C===void 0&&G||!oe?.continuationStreaming||D.signal.aborted)return;await Xt(Math.min(Wf+q*Vf,Kf),D.signal)}!D.signal.aborted&&C!==void 0&&Ia.warn("durable HITL reconcile did not land; keeping stale controls locked",{conversationId:x,messageId:C})})()};let Y=0;Pd({signal:D.signal,now:()=>performance.now(),sleep:C=>Xt(C,D.signal),connect:C=>c.connectResumeStream({signal:D.signal,onChunk:O,onConnected:C}),backfill:()=>{let C=performance.now();C-Y<Uf||(Y=C,A())}});let $=C=>C.partsSig.value.reduce((q,G)=>q+(G.kind==="text"||G.kind==="reasoning"?G.textSig.value.length:1),0),me=0,De=-1,L=setInterval(()=>{let C=r.value.at(-1);if(i.current&&C&&C.role!=="user"&&C.status!=="streaming"&&(m(!1),h(null)),!(!i.current&&C!==void 0&&C.role!=="user"&&!C.ephemeral&&(C.status==="streaming"||wt(C)&&Ue(C).trim()===""||To(C)))){me=0,De=-1;return}let G=$(C);if(G!==De){De=G,me=0;return}me++>=zf||A().then(oe=>{oe&&(me=0)})},Hf);return()=>{D.abort(),clearInterval(L),V.detach(),Ia.debug("resume stream closed",{conversationId:x})}},[t,n,o,o.value,d,c,_,p,u,f,m,h,g,r,P,y,v])}var Gf=z.scope("send");function Sd(e){let{transport:t,messagesSig:n,conversationIdSig:o,options:r,bus:i,feedback:l,persistence:s,visitorId:c,adoptConversationId:d,setStreaming:_,setActiveCancel:p}=e,u=N(()=>{let h=o.value??ze();return o.value||(o.value=h,s.saveConversationId(h)),h},[o,s]),f=N(async({continueExisting:h})=>{let g=u(),y=js(n.value,h),P=Yr({messages:y.map(Qr),conversationId:g,tools:r.features.tools,visitorId:c,userPrefs:s.loadUserPrefs()});_(!0),p(()=>()=>t.cancelTurn(o.value));try{let v=await t.sendTurn(P);d(v.conversationId)}catch(v){let x=en(v,r.strings),D=n.value.at(-1);if(h&&D?.role==="assistant")D.status="error",D.errorText=x,n.value=[...n.value];else{let j=kt();j.status="error",j.errorText=x,n.value=[...n.value,j]}_(!1),p(null),l.play("error"),i.emit("error",v),r.onError?.(v)}},[t,n,o,r,i,l,s,c,d,u,_,p]),m=N(async h=>{let g=u(),y=Yr({messages:[Qr(h)],conversationId:g,tools:r.features.tools,visitorId:c,userPrefs:s.loadUserPrefs()});try{let P=await t.sendTurn(y);d(P.conversationId)}catch(P){Gf.debug("operator-routed send failed (non-fatal)",{error:P});let v=P instanceof Error?P:new Error(String(P));i.emit("error",v),r.onError?.(v)}},[t,r,i,s,c,d,u]);return{sendAiTurn:f,sendRoutedTurn:m}}var jf=z.scope("unread"),Xf=300;function kd(e){let{transport:t,options:n,conversationIdSig:o,isChatActiveRef:r,activated:i,conversationReady:l}=e,s=Ye(!1),c=B(new Set),d=B();E(()=>()=>clearTimeout(d.current),[]);let _=N(()=>{let h=r.current()?o.value:void 0;s.value=[...c.current].some(g=>g!==h)},[s,o,r]),p=N(()=>{n.modules.list.some(h=>h.layout==="chat")&&t.listConversations({limit:50}).then(h=>{c.current=new Set(h.conversations.filter(g=>g.hasUnread).map(g=>g.conversationId)),_()}).catch(h=>jf.debug("refreshUnread failed (non-fatal)",{err:h}))},[t,n.modules,_]),u=N(h=>{c.current.delete(h),_()},[_]),f=N(()=>{if(!r.current())return;let h=o.value;h&&(clearTimeout(d.current),d.current=setTimeout(()=>{u(h),t.markRead(h)},Xf))},[t,o,u,r]),m=B(!1);return E(()=>{!i||!l||m.current||(m.current=!0,p())},[i,l,p]),E(()=>{if(!i)return;let h=()=>{document.visibilityState==="visible"&&p()};return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[i,p]),{hasUnreadSig:s,refreshUnread:p,clearUnread:u,markActiveConversationRead:f}}var Fn=z.scope("settings");function wd(e){let{options:t,persistence:n,transport:o,feedback:r,hostElement:i,bus:l}=e,s=n.loadUserPrefs(),[c,d]=R(()=>s.locale??t.locale),[_,p]=R(()=>s.themeMode??t.themeMode),[u,f]=R(()=>s.textSize??t.textSize),m=N(x=>{n.patchUserPrefs(x),o.saveUserPrefs(n.loadUserPrefs()).catch(D=>Fn.warn("saveUserPrefs failed",{err:D}))},[n,o]);E(()=>{s.soundMuted!==void 0&&r.setMuted(s.soundMuted)},[]),E(()=>{i.dataset.theme=_},[i,_,t]),E(()=>{i.dataset.textSize=u},[i,u,t]),E(()=>{let x=!0;return r.mutedSig.subscribe(D=>{if(x){x=!1;return}m({soundMuted:D})})},[r,m]);let h=Bt(c,t.availableLocales,t.defaultLocale);E(()=>{o.setLocale(h)},[o,h]),E(()=>{i.dir=di(h)?"rtl":"ltr"},[i,h]),E(()=>{h!==c&&d(h)},[h,c]);let g=N(x=>{Fn.info("localeChange",{locale:x}),d(x),m({locale:x}),l.emit("localeChange",x)},[m,l]),y=N(x=>{Fn.info("themeChange",{mode:x}),p(x),i.dataset.theme=x,m({themeMode:x}),l.emit("themeChange",x)},[i,m,l]),P=N(x=>{Fn.info("textSizeChange",{size:x}),f(x),i.dataset.textSize=x,m({textSize:x}),l.emit("textSizeChange",x)},[i,m,l]),v=N(()=>{r.toggleMuted();let x=r.mutedSig.value;Fn.info("soundToggle",{muted:x}),l.emit("soundToggle",{muted:x})},[r,l]);return{activeLocale:c,activeThemeMode:_,activeTextSize:u,effectiveLocale:h,setActiveLocale:d,setActiveThemeMode:p,setActiveTextSize:f,patchAndSync:m,handleLocaleChange:g,handleThemeChange:y,handleTextSizeChange:P,handleSoundToggle:v}}var se=z.scope("app"),or=S.cssPrefix;function Cd(e,t){return Ks({...e,text:Me(t,e.text)})}function Td({options:e,hostElement:t,bus:n}){let[o]=R(()=>_t(e.widgetId,e.storage,e.aiAgentDeploymentId)),[r,i]=R(()=>o.getVisitorId()),l=o.loadUserPrefs(),s=Ye(o.loadConversationId()),c=Ye([]),[d,_]=R(!1),[p,u]=R([]);function f(){let b=e.modules.list,T=new Set(b.map(X=>X.id)),Q=o.loadActiveModule();return Q&&T.has(Q)?Q:b[0]?.id??""}function m(){return e.modules.list.find(b=>b.layout==="chat")?.id}function h(){let b=m();return b?e.modules.list.length===1?!0:P.sig.value.activeTab===b:!1}let g=B(h);g.current=h;let y=B();if(!y.current){let b=e.modules.list.map(T=>T.id);y.current=Xc(f(),b,T=>o.saveActiveModule(T))}let P=y.current,[v,x]=R(!1),[D,j]=R(null),[V,ne]=R(!1),le=e.mode==="standalone"||e.mode==="inline",O=B(Sn(e,jt(),o.loadPanelOpen(),o.loadPanelSize())),[A,Y]=R(O.current.panelOpen),[$,me]=R(O.current.panelOpen),De=B(!1),L=B(void 0);E(()=>{A&&me(!0)},[A]);let C=B(!1),[q,G]=R(!1),{dismissed:oe,dismissCallout:ye}=hd({callout:e.launcher.callout,persistence:o}),ce=e.launcher.callout?.persistent??!0,Se=N(()=>{se.info("calloutDismiss"),n.emit("calloutDismiss",void 0),ye()},[n,ye]),[Re,Ge]=R(O.current.panelSize),k=B(!1),[F,de]=R("chat"),[fe,ke]=R(!0),[ge,qe]=R(!1),Le=B(ge);Le.current=ge;let[Bn,ct]=R(null),[Hn,on]=R([]),[Ua,qa]=R(null),zn=B(e.strings),Wa=B(e);Wa.current=e;let[Dd,$d]=R(void 0),[Fd,Bd]=R(void 0),[Hd,zd]=R(()=>o.loadSidebarCollapsed()??!1),[lr,Ud]=R({}),[te]=R(()=>new wo({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ns({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[$e]=R(()=>new Ao(e.sound,e.haptics)),{activeLocale:Un,activeThemeMode:Va,activeTextSize:Ka,effectiveLocale:Ot,setActiveLocale:qd,setActiveThemeMode:Wd,setActiveTextSize:Vd,patchAndSync:Ga,handleLocaleChange:Kd,handleThemeChange:Gd,handleTextSizeChange:jd,handleSoundToggle:Xd}=wd({options:e,persistence:o,transport:te,feedback:$e,hostElement:t,bus:n}),{controlModeSig:cr,assignedOperatorInitialsSig:Yd,operatorAvailableSig:Jd,applyControlState:dr,adoptControlStateChunk:Qd,requestOperator:Zd,cancelRequestOperator:eu}=vd({transport:te}),{hasUnreadSig:tu,refreshUnread:ja,clearUnread:Xa,markActiveConversationRead:nu}=kd({transport:te,options:e,conversationIdSig:s,isChatActiveRef:g,activated:$,conversationReady:v});E(()=>{$e.update(e.sound,e.haptics)},[$e,e.sound,e.haptics]),E(()=>()=>$e.destroy(),[$e]),E(()=>{k.current||!e.size.initialSize||(k.current=!0,!o.loadPanelSize()&&Ge(Xr(e.mode,e.size,jt())))},[e.mode,e.size,o]),E(()=>{if(!v||C.current)return;C.current=!0;let b=Sn(e,jt(),o.loadPanelOpen(),o.loadPanelSize());Y(b.panelOpen),Ge(b.panelSize)},[v,e,o]);let Ya=B(null);E(()=>{v&&P.reconcile(e.modules.list.map(b=>b.id),f())},[v,e.modules.list,P]);let qn=N(b=>{!b||b.length===0||(c.value=b.map(T=>Cd(T,zn.current)))},[c]),ur=B(null),Wn=N(async b=>{try{let{formSubmissions:T}=await(b?te.bootstrap(b):ur.current??te.bootstrap()),Q=new Map;return T.forEach((X,ie)=>Q.set(X.formId,ie)),T.filter((X,ie)=>!X.skipped||Q.get(X.formId)===ie).map((X,ie)=>({key:`wire:${X.formId}:${X.createdAt??ie}`,formId:X.formId,outcome:X.skipped?"skipped":"submitted",createdAt:xo(X.createdAt),values:X.values}))}catch(T){return se.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:T}),[]}},[te]),rn=B(0),Vn=N((b,T)=>{let Q=[...b.map(M=>M.createdAt),...T.map(M=>M.createdAt)].filter(M=>M!==void 0),X=(Q.length?Math.min(...Q):Date.now())-1;return[...(L.current?.messages??[]).map(M=>{let $t=Cd(M,zn.current);return $t.createdAt=X,$t}),...b]},[]),Ja=N(async b=>{let T=rn.current,Q=()=>T!==rn.current;_(!0);try{let[X,ie]=await Promise.all([te.loadConversation(b),Wn()]);if(Q())return;let M=kn(X.messages??[]);if(u(ie),c.value=Vn(tl(M,c.value),ie),ke(X.canContinue??!0),M.length){dr(pt(X.controlState));let $t=M.findLast(Ke=>Ke.role==="assistant"&&!Ke.ephemeral);on($t?.suggestions??X.suggestions??[])}}catch(X){if(Q())return;se.warn("loadThread failed; resetting conversationId",{err:X,conversationId:b}),s.value=void 0,o.saveConversationId(void 0)}finally{Q()||_(!1)}},[te,Wn,c,s,o,Vn]),an=N(async({newConversation:b})=>{let T=++rn.current,Q=()=>T!==rn.current,X=s.value,ie=b||!X?ze():X;ie!==X&&(s.value=ie,o.saveConversationId(ie));let M;try{M=await te.handshake({visitorId:r,conversationId:ie,userPrefs:o.loadUserPrefs(),locale:Un})}catch(Ke){if(Q())return;n.emit("error",Ke),e.onError?.(Ke),b||x(!0);return}if(Q())return;if(M.visitorId&&M.visitorId!==r&&(se.info("visitor rebound",{previous:r,current:M.visitorId,reason:M.rebind?.visitorId}),o.setVisitorId(M.visitorId),i(M.visitorId),n.emit("visitorRebound",{previous:r,current:M.visitorId,reason:M.rebind?.visitorId})),M.conversationId&&M.conversationId!==ie&&(se.info("conversation rebound",{previous:ie,current:M.conversationId,reason:M.rebind?.conversationId}),n.emit("conversationRebound",{previous:ie,current:M.conversationId,reason:M.rebind?.conversationId})),M.agent&&ct(M.agent),dr(pt(M.controlState)),e.mode==="page"&&(M.site&&Ls(M.site)?$d(M.site):M.site&&se.warn("invalid site config, using fallback",{site:M.site}),M.blocks&&Os(M.blocks)?Bd(M.blocks):M.blocks&&se.warn("invalid blocks config, using fallback",{blocks:M.blocks})),M.userPrefs&&!b&&(o.saveUserPrefs(M.userPrefs),M.userPrefs.locale&&qd(M.userPrefs.locale),M.userPrefs.soundMuted!==void 0&&$e.setMuted(M.userPrefs.soundMuted),M.userPrefs.themeMode&&Wd(M.userPrefs.themeMode),M.userPrefs.textSize&&Vd(M.userPrefs.textSize)),L.current=M.welcome,b||n.emit("handshake",M),M.welcome?.suggestions){let Ke=zn.current;on(M.welcome.suggestions.map(je=>({...je,label:Me(Ke,je.label),...je.text===void 0?{}:{text:Me(Ke,je.text)}})))}!b&&X&&M.conversationId===X?De.current=!0:(s.value=M.conversationId,o.saveConversationId(M.conversationId),qn(M.welcome?.messages)),b||x(!0)},[te,r,o,e,n,s,$e,qn,Ja,Un]),sn=JSON.stringify(e.userContext??null),ou=JSON.stringify(e.pageContext??null),ru=JSON.stringify(lr);E(()=>{let b=Object.keys(lr).length?{...lr,...e.userContext}:e.userContext;te.setContext(b,Yf(e.pageContext))},[te,sn,ou,ru]);let au=N((b,T=[])=>on(b.suggestions??T),[]),iu=N(b=>{if(!b||b===s.value)return;let T=s.value;s.value=b,o.saveConversationId(b),te.primeIdentity(void 0,b),se.info("conversation rebound",{previous:T,current:b}),T&&n.emit("conversationRebound",{previous:T,current:b,reason:b})},[s,o,te,n]);E(()=>(te.primeIdentity(r,s.value),an({newConversation:!1}),()=>{rn.current++}),[]);let Qa=B(!1);E(()=>{if(!(!$||!v||Qa.current)&&(Qa.current=!0,ur.current=te.bootstrap(),(async()=>{try{let b=await ur.current;j(pn((b??{forms:[]}).forms,Ot))}catch(b){se.debug("bootstrap failed \u2014 treating as no forms",{err:b})}finally{ne(!0)}})(),De.current)){De.current=!1;let b=s.value;b&&Ja(b)}},[$,v]);let Kn=B(null);E(()=>{if(!$||!v)return;if(Kn.current===null){Kn.current=Ot;return}if(Kn.current===Ot)return;Kn.current=Ot;let b=!1;return te.bootstrap().then(T=>{b||j(pn((T??{forms:[]}).forms,Ot))}).catch(T=>se.debug("forms re-localize failed \u2014 keeping current copy",{err:T})),()=>{b=!0}},[$,v,Ot,te]);let Za=B(sn);E(()=>{!v||Za.current===sn||(Za.current=sn,an({newConversation:!1}))},[sn,v,an]),bd({hostElement:t,mode:e.mode,panelSize:Re,isOpen:A,setIsOpen:Y});let{sendAiTurn:ln,sendRoutedTurn:ei}=Sd({transport:te,messagesSig:c,conversationIdSig:s,options:e,bus:n,feedback:$e,persistence:o,visitorId:r,adoptConversationId:iu,setStreaming:qe,setActiveCancel:qa}),{toolInteraction:su}=gd({streaming:ge,messagesSig:c,sendAiTurn:ln,bus:n,humanInLoop:e.features.humanInLoop}),lu=N((b,T)=>{se.info("messageFeedback",{messageId:b,value:T}),n.emit("messageFeedback",{messageId:b,value:T}),te.submitFeedback({messageId:b,value:T})},[n,te]),cu=()=>c.value.reduce((b,T)=>b+(T.role==="user"?1:0),0),Nt=e.forms.list.length>0?e.forms:D??e.forms,he=Wc({forms:Nt,persistence:o,userContext:()=>e.userContext,messageCount:cu,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>s.value,onComplete:(b,T,Q,X)=>{se.info("formSubmit",{formId:b.id,trigger:T,skipped:X}),n.emit("formSubmit",{formId:b.id,values:Q,skipped:X}),u(M=>{let Ke=M.find(je=>je.formId===b.id&&je.outcome==="skipped")?.createdAt??Date.now();return[...M.filter(je=>!(je.formId===b.id&&je.outcome==="skipped")),{key:`local:${b.id}:${Ke}`,formId:b.id,outcome:X?"skipped":"submitted",createdAt:Ke,...X?{}:{values:Q}}]});let ie=s.value??ze();s.value||(s.value=ie,o.saveConversationId(ie),te.primeIdentity(void 0,ie)),!X&&b.mirrorToContext&&Ud(M=>({...M,...Q})),te.submitForm({formId:b.id,conversationId:ie,trigger:T,values:Q,skipped:X})}}),du=ee(()=>he.activeForm.value),uu=N(()=>he.fire("after-messages"),[he]);xd({activated:$,conversationReady:v,conversationIdSig:s,messagesSig:c,streamingRef:Le,optionsRef:Wa,isChatActiveRef:g,transport:te,visitorId:r,adoptControlStateChunk:Qd,settleSuggestions:au,markActiveConversationRead:nu,onReplyLanded:uu,setStreaming:qe,setActiveCancel:qa,setCanSend:ke,feedback:$e,bus:n,homeNav:P}),E(()=>{he.refresh()},[Nt,he]);let ti=e.pageContext?.area?String(e.pageContext.area):void 0,_u=ee(()=>c.value.length);E(()=>{v&&V&&he.fire("pre-chat")},[v,V,he]),E(()=>{V&&!fe&&he.fire("conversation-closed")},[V,fe,he]),E(()=>{v&&V&&ti&&he.fire("page-area")},[v,V,ti,he]);let _r=Ae(()=>{let b=Nt.list.flatMap(T=>T.triggers).filter(T=>T.kind==="idle").map(T=>Number(T.param));return b.length?Math.min(...b)*1e3:0},[Nt]);E(()=>{if(!_r||!A)return;let b=setTimeout(()=>he.fire("idle"),_r);return()=>clearTimeout(b)},[_r,A,he,_u.value]);let ni=N(async(b,T)=>{let Q=cr.value!=="ai-agent";if(se.info("send",{textLen:b.length,attachments:T.length,streaming:ge,routedToOperator:Q}),ge&&!Q)return;n.emit("send",{text:b,attachmentCount:T.length}),Hn.length>0&&on([]);let X=await Qf(te,T,M=>{se.warn("upload failed",{err:M}),n.emit("error",M),e.onError?.(M)});$e.unlock(),$e.play("messageSent");let ie=Vs(b,X);if(nn(n,e,"user",b),Q){c.value=[...c.value,ie],ei(ie);return}c.value=[...c.value,ie,kt()],ln({continueExisting:!1})},[ge,te,n,e,Hn.length,c,ln,ei,cr]),pu=N(()=>{se.info("stop"),n.emit("stop",void 0);let b=c.value.at(-1);b&&b.role!=="user"&&b.status==="streaming"&&(b.canceled=!0,c.value=[...c.value]),Ua?.()},[Ua,n,c]),mu=N(()=>{if(ge)return;let b=c.value,T=b.at(-1);!T||T.role!=="assistant"||T.status!=="error"&&!mt(T)||(c.value=[...b.slice(0,-1),kt()],se.info("retry"),ln({continueExisting:!1}))},[ge,c,ln]),cn=N(()=>{if(Kl(e.mode,Re)==="exit-fullscreen"){se.info("close \u2192 exit-fullscreen",{mode:e.mode}),Ge("normal"),n.emit("fullscreen",!1);return}se.info("close \u2192 panel closed",{mode:e.mode}),he.fire("panel-close"),Y(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Re,he]),pr=N(()=>{se.info("open",{mode:e.mode}),$e.unlock(),G(!0),Y(!0),o.savePanelOpen(!0),!oe&&!ce&&Se(),setTimeout(()=>G(!1),Jf),ja(),n.emit("open",void 0),e.onOpen?.()},[n,e,$e,o,oe,ce,Se,ja]),mr=N(()=>{if(!c.value.some(T=>T.role==="user")&&fe&&s.value){se.info("clear \u2192 reusing empty conversation",{conversationId:s.value}),c.value.length===0&&qn(L.current?.messages);return}se.info("clear \u2192 new conversation",{wasStreaming:ge}),n.emit("clear",void 0),ge&&qe(!1),Vt(()=>{c.value=[],s.value=void 0}),o.clearConversation(),ke(!0),u([]),an({newConversation:!0})},[ge,c,s,o,an,n,fe,qn]),fr=N(()=>{mr(),de("chat");let b=e.modules.list.find(T=>T.layout==="chat")?.id;b&&P.switchTab(b)},[mr,P,e]),gr=N(()=>{let b=Re==="expanded"?"normal":"expanded";se.info("expand",{from:Re,expanded:b==="expanded"}),Ge(b),o.savePanelSize(b),n.emit("expand",b==="expanded")},[n,Re,o]),hr=N(()=>{let b=Re==="fullscreen"?"normal":"fullscreen";se.info("fullscreen",{from:Re,fullscreen:b==="fullscreen"}),Ge(b),o.savePanelSize(b),n.emit("fullscreen",b==="fullscreen")},[n,Re,o]),fu=N(()=>{de(b=>{let T=b==="history"?"chat":"history";return se.info("toggleHistory",{view:T}),n.emit("toggleHistory",{view:T}),T})},[n]),gu=N(()=>{zd(b=>{let T=!b;return se.info("sidebarToggle",{collapsed:T}),o.saveSidebarCollapsed(T),n.emit("sidebarToggle",{collapsed:T}),T})},[o,n]),hu=N(b=>{se.info("resize",b),Ga({widgetSize:b}),n.emit("resize",b)},[Ga,n]),vr=N(async b=>{se.info("selectConversation",{conversationId:b,wasStreaming:ge}),n.emit("selectConversation",{conversationId:b}),ge&&qe(!1);try{let[T,Q]=await Promise.all([te.loadConversation(b),Wn(b)]),X=kn(T.messages);Vt(()=>{c.value=Vn(X,Q),s.value=T.conversationId}),u(Q),o.saveConversationId(T.conversationId),te.primeIdentity(r,T.conversationId),T.agent&&ct(T.agent),ke(T.canContinue),dr(pt(T.controlState));let ie=X.findLast(M=>M.role==="assistant"&&!M.ephemeral);on(ie?.suggestions??T.suggestions??[]),de("chat"),await te.markRead(b),Xa(b)}catch(T){n.emit("error",T),e.onError?.(T)}},[te,c,s,n,e,o,Xa,Wn,Vn,ge,r]),Gn=B(null),oi=N(b=>{typeof b=="string"&&(V?he.fire("manual",b):Gn.current=b)},[V,he]);E(()=>{!V||!Gn.current||(he.fire("manual",Gn.current),Gn.current=null)},[V,he]);let Dt=B({handleOpen:pr,handleClose:cn,handleExpand:gr,handleFullscreen:hr,openForm:oi});Dt.current={handleOpen:pr,handleClose:cn,handleExpand:gr,handleFullscreen:hr,openForm:oi},Xe(()=>Qi(t,{open:()=>Dt.current.handleOpen(),close:()=>Dt.current.handleClose(),expand:()=>Dt.current.handleExpand(),fullscreen:()=>Dt.current.handleFullscreen(),openForm:b=>Dt.current.openForm(b)}),[t]);let Fe=Ae(()=>Ir(e,Un,Va,Ka),[e,Un,Va,Ka]);zn.current=Fe.strings;let vu=Ae(()=>p.map(b=>{let T=Nt.list.find(Q=>Q.id===b.formId);return{...b,title:T?.title,form:T}}),[p,Nt]),ri={options:Fe,transport:te,feedback:$e,bus:n,persistence:o,composerApiRef:Ya,view:F,canSend:fe,isStreaming:ge,controlMode:cr.value,assignedOperatorInitials:Yd.value,operatorAvailable:Jd.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Zd,onCancelRequest:eu,loadingMessages:d,messagesSig:c,agent:Bn,suggestions:Hn,initialWidgetSize:l.widgetSize??null,visitorId:r,onClose:cn,onClear:mr,onExpand:gr,onFullscreen:hr,onSoundToggle:Xd,onToggleHistory:fu,onSelectHistoryConversation:vr,onNewConversation:fr,onLocaleChange:Kd,onThemeChange:Gd,onTextSizeChange:jd,onWidgetSizeChange:hu,onSend:ni,onStop:pu,onSuggestion:b=>{let T=b.text??b.label;se.info("suggestion",{text:T,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:T}),e.autoSendSuggestions?ni(T,[]):Ya.current?.fill(T)},activeForm:du.value?.form??null,formMarkers:vu,onFormSubmit:he.complete,onFormSkip:he.skip,onFormFill:b=>he.fire("manual",b),tool:su,onRetry:mu,onMessageFeedback:lu},bu=b=>{vr(b);let T=m();T&&P.switchTab(T)};if(!v)return null;let dn=Fe.modules.list,br=b=>{let T=An("close",Fe.mode,b);return dn.length===0?a(fd,{strings:Fe.strings,onClose:T?cn:void 0}):dn.length===1&&dn[0]?.layout==="chat"?a(qc,{...ri,panelSize:b}):a(md,{panelProps:{...ri,panelSize:b,onClose:T?cn:void 0},enabledModules:dn,nav:P,bus:n,hasUnread:tu.value,onSelectConversation:bu,onStartNewConversation:fr,onSetPanelSize:Ge})};if(e.mode==="page"){let b=Q=>{vr(Q.conversationId)},T=dn.some(Q=>Q.layout==="chat");return a("div",{class:`${or}-anchor`,children:a(Gc,{site:Dd,blocks:Fd,transport:te,strings:Fe.strings,locale:Fe.locale,persistence:o,visitorId:r,showConversations:T,onSelectConversation:b,onNewConversation:fr,sidebarCollapsed:Hd,onToggleSidebarCollapsed:gu,children:br("fullscreen")})})}if(le){let b=e.mode==="standalone"?"fullscreen":Re;return a("div",{class:`${or}-anchor`,children:br(b)})}let ai=e.mode==="drawer",ii=!(e.mode==="modal")&&!e.launcher.hidden&&(!A||q),si=ii&&!q&&!oe&&!ai?Fe.launcher.callout:null;return a("div",{class:`${or}-anchor`,"data-launcher-size":Fe.launcher.size,children:[A||$?a("div",{class:`${or}-surface`,hidden:!A,children:br(Re)}):null,ii?a(ql,{onToggle:pr,launcher:Fe.launcher,strings:Fe.strings,leaving:q,edgeTab:ai}):null,si?a(Wl,{callout:si,launcherPosition:Fe.position,strings:Fe.strings,closeLabel:Fe.strings.close,onDismiss:Se}):null]})}function Yf(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Jf=120;async function Qf(e,t,n){let o=[];for(let r of t)try{let{id:i,url:l}=await e.uploadFile(r.file);o.push({id:i,name:r.name,mediaType:r.mediaType,size:r.size,url:l})}catch(i){n(i)}return o}var Zf=z.scope("error-boundary"),rr=class extends Oe{constructor(){super(...arguments);K(this,"state",{crashed:!1})}componentDidCatch(n,o){Zf.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 eg="1",tg=60,ng=2e3,Ed={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 og(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function rg(){return location.origin+location.pathname}function ag(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Rd(e,t){let n=Math.random(),o=0,r=0,i=new Set,l=(c,d)=>{let{tracking:_,publicKey:p,aiAgentDeploymentId:u,mode:f,themeMode:m}=t.getOptions();if(!_.enabled||og()||n>=_.sampleRate)return;let h=performance.now();if(h-o>6e4&&(o=h,r=0),++r>tg)return;let g=new URLSearchParams;g.set("v",eg),g.set("_ev",zt),g.set("e",c),_.token&&g.set("tk",_.token),p&&g.set("pk",p),u&&g.set("dep",u),g.set("vid",t.getVisitorId());let y=t.getConversationId();y&&g.set("cid",y),g.set("url",rg());let P=ag();P&&g.set("ref",P),g.set("sw",String(screen.width)),g.set("sh",String(screen.height)),g.set("vw",String(innerWidth)),g.set("vh",String(innerHeight)),g.set("dpr",String(devicePixelRatio)),g.set("lang",navigator.language);try{g.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(g.set("m",f),g.set("th",m),d)for(let[j,V]of Object.entries(d))V!==void 0&&g.set(j,String(V));g.set("ts",String(Date.now()));let v=`${_.endpoint}?${g}`;if(v.length>ng)return;let x=new Image(1,1);i.add(x);let D=()=>i.delete(x);x.addEventListener("load",D,{once:!0}),x.addEventListener("error",D,{once:!0}),x.src=v},s=Object.keys(Ed).map(c=>e.on(c,d=>l(c,Ed[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function ar(e){let{bus:t,host:n,appRoot:o,persistence:r,reportError:i}=e,l=e.initialRaw,s,c=dt(l),d=!0,_=()=>{c=dt(s?Mr(l,s):l)},p=()=>{ss(n,xt(c.mode));let m=r.loadUserPrefs().themeMode;ls(n,m?{...c,themeMode:m}:c),d&&(co(n,Ma(c)),d=!1)},u=()=>{p(),yt(rt(rr,{onError:i},rt(Td,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&r.rememberStorageVersion(m.config.storageVersion),s=m.config,_(),u())});let f=Rd(t,{getOptions:()=>c,getVisitorId:()=>r.getVisitorId(),getConversationId:()=>r.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:u,setUserOptions:m=>{l=m,_(),u()},patchUserOptions:m=>{l={...l,...m},_(),u()},destroy:()=>f()}}function Ma(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=_t(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=Sn(e,jt(),t.loadPanelOpen(),t.loadPanelSize());return Po(e.mode,o,n)}var ig=z.scope("hooks"),Oa="*",La=new Set;function Na(e,t,n){let o={widgetId:e,event:t,listener:n};return La.add(o),()=>{La.delete(o)}}function sg(e,t,n){let o=[...La];for(let r of o)if(lg(r.widgetId,e.widgetId)&&!(r.event!==Oa&&r.event!==t))try{r.listener(e,t,n)}catch(i){ig.warn("hook listener threw",{event:t,error:i})}}function Ad(e,t){let n=[];for(let o of cg)n.push(t.on(o,r=>{sg(e,o,r)}));return()=>{for(let o of n)o()}}function Da(e){if(Array.isArray(e))for(let t of e){let n=dg(t);n&&Na(n.widgetId,n.event,n.listener)}}function lg(e,t){return e===Oa||e===t}var cg=["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 dg(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 lt=new Map;function ir(e){e.debug!==void 0&&Qn(e.debug);let t=z.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=dt(e),o=n.widgetId,r=lt.get(o);r&&(t.debug("destroy existing instance at slot",{widgetId:o}),r.destroy());let i=Ma(n),l=n.iframe?us({position:xt(n.mode)},n.position,i,n.mode,e.target??null):Ut({position:xt(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new qt,c=_t(o,n.storage,n.aiAgentDeploymentId),d=h=>{s.emit("error",h),_.getOptions().onError?.(h)},_=ar({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});_.render();let p=l.hostElement,u=null,f=h=>{h.debug!==void 0&&Qn(h.debug),_.patchUserOptions(h)},m={widgetId:o,open:()=>hn(p,"open"),close:()=>hn(p,"close"),expand:()=>hn(p,"expand"),openForm:h=>hn(p,"openForm",h),on:(h,g)=>s.on(h,g),update:h=>{t.debug("update",{patch:h}),f(h)},setUserContext:h=>{t.debug("setUserContext",{keys:Object.keys(h)}),f({userContext:{..._.getUserOptions().userContext,...h}})},clearUserContext:()=>{t.debug("clearUserContext"),f({userContext:void 0})},setPageContext:h=>{t.debug("setPageContext",{keys:Object.keys(h)}),f({pageContext:{..._.getUserOptions().pageContext,...h}})},clearPageContext:()=>{t.debug("clearPageContext"),f({pageContext:void 0})},setDebug:h=>{Qn(h),t.info("debug level set",{level:un()})},debugLevel:()=>un(),onLog:h=>_n(h),destroy:()=>{t.info("destroy",{widgetId:o}),u?.(),_.destroy(),s.clear(),yt(null,l.appRoot),l.destroy(),lt.get(o)===m&<.delete(o)}};return u=Ad(m,s),lt.set(o,m),m}function sr(e){let t=e.widgetId??"default",n=lt.get(t);return n?(n.update(e),n):ir(e)}function $a(e){if(e!==void 0){lt.get(e)?.destroy();return}let t=[...lt.values()];for(let n of t)n.destroy()}function tt(e="default"){return lt.get(e)??null}function Id(){return[...lt.values()]}function Fa(e,t,n){return Na(e,t,n)}var Md=zt;var Ba=class extends HTMLElement{constructor(){super(...arguments);K(this,"bus",new qt);K(this,"mountResult",null);K(this,"runtime",null)}static get observedAttributes(){return Lr}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,yt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=to(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=dt(n);this.mountResult||(this.mountResult=Ut({existingHost:this,position:xt(o.mode)}));let r=_t(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=ar({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:r,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},Ld=!1;function Ha(){if(Ld||typeof customElements>"u")return;let e=S.tagName;customElements.get(e)||customElements.define(e,Ba),Ld=!0}typeof customElements<"u"&&Ha();var Od=z.scope("iife"),za={close:()=>tt()?.close(),destroy:()=>$a(),expand:()=>tt()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Fa(e,t,n):void 0,init:e=>sr(e),mount:e=>ir(e),on:(e,t)=>tt()?.on(e,t),onLog:e=>_n(e),open:()=>tt()?.open(),setDebug:e=>tt()?.setDebug(e),update:e=>tt()?.update(e)};function Nd(e,...t){let n=za[e];if(!n){Od.warn("unknown command",{command:e});return}return n(...t)}function ug(){let e=((n,...o)=>Nd(n,...o));e.init=sr,e.mount=ir,e.destroy=$a,e.getInstance=tt,e.getAllInstances=Id,e.version=Md,e.hook=Fa,e.debugLevel=()=>un(),e.onLog=_n;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(za)){if(t.has(n))continue;let o=za[n];Reflect.set(e,n,(...r)=>o(...r))}return e}function _g(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[r,...i]=o;if(typeof r=="string")try{Nd(r,...i)}catch(l){Od.warn("queued command failed",{command:r,error:l})}}}function pg(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)Da([o]);return t(...n)},e}function mg(){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 fg(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[S.global],t=ug();globalThis[S.global]=t,Ha();let n=`${S.global}Hooks`,o=globalThis[n];if(Da(o),globalThis[n]=pg(),_g(e),tt())return;let r=document.currentScript??mg(),i=Or(r?.dataset);if(!i.publicKey)return;let l=()=>{tt()||sr(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}fg();return wu(gg);})();
|
|
42
42
|
//# sourceMappingURL=elements.js.map
|