@helpai/elements 6.15.0 → 7.0.0
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/docs/frameworks.md +7 -3
- package/docs/installation.md +10 -10
- package/elements-web-component.esm.js +1 -1
- package/elements-web-component.esm.js.map +1 -1
- package/elements.cjs.js +23 -23
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +10 -10
- package/elements.esm.js.map +4 -4
- package/elements.js +29 -29
- package/elements.js.map +4 -4
- package/index.d.ts +7 -7
- package/index.mjs +2 -2
- package/llms-full.txt +157 -153
- package/llms.txt +19 -19
- package/package.json +2 -1
- package/react-BBw_sT1s.mjs +3 -0
- package/react-Dpi-Oi92.mjs +73 -0
- package/react.d.ts +45 -18
- package/react.mjs +1 -71
- package/web-component.mjs +1 -1
package/elements.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";(()=>{var Jm=Object.defineProperty;var Xm=(e,t,n)=>t in e?Jm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Z=(e,t,n)=>Xm(e,typeof t!="symbol"?t+"":t,n);var L={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 Zm=["en","fr","es","ar","he","zh"];function id(e){let t=e?.split("-")[0]?.toLowerCase();return Zm.find(n=>n===t)??"en"}function Ps(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ys(e){return Ps(e)?e.id??e.key:void 0}function xs(e,t){return Ps(e)&&Ps(t)?Object.fromEntries([...new Set([...Object.keys(e),...Object.keys(t)])].map(n=>[n,xs(e[n],t[n])])):Array.isArray(e)&&Array.isArray(t)&&t.length>0&&t.every(n=>ys(n)!==void 0)?e.map(n=>xs(n,t.find(r=>ys(r)===ys(n)))):t==null||typeof t=="string"&&!t.trim()?e:t}function zn(e,t){let n=t?.toLowerCase(),r=n?.split("-")[0],o=e.translations??[],i=o.find(c=>c.locale.toLowerCase()===n)??o.find(c=>c.locale.toLowerCase().split("-")[0]===r);if(!i)return e;let{locale:s,...l}=i;return xs(e,l)}var ui={attach:"Attach files",file:"File",attachmentMimeRejected:"{name} isn't a file type this chat accepts.",attachmentTooLarge:"{name} is too large. Files can be up to {max} together.",poweredBy:"Powered by {name}",attachmentTooMany:"The attachment limit is {count}.",attachmentUploadFailed:"{name} couldn't be uploaded.",conversationLoading:"Loading chat\u2026",loadPreviousMessages:"Load previous messages",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",dropZoneRejected:"These files can't be attached here",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRateLimitedIn:"Too many requests \u2014 please try again in {seconds} s.",errorOffline:"Can't reach the server. Check your connection and try again.",errorServer:"Something went wrong on our side. Please try again.",errorOriginNotAllowed:"This chat isn't set up for this website yet.",errorMessageTooLong:"That message is too long. Shorten it and send it again.",errorReconnecting:"Connection lost. Reconnecting\u2026",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",loadMoreConversations:"Load more conversations",language:"Language",launcherOpen:"Open chat",launcherAsk:"Ask {name}",micBlocked:"The microphone is blocked for this site, so voice input can't start.",micStart:"Start voice input",micStop:"Stop voice input",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",popOut:"Open in new tab",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",queueMessage:"Queue message",removeQueuedMessage:"Remove queued message",removeAttachment:"Remove {name}",suggestedReplies:"Suggested replies",compactingContext:"Optimizing conversation context\u2026",soundOff:"Sound off",soundOn:"Sound on",talkToOperator:"Talk to a person",connectingOperator:"Connecting you to a person\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",operatorBadgeTitle:"Live chat",chatNotice:"You're chatting with an AI assistant.",cancelOperatorRequest:"Keep chatting with the AI",loginPrompt:"Log in for faster, more personalized support",loginAction:"Log in",loginRequired:"Log in to chat with us",loginExpired:"Your login expired. Log in to continue this chat.",loginExpiredGuest:"Your login expired. Log in to continue this chat, or start a new conversation as a guest.",startAsGuest:"Start new conversation",loggedInAs:"Logged in as {name}",loggedIn:"Logged in",dismissLoginPrompt:"Hide",emailTranscript:"Email transcript",emailTranscriptPrompt:"Get a copy of this conversation by email.",emailTranscriptEmailLabel:"Email address",emailTranscriptSend:"Send transcript",emailTranscriptSending:"Sending\u2026",emailTranscriptSent:"Sent to {email}.",emailTranscriptAlreadySent:"This conversation was already emailed. Send a new message to email it again.",emailTranscriptLimited:"You've reached the limit for now. Try again later.",emailTranscriptFailed:"Couldn't send it. Try again.",emailTranscriptNotDelivered:"Couldn't send to this address. Check it and try again.",emailTranscriptCancel:"Cancel",emailTranscriptDone:"Done",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",visualPreparing:"Preparing visual\u2026",visualError:"This visual could not be displayed.",visualPartial:"Some parts of this visual could not be displayed.",visualSoldOut:"Sold out",visualCartEmpty:"Your cart is empty.",visualQuantity:"Qty",visualChoose:"Choose",visualDirect:"Direct",visualVia:"via",visualNight:"1 night",visualNights:"{count} nights",visualPerNight:"per night",visualTravellers:"Travellers",thinking:"Thinking\u2026",thought:"Thought",thoughtFor:"Thought for {time}",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",copyTicketReference:"Ticket {reference}, copy",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",chatUnavailable:"This chat isn't available right now",moduleBack:"Back",contentLoading:"Loading\u2026",contentHelpful:"Was this helpful?",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeAskPlaceholder:"Ask a question\u2026",homeWhatsNew:"What's new",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results for \u201C{query}\u201D",helpShowMore:"Show more",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsShowMore:"Show more",newsUnseen:"New post",unread:"Unread",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidNumber:"Enter a valid number",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",askFallbackQuestion:"Please provide the missing information.",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",decline:"Decline",changeAnswer:"Change answer",approvalPrompt:"{action}?",approvalEditHint:"You can change your answer until this step continues.",stepInput:"Input",stepWorking:"Working",stepWorkingOnIt:"Working on it\u2026",stepNeedsYourApproval:"Needs your approval",stepWaitingForVisitor:"Waiting for the visitor",stepApproved:"Approved",stepDeclined:"Declined",stepReplaced:"Replaced",stepFailed:"Failed",stepDidNotWork:"Didn't work",decidedYouApproved:"You approved",decidedYouDeclined:"You declined",decidedVisitorApproved:"Visitor approved",decidedVisitorDeclined:"Visitor declined",decidedTeamApproved:"Approved by a team member",decidedTeamDeclined:"Declined by a team member",decidedMemberApproved:"Approved by {name}",decidedMemberDeclined:"Declined by {name}",stepRawData:"Raw data",decidedRulesApproved:"Auto-approved",decidedRulesDeclined:"Auto-declined",edit:"Edit",toolStepsFailed:"{count} failed",statusStopped:"Stopped",toolStepsStopped:"Stopped after {count} steps",toolStepsStoppedOne:"Stopped after 1 step"},eh={attach:"Joindre des fichiers",file:"Fichier",attachmentMimeRejected:"{name} n'est pas un type de fichier accept\xE9 ici.",attachmentTooLarge:"{name} est trop volumineux. Les fichiers peuvent faire jusqu'\xE0 {max} au total.",poweredBy:"Propuls\xE9 par {name}",attachmentTooMany:"Limite de pi\xE8ces jointes : {count}.",attachmentUploadFailed:"{name} n'a pas pu \xEAtre envoy\xE9.",conversationLoading:"Chargement du chat\u2026",loadPreviousMessages:"Charger les messages pr\xE9c\xE9dents",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",dropZoneRejected:"Ces fichiers ne peuvent pas \xEAtre joints ici",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRateLimitedIn:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans {seconds} s.",errorOffline:"Impossible de joindre le serveur. V\xE9rifiez votre connexion et r\xE9essayez.",errorServer:"Un probl\xE8me est survenu de notre c\xF4t\xE9. Veuillez r\xE9essayer.",errorOriginNotAllowed:"Ce chat n'est pas encore configur\xE9 pour ce site.",errorMessageTooLong:"Ce message est trop long. Raccourcissez-le et renvoyez-le.",errorReconnecting:"Connexion perdue. Reconnexion\u2026",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",loadMoreConversations:"Charger plus de conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherAsk:"Demander \xE0 {name}",micBlocked:"Le micro est bloqu\xE9 pour ce site : la saisie vocale ne peut pas d\xE9marrer.",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",popOut:"Ouvrir dans un nouvel onglet",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",queueMessage:"Mettre le message en attente",removeQueuedMessage:"Retirer le message en attente",removeAttachment:"Retirer {name}",suggestedReplies:"R\xE9ponses sugg\xE9r\xE9es",compactingContext:"Optimisation du contexte de la conversation\u2026",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",talkToOperator:"Parler \xE0 une personne",connectingOperator:"Mise en relation avec une personne\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",operatorBadgeTitle:"Chat en direct",chatNotice:"Vous discutez avec un assistant IA.",cancelOperatorRequest:"Continuer avec l'IA",loginPrompt:"Connectez-vous pour une aide plus rapide et personnalis\xE9e",loginAction:"Se connecter",loginRequired:"Connectez-vous pour discuter avec nous",loginExpired:"Votre connexion a expir\xE9. Connectez-vous pour poursuivre cette conversation.",loginExpiredGuest:"Votre connexion a expir\xE9. Connectez-vous pour poursuivre cette conversation, ou d\xE9marrez-en une nouvelle en tant qu'invit\xE9.",startAsGuest:"D\xE9marrer une nouvelle conversation",loggedInAs:"Connect\xE9 en tant que {name}",loggedIn:"Connect\xE9",dismissLoginPrompt:"Masquer",emailTranscript:"Envoyer la transcription",emailTranscriptPrompt:"Recevez une copie de cette conversation par e-mail.",emailTranscriptEmailLabel:"Adresse e-mail",emailTranscriptSend:"Envoyer la transcription",emailTranscriptSending:"Envoi\u2026",emailTranscriptSent:"Envoy\xE9 \xE0 {email}.",emailTranscriptAlreadySent:"Cette conversation a d\xE9j\xE0 \xE9t\xE9 envoy\xE9e. Envoyez un nouveau message pour l'envoyer \xE0 nouveau.",emailTranscriptLimited:"Vous avez atteint la limite pour le moment. R\xE9essayez plus tard.",emailTranscriptFailed:"Envoi impossible. R\xE9essayez.",emailTranscriptNotDelivered:"Envoi impossible \xE0 cette adresse. V\xE9rifiez-la et r\xE9essayez.",emailTranscriptCancel:"Annuler",emailTranscriptDone:"Termin\xE9",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",visualPreparing:"Pr\xE9paration du visuel\u2026",visualError:"Ce visuel n\u2019a pas pu \xEAtre affich\xE9.",visualPartial:"Certaines parties de ce visuel n\u2019ont pas pu \xEAtre affich\xE9es.",visualSoldOut:"\xC9puis\xE9",visualCartEmpty:"Votre panier est vide.",visualQuantity:"Qt\xE9",visualChoose:"Choisissez",visualDirect:"Direct",visualVia:"via",visualNight:"1 nuit",visualNights:"{count} nuits",visualPerNight:"par nuit",visualTravellers:"Voyageurs",thinking:"R\xE9flexion\u2026",thought:"R\xE9flexion",thoughtFor:"R\xE9flexion : {time}",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",copyTicketReference:"Ticket {reference}, copier",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",chatUnavailable:"Ce chat n'est pas disponible pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",contentHelpful:"Cela vous a-t-il aid\xE9 ?",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeAskPlaceholder:"Posez une question\u2026",homeWhatsNew:"Nouveaut\xE9s",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 pour \xAB\xA0{query}\xA0\xBB",helpShowMore:"Afficher plus",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsShowMore:"Afficher plus",newsUnseen:"Nouvelle publication",unread:"Non lu",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidNumber:"Saisissez un nombre valide",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",askFallbackQuestion:"Veuillez fournir les informations manquantes.",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",decline:"Refuser",changeAnswer:"Modifier la r\xE9ponse",approvalPrompt:"{action} ?",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",stepInput:"Entr\xE9e",stepWorking:"En cours",stepWorkingOnIt:"En cours\u2026",stepNeedsYourApproval:"Votre accord est requis",stepWaitingForVisitor:"En attente du visiteur",stepApproved:"Approuv\xE9",stepDeclined:"Refus\xE9",stepReplaced:"Remplac\xE9",stepFailed:"\xC9chec",stepDidNotWork:"N'a pas fonctionn\xE9",decidedYouApproved:"Vous avez approuv\xE9",decidedYouDeclined:"Vous avez refus\xE9",decidedVisitorApproved:"Approuv\xE9 par le visiteur",decidedVisitorDeclined:"Refus\xE9 par le visiteur",decidedTeamApproved:"Approuv\xE9 par un membre de l'\xE9quipe",decidedTeamDeclined:"Refus\xE9 par un membre de l'\xE9quipe",decidedMemberApproved:"Approuv\xE9 par {name}",decidedMemberDeclined:"Refus\xE9 par {name}",stepRawData:"Donn\xE9es brutes",decidedRulesApproved:"Approuv\xE9 automatiquement",decidedRulesDeclined:"Refus\xE9 automatiquement",edit:"Modifier",toolStepsFailed:"{count} en \xE9chec",statusStopped:"Arr\xEAt\xE9",toolStepsStopped:"Arr\xEAt\xE9 apr\xE8s {count} \xE9tapes",toolStepsStoppedOne:"Arr\xEAt\xE9 apr\xE8s 1 \xE9tape"},th={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",file:"\u0645\u0644\u0641",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 {name} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629.",attachmentTooLarge:"\u0627\u0644\u0645\u0644\u0641 {name} \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627. \u064A\u0645\u0643\u0646 \u0623\u0646 \u064A\u0635\u0644 \u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0645\u0639\u064B\u0627 \u0625\u0644\u0649 {max}.",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 {name}",attachmentTooMany:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A: {count}.",attachmentUploadFailed:"\u062A\u0639\u0630\u0651\u0631 \u0631\u0641\u0639 {name}.",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",loadPreviousMessages:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0631\u0633\u0627\u0626\u0644 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",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",dropZoneRejected:"\u0644\u0627 \u064A\u0645\u0643\u0646 \u0625\u0631\u0641\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0647\u0646\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.",errorRateLimitedIn:"\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 {seconds} \u062B.",errorOffline:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u062E\u0627\u062F\u0645. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643 \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorServer:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0646 \u062C\u0647\u062A\u0646\u0627. \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorOriginNotAllowed:"\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u063A\u064A\u0631 \u0645\u064F\u0639\u062F\u0651\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u0648\u0642\u0639 \u0628\u0639\u062F.",errorMessageTooLong:"\u0647\u0630\u0647 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0637\u0648\u064A\u0644\u0629 \u062C\u062F\u064B\u0627. \u0627\u062E\u062A\u0635\u0631\u0647\u0627 \u0648\u0623\u0631\u0633\u0644\u0647\u0627 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorReconnecting:"\u0627\u0646\u0642\u0637\u0639 \u0627\u0644\u0627\u062A\u0635\u0627\u0644. \u062C\u0627\u0631\u064D \u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0627\u062A\u0635\u0627\u0644\u2026",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",loadMoreConversations:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0632\u064A\u062F \u0645\u0646 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherAsk:"\u0627\u0633\u0623\u0644 {name}",micBlocked:"\u0627\u0644\u0645\u064A\u0643\u0631\u0648\u0641\u0648\u0646 \u0645\u062D\u0638\u0648\u0631 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u0648\u0642\u0639\u060C \u0644\u0630\u0627 \u0644\u0627 \u064A\u0645\u0643\u0646 \u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A.",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",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",popOut:"\u0641\u062A\u062D \u0641\u064A \u0639\u0644\u0627\u0645\u0629 \u062A\u0628\u0648\u064A\u0628 \u062C\u062F\u064A\u062F\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",queueMessage:"\u0625\u0636\u0627\u0641\u0629 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0625\u0644\u0649 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",removeQueuedMessage:"\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0645\u0646 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",removeAttachment:"\u0625\u0632\u0627\u0644\u0629 {name}",suggestedReplies:"\u0631\u062F\u0648\u062F \u0645\u0642\u062A\u0631\u062D\u0629",compactingContext:"\u062C\u0627\u0631\u064D \u062A\u062D\u0633\u064A\u0646 \u0633\u064A\u0627\u0642 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0634\u062E\u0635",connectingOperator:"\u062C\u0627\u0631\u064D \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0634\u062E\u0635\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}",operatorBadgeTitle:"\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0628\u0627\u0634\u0631\u0629",chatNotice:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 \u0645\u0633\u0627\u0639\u062F \u0630\u0643\u0627\u0621 \u0627\u0635\u0637\u0646\u0627\u0639\u064A.",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",loginPrompt:"\u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0644\u062D\u0635\u0648\u0644 \u0639\u0644\u0649 \u062F\u0639\u0645 \u0623\u0633\u0631\u0639 \u0648\u0645\u062E\u0635\u0651\u0635 \u0644\u0643",loginAction:"\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",loginRequired:"\u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0644\u062F\u0631\u062F\u0634\u0629 \u0645\u0639\u0646\u0627",loginExpired:"\u0627\u0646\u062A\u0647\u062A \u0635\u0644\u0627\u062D\u064A\u0629 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u0643. \u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629.",loginExpiredGuest:"\u0627\u0646\u062A\u0647\u062A \u0635\u0644\u0627\u062D\u064A\u0629 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u0643. \u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u060C \u0623\u0648 \u0627\u0628\u062F\u0623 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629 \u0643\u0636\u064A\u0641.",startAsGuest:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",loggedInAs:"\u062A\u0645 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0628\u0627\u0633\u0645 {name}",loggedIn:"\u062A\u0645 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",dismissLoginPrompt:"\u0625\u062E\u0641\u0627\u0621",emailTranscript:"\u0625\u0631\u0633\u0627\u0644 \u0646\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",emailTranscriptPrompt:"\u0627\u062D\u0635\u0644 \u0639\u0644\u0649 \u0646\u0633\u062E\u0629 \u0645\u0646 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0639\u0628\u0631 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A.",emailTranscriptEmailLabel:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",emailTranscriptSend:"\u0625\u0631\u0633\u0627\u0644 \u0646\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",emailTranscriptSending:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",emailTranscriptSent:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0625\u0644\u0649 {email}.",emailTranscriptAlreadySent:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0628\u0627\u0644\u0641\u0639\u0644. \u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 \u062C\u062F\u064A\u062F\u0629 \u0644\u0625\u0631\u0633\u0627\u0644\u0647\u0627 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptLimited:"\u0644\u0642\u062F \u0628\u0644\u063A\u062A \u0627\u0644\u062D\u062F \u0627\u0644\u0645\u0633\u0645\u0648\u062D \u0628\u0647 \u062D\u0627\u0644\u064A\u064B\u0627. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649 \u0644\u0627\u062D\u0642\u064B\u0627.",emailTranscriptFailed:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptNotDelivered:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0625\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0648\u0627\u0646. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646\u0647 \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptCancel:"\u0625\u0644\u063A\u0627\u0621",emailTranscriptDone:"\u062A\u0645",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",visualPreparing:"\u062C\u0627\u0631\u064D \u0625\u0639\u062F\u0627\u062F \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A\u2026",visualError:"\u062A\u0639\u0630\u0631 \u0639\u0631\u0636 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A.",visualPartial:"\u062A\u0639\u0630\u0631 \u0639\u0631\u0636 \u0628\u0639\u0636 \u0623\u062C\u0632\u0627\u0621 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A.",visualSoldOut:"\u0646\u0641\u062F\u062A \u0627\u0644\u0643\u0645\u064A\u0629",visualCartEmpty:"\u0633\u0644\u062A\u0643 \u0641\u0627\u0631\u063A\u0629.",visualQuantity:"\u0627\u0644\u0643\u0645\u064A\u0629",visualChoose:"\u0627\u062E\u062A\u0631",visualDirect:"\u0645\u0628\u0627\u0634\u0631",visualVia:"\u0639\u0628\u0631",visualNight:"\u0644\u064A\u0644\u0629 \u0648\u0627\u062D\u062F\u0629",visualNights:"\u0627\u0644\u0644\u064A\u0627\u0644\u064A: {count}",visualPerNight:"\u0644\u0644\u064A\u0644\u0629",visualTravellers:"\u0627\u0644\u0645\u0633\u0627\u0641\u0631\u0648\u0646",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thought:"\u062A\u0641\u0643\u064A\u0631",thoughtFor:"\u0641\u0643\u0651\u0631 \u0644\u0645\u062F\u0629 {time}",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",copyTicketReference:"\u0627\u0644\u062A\u0630\u0643\u0631\u0629 {reference}\u060C \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",chatUnavailable:"\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629 \u062D\u0627\u0644\u064A\u0627\u064B",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",contentHelpful:"\u0647\u0644 \u0643\u0627\u0646 \u0647\u0630\u0627 \u0645\u0641\u064A\u062F\u064B\u0627\u061F",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",homeAskPlaceholder:"\u0627\u0637\u0631\u062D \u0633\u0624\u0627\u0644\u0627\u064B\u2026",homeWhatsNew:"\u0645\u0627 \u0627\u0644\u062C\u062F\u064A\u062F",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 \u0646\u062A\u0627\u0626\u062C \u0644\u0640 \xAB{query}\xBB",helpShowMore:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0632\u064A\u062F",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",newsShowMore:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0632\u064A\u062F",newsUnseen:"\u0645\u0646\u0634\u0648\u0631 \u062C\u062F\u064A\u062F",unread:"\u063A\u064A\u0631 \u0645\u0642\u0631\u0648\u0621",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",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",askFallbackQuestion:"\u064A\u0631\u062C\u0649 \u062A\u0642\u062F\u064A\u0645 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062A \u0627\u0644\u0646\u0627\u0642\u0635\u0629.",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",decline:"\u0631\u0641\u0636",changeAnswer:"\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",approvalPrompt:"{action}\u061F",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u063A\u064A\u064A\u0631 \u0625\u062C\u0627\u0628\u062A\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",stepInput:"\u0627\u0644\u0645\u062F\u062E\u0644\u0627\u062A",stepWorking:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",stepWorkingOnIt:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",stepNeedsYourApproval:"\u0628\u062D\u0627\u062C\u0629 \u0625\u0644\u0649 \u0645\u0648\u0627\u0641\u0642\u062A\u0643",stepWaitingForVisitor:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0632\u0627\u0626\u0631",stepApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",stepDeclined:"\u0645\u0631\u0641\u0648\u0636",stepReplaced:"\u062A\u0645 \u0627\u0644\u0627\u0633\u062A\u0628\u062F\u0627\u0644",stepFailed:"\u0641\u0634\u0644",stepDidNotWork:"\u0644\u0645 \u064A\u0646\u062C\u062D",decidedYouApproved:"\u0648\u0627\u0641\u0642\u062A",decidedYouDeclined:"\u0631\u0641\u0636\u062A",decidedVisitorApproved:"\u0648\u0627\u0641\u0642 \u0627\u0644\u0632\u0627\u0626\u0631",decidedVisitorDeclined:"\u0631\u0641\u0636 \u0627\u0644\u0632\u0627\u0626\u0631",decidedTeamApproved:"\u0648\u0627\u0641\u0642 \u0639\u0636\u0648 \u0641\u064A \u0627\u0644\u0641\u0631\u064A\u0642",decidedTeamDeclined:"\u0631\u0641\u0636 \u0639\u0636\u0648 \u0641\u064A \u0627\u0644\u0641\u0631\u064A\u0642",decidedMemberApproved:"\u0648\u0627\u0641\u0642 {name}",decidedMemberDeclined:"\u0631\u0641\u0636 {name}",stepRawData:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0623\u0648\u0644\u064A\u0629",decidedRulesApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",decidedRulesDeclined:"\u0631\u064F\u0641\u0636 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",edit:"\u062A\u0639\u062F\u064A\u0644",toolStepsFailed:"\u0641\u0634\u0644 {count}",statusStopped:"\u0623\u064F\u0648\u0642\u0641",toolStepsStopped:"\u0623\u064F\u0648\u0642\u0641 \u0628\u0639\u062F {count} \u062E\u0637\u0648\u0627\u062A",toolStepsStoppedOne:"\u0623\u064F\u0648\u0642\u0641 \u0628\u0639\u062F \u062E\u0637\u0648\u0629 \u0648\u0627\u062D\u062F\u0629"},nh={attach:"Adjuntar archivos",file:"Archivo",attachmentMimeRejected:"{name} no es un tipo de archivo que acepte este chat.",attachmentTooLarge:"{name} es demasiado grande. Los archivos pueden ocupar hasta {max} en total.",poweredBy:"Con la tecnolog\xEDa de {name}",attachmentTooMany:"L\xEDmite de adjuntos: {count}.",attachmentUploadFailed:"No se pudo subir {name}.",conversationLoading:"Cargando chat\u2026",loadPreviousMessages:"Cargar mensajes anteriores",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",dropZoneRejected:"Estos archivos no se pueden adjuntar aqu\xED",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRateLimitedIn:"Demasiadas solicitudes: int\xE9ntalo de nuevo en {seconds} s.",errorOffline:"No se puede conectar con el servidor. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo.",errorServer:"Algo sali\xF3 mal por nuestra parte. Int\xE9ntalo de nuevo.",errorOriginNotAllowed:"Este chat a\xFAn no est\xE1 configurado para este sitio web.",errorMessageTooLong:"Ese mensaje es demasiado largo. Ac\xF3rtalo y env\xEDalo de nuevo.",errorReconnecting:"Se perdi\xF3 la conexi\xF3n. Reconectando\u2026",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",loadMoreConversations:"Cargar m\xE1s conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherAsk:"Preg\xFAntale a {name}",micBlocked:"El micr\xF3fono est\xE1 bloqueado para este sitio, as\xED que la entrada de voz no puede iniciarse.",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",popOut:"Abrir en una pesta\xF1a nueva",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",queueMessage:"Poner mensaje en cola",removeQueuedMessage:"Quitar mensaje de la cola",removeAttachment:"Quitar {name}",suggestedReplies:"Respuestas sugeridas",compactingContext:"Optimizando el contexto de la conversaci\xF3n\u2026",soundOff:"Sonido desactivado",soundOn:"Sonido activado",talkToOperator:"Hablar con una persona",connectingOperator:"Conect\xE1ndote con una persona\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",operatorBadgeTitle:"Chat en vivo",chatNotice:"Est\xE1s chateando con un asistente de IA.",cancelOperatorRequest:"Seguir con la IA",loginPrompt:"Inicia sesi\xF3n para recibir una ayuda m\xE1s r\xE1pida y personalizada",loginAction:"Iniciar sesi\xF3n",loginRequired:"Inicia sesi\xF3n para chatear con nosotros",loginExpired:"Tu sesi\xF3n ha caducado. Inicia sesi\xF3n para continuar esta conversaci\xF3n.",loginExpiredGuest:"Tu sesi\xF3n ha caducado. Inicia sesi\xF3n para continuar esta conversaci\xF3n o empieza una nueva como invitado.",startAsGuest:"Empezar una nueva conversaci\xF3n",loggedInAs:"Sesi\xF3n iniciada como {name}",loggedIn:"Sesi\xF3n iniciada",dismissLoginPrompt:"Ocultar",emailTranscript:"Enviar transcripci\xF3n",emailTranscriptPrompt:"Recibe una copia de esta conversaci\xF3n por correo.",emailTranscriptEmailLabel:"Correo electr\xF3nico",emailTranscriptSend:"Enviar transcripci\xF3n",emailTranscriptSending:"Enviando\u2026",emailTranscriptSent:"Enviado a {email}.",emailTranscriptAlreadySent:"Esta conversaci\xF3n ya se envi\xF3. Env\xEDa un mensaje nuevo para enviarla otra vez.",emailTranscriptLimited:"Has alcanzado el l\xEDmite por ahora. Int\xE9ntalo m\xE1s tarde.",emailTranscriptFailed:"No se pudo enviar. Int\xE9ntalo de nuevo.",emailTranscriptNotDelivered:"No se pudo enviar a esta direcci\xF3n. Rev\xEDsala e int\xE9ntalo de nuevo.",emailTranscriptCancel:"Cancelar",emailTranscriptDone:"Listo",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",visualPreparing:"Preparando visualizaci\xF3n\u2026",visualError:"No se pudo mostrar esta visualizaci\xF3n.",visualPartial:"No se pudieron mostrar algunas partes de esta visualizaci\xF3n.",visualSoldOut:"Agotado",visualCartEmpty:"Tu carrito est\xE1 vac\xEDo.",visualQuantity:"Cant.",visualChoose:"Elige",visualDirect:"Directo",visualVia:"v\xEDa",visualNight:"1 noche",visualNights:"{count} noches",visualPerNight:"por noche",visualTravellers:"Viajeros",thinking:"Pensando\u2026",thought:"Razonamiento",thoughtFor:"Razon\xF3 durante {time}",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",copyTicketReference:"Ticket {reference}, copiar",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",chatUnavailable:"Este chat no est\xE1 disponible en este momento",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",contentHelpful:"\xBFTe result\xF3 \xFAtil?",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeAskPlaceholder:"Haz una pregunta\u2026",homeWhatsNew:"Lo nuevo",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:"Sin resultados para \xAB{query}\xBB",helpShowMore:"Mostrar m\xE1s",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsShowMore:"Mostrar m\xE1s",newsUnseen:"Publicaci\xF3n nueva",unread:"No le\xEDdo",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",askFallbackQuestion:"Indica la informaci\xF3n que falta.",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",decline:"Rechazar",changeAnswer:"Cambiar respuesta",approvalPrompt:"\xBF{action}?",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",stepInput:"Entrada",stepWorking:"En curso",stepWorkingOnIt:"En curso\u2026",stepNeedsYourApproval:"Necesita tu aprobaci\xF3n",stepWaitingForVisitor:"Esperando al visitante",stepApproved:"Aprobado",stepDeclined:"Rechazado",stepReplaced:"Reemplazado",stepFailed:"Fall\xF3",stepDidNotWork:"No funcion\xF3",decidedYouApproved:"Lo aprobaste",decidedYouDeclined:"Lo rechazaste",decidedVisitorApproved:"El visitante aprob\xF3",decidedVisitorDeclined:"El visitante rechaz\xF3",decidedTeamApproved:"Aprobado por un miembro del equipo",decidedTeamDeclined:"Rechazado por un miembro del equipo",decidedMemberApproved:"Aprobado por {name}",decidedMemberDeclined:"Rechazado por {name}",stepRawData:"Datos sin procesar",decidedRulesApproved:"Aprobado autom\xE1ticamente",decidedRulesDeclined:"Rechazado autom\xE1ticamente",edit:"Editar",toolStepsFailed:"{count} con error",statusStopped:"Detenido",toolStepsStopped:"Detenido tras {count} pasos",toolStepsStoppedOne:"Detenido tras 1 paso"},rh={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",file:"\u05E7\u05D5\u05D1\u05E5",attachmentMimeRejected:"\u05D4\u05E7\u05D5\u05D1\u05E5 {name} \u05D0\u05D9\u05E0\u05D5 \u05DE\u05E1\u05D5\u05D2 \u05E9\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05DE\u05E7\u05D1\u05DC.",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 {name} \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9. \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D9\u05DB\u05D5\u05DC\u05D9\u05DD \u05DC\u05D4\u05D2\u05D9\u05E2 \u05D9\u05D7\u05D3 \u05E2\u05D3 {max}.",poweredBy:"\u05DE\u05D5\u05E4\u05E2\u05DC \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",attachmentTooMany:"\u05DE\u05E1\u05E4\u05E8 \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05DE\u05E8\u05D1\u05D9 \u05DC\u05E6\u05D9\u05E8\u05D5\u05E3: {count}.",attachmentUploadFailed:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E2\u05DC\u05D5\u05EA \u05D0\u05EA {name}.",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",loadPreviousMessages:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",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",dropZoneRejected:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E6\u05E8\u05E3 \u05DB\u05D0\u05DF \u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05D0\u05DC\u05D4",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.",errorRateLimitedIn:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 {seconds} \u05E9\u05E0\u05F3.",errorOffline:"\u05D0\u05D9\u05DF \u05D7\u05D9\u05D1\u05D5\u05E8 \u05DC\u05E9\u05E8\u05EA. \u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05D4\u05D7\u05D9\u05D1\u05D5\u05E8 \u05D5\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1.",errorServer:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9 \u05D0\u05E6\u05DC\u05E0\u05D5. \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1.",errorOriginNotAllowed:"\u05D4\u05E6'\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E2\u05D3\u05D9\u05D9\u05DF \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 \u05DC\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4.",errorMessageTooLong:"\u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05D4\u05D6\u05D5 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DE\u05D3\u05D9. \u05E7\u05E6\u05E8\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05D5\u05E9\u05DC\u05D7\u05D5 \u05E9\u05D5\u05D1.",errorReconnecting:"\u05D4\u05D7\u05D9\u05D1\u05D5\u05E8 \u05D0\u05D1\u05D3. \u05DE\u05EA\u05D7\u05D1\u05E8 \u05DE\u05D7\u05D3\u05E9\u2026",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",loadMoreConversations:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherAsk:"\u05DC\u05E9\u05D0\u05D5\u05DC \u05D0\u05EA {name}",micBlocked:"\u05D4\u05DE\u05D9\u05E7\u05E8\u05D5\u05E4\u05D5\u05DF \u05D7\u05E1\u05D5\u05DD \u05D1\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4, \u05D5\u05DC\u05DB\u05DF \u05D0\u05D9 \u05D0\u05E4\u05E9\u05E8 \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9.",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",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",popOut:"\u05E4\u05EA\u05D9\u05D7\u05D4 \u05D1\u05DB\u05E8\u05D8\u05D9\u05E1\u05D9\u05D9\u05D4 \u05D7\u05D3\u05E9\u05D4",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",queueMessage:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DC\u05EA\u05D5\u05E8",removeQueuedMessage:"\u05D4\u05E1\u05E8\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DE\u05D4\u05EA\u05D5\u05E8",removeAttachment:"\u05D4\u05E1\u05E8\u05EA {name}",suggestedReplies:"\u05EA\u05E9\u05D5\u05D1\u05D5\u05EA \u05DE\u05D5\u05E6\u05E2\u05D5\u05EA",compactingContext:"\u05DE\u05D1\u05E6\u05E2 \u05D0\u05D5\u05E4\u05D8\u05D9\u05DE\u05D9\u05D6\u05E6\u05D9\u05D4 \u05DC\u05D4\u05E7\u05E9\u05E8 \u05D4\u05E9\u05D9\u05D7\u05D4\u2026",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",talkToOperator:"\u05D3\u05D1\u05E8\u05D5 \u05E2\u05DD \u05D0\u05D3\u05DD",connectingOperator:"\u05DE\u05D7\u05D1\u05E8\u05D9\u05DD \u05D0\u05D5\u05EA\u05DA \u05DC\u05D0\u05D3\u05DD\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}",operatorBadgeTitle:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D9",chatNotice:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD \u05E2\u05D5\u05D6\u05E8 \u05D1\u05D9\u05E0\u05D4 \u05DE\u05DC\u05D0\u05DB\u05D5\u05EA\u05D9\u05EA.",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",loginPrompt:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DC\u05E7\u05D1\u05DC\u05EA \u05EA\u05DE\u05D9\u05DB\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4 \u05D5\u05DE\u05D5\u05EA\u05D0\u05DE\u05EA \u05D0\u05D9\u05E9\u05D9\u05EA",loginAction:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA",loginRequired:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05E9\u05D5\u05D7\u05D7 \u05D0\u05D9\u05EA\u05E0\u05D5",loginExpired:"\u05E4\u05D2 \u05EA\u05D5\u05E7\u05E3 \u05D4\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC\u05DA. \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA \u05D1\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5.",loginExpiredGuest:"\u05E4\u05D2 \u05EA\u05D5\u05E7\u05E3 \u05D4\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC\u05DA. \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA \u05D1\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5, \u05D0\u05D5 \u05D4\u05EA\u05D7\u05D9\u05DC\u05D5 \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4 \u05DB\u05D0\u05D5\u05E8\u05D7\u05D9\u05DD.",startAsGuest:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",loggedInAs:"\u05DE\u05D7\u05D5\u05D1\u05E8/\u05EA \u05D1\u05EA\u05D5\u05E8 {name}",loggedIn:"\u05DE\u05D7\u05D5\u05D1\u05E8/\u05EA",dismissLoginPrompt:"\u05D4\u05E1\u05EA\u05E8\u05D4",emailTranscript:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05DE\u05DC\u05D9\u05DC \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC",emailTranscriptPrompt:"\u05E7\u05D1\u05DC\u05D5 \u05E2\u05D5\u05EA\u05E7 \u05E9\u05DC \u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC.",emailTranscriptEmailLabel:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D3\u05D5\u05D0\u05F4\u05DC",emailTranscriptSend:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05EA\u05DE\u05DC\u05D9\u05DC",emailTranscriptSending:"\u05E9\u05D5\u05DC\u05D7\u05D9\u05DD\u2026",emailTranscriptSent:"\u05E0\u05E9\u05DC\u05D7 \u05D0\u05DC {email}.",emailTranscriptAlreadySent:"\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05DB\u05D1\u05E8 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05E9\u05DC\u05D7\u05D5 \u05D4\u05D5\u05D3\u05E2\u05D4 \u05D7\u05D3\u05E9\u05D4 \u05DB\u05D3\u05D9 \u05DC\u05E9\u05DC\u05D5\u05D7 \u05D0\u05D5\u05EA\u05D4 \u05E9\u05D5\u05D1.",emailTranscriptLimited:"\u05D4\u05D2\u05E2\u05EA\u05DD \u05DC\u05DE\u05D2\u05D1\u05DC\u05D4 \u05DB\u05E8\u05D2\u05E2. \u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.",emailTranscriptFailed:"\u05D4\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4. \u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1.",emailTranscriptNotDelivered:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E9\u05DC\u05D5\u05D7 \u05DC\u05DB\u05EA\u05D5\u05D1\u05EA \u05D4\u05D6\u05D5. \u05D1\u05D3\u05E7\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05D5\u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1.",emailTranscriptCancel:"\u05D1\u05D9\u05D8\u05D5\u05DC",emailTranscriptDone:"\u05E1\u05D9\u05D5\u05DD",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",visualPreparing:"\u05DE\u05DB\u05D9\u05DF \u05EA\u05E6\u05D5\u05D2\u05D4\u2026",visualError:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E6\u05D9\u05D2 \u05EA\u05E6\u05D5\u05D2\u05D4 \u05D6\u05D5.",visualPartial:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E6\u05D9\u05D2 \u05D7\u05DC\u05E7\u05D9\u05DD \u05DE\u05EA\u05E6\u05D5\u05D2\u05D4 \u05D6\u05D5.",visualSoldOut:"\u05D0\u05D6\u05DC \u05DE\u05D4\u05DE\u05DC\u05D0\u05D9",visualCartEmpty:"\u05D4\u05E2\u05D2\u05DC\u05D4 \u05E9\u05DC\u05DA \u05E8\u05D9\u05E7\u05D4.",visualQuantity:"\u05DB\u05DE\u05D5\u05EA",visualChoose:"\u05D1\u05D7\u05E8\u05D5",visualDirect:"\u05D9\u05E9\u05D9\u05E8",visualVia:"\u05D3\u05E8\u05DA",visualNight:"\u05DC\u05D9\u05DC\u05D4 \u05D0\u05D7\u05D3",visualNights:"{count} \u05DC\u05D9\u05DC\u05D5\u05EA",visualPerNight:"\u05DC\u05DC\u05D9\u05DC\u05D4",visualTravellers:"\u05E0\u05D5\u05E1\u05E2\u05D9\u05DD",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thought:"\u05DE\u05D7\u05E9\u05D1\u05D4",thoughtFor:"\u05D7\u05E9\u05D1 \u05D1\u05DE\u05E9\u05DA {time}",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",copyTicketReference:"\u05E4\u05E0\u05D9\u05D9\u05D4 {reference}, \u05D4\u05E2\u05EA\u05E7\u05D4",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",chatUnavailable:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF \u05DB\u05E8\u05D2\u05E2",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",contentHelpful:"\u05D4\u05D0\u05DD \u05D6\u05D4 \u05E2\u05D6\u05E8?",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",homeAskPlaceholder:"\u05E9\u05D0\u05DC\u05D5 \u05E9\u05D0\u05DC\u05D4\u2026",homeWhatsNew:"\u05DE\u05D4 \u05D7\u05D3\u05E9",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:"\u05D0\u05D9\u05DF \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8 \u201E{query}\u201D",helpShowMore:"\u05D4\u05E6\u05D2\u05EA \u05E2\u05D5\u05D3",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",newsShowMore:"\u05D4\u05E6\u05D2\u05EA \u05E2\u05D5\u05D3",newsUnseen:"\u05E4\u05D5\u05E1\u05D8 \u05D7\u05D3\u05E9",unread:"\u05DC\u05D0 \u05E0\u05E7\u05E8\u05D0",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",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",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",askFallbackQuestion:"\u05D0\u05E0\u05D0 \u05E1\u05E4\u05E7\u05D5 \u05D0\u05EA \u05D4\u05DE\u05D9\u05D3\u05E2 \u05D4\u05D7\u05E1\u05E8.",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",decline:"\u05D3\u05D7\u05D9\u05D9\u05D4",changeAnswer:"\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05EA\u05E9\u05D5\u05D1\u05D4",approvalPrompt:"{action}?",approvalEditHint:"\u05D0\u05E4\u05E9\u05E8 \u05DC\u05E9\u05E0\u05D5\u05EA \u05D0\u05EA \u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05DE\u05E9\u05D9\u05DA.",stepInput:"\u05E7\u05DC\u05D8",stepWorking:"\u05D1\u05D1\u05D9\u05E6\u05D5\u05E2",stepWorkingOnIt:"\u05DE\u05D8\u05E4\u05DC\u05D9\u05DD \u05D1\u05D6\u05D4\u2026",stepNeedsYourApproval:"\u05E0\u05D3\u05E8\u05E9 \u05D4\u05D0\u05D9\u05E9\u05D5\u05E8 \u05E9\u05DC\u05DA",stepWaitingForVisitor:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05DE\u05D1\u05E7\u05E8",stepApproved:"\u05D0\u05D5\u05E9\u05E8",stepDeclined:"\u05E0\u05D3\u05D7\u05D4",stepReplaced:"\u05D4\u05D5\u05D7\u05DC\u05E3",stepFailed:"\u05E0\u05DB\u05E9\u05DC",stepDidNotWork:"\u05DC\u05D0 \u05D4\u05E6\u05DC\u05D9\u05D7",decidedYouApproved:"\u05D0\u05D9\u05E9\u05E8\u05EA",decidedYouDeclined:"\u05D3\u05D7\u05D9\u05EA",decidedVisitorApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05D1\u05E7\u05E8",decidedVisitorDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05D1\u05E7\u05E8",decidedTeamApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D7\u05D1\u05E8 \u05E6\u05D5\u05D5\u05EA",decidedTeamDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D7\u05D1\u05E8 \u05E6\u05D5\u05D5\u05EA",decidedMemberApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",decidedMemberDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",stepRawData:"\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05D2\u05D5\u05DC\u05DE\u05D9\u05D9\u05DD",decidedRulesApproved:"\u05D0\u05D5\u05E9\u05E8 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",decidedRulesDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolStepsFailed:"{count} \u05E0\u05DB\u05E9\u05DC\u05D5",statusStopped:"\u05E0\u05E2\u05E6\u05E8",toolStepsStopped:"\u05E0\u05E2\u05E6\u05E8 \u05D0\u05D7\u05E8\u05D9 {count} \u05E9\u05DC\u05D1\u05D9\u05DD",toolStepsStoppedOne:"\u05E0\u05E2\u05E6\u05E8 \u05D0\u05D7\u05E8\u05D9 \u05E9\u05DC\u05D1 \u05D0\u05D7\u05D3"},oh={attach:"\u6DFB\u52A0\u9644\u4EF6",file:"\u6587\u4EF6",attachmentMimeRejected:"\u6B64\u804A\u5929\u4E0D\u63A5\u53D7 {name} \u7684\u6587\u4EF6\u7C7B\u578B\u3002",attachmentTooLarge:"{name} \u592A\u5927\u4E86\u3002\u6587\u4EF6\u603B\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {max}\u3002",poweredBy:"\u7531 {name} \u63D0\u4F9B\u652F\u6301",attachmentTooMany:"\u6700\u591A\u53EF\u6DFB\u52A0 {count} \u4E2A\u9644\u4EF6\u3002",attachmentUploadFailed:"{name} \u4E0A\u4F20\u5931\u8D25\u3002",conversationLoading:"\u6B63\u5728\u52A0\u8F7D\u804A\u5929\u2026",loadPreviousMessages:"\u52A0\u8F7D\u66F4\u65E9\u7684\u6D88\u606F",close:"\u5173\u95ED",collapse:"\u6536\u8D77",collapseSidebar:"\u6536\u8D77\u4FA7\u8FB9\u680F",composerPlaceholder:"\u8F93\u5165\u6D88\u606F\u2026",dateLastWeek:"\u6700\u8FD1 7 \u5929",dateOlder:"\u66F4\u65E9",dateToday:"\u4ECA\u5929",dateYesterday:"\u6628\u5929",dropZone:"\u62D6\u653E\u6587\u4EF6\u4EE5\u6DFB\u52A0\u9644\u4EF6",dropZoneRejected:"\u8FD9\u4E9B\u6587\u4EF6\u65E0\u6CD5\u5728\u6B64\u6DFB\u52A0",errorGeneric:"\u51FA\u4E86\u70B9\u95EE\u9898",errorRateLimited:"\u8BF7\u6C42\u8FC7\u591A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",errorRateLimitedIn:"\u8BF7\u6C42\u8FC7\u591A\uFF0C\u8BF7\u5728 {seconds} \u79D2\u540E\u91CD\u8BD5\u3002",errorOffline:"\u65E0\u6CD5\u8FDE\u63A5\u670D\u52A1\u5668\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",errorServer:"\u6211\u4EEC\u8FD9\u8FB9\u51FA\u4E86\u70B9\u95EE\u9898\u3002\u8BF7\u91CD\u8BD5\u3002",errorOriginNotAllowed:"\u6B64\u804A\u5929\u5C1A\u672A\u4E3A\u672C\u7F51\u7AD9\u8BBE\u7F6E\u3002",errorMessageTooLong:"\u6D88\u606F\u592A\u957F\u4E86\u3002\u8BF7\u7F29\u77ED\u540E\u91CD\u65B0\u53D1\u9001\u3002",errorReconnecting:"\u8FDE\u63A5\u5DF2\u65AD\u5F00\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5\u2026",errorRetry:"\u91CD\u8BD5",expand:"\u5C55\u5F00",expandSidebar:"\u5C55\u5F00\u4FA7\u8FB9\u680F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",fullscreen:"\u5168\u5C4F",history:"\u5386\u53F2\u8BB0\u5F55",historyBack:"\u8FD4\u56DE\u804A\u5929",historyEmpty:"\u8FD8\u6CA1\u6709\u4EE5\u524D\u7684\u804A\u5929",historyLoading:"\u6B63\u5728\u52A0\u8F7D\u4F60\u7684\u804A\u5929\u2026",historyContinue:"\u7EE7\u7EED\u804A\u5929",historyTitle:"\u804A\u5929\u8BB0\u5F55",loadMoreConversations:"\u52A0\u8F7D\u66F4\u591A\u5BF9\u8BDD",language:"\u8BED\u8A00",launcherOpen:"\u6253\u5F00\u804A\u5929",launcherAsk:"\u8BE2\u95EE {name}",micBlocked:"\u6B64\u7F51\u7AD9\u7684\u9EA6\u514B\u98CE\u5DF2\u88AB\u963B\u6B62\uFF0C\u65E0\u6CD5\u5F00\u59CB\u8BED\u97F3\u8F93\u5165\u3002",micStart:"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",micStop:"\u505C\u6B62\u8BED\u97F3\u8F93\u5165",moreActions:"\u66F4\u591A\u64CD\u4F5C",newConversation:"\u65B0\u804A\u5929",panelTitle:"\u804A\u5929",popOut:"\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",resizeHandle:"\u62D6\u52A8\u4EE5\u8C03\u6574\u5927\u5C0F",scrollToBottom:"\u6EDA\u52A8\u5230\u6700\u65B0",send:"\u53D1\u9001",queueMessage:"\u6392\u961F\u53D1\u9001",removeQueuedMessage:"\u79FB\u9664\u6392\u961F\u7684\u6D88\u606F",removeAttachment:"\u79FB\u9664 {name}",suggestedReplies:"\u63A8\u8350\u56DE\u590D",compactingContext:"\u6B63\u5728\u4F18\u5316\u5BF9\u8BDD\u4E0A\u4E0B\u6587\u2026",soundOff:"\u5173\u95ED\u58F0\u97F3",soundOn:"\u6253\u5F00\u58F0\u97F3",talkToOperator:"\u4E0E\u771F\u4EBA\u4EA4\u8C08",connectingOperator:"\u6B63\u5728\u4E3A\u4F60\u8054\u7CFB\u771F\u4EBA\u2026",noOperatorAvailable:"\u76EE\u524D\u6CA1\u6709\u4EBA\u6709\u7A7A\uFF0C\u8BF7\u7559\u4E0B\u4F60\u7684\u8054\u7CFB\u65B9\u5F0F\uFF0C\u6211\u4EEC\u4F1A\u8DDF\u8FDB\u3002",chattingWithOperator:"\u4F60\u6B63\u5728\u4E0E {operator} \u804A\u5929",operatorBadgeTitle:"\u5728\u7EBF\u804A\u5929",chatNotice:"\u4F60\u6B63\u5728\u4E0E AI \u52A9\u624B\u804A\u5929\u3002",cancelOperatorRequest:"\u7EE7\u7EED\u4E0E AI \u804A\u5929",loginPrompt:"\u767B\u5F55\u4EE5\u83B7\u5F97\u66F4\u5FEB\u3001\u66F4\u4E2A\u6027\u5316\u7684\u652F\u6301",loginAction:"\u767B\u5F55",loginRequired:"\u767B\u5F55\u540E\u4E0E\u6211\u4EEC\u804A\u5929",loginExpired:"\u4F60\u7684\u767B\u5F55\u5DF2\u8FC7\u671F\u3002\u8BF7\u767B\u5F55\u4EE5\u7EE7\u7EED\u6B64\u804A\u5929\u3002",loginExpiredGuest:"\u4F60\u7684\u767B\u5F55\u5DF2\u8FC7\u671F\u3002\u8BF7\u767B\u5F55\u4EE5\u7EE7\u7EED\u6B64\u804A\u5929\uFF0C\u6216\u4EE5\u8BBF\u5BA2\u8EAB\u4EFD\u5F00\u59CB\u65B0\u5BF9\u8BDD\u3002",startAsGuest:"\u5F00\u59CB\u65B0\u5BF9\u8BDD",loggedInAs:"\u5DF2\u767B\u5F55\u4E3A {name}",loggedIn:"\u5DF2\u767B\u5F55",dismissLoginPrompt:"\u9690\u85CF",emailTranscript:"\u901A\u8FC7\u90AE\u4EF6\u53D1\u9001\u804A\u5929\u8BB0\u5F55",emailTranscriptPrompt:"\u901A\u8FC7\u90AE\u4EF6\u83B7\u53D6\u6B64\u5BF9\u8BDD\u7684\u526F\u672C\u3002",emailTranscriptEmailLabel:"\u90AE\u7BB1\u5730\u5740",emailTranscriptSend:"\u53D1\u9001\u804A\u5929\u8BB0\u5F55",emailTranscriptSending:"\u6B63\u5728\u53D1\u9001\u2026",emailTranscriptSent:"\u5DF2\u53D1\u9001\u81F3 {email}\u3002",emailTranscriptAlreadySent:"\u6B64\u5BF9\u8BDD\u5DF2\u901A\u8FC7\u90AE\u4EF6\u53D1\u9001\u3002\u53D1\u9001\u4E00\u6761\u65B0\u6D88\u606F\u540E\u53EF\u518D\u6B21\u53D1\u9001\u3002",emailTranscriptLimited:"\u4F60\u5DF2\u8FBE\u5230\u5F53\u524D\u4E0A\u9650\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",emailTranscriptFailed:"\u53D1\u9001\u5931\u8D25\u3002\u8BF7\u91CD\u8BD5\u3002",emailTranscriptNotDelivered:"\u65E0\u6CD5\u53D1\u9001\u5230\u6B64\u5730\u5740\u3002\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002",emailTranscriptCancel:"\u53D6\u6D88",emailTranscriptDone:"\u5B8C\u6210",stop:"\u505C\u6B62",theme:"\u4E3B\u9898",themeAuto:"\u81EA\u52A8",themeDark:"\u6DF1\u8272",themeLight:"\u6D45\u8272",textSize:"\u6587\u5B57\u5927\u5C0F",textSizeSmall:"\u5C0F",textSizeNormal:"\u6807\u51C6",textSizeLarge:"\u5927",loading:"\u6B63\u5728\u52A0\u8F7D\u2026",visualPreparing:"\u6B63\u5728\u51C6\u5907\u56FE\u8868\u2026",visualError:"\u65E0\u6CD5\u663E\u793A\u6B64\u56FE\u8868\u3002",visualPartial:"\u6B64\u56FE\u8868\u7684\u90E8\u5206\u5185\u5BB9\u65E0\u6CD5\u663E\u793A\u3002",visualSoldOut:"\u5DF2\u552E\u7F44",visualCartEmpty:"\u4F60\u7684\u8D2D\u7269\u8F66\u662F\u7A7A\u7684\u3002",visualQuantity:"\u6570\u91CF",visualChoose:"\u9009\u62E9",visualDirect:"\u76F4\u98DE",visualVia:"\u7ECF\u505C",visualNight:"1 \u665A",visualNights:"{count} \u665A",visualPerNight:"\u6BCF\u665A",visualTravellers:"\u65C5\u5BA2",thinking:"\u6B63\u5728\u601D\u8003\u2026",thought:"\u601D\u8003\u8FC7\u7A0B",thoughtFor:"\u601D\u8003\u4E86 {time}",toolResult:"\u7ED3\u679C",sources:"\u6765\u6E90",feedbackUp:"\u56DE\u7B54\u5F88\u597D",feedbackDown:"\u56DE\u7B54\u4E0D\u597D",feedbackThanks:"\u611F\u8C22\u4F60\u7684\u53CD\u9988",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",copyTicketReference:"\u5DE5\u5355 {reference}\uFF0C\u590D\u5236",tabHome:"\u9996\u9875",tabConversations:"\u804A\u5929",tabHelp:"\u5E2E\u52A9",tabNews:"\u52A8\u6001",modulesEmpty:"\u8FD9\u91CC\u8FD8\u6CA1\u6709\u5185\u5BB9",chatUnavailable:"\u6B64\u804A\u5929\u76EE\u524D\u4E0D\u53EF\u7528",moduleBack:"\u8FD4\u56DE",contentLoading:"\u6B63\u5728\u52A0\u8F7D\u2026",contentHelpful:"\u8FD9\u5BF9\u4F60\u6709\u5E2E\u52A9\u5417\uFF1F",homeGreeting:"\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u4F60\uFF1F",homeGreetingNamed:"\u4F60\u597D\uFF0C{name} \u{1F44B}",homeGreetingLead:"\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u4F60\uFF1F",homeSearchPlaceholder:"\u641C\u7D22\u5E2E\u52A9",homeAskPlaceholder:"\u63D0\u51FA\u95EE\u9898\u2026",homeWhatsNew:"\u6700\u65B0\u52A8\u6001",homeContentTitle:"\u70ED\u95E8\u6587\u7AE0",homeStatus:"\u72B6\u6001",helpTitle:"\u5E2E\u52A9",helpSearchPlaceholder:"\u641C\u7D22\u5E2E\u52A9",helpEmpty:"\u8FD8\u6CA1\u6709\u5E2E\u52A9\u6587\u7AE0",helpLoading:"\u6B63\u5728\u52A0\u8F7D\u5E2E\u52A9\u2026",helpSearchEmpty:"\u6CA1\u6709\u627E\u5230\u201C{query}\u201D\u7684\u7ED3\u679C",helpShowMore:"\u663E\u793A\u66F4\u591A",newsTitle:"\u52A8\u6001",newsEmpty:"\u8FD8\u6CA1\u6709\u52A8\u6001",newsLoading:"\u6B63\u5728\u52A0\u8F7D\u52A8\u6001\u2026",newsShowMore:"\u663E\u793A\u66F4\u591A",newsUnseen:"\u65B0\u6587\u7AE0",unread:"\u672A\u8BFB",formRequired:"\u6B64\u9879\u4E3A\u5FC5\u586B",formInvalidEmail:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740",formInvalidTel:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7535\u8BDD\u53F7\u7801",formInvalidNumber:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u6570\u5B57",formOtherPlaceholder:"\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u2026",inputRequired:"\u9700\u8981\u4F60\u56DE\u7B54\u7684\u95EE\u9898",askFallbackQuestion:"\u8BF7\u63D0\u4F9B\u7F3A\u5C11\u7684\u4FE1\u606F\u3002",inputBadge:"\u95EE\u9898",inputAnswered:"\u5DF2\u56DE\u7B54",inputSkipped:"\u5DF2\u8DF3\u8FC7",showOptions:"\u663E\u793A\u9009\u9879",hideOptions:"\u9690\u85CF\u9009\u9879",qtypeText:"\u4F60\u7684\u56DE\u7B54",qtypeEmail:"\u90AE\u7BB1\u5730\u5740",qtypePhone:"\u7535\u8BDD\u53F7\u7801",qtypeNumber:"\u6570\u5B57",qtypeDate:"\u65E5\u671F",qtypeChooseOne:"\u9009\u62E9\u4E00\u9879",qtypeChooseAny:"\u53EF\u591A\u9009",qtypeBoolean:"\u662F / \u5426",inputSubmit:"\u63D0\u4EA4\u56DE\u7B54",inputSubmitHint:"Enter \u53D1\u9001 \xB7 Shift+Enter \u6362\u884C",inputSkip:"\u8DF3\u8FC7",confirmYes:"\u662F",confirmNo:"\u5426",approve:"\u6279\u51C6",decline:"\u62D2\u7EDD",changeAnswer:"\u4FEE\u6539\u56DE\u7B54",approvalPrompt:"{action}\uFF1F",approvalEditHint:"\u5728\u6B64\u6B65\u9AA4\u7EE7\u7EED\u4E4B\u524D\uFF0C\u4F60\u53EF\u4EE5\u4FEE\u6539\u56DE\u7B54\u3002",stepInput:"\u8F93\u5165",stepWorking:"\u8FDB\u884C\u4E2D",stepWorkingOnIt:"\u6B63\u5728\u5904\u7406\u2026",stepNeedsYourApproval:"\u9700\u8981\u4F60\u7684\u6279\u51C6",stepWaitingForVisitor:"\u7B49\u5F85\u8BBF\u5BA2",stepApproved:"\u5DF2\u6279\u51C6",stepDeclined:"\u5DF2\u62D2\u7EDD",stepReplaced:"\u5DF2\u66FF\u6362",stepFailed:"\u5931\u8D25",stepDidNotWork:"\u672A\u6210\u529F",decidedYouApproved:"\u4F60\u5DF2\u6279\u51C6",decidedYouDeclined:"\u4F60\u5DF2\u62D2\u7EDD",decidedVisitorApproved:"\u8BBF\u5BA2\u5DF2\u6279\u51C6",decidedVisitorDeclined:"\u8BBF\u5BA2\u5DF2\u62D2\u7EDD",decidedTeamApproved:"\u56E2\u961F\u6210\u5458\u5DF2\u6279\u51C6",decidedTeamDeclined:"\u56E2\u961F\u6210\u5458\u5DF2\u62D2\u7EDD",decidedMemberApproved:"{name} \u5DF2\u6279\u51C6",decidedMemberDeclined:"{name} \u5DF2\u62D2\u7EDD",stepRawData:"\u539F\u59CB\u6570\u636E",decidedRulesApproved:"\u5DF2\u81EA\u52A8\u6279\u51C6",decidedRulesDeclined:"\u5DF2\u81EA\u52A8\u62D2\u7EDD",edit:"\u7F16\u8F91",toolStepsFailed:"{count} \u4E2A\u5931\u8D25",statusStopped:"\u5DF2\u505C\u6B62",toolStepsStopped:"\u5728 {count} \u6B65\u540E\u505C\u6B62",toolStepsStoppedOne:"\u5728 1 \u6B65\u540E\u505C\u6B62"},ih={en:ui,fr:eh,es:nh,ar:th,he:rh,zh:oh};function pi(e,t){let n=ad(e),r=fi(t),o=ih[id(n)],i=r?{...t[n],...t[e]}:t??{},s=r?t.en??{}:{};return{...ui,...o,...s,...i}}function ad(e){return(e.split("-")[0]??"en").toLowerCase()}var ah=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function _i(e){return ah.has(ad(e))}function at(e,t){return e[t]??t}function fi(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}var cd=["decided","auto-decided","unasked","failed"],gi=["platform","mcp","api","webmcp"],sh=["none","values","table","json","table-and-json"];function dd(e,t){return typeof t=="string"&&e.some(n=>n===t)}var lh={visitor:{stepsFrom:gi,stepsShown:[],stepDetails:"values",showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},member:{stepsFrom:gi,stepsShown:cd,stepDetails:"table-and-json",showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}},ch=["showStepSystem","showDecidedBy","foldApprovals"];function ud(e){let t={};if(typeof e!="object"||e===null)return t;for(let i of ch){let s=Reflect.get(e,i);typeof s=="boolean"&&(t[i]=s)}let n=Reflect.get(e,"stepsFrom");Array.isArray(n)&&(t.stepsFrom=gi.filter(i=>n.includes(i)));let r=Reflect.get(e,"stepsShown");Array.isArray(r)&&(t.stepsShown=cd.filter(i=>r.includes(i)));let o=Reflect.get(e,"stepDetails");return dd(sh,o)&&(t.stepDetails=o),t}function pd(e,t){return{...lh[t],...e}}var _d=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,dh=4e3;function Ss(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function uh(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,""),n=t.indexOf("__");return Ss(n>0?t.slice(n+2):t)}function ph(e,t,n){let r=e.approval;return r?.replacedByMessageId?"replaced":e.state==="output-available"?n.error===void 0?"done":"failed":e.state==="output-error"?t.interrupted?"stopped":"failed":e.state==="output-denied"||r?.approved===!1?"declined":e.state==="approval-responded"||r?.approved===!0?t.cutOff?"stopped":"approved":e.state==="approval-requested"?t.submitted?"submitted":t.cutOff?"stopped":t.superseded?"replaced":"waiting":t.live?"running":"stopped"}function _h(e,t){if(e.isAutomatic)return"rules";let n=e.respondedBy;return n?.visitorId?"visitor":n?.userId?n.userId===t.userId?"you":"teamMember":t.decides?"you":"visitor"}function fh(e,t,n,r,o){let i=r[t?"inputAnswered":"inputSkipped"];if(o)return{label:i,title:i};let s=r[t?"stepApproved":"stepDeclined"];if(e==="teamMember"&&n)return{label:s,title:r[t?"decidedMemberApproved":"decidedMemberDeclined"].replace("{name}",n)};let l=r[gh[e][t?0:1]];return e==="you"?{label:s,title:l}:{label:l,title:l}}var gh={you:["decidedYouApproved","decidedYouDeclined"],visitor:["decidedVisitorApproved","decidedVisitorDeclined"],teamMember:["decidedTeamApproved","decidedTeamDeclined"],rules:["decidedRulesApproved","decidedRulesDeclined"]};function mh(e,t){switch(e){case"running":return t.strings.stepWorking;case"waiting":return t.reader.decides?t.strings.stepNeedsYourApproval:t.strings.stepWaitingForVisitor;case"submitted":return t.strings.stepWorkingOnIt;case"approved":return t.strings.stepApproved;case"declined":return t.card?t.strings.inputSkipped:t.strings.stepDeclined;case"replaced":return t.card?t.strings.inputSkipped:t.strings.stepReplaced;case"stopped":return t.strings.statusStopped;case"failed":return t.plain?t.strings.stepDidNotWork:t.strings.stepFailed;case"done":return"";default:return e}}function $t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fd(e){return typeof e=="string"?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):""}function sd(e){return fd(e)||(e!==null&&typeof e=="object"?JSON.stringify(e):"")}function hh(e){if(!$t(e))return sd(e);let[t,...n]=Object.values(e).map(sd).filter(Boolean);return t===void 0?"":n.length>0?`${t} (${n.join(", ")})`:t}function ld(e,t){if(!$t(e))return[];let n=[];function r(i,s){if(Array.isArray(i)){let c=i.map(hh).filter(Boolean).join(", ");c&&n.push({path:s,value:c});return}if($t(i)){for(let[c,u]of Object.entries(i))r(u,[...s,c]);return}let l=fd(i);l&&(t.withIds||!_d.test(l))&&n.push({path:s,value:l})}r(e,[]);let o=n.map(({path:i})=>Ss(i.at(-1)??""));return n.map(({path:i,value:s},l)=>{let c=o[l]??"";return{label:o.filter(p=>p===c).length>1&&i.length>1?`${Ss(i.at(-2)??"")} \xB7 ${c.toLowerCase()}`:c,value:s}})}function vh(e,t){if($t(e))return Object.entries(e).find(n=>n[0]!==t&&typeof n[1]=="string"&&n[1].trim().length>0&&!_d.test(n[1].trim()))?.[1].trim()}function bh(e){if(typeof e.toolMetadata?.system=="string")return e.toolMetadata.system;let t=e.toolMetadata?.systemField,n=typeof t=="string"&&$t(e.input)?e.input[t]:void 0;return typeof n=="string"&&n.trim()?n.trim():void 0}function mi(e,t=Number.POSITIVE_INFINITY){if(e==null)return;let n=typeof e=="string"?e:JSON.stringify(e,null,2);if(!(!n||n==="{}"||n==="[]"||n==='""'))return n.length>t?`${n.slice(0,t)}\u2026`:n}function yh(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(t)}catch{return e}}function gd(e){if($t(e)&&e.storage==="tool-result-ref"&&"summary"in e)return gd(e.summary);if($t(e)&&Array.isArray(e.content)){let t=e.content.flatMap(r=>$t(r)&&typeof r.text=="string"?[r.text]:[]).join(`
|
|
2
|
-
`),n=$t(e.structuredContent)?e.structuredContent:yh(t);return e.isError===!0?{value:n,error:$t(n)&&typeof n.error=="string"?n.error:t}:{value:n}}return $t(e)&&typeof e.error=="string"&&typeof e.instruction=="string"?{value:e,error:e.error}:{value:e}}function Ph(e){return mi(e.input)!==void 0||mi(e.output)!==void 0||!!e.errorText}function xh(e,t){let n=e.approval?"decided":"unasked",r=e.approval?.isAutomatic?"auto-decided":n;return t==="failed"?[r,"failed"]:[r]}function Sh(e){let t=e.toolMetadata?.origin;return dd(gi,t)?t:void 0}function wh(e,t,n){let{display:r}=n,o=e.approval,i=o!==void 0&&!o.isAutomatic;if(i&&ws(e,n.turn))return"card";let s=n.by==="you"||i&&n.by===void 0&&n.reader.decides,l=Sh(e),c=(l===void 0||r.stepsFrom.includes(l))&&xh(e,t.status).some(u=>r.stepsShown.includes(u));return!(s||c)||!o&&!Ph(e)?"hidden":i&&!r.foldApprovals?"card":"step"}function ws(e,t){return e.approval?.replacedByMessageId||(t.superseded||t.cutOff)&&e.approval?.approved===void 0?!1:e.state==="approval-requested"||e.state==="approval-responded"}function md(e,t){let{turn:n,reader:r,display:o,strings:i}=t,s=gd(e.output),l=ph(e,n,s),c=e.approval,u=c!==void 0&&!c.isAutomatic,p=typeof e.toolMetadata?.card=="string"?e.toolMetadata.card:void 0,_=o.stepDetails,d=_==="table"||_==="table-and-json",f=_==="none"||_==="values",v=c?.replacedByMessageId?void 0:c?.approved,m=c&&v!==void 0?_h(c,r):void 0,h=m==="teamMember"?c?.respondedBy?.userId:void 0,y=m&&v!==void 0&&(m==="you"||m==="rules"||o.showDecidedBy)?{approved:v,by:m,...fh(m,v,h&&t.names?.get(h),i,p!==void 0),...h?{userId:h}:{}}:void 0,P=uh(e),x=o.showStepSystem||e.toolMetadata?.nameShared===!0?bh(e):void 0,C=vh(e.input,typeof e.toolMetadata?.systemField=="string"?e.toolMetadata.systemField:void 0),S=e.errorText??s.error,g=d&&s.error===void 0?ld(s.value,{withIds:!0}):[],b=_==="json"||_==="table-and-json"?{input:mi(e.input),output:mi(s.value,dh)}:void 0,k=u&&ws(e,n),N=_==="none"&&!k?[]:ld(e.input,{withIds:d||k}),I=S!==void 0&&S!==""&&!f,D=$t(c?.descriptor)&&$t(c.descriptor.decision)?c.descriptor.decision:void 0,A=_!=="none"||k?D:void 0,z=y!==void 0&&(l==="approved"||l==="declined"),j={toolCallId:e.toolCallId,placement:"hidden",...p&&c?{card:p}:{},name:P,...x?{system:x}:{},status:l,statusLabel:z?"":mh(l,{reader:r,strings:i,card:p!==void 0,plain:f}),...y?{decision:y}:{},...A?{why:A}:{},...C?{summary:C}:{},fields:N,tables:d,...g.length>0?{resultFields:g}:{},...I?{error:S}:{},...b?{raw:b}:{},opens:N.length>0||g.length>0||b!==void 0||I||A!==void 0,...u&&!p?{approval:kh(e,l,{turn:n,reader:r,strings:i,name:P})}:{}};return{...j,placement:wh(e,j,{turn:n,reader:r,display:o,by:m})}}function kh(e,t,n){let r=n.strings.approvalPrompt.replace("{action}",n.name);return t==="waiting"?{ask:r,buttons:n.reader.decides?"decide":"none"}:t==="submitted"?{ask:r,buttons:"none"}:ws(e,n.turn)?n.turn.canAct&&n.reader.decides?{ask:r,buttons:"change",note:n.strings.approvalEditHint}:t==="approved"?{ask:r,buttons:"none",note:n.strings.stepWorkingOnIt}:{ask:r,buttons:"none"}:{ask:r,buttons:"none"}}function hd(e){let t=new Map;for(let i of e)t.set(i.name,(t.get(i.name)??0)+1);let n=new Map;for(let{decision:i}of e){if(!i)continue;let s=n.get(i.title)??{approved:i.approved,label:i.label,title:i.title,...i.userId?{userId:i.userId}:{},count:0};n.set(i.title,{...s,count:s.count+1})}let[r]=e,o=e.some(i=>i.status==="stopped");return{tools:[...t].map(([i,s])=>({name:i,count:s})),...e.length===1&&r?{single:{name:r.name,...r.system?{system:r.system}:{},...r.summary?{summary:r.summary}:{},...Ch(r)}}:{},marks:[...n.values()].map(({count:i,...s})=>Object.assign(s,{label:i>1?`${s.label} \xD7${i}`:s.label})),failed:e.filter(i=>i.status==="failed").length,...o?{stopped:{finished:e.filter(i=>i.status!=="stopped").length}}:{}}}function Ch(e){return!e.decision&&(e.status==="replaced"||e.status==="declined")?{outcome:e.statusLabel}:{}}function vd(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace("{count}",String(e))}var ks=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{}}},hi=new ks,Fn={get(e){try{return sessionStorage.getItem(e)}catch{return null}},set(e,t){try{sessionStorage.setItem(e,t)}catch{}},remove(e){try{sessionStorage.removeItem(e)}catch{}}};var vi={maxBytes:10485760,maxCount:10,accept:"*/*"},bd={voice:"local"},Cs={enabled:!0,sampleRate:1},Ts={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio"},Pr={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},yd={floating:["theme","textSize","history","close","clear","expand","fullscreen","popOut","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"]},Rs={enabled:!0,volume:.3,events:void 0},Pd={enabled:!0,events:void 0},xd=[{label:"tabConversations",layout:"chat"}];var Es=["off","error","warn","info","debug","trace"],Ms=L.cssPrefix,Sd=`${Ms}.debug`,Th=`__${L.global}_DEBUG__`,Rh=`${Ms}-debug`,bi=2,As=null;function Ah(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Rh);if(e!==null){let t=Is(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Sd);if(e){let t=Is(e);if(t>=0)return t}}catch{}return Reflect.get(window,Th)?4:2}function Is(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=Es.findIndex(n=>n===e);if(t>=0)return t}return-1}function xr(e){let t=Is(e);if(!(t<0)){bi=t;try{window.localStorage?.setItem(Sd,Es[t]??"off")}catch{}}}function eo(){return Es[bi]??"warn"}bi=Ah();function wd(e){let t=`[${Ms}:${e}]`;function n(r,o,i){return(s,l)=>{if(!(bi<r)&&(l===void 0?console[o](t,s):console[o](t,s,l),As))try{As({level:i,scope:e,message:s,payload:l})}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:r=>wd(`${e}:${r}`)}}var ee=wd("core");function to(e){As=e}var Hn=ee.scope("context"),Ih=new Set(["visitorId","conversationId","jwt","token","authorization","password"]),kd=50,Ls=1024,Eh=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Os(e){return Cd(e,"userContext",!0)}function Ns(e){return Cd(e,"pageContext",!1)}function Mh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Cd(e,t,n){if(e==null)return;if(!Mh(e)){Hn.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let r={},o=0;for(let[i,s]of Object.entries(e)){if(Ih.has(i)){Hn.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(o>=kd){Hn.warn(`${t} truncated at ${kd} keys \u2014 dropped "${i}"`);continue}let l=Lh(t,i,s);l!==void 0&&(r[i]=l,o++)}return n&&typeof r.email=="string"&&!Eh.test(r.email)&&(Hn.warn("dropped malformed context field",{field:`${t}.email`,reason:"invalid format"}),delete r.email),Object.keys(r).length>0?r:void 0}function Lh(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){Hn.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let r=n.trim();return r===""?void 0:r.length>Ls?(Hn.warn(`truncated ${e}.${t} to ${Ls} chars`),r.slice(0,Ls)):r}Hn.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}function mn(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},r=t.behavior??{},o=t.i18n??{},i=t.feedback??{},s=t.footer??{},l=t.header??{},c={enabled:t.history?.enabled??!0},{themeMode:u,themeOverrides:p}=Oh(t.theme),_=n.mode??"floating",d=Nh(o.defaultLocale),f=o.availableLocales??[o.locale??d],v=Sr(o.locale??d,f,d),m=(t.baseUrl??L.defaultBaseUrl).replace(/\/$/,""),h=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),y=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:h,dataApiBaseUrl:y,userContext:Os(t.userContext),pageContext:Ns(t.pageContext),position:n.position??(_i(v)?"bottom-left":"bottom-right"),themeMode:u,textSize:"normal",themeOverrides:p,mode:_,responseMode:r.responseMode??"streaming",showReasoning:r.showReasoning??!1,stepDisplay:pd(r.stepDisplay,"visitor"),showSources:r.showSources??!1,enableMessageFeedback:!(r.disableMessageFeedback??!1),autoSendSuggestions:r.autoSendSuggestions??!1,cardAnswerWaitSeconds:r.cardAnswerWaitSeconds??60,popOutUrl:r.popOutUrl,features:{voice:t.features?.voice??bd.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),emailTranscript:!(t.features?.disableEmailTranscript??!1),operatorRequest:t.features?.enableOperatorRequest===!0&&!(t.features.hideRequestOperatorButton??!1)},endpoints:{upload:t.endpoints?.upload??Ts.upload,transcribe:t.endpoints?.transcribe??Ts.transcribe},attachments:{accept:t.composer?.attachments?.accept??vi.accept,maxBytes:t.composer?.attachments?.maxBytes??vi.maxBytes,maxCount:t.composer?.attachments?.maxCount??vi.maxCount},locale:v,defaultLocale:d,availableLocales:f,startMinimized:r.startMinimized??!0,actions:$h(_,l.actions,c.enabled),size:{...n.size,resize:{...n.size?.resize,enabled:n.size?.resize?.enabled??!0}},launcher:qh(t.launcher,t.agent?.name),sound:Dh(i.sound),haptics:Bh(i.haptics),strings:pi(v,o.strings),stringsOverride:o.strings,composerDisclaimer:s.composerDisclaimer??"",header:{variant:l.variant??"plain",notice:l.notice,showNotice:!(l.hideNotice??!1)},poweredBy:zh(s.poweredBy),composer:Fh(t.composer),modules:Hh(t.modules,c.enabled),tracking:Uh(t.tracking,y),history:c,storage:t.storage??hi,userToken:t.userToken,continueLink:t.continueLink,tools:t.tools,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Oh(e){if(typeof e=="string")return{themeMode:e,themeOverrides:{}};if(!e||typeof e!="object")return{themeMode:"host",themeOverrides:{}};let{mode:t,...n}=e;return{themeMode:t??"host",themeOverrides:n}}function Nh(e){return e&&e!=="auto"?e:globalThis.navigator?.language||"en"}function Sr(e,t,n){if(t.length<=1||t.includes(e))return e;let r=e.split("-")[0];return r&&t.includes(r)?r:t.includes(n)?n:t[0]??e}function $h(e,t,n){let r=t??yd[e];return n?r:r.filter(o=>o!=="history")}function Dh(e){return{enabled:e?.enabled??Rs.enabled,volume:e?.volume??Rs.volume,events:e?.events}}function Bh(e){return{enabled:e?.enabled??Pd.enabled,events:e?.events}}function Uh(e,t){let n=e?.sampleRate??Cs.sampleRate;return{enabled:e?.enabled??Cs.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 zh(e){return e?.text===""&&!e.logoUrl?null:{href:L.siteUrl,...e}}function Fh(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Hh(e,t){let n=(e??xd).slice(0,4),r=n.some(l=>l?.label&&l.layout==="help"),o=new Set,i=[];for(let l of n){if(!l?.label||!l?.layout)continue;let c=l.contentCollectionIds?.filter(Boolean),u=l.id??c?.[0]??l.layout;for(;o.has(u);)u=`${u}-${i.length}`;o.add(u);let p={id:u,label:l.label,layout:l.layout};c?.length&&(p.contentCollectionIds=c),l.layout==="home"&&(p.brandName=l.brandName,p.greetingText=l.greetingText,p.showGreeting=!(l.hideGreeting??!1),p.showSearchBar=r&&!(l.hideSearchBar??!1),p.showRecentConversations=t&&!(l.hideRecentConversations??!1),l.userAvatars?.length&&(p.userAvatars=l.userAvatars),l.status&&(p.status=l.status),p.contentBlockTitle=l.contentBlockTitle),i.push(p)}let s=Object.fromEntries(i.map(l=>[l.id,l]));return{list:i,byId:s}}function qh(e,t){let n=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??Pr.variant,size:e?.size??Pr.size,label:e?.label??Pr.label,icon:e?.icon??Pr.icon,hidden:e?.hidden??Pr.hidden,...t&&{personaName:t},callout:n}}function no(e,t){return e==="host"?"host":t??e}function $s(e,t,n,r){let o=Sr(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&n===e.themeMode&&r===e.textSize)return e;let i={...e};return o!==e.locale&&(i.locale=o,i.strings=pi(o,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),r!==e.textSize&&(i.textSize=r),i}function yi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var jh=["agent","presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints","history"];function Ds(e,t){if(!t)return e;let n={...e};for(let i of jh){let s=t[i];if(s===void 0)continue;let l=e[i];if(i==="theme"){l===void 0?n[i]=s:typeof l=="string"&&typeof s=="object"&&s!==null&&(n[i]={...s,mode:l});continue}i!=="i18n"&&(n[i]=Td(yi(s)?s:{},yi(l)?l:void 0))}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 r=e.i18n,o=t.i18n;if(r||o){let i=Td(yi(o)?o:{},yi(r)?r:void 0);o?.availableLocales!==void 0&&(i.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(i.defaultLocale=o.defaultLocale);let s=r?.strings,l=o?.strings;(s||l)&&(i.strings=Vh(l,s)),n.i18n=i}return n}function Td(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return n}function Vh(e,t){if(!e)return t;if(!t)return e;let n=fi(e),r=fi(t);if(!n&&!r)return{...e,...t};let o={},i=n?e:{en:e},s=r?t:{en:t};for(let[l,c]of Object.entries(i))o[l]={...c};for(let[l,c]of Object.entries(s))o[l]={...o[l],...c};return o}var Wh=["clear","expand","fullscreen","popOut","sound","history","language","theme","textSize","close"];function Gh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function hn(e){return e!=="false"}function Kh(e){try{return ud(JSON.parse(e))}catch{return}}function Qh(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function Yh(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}var Ad=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["continue-link","continueLink"],["theme","theme",e=>e]],Id=[["mode","mode",e=>e],["position","position",e=>e]],Ed=[["width","width"],["height","height"]],Md=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",hn],["show-reasoning","showReasoning",hn],["step-display","stepDisplay",Kh],["show-sources","showSources",hn],["disable-message-feedback","disableMessageFeedback",hn],["auto-send-suggestions","autoSendSuggestions",hn],["card-answer-wait-seconds","cardAnswerWaitSeconds",Qh],["pop-out-url","popOutUrl"]],Ld=[["locale","locale"]],Jh=new Set(Wh);function Xh(e){return Yh(e).filter(t=>Jh.has(t))}var Od=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",hn]],Nd=[["features-disable-file-upload","disableFileUpload",hn],["features-disable-email-transcript","disableEmailTranscript",hn],["features-voice","voice",e=>e]],$d=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Dd=[["user-id","id"],["user-email","email"],["user-name","name"]],Bd=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Zh=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],ev=[Ad,Id,Ed,Md,Ld,Od,Nd,$d,Dd,Bd],tv=new Set(["start-minimized"]),Bs=[...ev.flatMap(e=>e.map(([t])=>t).filter(t=>!tv.has(t))),...Zh];function Pi(e){let t={};function n(f){let v=e(f);return v===null||v===""?void 0:v}for(let[f,v,m]of Ad){let h=n(f);h!==void 0&&Reflect.set(t,v,m?m(h):h)}let r=qn(n,Id),o=qn(n,Ed);(r||o)&&(t.presentation={...r,...o?{size:o}:{}});let i=qn(n,Md);i&&(t.behavior=i);let s=qn(n,Ld);s&&(t.i18n=s);let l=rv(e,n);l&&(t.launcher=l);let c=qn(n,Nd);c&&(t.features=c);let u=qn(n,$d);u&&(t.endpoints=u);let p=Rd(n,Dd,"user-context");p&&(t.userContext=p);let _=Rd(n,Bd,"page-context");_&&(t.pageContext=_);let d=n("actions");return d!==void 0&&(t.header={actions:Xh(d)}),t}function Us(e){return e?Pi(t=>e[nv(t==="data-api-base-url"?"api-base-url":t)]??null):{}}function nv(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function qn(e,t){let n={};for(let[r,o,i]of t){let s=e(r);s!==void 0&&Reflect.set(n,o,i?i(s):s)}return Object.keys(n).length>0?n:null}function Rd(e,t,n){let r={};for(let[l,c]of t){let u=e(l);u!==void 0&&(r[c]=u)}let o={},i=e(n);if(i)try{let l=JSON.parse(i);if(Gh(l))for(let[c,u]of Object.entries(l))(typeof u=="string"||typeof u=="number"||typeof u=="boolean")&&(o[c]=u)}catch{}let s={...o,...r};return Object.keys(s).length>0?s:null}function rv(e,t){let n=qn(t,Od)??{},r=e("launcher-label");r!==null&&(n.label=r);let o=t("callout-text");if(o){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:o,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var ov=ee.scope("events"),vn={open:!1,ready:!1,unread:0},wr=class{constructor(){Z(this,"handlers",new Map);Z(this,"taps",new Set)}on(t,n){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(n),()=>this.handlers.get(t)?.delete(n)}tap(t){return this.taps.add(t),()=>this.taps.delete(t)}listensTo(t){return(this.handlers.get(t)?.size??0)>0||[...this.taps].some(n=>n.listensTo(t))}emit(t,n){for(let r of this.handlers.get(t)??[])try{r(n)}catch(o){ov.warn("listener threw",{event:t,error:o})}for(let r of this.taps)r.hear(t,n)}clear(){this.handlers.clear(),this.taps.clear()}};var iv=ee.scope("hooks"),zs="*";function Fs(e){return typeof e=="function"}var xi=new Set;function ro(e,t,n){let r={widgetId:e,event:t,listener:n};return xi.add(r),()=>{xi.delete(r)}}function av(e,t,n){let r=[...xi];for(let o of r)if(zd(o.widgetId,e.widgetId)&&!(o.event!==zs&&o.event!==t))try{o.listener(e,t,n)}catch(i){iv.warn("hook listener threw",{event:t,error:i})}}function Ud(e,t){return t.tap({hear:(n,r)=>av(e,n,r),listensTo:n=>[...xi].some(r=>r.event===n&&zd(r.widgetId,e.widgetId))})}function Hs(e){if(Array.isArray(e))for(let t of e){let n=sv(t);n&&ro(n.widgetId,n.event,n.listener)}}function zd(e,t){return e===zs||e===t}function sv(e){let t,n,r;if(Array.isArray(e))[t,n,r]=e;else if(lv(e))({widgetId:t,event:n,listener:r}=e);else return null;return typeof t!="string"||typeof n!="string"||!Fs(r)?null:{widgetId:t,event:n,listener:r}}function lv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var cv=new Set(["home","chats","help","news"]);function Fd(e){return typeof e!="object"||e===null||!("to"in e)||typeof e.to!="string"||!cv.has(e.to)?!1:!("id"in e)||e.id===void 0||typeof e.id=="string"}function Si(e){let[t="",...n]=e.trim().split("/");if(t===""||t==="open")return;let r=n.join("/");return r?{to:t,id:r}:{to:t}}function on(e,t){return{text:e,send:typeof t=="object"&&t!==null&&"send"in t&&t.send===!0}}function Hd(e){if(typeof e!="object"||e===null||!("text"in e)||typeof e.text!="string")return;let t=e.text.trim();return t?{text:t,send:"send"in e&&e.send===!0}:void 0}function qd(e){return`${L.cssPrefix}:${e}`}function Pt(e,t,n){e.dispatchEvent(new CustomEvent(qd(t),{detail:n}))}function jd(e,t){let n=Object.keys(t).filter(r=>Object.hasOwn(t,r)).map(r=>{let o=t[r],i=qd(r);function s(l){return o(l instanceof CustomEvent?l.detail:void 0)}return e.addEventListener(i,s),[i,s]});return()=>{for(let[r,o]of n)e.removeEventListener(r,o)}}var Vd=ee.scope("track"),dv=64,uv=256,pv=10;function kr(e,t){let n=typeof e=="string"?e.trim():"";if(!n||n.length>dv){Vd.warn("track: ignored an event without a name of 1\u201364 characters",{name:e});return}let r=Object.fromEntries(Object.entries(typeof t=="object"&&t!==null?t:{}).filter(o=>typeof o[1]=="string"||typeof o[1]=="boolean"||Number.isFinite(o[1])));return JSON.stringify(r).length>uv?(Vd.warn("track: sent the event without its data, which is over 256 characters",{name:n}),{name:n}):Object.keys(r).length>0?{name:n,data:r}:{name:n}}function Wd(e){let t=[];return e.on("hostEvent",n=>{t.push({...n,at:Date.now()}),t.length>pv&&t.shift()}),t}var _v=new Set(["hidden","submit","button","reset","image","file","password"]);function Kd(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function fv(e){return!Kd(e)||e.name===""||e.disabled?!1:!(e instanceof HTMLInputElement&&_v.has(e.type))}function gv(e){let t=e.labels?.[0]?.textContent?.trim();return e.getAttribute("toolparamdescription")??(t||e.getAttribute("aria-description"))??void 0}function mv(e,t){let n=gv(e),r=n?{description:n}:{};return e instanceof HTMLSelectElement?{...r,type:"string",enum:[...e.options].map(o=>o.value)}:e instanceof HTMLTextAreaElement?{...r,type:"string"}:e.type==="checkbox"?{...r,type:"boolean"}:e.type==="radio"?{...r,type:"string",enum:t}:e.type==="number"||e.type==="range"?{...r,type:"number"}:{...r,type:"string"}}function hv(e,t){Object.getOwnPropertyDescriptor(Reflect.getPrototypeOf(e)??e,"value")?.set?.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function Gd(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e)}function vv(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked!==(t===!0||t==="true")&&e.click();return}if(e instanceof HTMLInputElement&&e.type==="radio"){e.value===Gd(t)&&!e.checked&&e.click();return}hv(e,Gd(t))}function bv(e,t,n){var s;let r=[...e.elements].filter(fv),o={},i=new Set;for(let l of r){let c=r.flatMap(u=>u instanceof HTMLInputElement&&u.type==="radio"&&u.name===l.name?[u.value]:[]);o[s=l.name]??(o[s]=mv(l,c)),l.required&&i.add(l.name)}return{name:t,description:n,inputSchema:{type:"object",properties:o,...i.size>0?{required:[...i]}:{}},execute(l){let c=typeof l=="object"&&l!==null?Object.entries(l):[];for(let[p,_]of c)for(let d of r)d.name===p&&vv(d,_);if(!e.hasAttribute("toolautosubmit"))return"Filled in the form. The visitor still needs to check it and press its submit button.";let u=[...new Set([...e.elements].flatMap(p=>Kd(p)&&p.name&&!p.checkValidity()?[p.name]:[]))];return u.length>0?`Filled in the form, but it can't be submitted yet: ${u.join(", ")} still needs the visitor. Ask them to complete it and press the submit button.`:(setTimeout(()=>e.requestSubmit(),0),"Filled in the form and submitted it.")}}}function Qd(){return[...document.querySelectorAll("form[toolname][tooldescription]")].flatMap(e=>{let t=e.getAttribute("toolname")?.trim()??"",n=e.getAttribute("tooldescription")?.trim()??"";return t&&n?[bv(e,t,n)]:[]})}var Yd=`${L.cssPrefix}.page-tools`,yv=20,Pv=50;function wi(e){return typeof e=="object"&&e!==null}function xv(e){return wi(e)&&(e.state==="running"||e.state==="stopped"||e.state==="finished"&&wi(e.outcome))}function Sv(e){let t=e?JSON.parse(e):void 0;if(!wi(t))return{sent:[],calls:{}};let n=Array.isArray(t.sent)?t.sent.filter(o=>typeof o=="string"):[],r=Object.fromEntries(Object.entries(wi(t.calls)?t.calls:{}).filter(o=>xv(o[1])));return{sent:n,calls:r}}var js={sent:[],calls:{}};function oo(){try{js=Sv(sessionStorage.getItem(Yd))}catch{}return js}function qs(e){js=e;try{sessionStorage.setItem(Yd,JSON.stringify(e))}catch{}}var xt={markSent(e){let t=oo();qs({...t,sent:[...t.sent.filter(n=>n!==e),e].slice(-yv)})},sentHere(e){return oo().sent.includes(e)},get(e){return oo().calls[e]},set(e,t){let n=oo(),r=Object.entries(n.calls).filter(([o])=>o!==e);qs({...n,calls:Object.fromEntries([...r,[e,t]].slice(-Pv))})},clear(e){let t=oo();e.some(n=>n in t.calls)&&qs({...t,calls:Object.fromEntries(Object.entries(t.calls).filter(([n])=>!e.includes(n)))})}};function jn(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(i,e);function o(){return i()}t?.addEventListener("abort",o,{once:!0});function i(){clearTimeout(r),t?.removeEventListener("abort",o),n()}})}var Gs=ee.scope("page-tools"),Jd="site__",Xd=3e4,wv=1e3,Zd=Symbol.for(`${L.cssPrefix}.page-tools`),Ws={state:"output-error",errorText:"The page reloaded before this finished, so it may or may not have taken effect. Check with the visitor before trying it again."},tu="The visitor stopped this before it finished.";function bn(e){return typeof e=="object"&&e!==null}function kv(e){return bn(e)&&Array.isArray(e.registered)&&e.runs instanceof Map}function io(){let e=Reflect.get(globalThis,Zd);if(kv(e))return e;let t={registered:[],runs:new Map};return Reflect.set(globalThis,Zd,t),t}function Vn(e,t){let n=bn(t)&&t.signal instanceof AbortSignal?t.signal:void 0;if(n?.aborted)return;let r=io().registered;r.push(e);function o(){let i=r.indexOf(e);i>=0&&r.splice(i,1)}n?.addEventListener("abort",o,{once:!0})}function eu(e){return e.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,58)}function nu(e){if(!bn(e)||typeof e.name!="string"||!eu(e.name))return;let t=typeof e.title=="string"&&e.title.trim()!==""?e.title.trim().slice(0,120):void 0,n=[e.description,t].find(o=>typeof o=="string"&&o.trim()!=="")??e.name,r=e.preview;return{name:eu(e.name),...t?{title:t}:{},...typeof r=="function"?{preview:o=>Reflect.apply(r,e,[o])}:{},description:n.trim().slice(0,1024),inputSchema:{properties:{},...bn(e.inputSchema)?e.inputSchema:{},type:"object"},consequential:bn(e.annotations)&&e.annotations.consequentialHint===!0}}function Vs(e){return e.flatMap(t=>{let n=nu(t),r=bn(t)?t.execute:void 0;return!n||typeof r!="function"?(Gs.warn("skipped a tool without a name or an execute function",t),[]):[{...n,run:(o,i)=>Reflect.apply(r,t,[o,{signal:i}])}]})}async function Cv(){let e=Reflect.get(document,"modelContext")??Reflect.get(navigator,"modelContext");if(!bn(e)||typeof e.getTools!="function"||typeof e.executeTool!="function")return[];let t=e.getTools,n=e.executeTool,r=await Promise.race([Promise.resolve().then(()=>Reflect.apply(t,e,[])),jn(wv).then(()=>[])]).catch(()=>[]);return(Array.isArray(r)?r:[]).flatMap(o=>{let i=nu(o);return i?[{...i,run:(s,l)=>Reflect.apply(n,e,[o,s,{signal:l}])}]:[]})}async function ao(e=[]){let t=Vs(Qd()),n=new Set(t.map(i=>i.name)),o=[...(await Cv()).filter(i=>!n.has(i.name)),...t,...Vs(e),...Vs(io().registered)];return new Map(o.map(i=>[i.name,i]))}function Ks(e){return[...e.values()].map(({name:t,title:n,description:r,inputSchema:o,consequential:i})=>{let s={name:t,description:r,inputSchema:o};return n&&(s.title=n),i&&(s.annotations={consequentialHint:!0}),s})}function Wn(e){return e?.execution==="client"}function Cr(e){return e.startsWith(Jd)?e.slice(Jd.length):e}function Tv(e){if(e===void 0||typeof e=="function"||typeof e=="symbol")return null;let t=new WeakSet,n=JSON.stringify(e,(r,o)=>{if(typeof o=="bigint")return o.toString();if(!(typeof o=="function"||typeof o=="symbol"))return o instanceof Node?`[${o.nodeName.toLowerCase()}]`:bn(o)?t.has(o)?"[circular]":(t.add(o),o):o});return n.length>Xd?{truncated:!0,preview:n.slice(0,Xd)}:JSON.parse(n)}async function ru(e){let t=(await ao(e.optionTools)).get(Cr(e.toolName));if(!t?.preview)return;let n=t.preview;return Promise.resolve().then(()=>n(e.input)).catch(r=>{Gs.warn("a page tool preview failed",{name:t.name,error:r})})}async function Rv(e){let t=Cr(e.toolName),n=(await ao(e.optionTools)).get(t);return n?Promise.resolve().then(()=>n.run(e.input,e.signal)).then(r=>({state:"output-available",output:Tv(r)})).catch(r=>(Gs.warn("a page tool failed",{name:t,error:r}),{state:"output-error",errorText:(r instanceof Error?r.message:String(r)).slice(0,1e3)||"The page tool failed."})):{state:"output-error",errorText:`This page doesn't offer "${t}" right now; the visitor may have moved on. Tell them, or continue without it.`}}function ou(e){let{toolCallId:t}=e,n=xt.get(t);if(n?.state==="finished")return Promise.resolve(n.outcome);let{runs:r}=io(),o=r.get(t);if(o)return o.outcome;if(n?.state==="running")return xt.set(t,{state:"finished",outcome:Ws}),e.onSettled("interrupted",0),Promise.resolve(Ws);let i=new AbortController,s=performance.now();xt.set(t,{state:"running"});let l=Rv({...e,signal:i.signal}).then(c=>(r.delete(t),xt.get(t)?.state!=="running"||(xt.set(t,{state:"finished",outcome:c}),e.onSettled(c.state==="output-available"?"completed":"failed",Math.round(performance.now()-s))),c));return r.set(t,{outcome:l,controller:i}),l}function iu(e){return e===Ws.errorText||e===tu}function Qs(e){return xt.set(e,{state:"stopped"}),io().runs.get(e)?.controller.abort(),tu}function au(e){xt.clear([e]),io().runs.get(e)?.controller.abort()}var he,cu,Xs,yn,Ys,Ri,du,Ci,uu,Zs,Js,Av,lo=Symbol.for("pv"),Ai={},Ii=[],Iv=/^m(i|n|o|s|text|space)$/,Ei=Array.isArray,el=Ii.slice,Kn=Object.assign;function Gn(e){e&&e.parentNode&&e.remove()}function xn(e,t,n){var r,o,i,s={},l=arguments.length;for(i in t)i=="key"?r=t[i]:i=="ref"&&typeof e!="function"?o=t[i]:s[i]=t[i];return l>2&&(s.children=l>3?el.call(arguments,2):n),so(e,s,r,o,null)}function so(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:lo,__v:o||++cu,__i:-1,__u:0};return!o&&he.vnode&&he.vnode(i),i}function pe(e){return e.children}function zt(e,t){this.props=e,this.context=t,this.__g=0}function Pn(e,t){if(t==null)return e.__&&Pn(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!="function"||e.props.__P?null:Pn(e)}function Ev(e){var t,n=e.__v,r=n.__e,o=[],i=[],s=e.__P;s&&((t=Kn({constructor:lo},n)).__v=n.__v+1,he.vnode&&he.vnode(t),nl(s,t,n,e.__n,s.namespaceURI,32&n.__u?[r]:null,o,r||Pn(n),32&n.__u,i),t.__v=n.__v,t.__.__k[t.__i]=t,hu(o,t,i),n.__=n.__e=null,t.__e!=r&&pu(t))}function pu(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),pu(e)}function su(e){(8&e.__g||(e.__g|=8,yn.push(e),Ri++))&&Ys==he.debounceRendering||((Ys=he.debounceRendering)||queueMicrotask)(_u)}function _u(){try{for(var e,t=1;yn.length;)yn.length>t&&yn.sort(du),e=yn.shift(),t=yn.length,8&e.__g&&Ev(e)}finally{(Ri=yn.length)&&(Ys||queueMicrotask)(_u)}}function fu(e,t,n,r,o,i,s,l,c,u,p){var _,d,f,v,m,h,y=r.__k||Ii,P=t.length;for(c=Mv(n,t,y,c,P),_=0;_<P;_++)(f=n.__k[_])!=null&&(d=~f.__i&&y[f.__i]||Ai,f.__i=_,h=nl(e,f,d,o,i,s,l,c,u,p),v=f.__e,(d.ref!=f.ref||8&d.__u)&&(d.ref&&rl(d.ref,null,f,d),f.ref&&p.push(f.ref,f.__c||v,f)),m=m||v,4&f.__u?(c=gu(f,c,e,!d.__v),d.__e&&(d.__e=null)):typeof f.type=="function"&&h!==void 0?c=h:v&&(c=v.nextSibling),f.__u&=-21);return n.__e=m,c}function Mv(e,t,n,r,o){var i,s,l,c,u,p,_,d,f,v=n.length,m=v,h=0,y=0,P=e.__k=Array(o);for(i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s!="object"||s.constructor===String?s=P[i]=so(null,s):Ei(s)?s=P[i]=so(pe,{children:s}):s.constructor===lo&&s.__b?s=P[i]=so(s.type,s.props,s.key,s.ref,s.__v):P[i]=s,c=i+h,s.__=e,s.__b=e.__b+1,l=null,~(u=s.__i=Lv(s,n,c,m))&&(m--,(l=n[u])&&(l.__u|=2)),l&&l.__v?(s.__u|=16,u==c-1?h--:u==c+1?h++:u!=c&&(u>c?h--:h++,y=1)):(~u||(o>v?h--:o<v&&h++),typeof s.type!="function"&&(s.__u|=4))):P[i]=null;if(y){for(p=[],_=[],i=0;i<o;i++)if((s=P[i])&&16&s.__u){for(h=0,d=p.length;h<d;)p[f=h+d>>1]<s.__i?h=f+1:d=f;p[h]=s.__i,_[i]=h+1}for(h=p.length;i--;)_[i]&&(_[i]==h?h--:P[i].__u|=4)}if(m)for(i=0;i<v;i++)!(l=n[i])||2&l.__u||(l.__e==r&&(r=Pn(l)),ol(l,l));return r}function gu(e,t,n,r){var o,i,s,l;if(typeof e.type=="function"){if(e.props.__P)return t;if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&(o[i].__=e,t=gu(o[i],t,n,!1));return t}for(t&&!t.parentNode&&(t=Pn(e))&&!t.parentNode&&(t=null),s=e.__e,l=t;l&&l.nodeType==8;)l=l.nextSibling;for(s!=l&&(!r&&n.moveBefore&&s.parentNode?n.moveBefore(s,t):n.insertBefore(s,t||null)),t=s;(t=t&&t.nextSibling)&&t.nodeType==8&&!t.data.startsWith("$s"););return t}function tl(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(Ei(e)?e.some(function(n){tl(n,t)}):t.push(e)),t}function Lv(e,t,n,r){var o,i=e.key,s=e.type,l=t[n],c=l&&!(2&l.__u);if(l===null&&i==null||c&&i==l.key&&s==l.type)return n;if(r>(c?1:0)){for(o=n-1;o>=0;o--)if((l=t[o])&&!(2&l.__u)&&i==l.key&&s==l.type)return o;for(o=n+1;o<t.length;o++)if((l=t[o])&&!(2&l.__u)&&i==l.key&&s==l.type)return o}return-1}function lu(e,t,n){n==null&&(n=""),t[0]=="-"?e.setProperty(t,n):e[t]=n}function ki(e,t,n,r,o){var i,s;if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||lu(e.style,t);if(n)for(t in n)r&&n[t]==r[t]||lu(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")typeof n!="function"&&(n=null),typeof r!="function"&&(r=null),(e.__e||(e.__e={}))[t]=n,n&&r||(s=Js[t]||(Js[t]=Ov(t)),(e.__a||(e.__a={}))[t]=Zs,i=t!=(t=t.replace(uu,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),n?e.addEventListener(t,s,i):e.removeEventListener(t,s,i));else{if(o=="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{return void(e[t]=n??"")}catch{}if(typeof n=="function")return;n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n)}}function Ov(e){return function(t){var n=this.__e;if(n){if(n=n[e],t[Ci]==null)t[Ci]=Zs++;else if(t[Ci]<this.__a[e])return;return n(he.event?he.event(t):t)}}}function nl(e,t,n,r,o,i,s,l,c,u){var p,_,d,f,v,m,h,y,P,x,C,S,g,b,k,N,I,D,A=t.type;if(t.constructor!==lo)return null;128&n.__u&&(c=32&n.__u,p=n.__c.__z)&&(t.__u|=c,_=i=[],p.nodeType==8?l=Ti(p,i):i.push(p),l=i[0]||l),(p=he.__b)&&p(t);e:if(typeof A=="function"){d=s.length;try{if(y=t.props,P=(p=A.prototype)&&p.render,x=(p=A.contextType)&&r[p.__c],C=p?x?x.props.value:p.__:r,(f=n.__c)?(t.__c=f,2&f.__g&&(f.__g|=1)):(P?t.__c=f=new A(y,C):(t.__c=f=new zt(y,C),f.constructor=A,f.render=$v),x&&x.sub(f),f.state||(f.state={}),f.__n=r,f.__g|=8,f.__h=[],f.__k=[]),P&&(f.__s||(f.__s=f.state),A.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=Kn({},f.__s)),Kn(f.__s,A.getDerivedStateFromProps(y,f.__s)))),v=f.props,m=f.state,f.__v=t,n.__c){if(y!==v&&P&&!A.getDerivedStateFromProps&&f.componentWillReceiveProps&&f.componentWillReceiveProps(y,C),t.__v==n.__v&&!(8&f.__g)||!(4&f.__g)&&f.shouldComponentUpdate&&f.shouldComponentUpdate(y,f.__s,C)===!1){t.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(z){z&&(z.__=t)}),Ii.push.apply(f.__h,f.__k),f.__k=[],f.__h.length&&s.push(f),l=Pn(n);break e}f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,C),P&&f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,m,h)})}else P&&!A.getDerivedStateFromProps&&f.componentWillMount&&f.componentWillMount(),P&&f.componentDidMount&&f.__h.push(f.componentDidMount);f.context=C,f.props=y,f.__P=e,f.__g&=-5,S=he.__r,g=P?25:0;do f.__g&=-9,S&&S(t),p=f.render(f.props,f.state=f.__s,f.context);while(8&f.__g&&++g<25);P&&(Ii.push.apply(f.__h,f.__k),f.__k=[]),f.state=f.__s,f.getChildContext&&(r=Kn({},r,f.getChildContext())),P&&n.__c&&f.getSnapshotBeforeUpdate&&(h=f.getSnapshotBeforeUpdate(v,m)),b=p&&p.type===pe&&p.key==null?p.props.children:p,y.__P&&(p=l,o=(e=y.__P).namespaceURI,c=i=null,n.props&&n.props.__P!=e&&(n.__k.some(function(z){z&&ol(z,z)}),n.__k=null),l=n.__k?Pn(n,0):null),l=fu(e,Ei(b)?b:[b],t,n,r,o,i,s,l,c,u),y.__P&&(t.__e=null,l=p),t.__u&=-161,_&&_.some(Gn),f.__h.length&&s.push(f),1&f.__g&&(f.__g&=-4)}catch(z){if(s.length=d,t.__v=null,c||i)if(z&&z.then){if(t.__u|=128|c,i){for(~(I=i.indexOf(l||void 0))||(I=i.length);(D=i[I-1])&&D.nodeType==8;)I--;for(;I<i.length;I++)if(D=i[I])if(i[I]=null,k){if(D==N)break}else{if(D.nodeType!=8)break;D.data.startsWith("$s")&&(N=Ti(k=D))}}if(!k){for(;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;k=l}(p=Ti(k=t.__c.__z||(t.__c.__z=k)))?(t.__e=k,l=p):t.__e=l,l=l&&l.nextSibling}else i&&i.some(Gn);else t.__e=n.__e;t.__k||(t.__k=n.__k||[]),z&&z.then||mu(t),he.__e(z,t,n)}}else l=t.__e=Nv(n.__e,t,n,r,o,i,s,c,u,e);return(p=he.diffed)&&p(t),l}function Ti(e,t){if(e&&e.nodeType==8&&e.data.startsWith("$s"))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith("$s"))n++;else if(e.data.startsWith("/$s")&&!--n)return e}t&&t.push(e)}}function mu(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(mu))}function hu(e,t,n){for(var r=0;r<n.length;)rl(n[r++],n[r++],n[r++]);he.__c&&he.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){he.__e(i,o.__v)}})}function Nv(e,t,n,r,o,i,s,l,c,u){var p,_,d,f,v,m,h,y,P=n.props||Ai,x=t.props,C=t.type;if(C=="svg"?o="http://www.w3.org/2000/svg":C=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i){for(p=0;p<i.length;p++)if((v=i[p])&&(C?v.localName==C:v.nodeType==3)){e=v,i[p]=null;break}}if(!e){if(y=u.ownerDocument||document,!C)return y.createTextNode(x);e=y.createElementNS(o,C,x.is?x:u),l&&(he.__m&&he.__m(t,i),l=!1),i=null}if(C){if(u=C=="template"&&e.content||e,i=C=="textarea"&&x.defaultValue!=null?null:i&&el.call(u.childNodes),!l&&i)for(P={},p=0;p<e.attributes.length;p++)P[(v=e.attributes[p]).name]=v.value;for(p in P)v=P[p],p=="dangerouslySetInnerHTML"?d=v:p=="children"||p in x||p=="value"&&"defaultValue"in x||p=="checked"&&"defaultChecked"in x||ki(e,p,null,v,o);for(p in x)v=x[p],p=="children"?f=v:p=="dangerouslySetInnerHTML"?_=v:p=="value"?m=v:p=="checked"?h=v:l&&typeof v!="function"||P[p]===v||ki(e,p,v,P[p],o);_?(l||d&&(_.__html==d.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[]):(d&&(e.textContent=""),(C=="foreignObject"||o=="http://www.w3.org/1998/Math/MathML"&&Iv.test(C))&&(o="http://www.w3.org/1999/xhtml"),fu(u,Ei(f)?f:[f],t,n,r,o,i,s,i?i[0]:n.__k&&Pn(n,0),l,c),i&&i.some(Gn)),l&&C!="textarea"||(p="value",C=="progress"&&m==null?e.removeAttribute(p):m==null||m===e[p]&&(C!="progress"||m)||ki(e,p,m,P[p],o),p="checked",h!=null&&h!=e[p]&&ki(e,p,h,P[p],o))}else P===x||l&&e.data==x||(e.data=x);return e}function rl(e,t,n,r){try{typeof e=="function"?t?t.__x=e(t)||1:r&&(r=r.__c||r.__e)&&(t=r.__x)&&(r.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(o){he.__e(o,n)}}function ol(e,t,n){var r,o,i,s;if(he.unmount&&he.unmount(e),!(r=e.ref)||r.current&&r.current!=e.__e||rl(r,null,t,e),r=e.__c){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(l){he.__e(l,t)}r.__P=r.__n=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&ol(r[s],t,typeof e.type!="function"||n&&!e.props.__P);!n&&(r=e.__c)&&(r=r.__z)&&(o=Ti(r,i=[]))&&(r==e.__e&&i.some(Gn),Gn(o),Gn(r)),n||Gn(e.__e),e.__e=e.__c=e.__=null}function $v(e,t,n){return this.constructor(e,n)}function Kt(e,t){var n,r,o,i;he.__&&he.__(e,t),t.nodeType==9&&(t=t.documentElement),r=(n=e&&32&e.__u)?null:t.__k,t.__k=so(pe,{children:[e]}),o=[],i=[],nl(t,t.__k,r||Ai,Ai,t.namespaceURI,r?null:t.firstChild?el.call(t.childNodes):null,o,r?r.__e:t.firstChild,n,i),hu(o,t.__k,i),t.__k.props.children=null}he={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!(1&o.__g)){o.__g|=4;try{if((s=(i=o.constructor)&&i.getDerivedStateFromError)&&o.setState(i.getDerivedStateFromError(e)),o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=1),s&&8&o.__g)return void(o.__g|=2)}catch(l){e=l}}throw Ri=0,e}},cu=0,Xs=function(e){return e!=null&&e.constructor===lo},zt.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=Kn({},this.state)),typeof e=="function"&&(e=e(Kn({},n),this.props)),e&&(Kn(n,e),this.__v&&(t&&this.__k.push(t),su(this)))},zt.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),su(this))},zt.prototype.render=pe,yn=[],Ri=0,du=function(e,t){return e.__v.__b-t.__v.__b},Ci=Symbol(),uu=/(PointerCapture)$|Capture$/i,Zs=0,Js={},Av=0;function Lt(){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,Dv(t.subarray(6)),t[6]=(t[6]??0)&15|112,t[8]=(t[8]??0)&63|128;let n=Array.from(t,r=>r.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 Dv(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 Sn=ee.scope("persistence");function wn(e,t=hi,n){let r=n?`${e}.${n}`:e,o=`${L.cssPrefix}.${r}.storageVersion`,i=t.get(o)??void 0,s=i?`.v${i}`:"",l=`${L.cssPrefix}.${r}${s}`,c=`${L.cssPrefix}${s}.visitorId`,u=`${L.cssPrefix}${s}.lastUserSub`,p=`${l}.conversationId`,_=`${l}.userPrefs`,d=`${l}.panelOpen`,f=`${l}.panelSize`,v=`${l}.calloutDismissed`,m=`${l}.sidebarCollapsed`,h=`${l}.activeModule`,y=`${l}.seenNewsId`,P=`${l}.historyCount`,x=`${l}.loginReturn`,C=`${l}.loginPromptDismissedIn`,S={getVisitorId(){let g=t.get(c);if(g)return g;let b=Lt();return t.set(c,b),b},loadLastUserSub(){return t.get(u)??void 0},saveLastUserSub(g){t.set(u,g)},loadConversationId(){return t.get(p)??void 0},saveConversationId(g){Sn.trace("saveConversationId",{id:g,scope:r}),g?t.set(p,g):t.remove(p)},loadDraft(g){return t.get(`${l}.draft.${g}`)??""},saveDraft(g,b){let k=`${l}.draft.${g}`;b?t.set(k,b):t.remove(k)},loadMessageQueue(g){let b=t.get(`${l}.messageQueue.${g}`);if(!b)return[];try{let k=JSON.parse(b);return!Array.isArray(k)||!k.every(Bv)?[]:k}catch(k){return Sn.warn("loadMessageQueue parse failed",{error:k}),[]}},saveMessageQueue(g,b){let k=`${l}.messageQueue.${g}`;if(b.length===0){t.remove(k);return}try{t.set(k,JSON.stringify(b))}catch(N){Sn.warn("saveMessageQueue serialise failed",{error:N})}},loadUserPrefs(){let g=t.get(_);if(!g)return{};try{return il(JSON.parse(g))}catch(b){return Sn.warn("loadUserPrefs parse failed",{error:b}),{}}},saveUserPrefs(g){try{t.set(_,JSON.stringify(g))}catch(b){Sn.warn("saveUserPrefs serialise failed",{error:b})}},patchUserPrefs(g){let b=S.loadUserPrefs();S.saveUserPrefs({...b,...g})},loadPanelOpen(){let g=t.get(d);return g==="1"?!0:g==="0"?!1:null},savePanelOpen(g){t.set(d,g?"1":"0")},loadPanelSize(){let g=t.get(f);return g==="normal"||g==="expanded"||g==="fullscreen"?g:null},savePanelSize(g){t.set(f,g)},loadCalloutDismissed(g){if(!g)return!1;let b=t.get(v);return!!b&&b===g},saveCalloutDismissed(g){g?t.set(v,g):t.remove(v)},loadSidebarCollapsed(){let g=t.get(m);return g==="1"?!0:g==="0"?!1:null},saveSidebarCollapsed(g){t.set(m,g?"1":"0")},loadActiveModule(){return t.get(h)||null},saveActiveModule(g){t.set(h,g)},loadSeenNewsId(){return t.get(y)||null},saveSeenNewsId(g){t.set(y,g)},loadHistoryCount(){let g=t.get(P);if(!g)return null;let b=Number.parseInt(g,10);return Number.isFinite(b)&&b>=0?b:null},saveHistoryCount(g){t.set(P,String(g))},rememberStorageVersion(g){g&&g!==t.get(o)&&(Sn.debug("rememberStorageVersion (force-reset on next load)",{version:g}),t.set(o,g))},saveLoginReturn(g){Fn.set(x,JSON.stringify(g))},takeLoginReturn(){let g=Fn.get(x);if(g){Fn.remove(x);try{let b=JSON.parse(g);return Mi(b)&&typeof b.conversationId=="string"&&b.conversationId&&typeof b.draft=="string"?{conversationId:b.conversationId,draft:b.draft}:void 0}catch(b){Sn.warn("takeLoginReturn parse failed",{error:b});return}}},loadLoginPromptDismissedIn(){return Fn.get(C)??void 0},dismissLoginPromptIn(g){Fn.set(C,g)},clearConversation(){t.remove(p)},reset(){let g=t.get(p);g&&(t.remove(`${l}.draft.${g}`),t.remove(`${l}.messageQueue.${g}`));for(let b of[x,C])Fn.remove(b);for(let b of[c,u,p,_,f,v,m,h,y,P])t.remove(b);Sn.info("reset: forgot the visitor",{scope:r})}};return S}function Mi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bv(e){return Mi(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.text=="string"}function il(e){if(!Mi(e))return{};let t={};return typeof e.locale=="string"&&(t.locale=e.locale),typeof e.soundMuted=="boolean"&&(t.soundMuted=e.soundMuted),(e.themeMode==="auto"||e.themeMode==="light"||e.themeMode==="dark")&&(t.themeMode=e.themeMode),(e.textSize==="small"||e.textSize==="normal"||e.textSize==="large")&&(t.textSize=e.textSize),Mi(e.widgetSize)&&typeof e.widgetSize.width=="number"&&typeof e.widgetSize.height=="number"&&(t.widgetSize={width:e.widgetSize.width,height:e.widgetSize.height}),t}var Tr="6.15.0";var Uv="1",vu=60,zv=2e3,al={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:()=>{},toolResult:()=>{},toolDecision:e=>({approved:e.approved}),hostEvent:e=>({name:e.name,data:e.data&&JSON.stringify(e.data)}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,count:e.count}),contentOpen:e=>({contentId:e.contentId,contentCollectionId:e.contentCollectionId}),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 Fv(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Hv(){return location.origin+location.pathname}function qv(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function bu(e,t){let n=Math.random(),r=0,o=0,i=new Set;function s(_,d){let{tracking:f,publicKey:v,aiAgentDeploymentId:m,mode:h,themeMode:y}=t.getOptions();if(!f.enabled||Fv()||n>=f.sampleRate)return;let P=performance.now();if(P-r>6e4&&(r=P,o=0),++o>vu)return;let x=new URLSearchParams;x.set("v",Uv),x.set("_ev",Tr),x.set("e",_),f.token&&x.set("tk",f.token),v&&x.set("pk",v),m&&x.set("dep",m),x.set("vid",t.getVisitorId());let C=t.getConversationId();C&&x.set("cid",C),x.set("url",Hv());let S=qv();S&&x.set("ref",S),x.set("sw",String(screen.width)),x.set("sh",String(screen.height)),x.set("vw",String(innerWidth)),x.set("vh",String(innerHeight)),x.set("dpr",String(devicePixelRatio)),x.set("lang",navigator.language);try{x.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(x.set("m",h),x.set("th",y),d)for(let[N,I]of Object.entries(d))I!==void 0&&x.set(N,String(I));x.set("ts",String(Date.now()));let g=`${f.endpoint}?${x}`;if(g.length>zv)return;let b=new Image(1,1);i.add(b);function k(){return i.delete(b)}b.addEventListener("load",k,{once:!0}),b.addEventListener("error",k,{once:!0}),b.src=g}let l=[];function c(_,d){if(l&&_!=="handshake"){l.length<vu&&l.push([_,d]);return}let f=l??[];l=void 0;for(let[v,m]of f)s(v,m);s(_,d)}function u(_,d){return al[_]?.(d)}let p=Object.keys(al).filter(_=>Object.hasOwn(al,_)).map(_=>e.on(_,d=>c(_,u(_,d))));return()=>{for(let _ of p)_();i.clear()}}var yu=`.__P__-generative-ui{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--__P__-space-3);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-generative-ui p{margin:0}.__P__-generative-ui-grid-container{container:__P__-generative-ui-grid / inline-size;min-width:0}.__P__-generative-ui-grid{--__P__-cols: 1;display:flex;flex-wrap:wrap;gap:16px}.__P__-generative-ui-cell{display:flex;flex-direction:column;flex:1 1 calc((100% + 16px) * min(var(--__P__-span),var(--__P__-cols)) / var(--__P__-cols) - 16.5px);align-self:flex-start;min-width:0;gap:16px}.__P__-generative-ui-grid[data-equal-heights]>.__P__-generative-ui-cell{align-self:stretch}.__P__-generative-ui-grid[data-equal-heights]>.__P__-generative-ui-cell>:only-child{flex:1}@container __P__-generative-ui-grid (min-width: 496px){.__P__-generative-ui-grid{--__P__-cols: var(--__P__-cols-2)}}@container __P__-generative-ui-grid (min-width: 752px){.__P__-generative-ui-grid{--__P__-cols: var(--__P__-cols-3)}}@container __P__-generative-ui-grid (min-width: 1008px){.__P__-generative-ui-grid{--__P__-cols: var(--__P__-cols-4)}}.__P__-generative-ui section{display:flex;flex-direction:column;gap:var(--__P__-space-2);padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);min-width:0}.__P__-generative-ui-metric{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);font-size:1.6em;font-weight:700;font-variant-numeric:tabular-nums}.__P__-generative-ui-metric svg{flex:none;width:80px;height:24px;color:var(--__P__-accent)}.__P__-generative-ui-change{align-self:flex-start;padding:2px var(--__P__-space-2);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;font-variant-numeric:tabular-nums}.__P__-generative-ui-change[data-tone=good]{color:var(--__P__-fg);background:color-mix(in oklch,var(--__P__-success) 18%,transparent)}.__P__-generative-ui-change[data-tone=bad]{color:var(--__P__-danger-text);background:var(--__P__-danger-bg)}.__P__-generative-ui-table-card{container:__P__-generative-ui-table / inline-size}.__P__-generative-ui-table{overflow-x:auto}@container __P__-generative-ui-table (max-width: 639.98px){.__P__-generative-ui-table :is(table,tbody,tr,td){display:block}.__P__-generative-ui-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.__P__-generative-ui-table tr{margin-bottom:var(--__P__-space-2);padding:var(--__P__-space-1) var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm)}.__P__-generative-ui-table td,.__P__-generative-ui-table td[data-numeric=true]{display:flex;justify-content:space-between;gap:var(--__P__-space-3);padding:var(--__P__-space-1) 0;border:0;text-align:end}.__P__-generative-ui-table td:before{content:attr(data-label);color:var(--__P__-fg-muted);text-align:start}}.__P__-generative-ui table{width:100%;border-collapse:collapse;white-space:normal}.__P__-generative-ui caption{text-align:start;font-weight:600;padding-bottom:var(--__P__-space-2)}.__P__-generative-ui th,.__P__-generative-ui td{text-align:start;padding:var(--__P__-space-2);border-bottom:1px solid var(--__P__-border)}.__P__-generative-ui :is(th,td)[data-numeric=true]{text-align:end;font-variant-numeric:tabular-nums}.__P__-generative-ui th button{padding:0;border:0;background:none;color:inherit;font:inherit;font-weight:600;text-align:inherit;cursor:pointer}.__P__-generative-ui th button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-generative-ui th[aria-sort=ascending] button:after{content:" \\2191"}.__P__-generative-ui th[aria-sort=descending] button:after{content:" \\2193"}.__P__-generative-ui-chart{display:block;width:100%;max-height:320px;color:var(--__P__-accent)}.__P__-generative-ui-axis line{stroke:var(--__P__-border)}.__P__-generative-ui-axis text{fill:var(--__P__-fg-muted);font-size:9px}.__P__-generative-ui .__P__-generative-ui-legend{display:flex;flex-wrap:wrap;gap:var(--__P__-space-1) var(--__P__-space-3);margin:0;padding:0;list-style:none;color:var(--__P__-accent);font-size:var(--__P__-text-xs)}.__P__-generative-ui-legend li{display:flex;align-items:center;gap:6px;margin:0}.__P__-generative-ui-legend li:before{content:"";width:10px;height:10px;border-radius:3px;background:currentColor}.__P__-generative-ui-legend span{color:var(--__P__-fg)}.__P__-generative-ui-carousel{display:flex;gap:var(--__P__-space-3);margin:0 calc(var(--__P__-space-1) * -1);padding:0 var(--__P__-space-1) var(--__P__-space-2);overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:var(--__P__-space-1);scrollbar-width:thin;min-width:0}.__P__-generative-ui-card:has(>.__P__-generative-ui-photo),.__P__-generative-ui-offer{--__P__-card-width: 280px}.__P__-generative-ui-flight{--__P__-card-width: 300px}.__P__-generative-ui-sheet{--__P__-card-width: 480px}.__P__-generative-ui>section,.__P__-generative-ui-carousel>[role=listitem]>section{width:var(--__P__-card-width, 100%);max-width:100%}.__P__-generative-ui-cell>section{max-width:var(--__P__-card-width, 100%)}.__P__-generative-ui-carousel>[role=listitem]{display:flex;flex:none;max-width:100%;scroll-snap-align:start}.__P__-generative-ui-offer{overflow:hidden}.__P__-generative-ui-footer{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin-top:auto}.__P__-generative-ui-hint{min-height:1.4em;line-height:1.4;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-photo{position:relative;display:block;flex:none;width:calc(100% + 2 * var(--__P__-space-3));aspect-ratio:4 / 3;margin:calc(var(--__P__-space-3) * -1) calc(var(--__P__-space-3) * -1) var(--__P__-space-1);overflow:hidden;background:var(--__P__-hover)}.__P__-generative-ui-photo[data-wide=true]{aspect-ratio:16 / 9}.__P__-generative-ui-badges{display:flex;flex-wrap:wrap;gap:var(--__P__-space-1)}.__P__-generative-ui-photo>.__P__-generative-ui-badges{position:absolute;top:var(--__P__-space-2);inset-inline-start:var(--__P__-space-2)}.__P__-generative-ui-photo .__P__-generative-ui-pill{background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:0 0 0 1px var(--__P__-border)}.__P__-generative-ui-thumb{display:block;flex:0 0 auto;width:48px;height:48px;overflow:hidden;border-radius:var(--__P__-radius-sm);background:var(--__P__-hover)}.__P__-generative-ui-photo img,.__P__-generative-ui-thumb img{display:block;width:100%;max-width:none;height:100%;object-fit:cover}.__P__-generative-ui-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-generative-ui-stars{color:var(--__P__-warning);font-size:var(--__P__-text-xs);letter-spacing:1px}.__P__-generative-ui .__P__-generative-ui-details{display:grid;gap:2px;margin:0;padding:0;list-style:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-details li{display:flex;gap:6px;margin:0}.__P__-generative-ui-details li:before{content:"\\2022";flex:none}.__P__-generative-ui-leg{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}.__P__-generative-ui-leg+.__P__-generative-ui-leg{padding-top:var(--__P__-space-2);border-top:1px solid var(--__P__-border)}.__P__-generative-ui-leg-times{display:flex;align-items:center;gap:var(--__P__-space-1)}.__P__-generative-ui-leg-times>span:not(.__P__-generative-ui-leg-path){display:grid;flex:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-leg-times>span:last-child{text-align:end}.__P__-generative-ui-leg-times strong{color:var(--__P__-fg);font-size:1rem;font-variant-numeric:tabular-nums;white-space:nowrap}.__P__-generative-ui-leg-times sup{font-size:.6em;color:var(--__P__-fg-muted)}.__P__-generative-ui-leg-path{flex:1;min-width:0;padding-bottom:4px;border-bottom:1px solid var(--__P__-border-strong);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);line-height:1.3;text-align:center;overflow-wrap:normal}.__P__-generative-ui .__P__-generative-ui-itinerary{display:grid;gap:var(--__P__-space-2);margin:0;padding:0;list-style:none}.__P__-generative-ui-itinerary li{display:grid;margin:0;padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-generative-ui-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.35}:is(.__P__-generative-ui-carousel,.__P__-generative-ui-cell) .__P__-generative-ui-title{min-height:2.7em}.__P__-generative-ui a{color:inherit}.__P__-generative-ui .__P__-generative-ui-title a,.__P__-generative-ui .__P__-generative-ui-lines a,.__P__-generative-ui .__P__-generative-ui-actions>a{text-decoration:none}.__P__-generative-ui .__P__-generative-ui-title a:hover,.__P__-generative-ui .__P__-generative-ui-lines span>a:hover{text-decoration:underline}.__P__-generative-ui-pill{display:inline-flex;align-items:center;padding:2px var(--__P__-space-2);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-muted{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-star{color:var(--__P__-warning)}.__P__-generative-ui-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 var(--__P__-space-2);font-variant-numeric:tabular-nums}.__P__-generative-ui-price strong{font-size:1.1em}.__P__-generative-ui-price s{color:var(--__P__-fg-muted)}.__P__-generative-ui-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;color:var(--__P__-fg-muted)}.__P__-generative-ui-option{display:grid;gap:var(--__P__-space-1);min-width:0;margin:0;padding:0;border:0}.__P__-generative-ui-option legend{padding:0 0 var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-option div{display:flex;gap:6px;min-width:0;margin:-4px;padding:4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.__P__-generative-ui-option div::-webkit-scrollbar{display:none}.__P__-generative-ui-option div[data-cut-end]{mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div[data-cut-start]{mask-image:linear-gradient(to right,transparent,#000 32px)}.__P__-generative-ui-option div[data-cut-start][data-cut-end]{mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div:dir(rtl)[data-cut-end]{mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div:dir(rtl)[data-cut-start]{mask-image:linear-gradient(to left,transparent,#000 32px)}.__P__-generative-ui-option div:dir(rtl)[data-cut-start][data-cut-end]{mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option button{flex:0 0 auto;min-height:32px;padding:0 10px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-generative-ui-option button:hover{border-color:var(--__P__-border-strong)}.__P__-generative-ui-option button[aria-pressed=true]{border-color:var(--__P__-accent);box-shadow:inset 0 0 0 1px var(--__P__-accent);font-weight:600}.__P__-generative-ui-option button:disabled{color:var(--__P__-fg-muted);text-decoration:line-through;opacity:.6;cursor:not-allowed}.__P__-generative-ui-actions{display:flex;flex-wrap:wrap;gap:var(--__P__-space-2);margin-top:auto;padding-top:var(--__P__-space-1)}.__P__-generative-ui-actions:not([data-small=true])>*{flex:1 1 auto}.__P__-generative-ui-actions>*{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:none;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-generative-ui-actions>*>span{overflow:hidden;text-overflow:ellipsis}.__P__-generative-ui-actions[data-small=true]>*{min-height:28px;padding:0 var(--__P__-space-2);font-size:var(--__P__-text-xs)}.__P__-generative-ui-actions>:hover{border-color:var(--__P__-border-strong)}.__P__-generative-ui-actions>[data-primary=true]{border-color:var(--__P__-accent);background:var(--__P__-accent);color:var(--__P__-on-accent)}.__P__-generative-ui-actions>:focus-visible,.__P__-generative-ui-option button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-generative-ui-actions>:disabled{border-color:var(--__P__-border);background:var(--__P__-hover);color:var(--__P__-fg-muted);cursor:not-allowed}.__P__-generative-ui .__P__-generative-ui-lines{display:grid;margin:0;padding:0;list-style:none}.__P__-generative-ui .__P__-generative-ui-lines li{display:flex;margin:0;gap:var(--__P__-space-3);padding:var(--__P__-space-2) 0;border-bottom:1px solid var(--__P__-border)}.__P__-generative-ui .__P__-generative-ui-lines li:first-child{padding-top:0}.__P__-generative-ui-lines li>div{display:grid;flex:1;gap:2px;min-width:0}.__P__-generative-ui-line-head{display:flex;align-items:baseline;gap:var(--__P__-space-3)}.__P__-generative-ui-line-head>span{display:-webkit-box;flex:1;min-width:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.__P__-generative-ui-line-head>strong{flex:none;font-variant-numeric:tabular-nums}.__P__-generative-ui-totals{display:grid;gap:var(--__P__-space-1);margin:0;font-variant-numeric:tabular-nums}.__P__-generative-ui-totals div{display:flex;justify-content:space-between;gap:var(--__P__-space-3);color:var(--__P__-fg-muted)}.__P__-generative-ui-totals div:last-child{padding-top:var(--__P__-space-1);color:var(--__P__-fg);font-weight:700}.__P__-generative-ui-totals dt{min-width:0}.__P__-generative-ui-totals dd{flex:none;margin:0;white-space:nowrap}.__P__-generative-ui-notice{padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover)}.__P__-generative-ui-notice[data-severity=warning]{color:var(--__P__-fg);background:color-mix(in oklch,var(--__P__-warning) 16%,transparent)}.__P__-generative-ui-notice[data-severity=error]{color:var(--__P__-danger-text);background:var(--__P__-danger-bg)}.__P__-generative-ui .__P__-generative-ui-timeline{display:grid;gap:var(--__P__-space-2);margin:0;padding:0;list-style:none}.__P__-generative-ui .__P__-generative-ui-timeline li{display:flex;margin:0;align-items:baseline;gap:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-generative-ui-timeline li:before{content:"";flex:0 0 auto;width:8px;height:8px;border:2px solid var(--__P__-border-strong);border-radius:50%}.__P__-generative-ui-timeline li[data-done=true]{color:var(--__P__-fg);font-weight:600}.__P__-generative-ui-timeline li[data-done=true]:before{border-color:var(--__P__-accent);background:var(--__P__-accent)}.__P__-generative-ui-timeline li>:first-child{flex:1}@media(pointer:coarse){.__P__-generative-ui-actions>*{min-height:44px}.__P__-generative-ui-actions>*>span{overflow:hidden;text-overflow:ellipsis}.__P__-generative-ui-actions[data-small=true]>*{min-height:32px}.__P__-generative-ui-option button{min-height:40px}}
|
|
3
|
-
`;var
|
|
4
|
-
`;var xu=`.__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:18px;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;width:max-content;max-width:min(260px,calc(100vw - 100% - var(--__P__-callout-gap) - 32px));white-space:normal;overflow-wrap:anywhere}.__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)}.__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{flex-shrink:0;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;overflow:clip;overscroll-behavior:none;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:var(--__P__-visual-viewport-top, 0px) 0 auto;height:var(--__P__-visual-viewport-height, 100dvh);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:100%;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}: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: clamp(440px, 32vw, 640px);--__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;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:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:100%;min-width:min(var(--__P__-resize-min-w, 0px),calc(100vw - var(--__P__-inset-x) * 2));max-width:var(--__P__-resize-max-w, none);max-height:none;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}}@media(max-width:640px){:host([data-mode="open"][data-position]) .__P__-anchor,:host([data-mode="expanded"][data-position]) .__P__-anchor,:host([data-mode="drawer"][data-position]) .__P__-anchor,:host([data-mode="modal"][data-position]) .__P__-anchor{inset:var(--__P__-visual-viewport-top, 0px) 0 auto;align-items:stretch;width:auto;height:var(--__P__-visual-viewport-height, 100dvh);padding:0}:host([data-mode="open"][data-position]) .__P__-panel,:host([data-mode="expanded"][data-position]) .__P__-panel,:host([data-mode="drawer"][data-position]) .__P__-panel,:host([data-mode="modal"][data-position]) .__P__-panel{width:100vw;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;translate:none}:host([data-mode="modal"]){background:none;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__-header[data-variant=accent]{background:var(--__P__-accent);color:var(--__P__-on-accent);border-bottom-color:transparent}.__P__-header[data-variant=accent]>h1,.__P__-header[data-variant=accent] .__P__-agent-meta strong,.__P__-header[data-variant=accent] .__P__-agent-sub span,.__P__-header[data-variant=accent] .__P__-agent-ticket,.__P__-header[data-variant=accent] .__P__-agent-ticket:hover,.__P__-header[data-variant=accent]>.__P__-icon-btn,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn{color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-header[data-variant=accent]>.__P__-icon-btn:hover,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn:hover,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn:hover{background:color-mix(in oklch,var(--__P__-on-accent) 16%,transparent);color:var(--__P__-on-accent)}.__P__-header[data-variant=accent]>.__P__-icon-btn:active,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn:active,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn:active{background:color-mix(in oklch,var(--__P__-on-accent) 24%,transparent)}.__P__-header[data-variant=accent] .__P__-agent-avatar{background:color-mix(in oklch,var(--__P__-on-accent) 18%,transparent);color:var(--__P__-on-accent)}.__P__-header[data-variant=accent] .__P__-agent-avatar:after{border-color:var(--__P__-accent)}.__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:var(--__P__-radius-md);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);flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;border-radius:inherit;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__-agent-sub{display:flex;gap:4px;min-width:0}.__P__-agent-sub button+span:before{content:"\\b7\\a0"}.__P__-agent-ticket{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);cursor:copy}.__P__-agent-ticket:hover{color:var(--__P__-fg)}.__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[data-cut-end=true]{mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}.__P__-suggestions[data-cut-start=true]{mask-image:linear-gradient(to right,transparent,#000 32px)}.__P__-suggestions[data-cut-start=true][data-cut-end=true]{mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}:host([dir="rtl"]) .__P__-suggestions[data-cut-end=true]{mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}:host([dir="rtl"]) .__P__-suggestions[data-cut-start=true]{mask-image:linear-gradient(to left,transparent,#000 32px)}:host([dir="rtl"]) .__P__-suggestions[data-cut-start=true][data-cut-end=true]{mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__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;position:relative;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 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:0;bottom:14px;z-index:2;margin-inline:auto;display: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;overflow-anchor:none}.__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__-load-previous,.__P__-history-more{display:flex;justify-content:center}.__P__-load-previous button,.__P__-history-more button{border:0;padding:4px 8px;background:transparent;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;cursor:pointer}.__P__-load-previous button:hover,.__P__-history-more button:hover{text-decoration:underline}.__P__-load-previous button:focus-visible,.__P__-history-more button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-load-previous button:disabled,.__P__-history-more button:disabled{cursor:wait;opacity:.6}.__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-body{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--__P__-space-3) 6px;min-width:0}.__P__-bubble-body>*{flex:1 0 100%;min-width:0}.__P__-bubble-body>.__P__-source,.__P__-bubble-body>.__P__-typing{flex:0 1 auto}.__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,.__P__-steps){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui,.__P__-steps) .__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 :not(pre)>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__-file-image,.__P__-file-chip{border-radius:var(--__P__-radius-sm);color:inherit;text-decoration:none}.__P__-file-image{display:block;width:fit-content;max-width:min(100%,240px);overflow:hidden}.__P__-file-image img{max-height:240px;object-fit:cover}.__P__-file-chip{display:flex;align-items:center;gap:var(--__P__-space-2);max-width:min(100%,280px);padding:var(--__P__-space-2);border:1px solid color-mix(in srgb,currentColor 18%,transparent);background:color-mix(in srgb,currentColor 5%,transparent);transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-file-chip:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.__P__-file-image:focus-visible,.__P__-file-chip:focus-visible{outline:2px solid currentColor;outline-offset:2px}.__P__-file-chip-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:var(--__P__-radius-sm);background:color-mix(in srgb,currentColor 10%,transparent)}.__P__-file-chip-text{display:grid;min-width:0;line-height:1.35}.__P__-file-chip-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-file-chip-meta{font-size:var(--__P__-text-xs);opacity:.75}.__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__-chat-notice{padding:0 var(--__P__-space-3);text-align:center;font-size:var(--__P__-text-xs);line-height:1.5;color:var(--__P__-fg-muted)}.__P__-chat-notice .__P__-md p{margin:0}.__P__-chat-notice .__P__-md a{color:var(--__P__-accent-fg)}.__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__-steps{min-width:0;font-size:var(--__P__-text-sm)}.__P__-steps-head,.__P__-steps-row-head{display:inline-flex;align-items:center;gap:var(--__P__-space-2);max-width:100%;min-width:0;min-height:28px;padding:0;border:0;background:none;color:var(--__P__-fg-muted);font:inherit;text-align:start;cursor:pointer;-webkit-tap-highlight-color:transparent}.__P__-steps-head:hover,.__P__-steps-row-head:hover{color:var(--__P__-fg)}.__P__-steps-head:focus-visible,.__P__-steps-row-head:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-steps-icon,.__P__-steps-row-icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:16px;height:16px}.__P__-steps-icon svg,.__P__-steps-row-icon svg{width:14px;height:14px}.__P__-steps-label,.__P__-steps-row-label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-steps-sep{margin-inline:var(--__P__-space-1)}.__P__-steps-name .__P__-steps-count{margin-inline-start:var(--__P__-space-1)}.__P__-steps-count,.__P__-steps-failed,.__P__-steps-denied,.__P__-steps-time{flex:none;font-variant-numeric:tabular-nums}.__P__-steps-failed{color:var(--__P__-danger-text)}.__P__-steps-denied{color:var(--__P__-fg-muted)}.__P__-steps-decision{display:inline-flex;flex:none;align-items:center;gap:var(--__P__-space-1);font-variant-numeric:tabular-nums;color:var(--__P__-success)}.__P__-steps-decision[data-approved=false]{color:var(--__P__-warning)}.__P__-steps-decision svg{width:14px;height:14px}.__P__-steps-row-error{margin:0;color:var(--__P__-danger-text)}.__P__-steps-chevron{display:inline-flex;flex:none;width:16px;height:16px;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-steps-chevron svg{width:16px;height:16px}.__P__-steps-chevron[data-open=true]{transform:rotate(180deg)}.__P__-steps-list{position:relative;display:flex;flex-direction:column;gap:var(--__P__-space-1);margin:var(--__P__-space-1) 0 0;padding:0;list-style:none}.__P__-steps-list:before{content:"";position:absolute;inset-block:0;inset-inline-start:7px;width:2px;border-radius:1px;background:var(--__P__-border)}.__P__-steps-row{position:relative;display:grid;grid-template-columns:16px minmax(0,1fr);column-gap:var(--__P__-space-2);align-items:start}.__P__-steps-row .__P__-steps-row-icon{margin-block:6px;border-radius:999px;background:var(--__P__-bubble-assistant);color:var(--__P__-fg-muted)}.__P__-steps-row[data-status=error] .__P__-steps-row-icon{color:var(--__P__-danger-text)}.__P__-steps-row-main{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.__P__-steps-row-name{color:var(--__P__-fg);font-weight:500}.__P__-steps-row-system,.__P__-steps-row-summary{margin-inline-start:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-steps-row-body{grid-column:2;display:flex;flex-direction:column;gap:var(--__P__-space-2);width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__P__-steps-row[data-standalone=true]>:is(.__P__-steps-row-body,.__P__-steps-thought-text){grid-column:1 / -1}.__P__-steps-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease-out}.__P__-steps-body[data-open=true]{grid-template-rows:1fr}.__P__-steps-body-inner{min-height:0;overflow:hidden}.__P__-steps-live{min-width:0;overflow:hidden;text-overflow:ellipsis;background:linear-gradient(90deg,var(--__P__-fg-muted) 0%,var(--__P__-fg) 50%,var(--__P__-fg-muted) 100%) 0 0 / 200% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;animation:__P__-steps-shimmer 2s linear infinite}@keyframes __P__-steps-shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-steps-body,.__P__-steps-chevron{transition:none}.__P__-steps-live{background:none;color:var(--__P__-fg-muted);animation:none}}.__P__-steps-thought,.__P__-steps-stopped-label{color:var(--__P__-fg-muted)}.__P__-steps-thought-label,.__P__-steps-stopped-label{display:inline-flex;align-items:center;min-height:28px}.__P__-steps-thought-text{grid-column:2;width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__P__-reasoning-body{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%;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__-compaction-status{width:100%;padding:10px 14px;justify-content:center;font-size:var(--__P__-text-xs)}.__P__-message-queue{display:flex;max-height:112px;flex-direction:column;gap:var(--__P__-space-1);overflow-y:auto}.__P__-attachment-chip.__P__-queued-message{width:100%;max-width:none}.__P__-queued-text{min-width:0;flex:1}.__P__-composer-row{--__P__-composer-line-height: 40px;display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;--__P__-textarea-base-height: 40px;height:var(--__P__-textarea-base-height);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)}.__P__-textarea:focus-visible{outline:none;border-color:var(--__P__-focus)}.__P__-textarea:placeholder-shown{white-space:nowrap;overflow:hidden}.__P__-textarea::placeholder{text-overflow:ellipsis}@media(pointer:coarse){.__P__-textarea{--__P__-textarea-base-height: 44px}.__P__-composer-row{--__P__-composer-line-height: 44px}.__P__-composer-row>.__P__-send{margin-block-end:2px}}.__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;margin-block-end:calc((var(--__P__-composer-line-height) - 32px) / 2)}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{position:relative;display:inline-flex;align-items:center;gap:8px;padding:5px;border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:220px;overflow:hidden}.__P__-attachment-chip[data-upload=error]{border-color:color-mix(in oklab,var(--__P__-danger) 45%,transparent);background:color-mix(in oklab,var(--__P__-danger) 6%,var(--__P__-bg-elevated))}.__P__-attachment-thumb{flex-shrink:0;width:32px;height:32px;border-radius:var(--__P__-radius-sm);object-fit:cover;background:var(--__P__-border);display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-text{display:flex;flex-direction:column;min-width:0;line-height:1.3}.__P__-attachment-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--__P__-fg);font-weight:500}.__P__-attachment-meta{display:inline-flex;align-items:center;gap:4px;color:var(--__P__-fg-muted);font-variant-numeric:tabular-nums;white-space:nowrap}.__P__-attachment-meta svg{flex:none;width:12px;height:12px}.__P__-attachment-chip[data-upload=error] .__P__-attachment-meta{color:var(--__P__-danger)}.__P__-attachment-chip[data-upload=done] .__P__-attachment-meta svg{color:var(--__P__-success)}.__P__-attachment-progress{position:absolute;inset-inline:0;bottom:0;height:2px;background:color-mix(in oklab,var(--__P__-accent) 15%,transparent)}.__P__-attachment-progress>span{display:block;height:100%;background:var(--__P__-accent);transition:width var(--__P__-dur-quick) var(--__P__-ease)}.__P__-attachment-remove{flex-shrink:0;width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove svg{width:14px;height:14px}.__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%,color-mix(in srgb,var(--__P__-bg) 92%,transparent));display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;text-align:center;padding:16px;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)}.__P__-dropzone-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:999px;background:color-mix(in srgb,var(--__P__-accent) 14%,transparent)}.__P__-dropzone-icon svg{width:22px;height:22px}.__P__-dropzone[data-state=reject]{border-color:var(--__P__-danger);background:color-mix(in srgb,var(--__P__-danger) 8%,color-mix(in srgb,var(--__P__-bg) 92%,transparent));color:var(--__P__-danger)}.__P__-dropzone[data-state=reject] .__P__-dropzone-icon{background:color-mix(in srgb,var(--__P__-danger) 14%,transparent)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{display:flex;align-items:center;gap:var(--__P__-space-2);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)}.__P__-error-icon{display:inline-flex;flex:none;width:16px;height:16px;color:var(--__P__-danger-text)}.__P__-error-icon svg{width:16px;height:16px}.__P__-error-text{min-width:0}.__P__-error-retry{flex:none;margin-inline-start:auto;min-height:28px;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__-error-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__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-card>[role=listitem]{display:flex;flex-direction:column}.__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-card>*+*{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:var(--__P__-radius-md);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-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:var(--__P__-radius-md)}.__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__-transcript-layer{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-4);border-radius:inherit;overflow:hidden}.__P__-transcript-backdrop{position:absolute;inset:0;background:var(--__P__-backdrop);animation:__P__-transcript-fade var(--__P__-dur-base) var(--__P__-ease-out)}.__P__-transcript-sheet{position:relative;display:flex;flex-direction:column;gap:var(--__P__-space-3);box-sizing:border-box;width:100%;max-width:360px;padding:var(--__P__-space-4);border-radius:var(--__P__-radius-lg);background:var(--__P__-bg);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel),inset 0 0 0 1px var(--__P__-border);animation:__P__-transcript-in var(--__P__-dur-base) var(--__P__-ease-out)}.__P__-transcript-sheet-head{display:flex;align-items:center;gap:var(--__P__-space-2);margin-block:-4px;margin-inline-end:-6px}.__P__-transcript-sheet-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:28px;block-size:28px;flex-shrink:0;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-transcript-sheet-icon svg{inline-size:16px;block-size:16px}.__P__-transcript-sheet-title{flex:1;min-width:0;margin:0;font-size:var(--__P__-text-base);font-weight:600;text-wrap:balance}.__P__-transcript-sheet-form{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-transcript-sheet-text{margin:0;font-size:var(--__P__-text-sm);line-height:1.45;color:var(--__P__-fg-muted);overflow-wrap:anywhere;text-wrap:pretty}.__P__-transcript-sheet-sent{display:flex;align-items:flex-start;gap:var(--__P__-space-2);color:var(--__P__-fg)}.__P__-transcript-sheet-sent svg{flex-shrink:0;inline-size:18px;block-size:18px;color:var(--__P__-success)}.__P__-transcript-sheet-action{width:100%;min-height:44px;text-align:center;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),scale var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-transcript-sheet-action:active:not(:disabled){scale:.96}@keyframes __P__-transcript-fade{0%{opacity:0}}@keyframes __P__-transcript-in{0%{opacity:0;translate:0 8px}}@media(max-width:640px){.__P__-transcript-layer{align-items:flex-end;padding:0}.__P__-transcript-sheet{max-width:none;padding-bottom:calc(var(--__P__-space-4) + env(safe-area-inset-bottom,0px));border-end-start-radius:0;border-end-end-radius:0;animation-name:__P__-transcript-up}}@keyframes __P__-transcript-up{0%{translate:0 100%}}@media(prefers-reduced-motion:reduce){.__P__-transcript-backdrop,.__P__-transcript-sheet{animation:none}}.__P__-operator-banner{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;column-gap:10px;box-sizing:border-box;width:calc(100% - 2 * var(--__P__-space-3));max-width:var(--__P__-conversation-max, 768px);margin:0 auto var(--__P__-space-2);padding:10px 12px;border-radius:var(--__P__-radius-lg);background:var(--__P__-bg-elevated);box-shadow:inset 0 0 0 1px var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);line-height:1.45;text-align:start}.__P__-operator-label{text-wrap:pretty}.__P__-operator-pulse{width:8px;height:8px;margin-block-start:calc((1.45em - 8px)/2);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-banner[data-available=false] .__P__-operator-pulse{background:var(--__P__-warning);animation:none}.__P__-operator-banner[data-mode=operator] .__P__-operator-pulse{background:var(--__P__-success)}.__P__-operator-dismiss{width:28px;height:28px;margin-block:-4px;margin-inline-end:-6px}.__P__-operator-dismiss:before{inset:-8px}.__P__-operator-dismiss svg{width:16px;height:16px}@media(prefers-reduced-motion:reduce){.__P__-operator-banner[data-mode=awaiting-operator] .__P__-operator-pulse{animation:none}}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-login-bar{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;column-gap:10px;padding:6px 8px;padding-inline-start:14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font-size:var(--__P__-text-sm);line-height:1.4}.__P__-login-bar-icon,.__P__-login-gate-icon{display:inline-flex;color:var(--__P__-fg-muted)}.__P__-login-bar-icon svg{width:16px;height:16px}.__P__-login-bar-text{text-wrap:pretty}.__P__-login-bar[data-kind=user]{grid-template-columns:auto minmax(0,1fr);padding-inline-end:14px;color:var(--__P__-fg-muted)}.__P__-login-bar[data-kind=user] .__P__-login-bar-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-login-bar-action{appearance:none;border:0;cursor:pointer;padding:6px 12px;border-radius:999px;background:transparent;color:var(--__P__-accent-fg);font:inherit;font-weight:600;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-login-bar-action:hover{background:var(--__P__-hover)}.__P__-login-bar-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px}.__P__-login-bar-hide{width:28px;height:28px}.__P__-login-bar-hide:before{inset:-8px}.__P__-login-bar-hide svg{width:16px;height:16px}.__P__-login-gate{display:flex;flex-direction:column;align-items:center;gap:10px;box-sizing:border-box;width:calc(100% - 2 * var(--__P__-space-3));max-width:var(--__P__-conversation-max, 768px);margin:0 auto var(--__P__-space-3);padding:18px 16px;border-radius:var(--__P__-radius-lg);background:var(--__P__-bg-elevated);box-shadow:inset 0 0 0 1px var(--__P__-border);text-align:center}.__P__-login-gate[data-alone]{flex:1;justify-content:center;margin-block-start:var(--__P__-space-3);background:transparent;box-shadow:none}.__P__-login-gate-icon{align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:var(--__P__-bg);box-shadow:inset 0 0 0 1px var(--__P__-border)}.__P__-login-gate[data-alone] .__P__-login-gate-icon{width:48px;height:48px;background:var(--__P__-bg-elevated)}.__P__-login-gate-icon svg{width:20px;height:20px}.__P__-form-actions.__P__-login-gate-actions{justify-content:center;width:100%;max-width:320px;margin-top:var(--__P__-space-1)}.__P__-login-gate-title{margin:0;color:var(--__P__-fg);font-size:var(--__P__-text-md);font-weight:600;line-height:1.35;text-wrap:balance}.__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);color:var(--__P__-fg);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,.__P__-panel[data-resizing] .__P__-resize-grip{opacity:1}.__P__-resize-grip:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px;border-radius:4px}.__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)}.__P__-resize-grip--edge{top:0;bottom:0;left:0;width:8px;height:auto;opacity:1;cursor:ew-resize}.__P__-resize-grip--edge:focus-visible{outline:none}.__P__-resize-grip--edge:after{content:"";position:absolute;top:var(--__P__-radius, 12px);bottom:var(--__P__-radius, 12px);left:0;width:2px;border-radius:1px;background:var(--__P__-focus);opacity:0;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}:host([data-position$="-left"]) .__P__-resize-grip--edge,:host([data-position$="-left"]) .__P__-resize-grip--edge:after{left:auto;right:0}.__P__-resize-grip--edge:hover:after{opacity:1;transition-delay:.15s}.__P__-resize-grip--edge:focus-visible:after,.__P__-panel[data-resizing] .__P__-resize-grip--edge:after{opacity:1}@media(pointer:coarse){.__P__-resize-grip{width:24px;height:24px}.__P__-resize-grip--edge{width:14px;height:auto}}:host(:not([data-mode="open"]):not([data-mode="expanded"]):not([data-mode="drawer"])) .__P__-resize-grip{display:none}@media(max-width:640px){.__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__-help-more{justify-content:center;color:var(--__P__-accent-fg);font-weight:600}.__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)}@media(hover:hover){.__P__-tab:hover{background:var(--__P__-hover)}}.__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:var(--__P__-radius-md);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:var(--__P__-radius-md);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;line-height:1.45}.__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{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search[data-input=true]:focus-within{outline:none;border-color:var(--__P__-focus)}.__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-input:focus-visible{outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-home-ask{padding-block:6px;padding-inline-end:6px}.__P__-home-ask .__P__-send{width:32px;height:32px;flex-shrink:0}.__P__-home-ask .__P__-send[data-shape=pill]{width:auto;padding:0 14px}.__P__-home-ask .__P__-send svg{width:16px;height:16px}.__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-vote{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2);padding-top:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;line-height:1.45;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface);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-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-news-tag{padding:1px 8px;border-radius:6px;background:var(--__P__-hover);color:var(--__P__-fg);font-size:calc(12px * var(--__P__-text-scale));white-space:nowrap}.__P__-news-more{display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);width:100%;min-height:44px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);background:var(--__P__-surface);color:var(--__P__-accent-fg);font-weight:600}.__P__-news-more:hover{background:var(--__P__-bg-elevated)}.__P__-news-more:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__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__-panel-notice{display:flex;align-items:center;justify-content:center;position:relative;padding:var(--__P__-space-6);text-align:center}.__P__-panel-notice-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-panel-notice-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__-textarea,.__P__-home-search-input,.__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__-toolui{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)}.__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=done]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=approved],.__P__-toolui-status[data-status=submitted]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=waiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=declined]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=failed]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=replaced],.__P__-toolui-status[data-status=running],.__P__-toolui-status[data-status=stopped]{--__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-3)}.__P__-toolui-collapse-body>.__P__-form{gap:var(--__P__-space-3)}.__P__-toolui-collapse-body>.__P__-form>.__P__-field,.__P__-toolui-summary>.__P__-field{padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg) 80%,transparent);line-height:1.5}.__P__-toolui-collapse-body>.__P__-form>.__P__-field{gap:var(--__P__-space-2)}.__P__-toolui-summary>.__P__-field{gap:var(--__P__-space-1)}.__P__-toolui-summary .__P__-field-label{color:var(--__P__-fg-muted)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted);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-system{min-width:0;overflow:hidden;color:var(--__P__-fg-muted);text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-preview{min-width:0}.__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-fields{max-height:240px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm)}.__P__-toolui-fields table{width:100%;border-collapse:collapse;font-size:var(--__P__-text-sm);line-height:1.5}.__P__-toolui-fields tr:nth-child(2n){background:color-mix(in oklab,var(--__P__-fg) 4%,transparent)}.__P__-toolui-fields tr+tr{border-top:1px solid var(--__P__-border)}.__P__-toolui-fields th,.__P__-toolui-fields td{padding:6px var(--__P__-space-2);text-align:start;vertical-align:top}.__P__-toolui-fields th{width:1%;color:var(--__P__-fg-muted);font-weight:400;white-space:nowrap}.__P__-toolui-fields td{color:var(--__P__-fg);white-space:pre-wrap;overflow-wrap:anywhere}.__P__-toolui-fields[data-plain=true]{border:0;border-radius:0}.__P__-toolui-fields[data-plain=true] tr:nth-child(2n){background:none}.__P__-toolui-fields[data-plain=true] tr+tr{border-top:0}.__P__-toolui-fields[data-plain=true] th,.__P__-toolui-fields[data-plain=true] td{padding:1px var(--__P__-space-2) 1px 0}.__P__-toolui-raw>summary{width:fit-content;color:var(--__P__-fg-muted);cursor:pointer}.__P__-toolui-raw>summary:hover{color:var(--__P__-fg)}.__P__-toolui-raw>summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-toolui-raw[open]{display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__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}
|
|
5
|
-
`;var
|
|
6
|
-
`;var
|
|
7
|
-
`;var Qv="helpai",Yv="#5B5BD6",Jv="#FFFFFF",Xv="12px",Zv="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",ll=[wu,Su,xu
|
|
8
|
-
`).replace(/__P__/g,Qv).replaceAll("__BRAND_ACCENT_TEXT__",Jv).replaceAll("__BRAND_ACCENT__",Yv).replaceAll("__BRAND_RADIUS__",Xv).replaceAll("__BRAND_FONT__",Zv);var Cu=["data-theme","data-color-scheme","data-mode","data-bs-theme"];function ku(e){if(e){if(e.classList.contains("dark"))return"dark";if(e.classList.contains("light"))return"light";for(let t of Cu){let n=e.getAttribute(t);if(n==="dark"||n==="light")return n}}}function Li(e=document){let t=ku(e.documentElement)??ku(e.body);if(t)return t;let n=getComputedStyle(e.documentElement).colorScheme.trim();return n==="dark"||n==="light"?n:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Tu(e,t=document){let n=Li(t);e(n);function r(){let l=Li(t);l!==n&&(n=l,e(l))}let o=new MutationObserver(r),i={attributes:!0,attributeFilter:["class","style",...Cu]};o.observe(t.documentElement,i),t.body&&o.observe(t.body,i);let s=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):void 0;return s?.addEventListener("change",r),()=>{o.disconnect(),s?.removeEventListener("change",r)}}var eb=ee.scope("mount"),Ru=new WeakMap,tb={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 cl(e,t){let n=t==="flow"?e.style.height:"";e.style.cssText=tb[t],n&&(e.style.height=n)}function Rr(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Oi(e={}){let t=e.position??"flow";eb.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${L.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let r;e.existingHost?r=e.existingHost:(r=document.createElement(n),(e.target??document.body).appendChild(r)),r.setAttribute("data-brand",L.id),cl(r,t);let o=r.shadowRoot??r.attachShadow({mode:"open"});for(let l of["keydown","keypress","keyup"])o.addEventListener(l,nb);let i=r.ownerDocument;if(!rb(o,i)){let l=i.createElement("style");l.textContent=ll,o.appendChild(l)}let s=document.createElement("div");return s.className=`${L.cssPrefix}-app`,o.appendChild(s),{appRoot:s,destroy:()=>r.remove(),hostElement:r,shadowRoot:o}}function nb(e){if(e instanceof KeyboardEvent&&(e.metaKey||e.ctrlKey))return;let t=e.composedPath()[0];t instanceof HTMLElement&&(t.isContentEditable||t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")&&e.stopPropagation()}function rb(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=Ru.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(ll),Ru.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function ob(e,t){let n=L.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 ib(e,t){e.dataset.theme=t==="host"?Li():t}function ab(e,t){let n=L.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 sb(e,t){e.dataset.position=t}function Ni(e,t){e.dataset.mode=t}function Au(e,t){ib(e,t.themeMode),ob(e,t.themeOverrides),sb(e,t.position),ab(e,t.size)}var Qn,Xe,dl,Iu,ul=Object.is,uo=0,Uu=[],pl=[],Je=he,Eu=Je.__b,Mu=Je.__r,Lu=Je.diffed,Ou=Je.__c,Nu=Je.unmount,$u=Je.__;function po(e,t){Je.__h&&Je.__h(Xe,e,uo||t),uo=0;var n=Xe.__H||(Xe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function $(e){return uo=1,zu(Fu,e)}function zu(e,t,n){var r=po(Qn++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Fu(void 0,t),function(i){var s=(r.__N||r.__)[0],l=r.t(s,i);ul(s,l)||(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=Xe,!Xe.__f)){Xe.__f=!0;var o=Xe.shouldComponentUpdate;Xe.shouldComponentUpdate=function(i,s,l){var c=this.__H;if(!c)return!0;var u=!1,p=this.props!=i;if(c.__.some(function(d){d.__N&&(u=!0,ul(d.__[0],d.__N[0])||(p=!0))}),o){var _=o.call(this,i,s,l);return u?_||p:_}return!u||p}}return r.__}function U(e,t){var n=po(Qn++,3);!Je.__s&&fl(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,Xe.__H.__h.push(n))}function ut(e,t){var n=po(Qn++,4);!Je.__s&&fl(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,Xe.__h.push(n))}function B(e){return uo=5,xe(function(){return{current:e}},[])}function xe(e,t){var n=po(Qn++,7);return fl(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function F(e,t){return uo=8,xe(function(){return e},t)}function _o(){var e=po(Qn++,11);if(!e.__){for(var t=Xe.__v;!t.__m&&t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function lb(){var e;do{for(;e=pl.shift();)try{co(e)}catch(n){Je.__e(n,{__:(e=e.__P)&&e.__v})}for(;e=Uu.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(co),t.__h.some(_l),t.__h=[]}catch(n){t.__h=[],Je.__e(n,e.__v)}}}while(pl.length)}Je.__b=function(e){Xe=null,Eu&&Eu(e)},Je.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),$u&&$u(e,t)},Je.__r=function(e){Mu&&Mu(e),Qn=0;var t=(Xe=e.__c).__H;t&&(dl==Xe?Xe.__h=[]:(t.__h.some(co),t.__h.some(_l),Qn=0),t.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})),dl=Xe},Je.diffed=function(e){Lu&&Lu(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Bu(Uu.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u)})),dl=Xe=null},Je.__c=function(e,t){t.some(function(n){try{n.__h.some(co),n.__h=n.__h.filter(function(r){return!r.__||_l(r)})}catch(r){n.__h=[function(){throw r}]}}),Ou&&Ou(e,t)},Je.unmount=function(e){Nu&&Nu(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(o){try{if(o.__P&&o.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n=n&&n.__c}o.__P=n,Bu(pl.push(o))}else co(o)}catch(i){t=i}}),r.__H=void 0,t&&Je.__e(t,r.__v))};var Du=typeof requestAnimationFrame=="function";function cb(e){var t,n=function(){clearTimeout(r),Du&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Du&&(t=requestAnimationFrame(n))}function Bu(e){e!=1&&Iu==Je.requestAnimationFrame||((Iu=Je.requestAnimationFrame)||cb)(lb)}function co(e){var t=Xe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Xe=t}function _l(e){var t=Xe;e.__c=e.__(),Xe=t}function fl(e,t){return!e||e.length!=t.length||t.some(function(n,r){return!ul(n,e[r])})}function Fu(e,t){return typeof t=="function"?t(e):t}var db=Symbol.for("preact-signals");function Ui(){if(an>1)an--;else{var e,t=!1;for((function(){var o=Di;for(Di=void 0;o!==void 0;){var i=o.S;if(i.v===o.v)for(var s=i.t;s!==void 0;s=s.x)s.i===o.i&&(s.i=i.i);o=o.o}})();go!==void 0;){var n=go;for(go=void 0,$i++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&qu(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if($i=0,an--,t)throw e}}function Ft(e){if(an>0)return e();gl=++ub,an++;try{return e()}finally{Ui()}}var fo,Fe=void 0;function mo(e){var t=Fe,n=fo;Fe=void 0,fo=void 0;try{return e()}finally{Fe=t,fo=n}}var go=void 0,an=0,$i=0,ub=0,gl=0,Di=void 0,Bi=0;function Hu(e){if(Fe!==void 0){var t=e.n;if(t===void 0||t.t!==Fe)return t={i:0,S:e,p:Fe.s,n:void 0,t:Fe,e:void 0,x:void 0,r:t},Fe.s!==void 0&&(Fe.s.n=t),Fe.s=t,e.n=t,32&Fe.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Fe.s,t.n=void 0,Fe.s.n=t,Fe.s=t),t}}function pt(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}pt.prototype.brand=db;pt.prototype.h=function(){return!0};pt.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:mo(function(){var r;(r=t.W)==null||r.call(t)}))};pt.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&mo(function(){var o;(o=t.Z)==null||o.call(t)}))}};pt.prototype.subscribe=function(e){var t=this;return qt(function(){var n=t.value;mo(function(){return e(n)})},{name:"sub"})};pt.prototype.valueOf=function(){return this.value};pt.prototype.toString=function(){return this.value+""};pt.prototype.toJSON=function(){return this.value};pt.prototype.peek=function(){var e=this;return mo(function(){return e.value})};Object.defineProperty(pt.prototype,"value",{get:function(){var e=Hu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if($i>100)throw new Error("Cycle detected");(function(n){an!==0&&$i===0&&n.l!==gl&&(n.l=gl,Di={S:n,v:n.v,i:n.i,o:Di})})(this),this.v=e,this.i++,Bi++,an++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ui()}}}});function oe(e,t){return new pt(e,t)}function qu(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 ju(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 Vu(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Yn(e,t){pt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Bi-1,this.f=4}Yn.prototype=new pt;Yn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Bi))return!0;if(this.g=Bi,this.f|=1,this.i>0&&!qu(this))return this.f&=-2,!0;var e=Fe;try{ju(this),Fe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Fe=e,Vu(this),this.f&=-2,!0};Yn.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)}pt.prototype.S.call(this,e)};Yn.prototype.U=function(e){if(this.t!==void 0&&(pt.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)}};Yn.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(Yn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Hu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Ze(e,t){return new Yn(e,t)}function Wu(e){var t=e.j;if(e.j=void 0,typeof t=="function"){an++;var n=Fe;Fe=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ml(e),r}finally{Fe=n,Ui()}}}function ml(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Wu(e)}function pb(e){if(Fe!==this)throw new Error("Out-of-order effect");Vu(this),Fe=e,this.f&=-2;try{8&this.f&&ml(this)}finally{Ui()}}function Ar(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,fo&&fo.push(this)}Ar.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.j=t)}finally{e()}};Ar.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Wu(this),ju(this),an++;var e=Fe;return Fe=this,pb.bind(this,e)};Ar.prototype.N=function(){2&this.f||(this.f|=2,this.u=go,go=this)};Ar.prototype.d=function(){this.f|=8,1&this.f||ml(this)};Ar.prototype.dispose=function(){this.d()};function qt(e,t){var n=new Ar(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Gu,vo,zi,_b=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Ku=[];qt(function(){Gu=this.N})();function Ir(e,t){he[e]=t.bind(null,he[e]||function(){})}function ho(e){if(zi){var t=zi;zi=void 0,t()}zi=e&&e.S()}function Qu(e){var t=this,n=e.data,r=St(n);r.name="ReactiveDom",r.value=n;var o=xe(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=Ze(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),p=Ze(function(){return!Array.isArray(u.value)&&!Xs(u.value)}),_=qt(function(){if(this.N=Yu,p.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){_(),d.call(this)},[p,u]},[]),i=o[0],s=o[1];return i.value?s.peek():s.value}Qu.displayName="ReactiveTextNode";Object.defineProperties(pt.prototype,{constructor:{configurable:!0,value:xn(pe,null).constructor},type:{configurable:!0,value:Qu},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Ir("__b",function(e,t){if(ho(),vo=void 0,typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof pt&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)});Ir("__r",function(e,t){if(e(t),t.type!==pe){ho();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o,i){var s;return qt(function(){s=this},{name:i}),s.c=o,s})((function(o){return function(){var i;_b&&((i=this.y)==null||i.call(this)),o.__$f|=1,o.setState({})}})(r),typeof t.type=="function"?t.type.displayName||t.type.name:""))),vo=r,ho(n)}});Ir("__e",function(e,t,n,r){ho(),vo=void 0,e(t,n,r)});Ir("diffed",function(e,t){ho(),vo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||r&&s in r||(l.d(),i[s]=void 0)}if(r){i||(i={},n.U=i);for(var c in r){var u=i[c],p=r[c];u===void 0?(u=fb(n,c,p,o),i[c]=u):u.o(p,o)}}}e(t)});function fb(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=oe(n);return{o:function(s,l){i.value=s,r=l},d:qt(function(){this.N=Yu;var s=i.value.value;r[t]!==s&&(r[t]=s,o?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}Ir("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){u.__$f|=8;var p=u.__$u;p&&(u.__$u=void 0,p.d())}}e(t)});Ir("__h",function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)});zt.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function St(e,t){return xe(function(){return oe(e,t)},[])}function mt(e,t){var n=B(e);return n.current=e,vo.__$f|=4,xe(function(){return Ze(function(){return n.current()},t)},[])}var gb=function(e){queueMicrotask(function(){queueMicrotask(e)})};function mb(){Ft(function(){for(var e;e=Ku.shift();)Gu.call(e)})}function Yu(){Ku.push(this)===1&&(he.requestAnimationFrame||gb)(mb)}var hb="x-public-key",vb="x-ai-agent-deployment-id";function Ju(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");return{headers(){let t={[vb]:e.aiAgentDeploymentId};return e.publicKey&&(t[e.publicKeyHeader??hb]=e.publicKey),t}}}function Fi(e,t){let n=[],r;for(let o of e){let i=new URLSearchParams(o);i.has(t)?r??(r=i.get(t)??""):n.push(o)}return{value:r,rest:n}}function Xu(e){let t=new URL(e),n=L.cssPrefix,r=`${L.cssPrefix}-ask`,o=t.search.slice(1).split("&").filter(Boolean),i=t.hash.slice(1).split("&").filter(Boolean),s=Fi(o,n),l=Fi(s.rest,r),c=Fi(i,n),u=Fi(c.rest,r),p=s.value??c.value,_=(l.value??u.value)?.trim()||void 0;if(!(p===void 0&&_===void 0))return t.search=l.rest.join("&"),t.hash=u.rest.join("&"),{target:p===void 0?void 0:Si(p),..._?{ask:_}:{},url:t.toString()}}var Zu=ee.scope("feedback:audio"),Hi=class{constructor(){Z(this,"ctx",null);Z(this,"master",null);Z(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){Zu.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,r=this.master;if(!n||!r||n.state!=="running")return;let o=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let u=n.createGain(),p=o+l*i;u.gain.setValueAtTime(1e-4,p),u.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),u.gain.exponentialRampToValueAtTime(1e-4,p+i),c.connect(u).connect(r),c.start(p),c.stop(p+i+.01)})}async playUrl(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let i=n.createBufferSource();i.buffer=o,i.connect(r),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 r=this.ctx,o=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>r.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(Zu.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var ep={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},tp={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 kn=null,qi=0;function bb(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function yb(){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=`__${L.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;";e.style.cssText=n,t.style.cssText=n;for(let r of[e,t])r.addEventListener("click",o=>o.stopPropagation());return document.body.append(e,t),{input:e,label:t}}function np(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(bb())try{navigator.vibrate(e);return}catch{}if(kn??(kn=yb()),!!kn)try{kn.label.click()}catch{}}}function rp(){qi++;let e=!1;return()=>{e||(e=!0,qi=Math.max(0,qi-1),qi===0&&kn&&(kn.input.remove(),kn.label.remove(),kn=null))}}var Pb=ee.scope("feedback"),xb=100,ji=class{constructor(t,n){Z(this,"mutedSig",oe(!1));Z(this,"audio",new Hi);Z(this,"releaseHaptics");Z(this,"sound");Z(this,"haptics");Z(this,"lastPlayed",new Map);Z(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=rp(),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<xb}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(o=>Pb.warn("audio play failed",{err:o,url:n}));return}let r=tp[t];r&&this.audio.playTone(r)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let r=n===!0||n===void 0?ep[t]:n;np(r)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function op(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function hl(e){return op(e)}function vl(e){return!(!op(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Vi(e){if(typeof e!="object"||e===null)return{};let t=Reflect.get(e,"url");return{url:typeof t=="string"&&/^https?:\/\//i.test(t)&&t.includes("{returnTo}")?t:void 0,required:Reflect.get(e,"required")===!0,hidePrompt:Reflect.get(e,"hidePrompt")===!0,hideUser:Reflect.get(e,"hideUser")===!0}}function ap(e,t){let n=encodeURIComponent(t).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`);return e.replaceAll("{returnTo}",n)}function sp(e){let t=e.split(".")[1];if(t)try{let n=atob(t.replace(/-/g,"+").replace(/_/g,"/")),r=JSON.parse(new TextDecoder().decode(Uint8Array.from(n,o=>o.charCodeAt(0))));return typeof r=="object"&&r!==null&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):void 0}catch{return}}function ip(e,t){let n=e?.[t];return typeof n=="string"&&n.trim()?{[t]:n.trim()}:{}}function lp(e){let t=sp(e);return{...ip(t,"name"),...ip(t,"email")}}function cp(e){let t=sp(e)?.sub;return typeof t=="string"&&t!==""?t:void 0}function dp(){try{return window.top?.location.href??location.href}catch{return location.href}}function up(e){try{(window.top??window).location.assign(e)}catch{location.assign(e)}}var Sb=Symbol.for("pv"),wb=0;function a(e,t,n,r,o,i){t||(t={});var s,l,c=t;if("ref"in c&&typeof e!="function")for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:Sb,__v:--wb,__i:-1,__u:0};return(o||i)&&(u.__source=o,u.__self=i),he.vnode&&he.vnode(u),u}var Er=1,bo=2,yo=4,_p=8,fp=16;function kb(e){switch(e){case Er:return"href";case bo:return"src";case yo:return"class";case _p:return"checked";case fp:return"start"}}var Cb=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}},Tb=Cb;var pp=24;function Po(e){let t=new Uint32Array(pp);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(pp),indent:"",indent_len:0,table_state:0}}function Mr(e){e.pending.length>0&&Qe(e,`
|
|
9
|
-
`)}function Ae(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 Ke(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 Ie(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&Ke(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function Rb(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Jn(e,t){for(e.fence_start=0;e.len>t;)Ke(e)}function Wi(e,t){let n=0;for(let r=0;r<=e.len&&(t-=e.spaces[r],!(t<0));r+=1)switch(e.tokens[r]){case 9:case 10:case 20:case 25:n=r;break}for(;e.len>n;)Ke(e);return t}function bl(e,t){let n=-1,r=-1;for(let o=e.blockquote_idx+1;o<=e.len;o+=1)if(e.tokens[o]===25){if(e.indent_len<e.spaces[o]){r=-1;break}r=o}else e.tokens[o]===t&&(n=o);return r===-1?n===-1?(Jn(e,e.blockquote_idx),Ie(e,t),!0):(Jn(e,n),!1):(Jn(e,r),Ie(e,t),!0)}function yl(e,t){Ie(e,25),e.spaces[e.len]=e.indent_len+t,
|
|
10
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){Ke(e),
|
|
11
|
-
`:if(e.hr_chars<3)break;Wi(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),
|
|
12
|
-
`:{Wi(e,e.indent_len),Ie(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,yo,e.pending.slice(e.fence_start)),
|
|
1
|
+
"use strict";(()=>{var Jm=Object.defineProperty;var Xm=(e,t,n)=>t in e?Jm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Z=(e,t,n)=>Xm(e,typeof t!="symbol"?t+"":t,n);var L={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 Zm=["en","fr","es","ar","he","zh"];function ad(e){let t=e?.split("-")[0]?.toLowerCase();return Zm.find(n=>n===t)??"en"}function Ps(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ys(e){return Ps(e)?e.id??e.key:void 0}function xs(e,t){return Ps(e)&&Ps(t)?Object.fromEntries([...new Set([...Object.keys(e),...Object.keys(t)])].map(n=>[n,xs(e[n],t[n])])):Array.isArray(e)&&Array.isArray(t)&&t.length>0&&t.every(n=>ys(n)!==void 0)?e.map(n=>xs(n,t.find(r=>ys(r)===ys(n)))):t==null||typeof t=="string"&&!t.trim()?e:t}function zn(e,t){let n=t?.toLowerCase(),r=n?.split("-")[0],o=e.translations??[],i=o.find(c=>c.locale.toLowerCase()===n)??o.find(c=>c.locale.toLowerCase().split("-")[0]===r);if(!i)return e;let{locale:s,...l}=i;return xs(e,l)}var ui={attach:"Attach files",file:"File",attachmentMimeRejected:"{name} isn't a file type this chat accepts.",attachmentTooLarge:"{name} is too large. Files can be up to {max} together.",poweredBy:"Powered by {name}",attachmentTooMany:"The attachment limit is {count}.",attachmentUploadFailed:"{name} couldn't be uploaded.",conversationLoading:"Loading chat\u2026",loadPreviousMessages:"Load previous messages",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",dropZoneRejected:"These files can't be attached here",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRateLimitedIn:"Too many requests \u2014 please try again in {seconds} s.",errorOffline:"Can't reach the server. Check your connection and try again.",errorServer:"Something went wrong on our side. Please try again.",errorOriginNotAllowed:"This chat isn't set up for this website yet.",errorMessageTooLong:"That message is too long. Shorten it and send it again.",errorReconnecting:"Connection lost. Reconnecting\u2026",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",loadMoreConversations:"Load more conversations",language:"Language",launcherOpen:"Open chat",launcherAsk:"Ask {name}",micBlocked:"The microphone is blocked for this site, so voice input can't start.",micStart:"Start voice input",micStop:"Stop voice input",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",popOut:"Open in new tab",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",queueMessage:"Queue message",removeQueuedMessage:"Remove queued message",removeAttachment:"Remove {name}",suggestedReplies:"Suggested replies",compactingContext:"Optimizing conversation context\u2026",soundOff:"Sound off",soundOn:"Sound on",talkToOperator:"Talk to a person",connectingOperator:"Connecting you to a person\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",operatorBadgeTitle:"Live chat",chatNotice:"You're chatting with an AI assistant.",cancelOperatorRequest:"Keep chatting with the AI",loginPrompt:"Log in for faster, more personalized support",loginAction:"Log in",loginRequired:"Log in to chat with us",loginExpired:"Your login expired. Log in to continue this chat.",loginExpiredGuest:"Your login expired. Log in to continue this chat, or start a new conversation as a guest.",startAsGuest:"Start new conversation",loggedInAs:"Logged in as {name}",loggedIn:"Logged in",dismissLoginPrompt:"Hide",emailTranscript:"Email transcript",emailTranscriptPrompt:"Get a copy of this conversation by email.",emailTranscriptEmailLabel:"Email address",emailTranscriptSend:"Send transcript",emailTranscriptSending:"Sending\u2026",emailTranscriptSent:"Sent to {email}.",emailTranscriptAlreadySent:"This conversation was already emailed. Send a new message to email it again.",emailTranscriptLimited:"You've reached the limit for now. Try again later.",emailTranscriptFailed:"Couldn't send it. Try again.",emailTranscriptNotDelivered:"Couldn't send to this address. Check it and try again.",emailTranscriptCancel:"Cancel",emailTranscriptDone:"Done",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",visualPreparing:"Preparing visual\u2026",visualError:"This visual could not be displayed.",visualPartial:"Some parts of this visual could not be displayed.",visualSoldOut:"Sold out",visualCartEmpty:"Your cart is empty.",visualQuantity:"Qty",visualChoose:"Choose",visualDirect:"Direct",visualVia:"via",visualNight:"1 night",visualNights:"{count} nights",visualPerNight:"per night",visualTravellers:"Travellers",thinking:"Thinking\u2026",thought:"Thought",thoughtFor:"Thought for {time}",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",copyTicketReference:"Ticket {reference}, copy",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",chatUnavailable:"This chat isn't available right now",moduleBack:"Back",contentLoading:"Loading\u2026",contentHelpful:"Was this helpful?",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeAskPlaceholder:"Ask a question\u2026",homeWhatsNew:"What's new",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results for \u201C{query}\u201D",helpShowMore:"Show more",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsShowMore:"Show more",newsUnseen:"New post",unread:"Unread",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidNumber:"Enter a valid number",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",askFallbackQuestion:"Please provide the missing information.",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",decline:"Decline",changeAnswer:"Change answer",approvalPrompt:"{action}?",approvalEditHint:"You can change your answer until this step continues.",stepInput:"Input",stepWorking:"Working",stepWorkingOnIt:"Working on it\u2026",stepNeedsYourApproval:"Needs your approval",stepWaitingForVisitor:"Waiting for the visitor",stepApproved:"Approved",stepDeclined:"Declined",stepReplaced:"Replaced",stepFailed:"Failed",stepDidNotWork:"Didn't work",decidedYouApproved:"You approved",decidedYouDeclined:"You declined",decidedVisitorApproved:"Visitor approved",decidedVisitorDeclined:"Visitor declined",decidedTeamApproved:"Approved by a team member",decidedTeamDeclined:"Declined by a team member",decidedMemberApproved:"Approved by {name}",decidedMemberDeclined:"Declined by {name}",stepRawData:"Raw data",decidedRulesApproved:"Auto-approved",decidedRulesDeclined:"Auto-declined",edit:"Edit",toolStepsFailed:"{count} failed",statusStopped:"Stopped",toolStepsStopped:"Stopped after {count} steps",toolStepsStoppedOne:"Stopped after 1 step"},eh={attach:"Joindre des fichiers",file:"Fichier",attachmentMimeRejected:"{name} n'est pas un type de fichier accept\xE9 ici.",attachmentTooLarge:"{name} est trop volumineux. Les fichiers peuvent faire jusqu'\xE0 {max} au total.",poweredBy:"Propuls\xE9 par {name}",attachmentTooMany:"Limite de pi\xE8ces jointes : {count}.",attachmentUploadFailed:"{name} n'a pas pu \xEAtre envoy\xE9.",conversationLoading:"Chargement du chat\u2026",loadPreviousMessages:"Charger les messages pr\xE9c\xE9dents",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",dropZoneRejected:"Ces fichiers ne peuvent pas \xEAtre joints ici",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRateLimitedIn:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans {seconds} s.",errorOffline:"Impossible de joindre le serveur. V\xE9rifiez votre connexion et r\xE9essayez.",errorServer:"Un probl\xE8me est survenu de notre c\xF4t\xE9. Veuillez r\xE9essayer.",errorOriginNotAllowed:"Ce chat n'est pas encore configur\xE9 pour ce site.",errorMessageTooLong:"Ce message est trop long. Raccourcissez-le et renvoyez-le.",errorReconnecting:"Connexion perdue. Reconnexion\u2026",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",loadMoreConversations:"Charger plus de conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherAsk:"Demander \xE0 {name}",micBlocked:"Le micro est bloqu\xE9 pour ce site : la saisie vocale ne peut pas d\xE9marrer.",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",popOut:"Ouvrir dans un nouvel onglet",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",queueMessage:"Mettre le message en attente",removeQueuedMessage:"Retirer le message en attente",removeAttachment:"Retirer {name}",suggestedReplies:"R\xE9ponses sugg\xE9r\xE9es",compactingContext:"Optimisation du contexte de la conversation\u2026",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",talkToOperator:"Parler \xE0 une personne",connectingOperator:"Mise en relation avec une personne\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",operatorBadgeTitle:"Chat en direct",chatNotice:"Vous discutez avec un assistant IA.",cancelOperatorRequest:"Continuer avec l'IA",loginPrompt:"Connectez-vous pour une aide plus rapide et personnalis\xE9e",loginAction:"Se connecter",loginRequired:"Connectez-vous pour discuter avec nous",loginExpired:"Votre connexion a expir\xE9. Connectez-vous pour poursuivre cette conversation.",loginExpiredGuest:"Votre connexion a expir\xE9. Connectez-vous pour poursuivre cette conversation, ou d\xE9marrez-en une nouvelle en tant qu'invit\xE9.",startAsGuest:"D\xE9marrer une nouvelle conversation",loggedInAs:"Connect\xE9 en tant que {name}",loggedIn:"Connect\xE9",dismissLoginPrompt:"Masquer",emailTranscript:"Envoyer la transcription",emailTranscriptPrompt:"Recevez une copie de cette conversation par e-mail.",emailTranscriptEmailLabel:"Adresse e-mail",emailTranscriptSend:"Envoyer la transcription",emailTranscriptSending:"Envoi\u2026",emailTranscriptSent:"Envoy\xE9 \xE0 {email}.",emailTranscriptAlreadySent:"Cette conversation a d\xE9j\xE0 \xE9t\xE9 envoy\xE9e. Envoyez un nouveau message pour l'envoyer \xE0 nouveau.",emailTranscriptLimited:"Vous avez atteint la limite pour le moment. R\xE9essayez plus tard.",emailTranscriptFailed:"Envoi impossible. R\xE9essayez.",emailTranscriptNotDelivered:"Envoi impossible \xE0 cette adresse. V\xE9rifiez-la et r\xE9essayez.",emailTranscriptCancel:"Annuler",emailTranscriptDone:"Termin\xE9",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",visualPreparing:"Pr\xE9paration du visuel\u2026",visualError:"Ce visuel n\u2019a pas pu \xEAtre affich\xE9.",visualPartial:"Certaines parties de ce visuel n\u2019ont pas pu \xEAtre affich\xE9es.",visualSoldOut:"\xC9puis\xE9",visualCartEmpty:"Votre panier est vide.",visualQuantity:"Qt\xE9",visualChoose:"Choisissez",visualDirect:"Direct",visualVia:"via",visualNight:"1 nuit",visualNights:"{count} nuits",visualPerNight:"par nuit",visualTravellers:"Voyageurs",thinking:"R\xE9flexion\u2026",thought:"R\xE9flexion",thoughtFor:"R\xE9flexion : {time}",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",copyTicketReference:"Ticket {reference}, copier",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",chatUnavailable:"Ce chat n'est pas disponible pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",contentHelpful:"Cela vous a-t-il aid\xE9 ?",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeAskPlaceholder:"Posez une question\u2026",homeWhatsNew:"Nouveaut\xE9s",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 pour \xAB\xA0{query}\xA0\xBB",helpShowMore:"Afficher plus",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsShowMore:"Afficher plus",newsUnseen:"Nouvelle publication",unread:"Non lu",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidNumber:"Saisissez un nombre valide",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",askFallbackQuestion:"Veuillez fournir les informations manquantes.",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",decline:"Refuser",changeAnswer:"Modifier la r\xE9ponse",approvalPrompt:"{action} ?",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",stepInput:"Entr\xE9e",stepWorking:"En cours",stepWorkingOnIt:"En cours\u2026",stepNeedsYourApproval:"Votre accord est requis",stepWaitingForVisitor:"En attente du visiteur",stepApproved:"Approuv\xE9",stepDeclined:"Refus\xE9",stepReplaced:"Remplac\xE9",stepFailed:"\xC9chec",stepDidNotWork:"N'a pas fonctionn\xE9",decidedYouApproved:"Vous avez approuv\xE9",decidedYouDeclined:"Vous avez refus\xE9",decidedVisitorApproved:"Approuv\xE9 par le visiteur",decidedVisitorDeclined:"Refus\xE9 par le visiteur",decidedTeamApproved:"Approuv\xE9 par un membre de l'\xE9quipe",decidedTeamDeclined:"Refus\xE9 par un membre de l'\xE9quipe",decidedMemberApproved:"Approuv\xE9 par {name}",decidedMemberDeclined:"Refus\xE9 par {name}",stepRawData:"Donn\xE9es brutes",decidedRulesApproved:"Approuv\xE9 automatiquement",decidedRulesDeclined:"Refus\xE9 automatiquement",edit:"Modifier",toolStepsFailed:"{count} en \xE9chec",statusStopped:"Arr\xEAt\xE9",toolStepsStopped:"Arr\xEAt\xE9 apr\xE8s {count} \xE9tapes",toolStepsStoppedOne:"Arr\xEAt\xE9 apr\xE8s 1 \xE9tape"},th={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",file:"\u0645\u0644\u0641",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 {name} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629.",attachmentTooLarge:"\u0627\u0644\u0645\u0644\u0641 {name} \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627. \u064A\u0645\u0643\u0646 \u0623\u0646 \u064A\u0635\u0644 \u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0645\u0639\u064B\u0627 \u0625\u0644\u0649 {max}.",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 {name}",attachmentTooMany:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A: {count}.",attachmentUploadFailed:"\u062A\u0639\u0630\u0651\u0631 \u0631\u0641\u0639 {name}.",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",loadPreviousMessages:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0631\u0633\u0627\u0626\u0644 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",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",dropZoneRejected:"\u0644\u0627 \u064A\u0645\u0643\u0646 \u0625\u0631\u0641\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0647\u0646\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.",errorRateLimitedIn:"\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 {seconds} \u062B.",errorOffline:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u062E\u0627\u062F\u0645. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643 \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorServer:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0646 \u062C\u0647\u062A\u0646\u0627. \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorOriginNotAllowed:"\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u063A\u064A\u0631 \u0645\u064F\u0639\u062F\u0651\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u0648\u0642\u0639 \u0628\u0639\u062F.",errorMessageTooLong:"\u0647\u0630\u0647 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0637\u0648\u064A\u0644\u0629 \u062C\u062F\u064B\u0627. \u0627\u062E\u062A\u0635\u0631\u0647\u0627 \u0648\u0623\u0631\u0633\u0644\u0647\u0627 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorReconnecting:"\u0627\u0646\u0642\u0637\u0639 \u0627\u0644\u0627\u062A\u0635\u0627\u0644. \u062C\u0627\u0631\u064D \u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0627\u062A\u0635\u0627\u0644\u2026",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",loadMoreConversations:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0632\u064A\u062F \u0645\u0646 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherAsk:"\u0627\u0633\u0623\u0644 {name}",micBlocked:"\u0627\u0644\u0645\u064A\u0643\u0631\u0648\u0641\u0648\u0646 \u0645\u062D\u0638\u0648\u0631 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u0648\u0642\u0639\u060C \u0644\u0630\u0627 \u0644\u0627 \u064A\u0645\u0643\u0646 \u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A.",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",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",popOut:"\u0641\u062A\u062D \u0641\u064A \u0639\u0644\u0627\u0645\u0629 \u062A\u0628\u0648\u064A\u0628 \u062C\u062F\u064A\u062F\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",queueMessage:"\u0625\u0636\u0627\u0641\u0629 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0625\u0644\u0649 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",removeQueuedMessage:"\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0645\u0646 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",removeAttachment:"\u0625\u0632\u0627\u0644\u0629 {name}",suggestedReplies:"\u0631\u062F\u0648\u062F \u0645\u0642\u062A\u0631\u062D\u0629",compactingContext:"\u062C\u0627\u0631\u064D \u062A\u062D\u0633\u064A\u0646 \u0633\u064A\u0627\u0642 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0634\u062E\u0635",connectingOperator:"\u062C\u0627\u0631\u064D \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0634\u062E\u0635\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}",operatorBadgeTitle:"\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0628\u0627\u0634\u0631\u0629",chatNotice:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 \u0645\u0633\u0627\u0639\u062F \u0630\u0643\u0627\u0621 \u0627\u0635\u0637\u0646\u0627\u0639\u064A.",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",loginPrompt:"\u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0644\u062D\u0635\u0648\u0644 \u0639\u0644\u0649 \u062F\u0639\u0645 \u0623\u0633\u0631\u0639 \u0648\u0645\u062E\u0635\u0651\u0635 \u0644\u0643",loginAction:"\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",loginRequired:"\u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0644\u062F\u0631\u062F\u0634\u0629 \u0645\u0639\u0646\u0627",loginExpired:"\u0627\u0646\u062A\u0647\u062A \u0635\u0644\u0627\u062D\u064A\u0629 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u0643. \u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629.",loginExpiredGuest:"\u0627\u0646\u062A\u0647\u062A \u0635\u0644\u0627\u062D\u064A\u0629 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u0643. \u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u060C \u0623\u0648 \u0627\u0628\u062F\u0623 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629 \u0643\u0636\u064A\u0641.",startAsGuest:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",loggedInAs:"\u062A\u0645 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0628\u0627\u0633\u0645 {name}",loggedIn:"\u062A\u0645 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",dismissLoginPrompt:"\u0625\u062E\u0641\u0627\u0621",emailTranscript:"\u0625\u0631\u0633\u0627\u0644 \u0646\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",emailTranscriptPrompt:"\u0627\u062D\u0635\u0644 \u0639\u0644\u0649 \u0646\u0633\u062E\u0629 \u0645\u0646 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0639\u0628\u0631 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A.",emailTranscriptEmailLabel:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",emailTranscriptSend:"\u0625\u0631\u0633\u0627\u0644 \u0646\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",emailTranscriptSending:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",emailTranscriptSent:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0625\u0644\u0649 {email}.",emailTranscriptAlreadySent:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0628\u0627\u0644\u0641\u0639\u0644. \u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 \u062C\u062F\u064A\u062F\u0629 \u0644\u0625\u0631\u0633\u0627\u0644\u0647\u0627 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptLimited:"\u0644\u0642\u062F \u0628\u0644\u063A\u062A \u0627\u0644\u062D\u062F \u0627\u0644\u0645\u0633\u0645\u0648\u062D \u0628\u0647 \u062D\u0627\u0644\u064A\u064B\u0627. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649 \u0644\u0627\u062D\u0642\u064B\u0627.",emailTranscriptFailed:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptNotDelivered:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0625\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0648\u0627\u0646. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646\u0647 \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptCancel:"\u0625\u0644\u063A\u0627\u0621",emailTranscriptDone:"\u062A\u0645",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",visualPreparing:"\u062C\u0627\u0631\u064D \u0625\u0639\u062F\u0627\u062F \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A\u2026",visualError:"\u062A\u0639\u0630\u0631 \u0639\u0631\u0636 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A.",visualPartial:"\u062A\u0639\u0630\u0631 \u0639\u0631\u0636 \u0628\u0639\u0636 \u0623\u062C\u0632\u0627\u0621 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A.",visualSoldOut:"\u0646\u0641\u062F\u062A \u0627\u0644\u0643\u0645\u064A\u0629",visualCartEmpty:"\u0633\u0644\u062A\u0643 \u0641\u0627\u0631\u063A\u0629.",visualQuantity:"\u0627\u0644\u0643\u0645\u064A\u0629",visualChoose:"\u0627\u062E\u062A\u0631",visualDirect:"\u0645\u0628\u0627\u0634\u0631",visualVia:"\u0639\u0628\u0631",visualNight:"\u0644\u064A\u0644\u0629 \u0648\u0627\u062D\u062F\u0629",visualNights:"\u0627\u0644\u0644\u064A\u0627\u0644\u064A: {count}",visualPerNight:"\u0644\u0644\u064A\u0644\u0629",visualTravellers:"\u0627\u0644\u0645\u0633\u0627\u0641\u0631\u0648\u0646",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thought:"\u062A\u0641\u0643\u064A\u0631",thoughtFor:"\u0641\u0643\u0651\u0631 \u0644\u0645\u062F\u0629 {time}",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",copyTicketReference:"\u0627\u0644\u062A\u0630\u0643\u0631\u0629 {reference}\u060C \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",chatUnavailable:"\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629 \u062D\u0627\u0644\u064A\u0627\u064B",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",contentHelpful:"\u0647\u0644 \u0643\u0627\u0646 \u0647\u0630\u0627 \u0645\u0641\u064A\u062F\u064B\u0627\u061F",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",homeAskPlaceholder:"\u0627\u0637\u0631\u062D \u0633\u0624\u0627\u0644\u0627\u064B\u2026",homeWhatsNew:"\u0645\u0627 \u0627\u0644\u062C\u062F\u064A\u062F",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 \u0646\u062A\u0627\u0626\u062C \u0644\u0640 \xAB{query}\xBB",helpShowMore:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0632\u064A\u062F",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",newsShowMore:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0632\u064A\u062F",newsUnseen:"\u0645\u0646\u0634\u0648\u0631 \u062C\u062F\u064A\u062F",unread:"\u063A\u064A\u0631 \u0645\u0642\u0631\u0648\u0621",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",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",askFallbackQuestion:"\u064A\u0631\u062C\u0649 \u062A\u0642\u062F\u064A\u0645 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062A \u0627\u0644\u0646\u0627\u0642\u0635\u0629.",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",decline:"\u0631\u0641\u0636",changeAnswer:"\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",approvalPrompt:"{action}\u061F",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u063A\u064A\u064A\u0631 \u0625\u062C\u0627\u0628\u062A\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",stepInput:"\u0627\u0644\u0645\u062F\u062E\u0644\u0627\u062A",stepWorking:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",stepWorkingOnIt:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",stepNeedsYourApproval:"\u0628\u062D\u0627\u062C\u0629 \u0625\u0644\u0649 \u0645\u0648\u0627\u0641\u0642\u062A\u0643",stepWaitingForVisitor:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0632\u0627\u0626\u0631",stepApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",stepDeclined:"\u0645\u0631\u0641\u0648\u0636",stepReplaced:"\u062A\u0645 \u0627\u0644\u0627\u0633\u062A\u0628\u062F\u0627\u0644",stepFailed:"\u0641\u0634\u0644",stepDidNotWork:"\u0644\u0645 \u064A\u0646\u062C\u062D",decidedYouApproved:"\u0648\u0627\u0641\u0642\u062A",decidedYouDeclined:"\u0631\u0641\u0636\u062A",decidedVisitorApproved:"\u0648\u0627\u0641\u0642 \u0627\u0644\u0632\u0627\u0626\u0631",decidedVisitorDeclined:"\u0631\u0641\u0636 \u0627\u0644\u0632\u0627\u0626\u0631",decidedTeamApproved:"\u0648\u0627\u0641\u0642 \u0639\u0636\u0648 \u0641\u064A \u0627\u0644\u0641\u0631\u064A\u0642",decidedTeamDeclined:"\u0631\u0641\u0636 \u0639\u0636\u0648 \u0641\u064A \u0627\u0644\u0641\u0631\u064A\u0642",decidedMemberApproved:"\u0648\u0627\u0641\u0642 {name}",decidedMemberDeclined:"\u0631\u0641\u0636 {name}",stepRawData:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0623\u0648\u0644\u064A\u0629",decidedRulesApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",decidedRulesDeclined:"\u0631\u064F\u0641\u0636 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",edit:"\u062A\u0639\u062F\u064A\u0644",toolStepsFailed:"\u0641\u0634\u0644 {count}",statusStopped:"\u0623\u064F\u0648\u0642\u0641",toolStepsStopped:"\u0623\u064F\u0648\u0642\u0641 \u0628\u0639\u062F {count} \u062E\u0637\u0648\u0627\u062A",toolStepsStoppedOne:"\u0623\u064F\u0648\u0642\u0641 \u0628\u0639\u062F \u062E\u0637\u0648\u0629 \u0648\u0627\u062D\u062F\u0629"},nh={attach:"Adjuntar archivos",file:"Archivo",attachmentMimeRejected:"{name} no es un tipo de archivo que acepte este chat.",attachmentTooLarge:"{name} es demasiado grande. Los archivos pueden ocupar hasta {max} en total.",poweredBy:"Con la tecnolog\xEDa de {name}",attachmentTooMany:"L\xEDmite de adjuntos: {count}.",attachmentUploadFailed:"No se pudo subir {name}.",conversationLoading:"Cargando chat\u2026",loadPreviousMessages:"Cargar mensajes anteriores",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",dropZoneRejected:"Estos archivos no se pueden adjuntar aqu\xED",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRateLimitedIn:"Demasiadas solicitudes: int\xE9ntalo de nuevo en {seconds} s.",errorOffline:"No se puede conectar con el servidor. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo.",errorServer:"Algo sali\xF3 mal por nuestra parte. Int\xE9ntalo de nuevo.",errorOriginNotAllowed:"Este chat a\xFAn no est\xE1 configurado para este sitio web.",errorMessageTooLong:"Ese mensaje es demasiado largo. Ac\xF3rtalo y env\xEDalo de nuevo.",errorReconnecting:"Se perdi\xF3 la conexi\xF3n. Reconectando\u2026",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",loadMoreConversations:"Cargar m\xE1s conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherAsk:"Preg\xFAntale a {name}",micBlocked:"El micr\xF3fono est\xE1 bloqueado para este sitio, as\xED que la entrada de voz no puede iniciarse.",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",popOut:"Abrir en una pesta\xF1a nueva",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",queueMessage:"Poner mensaje en cola",removeQueuedMessage:"Quitar mensaje de la cola",removeAttachment:"Quitar {name}",suggestedReplies:"Respuestas sugeridas",compactingContext:"Optimizando el contexto de la conversaci\xF3n\u2026",soundOff:"Sonido desactivado",soundOn:"Sonido activado",talkToOperator:"Hablar con una persona",connectingOperator:"Conect\xE1ndote con una persona\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",operatorBadgeTitle:"Chat en vivo",chatNotice:"Est\xE1s chateando con un asistente de IA.",cancelOperatorRequest:"Seguir con la IA",loginPrompt:"Inicia sesi\xF3n para recibir una ayuda m\xE1s r\xE1pida y personalizada",loginAction:"Iniciar sesi\xF3n",loginRequired:"Inicia sesi\xF3n para chatear con nosotros",loginExpired:"Tu sesi\xF3n ha caducado. Inicia sesi\xF3n para continuar esta conversaci\xF3n.",loginExpiredGuest:"Tu sesi\xF3n ha caducado. Inicia sesi\xF3n para continuar esta conversaci\xF3n o empieza una nueva como invitado.",startAsGuest:"Empezar una nueva conversaci\xF3n",loggedInAs:"Sesi\xF3n iniciada como {name}",loggedIn:"Sesi\xF3n iniciada",dismissLoginPrompt:"Ocultar",emailTranscript:"Enviar transcripci\xF3n",emailTranscriptPrompt:"Recibe una copia de esta conversaci\xF3n por correo.",emailTranscriptEmailLabel:"Correo electr\xF3nico",emailTranscriptSend:"Enviar transcripci\xF3n",emailTranscriptSending:"Enviando\u2026",emailTranscriptSent:"Enviado a {email}.",emailTranscriptAlreadySent:"Esta conversaci\xF3n ya se envi\xF3. Env\xEDa un mensaje nuevo para enviarla otra vez.",emailTranscriptLimited:"Has alcanzado el l\xEDmite por ahora. Int\xE9ntalo m\xE1s tarde.",emailTranscriptFailed:"No se pudo enviar. Int\xE9ntalo de nuevo.",emailTranscriptNotDelivered:"No se pudo enviar a esta direcci\xF3n. Rev\xEDsala e int\xE9ntalo de nuevo.",emailTranscriptCancel:"Cancelar",emailTranscriptDone:"Listo",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",visualPreparing:"Preparando visualizaci\xF3n\u2026",visualError:"No se pudo mostrar esta visualizaci\xF3n.",visualPartial:"No se pudieron mostrar algunas partes de esta visualizaci\xF3n.",visualSoldOut:"Agotado",visualCartEmpty:"Tu carrito est\xE1 vac\xEDo.",visualQuantity:"Cant.",visualChoose:"Elige",visualDirect:"Directo",visualVia:"v\xEDa",visualNight:"1 noche",visualNights:"{count} noches",visualPerNight:"por noche",visualTravellers:"Viajeros",thinking:"Pensando\u2026",thought:"Razonamiento",thoughtFor:"Razon\xF3 durante {time}",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",copyTicketReference:"Ticket {reference}, copiar",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",chatUnavailable:"Este chat no est\xE1 disponible en este momento",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",contentHelpful:"\xBFTe result\xF3 \xFAtil?",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeAskPlaceholder:"Haz una pregunta\u2026",homeWhatsNew:"Lo nuevo",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:"Sin resultados para \xAB{query}\xBB",helpShowMore:"Mostrar m\xE1s",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsShowMore:"Mostrar m\xE1s",newsUnseen:"Publicaci\xF3n nueva",unread:"No le\xEDdo",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",askFallbackQuestion:"Indica la informaci\xF3n que falta.",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",decline:"Rechazar",changeAnswer:"Cambiar respuesta",approvalPrompt:"\xBF{action}?",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",stepInput:"Entrada",stepWorking:"En curso",stepWorkingOnIt:"En curso\u2026",stepNeedsYourApproval:"Necesita tu aprobaci\xF3n",stepWaitingForVisitor:"Esperando al visitante",stepApproved:"Aprobado",stepDeclined:"Rechazado",stepReplaced:"Reemplazado",stepFailed:"Fall\xF3",stepDidNotWork:"No funcion\xF3",decidedYouApproved:"Lo aprobaste",decidedYouDeclined:"Lo rechazaste",decidedVisitorApproved:"El visitante aprob\xF3",decidedVisitorDeclined:"El visitante rechaz\xF3",decidedTeamApproved:"Aprobado por un miembro del equipo",decidedTeamDeclined:"Rechazado por un miembro del equipo",decidedMemberApproved:"Aprobado por {name}",decidedMemberDeclined:"Rechazado por {name}",stepRawData:"Datos sin procesar",decidedRulesApproved:"Aprobado autom\xE1ticamente",decidedRulesDeclined:"Rechazado autom\xE1ticamente",edit:"Editar",toolStepsFailed:"{count} con error",statusStopped:"Detenido",toolStepsStopped:"Detenido tras {count} pasos",toolStepsStoppedOne:"Detenido tras 1 paso"},rh={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",file:"\u05E7\u05D5\u05D1\u05E5",attachmentMimeRejected:"\u05D4\u05E7\u05D5\u05D1\u05E5 {name} \u05D0\u05D9\u05E0\u05D5 \u05DE\u05E1\u05D5\u05D2 \u05E9\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05DE\u05E7\u05D1\u05DC.",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 {name} \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9. \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D9\u05DB\u05D5\u05DC\u05D9\u05DD \u05DC\u05D4\u05D2\u05D9\u05E2 \u05D9\u05D7\u05D3 \u05E2\u05D3 {max}.",poweredBy:"\u05DE\u05D5\u05E4\u05E2\u05DC \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",attachmentTooMany:"\u05DE\u05E1\u05E4\u05E8 \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05DE\u05E8\u05D1\u05D9 \u05DC\u05E6\u05D9\u05E8\u05D5\u05E3: {count}.",attachmentUploadFailed:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E2\u05DC\u05D5\u05EA \u05D0\u05EA {name}.",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",loadPreviousMessages:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",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",dropZoneRejected:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E6\u05E8\u05E3 \u05DB\u05D0\u05DF \u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05D0\u05DC\u05D4",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.",errorRateLimitedIn:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 {seconds} \u05E9\u05E0\u05F3.",errorOffline:"\u05D0\u05D9\u05DF \u05D7\u05D9\u05D1\u05D5\u05E8 \u05DC\u05E9\u05E8\u05EA. \u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05D4\u05D7\u05D9\u05D1\u05D5\u05E8 \u05D5\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1.",errorServer:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9 \u05D0\u05E6\u05DC\u05E0\u05D5. \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1.",errorOriginNotAllowed:"\u05D4\u05E6'\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E2\u05D3\u05D9\u05D9\u05DF \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 \u05DC\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4.",errorMessageTooLong:"\u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05D4\u05D6\u05D5 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DE\u05D3\u05D9. \u05E7\u05E6\u05E8\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05D5\u05E9\u05DC\u05D7\u05D5 \u05E9\u05D5\u05D1.",errorReconnecting:"\u05D4\u05D7\u05D9\u05D1\u05D5\u05E8 \u05D0\u05D1\u05D3. \u05DE\u05EA\u05D7\u05D1\u05E8 \u05DE\u05D7\u05D3\u05E9\u2026",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",loadMoreConversations:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherAsk:"\u05DC\u05E9\u05D0\u05D5\u05DC \u05D0\u05EA {name}",micBlocked:"\u05D4\u05DE\u05D9\u05E7\u05E8\u05D5\u05E4\u05D5\u05DF \u05D7\u05E1\u05D5\u05DD \u05D1\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4, \u05D5\u05DC\u05DB\u05DF \u05D0\u05D9 \u05D0\u05E4\u05E9\u05E8 \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9.",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",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",popOut:"\u05E4\u05EA\u05D9\u05D7\u05D4 \u05D1\u05DB\u05E8\u05D8\u05D9\u05E1\u05D9\u05D9\u05D4 \u05D7\u05D3\u05E9\u05D4",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",queueMessage:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DC\u05EA\u05D5\u05E8",removeQueuedMessage:"\u05D4\u05E1\u05E8\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DE\u05D4\u05EA\u05D5\u05E8",removeAttachment:"\u05D4\u05E1\u05E8\u05EA {name}",suggestedReplies:"\u05EA\u05E9\u05D5\u05D1\u05D5\u05EA \u05DE\u05D5\u05E6\u05E2\u05D5\u05EA",compactingContext:"\u05DE\u05D1\u05E6\u05E2 \u05D0\u05D5\u05E4\u05D8\u05D9\u05DE\u05D9\u05D6\u05E6\u05D9\u05D4 \u05DC\u05D4\u05E7\u05E9\u05E8 \u05D4\u05E9\u05D9\u05D7\u05D4\u2026",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",talkToOperator:"\u05D3\u05D1\u05E8\u05D5 \u05E2\u05DD \u05D0\u05D3\u05DD",connectingOperator:"\u05DE\u05D7\u05D1\u05E8\u05D9\u05DD \u05D0\u05D5\u05EA\u05DA \u05DC\u05D0\u05D3\u05DD\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}",operatorBadgeTitle:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D9",chatNotice:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD \u05E2\u05D5\u05D6\u05E8 \u05D1\u05D9\u05E0\u05D4 \u05DE\u05DC\u05D0\u05DB\u05D5\u05EA\u05D9\u05EA.",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",loginPrompt:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DC\u05E7\u05D1\u05DC\u05EA \u05EA\u05DE\u05D9\u05DB\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4 \u05D5\u05DE\u05D5\u05EA\u05D0\u05DE\u05EA \u05D0\u05D9\u05E9\u05D9\u05EA",loginAction:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA",loginRequired:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05E9\u05D5\u05D7\u05D7 \u05D0\u05D9\u05EA\u05E0\u05D5",loginExpired:"\u05E4\u05D2 \u05EA\u05D5\u05E7\u05E3 \u05D4\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC\u05DA. \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA \u05D1\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5.",loginExpiredGuest:"\u05E4\u05D2 \u05EA\u05D5\u05E7\u05E3 \u05D4\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC\u05DA. \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA \u05D1\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5, \u05D0\u05D5 \u05D4\u05EA\u05D7\u05D9\u05DC\u05D5 \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4 \u05DB\u05D0\u05D5\u05E8\u05D7\u05D9\u05DD.",startAsGuest:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",loggedInAs:"\u05DE\u05D7\u05D5\u05D1\u05E8/\u05EA \u05D1\u05EA\u05D5\u05E8 {name}",loggedIn:"\u05DE\u05D7\u05D5\u05D1\u05E8/\u05EA",dismissLoginPrompt:"\u05D4\u05E1\u05EA\u05E8\u05D4",emailTranscript:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05DE\u05DC\u05D9\u05DC \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC",emailTranscriptPrompt:"\u05E7\u05D1\u05DC\u05D5 \u05E2\u05D5\u05EA\u05E7 \u05E9\u05DC \u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC.",emailTranscriptEmailLabel:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D3\u05D5\u05D0\u05F4\u05DC",emailTranscriptSend:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05EA\u05DE\u05DC\u05D9\u05DC",emailTranscriptSending:"\u05E9\u05D5\u05DC\u05D7\u05D9\u05DD\u2026",emailTranscriptSent:"\u05E0\u05E9\u05DC\u05D7 \u05D0\u05DC {email}.",emailTranscriptAlreadySent:"\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05DB\u05D1\u05E8 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05E9\u05DC\u05D7\u05D5 \u05D4\u05D5\u05D3\u05E2\u05D4 \u05D7\u05D3\u05E9\u05D4 \u05DB\u05D3\u05D9 \u05DC\u05E9\u05DC\u05D5\u05D7 \u05D0\u05D5\u05EA\u05D4 \u05E9\u05D5\u05D1.",emailTranscriptLimited:"\u05D4\u05D2\u05E2\u05EA\u05DD \u05DC\u05DE\u05D2\u05D1\u05DC\u05D4 \u05DB\u05E8\u05D2\u05E2. \u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.",emailTranscriptFailed:"\u05D4\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4. \u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1.",emailTranscriptNotDelivered:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E9\u05DC\u05D5\u05D7 \u05DC\u05DB\u05EA\u05D5\u05D1\u05EA \u05D4\u05D6\u05D5. \u05D1\u05D3\u05E7\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05D5\u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1.",emailTranscriptCancel:"\u05D1\u05D9\u05D8\u05D5\u05DC",emailTranscriptDone:"\u05E1\u05D9\u05D5\u05DD",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",visualPreparing:"\u05DE\u05DB\u05D9\u05DF \u05EA\u05E6\u05D5\u05D2\u05D4\u2026",visualError:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E6\u05D9\u05D2 \u05EA\u05E6\u05D5\u05D2\u05D4 \u05D6\u05D5.",visualPartial:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E6\u05D9\u05D2 \u05D7\u05DC\u05E7\u05D9\u05DD \u05DE\u05EA\u05E6\u05D5\u05D2\u05D4 \u05D6\u05D5.",visualSoldOut:"\u05D0\u05D6\u05DC \u05DE\u05D4\u05DE\u05DC\u05D0\u05D9",visualCartEmpty:"\u05D4\u05E2\u05D2\u05DC\u05D4 \u05E9\u05DC\u05DA \u05E8\u05D9\u05E7\u05D4.",visualQuantity:"\u05DB\u05DE\u05D5\u05EA",visualChoose:"\u05D1\u05D7\u05E8\u05D5",visualDirect:"\u05D9\u05E9\u05D9\u05E8",visualVia:"\u05D3\u05E8\u05DA",visualNight:"\u05DC\u05D9\u05DC\u05D4 \u05D0\u05D7\u05D3",visualNights:"{count} \u05DC\u05D9\u05DC\u05D5\u05EA",visualPerNight:"\u05DC\u05DC\u05D9\u05DC\u05D4",visualTravellers:"\u05E0\u05D5\u05E1\u05E2\u05D9\u05DD",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thought:"\u05DE\u05D7\u05E9\u05D1\u05D4",thoughtFor:"\u05D7\u05E9\u05D1 \u05D1\u05DE\u05E9\u05DA {time}",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",copyTicketReference:"\u05E4\u05E0\u05D9\u05D9\u05D4 {reference}, \u05D4\u05E2\u05EA\u05E7\u05D4",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",chatUnavailable:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF \u05DB\u05E8\u05D2\u05E2",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",contentHelpful:"\u05D4\u05D0\u05DD \u05D6\u05D4 \u05E2\u05D6\u05E8?",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",homeAskPlaceholder:"\u05E9\u05D0\u05DC\u05D5 \u05E9\u05D0\u05DC\u05D4\u2026",homeWhatsNew:"\u05DE\u05D4 \u05D7\u05D3\u05E9",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:"\u05D0\u05D9\u05DF \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8 \u201E{query}\u201D",helpShowMore:"\u05D4\u05E6\u05D2\u05EA \u05E2\u05D5\u05D3",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",newsShowMore:"\u05D4\u05E6\u05D2\u05EA \u05E2\u05D5\u05D3",newsUnseen:"\u05E4\u05D5\u05E1\u05D8 \u05D7\u05D3\u05E9",unread:"\u05DC\u05D0 \u05E0\u05E7\u05E8\u05D0",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",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",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",askFallbackQuestion:"\u05D0\u05E0\u05D0 \u05E1\u05E4\u05E7\u05D5 \u05D0\u05EA \u05D4\u05DE\u05D9\u05D3\u05E2 \u05D4\u05D7\u05E1\u05E8.",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",decline:"\u05D3\u05D7\u05D9\u05D9\u05D4",changeAnswer:"\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05EA\u05E9\u05D5\u05D1\u05D4",approvalPrompt:"{action}?",approvalEditHint:"\u05D0\u05E4\u05E9\u05E8 \u05DC\u05E9\u05E0\u05D5\u05EA \u05D0\u05EA \u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05DE\u05E9\u05D9\u05DA.",stepInput:"\u05E7\u05DC\u05D8",stepWorking:"\u05D1\u05D1\u05D9\u05E6\u05D5\u05E2",stepWorkingOnIt:"\u05DE\u05D8\u05E4\u05DC\u05D9\u05DD \u05D1\u05D6\u05D4\u2026",stepNeedsYourApproval:"\u05E0\u05D3\u05E8\u05E9 \u05D4\u05D0\u05D9\u05E9\u05D5\u05E8 \u05E9\u05DC\u05DA",stepWaitingForVisitor:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05DE\u05D1\u05E7\u05E8",stepApproved:"\u05D0\u05D5\u05E9\u05E8",stepDeclined:"\u05E0\u05D3\u05D7\u05D4",stepReplaced:"\u05D4\u05D5\u05D7\u05DC\u05E3",stepFailed:"\u05E0\u05DB\u05E9\u05DC",stepDidNotWork:"\u05DC\u05D0 \u05D4\u05E6\u05DC\u05D9\u05D7",decidedYouApproved:"\u05D0\u05D9\u05E9\u05E8\u05EA",decidedYouDeclined:"\u05D3\u05D7\u05D9\u05EA",decidedVisitorApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05D1\u05E7\u05E8",decidedVisitorDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05D1\u05E7\u05E8",decidedTeamApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D7\u05D1\u05E8 \u05E6\u05D5\u05D5\u05EA",decidedTeamDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D7\u05D1\u05E8 \u05E6\u05D5\u05D5\u05EA",decidedMemberApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",decidedMemberDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",stepRawData:"\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05D2\u05D5\u05DC\u05DE\u05D9\u05D9\u05DD",decidedRulesApproved:"\u05D0\u05D5\u05E9\u05E8 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",decidedRulesDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolStepsFailed:"{count} \u05E0\u05DB\u05E9\u05DC\u05D5",statusStopped:"\u05E0\u05E2\u05E6\u05E8",toolStepsStopped:"\u05E0\u05E2\u05E6\u05E8 \u05D0\u05D7\u05E8\u05D9 {count} \u05E9\u05DC\u05D1\u05D9\u05DD",toolStepsStoppedOne:"\u05E0\u05E2\u05E6\u05E8 \u05D0\u05D7\u05E8\u05D9 \u05E9\u05DC\u05D1 \u05D0\u05D7\u05D3"},oh={attach:"\u6DFB\u52A0\u9644\u4EF6",file:"\u6587\u4EF6",attachmentMimeRejected:"\u6B64\u804A\u5929\u4E0D\u63A5\u53D7 {name} \u7684\u6587\u4EF6\u7C7B\u578B\u3002",attachmentTooLarge:"{name} \u592A\u5927\u4E86\u3002\u6587\u4EF6\u603B\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {max}\u3002",poweredBy:"\u7531 {name} \u63D0\u4F9B\u652F\u6301",attachmentTooMany:"\u6700\u591A\u53EF\u6DFB\u52A0 {count} \u4E2A\u9644\u4EF6\u3002",attachmentUploadFailed:"{name} \u4E0A\u4F20\u5931\u8D25\u3002",conversationLoading:"\u6B63\u5728\u52A0\u8F7D\u804A\u5929\u2026",loadPreviousMessages:"\u52A0\u8F7D\u66F4\u65E9\u7684\u6D88\u606F",close:"\u5173\u95ED",collapse:"\u6536\u8D77",collapseSidebar:"\u6536\u8D77\u4FA7\u8FB9\u680F",composerPlaceholder:"\u8F93\u5165\u6D88\u606F\u2026",dateLastWeek:"\u6700\u8FD1 7 \u5929",dateOlder:"\u66F4\u65E9",dateToday:"\u4ECA\u5929",dateYesterday:"\u6628\u5929",dropZone:"\u62D6\u653E\u6587\u4EF6\u4EE5\u6DFB\u52A0\u9644\u4EF6",dropZoneRejected:"\u8FD9\u4E9B\u6587\u4EF6\u65E0\u6CD5\u5728\u6B64\u6DFB\u52A0",errorGeneric:"\u51FA\u4E86\u70B9\u95EE\u9898",errorRateLimited:"\u8BF7\u6C42\u8FC7\u591A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",errorRateLimitedIn:"\u8BF7\u6C42\u8FC7\u591A\uFF0C\u8BF7\u5728 {seconds} \u79D2\u540E\u91CD\u8BD5\u3002",errorOffline:"\u65E0\u6CD5\u8FDE\u63A5\u670D\u52A1\u5668\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",errorServer:"\u6211\u4EEC\u8FD9\u8FB9\u51FA\u4E86\u70B9\u95EE\u9898\u3002\u8BF7\u91CD\u8BD5\u3002",errorOriginNotAllowed:"\u6B64\u804A\u5929\u5C1A\u672A\u4E3A\u672C\u7F51\u7AD9\u8BBE\u7F6E\u3002",errorMessageTooLong:"\u6D88\u606F\u592A\u957F\u4E86\u3002\u8BF7\u7F29\u77ED\u540E\u91CD\u65B0\u53D1\u9001\u3002",errorReconnecting:"\u8FDE\u63A5\u5DF2\u65AD\u5F00\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5\u2026",errorRetry:"\u91CD\u8BD5",expand:"\u5C55\u5F00",expandSidebar:"\u5C55\u5F00\u4FA7\u8FB9\u680F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",fullscreen:"\u5168\u5C4F",history:"\u5386\u53F2\u8BB0\u5F55",historyBack:"\u8FD4\u56DE\u804A\u5929",historyEmpty:"\u8FD8\u6CA1\u6709\u4EE5\u524D\u7684\u804A\u5929",historyLoading:"\u6B63\u5728\u52A0\u8F7D\u4F60\u7684\u804A\u5929\u2026",historyContinue:"\u7EE7\u7EED\u804A\u5929",historyTitle:"\u804A\u5929\u8BB0\u5F55",loadMoreConversations:"\u52A0\u8F7D\u66F4\u591A\u5BF9\u8BDD",language:"\u8BED\u8A00",launcherOpen:"\u6253\u5F00\u804A\u5929",launcherAsk:"\u8BE2\u95EE {name}",micBlocked:"\u6B64\u7F51\u7AD9\u7684\u9EA6\u514B\u98CE\u5DF2\u88AB\u963B\u6B62\uFF0C\u65E0\u6CD5\u5F00\u59CB\u8BED\u97F3\u8F93\u5165\u3002",micStart:"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",micStop:"\u505C\u6B62\u8BED\u97F3\u8F93\u5165",moreActions:"\u66F4\u591A\u64CD\u4F5C",newConversation:"\u65B0\u804A\u5929",panelTitle:"\u804A\u5929",popOut:"\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",resizeHandle:"\u62D6\u52A8\u4EE5\u8C03\u6574\u5927\u5C0F",scrollToBottom:"\u6EDA\u52A8\u5230\u6700\u65B0",send:"\u53D1\u9001",queueMessage:"\u6392\u961F\u53D1\u9001",removeQueuedMessage:"\u79FB\u9664\u6392\u961F\u7684\u6D88\u606F",removeAttachment:"\u79FB\u9664 {name}",suggestedReplies:"\u63A8\u8350\u56DE\u590D",compactingContext:"\u6B63\u5728\u4F18\u5316\u5BF9\u8BDD\u4E0A\u4E0B\u6587\u2026",soundOff:"\u5173\u95ED\u58F0\u97F3",soundOn:"\u6253\u5F00\u58F0\u97F3",talkToOperator:"\u4E0E\u771F\u4EBA\u4EA4\u8C08",connectingOperator:"\u6B63\u5728\u4E3A\u4F60\u8054\u7CFB\u771F\u4EBA\u2026",noOperatorAvailable:"\u76EE\u524D\u6CA1\u6709\u4EBA\u6709\u7A7A\uFF0C\u8BF7\u7559\u4E0B\u4F60\u7684\u8054\u7CFB\u65B9\u5F0F\uFF0C\u6211\u4EEC\u4F1A\u8DDF\u8FDB\u3002",chattingWithOperator:"\u4F60\u6B63\u5728\u4E0E {operator} \u804A\u5929",operatorBadgeTitle:"\u5728\u7EBF\u804A\u5929",chatNotice:"\u4F60\u6B63\u5728\u4E0E AI \u52A9\u624B\u804A\u5929\u3002",cancelOperatorRequest:"\u7EE7\u7EED\u4E0E AI \u804A\u5929",loginPrompt:"\u767B\u5F55\u4EE5\u83B7\u5F97\u66F4\u5FEB\u3001\u66F4\u4E2A\u6027\u5316\u7684\u652F\u6301",loginAction:"\u767B\u5F55",loginRequired:"\u767B\u5F55\u540E\u4E0E\u6211\u4EEC\u804A\u5929",loginExpired:"\u4F60\u7684\u767B\u5F55\u5DF2\u8FC7\u671F\u3002\u8BF7\u767B\u5F55\u4EE5\u7EE7\u7EED\u6B64\u804A\u5929\u3002",loginExpiredGuest:"\u4F60\u7684\u767B\u5F55\u5DF2\u8FC7\u671F\u3002\u8BF7\u767B\u5F55\u4EE5\u7EE7\u7EED\u6B64\u804A\u5929\uFF0C\u6216\u4EE5\u8BBF\u5BA2\u8EAB\u4EFD\u5F00\u59CB\u65B0\u5BF9\u8BDD\u3002",startAsGuest:"\u5F00\u59CB\u65B0\u5BF9\u8BDD",loggedInAs:"\u5DF2\u767B\u5F55\u4E3A {name}",loggedIn:"\u5DF2\u767B\u5F55",dismissLoginPrompt:"\u9690\u85CF",emailTranscript:"\u901A\u8FC7\u90AE\u4EF6\u53D1\u9001\u804A\u5929\u8BB0\u5F55",emailTranscriptPrompt:"\u901A\u8FC7\u90AE\u4EF6\u83B7\u53D6\u6B64\u5BF9\u8BDD\u7684\u526F\u672C\u3002",emailTranscriptEmailLabel:"\u90AE\u7BB1\u5730\u5740",emailTranscriptSend:"\u53D1\u9001\u804A\u5929\u8BB0\u5F55",emailTranscriptSending:"\u6B63\u5728\u53D1\u9001\u2026",emailTranscriptSent:"\u5DF2\u53D1\u9001\u81F3 {email}\u3002",emailTranscriptAlreadySent:"\u6B64\u5BF9\u8BDD\u5DF2\u901A\u8FC7\u90AE\u4EF6\u53D1\u9001\u3002\u53D1\u9001\u4E00\u6761\u65B0\u6D88\u606F\u540E\u53EF\u518D\u6B21\u53D1\u9001\u3002",emailTranscriptLimited:"\u4F60\u5DF2\u8FBE\u5230\u5F53\u524D\u4E0A\u9650\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",emailTranscriptFailed:"\u53D1\u9001\u5931\u8D25\u3002\u8BF7\u91CD\u8BD5\u3002",emailTranscriptNotDelivered:"\u65E0\u6CD5\u53D1\u9001\u5230\u6B64\u5730\u5740\u3002\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002",emailTranscriptCancel:"\u53D6\u6D88",emailTranscriptDone:"\u5B8C\u6210",stop:"\u505C\u6B62",theme:"\u4E3B\u9898",themeAuto:"\u81EA\u52A8",themeDark:"\u6DF1\u8272",themeLight:"\u6D45\u8272",textSize:"\u6587\u5B57\u5927\u5C0F",textSizeSmall:"\u5C0F",textSizeNormal:"\u6807\u51C6",textSizeLarge:"\u5927",loading:"\u6B63\u5728\u52A0\u8F7D\u2026",visualPreparing:"\u6B63\u5728\u51C6\u5907\u56FE\u8868\u2026",visualError:"\u65E0\u6CD5\u663E\u793A\u6B64\u56FE\u8868\u3002",visualPartial:"\u6B64\u56FE\u8868\u7684\u90E8\u5206\u5185\u5BB9\u65E0\u6CD5\u663E\u793A\u3002",visualSoldOut:"\u5DF2\u552E\u7F44",visualCartEmpty:"\u4F60\u7684\u8D2D\u7269\u8F66\u662F\u7A7A\u7684\u3002",visualQuantity:"\u6570\u91CF",visualChoose:"\u9009\u62E9",visualDirect:"\u76F4\u98DE",visualVia:"\u7ECF\u505C",visualNight:"1 \u665A",visualNights:"{count} \u665A",visualPerNight:"\u6BCF\u665A",visualTravellers:"\u65C5\u5BA2",thinking:"\u6B63\u5728\u601D\u8003\u2026",thought:"\u601D\u8003\u8FC7\u7A0B",thoughtFor:"\u601D\u8003\u4E86 {time}",toolResult:"\u7ED3\u679C",sources:"\u6765\u6E90",feedbackUp:"\u56DE\u7B54\u5F88\u597D",feedbackDown:"\u56DE\u7B54\u4E0D\u597D",feedbackThanks:"\u611F\u8C22\u4F60\u7684\u53CD\u9988",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",copyTicketReference:"\u5DE5\u5355 {reference}\uFF0C\u590D\u5236",tabHome:"\u9996\u9875",tabConversations:"\u804A\u5929",tabHelp:"\u5E2E\u52A9",tabNews:"\u52A8\u6001",modulesEmpty:"\u8FD9\u91CC\u8FD8\u6CA1\u6709\u5185\u5BB9",chatUnavailable:"\u6B64\u804A\u5929\u76EE\u524D\u4E0D\u53EF\u7528",moduleBack:"\u8FD4\u56DE",contentLoading:"\u6B63\u5728\u52A0\u8F7D\u2026",contentHelpful:"\u8FD9\u5BF9\u4F60\u6709\u5E2E\u52A9\u5417\uFF1F",homeGreeting:"\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u4F60\uFF1F",homeGreetingNamed:"\u4F60\u597D\uFF0C{name} \u{1F44B}",homeGreetingLead:"\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u4F60\uFF1F",homeSearchPlaceholder:"\u641C\u7D22\u5E2E\u52A9",homeAskPlaceholder:"\u63D0\u51FA\u95EE\u9898\u2026",homeWhatsNew:"\u6700\u65B0\u52A8\u6001",homeContentTitle:"\u70ED\u95E8\u6587\u7AE0",homeStatus:"\u72B6\u6001",helpTitle:"\u5E2E\u52A9",helpSearchPlaceholder:"\u641C\u7D22\u5E2E\u52A9",helpEmpty:"\u8FD8\u6CA1\u6709\u5E2E\u52A9\u6587\u7AE0",helpLoading:"\u6B63\u5728\u52A0\u8F7D\u5E2E\u52A9\u2026",helpSearchEmpty:"\u6CA1\u6709\u627E\u5230\u201C{query}\u201D\u7684\u7ED3\u679C",helpShowMore:"\u663E\u793A\u66F4\u591A",newsTitle:"\u52A8\u6001",newsEmpty:"\u8FD8\u6CA1\u6709\u52A8\u6001",newsLoading:"\u6B63\u5728\u52A0\u8F7D\u52A8\u6001\u2026",newsShowMore:"\u663E\u793A\u66F4\u591A",newsUnseen:"\u65B0\u6587\u7AE0",unread:"\u672A\u8BFB",formRequired:"\u6B64\u9879\u4E3A\u5FC5\u586B",formInvalidEmail:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740",formInvalidTel:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7535\u8BDD\u53F7\u7801",formInvalidNumber:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u6570\u5B57",formOtherPlaceholder:"\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u2026",inputRequired:"\u9700\u8981\u4F60\u56DE\u7B54\u7684\u95EE\u9898",askFallbackQuestion:"\u8BF7\u63D0\u4F9B\u7F3A\u5C11\u7684\u4FE1\u606F\u3002",inputBadge:"\u95EE\u9898",inputAnswered:"\u5DF2\u56DE\u7B54",inputSkipped:"\u5DF2\u8DF3\u8FC7",showOptions:"\u663E\u793A\u9009\u9879",hideOptions:"\u9690\u85CF\u9009\u9879",qtypeText:"\u4F60\u7684\u56DE\u7B54",qtypeEmail:"\u90AE\u7BB1\u5730\u5740",qtypePhone:"\u7535\u8BDD\u53F7\u7801",qtypeNumber:"\u6570\u5B57",qtypeDate:"\u65E5\u671F",qtypeChooseOne:"\u9009\u62E9\u4E00\u9879",qtypeChooseAny:"\u53EF\u591A\u9009",qtypeBoolean:"\u662F / \u5426",inputSubmit:"\u63D0\u4EA4\u56DE\u7B54",inputSubmitHint:"Enter \u53D1\u9001 \xB7 Shift+Enter \u6362\u884C",inputSkip:"\u8DF3\u8FC7",confirmYes:"\u662F",confirmNo:"\u5426",approve:"\u6279\u51C6",decline:"\u62D2\u7EDD",changeAnswer:"\u4FEE\u6539\u56DE\u7B54",approvalPrompt:"{action}\uFF1F",approvalEditHint:"\u5728\u6B64\u6B65\u9AA4\u7EE7\u7EED\u4E4B\u524D\uFF0C\u4F60\u53EF\u4EE5\u4FEE\u6539\u56DE\u7B54\u3002",stepInput:"\u8F93\u5165",stepWorking:"\u8FDB\u884C\u4E2D",stepWorkingOnIt:"\u6B63\u5728\u5904\u7406\u2026",stepNeedsYourApproval:"\u9700\u8981\u4F60\u7684\u6279\u51C6",stepWaitingForVisitor:"\u7B49\u5F85\u8BBF\u5BA2",stepApproved:"\u5DF2\u6279\u51C6",stepDeclined:"\u5DF2\u62D2\u7EDD",stepReplaced:"\u5DF2\u66FF\u6362",stepFailed:"\u5931\u8D25",stepDidNotWork:"\u672A\u6210\u529F",decidedYouApproved:"\u4F60\u5DF2\u6279\u51C6",decidedYouDeclined:"\u4F60\u5DF2\u62D2\u7EDD",decidedVisitorApproved:"\u8BBF\u5BA2\u5DF2\u6279\u51C6",decidedVisitorDeclined:"\u8BBF\u5BA2\u5DF2\u62D2\u7EDD",decidedTeamApproved:"\u56E2\u961F\u6210\u5458\u5DF2\u6279\u51C6",decidedTeamDeclined:"\u56E2\u961F\u6210\u5458\u5DF2\u62D2\u7EDD",decidedMemberApproved:"{name} \u5DF2\u6279\u51C6",decidedMemberDeclined:"{name} \u5DF2\u62D2\u7EDD",stepRawData:"\u539F\u59CB\u6570\u636E",decidedRulesApproved:"\u5DF2\u81EA\u52A8\u6279\u51C6",decidedRulesDeclined:"\u5DF2\u81EA\u52A8\u62D2\u7EDD",edit:"\u7F16\u8F91",toolStepsFailed:"{count} \u4E2A\u5931\u8D25",statusStopped:"\u5DF2\u505C\u6B62",toolStepsStopped:"\u5728 {count} \u6B65\u540E\u505C\u6B62",toolStepsStoppedOne:"\u5728 1 \u6B65\u540E\u505C\u6B62"},ih={en:ui,fr:eh,es:nh,ar:th,he:rh,zh:oh};function pi(e,t){let n=sd(e),r=fi(t),o=ih[ad(n)],i=r?{...t[n],...t[e]}:t??{},s=r?t.en??{}:{};return{...ui,...o,...s,...i}}function sd(e){return(e.split("-")[0]??"en").toLowerCase()}var ah=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function _i(e){return ah.has(sd(e))}function at(e,t){return e[t]??t}function fi(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}var dd=["decided","auto-decided","unasked","failed"],gi=["platform","mcp","api","webmcp"],sh=["none","values","table","json","table-and-json"];function ud(e,t){return typeof t=="string"&&e.some(n=>n===t)}var lh={visitor:{stepsFrom:gi,stepsShown:[],stepDetails:"values",showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},member:{stepsFrom:gi,stepsShown:dd,stepDetails:"table-and-json",showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}},ch=["showStepSystem","showDecidedBy","foldApprovals"];function pd(e){let t={};if(typeof e!="object"||e===null)return t;for(let i of ch){let s=Reflect.get(e,i);typeof s=="boolean"&&(t[i]=s)}let n=Reflect.get(e,"stepsFrom");Array.isArray(n)&&(t.stepsFrom=gi.filter(i=>n.includes(i)));let r=Reflect.get(e,"stepsShown");Array.isArray(r)&&(t.stepsShown=dd.filter(i=>r.includes(i)));let o=Reflect.get(e,"stepDetails");return ud(sh,o)&&(t.stepDetails=o),t}function _d(e,t){return{...lh[t],...e}}var fd=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,dh=4e3;function Ss(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function uh(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,""),n=t.indexOf("__");return Ss(n>0?t.slice(n+2):t)}function ph(e,t,n){let r=e.approval;return r?.replacedByMessageId?"replaced":e.state==="output-available"?n.error===void 0?"done":"failed":e.state==="output-error"?t.interrupted?"stopped":"failed":e.state==="output-denied"||r?.approved===!1?"declined":e.state==="approval-responded"||r?.approved===!0?t.cutOff?"stopped":"approved":e.state==="approval-requested"?t.submitted?"submitted":t.cutOff?"stopped":t.superseded?"replaced":"waiting":t.live?"running":"stopped"}function _h(e,t){if(e.isAutomatic)return"rules";let n=e.respondedBy;return n?.visitorId?"visitor":n?.userId?n.userId===t.userId?"you":"teamMember":t.decides?"you":"visitor"}function fh(e,t,n,r,o){let i=r[t?"inputAnswered":"inputSkipped"];if(o)return{label:i,title:i};let s=r[t?"stepApproved":"stepDeclined"];if(e==="teamMember"&&n)return{label:s,title:r[t?"decidedMemberApproved":"decidedMemberDeclined"].replace("{name}",n)};let l=r[gh[e][t?0:1]];return e==="you"?{label:s,title:l}:{label:l,title:l}}var gh={you:["decidedYouApproved","decidedYouDeclined"],visitor:["decidedVisitorApproved","decidedVisitorDeclined"],teamMember:["decidedTeamApproved","decidedTeamDeclined"],rules:["decidedRulesApproved","decidedRulesDeclined"]};function mh(e,t){switch(e){case"running":return t.strings.stepWorking;case"waiting":return t.reader.decides?t.strings.stepNeedsYourApproval:t.strings.stepWaitingForVisitor;case"submitted":return t.strings.stepWorkingOnIt;case"approved":return t.strings.stepApproved;case"declined":return t.card?t.strings.inputSkipped:t.strings.stepDeclined;case"replaced":return t.card?t.strings.inputSkipped:t.strings.stepReplaced;case"stopped":return t.strings.statusStopped;case"failed":return t.plain?t.strings.stepDidNotWork:t.strings.stepFailed;case"done":return"";default:return e}}function $t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gd(e){return typeof e=="string"?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):""}function ld(e){return gd(e)||(e!==null&&typeof e=="object"?JSON.stringify(e):"")}function hh(e){if(!$t(e))return ld(e);let[t,...n]=Object.values(e).map(ld).filter(Boolean);return t===void 0?"":n.length>0?`${t} (${n.join(", ")})`:t}function cd(e,t){if(!$t(e))return[];let n=[];function r(i,s){if(Array.isArray(i)){let c=i.map(hh).filter(Boolean).join(", ");c&&n.push({path:s,value:c});return}if($t(i)){for(let[c,u]of Object.entries(i))r(u,[...s,c]);return}let l=gd(i);l&&(t.withIds||!fd.test(l))&&n.push({path:s,value:l})}r(e,[]);let o=n.map(({path:i})=>Ss(i.at(-1)??""));return n.map(({path:i,value:s},l)=>{let c=o[l]??"";return{label:o.filter(p=>p===c).length>1&&i.length>1?`${Ss(i.at(-2)??"")} \xB7 ${c.toLowerCase()}`:c,value:s}})}function vh(e,t){if($t(e))return Object.entries(e).find(n=>n[0]!==t&&typeof n[1]=="string"&&n[1].trim().length>0&&!fd.test(n[1].trim()))?.[1].trim()}function bh(e){if(typeof e.toolMetadata?.system=="string")return e.toolMetadata.system;let t=e.toolMetadata?.systemField,n=typeof t=="string"&&$t(e.input)?e.input[t]:void 0;return typeof n=="string"&&n.trim()?n.trim():void 0}function mi(e,t=Number.POSITIVE_INFINITY){if(e==null)return;let n=typeof e=="string"?e:JSON.stringify(e,null,2);if(!(!n||n==="{}"||n==="[]"||n==='""'))return n.length>t?`${n.slice(0,t)}\u2026`:n}function yh(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(t)}catch{return e}}function md(e){if($t(e)&&e.storage==="tool-result-ref"&&"summary"in e)return md(e.summary);if($t(e)&&Array.isArray(e.content)){let t=e.content.flatMap(r=>$t(r)&&typeof r.text=="string"?[r.text]:[]).join(`
|
|
2
|
+
`),n=$t(e.structuredContent)?e.structuredContent:yh(t);return e.isError===!0?{value:n,error:$t(n)&&typeof n.error=="string"?n.error:t}:{value:n}}return $t(e)&&typeof e.error=="string"&&typeof e.instruction=="string"?{value:e,error:e.error}:{value:e}}function Ph(e){return mi(e.input)!==void 0||mi(e.output)!==void 0||!!e.errorText}function xh(e,t){let n=e.approval?"decided":"unasked",r=e.approval?.isAutomatic?"auto-decided":n;return t==="failed"?[r,"failed"]:[r]}function Sh(e){let t=e.toolMetadata?.origin;return ud(gi,t)?t:void 0}function wh(e,t,n){let{display:r}=n,o=e.approval,i=o!==void 0&&!o.isAutomatic;if(i&&ws(e,n.turn))return"card";let s=n.by==="you"||i&&n.by===void 0&&n.reader.decides,l=Sh(e),c=(l===void 0||r.stepsFrom.includes(l))&&xh(e,t.status).some(u=>r.stepsShown.includes(u));return!(s||c)||!o&&!Ph(e)?"hidden":i&&!r.foldApprovals?"card":"step"}function ws(e,t){return e.approval?.replacedByMessageId||(t.superseded||t.cutOff)&&e.approval?.approved===void 0?!1:e.state==="approval-requested"||e.state==="approval-responded"}function hd(e,t){let{turn:n,reader:r,display:o,strings:i}=t,s=md(e.output),l=ph(e,n,s),c=e.approval,u=c!==void 0&&!c.isAutomatic,p=typeof e.toolMetadata?.card=="string"?e.toolMetadata.card:void 0,_=o.stepDetails,d=_==="table"||_==="table-and-json",f=_==="none"||_==="values",v=c?.replacedByMessageId?void 0:c?.approved,m=c&&v!==void 0?_h(c,r):void 0,h=m==="teamMember"?c?.respondedBy?.userId:void 0,y=m&&v!==void 0&&(m==="you"||m==="rules"||o.showDecidedBy)?{approved:v,by:m,...fh(m,v,h&&t.names?.get(h),i,p!==void 0),...h?{userId:h}:{}}:void 0,P=uh(e),x=o.showStepSystem||e.toolMetadata?.nameShared===!0?bh(e):void 0,C=vh(e.input,typeof e.toolMetadata?.systemField=="string"?e.toolMetadata.systemField:void 0),S=e.errorText??s.error,g=d&&s.error===void 0?cd(s.value,{withIds:!0}):[],b=_==="json"||_==="table-and-json"?{input:mi(e.input),output:mi(s.value,dh)}:void 0,k=u&&ws(e,n),N=_==="none"&&!k?[]:cd(e.input,{withIds:d||k}),I=S!==void 0&&S!==""&&!f,D=$t(c?.descriptor)&&$t(c.descriptor.decision)?c.descriptor.decision:void 0,A=_!=="none"||k?D:void 0,z=y!==void 0&&(l==="approved"||l==="declined"),j={toolCallId:e.toolCallId,placement:"hidden",...p&&c?{card:p}:{},name:P,...x?{system:x}:{},status:l,statusLabel:z?"":mh(l,{reader:r,strings:i,card:p!==void 0,plain:f}),...y?{decision:y}:{},...A?{why:A}:{},...C?{summary:C}:{},fields:N,tables:d,...g.length>0?{resultFields:g}:{},...I?{error:S}:{},...b?{raw:b}:{},opens:N.length>0||g.length>0||b!==void 0||I||A!==void 0,...u&&!p?{approval:kh(e,l,{turn:n,reader:r,strings:i,name:P})}:{}};return{...j,placement:wh(e,j,{turn:n,reader:r,display:o,by:m})}}function kh(e,t,n){let r=n.strings.approvalPrompt.replace("{action}",n.name);return t==="waiting"?{ask:r,buttons:n.reader.decides?"decide":"none"}:t==="submitted"?{ask:r,buttons:"none"}:ws(e,n.turn)?n.turn.canAct&&n.reader.decides?{ask:r,buttons:"change",note:n.strings.approvalEditHint}:t==="approved"?{ask:r,buttons:"none",note:n.strings.stepWorkingOnIt}:{ask:r,buttons:"none"}:{ask:r,buttons:"none"}}function vd(e){let t=new Map;for(let i of e)t.set(i.name,(t.get(i.name)??0)+1);let n=new Map;for(let{decision:i}of e){if(!i)continue;let s=n.get(i.title)??{approved:i.approved,label:i.label,title:i.title,...i.userId?{userId:i.userId}:{},count:0};n.set(i.title,{...s,count:s.count+1})}let[r]=e,o=e.some(i=>i.status==="stopped");return{tools:[...t].map(([i,s])=>({name:i,count:s})),...e.length===1&&r?{single:{name:r.name,...r.system?{system:r.system}:{},...r.summary?{summary:r.summary}:{},...Ch(r)}}:{},marks:[...n.values()].map(({count:i,...s})=>Object.assign(s,{label:i>1?`${s.label} \xD7${i}`:s.label})),failed:e.filter(i=>i.status==="failed").length,...o?{stopped:{finished:e.filter(i=>i.status!=="stopped").length}}:{}}}function Ch(e){return!e.decision&&(e.status==="replaced"||e.status==="declined")?{outcome:e.statusLabel}:{}}function bd(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace("{count}",String(e))}var ks=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{}}},hi=new ks,Fn={get(e){try{return sessionStorage.getItem(e)}catch{return null}},set(e,t){try{sessionStorage.setItem(e,t)}catch{}},remove(e){try{sessionStorage.removeItem(e)}catch{}}};var vi={maxBytes:10485760,maxCount:10,accept:"*/*"},yd={voice:"local"},Cs={enabled:!0,sampleRate:1},Ts={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio"},Pr={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Pd={floating:["theme","textSize","history","close","clear","expand","fullscreen","popOut","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"]},Rs={enabled:!0,volume:.3,events:void 0},xd={enabled:!0,events:void 0},Sd=[{label:"tabConversations",layout:"chat"}];var Es=["off","error","warn","info","debug","trace"],Ms=L.cssPrefix,wd=`${Ms}.debug`,Th=`__${L.global}_DEBUG__`,Rh=`${Ms}-debug`,bi=2,As=null;function Ah(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Rh);if(e!==null){let t=Is(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(wd);if(e){let t=Is(e);if(t>=0)return t}}catch{}return Reflect.get(window,Th)?4:2}function Is(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=Es.findIndex(n=>n===e);if(t>=0)return t}return-1}function xr(e){let t=Is(e);if(!(t<0)){bi=t;try{window.localStorage?.setItem(wd,Es[t]??"off")}catch{}}}function eo(){return Es[bi]??"warn"}bi=Ah();function kd(e){let t=`[${Ms}:${e}]`;function n(r,o,i){return(s,l)=>{if(!(bi<r)&&(l===void 0?console[o](t,s):console[o](t,s,l),As))try{As({level:i,scope:e,message:s,payload:l})}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:r=>kd(`${e}:${r}`)}}var ee=kd("core");function to(e){As=e}var Hn=ee.scope("context"),Ih=new Set(["visitorId","conversationId","jwt","token","authorization","password"]),Cd=50,Ls=1024,Eh=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Os(e){return Td(e,"userContext",!0)}function Ns(e){return Td(e,"pageContext",!1)}function Mh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Td(e,t,n){if(e==null)return;if(!Mh(e)){Hn.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let r={},o=0;for(let[i,s]of Object.entries(e)){if(Ih.has(i)){Hn.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(o>=Cd){Hn.warn(`${t} truncated at ${Cd} keys \u2014 dropped "${i}"`);continue}let l=Lh(t,i,s);l!==void 0&&(r[i]=l,o++)}return n&&typeof r.email=="string"&&!Eh.test(r.email)&&(Hn.warn("dropped malformed context field",{field:`${t}.email`,reason:"invalid format"}),delete r.email),Object.keys(r).length>0?r:void 0}function Lh(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){Hn.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let r=n.trim();return r===""?void 0:r.length>Ls?(Hn.warn(`truncated ${e}.${t} to ${Ls} chars`),r.slice(0,Ls)):r}Hn.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}function mn(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},r=t.behavior??{},o=t.i18n??{},i=t.feedback??{},s=t.footer??{},l=t.header??{},c={enabled:t.history?.enabled??!0},{themeMode:u,themeOverrides:p}=Oh(t.theme),_=n.mode??"floating",d=Nh(o.defaultLocale),f=o.availableLocales??[o.locale??d],v=Sr(o.locale??d,f,d),m=(t.baseUrl??L.defaultBaseUrl).replace(/\/$/,""),h=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),y=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:h,dataApiBaseUrl:y,userContext:Os(t.userContext),pageContext:Ns(t.pageContext),position:n.position??(_i(v)?"bottom-left":"bottom-right"),themeMode:u,textSize:"normal",themeOverrides:p,mode:_,responseMode:r.responseMode??"streaming",showReasoning:r.showReasoning??!1,stepDisplay:_d(r.stepDisplay,"visitor"),showSources:r.showSources??!1,enableMessageFeedback:!(r.disableMessageFeedback??!1),autoSendSuggestions:r.autoSendSuggestions??!1,cardAnswerWaitSeconds:r.cardAnswerWaitSeconds??60,popOutUrl:r.popOutUrl,features:{voice:t.features?.voice??yd.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),emailTranscript:!(t.features?.disableEmailTranscript??!1),operatorRequest:t.features?.enableOperatorRequest===!0&&!(t.features.hideRequestOperatorButton??!1)},endpoints:{upload:t.endpoints?.upload??Ts.upload,transcribe:t.endpoints?.transcribe??Ts.transcribe},attachments:{accept:t.composer?.attachments?.accept??vi.accept,maxBytes:t.composer?.attachments?.maxBytes??vi.maxBytes,maxCount:t.composer?.attachments?.maxCount??vi.maxCount},locale:v,defaultLocale:d,availableLocales:f,startMinimized:r.startMinimized??!0,actions:$h(_,l.actions,c.enabled),size:{...n.size,resize:{...n.size?.resize,enabled:n.size?.resize?.enabled??!0}},launcher:qh(t.launcher,t.agent?.name),sound:Dh(i.sound),haptics:Bh(i.haptics),strings:pi(v,o.strings),stringsOverride:o.strings,composerDisclaimer:s.composerDisclaimer??"",header:{variant:l.variant??"plain",notice:l.notice,showNotice:!(l.hideNotice??!1)},poweredBy:zh(s.poweredBy),composer:Fh(t.composer),modules:Hh(t.modules,c.enabled),tracking:Uh(t.tracking,y),history:c,storage:t.storage??hi,userToken:t.userToken,continueLink:t.continueLink,tools:t.tools,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Oh(e){if(typeof e=="string")return{themeMode:e,themeOverrides:{}};if(!e||typeof e!="object")return{themeMode:"host",themeOverrides:{}};let{mode:t,...n}=e;return{themeMode:t??"host",themeOverrides:n}}function Nh(e){return e&&e!=="auto"?e:globalThis.navigator?.language||"en"}function Sr(e,t,n){if(t.length<=1||t.includes(e))return e;let r=e.split("-")[0];return r&&t.includes(r)?r:t.includes(n)?n:t[0]??e}function $h(e,t,n){let r=t??Pd[e];return n?r:r.filter(o=>o!=="history")}function Dh(e){return{enabled:e?.enabled??Rs.enabled,volume:e?.volume??Rs.volume,events:e?.events}}function Bh(e){return{enabled:e?.enabled??xd.enabled,events:e?.events}}function Uh(e,t){let n=e?.sampleRate??Cs.sampleRate;return{enabled:e?.enabled??Cs.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 zh(e){return e?.text===""&&!e.logoUrl?null:{href:L.siteUrl,...e}}function Fh(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Hh(e,t){let n=(e??Sd).slice(0,4),r=n.some(l=>l?.label&&l.layout==="help"),o=new Set,i=[];for(let l of n){if(!l?.label||!l?.layout)continue;let c=l.contentCollectionIds?.filter(Boolean),u=l.id??c?.[0]??l.layout;for(;o.has(u);)u=`${u}-${i.length}`;o.add(u);let p={id:u,label:l.label,layout:l.layout};c?.length&&(p.contentCollectionIds=c),l.layout==="home"&&(p.brandName=l.brandName,p.greetingText=l.greetingText,p.showGreeting=!(l.hideGreeting??!1),p.showSearchBar=r&&!(l.hideSearchBar??!1),p.showRecentConversations=t&&!(l.hideRecentConversations??!1),l.userAvatars?.length&&(p.userAvatars=l.userAvatars),l.status&&(p.status=l.status),p.contentBlockTitle=l.contentBlockTitle),i.push(p)}let s=Object.fromEntries(i.map(l=>[l.id,l]));return{list:i,byId:s}}function qh(e,t){let n=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??Pr.variant,size:e?.size??Pr.size,label:e?.label??Pr.label,icon:e?.icon??Pr.icon,hidden:e?.hidden??Pr.hidden,...t&&{personaName:t},callout:n}}function no(e,t){return e==="host"?"host":t??e}function $s(e,t,n,r){let o=Sr(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&n===e.themeMode&&r===e.textSize)return e;let i={...e};return o!==e.locale&&(i.locale=o,i.strings=pi(o,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),r!==e.textSize&&(i.textSize=r),i}function yi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var jh=["agent","presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints","history"];function Ds(e,t){if(!t)return e;let n={...e};for(let i of jh){let s=t[i];if(s===void 0)continue;let l=e[i];if(i==="theme"){l===void 0?n[i]=s:typeof l=="string"&&typeof s=="object"&&s!==null&&(n[i]={...s,mode:l});continue}i!=="i18n"&&(n[i]=Rd(yi(s)?s:{},yi(l)?l:void 0))}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 r=e.i18n,o=t.i18n;if(r||o){let i=Rd(yi(o)?o:{},yi(r)?r:void 0);o?.availableLocales!==void 0&&(i.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(i.defaultLocale=o.defaultLocale);let s=r?.strings,l=o?.strings;(s||l)&&(i.strings=Vh(l,s)),n.i18n=i}return n}function Rd(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return n}function Vh(e,t){if(!e)return t;if(!t)return e;let n=fi(e),r=fi(t);if(!n&&!r)return{...e,...t};let o={},i=n?e:{en:e},s=r?t:{en:t};for(let[l,c]of Object.entries(i))o[l]={...c};for(let[l,c]of Object.entries(s))o[l]={...o[l],...c};return o}var Wh=["clear","expand","fullscreen","popOut","sound","history","language","theme","textSize","close"];function Gh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function hn(e){return e!=="false"}function Kh(e){try{return pd(JSON.parse(e))}catch{return}}function Qh(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function Yh(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}var Id=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["continue-link","continueLink"],["theme","theme",e=>e]],Ed=[["mode","mode",e=>e],["position","position",e=>e]],Md=[["width","width"],["height","height"]],Ld=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",hn],["show-reasoning","showReasoning",hn],["step-display","stepDisplay",Kh],["show-sources","showSources",hn],["disable-message-feedback","disableMessageFeedback",hn],["auto-send-suggestions","autoSendSuggestions",hn],["card-answer-wait-seconds","cardAnswerWaitSeconds",Qh],["pop-out-url","popOutUrl"]],Od=[["locale","locale"]],Jh=new Set(Wh);function Xh(e){return Yh(e).filter(t=>Jh.has(t))}var Nd=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",hn]],$d=[["features-disable-file-upload","disableFileUpload",hn],["features-disable-email-transcript","disableEmailTranscript",hn],["features-voice","voice",e=>e]],Dd=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Bd=[["user-id","id"],["user-email","email"],["user-name","name"]],Ud=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Zh=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],ev=[Id,Ed,Md,Ld,Od,Nd,$d,Dd,Bd,Ud],tv=new Set(["start-minimized"]),Bs=[...ev.flatMap(e=>e.map(([t])=>t).filter(t=>!tv.has(t))),...Zh];function Pi(e){let t={};function n(f){let v=e(f);return v===null||v===""?void 0:v}for(let[f,v,m]of Id){let h=n(f);h!==void 0&&Reflect.set(t,v,m?m(h):h)}let r=qn(n,Ed),o=qn(n,Md);(r||o)&&(t.presentation={...r,...o?{size:o}:{}});let i=qn(n,Ld);i&&(t.behavior=i);let s=qn(n,Od);s&&(t.i18n=s);let l=rv(e,n);l&&(t.launcher=l);let c=qn(n,$d);c&&(t.features=c);let u=qn(n,Dd);u&&(t.endpoints=u);let p=Ad(n,Bd,"user-context");p&&(t.userContext=p);let _=Ad(n,Ud,"page-context");_&&(t.pageContext=_);let d=n("actions");return d!==void 0&&(t.header={actions:Xh(d)}),t}function Us(e){return e?Pi(t=>e[nv(t==="data-api-base-url"?"api-base-url":t)]??null):{}}function nv(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function qn(e,t){let n={};for(let[r,o,i]of t){let s=e(r);s!==void 0&&Reflect.set(n,o,i?i(s):s)}return Object.keys(n).length>0?n:null}function Ad(e,t,n){let r={};for(let[l,c]of t){let u=e(l);u!==void 0&&(r[c]=u)}let o={},i=e(n);if(i)try{let l=JSON.parse(i);if(Gh(l))for(let[c,u]of Object.entries(l))(typeof u=="string"||typeof u=="number"||typeof u=="boolean")&&(o[c]=u)}catch{}let s={...o,...r};return Object.keys(s).length>0?s:null}function rv(e,t){let n=qn(t,Nd)??{},r=e("launcher-label");r!==null&&(n.label=r);let o=t("callout-text");if(o){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:o,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var ov=ee.scope("events"),vn={open:!1,ready:!1,unread:0},wr=class{constructor(){Z(this,"handlers",new Map);Z(this,"taps",new Set)}on(t,n){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(n),()=>this.handlers.get(t)?.delete(n)}tap(t){return this.taps.add(t),()=>this.taps.delete(t)}listensTo(t){return(this.handlers.get(t)?.size??0)>0||[...this.taps].some(n=>n.listensTo(t))}emit(t,n){for(let r of this.handlers.get(t)??[])try{r(n)}catch(o){ov.warn("listener threw",{event:t,error:o})}for(let r of this.taps)r.hear(t,n)}clear(){this.handlers.clear(),this.taps.clear()}};var iv=ee.scope("hooks"),zs="*";function Fs(e){return typeof e=="function"}var xi=new Set;function ro(e,t,n){let r={widgetId:e,event:t,listener:n};return xi.add(r),()=>{xi.delete(r)}}function av(e,t,n){let r=[...xi];for(let o of r)if(Fd(o.widgetId,e.widgetId)&&!(o.event!==zs&&o.event!==t))try{o.listener(e,t,n)}catch(i){iv.warn("hook listener threw",{event:t,error:i})}}function zd(e,t){return t.tap({hear:(n,r)=>av(e,n,r),listensTo:n=>[...xi].some(r=>r.event===n&&Fd(r.widgetId,e.widgetId))})}function Hs(e){if(Array.isArray(e))for(let t of e){let n=sv(t);n&&ro(n.widgetId,n.event,n.listener)}}function Fd(e,t){return e===zs||e===t}function sv(e){let t,n,r;if(Array.isArray(e))[t,n,r]=e;else if(lv(e))({widgetId:t,event:n,listener:r}=e);else return null;return typeof t!="string"||typeof n!="string"||!Fs(r)?null:{widgetId:t,event:n,listener:r}}function lv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var cv=new Set(["home","chats","help","news"]);function Hd(e){return typeof e!="object"||e===null||!("to"in e)||typeof e.to!="string"||!cv.has(e.to)?!1:!("id"in e)||e.id===void 0||typeof e.id=="string"}function Si(e){let[t="",...n]=e.trim().split("/");if(t===""||t==="open")return;let r=n.join("/");return r?{to:t,id:r}:{to:t}}function sn(e,t){return{text:e,send:typeof t=="object"&&t!==null&&"send"in t&&t.send===!0}}function qd(e){if(typeof e!="object"||e===null||!("text"in e)||typeof e.text!="string")return;let t=e.text.trim();return t?{text:t,send:"send"in e&&e.send===!0}:void 0}function jd(e){return`${L.cssPrefix}:${e}`}function Pt(e,t,n){e.dispatchEvent(new CustomEvent(jd(t),{detail:n}))}function Vd(e,t){let n=Object.keys(t).filter(r=>Object.hasOwn(t,r)).map(r=>{let o=t[r],i=jd(r);function s(l){return o(l instanceof CustomEvent?l.detail:void 0)}return e.addEventListener(i,s),[i,s]});return()=>{for(let[r,o]of n)e.removeEventListener(r,o)}}var Wd=ee.scope("track"),dv=64,uv=256,pv=10;function kr(e,t){let n=typeof e=="string"?e.trim():"";if(!n||n.length>dv){Wd.warn("track: ignored an event without a name of 1\u201364 characters",{name:e});return}let r=Object.fromEntries(Object.entries(typeof t=="object"&&t!==null?t:{}).filter(o=>typeof o[1]=="string"||typeof o[1]=="boolean"||Number.isFinite(o[1])));return JSON.stringify(r).length>uv?(Wd.warn("track: sent the event without its data, which is over 256 characters",{name:n}),{name:n}):Object.keys(r).length>0?{name:n,data:r}:{name:n}}function Gd(e){let t=[];return e.on("hostEvent",n=>{t.push({...n,at:Date.now()}),t.length>pv&&t.shift()}),t}var _v=new Set(["hidden","submit","button","reset","image","file","password"]);function Qd(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function fv(e){return!Qd(e)||e.name===""||e.disabled?!1:!(e instanceof HTMLInputElement&&_v.has(e.type))}function gv(e){let t=e.labels?.[0]?.textContent?.trim();return e.getAttribute("toolparamdescription")??(t||e.getAttribute("aria-description"))??void 0}function mv(e,t){let n=gv(e),r=n?{description:n}:{};return e instanceof HTMLSelectElement?{...r,type:"string",enum:[...e.options].map(o=>o.value)}:e instanceof HTMLTextAreaElement?{...r,type:"string"}:e.type==="checkbox"?{...r,type:"boolean"}:e.type==="radio"?{...r,type:"string",enum:t}:e.type==="number"||e.type==="range"?{...r,type:"number"}:{...r,type:"string"}}function hv(e,t){Object.getOwnPropertyDescriptor(Reflect.getPrototypeOf(e)??e,"value")?.set?.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function Kd(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e)}function vv(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked!==(t===!0||t==="true")&&e.click();return}if(e instanceof HTMLInputElement&&e.type==="radio"){e.value===Kd(t)&&!e.checked&&e.click();return}hv(e,Kd(t))}function bv(e,t,n){var s;let r=[...e.elements].filter(fv),o={},i=new Set;for(let l of r){let c=r.flatMap(u=>u instanceof HTMLInputElement&&u.type==="radio"&&u.name===l.name?[u.value]:[]);o[s=l.name]??(o[s]=mv(l,c)),l.required&&i.add(l.name)}return{name:t,description:n,inputSchema:{type:"object",properties:o,...i.size>0?{required:[...i]}:{}},execute(l){let c=typeof l=="object"&&l!==null?Object.entries(l):[];for(let[p,_]of c)for(let d of r)d.name===p&&vv(d,_);if(!e.hasAttribute("toolautosubmit"))return"Filled in the form. The visitor still needs to check it and press its submit button.";let u=[...new Set([...e.elements].flatMap(p=>Qd(p)&&p.name&&!p.checkValidity()?[p.name]:[]))];return u.length>0?`Filled in the form, but it can't be submitted yet: ${u.join(", ")} still needs the visitor. Ask them to complete it and press the submit button.`:(setTimeout(()=>e.requestSubmit(),0),"Filled in the form and submitted it.")}}}function Yd(){return[...document.querySelectorAll("form[toolname][tooldescription]")].flatMap(e=>{let t=e.getAttribute("toolname")?.trim()??"",n=e.getAttribute("tooldescription")?.trim()??"";return t&&n?[bv(e,t,n)]:[]})}var Jd=`${L.cssPrefix}.page-tools`,yv=20,Pv=50;function wi(e){return typeof e=="object"&&e!==null}function xv(e){return wi(e)&&(e.state==="running"||e.state==="stopped"||e.state==="finished"&&wi(e.outcome))}function Sv(e){let t=e?JSON.parse(e):void 0;if(!wi(t))return{sent:[],calls:{}};let n=Array.isArray(t.sent)?t.sent.filter(o=>typeof o=="string"):[],r=Object.fromEntries(Object.entries(wi(t.calls)?t.calls:{}).filter(o=>xv(o[1])));return{sent:n,calls:r}}var js={sent:[],calls:{}};function oo(){try{js=Sv(sessionStorage.getItem(Jd))}catch{}return js}function qs(e){js=e;try{sessionStorage.setItem(Jd,JSON.stringify(e))}catch{}}var xt={markSent(e){let t=oo();qs({...t,sent:[...t.sent.filter(n=>n!==e),e].slice(-yv)})},sentHere(e){return oo().sent.includes(e)},get(e){return oo().calls[e]},set(e,t){let n=oo(),r=Object.entries(n.calls).filter(([o])=>o!==e);qs({...n,calls:Object.fromEntries([...r,[e,t]].slice(-Pv))})},clear(e){let t=oo();e.some(n=>n in t.calls)&&qs({...t,calls:Object.fromEntries(Object.entries(t.calls).filter(([n])=>!e.includes(n)))})}};function jn(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(i,e);function o(){return i()}t?.addEventListener("abort",o,{once:!0});function i(){clearTimeout(r),t?.removeEventListener("abort",o),n()}})}var Gs=ee.scope("page-tools"),Xd="site__",Zd=3e4,wv=1e3,eu=Symbol.for(`${L.cssPrefix}.page-tools`),Ws={state:"output-error",errorText:"The page reloaded before this finished, so it may or may not have taken effect. Check with the visitor before trying it again."},nu="The visitor stopped this before it finished.";function bn(e){return typeof e=="object"&&e!==null}function kv(e){return bn(e)&&Array.isArray(e.registered)&&e.runs instanceof Map}function io(){let e=Reflect.get(globalThis,eu);if(kv(e))return e;let t={registered:[],runs:new Map};return Reflect.set(globalThis,eu,t),t}function Vn(e,t){let n=bn(t)&&t.signal instanceof AbortSignal?t.signal:void 0;if(n?.aborted)return;let r=io().registered;r.push(e);function o(){let i=r.indexOf(e);i>=0&&r.splice(i,1)}n?.addEventListener("abort",o,{once:!0})}function tu(e){return e.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,58)}function ru(e){if(!bn(e)||typeof e.name!="string"||!tu(e.name))return;let t=typeof e.title=="string"&&e.title.trim()!==""?e.title.trim().slice(0,120):void 0,n=[e.description,t].find(o=>typeof o=="string"&&o.trim()!=="")??e.name,r=e.preview;return{name:tu(e.name),...t?{title:t}:{},...typeof r=="function"?{preview:o=>Reflect.apply(r,e,[o])}:{},description:n.trim().slice(0,1024),inputSchema:{properties:{},...bn(e.inputSchema)?e.inputSchema:{},type:"object"},consequential:bn(e.annotations)&&e.annotations.consequentialHint===!0}}function Vs(e){return e.flatMap(t=>{let n=ru(t),r=bn(t)?t.execute:void 0;return!n||typeof r!="function"?(Gs.warn("skipped a tool without a name or an execute function",t),[]):[{...n,run:(o,i)=>Reflect.apply(r,t,[o,{signal:i}])}]})}async function Cv(){let e=Reflect.get(document,"modelContext")??Reflect.get(navigator,"modelContext");if(!bn(e)||typeof e.getTools!="function"||typeof e.executeTool!="function")return[];let t=e.getTools,n=e.executeTool,r=await Promise.race([Promise.resolve().then(()=>Reflect.apply(t,e,[])),jn(wv).then(()=>[])]).catch(()=>[]);return(Array.isArray(r)?r:[]).flatMap(o=>{let i=ru(o);return i?[{...i,run:(s,l)=>Reflect.apply(n,e,[o,s,{signal:l}])}]:[]})}async function ao(e=[]){let t=Vs(Yd()),n=new Set(t.map(i=>i.name)),o=[...(await Cv()).filter(i=>!n.has(i.name)),...t,...Vs(e),...Vs(io().registered)];return new Map(o.map(i=>[i.name,i]))}function Ks(e){return[...e.values()].map(({name:t,title:n,description:r,inputSchema:o,consequential:i})=>{let s={name:t,description:r,inputSchema:o};return n&&(s.title=n),i&&(s.annotations={consequentialHint:!0}),s})}function Wn(e){return e?.execution==="client"}function Cr(e){return e.startsWith(Xd)?e.slice(Xd.length):e}function Tv(e){if(e===void 0||typeof e=="function"||typeof e=="symbol")return null;let t=new WeakSet,n=JSON.stringify(e,(r,o)=>{if(typeof o=="bigint")return o.toString();if(!(typeof o=="function"||typeof o=="symbol"))return o instanceof Node?`[${o.nodeName.toLowerCase()}]`:bn(o)?t.has(o)?"[circular]":(t.add(o),o):o});return n.length>Zd?{truncated:!0,preview:n.slice(0,Zd)}:JSON.parse(n)}async function ou(e){let t=(await ao(e.optionTools)).get(Cr(e.toolName));if(!t?.preview)return;let n=t.preview;return Promise.resolve().then(()=>n(e.input)).catch(r=>{Gs.warn("a page tool preview failed",{name:t.name,error:r})})}async function Rv(e){let t=Cr(e.toolName),n=(await ao(e.optionTools)).get(t);return n?Promise.resolve().then(()=>n.run(e.input,e.signal)).then(r=>({state:"output-available",output:Tv(r)})).catch(r=>(Gs.warn("a page tool failed",{name:t,error:r}),{state:"output-error",errorText:(r instanceof Error?r.message:String(r)).slice(0,1e3)||"The page tool failed."})):{state:"output-error",errorText:`This page doesn't offer "${t}" right now; the visitor may have moved on. Tell them, or continue without it.`}}function iu(e){let{toolCallId:t}=e,n=xt.get(t);if(n?.state==="finished")return Promise.resolve(n.outcome);let{runs:r}=io(),o=r.get(t);if(o)return o.outcome;if(n?.state==="running")return xt.set(t,{state:"finished",outcome:Ws}),e.onSettled("interrupted",0),Promise.resolve(Ws);let i=new AbortController,s=performance.now();xt.set(t,{state:"running"});let l=Rv({...e,signal:i.signal}).then(c=>(r.delete(t),xt.get(t)?.state!=="running"||(xt.set(t,{state:"finished",outcome:c}),e.onSettled(c.state==="output-available"?"completed":"failed",Math.round(performance.now()-s))),c));return r.set(t,{outcome:l,controller:i}),l}function au(e){return e===Ws.errorText||e===nu}function Qs(e){return xt.set(e,{state:"stopped"}),io().runs.get(e)?.controller.abort(),nu}function su(e){xt.clear([e]),io().runs.get(e)?.controller.abort()}var he,du,Xs,yn,Ys,Ri,uu,Ci,pu,Zs,Js,Av,lo=Symbol.for("pv"),Ai={},Ii=[],Iv=/^m(i|n|o|s|text|space)$/,Ei=Array.isArray,el=Ii.slice,Kn=Object.assign;function Gn(e){e&&e.parentNode&&e.remove()}function xn(e,t,n){var r,o,i,s={},l=arguments.length;for(i in t)i=="key"?r=t[i]:i=="ref"&&typeof e!="function"?o=t[i]:s[i]=t[i];return l>2&&(s.children=l>3?el.call(arguments,2):n),so(e,s,r,o,null)}function so(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:lo,__v:o||++du,__i:-1,__u:0};return!o&&he.vnode&&he.vnode(i),i}function pe(e){return e.children}function zt(e,t){this.props=e,this.context=t,this.__g=0}function Pn(e,t){if(t==null)return e.__&&Pn(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!="function"||e.props.__P?null:Pn(e)}function Ev(e){var t,n=e.__v,r=n.__e,o=[],i=[],s=e.__P;s&&((t=Kn({constructor:lo},n)).__v=n.__v+1,he.vnode&&he.vnode(t),nl(s,t,n,e.__n,s.namespaceURI,32&n.__u?[r]:null,o,r||Pn(n),32&n.__u,i),t.__v=n.__v,t.__.__k[t.__i]=t,vu(o,t,i),n.__=n.__e=null,t.__e!=r&&_u(t))}function _u(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),_u(e)}function lu(e){(8&e.__g||(e.__g|=8,yn.push(e),Ri++))&&Ys==he.debounceRendering||((Ys=he.debounceRendering)||queueMicrotask)(fu)}function fu(){try{for(var e,t=1;yn.length;)yn.length>t&&yn.sort(uu),e=yn.shift(),t=yn.length,8&e.__g&&Ev(e)}finally{(Ri=yn.length)&&(Ys||queueMicrotask)(fu)}}function gu(e,t,n,r,o,i,s,l,c,u,p){var _,d,f,v,m,h,y=r.__k||Ii,P=t.length;for(c=Mv(n,t,y,c,P),_=0;_<P;_++)(f=n.__k[_])!=null&&(d=~f.__i&&y[f.__i]||Ai,f.__i=_,h=nl(e,f,d,o,i,s,l,c,u,p),v=f.__e,(d.ref!=f.ref||8&d.__u)&&(d.ref&&rl(d.ref,null,f,d),f.ref&&p.push(f.ref,f.__c||v,f)),m=m||v,4&f.__u?(c=mu(f,c,e,!d.__v),d.__e&&(d.__e=null)):typeof f.type=="function"&&h!==void 0?c=h:v&&(c=v.nextSibling),f.__u&=-21);return n.__e=m,c}function Mv(e,t,n,r,o){var i,s,l,c,u,p,_,d,f,v=n.length,m=v,h=0,y=0,P=e.__k=Array(o);for(i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s!="object"||s.constructor===String?s=P[i]=so(null,s):Ei(s)?s=P[i]=so(pe,{children:s}):s.constructor===lo&&s.__b?s=P[i]=so(s.type,s.props,s.key,s.ref,s.__v):P[i]=s,c=i+h,s.__=e,s.__b=e.__b+1,l=null,~(u=s.__i=Lv(s,n,c,m))&&(m--,(l=n[u])&&(l.__u|=2)),l&&l.__v?(s.__u|=16,u==c-1?h--:u==c+1?h++:u!=c&&(u>c?h--:h++,y=1)):(~u||(o>v?h--:o<v&&h++),typeof s.type!="function"&&(s.__u|=4))):P[i]=null;if(y){for(p=[],_=[],i=0;i<o;i++)if((s=P[i])&&16&s.__u){for(h=0,d=p.length;h<d;)p[f=h+d>>1]<s.__i?h=f+1:d=f;p[h]=s.__i,_[i]=h+1}for(h=p.length;i--;)_[i]&&(_[i]==h?h--:P[i].__u|=4)}if(m)for(i=0;i<v;i++)!(l=n[i])||2&l.__u||(l.__e==r&&(r=Pn(l)),ol(l,l));return r}function mu(e,t,n,r){var o,i,s,l;if(typeof e.type=="function"){if(e.props.__P)return t;if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&(o[i].__=e,t=mu(o[i],t,n,!1));return t}for(t&&!t.parentNode&&(t=Pn(e))&&!t.parentNode&&(t=null),s=e.__e,l=t;l&&l.nodeType==8;)l=l.nextSibling;for(s!=l&&(!r&&n.moveBefore&&s.parentNode?n.moveBefore(s,t):n.insertBefore(s,t||null)),t=s;(t=t&&t.nextSibling)&&t.nodeType==8&&!t.data.startsWith("$s"););return t}function tl(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(Ei(e)?e.some(function(n){tl(n,t)}):t.push(e)),t}function Lv(e,t,n,r){var o,i=e.key,s=e.type,l=t[n],c=l&&!(2&l.__u);if(l===null&&i==null||c&&i==l.key&&s==l.type)return n;if(r>(c?1:0)){for(o=n-1;o>=0;o--)if((l=t[o])&&!(2&l.__u)&&i==l.key&&s==l.type)return o;for(o=n+1;o<t.length;o++)if((l=t[o])&&!(2&l.__u)&&i==l.key&&s==l.type)return o}return-1}function cu(e,t,n){n==null&&(n=""),t[0]=="-"?e.setProperty(t,n):e[t]=n}function ki(e,t,n,r,o){var i,s;if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||cu(e.style,t);if(n)for(t in n)r&&n[t]==r[t]||cu(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")typeof n!="function"&&(n=null),typeof r!="function"&&(r=null),(e.__e||(e.__e={}))[t]=n,n&&r||(s=Js[t]||(Js[t]=Ov(t)),(e.__a||(e.__a={}))[t]=Zs,i=t!=(t=t.replace(pu,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),n?e.addEventListener(t,s,i):e.removeEventListener(t,s,i));else{if(o=="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{return void(e[t]=n??"")}catch{}if(typeof n=="function")return;n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n)}}function Ov(e){return function(t){var n=this.__e;if(n){if(n=n[e],t[Ci]==null)t[Ci]=Zs++;else if(t[Ci]<this.__a[e])return;return n(he.event?he.event(t):t)}}}function nl(e,t,n,r,o,i,s,l,c,u){var p,_,d,f,v,m,h,y,P,x,C,S,g,b,k,N,I,D,A=t.type;if(t.constructor!==lo)return null;128&n.__u&&(c=32&n.__u,p=n.__c.__z)&&(t.__u|=c,_=i=[],p.nodeType==8?l=Ti(p,i):i.push(p),l=i[0]||l),(p=he.__b)&&p(t);e:if(typeof A=="function"){d=s.length;try{if(y=t.props,P=(p=A.prototype)&&p.render,x=(p=A.contextType)&&r[p.__c],C=p?x?x.props.value:p.__:r,(f=n.__c)?(t.__c=f,2&f.__g&&(f.__g|=1)):(P?t.__c=f=new A(y,C):(t.__c=f=new zt(y,C),f.constructor=A,f.render=$v),x&&x.sub(f),f.state||(f.state={}),f.__n=r,f.__g|=8,f.__h=[],f.__k=[]),P&&(f.__s||(f.__s=f.state),A.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=Kn({},f.__s)),Kn(f.__s,A.getDerivedStateFromProps(y,f.__s)))),v=f.props,m=f.state,f.__v=t,n.__c){if(y!==v&&P&&!A.getDerivedStateFromProps&&f.componentWillReceiveProps&&f.componentWillReceiveProps(y,C),t.__v==n.__v&&!(8&f.__g)||!(4&f.__g)&&f.shouldComponentUpdate&&f.shouldComponentUpdate(y,f.__s,C)===!1){t.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(z){z&&(z.__=t)}),Ii.push.apply(f.__h,f.__k),f.__k=[],f.__h.length&&s.push(f),l=Pn(n);break e}f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,C),P&&f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,m,h)})}else P&&!A.getDerivedStateFromProps&&f.componentWillMount&&f.componentWillMount(),P&&f.componentDidMount&&f.__h.push(f.componentDidMount);f.context=C,f.props=y,f.__P=e,f.__g&=-5,S=he.__r,g=P?25:0;do f.__g&=-9,S&&S(t),p=f.render(f.props,f.state=f.__s,f.context);while(8&f.__g&&++g<25);P&&(Ii.push.apply(f.__h,f.__k),f.__k=[]),f.state=f.__s,f.getChildContext&&(r=Kn({},r,f.getChildContext())),P&&n.__c&&f.getSnapshotBeforeUpdate&&(h=f.getSnapshotBeforeUpdate(v,m)),b=p&&p.type===pe&&p.key==null?p.props.children:p,y.__P&&(p=l,o=(e=y.__P).namespaceURI,c=i=null,n.props&&n.props.__P!=e&&(n.__k.some(function(z){z&&ol(z,z)}),n.__k=null),l=n.__k?Pn(n,0):null),l=gu(e,Ei(b)?b:[b],t,n,r,o,i,s,l,c,u),y.__P&&(t.__e=null,l=p),t.__u&=-161,_&&_.some(Gn),f.__h.length&&s.push(f),1&f.__g&&(f.__g&=-4)}catch(z){if(s.length=d,t.__v=null,c||i)if(z&&z.then){if(t.__u|=128|c,i){for(~(I=i.indexOf(l||void 0))||(I=i.length);(D=i[I-1])&&D.nodeType==8;)I--;for(;I<i.length;I++)if(D=i[I])if(i[I]=null,k){if(D==N)break}else{if(D.nodeType!=8)break;D.data.startsWith("$s")&&(N=Ti(k=D))}}if(!k){for(;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;k=l}(p=Ti(k=t.__c.__z||(t.__c.__z=k)))?(t.__e=k,l=p):t.__e=l,l=l&&l.nextSibling}else i&&i.some(Gn);else t.__e=n.__e;t.__k||(t.__k=n.__k||[]),z&&z.then||hu(t),he.__e(z,t,n)}}else l=t.__e=Nv(n.__e,t,n,r,o,i,s,c,u,e);return(p=he.diffed)&&p(t),l}function Ti(e,t){if(e&&e.nodeType==8&&e.data.startsWith("$s"))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith("$s"))n++;else if(e.data.startsWith("/$s")&&!--n)return e}t&&t.push(e)}}function hu(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(hu))}function vu(e,t,n){for(var r=0;r<n.length;)rl(n[r++],n[r++],n[r++]);he.__c&&he.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){he.__e(i,o.__v)}})}function Nv(e,t,n,r,o,i,s,l,c,u){var p,_,d,f,v,m,h,y,P=n.props||Ai,x=t.props,C=t.type;if(C=="svg"?o="http://www.w3.org/2000/svg":C=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i){for(p=0;p<i.length;p++)if((v=i[p])&&(C?v.localName==C:v.nodeType==3)){e=v,i[p]=null;break}}if(!e){if(y=u.ownerDocument||document,!C)return y.createTextNode(x);e=y.createElementNS(o,C,x.is?x:u),l&&(he.__m&&he.__m(t,i),l=!1),i=null}if(C){if(u=C=="template"&&e.content||e,i=C=="textarea"&&x.defaultValue!=null?null:i&&el.call(u.childNodes),!l&&i)for(P={},p=0;p<e.attributes.length;p++)P[(v=e.attributes[p]).name]=v.value;for(p in P)v=P[p],p=="dangerouslySetInnerHTML"?d=v:p=="children"||p in x||p=="value"&&"defaultValue"in x||p=="checked"&&"defaultChecked"in x||ki(e,p,null,v,o);for(p in x)v=x[p],p=="children"?f=v:p=="dangerouslySetInnerHTML"?_=v:p=="value"?m=v:p=="checked"?h=v:l&&typeof v!="function"||P[p]===v||ki(e,p,v,P[p],o);_?(l||d&&(_.__html==d.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[]):(d&&(e.textContent=""),(C=="foreignObject"||o=="http://www.w3.org/1998/Math/MathML"&&Iv.test(C))&&(o="http://www.w3.org/1999/xhtml"),gu(u,Ei(f)?f:[f],t,n,r,o,i,s,i?i[0]:n.__k&&Pn(n,0),l,c),i&&i.some(Gn)),l&&C!="textarea"||(p="value",C=="progress"&&m==null?e.removeAttribute(p):m==null||m===e[p]&&(C!="progress"||m)||ki(e,p,m,P[p],o),p="checked",h!=null&&h!=e[p]&&ki(e,p,h,P[p],o))}else P===x||l&&e.data==x||(e.data=x);return e}function rl(e,t,n,r){try{typeof e=="function"?t?t.__x=e(t)||1:r&&(r=r.__c||r.__e)&&(t=r.__x)&&(r.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(o){he.__e(o,n)}}function ol(e,t,n){var r,o,i,s;if(he.unmount&&he.unmount(e),!(r=e.ref)||r.current&&r.current!=e.__e||rl(r,null,t,e),r=e.__c){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(l){he.__e(l,t)}r.__P=r.__n=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&ol(r[s],t,typeof e.type!="function"||n&&!e.props.__P);!n&&(r=e.__c)&&(r=r.__z)&&(o=Ti(r,i=[]))&&(r==e.__e&&i.some(Gn),Gn(o),Gn(r)),n||Gn(e.__e),e.__e=e.__c=e.__=null}function $v(e,t,n){return this.constructor(e,n)}function Kt(e,t){var n,r,o,i;he.__&&he.__(e,t),t.nodeType==9&&(t=t.documentElement),r=(n=e&&32&e.__u)?null:t.__k,t.__k=so(pe,{children:[e]}),o=[],i=[],nl(t,t.__k,r||Ai,Ai,t.namespaceURI,r?null:t.firstChild?el.call(t.childNodes):null,o,r?r.__e:t.firstChild,n,i),vu(o,t.__k,i),t.__k.props.children=null}he={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!(1&o.__g)){o.__g|=4;try{if((s=(i=o.constructor)&&i.getDerivedStateFromError)&&o.setState(i.getDerivedStateFromError(e)),o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=1),s&&8&o.__g)return void(o.__g|=2)}catch(l){e=l}}throw Ri=0,e}},du=0,Xs=function(e){return e!=null&&e.constructor===lo},zt.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=Kn({},this.state)),typeof e=="function"&&(e=e(Kn({},n),this.props)),e&&(Kn(n,e),this.__v&&(t&&this.__k.push(t),lu(this)))},zt.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),lu(this))},zt.prototype.render=pe,yn=[],Ri=0,uu=function(e,t){return e.__v.__b-t.__v.__b},Ci=Symbol(),pu=/(PointerCapture)$|Capture$/i,Zs=0,Js={},Av=0;function Lt(){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,Dv(t.subarray(6)),t[6]=(t[6]??0)&15|112,t[8]=(t[8]??0)&63|128;let n=Array.from(t,r=>r.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 Dv(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 Sn=ee.scope("persistence");function wn(e,t=hi,n){let r=n?`${e}.${n}`:e,o=`${L.cssPrefix}.${r}.storageVersion`,i=t.get(o)??void 0,s=i?`.v${i}`:"",l=`${L.cssPrefix}.${r}${s}`,c=`${L.cssPrefix}${s}.visitorId`,u=`${L.cssPrefix}${s}.lastUserSub`,p=`${l}.conversationId`,_=`${l}.userPrefs`,d=`${l}.panelOpen`,f=`${l}.panelSize`,v=`${l}.calloutDismissed`,m=`${l}.sidebarCollapsed`,h=`${l}.activeModule`,y=`${l}.seenNewsId`,P=`${l}.historyCount`,x=`${l}.loginReturn`,C=`${l}.loginPromptDismissedIn`,S={getVisitorId(){let g=t.get(c);if(g)return g;let b=Lt();return t.set(c,b),b},loadLastUserSub(){return t.get(u)??void 0},saveLastUserSub(g){t.set(u,g)},loadConversationId(){return t.get(p)??void 0},saveConversationId(g){Sn.trace("saveConversationId",{id:g,scope:r}),g?t.set(p,g):t.remove(p)},loadDraft(g){return t.get(`${l}.draft.${g}`)??""},saveDraft(g,b){let k=`${l}.draft.${g}`;b?t.set(k,b):t.remove(k)},loadMessageQueue(g){let b=t.get(`${l}.messageQueue.${g}`);if(!b)return[];try{let k=JSON.parse(b);return!Array.isArray(k)||!k.every(Bv)?[]:k}catch(k){return Sn.warn("loadMessageQueue parse failed",{error:k}),[]}},saveMessageQueue(g,b){let k=`${l}.messageQueue.${g}`;if(b.length===0){t.remove(k);return}try{t.set(k,JSON.stringify(b))}catch(N){Sn.warn("saveMessageQueue serialise failed",{error:N})}},loadUserPrefs(){let g=t.get(_);if(!g)return{};try{return il(JSON.parse(g))}catch(b){return Sn.warn("loadUserPrefs parse failed",{error:b}),{}}},saveUserPrefs(g){try{t.set(_,JSON.stringify(g))}catch(b){Sn.warn("saveUserPrefs serialise failed",{error:b})}},patchUserPrefs(g){let b=S.loadUserPrefs();S.saveUserPrefs({...b,...g})},loadPanelOpen(){let g=t.get(d);return g==="1"?!0:g==="0"?!1:null},savePanelOpen(g){t.set(d,g?"1":"0")},loadPanelSize(){let g=t.get(f);return g==="normal"||g==="expanded"||g==="fullscreen"?g:null},savePanelSize(g){t.set(f,g)},loadCalloutDismissed(g){if(!g)return!1;let b=t.get(v);return!!b&&b===g},saveCalloutDismissed(g){g?t.set(v,g):t.remove(v)},loadSidebarCollapsed(){let g=t.get(m);return g==="1"?!0:g==="0"?!1:null},saveSidebarCollapsed(g){t.set(m,g?"1":"0")},loadActiveModule(){return t.get(h)||null},saveActiveModule(g){t.set(h,g)},loadSeenNewsId(){return t.get(y)||null},saveSeenNewsId(g){t.set(y,g)},loadHistoryCount(){let g=t.get(P);if(!g)return null;let b=Number.parseInt(g,10);return Number.isFinite(b)&&b>=0?b:null},saveHistoryCount(g){t.set(P,String(g))},rememberStorageVersion(g){g&&g!==t.get(o)&&(Sn.debug("rememberStorageVersion (force-reset on next load)",{version:g}),t.set(o,g))},saveLoginReturn(g){Fn.set(x,JSON.stringify(g))},takeLoginReturn(){let g=Fn.get(x);if(g){Fn.remove(x);try{let b=JSON.parse(g);return Mi(b)&&typeof b.conversationId=="string"&&b.conversationId&&typeof b.draft=="string"?{conversationId:b.conversationId,draft:b.draft}:void 0}catch(b){Sn.warn("takeLoginReturn parse failed",{error:b});return}}},loadLoginPromptDismissedIn(){return Fn.get(C)??void 0},dismissLoginPromptIn(g){Fn.set(C,g)},clearConversation(){t.remove(p)},reset(){let g=t.get(p);g&&(t.remove(`${l}.draft.${g}`),t.remove(`${l}.messageQueue.${g}`));for(let b of[x,C])Fn.remove(b);for(let b of[c,u,p,_,f,v,m,h,y,P])t.remove(b);Sn.info("reset: forgot the visitor",{scope:r})}};return S}function Mi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bv(e){return Mi(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.text=="string"}function il(e){if(!Mi(e))return{};let t={};return typeof e.locale=="string"&&(t.locale=e.locale),typeof e.soundMuted=="boolean"&&(t.soundMuted=e.soundMuted),(e.themeMode==="auto"||e.themeMode==="light"||e.themeMode==="dark")&&(t.themeMode=e.themeMode),(e.textSize==="small"||e.textSize==="normal"||e.textSize==="large")&&(t.textSize=e.textSize),Mi(e.widgetSize)&&typeof e.widgetSize.width=="number"&&typeof e.widgetSize.height=="number"&&(t.widgetSize={width:e.widgetSize.width,height:e.widgetSize.height}),t}var Tr="7.0.0";var Uv="1",bu=60,zv=2e3,al={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:()=>{},toolResult:()=>{},toolDecision:e=>({approved:e.approved}),hostEvent:e=>({name:e.name,data:e.data&&JSON.stringify(e.data)}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,count:e.count}),contentOpen:e=>({contentId:e.contentId,contentCollectionId:e.contentCollectionId}),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 Fv(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Hv(){return location.origin+location.pathname}function qv(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function yu(e,t){let n=Math.random(),r=0,o=0,i=new Set;function s(_,d){let{tracking:f,publicKey:v,aiAgentDeploymentId:m,mode:h,themeMode:y}=t.getOptions();if(!f.enabled||Fv()||n>=f.sampleRate)return;let P=performance.now();if(P-r>6e4&&(r=P,o=0),++o>bu)return;let x=new URLSearchParams;x.set("v",Uv),x.set("_ev",Tr),x.set("e",_),f.token&&x.set("tk",f.token),v&&x.set("pk",v),m&&x.set("dep",m),x.set("vid",t.getVisitorId());let C=t.getConversationId();C&&x.set("cid",C),x.set("url",Hv());let S=qv();S&&x.set("ref",S),x.set("sw",String(screen.width)),x.set("sh",String(screen.height)),x.set("vw",String(innerWidth)),x.set("vh",String(innerHeight)),x.set("dpr",String(devicePixelRatio)),x.set("lang",navigator.language);try{x.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(x.set("m",h),x.set("th",y),d)for(let[N,I]of Object.entries(d))I!==void 0&&x.set(N,String(I));x.set("ts",String(Date.now()));let g=`${f.endpoint}?${x}`;if(g.length>zv)return;let b=new Image(1,1);i.add(b);function k(){return i.delete(b)}b.addEventListener("load",k,{once:!0}),b.addEventListener("error",k,{once:!0}),b.src=g}let l=[];function c(_,d){if(l&&_!=="handshake"){l.length<bu&&l.push([_,d]);return}let f=l??[];l=void 0;for(let[v,m]of f)s(v,m);s(_,d)}function u(_,d){return al[_]?.(d)}let p=Object.keys(al).filter(_=>Object.hasOwn(al,_)).map(_=>e.on(_,d=>c(_,u(_,d))));return()=>{for(let _ of p)_();i.clear()}}var Pu=`.__P__-generative-ui{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--__P__-space-3);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-generative-ui p{margin:0}.__P__-generative-ui-grid-container{container:__P__-generative-ui-grid / inline-size;min-width:0}.__P__-generative-ui-grid{--__P__-cols: 1;display:flex;flex-wrap:wrap;gap:16px}.__P__-generative-ui-cell{display:flex;flex-direction:column;flex:1 1 calc((100% + 16px) * min(var(--__P__-span),var(--__P__-cols)) / var(--__P__-cols) - 16.5px);align-self:flex-start;min-width:0;gap:16px}.__P__-generative-ui-grid[data-equal-heights]>.__P__-generative-ui-cell{align-self:stretch}.__P__-generative-ui-grid[data-equal-heights]>.__P__-generative-ui-cell>:only-child{flex:1}@container __P__-generative-ui-grid (min-width: 496px){.__P__-generative-ui-grid{--__P__-cols: var(--__P__-cols-2)}}@container __P__-generative-ui-grid (min-width: 752px){.__P__-generative-ui-grid{--__P__-cols: var(--__P__-cols-3)}}@container __P__-generative-ui-grid (min-width: 1008px){.__P__-generative-ui-grid{--__P__-cols: var(--__P__-cols-4)}}.__P__-generative-ui section{display:flex;flex-direction:column;gap:var(--__P__-space-2);padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);min-width:0}.__P__-generative-ui-metric{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);font-size:1.6em;font-weight:700;font-variant-numeric:tabular-nums}.__P__-generative-ui-metric svg{flex:none;width:80px;height:24px;color:var(--__P__-accent)}.__P__-generative-ui-change{align-self:flex-start;padding:2px var(--__P__-space-2);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;font-variant-numeric:tabular-nums}.__P__-generative-ui-change[data-tone=good]{color:var(--__P__-fg);background:color-mix(in oklch,var(--__P__-success) 18%,transparent)}.__P__-generative-ui-change[data-tone=bad]{color:var(--__P__-danger-text);background:var(--__P__-danger-bg)}.__P__-generative-ui-table-card{container:__P__-generative-ui-table / inline-size}.__P__-generative-ui-table{overflow-x:auto}@container __P__-generative-ui-table (max-width: 639.98px){.__P__-generative-ui-table :is(table,tbody,tr,td){display:block}.__P__-generative-ui-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.__P__-generative-ui-table tr{margin-bottom:var(--__P__-space-2);padding:var(--__P__-space-1) var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm)}.__P__-generative-ui-table td,.__P__-generative-ui-table td[data-numeric=true]{display:flex;justify-content:space-between;gap:var(--__P__-space-3);padding:var(--__P__-space-1) 0;border:0;text-align:end}.__P__-generative-ui-table td:before{content:attr(data-label);color:var(--__P__-fg-muted);text-align:start}}.__P__-generative-ui table{width:100%;border-collapse:collapse;white-space:normal}.__P__-generative-ui caption{text-align:start;font-weight:600;padding-bottom:var(--__P__-space-2)}.__P__-generative-ui th,.__P__-generative-ui td{text-align:start;padding:var(--__P__-space-2);border-bottom:1px solid var(--__P__-border)}.__P__-generative-ui :is(th,td)[data-numeric=true]{text-align:end;font-variant-numeric:tabular-nums}.__P__-generative-ui th button{padding:0;border:0;background:none;color:inherit;font:inherit;font-weight:600;text-align:inherit;cursor:pointer}.__P__-generative-ui th button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-generative-ui th[aria-sort=ascending] button:after{content:" \\2191"}.__P__-generative-ui th[aria-sort=descending] button:after{content:" \\2193"}.__P__-generative-ui-chart{display:block;width:100%;max-height:320px;color:var(--__P__-accent)}.__P__-generative-ui-axis line{stroke:var(--__P__-border)}.__P__-generative-ui-axis text{fill:var(--__P__-fg-muted);font-size:9px}.__P__-generative-ui .__P__-generative-ui-legend{display:flex;flex-wrap:wrap;gap:var(--__P__-space-1) var(--__P__-space-3);margin:0;padding:0;list-style:none;color:var(--__P__-accent);font-size:var(--__P__-text-xs)}.__P__-generative-ui-legend li{display:flex;align-items:center;gap:6px;margin:0}.__P__-generative-ui-legend li:before{content:"";width:10px;height:10px;border-radius:3px;background:currentColor}.__P__-generative-ui-legend span{color:var(--__P__-fg)}.__P__-generative-ui-carousel{display:flex;gap:var(--__P__-space-3);margin:0 calc(var(--__P__-space-1) * -1);padding:0 var(--__P__-space-1) var(--__P__-space-2);overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:var(--__P__-space-1);scrollbar-width:thin;min-width:0}.__P__-generative-ui-card:has(>.__P__-generative-ui-photo),.__P__-generative-ui-offer{--__P__-card-width: 280px}.__P__-generative-ui-flight{--__P__-card-width: 300px}.__P__-generative-ui-sheet{--__P__-card-width: 480px}.__P__-generative-ui>section,.__P__-generative-ui-carousel>[role=listitem]>section{width:var(--__P__-card-width, 100%);max-width:100%}.__P__-generative-ui-cell>section{max-width:var(--__P__-card-width, 100%)}.__P__-generative-ui-carousel>[role=listitem]{display:flex;flex:none;max-width:100%;scroll-snap-align:start}.__P__-generative-ui-offer{overflow:hidden}.__P__-generative-ui-footer{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin-top:auto}.__P__-generative-ui-hint{min-height:1.4em;line-height:1.4;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-photo{position:relative;display:block;flex:none;width:calc(100% + 2 * var(--__P__-space-3));aspect-ratio:4 / 3;margin:calc(var(--__P__-space-3) * -1) calc(var(--__P__-space-3) * -1) var(--__P__-space-1);overflow:hidden;background:var(--__P__-hover)}.__P__-generative-ui-photo[data-wide=true]{aspect-ratio:16 / 9}.__P__-generative-ui-badges{display:flex;flex-wrap:wrap;gap:var(--__P__-space-1)}.__P__-generative-ui-photo>.__P__-generative-ui-badges{position:absolute;top:var(--__P__-space-2);inset-inline-start:var(--__P__-space-2)}.__P__-generative-ui-photo .__P__-generative-ui-pill{background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:0 0 0 1px var(--__P__-border)}.__P__-generative-ui-thumb{display:block;flex:0 0 auto;width:48px;height:48px;overflow:hidden;border-radius:var(--__P__-radius-sm);background:var(--__P__-hover)}.__P__-generative-ui-photo img,.__P__-generative-ui-thumb img{display:block;width:100%;max-width:none;height:100%;object-fit:cover}.__P__-generative-ui-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-generative-ui-stars{color:var(--__P__-warning);font-size:var(--__P__-text-xs);letter-spacing:1px}.__P__-generative-ui .__P__-generative-ui-details{display:grid;gap:2px;margin:0;padding:0;list-style:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-details li{display:flex;gap:6px;margin:0}.__P__-generative-ui-details li:before{content:"\\2022";flex:none}.__P__-generative-ui-leg{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}.__P__-generative-ui-leg+.__P__-generative-ui-leg{padding-top:var(--__P__-space-2);border-top:1px solid var(--__P__-border)}.__P__-generative-ui-leg-times{display:flex;align-items:center;gap:var(--__P__-space-1)}.__P__-generative-ui-leg-times>span:not(.__P__-generative-ui-leg-path){display:grid;flex:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-leg-times>span:last-child{text-align:end}.__P__-generative-ui-leg-times strong{color:var(--__P__-fg);font-size:1rem;font-variant-numeric:tabular-nums;white-space:nowrap}.__P__-generative-ui-leg-times sup{font-size:.6em;color:var(--__P__-fg-muted)}.__P__-generative-ui-leg-path{flex:1;min-width:0;padding-bottom:4px;border-bottom:1px solid var(--__P__-border-strong);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);line-height:1.3;text-align:center;overflow-wrap:normal}.__P__-generative-ui .__P__-generative-ui-itinerary{display:grid;gap:var(--__P__-space-2);margin:0;padding:0;list-style:none}.__P__-generative-ui-itinerary li{display:grid;margin:0;padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-generative-ui-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.35}:is(.__P__-generative-ui-carousel,.__P__-generative-ui-cell) .__P__-generative-ui-title{min-height:2.7em}.__P__-generative-ui a{color:inherit}.__P__-generative-ui .__P__-generative-ui-title a,.__P__-generative-ui .__P__-generative-ui-lines a,.__P__-generative-ui .__P__-generative-ui-actions>a{text-decoration:none}.__P__-generative-ui .__P__-generative-ui-title a:hover,.__P__-generative-ui .__P__-generative-ui-lines span>a:hover{text-decoration:underline}.__P__-generative-ui-pill{display:inline-flex;align-items:center;padding:2px var(--__P__-space-2);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-muted{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-star{color:var(--__P__-warning)}.__P__-generative-ui-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 var(--__P__-space-2);font-variant-numeric:tabular-nums}.__P__-generative-ui-price strong{font-size:1.1em}.__P__-generative-ui-price s{color:var(--__P__-fg-muted)}.__P__-generative-ui-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;color:var(--__P__-fg-muted)}.__P__-generative-ui-option{display:grid;gap:var(--__P__-space-1);min-width:0;margin:0;padding:0;border:0}.__P__-generative-ui-option legend{padding:0 0 var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-option div{display:flex;gap:6px;min-width:0;margin:-4px;padding:4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.__P__-generative-ui-option div::-webkit-scrollbar{display:none}.__P__-generative-ui-option div[data-cut-end]{mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div[data-cut-start]{mask-image:linear-gradient(to right,transparent,#000 32px)}.__P__-generative-ui-option div[data-cut-start][data-cut-end]{mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div:dir(rtl)[data-cut-end]{mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div:dir(rtl)[data-cut-start]{mask-image:linear-gradient(to left,transparent,#000 32px)}.__P__-generative-ui-option div:dir(rtl)[data-cut-start][data-cut-end]{mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option button{flex:0 0 auto;min-height:32px;padding:0 10px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-generative-ui-option button:hover{border-color:var(--__P__-border-strong)}.__P__-generative-ui-option button[aria-pressed=true]{border-color:var(--__P__-accent);box-shadow:inset 0 0 0 1px var(--__P__-accent);font-weight:600}.__P__-generative-ui-option button:disabled{color:var(--__P__-fg-muted);text-decoration:line-through;opacity:.6;cursor:not-allowed}.__P__-generative-ui-actions{display:flex;flex-wrap:wrap;gap:var(--__P__-space-2);margin-top:auto;padding-top:var(--__P__-space-1)}.__P__-generative-ui-actions:not([data-small=true])>*{flex:1 1 auto}.__P__-generative-ui-actions>*{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:none;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-generative-ui-actions>*>span{overflow:hidden;text-overflow:ellipsis}.__P__-generative-ui-actions[data-small=true]>*{min-height:28px;padding:0 var(--__P__-space-2);font-size:var(--__P__-text-xs)}.__P__-generative-ui-actions>:hover{border-color:var(--__P__-border-strong)}.__P__-generative-ui-actions>[data-primary=true]{border-color:var(--__P__-accent);background:var(--__P__-accent);color:var(--__P__-on-accent)}.__P__-generative-ui-actions>:focus-visible,.__P__-generative-ui-option button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-generative-ui-actions>:disabled{border-color:var(--__P__-border);background:var(--__P__-hover);color:var(--__P__-fg-muted);cursor:not-allowed}.__P__-generative-ui .__P__-generative-ui-lines{display:grid;margin:0;padding:0;list-style:none}.__P__-generative-ui .__P__-generative-ui-lines li{display:flex;margin:0;gap:var(--__P__-space-3);padding:var(--__P__-space-2) 0;border-bottom:1px solid var(--__P__-border)}.__P__-generative-ui .__P__-generative-ui-lines li:first-child{padding-top:0}.__P__-generative-ui-lines li>div{display:grid;flex:1;gap:2px;min-width:0}.__P__-generative-ui-line-head{display:flex;align-items:baseline;gap:var(--__P__-space-3)}.__P__-generative-ui-line-head>span{display:-webkit-box;flex:1;min-width:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.__P__-generative-ui-line-head>strong{flex:none;font-variant-numeric:tabular-nums}.__P__-generative-ui-totals{display:grid;gap:var(--__P__-space-1);margin:0;font-variant-numeric:tabular-nums}.__P__-generative-ui-totals div{display:flex;justify-content:space-between;gap:var(--__P__-space-3);color:var(--__P__-fg-muted)}.__P__-generative-ui-totals div:last-child{padding-top:var(--__P__-space-1);color:var(--__P__-fg);font-weight:700}.__P__-generative-ui-totals dt{min-width:0}.__P__-generative-ui-totals dd{flex:none;margin:0;white-space:nowrap}.__P__-generative-ui-notice{padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover)}.__P__-generative-ui-notice[data-severity=warning]{color:var(--__P__-fg);background:color-mix(in oklch,var(--__P__-warning) 16%,transparent)}.__P__-generative-ui-notice[data-severity=error]{color:var(--__P__-danger-text);background:var(--__P__-danger-bg)}.__P__-generative-ui .__P__-generative-ui-timeline{display:grid;gap:var(--__P__-space-2);margin:0;padding:0;list-style:none}.__P__-generative-ui .__P__-generative-ui-timeline li{display:flex;margin:0;align-items:baseline;gap:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-generative-ui-timeline li:before{content:"";flex:0 0 auto;width:8px;height:8px;border:2px solid var(--__P__-border-strong);border-radius:50%}.__P__-generative-ui-timeline li[data-done=true]{color:var(--__P__-fg);font-weight:600}.__P__-generative-ui-timeline li[data-done=true]:before{border-color:var(--__P__-accent);background:var(--__P__-accent)}.__P__-generative-ui-timeline li>:first-child{flex:1}@media(pointer:coarse){.__P__-generative-ui-actions>*{min-height:44px}.__P__-generative-ui-actions>*>span{overflow:hidden;text-overflow:ellipsis}.__P__-generative-ui-actions[data-small=true]>*{min-height:32px}.__P__-generative-ui-option button{min-height:40px}}
|
|
3
|
+
`;var xu=`: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;border-radius:var(--__P__-radius-md)}: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}}
|
|
4
|
+
`;var Su=`.__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:18px;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;width:max-content;max-width:min(260px,calc(100vw - 100% - var(--__P__-callout-gap) - 32px));white-space:normal;overflow-wrap:anywhere}.__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)}.__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{flex-shrink:0;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;overflow:clip;overscroll-behavior:none;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:var(--__P__-visual-viewport-top, 0px) 0 auto;height:var(--__P__-visual-viewport-height, 100dvh);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:100%;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}: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: clamp(440px, 32vw, 640px);--__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;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:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:100%;min-width:min(var(--__P__-resize-min-w, 0px),calc(100vw - var(--__P__-inset-x) * 2));max-width:var(--__P__-resize-max-w, none);max-height:none;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}}@media(max-width:640px){:host([data-mode="open"][data-position]) .__P__-anchor,:host([data-mode="expanded"][data-position]) .__P__-anchor,:host([data-mode="drawer"][data-position]) .__P__-anchor,:host([data-mode="modal"][data-position]) .__P__-anchor{inset:var(--__P__-visual-viewport-top, 0px) 0 auto;align-items:stretch;width:auto;height:var(--__P__-visual-viewport-height, 100dvh);padding:0}:host([data-mode="open"][data-position]) .__P__-panel,:host([data-mode="expanded"][data-position]) .__P__-panel,:host([data-mode="drawer"][data-position]) .__P__-panel,:host([data-mode="modal"][data-position]) .__P__-panel{width:100vw;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;translate:none}:host([data-mode="modal"]){background:none;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__-header[data-variant=accent]{background:var(--__P__-accent);color:var(--__P__-on-accent);border-bottom-color:transparent}.__P__-header[data-variant=accent]>h1,.__P__-header[data-variant=accent] .__P__-agent-meta strong,.__P__-header[data-variant=accent] .__P__-agent-sub span,.__P__-header[data-variant=accent] .__P__-agent-ticket,.__P__-header[data-variant=accent] .__P__-agent-ticket:hover,.__P__-header[data-variant=accent]>.__P__-icon-btn,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn{color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-header[data-variant=accent]>.__P__-icon-btn:hover,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn:hover,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn:hover{background:color-mix(in oklch,var(--__P__-on-accent) 16%,transparent);color:var(--__P__-on-accent)}.__P__-header[data-variant=accent]>.__P__-icon-btn:active,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn:active,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn:active{background:color-mix(in oklch,var(--__P__-on-accent) 24%,transparent)}.__P__-header[data-variant=accent] .__P__-agent-avatar{background:color-mix(in oklch,var(--__P__-on-accent) 18%,transparent);color:var(--__P__-on-accent)}.__P__-header[data-variant=accent] .__P__-agent-avatar:after{border-color:var(--__P__-accent)}.__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:var(--__P__-radius-md);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);flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;border-radius:inherit;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__-agent-sub{display:flex;gap:4px;min-width:0}.__P__-agent-sub button+span:before{content:"\\b7\\a0"}.__P__-agent-ticket{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);cursor:copy}.__P__-agent-ticket:hover{color:var(--__P__-fg)}.__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[data-cut-end=true]{mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}.__P__-suggestions[data-cut-start=true]{mask-image:linear-gradient(to right,transparent,#000 32px)}.__P__-suggestions[data-cut-start=true][data-cut-end=true]{mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}:host([dir="rtl"]) .__P__-suggestions[data-cut-end=true]{mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}:host([dir="rtl"]) .__P__-suggestions[data-cut-start=true]{mask-image:linear-gradient(to left,transparent,#000 32px)}:host([dir="rtl"]) .__P__-suggestions[data-cut-start=true][data-cut-end=true]{mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__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;position:relative;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 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:0;bottom:14px;z-index:2;margin-inline:auto;display: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;overflow-anchor:none}.__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__-load-previous,.__P__-history-more{display:flex;justify-content:center}.__P__-load-previous button,.__P__-history-more button{border:0;padding:4px 8px;background:transparent;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;cursor:pointer}.__P__-load-previous button:hover,.__P__-history-more button:hover{text-decoration:underline}.__P__-load-previous button:focus-visible,.__P__-history-more button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-load-previous button:disabled,.__P__-history-more button:disabled{cursor:wait;opacity:.6}.__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-body{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--__P__-space-3) 6px;min-width:0}.__P__-bubble-body>*{flex:1 0 100%;min-width:0}.__P__-bubble-body>.__P__-source,.__P__-bubble-body>.__P__-typing{flex:0 1 auto}.__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,.__P__-steps){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui,.__P__-steps) .__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 :not(pre)>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__-file-image,.__P__-file-chip{border-radius:var(--__P__-radius-sm);color:inherit;text-decoration:none}.__P__-file-image{display:block;width:fit-content;max-width:min(100%,240px);overflow:hidden}.__P__-file-image img{max-height:240px;object-fit:cover}.__P__-file-chip{display:flex;align-items:center;gap:var(--__P__-space-2);max-width:min(100%,280px);padding:var(--__P__-space-2);border:1px solid color-mix(in srgb,currentColor 18%,transparent);background:color-mix(in srgb,currentColor 5%,transparent);transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-file-chip:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.__P__-file-image:focus-visible,.__P__-file-chip:focus-visible{outline:2px solid currentColor;outline-offset:2px}.__P__-file-chip-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:var(--__P__-radius-sm);background:color-mix(in srgb,currentColor 10%,transparent)}.__P__-file-chip-text{display:grid;min-width:0;line-height:1.35}.__P__-file-chip-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-file-chip-meta{font-size:var(--__P__-text-xs);opacity:.75}.__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__-chat-notice{padding:0 var(--__P__-space-3);text-align:center;font-size:var(--__P__-text-xs);line-height:1.5;color:var(--__P__-fg-muted)}.__P__-chat-notice .__P__-md p{margin:0}.__P__-chat-notice .__P__-md a{color:var(--__P__-accent-fg)}.__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__-steps{min-width:0;font-size:var(--__P__-text-sm)}.__P__-steps-head,.__P__-steps-row-head{display:inline-flex;align-items:center;gap:var(--__P__-space-2);max-width:100%;min-width:0;min-height:28px;padding:0;border:0;background:none;color:var(--__P__-fg-muted);font:inherit;text-align:start;cursor:pointer;-webkit-tap-highlight-color:transparent}.__P__-steps-head:hover,.__P__-steps-row-head:hover{color:var(--__P__-fg)}.__P__-steps-head:focus-visible,.__P__-steps-row-head:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-steps-icon,.__P__-steps-row-icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:16px;height:16px}.__P__-steps-icon svg,.__P__-steps-row-icon svg{width:14px;height:14px}.__P__-steps-label,.__P__-steps-row-label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-steps-sep{margin-inline:var(--__P__-space-1)}.__P__-steps-name .__P__-steps-count{margin-inline-start:var(--__P__-space-1)}.__P__-steps-count,.__P__-steps-failed,.__P__-steps-denied,.__P__-steps-time{flex:none;font-variant-numeric:tabular-nums}.__P__-steps-failed{color:var(--__P__-danger-text)}.__P__-steps-denied{color:var(--__P__-fg-muted)}.__P__-steps-decision{display:inline-flex;flex:none;align-items:center;gap:var(--__P__-space-1);font-variant-numeric:tabular-nums;color:var(--__P__-success)}.__P__-steps-decision[data-approved=false]{color:var(--__P__-warning)}.__P__-steps-decision svg{width:14px;height:14px}.__P__-steps-row-error{margin:0;color:var(--__P__-danger-text)}.__P__-steps-chevron{display:inline-flex;flex:none;width:16px;height:16px;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-steps-chevron svg{width:16px;height:16px}.__P__-steps-chevron[data-open=true]{transform:rotate(180deg)}.__P__-steps-list{position:relative;display:flex;flex-direction:column;gap:var(--__P__-space-1);margin:var(--__P__-space-1) 0 0;padding:0;list-style:none}.__P__-steps-list:before{content:"";position:absolute;inset-block:0;inset-inline-start:7px;width:2px;border-radius:1px;background:var(--__P__-border)}.__P__-steps-row{position:relative;display:grid;grid-template-columns:16px minmax(0,1fr);column-gap:var(--__P__-space-2);align-items:start}.__P__-steps-row .__P__-steps-row-icon{margin-block:6px;border-radius:999px;background:var(--__P__-bubble-assistant);color:var(--__P__-fg-muted)}.__P__-steps-row[data-status=error] .__P__-steps-row-icon{color:var(--__P__-danger-text)}.__P__-steps-row-main{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.__P__-steps-row-name{color:var(--__P__-fg);font-weight:500}.__P__-steps-row-system,.__P__-steps-row-summary{margin-inline-start:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-steps-row-body{grid-column:2;display:flex;flex-direction:column;gap:var(--__P__-space-2);width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__P__-steps-row[data-standalone=true]>:is(.__P__-steps-row-body,.__P__-steps-thought-text){grid-column:1 / -1}.__P__-steps-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease-out}.__P__-steps-body[data-open=true]{grid-template-rows:1fr}.__P__-steps-body-inner{min-height:0;overflow:hidden}.__P__-steps-live{min-width:0;overflow:hidden;text-overflow:ellipsis;background:linear-gradient(90deg,var(--__P__-fg-muted) 0%,var(--__P__-fg) 50%,var(--__P__-fg-muted) 100%) 0 0 / 200% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;animation:__P__-steps-shimmer 2s linear infinite}@keyframes __P__-steps-shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-steps-body,.__P__-steps-chevron{transition:none}.__P__-steps-live{background:none;color:var(--__P__-fg-muted);animation:none}}.__P__-steps-thought,.__P__-steps-stopped-label{color:var(--__P__-fg-muted)}.__P__-steps-thought-label,.__P__-steps-stopped-label{display:inline-flex;align-items:center;min-height:28px}.__P__-steps-thought-text{grid-column:2;width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__P__-reasoning-body{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%;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__-compaction-status{width:100%;padding:10px 14px;justify-content:center;font-size:var(--__P__-text-xs)}.__P__-message-queue{display:flex;max-height:112px;flex-direction:column;gap:var(--__P__-space-1);overflow-y:auto}.__P__-attachment-chip.__P__-queued-message{width:100%;max-width:none}.__P__-queued-text{min-width:0;flex:1}.__P__-composer-row{--__P__-composer-line-height: 40px;display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;--__P__-textarea-base-height: 40px;height:var(--__P__-textarea-base-height);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)}.__P__-textarea:focus-visible{outline:none;border-color:var(--__P__-focus)}.__P__-textarea:placeholder-shown{white-space:nowrap;overflow:hidden}.__P__-textarea::placeholder{text-overflow:ellipsis}@media(pointer:coarse){.__P__-textarea{--__P__-textarea-base-height: 44px}.__P__-composer-row{--__P__-composer-line-height: 44px}.__P__-composer-row>.__P__-send{margin-block-end:2px}}.__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;margin-block-end:calc((var(--__P__-composer-line-height) - 32px) / 2)}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{position:relative;display:inline-flex;align-items:center;gap:8px;padding:5px;border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:220px;overflow:hidden}.__P__-attachment-chip[data-upload=error]{border-color:color-mix(in oklab,var(--__P__-danger) 45%,transparent);background:color-mix(in oklab,var(--__P__-danger) 6%,var(--__P__-bg-elevated))}.__P__-attachment-thumb{flex-shrink:0;width:32px;height:32px;border-radius:var(--__P__-radius-sm);object-fit:cover;background:var(--__P__-border);display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-text{display:flex;flex-direction:column;min-width:0;line-height:1.3}.__P__-attachment-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--__P__-fg);font-weight:500}.__P__-attachment-meta{display:inline-flex;align-items:center;gap:4px;color:var(--__P__-fg-muted);font-variant-numeric:tabular-nums;white-space:nowrap}.__P__-attachment-meta svg{flex:none;width:12px;height:12px}.__P__-attachment-chip[data-upload=error] .__P__-attachment-meta{color:var(--__P__-danger)}.__P__-attachment-chip[data-upload=done] .__P__-attachment-meta svg{color:var(--__P__-success)}.__P__-attachment-progress{position:absolute;inset-inline:0;bottom:0;height:2px;background:color-mix(in oklab,var(--__P__-accent) 15%,transparent)}.__P__-attachment-progress>span{display:block;height:100%;background:var(--__P__-accent);transition:width var(--__P__-dur-quick) var(--__P__-ease)}.__P__-attachment-remove{flex-shrink:0;width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove svg{width:14px;height:14px}.__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%,color-mix(in srgb,var(--__P__-bg) 92%,transparent));display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;text-align:center;padding:16px;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)}.__P__-dropzone-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:999px;background:color-mix(in srgb,var(--__P__-accent) 14%,transparent)}.__P__-dropzone-icon svg{width:22px;height:22px}.__P__-dropzone[data-state=reject]{border-color:var(--__P__-danger);background:color-mix(in srgb,var(--__P__-danger) 8%,color-mix(in srgb,var(--__P__-bg) 92%,transparent));color:var(--__P__-danger)}.__P__-dropzone[data-state=reject] .__P__-dropzone-icon{background:color-mix(in srgb,var(--__P__-danger) 14%,transparent)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{display:flex;align-items:center;gap:var(--__P__-space-2);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)}.__P__-error-icon{display:inline-flex;flex:none;width:16px;height:16px;color:var(--__P__-danger-text)}.__P__-error-icon svg{width:16px;height:16px}.__P__-error-text{min-width:0}.__P__-error-retry{flex:none;margin-inline-start:auto;min-height:28px;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__-error-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__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-card>[role=listitem]{display:flex;flex-direction:column}.__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-card>*+*{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:var(--__P__-radius-md);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-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:var(--__P__-radius-md)}.__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__-transcript-layer{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-4);border-radius:inherit;overflow:hidden}.__P__-transcript-backdrop{position:absolute;inset:0;background:var(--__P__-backdrop);animation:__P__-transcript-fade var(--__P__-dur-base) var(--__P__-ease-out)}.__P__-transcript-sheet{position:relative;display:flex;flex-direction:column;gap:var(--__P__-space-3);box-sizing:border-box;width:100%;max-width:360px;padding:var(--__P__-space-4);border-radius:var(--__P__-radius-lg);background:var(--__P__-bg);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel),inset 0 0 0 1px var(--__P__-border);animation:__P__-transcript-in var(--__P__-dur-base) var(--__P__-ease-out)}.__P__-transcript-sheet-head{display:flex;align-items:center;gap:var(--__P__-space-2);margin-block:-4px;margin-inline-end:-6px}.__P__-transcript-sheet-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:28px;block-size:28px;flex-shrink:0;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-transcript-sheet-icon svg{inline-size:16px;block-size:16px}.__P__-transcript-sheet-title{flex:1;min-width:0;margin:0;font-size:var(--__P__-text-base);font-weight:600;text-wrap:balance}.__P__-transcript-sheet-form{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-transcript-sheet-text{margin:0;font-size:var(--__P__-text-sm);line-height:1.45;color:var(--__P__-fg-muted);overflow-wrap:anywhere;text-wrap:pretty}.__P__-transcript-sheet-sent{display:flex;align-items:flex-start;gap:var(--__P__-space-2);color:var(--__P__-fg)}.__P__-transcript-sheet-sent svg{flex-shrink:0;inline-size:18px;block-size:18px;color:var(--__P__-success)}.__P__-transcript-sheet-action{width:100%;min-height:44px;text-align:center;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),scale var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-transcript-sheet-action:active:not(:disabled){scale:.96}@keyframes __P__-transcript-fade{0%{opacity:0}}@keyframes __P__-transcript-in{0%{opacity:0;translate:0 8px}}@media(max-width:640px){.__P__-transcript-layer{align-items:flex-end;padding:0}.__P__-transcript-sheet{max-width:none;padding-bottom:calc(var(--__P__-space-4) + env(safe-area-inset-bottom,0px));border-end-start-radius:0;border-end-end-radius:0;animation-name:__P__-transcript-up}}@keyframes __P__-transcript-up{0%{translate:0 100%}}@media(prefers-reduced-motion:reduce){.__P__-transcript-backdrop,.__P__-transcript-sheet{animation:none}}.__P__-operator-banner{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;column-gap:10px;box-sizing:border-box;width:calc(100% - 2 * var(--__P__-space-3));max-width:var(--__P__-conversation-max, 768px);margin:0 auto var(--__P__-space-2);padding:10px 12px;border-radius:var(--__P__-radius-lg);background:var(--__P__-bg-elevated);box-shadow:inset 0 0 0 1px var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);line-height:1.45;text-align:start}.__P__-operator-label{text-wrap:pretty}.__P__-operator-pulse{width:8px;height:8px;margin-block-start:calc((1.45em - 8px)/2);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-banner[data-available=false] .__P__-operator-pulse{background:var(--__P__-warning);animation:none}.__P__-operator-banner[data-mode=operator] .__P__-operator-pulse{background:var(--__P__-success)}.__P__-operator-dismiss{width:28px;height:28px;margin-block:-4px;margin-inline-end:-6px}.__P__-operator-dismiss:before{inset:-8px}.__P__-operator-dismiss svg{width:16px;height:16px}@media(prefers-reduced-motion:reduce){.__P__-operator-banner[data-mode=awaiting-operator] .__P__-operator-pulse{animation:none}}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-login-bar{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;column-gap:10px;padding:6px 8px;padding-inline-start:14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font-size:var(--__P__-text-sm);line-height:1.4}.__P__-login-bar-icon,.__P__-login-gate-icon{display:inline-flex;color:var(--__P__-fg-muted)}.__P__-login-bar-icon svg{width:16px;height:16px}.__P__-login-bar-text{text-wrap:pretty}.__P__-login-bar[data-kind=user]{grid-template-columns:auto minmax(0,1fr);padding-inline-end:14px;color:var(--__P__-fg-muted)}.__P__-login-bar[data-kind=user] .__P__-login-bar-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-login-bar-action{appearance:none;border:0;cursor:pointer;padding:6px 12px;border-radius:999px;background:transparent;color:var(--__P__-accent-fg);font:inherit;font-weight:600;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-login-bar-action:hover{background:var(--__P__-hover)}.__P__-login-bar-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px}.__P__-login-bar-hide{width:28px;height:28px}.__P__-login-bar-hide:before{inset:-8px}.__P__-login-bar-hide svg{width:16px;height:16px}.__P__-login-gate{display:flex;flex-direction:column;align-items:center;gap:10px;box-sizing:border-box;width:calc(100% - 2 * var(--__P__-space-3));max-width:var(--__P__-conversation-max, 768px);margin:0 auto var(--__P__-space-3);padding:18px 16px;border-radius:var(--__P__-radius-lg);background:var(--__P__-bg-elevated);box-shadow:inset 0 0 0 1px var(--__P__-border);text-align:center}.__P__-login-gate[data-alone]{flex:1;justify-content:center;margin-block-start:var(--__P__-space-3);background:transparent;box-shadow:none}.__P__-login-gate-icon{align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:var(--__P__-bg);box-shadow:inset 0 0 0 1px var(--__P__-border)}.__P__-login-gate[data-alone] .__P__-login-gate-icon{width:48px;height:48px;background:var(--__P__-bg-elevated)}.__P__-login-gate-icon svg{width:20px;height:20px}.__P__-form-actions.__P__-login-gate-actions{justify-content:center;width:100%;max-width:320px;margin-top:var(--__P__-space-1)}.__P__-login-gate-title{margin:0;color:var(--__P__-fg);font-size:var(--__P__-text-md);font-weight:600;line-height:1.35;text-wrap:balance}.__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);color:var(--__P__-fg);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,.__P__-panel[data-resizing] .__P__-resize-grip{opacity:1}.__P__-resize-grip:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px;border-radius:4px}.__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)}.__P__-resize-grip--edge{top:0;bottom:0;left:0;width:8px;height:auto;opacity:1;cursor:ew-resize}.__P__-resize-grip--edge:focus-visible{outline:none}.__P__-resize-grip--edge:after{content:"";position:absolute;top:var(--__P__-radius, 12px);bottom:var(--__P__-radius, 12px);left:0;width:2px;border-radius:1px;background:var(--__P__-focus);opacity:0;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}:host([data-position$="-left"]) .__P__-resize-grip--edge,:host([data-position$="-left"]) .__P__-resize-grip--edge:after{left:auto;right:0}.__P__-resize-grip--edge:hover:after{opacity:1;transition-delay:.15s}.__P__-resize-grip--edge:focus-visible:after,.__P__-panel[data-resizing] .__P__-resize-grip--edge:after{opacity:1}@media(pointer:coarse){.__P__-resize-grip{width:24px;height:24px}.__P__-resize-grip--edge{width:14px;height:auto}}:host(:not([data-mode="open"]):not([data-mode="expanded"]):not([data-mode="drawer"])) .__P__-resize-grip{display:none}@media(max-width:640px){.__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__-help-more{justify-content:center;color:var(--__P__-accent-fg);font-weight:600}.__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)}@media(hover:hover){.__P__-tab:hover{background:var(--__P__-hover)}}.__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:var(--__P__-radius-md);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:var(--__P__-radius-md);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;line-height:1.45}.__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{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search[data-input=true]:focus-within{outline:none;border-color:var(--__P__-focus)}.__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-input:focus-visible{outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-home-ask{padding-block:6px;padding-inline-end:6px}.__P__-home-ask .__P__-send{width:32px;height:32px;flex-shrink:0}.__P__-home-ask .__P__-send[data-shape=pill]{width:auto;padding:0 14px}.__P__-home-ask .__P__-send svg{width:16px;height:16px}.__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-vote{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2);padding-top:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;line-height:1.45;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface);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-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-news-tag{padding:1px 8px;border-radius:6px;background:var(--__P__-hover);color:var(--__P__-fg);font-size:calc(12px * var(--__P__-text-scale));white-space:nowrap}.__P__-news-more{display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);width:100%;min-height:44px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);background:var(--__P__-surface);color:var(--__P__-accent-fg);font-weight:600}.__P__-news-more:hover{background:var(--__P__-bg-elevated)}.__P__-news-more:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__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__-panel-notice{display:flex;align-items:center;justify-content:center;position:relative;padding:var(--__P__-space-6);text-align:center}.__P__-panel-notice-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-panel-notice-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__-textarea,.__P__-home-search-input,.__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__-toolui{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)}.__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=done]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=approved],.__P__-toolui-status[data-status=submitted]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=waiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=declined]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=failed]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=replaced],.__P__-toolui-status[data-status=running],.__P__-toolui-status[data-status=stopped]{--__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-3)}.__P__-toolui-collapse-body>.__P__-form{gap:var(--__P__-space-3)}.__P__-toolui-collapse-body>.__P__-form>.__P__-field,.__P__-toolui-summary>.__P__-field{padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg) 80%,transparent);line-height:1.5}.__P__-toolui-collapse-body>.__P__-form>.__P__-field{gap:var(--__P__-space-2)}.__P__-toolui-summary>.__P__-field{gap:var(--__P__-space-1)}.__P__-toolui-summary .__P__-field-label{color:var(--__P__-fg-muted)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted);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-system{min-width:0;overflow:hidden;color:var(--__P__-fg-muted);text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-preview{min-width:0}.__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-fields{max-height:240px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm)}.__P__-toolui-fields table{width:100%;border-collapse:collapse;font-size:var(--__P__-text-sm);line-height:1.5}.__P__-toolui-fields tr:nth-child(2n){background:color-mix(in oklab,var(--__P__-fg) 4%,transparent)}.__P__-toolui-fields tr+tr{border-top:1px solid var(--__P__-border)}.__P__-toolui-fields th,.__P__-toolui-fields td{padding:6px var(--__P__-space-2);text-align:start;vertical-align:top}.__P__-toolui-fields th{width:1%;color:var(--__P__-fg-muted);font-weight:400;white-space:nowrap}.__P__-toolui-fields td{color:var(--__P__-fg);white-space:pre-wrap;overflow-wrap:anywhere}.__P__-toolui-fields[data-plain=true]{border:0;border-radius:0}.__P__-toolui-fields[data-plain=true] tr:nth-child(2n){background:none}.__P__-toolui-fields[data-plain=true] tr+tr{border-top:0}.__P__-toolui-fields[data-plain=true] th,.__P__-toolui-fields[data-plain=true] td{padding:1px var(--__P__-space-2) 1px 0}.__P__-toolui-raw>summary{width:fit-content;color:var(--__P__-fg-muted);cursor:pointer}.__P__-toolui-raw>summary:hover{color:var(--__P__-fg)}.__P__-toolui-raw>summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-toolui-raw[open]{display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__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}
|
|
5
|
+
`;var wu=`*,*: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}
|
|
6
|
+
`;var ku=`: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, .55) 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}}
|
|
7
|
+
`;var Qv="helpai",Yv="#5B5BD6",Jv="#FFFFFF",Xv="12px",Zv="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",ll=[ku,wu,Su,Pu,xu].join(`
|
|
8
|
+
`).replace(/__P__/g,Qv).replaceAll("__BRAND_ACCENT_TEXT__",Jv).replaceAll("__BRAND_ACCENT__",Yv).replaceAll("__BRAND_RADIUS__",Xv).replaceAll("__BRAND_FONT__",Zv);var Tu=["data-theme","data-color-scheme","data-mode","data-bs-theme"];function Cu(e){if(e){if(e.classList.contains("dark"))return"dark";if(e.classList.contains("light"))return"light";for(let t of Tu){let n=e.getAttribute(t);if(n==="dark"||n==="light")return n}}}function Li(e=document){let t=Cu(e.documentElement)??Cu(e.body);if(t)return t;let n=getComputedStyle(e.documentElement).colorScheme.trim();return n==="dark"||n==="light"?n:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ru(e,t=document){let n=Li(t);e(n);function r(){let l=Li(t);l!==n&&(n=l,e(l))}let o=new MutationObserver(r),i={attributes:!0,attributeFilter:["class","style",...Tu]};o.observe(t.documentElement,i),t.body&&o.observe(t.body,i);let s=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):void 0;return s?.addEventListener("change",r),()=>{o.disconnect(),s?.removeEventListener("change",r)}}var eb=ee.scope("mount"),Au=new WeakMap,tb={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 cl(e,t){let n=t==="flow"?e.style.height:"";e.style.cssText=tb[t],n&&(e.style.height=n)}function Rr(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Oi(e={}){let t=e.position??"flow";eb.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${L.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let r;e.existingHost?r=e.existingHost:(r=document.createElement(n),(e.target??document.body).appendChild(r)),r.setAttribute("data-brand",L.id),cl(r,t);let o=r.shadowRoot??r.attachShadow({mode:"open"});for(let l of["keydown","keypress","keyup"])o.addEventListener(l,nb);let i=r.ownerDocument;if(!rb(o,i)){let l=i.createElement("style");l.textContent=ll,o.appendChild(l)}let s=document.createElement("div");return s.className=`${L.cssPrefix}-app`,o.appendChild(s),{appRoot:s,destroy:()=>r.remove(),hostElement:r,shadowRoot:o}}function nb(e){if(e instanceof KeyboardEvent&&(e.metaKey||e.ctrlKey))return;let t=e.composedPath()[0];t instanceof HTMLElement&&(t.isContentEditable||t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")&&e.stopPropagation()}function rb(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=Au.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(ll),Au.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function ob(e,t){let n=L.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 ib(e,t){e.dataset.theme=t==="host"?Li():t}function ab(e,t){let n=L.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 sb(e,t){e.dataset.position=t}function Ni(e,t){e.dataset.mode=t}function Iu(e,t){ib(e,t.themeMode),ob(e,t.themeOverrides),sb(e,t.position),ab(e,t.size)}var Qn,Xe,dl,Eu,ul=Object.is,uo=0,zu=[],pl=[],Je=he,Mu=Je.__b,Lu=Je.__r,Ou=Je.diffed,Nu=Je.__c,$u=Je.unmount,Du=Je.__;function po(e,t){Je.__h&&Je.__h(Xe,e,uo||t),uo=0;var n=Xe.__H||(Xe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function $(e){return uo=1,Fu(Hu,e)}function Fu(e,t,n){var r=po(Qn++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Hu(void 0,t),function(i){var s=(r.__N||r.__)[0],l=r.t(s,i);ul(s,l)||(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=Xe,!Xe.__f)){Xe.__f=!0;var o=Xe.shouldComponentUpdate;Xe.shouldComponentUpdate=function(i,s,l){var c=this.__H;if(!c)return!0;var u=!1,p=this.props!=i;if(c.__.some(function(d){d.__N&&(u=!0,ul(d.__[0],d.__N[0])||(p=!0))}),o){var _=o.call(this,i,s,l);return u?_||p:_}return!u||p}}return r.__}function U(e,t){var n=po(Qn++,3);!Je.__s&&fl(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,Xe.__H.__h.push(n))}function ut(e,t){var n=po(Qn++,4);!Je.__s&&fl(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,Xe.__h.push(n))}function B(e){return uo=5,xe(function(){return{current:e}},[])}function xe(e,t){var n=po(Qn++,7);return fl(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function F(e,t){return uo=8,xe(function(){return e},t)}function _o(){var e=po(Qn++,11);if(!e.__){for(var t=Xe.__v;!t.__m&&t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function lb(){var e;do{for(;e=pl.shift();)try{co(e)}catch(n){Je.__e(n,{__:(e=e.__P)&&e.__v})}for(;e=zu.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(co),t.__h.some(_l),t.__h=[]}catch(n){t.__h=[],Je.__e(n,e.__v)}}}while(pl.length)}Je.__b=function(e){Xe=null,Mu&&Mu(e)},Je.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Du&&Du(e,t)},Je.__r=function(e){Lu&&Lu(e),Qn=0;var t=(Xe=e.__c).__H;t&&(dl==Xe?Xe.__h=[]:(t.__h.some(co),t.__h.some(_l),Qn=0),t.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})),dl=Xe},Je.diffed=function(e){Ou&&Ou(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Uu(zu.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u)})),dl=Xe=null},Je.__c=function(e,t){t.some(function(n){try{n.__h.some(co),n.__h=n.__h.filter(function(r){return!r.__||_l(r)})}catch(r){n.__h=[function(){throw r}]}}),Nu&&Nu(e,t)},Je.unmount=function(e){$u&&$u(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(o){try{if(o.__P&&o.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n=n&&n.__c}o.__P=n,Uu(pl.push(o))}else co(o)}catch(i){t=i}}),r.__H=void 0,t&&Je.__e(t,r.__v))};var Bu=typeof requestAnimationFrame=="function";function cb(e){var t,n=function(){clearTimeout(r),Bu&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Bu&&(t=requestAnimationFrame(n))}function Uu(e){e!=1&&Eu==Je.requestAnimationFrame||((Eu=Je.requestAnimationFrame)||cb)(lb)}function co(e){var t=Xe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Xe=t}function _l(e){var t=Xe;e.__c=e.__(),Xe=t}function fl(e,t){return!e||e.length!=t.length||t.some(function(n,r){return!ul(n,e[r])})}function Hu(e,t){return typeof t=="function"?t(e):t}var db=Symbol.for("preact-signals");function Ui(){if(ln>1)ln--;else{var e,t=!1;for((function(){var o=Di;for(Di=void 0;o!==void 0;){var i=o.S;if(i.v===o.v)for(var s=i.t;s!==void 0;s=s.x)s.i===o.i&&(s.i=i.i);o=o.o}})();go!==void 0;){var n=go;for(go=void 0,$i++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ju(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if($i=0,ln--,t)throw e}}function Ft(e){if(ln>0)return e();gl=++ub,ln++;try{return e()}finally{Ui()}}var fo,Fe=void 0;function mo(e){var t=Fe,n=fo;Fe=void 0,fo=void 0;try{return e()}finally{Fe=t,fo=n}}var go=void 0,ln=0,$i=0,ub=0,gl=0,Di=void 0,Bi=0;function qu(e){if(Fe!==void 0){var t=e.n;if(t===void 0||t.t!==Fe)return t={i:0,S:e,p:Fe.s,n:void 0,t:Fe,e:void 0,x:void 0,r:t},Fe.s!==void 0&&(Fe.s.n=t),Fe.s=t,e.n=t,32&Fe.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Fe.s,t.n=void 0,Fe.s.n=t,Fe.s=t),t}}function pt(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}pt.prototype.brand=db;pt.prototype.h=function(){return!0};pt.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:mo(function(){var r;(r=t.W)==null||r.call(t)}))};pt.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&mo(function(){var o;(o=t.Z)==null||o.call(t)}))}};pt.prototype.subscribe=function(e){var t=this;return qt(function(){var n=t.value;mo(function(){return e(n)})},{name:"sub"})};pt.prototype.valueOf=function(){return this.value};pt.prototype.toString=function(){return this.value+""};pt.prototype.toJSON=function(){return this.value};pt.prototype.peek=function(){var e=this;return mo(function(){return e.value})};Object.defineProperty(pt.prototype,"value",{get:function(){var e=qu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if($i>100)throw new Error("Cycle detected");(function(n){ln!==0&&$i===0&&n.l!==gl&&(n.l=gl,Di={S:n,v:n.v,i:n.i,o:Di})})(this),this.v=e,this.i++,Bi++,ln++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ui()}}}});function oe(e,t){return new pt(e,t)}function ju(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 Vu(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 Wu(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Yn(e,t){pt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Bi-1,this.f=4}Yn.prototype=new pt;Yn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Bi))return!0;if(this.g=Bi,this.f|=1,this.i>0&&!ju(this))return this.f&=-2,!0;var e=Fe;try{Vu(this),Fe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Fe=e,Wu(this),this.f&=-2,!0};Yn.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)}pt.prototype.S.call(this,e)};Yn.prototype.U=function(e){if(this.t!==void 0&&(pt.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)}};Yn.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(Yn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=qu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Ze(e,t){return new Yn(e,t)}function Gu(e){var t=e.j;if(e.j=void 0,typeof t=="function"){ln++;var n=Fe;Fe=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ml(e),r}finally{Fe=n,Ui()}}}function ml(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Gu(e)}function pb(e){if(Fe!==this)throw new Error("Out-of-order effect");Wu(this),Fe=e,this.f&=-2;try{8&this.f&&ml(this)}finally{Ui()}}function Ar(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,fo&&fo.push(this)}Ar.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.j=t)}finally{e()}};Ar.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Gu(this),Vu(this),ln++;var e=Fe;return Fe=this,pb.bind(this,e)};Ar.prototype.N=function(){2&this.f||(this.f|=2,this.u=go,go=this)};Ar.prototype.d=function(){this.f|=8,1&this.f||ml(this)};Ar.prototype.dispose=function(){this.d()};function qt(e,t){var n=new Ar(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Ku,vo,zi,_b=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Qu=[];qt(function(){Ku=this.N})();function Ir(e,t){he[e]=t.bind(null,he[e]||function(){})}function ho(e){if(zi){var t=zi;zi=void 0,t()}zi=e&&e.S()}function Yu(e){var t=this,n=e.data,r=St(n);r.name="ReactiveDom",r.value=n;var o=xe(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=Ze(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),p=Ze(function(){return!Array.isArray(u.value)&&!Xs(u.value)}),_=qt(function(){if(this.N=Ju,p.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){_(),d.call(this)},[p,u]},[]),i=o[0],s=o[1];return i.value?s.peek():s.value}Yu.displayName="ReactiveTextNode";Object.defineProperties(pt.prototype,{constructor:{configurable:!0,value:xn(pe,null).constructor},type:{configurable:!0,value:Yu},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Ir("__b",function(e,t){if(ho(),vo=void 0,typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof pt&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)});Ir("__r",function(e,t){if(e(t),t.type!==pe){ho();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o,i){var s;return qt(function(){s=this},{name:i}),s.c=o,s})((function(o){return function(){var i;_b&&((i=this.y)==null||i.call(this)),o.__$f|=1,o.setState({})}})(r),typeof t.type=="function"?t.type.displayName||t.type.name:""))),vo=r,ho(n)}});Ir("__e",function(e,t,n,r){ho(),vo=void 0,e(t,n,r)});Ir("diffed",function(e,t){ho(),vo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||r&&s in r||(l.d(),i[s]=void 0)}if(r){i||(i={},n.U=i);for(var c in r){var u=i[c],p=r[c];u===void 0?(u=fb(n,c,p,o),i[c]=u):u.o(p,o)}}}e(t)});function fb(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=oe(n);return{o:function(s,l){i.value=s,r=l},d:qt(function(){this.N=Ju;var s=i.value.value;r[t]!==s&&(r[t]=s,o?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}Ir("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){u.__$f|=8;var p=u.__$u;p&&(u.__$u=void 0,p.d())}}e(t)});Ir("__h",function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)});zt.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function St(e,t){return xe(function(){return oe(e,t)},[])}function mt(e,t){var n=B(e);return n.current=e,vo.__$f|=4,xe(function(){return Ze(function(){return n.current()},t)},[])}var gb=function(e){queueMicrotask(function(){queueMicrotask(e)})};function mb(){Ft(function(){for(var e;e=Qu.shift();)Ku.call(e)})}function Ju(){Qu.push(this)===1&&(he.requestAnimationFrame||gb)(mb)}var hb="x-public-key",vb="x-ai-agent-deployment-id";function Xu(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");return{headers(){let t={[vb]:e.aiAgentDeploymentId};return e.publicKey&&(t[e.publicKeyHeader??hb]=e.publicKey),t}}}function Fi(e,t){let n=[],r;for(let o of e){let i=new URLSearchParams(o);i.has(t)?r??(r=i.get(t)??""):n.push(o)}return{value:r,rest:n}}function Zu(e){let t=new URL(e),n=L.cssPrefix,r=`${L.cssPrefix}-ask`,o=t.search.slice(1).split("&").filter(Boolean),i=t.hash.slice(1).split("&").filter(Boolean),s=Fi(o,n),l=Fi(s.rest,r),c=Fi(i,n),u=Fi(c.rest,r),p=s.value??c.value,_=(l.value??u.value)?.trim()||void 0;if(!(p===void 0&&_===void 0))return t.search=l.rest.join("&"),t.hash=u.rest.join("&"),{target:p===void 0?void 0:Si(p),..._?{ask:_}:{},url:t.toString()}}var ep=ee.scope("feedback:audio"),Hi=class{constructor(){Z(this,"ctx",null);Z(this,"master",null);Z(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){ep.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,r=this.master;if(!n||!r||n.state!=="running")return;let o=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let u=n.createGain(),p=o+l*i;u.gain.setValueAtTime(1e-4,p),u.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),u.gain.exponentialRampToValueAtTime(1e-4,p+i),c.connect(u).connect(r),c.start(p),c.stop(p+i+.01)})}async playUrl(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let i=n.createBufferSource();i.buffer=o,i.connect(r),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 r=this.ctx,o=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>r.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(ep.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var tp={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},np={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 kn=null,qi=0;function bb(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function yb(){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=`__${L.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;";e.style.cssText=n,t.style.cssText=n;for(let r of[e,t])r.addEventListener("click",o=>o.stopPropagation());return document.body.append(e,t),{input:e,label:t}}function rp(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(bb())try{navigator.vibrate(e);return}catch{}if(kn??(kn=yb()),!!kn)try{kn.label.click()}catch{}}}function op(){qi++;let e=!1;return()=>{e||(e=!0,qi=Math.max(0,qi-1),qi===0&&kn&&(kn.input.remove(),kn.label.remove(),kn=null))}}var Pb=ee.scope("feedback"),xb=100,ji=class{constructor(t,n){Z(this,"mutedSig",oe(!1));Z(this,"audio",new Hi);Z(this,"releaseHaptics");Z(this,"sound");Z(this,"haptics");Z(this,"lastPlayed",new Map);Z(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=op(),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<xb}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(o=>Pb.warn("audio play failed",{err:o,url:n}));return}let r=np[t];r&&this.audio.playTone(r)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let r=n===!0||n===void 0?tp[t]:n;rp(r)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function ip(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function hl(e){return ip(e)}function vl(e){return!(!ip(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Vi(e){if(typeof e!="object"||e===null)return{};let t=Reflect.get(e,"url");return{url:typeof t=="string"&&/^https?:\/\//i.test(t)&&t.includes("{returnTo}")?t:void 0,required:Reflect.get(e,"required")===!0,hidePrompt:Reflect.get(e,"hidePrompt")===!0,hideUser:Reflect.get(e,"hideUser")===!0}}function sp(e,t){let n=encodeURIComponent(t).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`);return e.replaceAll("{returnTo}",n)}function lp(e){let t=e.split(".")[1];if(t)try{let n=atob(t.replace(/-/g,"+").replace(/_/g,"/")),r=JSON.parse(new TextDecoder().decode(Uint8Array.from(n,o=>o.charCodeAt(0))));return typeof r=="object"&&r!==null&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):void 0}catch{return}}function ap(e,t){let n=e?.[t];return typeof n=="string"&&n.trim()?{[t]:n.trim()}:{}}function cp(e){let t=lp(e);return{...ap(t,"name"),...ap(t,"email")}}function dp(e){let t=lp(e)?.sub;return typeof t=="string"&&t!==""?t:void 0}function up(){try{return window.top?.location.href??location.href}catch{return location.href}}function pp(e){try{(window.top??window).location.assign(e)}catch{location.assign(e)}}var Sb=Symbol.for("pv"),wb=0;function a(e,t,n,r,o,i){t||(t={});var s,l,c=t;if("ref"in c&&typeof e!="function")for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:Sb,__v:--wb,__i:-1,__u:0};return(o||i)&&(u.__source=o,u.__self=i),he.vnode&&he.vnode(u),u}var Er=1,bo=2,yo=4,fp=8,gp=16;function kb(e){switch(e){case Er:return"href";case bo:return"src";case yo:return"class";case fp:return"checked";case gp:return"start"}}var Cb=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}},Tb=Cb;var _p=24;function Po(e){let t=new Uint32Array(_p);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(_p),indent:"",indent_len:0,table_state:0}}function Mr(e){e.pending.length>0&&Qe(e,`
|
|
9
|
+
`)}function Ae(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 Ke(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 Ie(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&Ke(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function Rb(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Jn(e,t){for(e.fence_start=0;e.len>t;)Ke(e)}function Wi(e,t){let n=0;for(let r=0;r<=e.len&&(t-=e.spaces[r],!(t<0));r+=1)switch(e.tokens[r]){case 9:case 10:case 20:case 25:n=r;break}for(;e.len>n;)Ke(e);return t}function bl(e,t){let n=-1,r=-1;for(let o=e.blockquote_idx+1;o<=e.len;o+=1)if(e.tokens[o]===25){if(e.indent_len<e.spaces[o]){r=-1;break}r=o}else e.tokens[o]===t&&(n=o);return r===-1?n===-1?(Jn(e,e.blockquote_idx),Ie(e,t),!0):(Jn(e,n),!1):(Jn(e,r),Ie(e,t),!0)}function yl(e,t){Ie(e,25),e.spaces[e.len]=e.indent_len+t,cn(e),e.token=103}function cn(e){e.indent="",e.indent_len=0,e.pending=""}function Pl(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 Ab(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 Ib(e){return Pl(e)||Ab(e)}function Qe(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 o=Wi(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],o>0&&Qe(e," ".repeat(o))}let r=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`
|
|
10
|
+
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){Ke(e),cn(e),e.pending=n;continue}Jn(e,e.blockquote_idx),cn(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=r;continue}break;case" ":Wi(e,e.indent_len),Ie(e,Tb(e.pending.length)),cn(e);continue}break;case">":{let i=Rb(e,20,e.blockquote_idx+1);i===-1?(Jn(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,Ie(e,20)):e.blockquote_idx=i,cn(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=r;continue;case" ":e.pending=r;continue;case`
|
|
11
|
+
`:if(e.hr_chars<3)break;Wi(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),cn(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){bl(e,23),yl(e,2),Qe(e,r.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=r,e.fence_start=r.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=r,e.fence_start=r.length):(Ie(e,2),cn(e),e.fence_start=0,Qe(e,r));continue;case`
|
|
12
|
+
`:{Wi(e,e.indent_len),Ie(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,yo,e.pending.slice(e.fence_start)),cn(e),e.token=101;continue}default:e.pending=r;continue}case"+":if(n!==" ")break;bl(e,23),yl(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;bl(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,gp,e.pending.slice(0,-1)),yl(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||Pl(i)){e.pending=r;continue}}break;case"|":Jn(e,e.blockquote_idx),Ie(e,27),Ie(e,28),e.pending="",Qe(e,n);continue}let o=r;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}o=e.indent.slice(i)+r,Ie(e,9)}else Ie(e,2);cn(e),Qe(e,o);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=r;continue;case`
|
|
13
13
|
`:e.table_state=2,e.pending="";continue;default:Ke(e),e.table_state=0;break}else switch(e.pending){case"|":Ie(e,28),e.pending="",Qe(e,n);continue;case`
|
|
14
14
|
`:Ke(e),e.pending="",e.table_state=0,Qe(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":Ie(e,29),Ke(e),e.pending="",Qe(e,n);continue;case`
|
|
15
15
|
`:Ke(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Qe(e,n);continue;default:Ie(e,29),Qe(e,n);continue}break;case 29:if(e.pending==="|"){Ae(e),Ke(e),e.pending="",Qe(e,n);continue}break;case 9:switch(r){case`
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
`:e.pending=r;continue;default:e.pending.length!==0?(Ae(e),Ke(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=r;continue;case`
|
|
26
26
|
`:if(r.length===e.fence_start+e.fence_end+1){Ae(e),Ke(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
|
|
27
27
|
`){e.pending=r,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":r.length===e.fence_start+ +(e.pending[0]===" ")?(Ae(e),Ke(e),e.pending="",e.fence_start=0):e.pending=r;continue;case`
|
|
28
|
-
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,Ae(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=r,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=r;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=r;continue;case 2:if(n!=="]")break;e.pending=r;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,
|
|
28
|
+
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,Ae(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=r,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=r;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=r;continue;case 2:if(n!=="]")break;e.pending=r;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,fp,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Qe(e,r);continue;case 14:case 15:{let i="*",s=12;if(e.token===15&&(i="_",s=13),i===e.pending){if(Ae(e),i===n){Ke(e),e.pending="";continue}Ie(e,s),e.pending=n;continue}break}case 12:case 13:{let i="*",s=14;switch(e.token===13&&(i="_",s=15),e.pending){case i:i===n?e.tokens[e.len-1]===s?e.pending=r:(Ae(e),Ie(e,s),e.pending=""):(Ae(e),Ke(e),e.pending=n);continue;case i+i:let l=e.token;Ae(e),Ke(e),Ke(e),i!==n?(Ie(e,l),e.pending=n):e.pending="";continue}break}case 16:if(r==="~~"){Ae(e),Ke(e),e.pending="";continue}break;case 105:n===`
|
|
29
29
|
`?(Ae(e),Ie(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Qe(e,n));continue;case 30:if(r==="\\]"||r==="$$"){Ae(e),Ke(e),e.pending="";continue}break;case 31:if(r==="\\)"||e.pending[0]==="$"){Ae(e),Ke(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:r==="http://"||r==="https://"?(Ae(e),Ie(e,18),e.pending=r,e.text=r):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=r:(e.token=e.tokens[e.len],Qe(e,n));continue;case 17:case 19:if(e.pending==="]"){Ae(e),n==="("?e.pending=r:(Ke(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?Er:bo,s=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,s),Ke(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
|
|
30
30
|
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,Er,e.pending),Ae(e),Ke(e),e.pending=n):(e.text+=n,e.pending=r);continue;case 104:if(r.startsWith("<br")){if(r.length===3||n===" "||n==="/"&&(r.length===4||e.pending[e.pending.length-1]===" ")){e.pending=r;continue}if(n===">"){Ae(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),Qe(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":Ae(e),Ie(e,31),e.pending="";continue;case"[":e.token=105,e.pending=r;continue;case`
|
|
31
31
|
`:e.pending=n;continue;default:let o=n.charCodeAt(0);e.pending="",e.text+=Pl(o)||o>=65&&o<=90||o>=97&&o<=122?r:n;continue}case`
|
|
@@ -33,44 +33,44 @@
|
|
|
33
33
|
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let o=12,i=14,s=e.pending[0];if(s==="_"&&(o=13,i=15),e.pending.length===1){if(s===n){e.pending=r;continue}if(n!==" "&&n!==`
|
|
34
34
|
`){Ae(e),Ie(e,o),e.pending=n;continue}}else{if(s===n){Ae(e),Ie(e,i),Ie(e,o),e.pending="";continue}if(n!==" "&&n!==`
|
|
35
35
|
`){Ae(e),Ie(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=r;continue}}else if(n!==" "&&n!==`
|
|
36
|
-
`){Ae(e),Ie(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=r;continue}else{if(Ib(n.charCodeAt(0)))break;Ae(e),Ie(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){Ae(e),Ie(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){Ae(e),Ie(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}Ae(e)}function Gi(e){return{add_token:Eb,end_token:xl,add_text:Sl,set_attr:wl,data:{nodes:[e,,,,,],index:0}}}function Eb(e,t){let n=e.nodes[e.index],r;switch(t){case 1:return;case 20:r=document.createElement("blockquote");break;case 2:r=document.createElement("p");break;case 21:r=document.createElement("br");break;case 22:r=document.createElement("hr");break;case 3:r=document.createElement("h1");break;case 4:r=document.createElement("h2");break;case 5:r=document.createElement("h3");break;case 6:r=document.createElement("h4");break;case 7:r=document.createElement("h5");break;case 8:r=document.createElement("h6");break;case 12:case 13:r=document.createElement("em");break;case 14:case 15:r=document.createElement("strong");break;case 16:r=document.createElement("s");break;case 11:r=document.createElement("code");break;case 18:case 17:r=document.createElement("a");break;case 19:r=document.createElement("img");break;case 23:r=document.createElement("ul");break;case 24:r=document.createElement("ol");break;case 25:r=document.createElement("li");break;case 26:let o=r=document.createElement("input");o.type="checkbox",o.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),r=document.createElement("code");break;case 27:r=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]}r=document.createElement("tr");break;case 29:r=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:r=document.createElement("equation-block");break;case 31:r=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(r)}function xl(e){e.index-=1}function Sl(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function wl(e,t,n){e.nodes[e.index].setAttribute(kb(t),n)}function Dt({amount:e,currency:t},n){let r=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??2;return new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e/10**r)}function Cl(e,t){let n=new Date(e);return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeZone:e.length===10?"UTC":void 0}).format(n)}function Lr(e,t){let n=Mb(e);return n?new Intl.DateTimeFormat(t,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(n):e}function Mb(e){let t=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})/.exec(e);return t?Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]),Number(t[5])):void 0}function xo(e,t){let[n,r]=[e,t].map(i=>/^\d{4}-\d{2}-\d{2}/.test(i??"")?Date.parse(`${i?.slice(0,10)}T00:00:00Z`):Number.NaN),o=Math.round(((r??Number.NaN)-(n??Number.NaN))/864e5);return o>0?o:void 0}function Xn(e,t){return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(Date.parse(e.slice(0,10)))?e:new Intl.DateTimeFormat(t,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(Date.parse(e.slice(0,10)))}function Zn(e,t,n){return[e,t].flatMap(r=>r?[Xn(r,n)]:[]).join(" \u2013 ")}function Lb(e,t){let n=(o,i)=>new Intl.NumberFormat(t,{style:"unit",unit:i,unitDisplay:"narrow"}).format(o),r=Math.floor(e/60);return[r>0&&n(r,"hour"),e%60>0&&n(e%60,"minute")].filter(Boolean).join(" ")}function mp(e,t,n){let r=e.stops===void 0?void 0:e.stops.length===0?t.visualDirect:`${t.visualVia} ${e.stops.join(", ")}`;return[e.duration===void 0?void 0:Lb(e.duration,n),r].filter(Boolean).join(" \xB7 ")}function Ob(e,t){return e===1?t.visualNight:t.visualNights.replace("{count}",String(e))}function hp(e,t,n){let r=e.typeName==="Stay"?e.props.stay:void 0,o=e.typeName==="Stay"?{...e.props.stay,title:e.props.stay.name,start:e.props.stay.checkIn,end:e.props.stay.checkOut,nights:void 0,priceNote:void 0}:e.props.package,i=o.nights??xo(o.start,o.end);return{...o,stars:r?.stars,room:r?.room,when:[Zn(o.start,o.end,n),i&&Ob(i,t)].filter(Boolean).join(" \xB7 "),note:r?.nightly?`${Dt(r.nightly,n)} ${t.visualPerNight}`:o.priceNote,available:o.available!==!1}}function vp({value:e,best:t}){return t===void 0||t===5?String(e):`${e}/${t}`}function Cn(e){return Array.isArray(e)?e:[e]}function bp({type:e,data:t}){let n=Cn(t[0]?.value??[]).length;if(t.some(o=>Cn(o.value).length!==n))return!1;if(e!=="pie")return!0;let r=t.map(o=>Cn(o.value)[0]??0);return n===1&&r.every(o=>o>=0)&&r.some(o=>o>0)}var yp=["#f59e0b","#10b981","#ef4444","#8b5cf6","#0ea5e9"];function Pp({type:e,data:t},n){let r=t.map(f=>Cn(f.value)),o=Math.max(1,r[0]?.length??1),i=Math.min(0,...r.flat()),s=Math.max(0,...r.flat()),l=s-i||1,c=272/Math.max(1,t.length),u=c*.7/o,p=Math.ceil(t.length/8),_=new Intl.NumberFormat(n,{notation:"compact",maximumFractionDigits:1});function d(f){return 148-(f-i)/l*136}return{baseline:d(0),barWidth:u,series:Array.from({length:o},(f,v)=>r.map((m,h)=>({x:24+(h+.5)*c+(e==="bar"?(v-(o-1)/2)*u:0),y:d(m[v]??0)}))),labels:t.flatMap((f,v)=>v%p===0?[{x:24+(v+.5)*c,text:f.label.length*5>c*p?`${f.label.slice(0,Math.max(1,Math.floor(c*p/5)-1))}\u2026`:f.label}]:[]),ticks:[...new Set([s,i])].map(f=>({y:d(f),text:_.format(f)})),slices:e==="pie"?Nb(r.map(f=>f[0]??0)):[]}}function Nb(e){let t=e.reduce((r,o)=>r+o,0)||1,n=-Math.PI/2;return e.map(r=>{let o=n+r/t*2*Math.PI,i=$b(n,Math.min(o,n+2*Math.PI-1e-4));return n=o,{path:i,share:r/t}})}function $b(e,t){let n=t-e>Math.PI?1:0,r=(o,i)=>`${(160+o*Math.cos(i)).toFixed(2)} ${(84+o*Math.sin(i)).toFixed(2)}`;return`M${r(64,e)}A64 64 0 ${n} 1 ${r(64,t)}L${r(40,t)}A40 40 0 ${n} 0 ${r(40,e)}Z`}function xp(e){if(!e||e.length<2)return;let t=Math.min(...e),n=Math.max(...e)-t||1;return e.map((r,o)=>`${(o*80/(e.length-1)).toFixed(1)},${(22-(r-t)/n*20).toFixed(1)}`).join(" ")}function kl(e){let t=/^[^\d\-−+]{0,4}([-−+]?\d[\d.,\s]*?)\s?[^\d]{0,4}$/u.exec(e.trim());if(!t?.[1])return;let n=t[1].replace(/\s/g,"").replace("\u2212","-"),r=n.match(/[.,]/g)??[],o=r.at(-1),i=new Set(r).size>1||r.length===1&&!/^[-+]?[1-9]\d{0,2}[.,]\d{3}$/.test(n)?o:void 0,s=Number(n.replace(i===","?/\./g:i==="."?/,/g:/[.,]/g,"").replace(",","."));return Number.isFinite(s)?s:void 0}function Sp(e,t){return e.map((n,r)=>{let o=t.map(i=>i[r]??"").filter(i=>i.trim());return o.length>0&&o.every(i=>kl(i)!==void 0)})}function wp(e,t,n){if(!t)return e;let r=new Intl.Collator(n,{numeric:!0}),o=t.descending?-1:1;return[...e].sort((i,s)=>{let[l,c]=[i[t.column]??"",s[t.column]??""];return o*(t.numeric?(kl(l)??0)-(kl(c)??0):r.compare(l,c))})}var T0={gridTrack:240,gap:16,tableRows:640,photoWidth:280,cardWidths:new Map(Object.entries({Product:280,Stay:280,Package:280,Flight:300,Cart:480,Order:480,Booking:480}))};function Tl(e){return e.typeName==="Cell"?e.props.span??1:1}function kp(e,t){let n=e.reduce((r,o)=>r+Math.min(o,t),0);return Math.ceil(n/Math.max(1,Math.ceil(n/t)))||1}function Cp(e){let t=new Set(e.map(n=>{let r=n.typeName==="Cell"?n.props.children.length===1?n.props.children[0]:void 0:n;return r?.typeName==="Metric"?"Card":r?.typeName}));return t.size===1&&!t.has(void 0)}function Tp({scrollLeft:e,scrollWidth:t,clientWidth:n}){let r=Math.abs(e);return{start:r>1,end:r<t-n-1}}function er(e){return/^https:\/\//i.test(e??"")}function Rl(e,t){return(e??[]).flatMap(n=>n.url?er(n.url)?[{...n,url:n.url,message:void 0}]:[]:t?[{...n,url:void 0,message:n.label}]:[])}function So(e,t,n){return`${e}: ${[t,...Object.entries(n??{}).map(([r,o])=>`${r}: ${o}`)].join(", ")}`}function Rp(e){return[...e.legs.map(t=>t.number??t.carrier),e.fare].filter(Boolean).join(", ")}function Ap(e,t){return t!==void 0&&t.currency===e.currency&&t.amount>e.amount}function Ip(e,t){let n=e.variants??[],r=(e.options??[]).filter(c=>c.values.length).map(c=>({...c,value:t[c.name]??c.values.find(u=>u===e.selected?.[c.name])??(c.values.length===1?c.values[0]:void 0),unavailable:n.length?c.values.filter(u=>!n.some(p=>p.available!==!1&&p.options[c.name]===u)):[]})),o=r.filter(c=>c.value===void 0).map(c=>c.name),i=Object.fromEntries(r.flatMap(c=>c.value===void 0?[]:[[c.name,c.value]])),s=o.length?void 0:n.find(c=>r.every(u=>c.options[u.name]===u.value)),l=!o.length&&n.length?s!==void 0&&s.available!==!1:e.available!==!1;return{options:r,missing:o,chosen:i,available:l,price:s?.price??e.price,compareAtPrice:s?.price?s.compareAtPrice:e.compareAtPrice,image:s?.image??e.image,canBuy:!o.length&&l}}var Qt={root:"Root",schema:{$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:{Root:{$ref:"#/$defs/Root"},Grid:{$ref:"#/$defs/Grid"},Cell:{$ref:"#/$defs/Cell"},Carousel:{$ref:"#/$defs/Carousel"},Text:{$ref:"#/$defs/Text"},Card:{$ref:"#/$defs/Card"},Metric:{$ref:"#/$defs/Metric"},Table:{$ref:"#/$defs/Table"},Chart:{$ref:"#/$defs/Chart"},Product:{$ref:"#/$defs/Product"},Cart:{$ref:"#/$defs/Cart"},Order:{$ref:"#/$defs/Order"},Flight:{$ref:"#/$defs/Flight"},Stay:{$ref:"#/$defs/Stay"},Package:{$ref:"#/$defs/Package"},Booking:{$ref:"#/$defs/Booking"}},required:["Root","Grid","Cell","Carousel","Text","Card","Metric","Table","Chart","Product","Cart","Order","Flight","Stay","Package","Booking"],additionalProperties:!1,$defs:{Root:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Grid"},{$ref:"#/$defs/Carousel"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}}},required:["children"],additionalProperties:!1},Grid:{type:"object",properties:{columns:{type:"integer",enum:[1,2,3,4],default:1},children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Cell"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}}},required:["columns","children"],additionalProperties:!1},Cell:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}},span:{type:"integer",enum:[1,2,3,4],default:1}},required:["children"],additionalProperties:!1},Carousel:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Card"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"}]}}},required:["children"],additionalProperties:!1},Text:{type:"object",properties:{text:{type:"string"}},required:["text"],additionalProperties:!1},Card:{type:"object",properties:{title:{type:"string"},body:{type:"string"},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}},image:{type:"string"}},required:["title","body"],additionalProperties:!1},Metric:{type:"object",properties:{label:{type:"string"},value:{type:"string"},detail:{type:"string"},change:{type:"object",properties:{text:{type:"string"},tone:{type:"string",enum:["good","bad","neutral"]}},required:["text","tone"]},trend:{type:"array",items:{type:"number"}}},required:["label","value"],additionalProperties:!1},Table:{type:"object",properties:{title:{type:"string"},columns:{type:"array",items:{type:"string"}},rows:{type:"array",items:{type:"array",items:{type:"string"}}}},required:["title","columns","rows"],additionalProperties:!1},Chart:{type:"object",properties:{title:{type:"string"},type:{type:"string",enum:["bar","line","pie"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{anyOf:[{type:"number"},{type:"array",items:{type:"number"}}]}},required:["label","value"],additionalProperties:!1}},series:{type:"array",items:{type:"string"}}},required:["title","type","data"],additionalProperties:!1},Product:{type:"object",properties:{product:{type:"object",properties:{title:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},description:{type:"string"},badge:{type:"string"},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},available:{type:"boolean"},options:{type:"array",items:{type:"object",properties:{name:{type:"string"},values:{type:"array",items:{type:"string"}}},required:["name","values"]}},variants:{type:"array",items:{type:"object",properties:{options:{type:"object",additionalProperties:{type:"string"}},id:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},available:{type:"boolean"}},required:["options"]}},selected:{type:"object",additionalProperties:{type:"string"}},details:{type:"array",items:{type:"string"}}},required:["title","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["product"],additionalProperties:!1},Cart:{type:"object",properties:{cart:{type:"object",properties:{lines:{type:"array",items:{type:"object",properties:{title:{type:"string"},quantity:{type:"integer"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},options:{type:"object",additionalProperties:{type:"string"}},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","quantity","price"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},messages:{type:"array",items:{type:"object",properties:{text:{type:"string"},severity:{type:"string",enum:["info","warning","error"]}},required:["text","severity"]}}},required:["lines","totals"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["cart"],additionalProperties:!1},Order:{type:"object",properties:{order:{type:"object",properties:{number:{type:"string"},status:{type:"string"},date:{type:"string"},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},quantity:{type:"integer"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},options:{type:"object",additionalProperties:{type:"string"}},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","quantity","price"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},timeline:{type:"array",items:{type:"object",properties:{label:{type:"string"},done:{type:"boolean"},date:{type:"string"}},required:["label","done"]}},details:{type:"array",items:{type:"string"}}},required:["number","status","items","totals"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["order"],additionalProperties:!1},Flight:{type:"object",properties:{flight:{type:"object",properties:{legs:{type:"array",items:{type:"object",properties:{from:{type:"string"},to:{type:"string"},departs:{type:"string"},arrives:{type:"string"},carrier:{type:"string"},number:{type:"string"},duration:{type:"integer"},stops:{type:"array",items:{type:"string"}}},required:["from","to","departs","arrives","carrier"]},minItems:1},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},priceNote:{type:"string"},fare:{type:"string"},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["legs","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["flight"],additionalProperties:!1},Stay:{type:"object",properties:{stay:{type:"object",properties:{name:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},image:{type:"string"},url:{type:"string"},location:{type:"string"},stars:{type:"integer"},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},checkIn:{type:"string"},checkOut:{type:"string"},room:{type:"string"},nightly:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["name","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["stay"],additionalProperties:!1},Package:{type:"object",properties:{package:{type:"object",properties:{title:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},image:{type:"string"},url:{type:"string"},location:{type:"string"},start:{type:"string"},end:{type:"string"},nights:{type:"integer"},priceNote:{type:"string"},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["title","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["package"],additionalProperties:!1},Booking:{type:"object",properties:{booking:{type:"object",properties:{reference:{type:"string"},status:{type:"string"},title:{type:"string"},start:{type:"string"},end:{type:"string"},travellers:{type:"array",items:{type:"string"}},itinerary:{type:"array",items:{type:"object",properties:{title:{type:"string"},date:{type:"string"},time:{type:"string"},detail:{type:"string"}},required:["title"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},details:{type:"array",items:{type:"string"}}},required:["reference","status"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["booking"],additionalProperties:!1}}}};function Ep(e){switch(e.k){case"StateRef":case"RuntimeRef":case"BinOp":case"UnaryOp":case"Ternary":case"Member":case"Index":case"Assign":return!0;default:return!1}}var Db=new Set(["Comp","Ref","StateRef","RuntimeRef","BinOp","UnaryOp","Ternary","Member","Index","Assign","Str","Num","Bool","Null","Arr","Obj","Ph"]);function tr(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Db.has(e.k)}function wo(e,t){let n=r=>{switch(t(r),r.k){case"Comp":r.args.forEach(n),Object.values(r.mappedProps??{}).forEach(n);break;case"Arr":r.els.forEach(n);break;case"Obj":r.entries.forEach(([,o])=>n(o));break;case"BinOp":n(r.left),n(r.right);break;case"UnaryOp":n(r.operand);break;case"Ternary":n(r.cond),n(r.then),n(r.else);break;case"Member":n(r.obj);break;case"Index":n(r.obj),n(r.index);break;case"Assign":n(r.value);break}};n(e)}function Ki(e){return e==null?{k:"Null"}:typeof e=="string"?{k:"Str",v:e}:typeof e=="number"?{k:"Num",v:e}:typeof e=="boolean"?{k:"Bool",v:e}:Array.isArray(e)?{k:"Arr",els:e.map(Ki)}:typeof e=="object"?{k:"Obj",entries:Object.entries(e).map(([t,n])=>[t,Ki(n)])}:{k:"Null"}}function Qi(e){switch(e.k){case"Str":case"Num":case"Bool":return{v:e.v};case"Null":return{v:null};case"Arr":{let t=[];for(let n of e.els){let r=Qi(n);if(!r)return;t.push(r.v)}return{v:t}}case"Obj":{let t={};for(let[n,r]of e.entries){let o=Qi(r);if(!o)return;t[n]=o.v}return{v:t}}default:return}}var Yi=new Map([["Count",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["First",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["Last",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["Sum",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Avg",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Min",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Max",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Sort",{kind:"function",params:[{name:"array",required:!1},{name:"field",required:!1},{name:"direction",required:!1}],builtin:!0}],["Filter",{kind:"function",params:[{name:"array",required:!1},{name:"field",required:!1},{name:"operator",required:!1},{name:"value",required:!1}],builtin:!0}],["Round",{kind:"function",params:[{name:"number",required:!1},{name:"decimals",required:!1}],builtin:!0}],["Abs",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Floor",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Ceil",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Each",{kind:"function",params:[{name:"array",required:!1},{name:"varName",required:!1},{name:"template",required:!1}],builtin:!0,lazy:!0}],["Run",{kind:"action",params:[{name:"ref",required:!1}],builtin:!0,lazy:!0}],["ToAssistant",{kind:"action",params:[{name:"message",required:!1},{name:"context",required:!1}],builtin:!0}],["OpenUrl",{kind:"action",params:[{name:"url",required:!1}],builtin:!0}],["Set",{kind:"action",params:[{name:"variable",required:!1},{name:"value",required:!1}],builtin:!0,lazy:!0}],["Reset",{kind:"action",params:[{name:"variable",required:!1}],builtin:!0,lazy:!0}],["Action",{kind:"action",params:[{name:"steps",required:!0}],builtin:!0,lazy:!0}]]),Mp={ActionExpression:!0,OpenUrl:!0,ToAssistant:!0},Tn={Query:"Query",Mutation:"Mutation"};function ko(e){return e?.callDefs??Yi}function Co(e){return Yi.has(e)}function Or(e){return e in Tn}var T;(function(e){e[e.Newline=0]="Newline",e[e.LParen=1]="LParen",e[e.RParen=2]="RParen",e[e.LBrack=3]="LBrack",e[e.RBrack=4]="RBrack",e[e.LBrace=5]="LBrace",e[e.RBrace=6]="RBrace",e[e.Comma=7]="Comma",e[e.Colon=8]="Colon",e[e.Equals=9]="Equals",e[e.True=10]="True",e[e.False=11]="False",e[e.Null=12]="Null",e[e.EOF=13]="EOF",e[e.Str=14]="Str",e[e.Num=15]="Num",e[e.Ident=16]="Ident",e[e.Type=17]="Type",e[e.StateVar=18]="StateVar",e[e.Dot=19]="Dot",e[e.Plus=20]="Plus",e[e.Minus=21]="Minus",e[e.Star=22]="Star",e[e.Slash=23]="Slash",e[e.Percent=24]="Percent",e[e.EqEq=25]="EqEq",e[e.NotEq=26]="NotEq",e[e.Greater=27]="Greater",e[e.Less=28]="Less",e[e.GreaterEq=29]="GreaterEq",e[e.LessEq=30]="LessEq",e[e.And=31]="And",e[e.Or=32]="Or",e[e.Not=33]="Not",e[e.Question=34]="Question",e[e.BuiltinCall=35]="BuiltinCall"})(T||(T={}));var Bb=1,Lp=2,Op=3,Al=4,To=5,Il=6,Ji=7,Np=8,Ub=9;function Xi(e){let t=0,n=()=>e[t]??{t:T.EOF},r=()=>{let d=n();return t++,d},o=d=>{n().t===d&&t++};function i(d){switch(d.t){case T.Question:return Bb;case T.Or:return Lp;case T.And:return Op;case T.EqEq:case T.NotEq:return Al;case T.Greater:case T.Less:case T.GreaterEq:case T.LessEq:return To;case T.Plus:case T.Minus:return Il;case T.Star:case T.Slash:case T.Percent:return Ji;case T.Dot:case T.LBrack:return Ub;default:return 0}}function s(d=0){let f=l();for(;i(n())>d;)f=c(f);return f}function l(){let d=n();if(d.t===T.Str)return r(),{k:"Str",v:d.v};if(d.t===T.Num)return r(),{k:"Num",v:d.v};if(d.t===T.True)return r(),{k:"Bool",v:!0};if(d.t===T.False)return r(),{k:"Bool",v:!1};if(d.t===T.Null)return r(),{k:"Null"};if(d.t===T.LBrack)return p();if(d.t===T.LBrace)return _();if(d.t===T.StateVar){let f=d.v;if(r(),n().t===T.Equals){r();let v=s(0);return{k:"Assign",target:f,value:v}}return{k:"StateRef",n:f}}if(d.t===T.Type){let f=d.v;return e[t+1]?.t===T.LParen&&(!Co(f)||f==="Action")?u():(r(),{k:"Ref",n:f})}if(d.t===T.BuiltinCall){if(e[t+1]?.t===T.LParen){let f=u();return f.k==="Comp"&&!Co(f.name)&&(f.fn=!0),f}return r(),{k:"Ref",n:d.v}}if(d.t===T.Ident)return r(),{k:"Ref",n:d.v};if(d.t===T.Not)return r(),{k:"UnaryOp",op:"!",operand:s(Np)};if(d.t===T.Minus)return r(),{k:"UnaryOp",op:"-",operand:s(Np)};if(d.t===T.LParen){r();let f=s(0);return o(T.RParen),f}return r(),{k:"Null"}}function c(d){let f=n();if(f.t===T.Plus)return r(),{k:"BinOp",op:"+",left:d,right:s(Il)};if(f.t===T.Minus)return r(),{k:"BinOp",op:"-",left:d,right:s(Il)};if(f.t===T.Star)return r(),{k:"BinOp",op:"*",left:d,right:s(Ji)};if(f.t===T.Slash)return r(),{k:"BinOp",op:"/",left:d,right:s(Ji)};if(f.t===T.Percent)return r(),{k:"BinOp",op:"%",left:d,right:s(Ji)};if(f.t===T.EqEq)return r(),{k:"BinOp",op:"==",left:d,right:s(Al)};if(f.t===T.NotEq)return r(),{k:"BinOp",op:"!=",left:d,right:s(Al)};if(f.t===T.Greater)return r(),{k:"BinOp",op:">",left:d,right:s(To)};if(f.t===T.Less)return r(),{k:"BinOp",op:"<",left:d,right:s(To)};if(f.t===T.GreaterEq)return r(),{k:"BinOp",op:">=",left:d,right:s(To)};if(f.t===T.LessEq)return r(),{k:"BinOp",op:"<=",left:d,right:s(To)};if(f.t===T.And)return r(),{k:"BinOp",op:"&&",left:d,right:s(Op)};if(f.t===T.Or)return r(),{k:"BinOp",op:"||",left:d,right:s(Lp)};if(f.t===T.Question){r();let v=s(0);o(T.Colon);let m=s(0);return{k:"Ternary",cond:d,then:v,else:m}}if(f.t===T.Dot){r();let v=n(),m=v.t===T.Ident||v.t===T.Type||v.t===T.Str||v.t===T.Num?(r(),String(v.v)):v.t===T.StateVar?(r(),v.v.replace(/^\$/,"")):(r(),"?");return{k:"Member",obj:d,field:m}}if(f.t===T.LBrack){r();let v=s(0);return o(T.RBrack),{k:"Index",obj:d,index:v}}return d}function u(){let d=n().v;r(),o(T.LParen);let f=[];for(;n().t!==T.RParen&&n().t!==T.EOF;)f.push(s(0)),n().t===T.Comma&&r();return o(T.RParen),{k:"Comp",name:d,args:f}}function p(){r();let d=[];for(;n().t!==T.RBrack&&n().t!==T.EOF;)d.push(s(0)),n().t===T.Comma&&r();return o(T.RBrack),{k:"Arr",els:d}}function _(){r();let d=[];for(;n().t!==T.RBrace&&n().t!==T.EOF;){let f=n(),v=f.t===T.Ident||f.t===T.Str||f.t===T.Type||f.t===T.Num?(r(),String(f.v)):f.t===T.StateVar?(r(),f.v.replace(/^\$/,"")):(r(),"?");o(T.Colon),d.push([v,s(0)]),n().t===T.Comma&&r()}return o(T.RBrace),{k:"Obj",entries:d}}return s(0)}function Zi(e){let t=[],n=0,r=e.length;for(;n<r;){for(;n<r&&(e.charAt(n)===" "||e.charAt(n)===" "||e.charAt(n)==="\r");)n++;if(n>=r)break;let o=e.charAt(n);if(o===`
|
|
36
|
+
`){Ae(e),Ie(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=r;continue}else{if(Ib(n.charCodeAt(0)))break;Ae(e),Ie(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){Ae(e),Ie(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){Ae(e),Ie(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}Ae(e)}function Gi(e){return{add_token:Eb,end_token:xl,add_text:Sl,set_attr:wl,data:{nodes:[e,,,,,],index:0}}}function Eb(e,t){let n=e.nodes[e.index],r;switch(t){case 1:return;case 20:r=document.createElement("blockquote");break;case 2:r=document.createElement("p");break;case 21:r=document.createElement("br");break;case 22:r=document.createElement("hr");break;case 3:r=document.createElement("h1");break;case 4:r=document.createElement("h2");break;case 5:r=document.createElement("h3");break;case 6:r=document.createElement("h4");break;case 7:r=document.createElement("h5");break;case 8:r=document.createElement("h6");break;case 12:case 13:r=document.createElement("em");break;case 14:case 15:r=document.createElement("strong");break;case 16:r=document.createElement("s");break;case 11:r=document.createElement("code");break;case 18:case 17:r=document.createElement("a");break;case 19:r=document.createElement("img");break;case 23:r=document.createElement("ul");break;case 24:r=document.createElement("ol");break;case 25:r=document.createElement("li");break;case 26:let o=r=document.createElement("input");o.type="checkbox",o.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),r=document.createElement("code");break;case 27:r=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]}r=document.createElement("tr");break;case 29:r=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:r=document.createElement("equation-block");break;case 31:r=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(r)}function xl(e){e.index-=1}function Sl(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function wl(e,t,n){e.nodes[e.index].setAttribute(kb(t),n)}function Dt({amount:e,currency:t},n){let r=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??2;return new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e/10**r)}function Cl(e,t){let n=new Date(e);return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeZone:e.length===10?"UTC":void 0}).format(n)}function Lr(e,t){let n=Mb(e);return n?new Intl.DateTimeFormat(t,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(n):e}function Mb(e){let t=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})/.exec(e);return t?Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]),Number(t[5])):void 0}function xo(e,t){let[n,r]=[e,t].map(i=>/^\d{4}-\d{2}-\d{2}/.test(i??"")?Date.parse(`${i?.slice(0,10)}T00:00:00Z`):Number.NaN),o=Math.round(((r??Number.NaN)-(n??Number.NaN))/864e5);return o>0?o:void 0}function Xn(e,t){return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(Date.parse(e.slice(0,10)))?e:new Intl.DateTimeFormat(t,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(Date.parse(e.slice(0,10)))}function Zn(e,t,n){return[e,t].flatMap(r=>r?[Xn(r,n)]:[]).join(" \u2013 ")}function Lb(e,t){let n=(o,i)=>new Intl.NumberFormat(t,{style:"unit",unit:i,unitDisplay:"narrow"}).format(o),r=Math.floor(e/60);return[r>0&&n(r,"hour"),e%60>0&&n(e%60,"minute")].filter(Boolean).join(" ")}function hp(e,t,n){let r=e.stops===void 0?void 0:e.stops.length===0?t.visualDirect:`${t.visualVia} ${e.stops.join(", ")}`;return[e.duration===void 0?void 0:Lb(e.duration,n),r].filter(Boolean).join(" \xB7 ")}function Ob(e,t){return e===1?t.visualNight:t.visualNights.replace("{count}",String(e))}function vp(e,t,n){let r=e.typeName==="Stay"?e.props.stay:void 0,o=e.typeName==="Stay"?{...e.props.stay,title:e.props.stay.name,start:e.props.stay.checkIn,end:e.props.stay.checkOut,nights:void 0,priceNote:void 0}:e.props.package,i=o.nights??xo(o.start,o.end);return{...o,stars:r?.stars,room:r?.room,when:[Zn(o.start,o.end,n),i&&Ob(i,t)].filter(Boolean).join(" \xB7 "),note:r?.nightly?`${Dt(r.nightly,n)} ${t.visualPerNight}`:o.priceNote,available:o.available!==!1}}function bp({value:e,best:t}){return t===void 0||t===5?String(e):`${e}/${t}`}function Cn(e){return Array.isArray(e)?e:[e]}function yp({type:e,data:t}){let n=Cn(t[0]?.value??[]).length;if(t.some(o=>Cn(o.value).length!==n))return!1;if(e!=="pie")return!0;let r=t.map(o=>Cn(o.value)[0]??0);return n===1&&r.every(o=>o>=0)&&r.some(o=>o>0)}var Pp=["#f59e0b","#10b981","#ef4444","#8b5cf6","#0ea5e9"];function xp({type:e,data:t},n){let r=t.map(f=>Cn(f.value)),o=Math.max(1,r[0]?.length??1),i=Math.min(0,...r.flat()),s=Math.max(0,...r.flat()),l=s-i||1,c=272/Math.max(1,t.length),u=c*.7/o,p=Math.ceil(t.length/8),_=new Intl.NumberFormat(n,{notation:"compact",maximumFractionDigits:1});function d(f){return 148-(f-i)/l*136}return{baseline:d(0),barWidth:u,series:Array.from({length:o},(f,v)=>r.map((m,h)=>({x:24+(h+.5)*c+(e==="bar"?(v-(o-1)/2)*u:0),y:d(m[v]??0)}))),labels:t.flatMap((f,v)=>v%p===0?[{x:24+(v+.5)*c,text:f.label.length*5>c*p?`${f.label.slice(0,Math.max(1,Math.floor(c*p/5)-1))}\u2026`:f.label}]:[]),ticks:[...new Set([s,i])].map(f=>({y:d(f),text:_.format(f)})),slices:e==="pie"?Nb(r.map(f=>f[0]??0)):[]}}function Nb(e){let t=e.reduce((r,o)=>r+o,0)||1,n=-Math.PI/2;return e.map(r=>{let o=n+r/t*2*Math.PI,i=$b(n,Math.min(o,n+2*Math.PI-1e-4));return n=o,{path:i,share:r/t}})}function $b(e,t){let n=t-e>Math.PI?1:0,r=(o,i)=>`${(160+o*Math.cos(i)).toFixed(2)} ${(84+o*Math.sin(i)).toFixed(2)}`;return`M${r(64,e)}A64 64 0 ${n} 1 ${r(64,t)}L${r(40,t)}A40 40 0 ${n} 0 ${r(40,e)}Z`}function Sp(e){if(!e||e.length<2)return;let t=Math.min(...e),n=Math.max(...e)-t||1;return e.map((r,o)=>`${(o*80/(e.length-1)).toFixed(1)},${(22-(r-t)/n*20).toFixed(1)}`).join(" ")}function kl(e){let t=/^[^\d\-−+]{0,4}([-−+]?\d[\d.,\s]*?)\s?[^\d]{0,4}$/u.exec(e.trim());if(!t?.[1])return;let n=t[1].replace(/\s/g,"").replace("\u2212","-"),r=n.match(/[.,]/g)??[],o=r.at(-1),i=new Set(r).size>1||r.length===1&&!/^[-+]?[1-9]\d{0,2}[.,]\d{3}$/.test(n)?o:void 0,s=Number(n.replace(i===","?/\./g:i==="."?/,/g:/[.,]/g,"").replace(",","."));return Number.isFinite(s)?s:void 0}function wp(e,t){return e.map((n,r)=>{let o=t.map(i=>i[r]??"").filter(i=>i.trim());return o.length>0&&o.every(i=>kl(i)!==void 0)})}function kp(e,t,n){if(!t)return e;let r=new Intl.Collator(n,{numeric:!0}),o=t.descending?-1:1;return[...e].sort((i,s)=>{let[l,c]=[i[t.column]??"",s[t.column]??""];return o*(t.numeric?(kl(l)??0)-(kl(c)??0):r.compare(l,c))})}var T0={gridTrack:240,gap:16,tableRows:640,photoWidth:280,cardWidths:new Map(Object.entries({Product:280,Stay:280,Package:280,Flight:300,Cart:480,Order:480,Booking:480}))};function Tl(e){return e.typeName==="Cell"?e.props.span??1:1}function Cp(e,t){let n=e.reduce((r,o)=>r+Math.min(o,t),0);return Math.ceil(n/Math.max(1,Math.ceil(n/t)))||1}function Tp(e){let t=new Set(e.map(n=>{let r=n.typeName==="Cell"?n.props.children.length===1?n.props.children[0]:void 0:n;return r?.typeName==="Metric"?"Card":r?.typeName}));return t.size===1&&!t.has(void 0)}function Rp({scrollLeft:e,scrollWidth:t,clientWidth:n}){let r=Math.abs(e);return{start:r>1,end:r<t-n-1}}function er(e){return/^https:\/\//i.test(e??"")}function Rl(e,t){return(e??[]).flatMap(n=>n.url?er(n.url)?[{...n,url:n.url,message:void 0}]:[]:t?[{...n,url:void 0,message:n.label}]:[])}function So(e,t,n){return`${e}: ${[t,...Object.entries(n??{}).map(([r,o])=>`${r}: ${o}`)].join(", ")}`}function Ap(e){return[...e.legs.map(t=>t.number??t.carrier),e.fare].filter(Boolean).join(", ")}function Ip(e,t){return t!==void 0&&t.currency===e.currency&&t.amount>e.amount}function Ep(e,t){let n=e.variants??[],r=(e.options??[]).filter(c=>c.values.length).map(c=>({...c,value:t[c.name]??c.values.find(u=>u===e.selected?.[c.name])??(c.values.length===1?c.values[0]:void 0),unavailable:n.length?c.values.filter(u=>!n.some(p=>p.available!==!1&&p.options[c.name]===u)):[]})),o=r.filter(c=>c.value===void 0).map(c=>c.name),i=Object.fromEntries(r.flatMap(c=>c.value===void 0?[]:[[c.name,c.value]])),s=o.length?void 0:n.find(c=>r.every(u=>c.options[u.name]===u.value)),l=!o.length&&n.length?s!==void 0&&s.available!==!1:e.available!==!1;return{options:r,missing:o,chosen:i,available:l,price:s?.price??e.price,compareAtPrice:s?.price?s.compareAtPrice:e.compareAtPrice,image:s?.image??e.image,canBuy:!o.length&&l}}var Qt={root:"Root",schema:{$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:{Root:{$ref:"#/$defs/Root"},Grid:{$ref:"#/$defs/Grid"},Cell:{$ref:"#/$defs/Cell"},Carousel:{$ref:"#/$defs/Carousel"},Text:{$ref:"#/$defs/Text"},Card:{$ref:"#/$defs/Card"},Metric:{$ref:"#/$defs/Metric"},Table:{$ref:"#/$defs/Table"},Chart:{$ref:"#/$defs/Chart"},Product:{$ref:"#/$defs/Product"},Cart:{$ref:"#/$defs/Cart"},Order:{$ref:"#/$defs/Order"},Flight:{$ref:"#/$defs/Flight"},Stay:{$ref:"#/$defs/Stay"},Package:{$ref:"#/$defs/Package"},Booking:{$ref:"#/$defs/Booking"}},required:["Root","Grid","Cell","Carousel","Text","Card","Metric","Table","Chart","Product","Cart","Order","Flight","Stay","Package","Booking"],additionalProperties:!1,$defs:{Root:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Grid"},{$ref:"#/$defs/Carousel"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}}},required:["children"],additionalProperties:!1},Grid:{type:"object",properties:{columns:{type:"integer",enum:[1,2,3,4],default:1},children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Cell"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}}},required:["columns","children"],additionalProperties:!1},Cell:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}},span:{type:"integer",enum:[1,2,3,4],default:1}},required:["children"],additionalProperties:!1},Carousel:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Card"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"}]}}},required:["children"],additionalProperties:!1},Text:{type:"object",properties:{text:{type:"string"}},required:["text"],additionalProperties:!1},Card:{type:"object",properties:{title:{type:"string"},body:{type:"string"},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}},image:{type:"string"}},required:["title","body"],additionalProperties:!1},Metric:{type:"object",properties:{label:{type:"string"},value:{type:"string"},detail:{type:"string"},change:{type:"object",properties:{text:{type:"string"},tone:{type:"string",enum:["good","bad","neutral"]}},required:["text","tone"]},trend:{type:"array",items:{type:"number"}}},required:["label","value"],additionalProperties:!1},Table:{type:"object",properties:{title:{type:"string"},columns:{type:"array",items:{type:"string"}},rows:{type:"array",items:{type:"array",items:{type:"string"}}}},required:["title","columns","rows"],additionalProperties:!1},Chart:{type:"object",properties:{title:{type:"string"},type:{type:"string",enum:["bar","line","pie"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{anyOf:[{type:"number"},{type:"array",items:{type:"number"}}]}},required:["label","value"],additionalProperties:!1}},series:{type:"array",items:{type:"string"}}},required:["title","type","data"],additionalProperties:!1},Product:{type:"object",properties:{product:{type:"object",properties:{title:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},description:{type:"string"},badge:{type:"string"},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},available:{type:"boolean"},options:{type:"array",items:{type:"object",properties:{name:{type:"string"},values:{type:"array",items:{type:"string"}}},required:["name","values"]}},variants:{type:"array",items:{type:"object",properties:{options:{type:"object",additionalProperties:{type:"string"}},id:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},available:{type:"boolean"}},required:["options"]}},selected:{type:"object",additionalProperties:{type:"string"}},details:{type:"array",items:{type:"string"}}},required:["title","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["product"],additionalProperties:!1},Cart:{type:"object",properties:{cart:{type:"object",properties:{lines:{type:"array",items:{type:"object",properties:{title:{type:"string"},quantity:{type:"integer"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},options:{type:"object",additionalProperties:{type:"string"}},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","quantity","price"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},messages:{type:"array",items:{type:"object",properties:{text:{type:"string"},severity:{type:"string",enum:["info","warning","error"]}},required:["text","severity"]}}},required:["lines","totals"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["cart"],additionalProperties:!1},Order:{type:"object",properties:{order:{type:"object",properties:{number:{type:"string"},status:{type:"string"},date:{type:"string"},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},quantity:{type:"integer"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},options:{type:"object",additionalProperties:{type:"string"}},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","quantity","price"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},timeline:{type:"array",items:{type:"object",properties:{label:{type:"string"},done:{type:"boolean"},date:{type:"string"}},required:["label","done"]}},details:{type:"array",items:{type:"string"}}},required:["number","status","items","totals"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["order"],additionalProperties:!1},Flight:{type:"object",properties:{flight:{type:"object",properties:{legs:{type:"array",items:{type:"object",properties:{from:{type:"string"},to:{type:"string"},departs:{type:"string"},arrives:{type:"string"},carrier:{type:"string"},number:{type:"string"},duration:{type:"integer"},stops:{type:"array",items:{type:"string"}}},required:["from","to","departs","arrives","carrier"]},minItems:1},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},priceNote:{type:"string"},fare:{type:"string"},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["legs","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["flight"],additionalProperties:!1},Stay:{type:"object",properties:{stay:{type:"object",properties:{name:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},image:{type:"string"},url:{type:"string"},location:{type:"string"},stars:{type:"integer"},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},checkIn:{type:"string"},checkOut:{type:"string"},room:{type:"string"},nightly:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["name","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["stay"],additionalProperties:!1},Package:{type:"object",properties:{package:{type:"object",properties:{title:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},image:{type:"string"},url:{type:"string"},location:{type:"string"},start:{type:"string"},end:{type:"string"},nights:{type:"integer"},priceNote:{type:"string"},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["title","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["package"],additionalProperties:!1},Booking:{type:"object",properties:{booking:{type:"object",properties:{reference:{type:"string"},status:{type:"string"},title:{type:"string"},start:{type:"string"},end:{type:"string"},travellers:{type:"array",items:{type:"string"}},itinerary:{type:"array",items:{type:"object",properties:{title:{type:"string"},date:{type:"string"},time:{type:"string"},detail:{type:"string"}},required:["title"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},details:{type:"array",items:{type:"string"}}},required:["reference","status"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["booking"],additionalProperties:!1}}}};function Mp(e){switch(e.k){case"StateRef":case"RuntimeRef":case"BinOp":case"UnaryOp":case"Ternary":case"Member":case"Index":case"Assign":return!0;default:return!1}}var Db=new Set(["Comp","Ref","StateRef","RuntimeRef","BinOp","UnaryOp","Ternary","Member","Index","Assign","Str","Num","Bool","Null","Arr","Obj","Ph"]);function tr(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Db.has(e.k)}function wo(e,t){let n=r=>{switch(t(r),r.k){case"Comp":r.args.forEach(n),Object.values(r.mappedProps??{}).forEach(n);break;case"Arr":r.els.forEach(n);break;case"Obj":r.entries.forEach(([,o])=>n(o));break;case"BinOp":n(r.left),n(r.right);break;case"UnaryOp":n(r.operand);break;case"Ternary":n(r.cond),n(r.then),n(r.else);break;case"Member":n(r.obj);break;case"Index":n(r.obj),n(r.index);break;case"Assign":n(r.value);break}};n(e)}function Ki(e){return e==null?{k:"Null"}:typeof e=="string"?{k:"Str",v:e}:typeof e=="number"?{k:"Num",v:e}:typeof e=="boolean"?{k:"Bool",v:e}:Array.isArray(e)?{k:"Arr",els:e.map(Ki)}:typeof e=="object"?{k:"Obj",entries:Object.entries(e).map(([t,n])=>[t,Ki(n)])}:{k:"Null"}}function Qi(e){switch(e.k){case"Str":case"Num":case"Bool":return{v:e.v};case"Null":return{v:null};case"Arr":{let t=[];for(let n of e.els){let r=Qi(n);if(!r)return;t.push(r.v)}return{v:t}}case"Obj":{let t={};for(let[n,r]of e.entries){let o=Qi(r);if(!o)return;t[n]=o.v}return{v:t}}default:return}}var Yi=new Map([["Count",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["First",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["Last",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["Sum",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Avg",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Min",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Max",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Sort",{kind:"function",params:[{name:"array",required:!1},{name:"field",required:!1},{name:"direction",required:!1}],builtin:!0}],["Filter",{kind:"function",params:[{name:"array",required:!1},{name:"field",required:!1},{name:"operator",required:!1},{name:"value",required:!1}],builtin:!0}],["Round",{kind:"function",params:[{name:"number",required:!1},{name:"decimals",required:!1}],builtin:!0}],["Abs",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Floor",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Ceil",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Each",{kind:"function",params:[{name:"array",required:!1},{name:"varName",required:!1},{name:"template",required:!1}],builtin:!0,lazy:!0}],["Run",{kind:"action",params:[{name:"ref",required:!1}],builtin:!0,lazy:!0}],["ToAssistant",{kind:"action",params:[{name:"message",required:!1},{name:"context",required:!1}],builtin:!0}],["OpenUrl",{kind:"action",params:[{name:"url",required:!1}],builtin:!0}],["Set",{kind:"action",params:[{name:"variable",required:!1},{name:"value",required:!1}],builtin:!0,lazy:!0}],["Reset",{kind:"action",params:[{name:"variable",required:!1}],builtin:!0,lazy:!0}],["Action",{kind:"action",params:[{name:"steps",required:!0}],builtin:!0,lazy:!0}]]),Lp={ActionExpression:!0,OpenUrl:!0,ToAssistant:!0},Tn={Query:"Query",Mutation:"Mutation"};function ko(e){return e?.callDefs??Yi}function Co(e){return Yi.has(e)}function Or(e){return e in Tn}var T;(function(e){e[e.Newline=0]="Newline",e[e.LParen=1]="LParen",e[e.RParen=2]="RParen",e[e.LBrack=3]="LBrack",e[e.RBrack=4]="RBrack",e[e.LBrace=5]="LBrace",e[e.RBrace=6]="RBrace",e[e.Comma=7]="Comma",e[e.Colon=8]="Colon",e[e.Equals=9]="Equals",e[e.True=10]="True",e[e.False=11]="False",e[e.Null=12]="Null",e[e.EOF=13]="EOF",e[e.Str=14]="Str",e[e.Num=15]="Num",e[e.Ident=16]="Ident",e[e.Type=17]="Type",e[e.StateVar=18]="StateVar",e[e.Dot=19]="Dot",e[e.Plus=20]="Plus",e[e.Minus=21]="Minus",e[e.Star=22]="Star",e[e.Slash=23]="Slash",e[e.Percent=24]="Percent",e[e.EqEq=25]="EqEq",e[e.NotEq=26]="NotEq",e[e.Greater=27]="Greater",e[e.Less=28]="Less",e[e.GreaterEq=29]="GreaterEq",e[e.LessEq=30]="LessEq",e[e.And=31]="And",e[e.Or=32]="Or",e[e.Not=33]="Not",e[e.Question=34]="Question",e[e.BuiltinCall=35]="BuiltinCall"})(T||(T={}));var Bb=1,Op=2,Np=3,Al=4,To=5,Il=6,Ji=7,$p=8,Ub=9;function Xi(e){let t=0,n=()=>e[t]??{t:T.EOF},r=()=>{let d=n();return t++,d},o=d=>{n().t===d&&t++};function i(d){switch(d.t){case T.Question:return Bb;case T.Or:return Op;case T.And:return Np;case T.EqEq:case T.NotEq:return Al;case T.Greater:case T.Less:case T.GreaterEq:case T.LessEq:return To;case T.Plus:case T.Minus:return Il;case T.Star:case T.Slash:case T.Percent:return Ji;case T.Dot:case T.LBrack:return Ub;default:return 0}}function s(d=0){let f=l();for(;i(n())>d;)f=c(f);return f}function l(){let d=n();if(d.t===T.Str)return r(),{k:"Str",v:d.v};if(d.t===T.Num)return r(),{k:"Num",v:d.v};if(d.t===T.True)return r(),{k:"Bool",v:!0};if(d.t===T.False)return r(),{k:"Bool",v:!1};if(d.t===T.Null)return r(),{k:"Null"};if(d.t===T.LBrack)return p();if(d.t===T.LBrace)return _();if(d.t===T.StateVar){let f=d.v;if(r(),n().t===T.Equals){r();let v=s(0);return{k:"Assign",target:f,value:v}}return{k:"StateRef",n:f}}if(d.t===T.Type){let f=d.v;return e[t+1]?.t===T.LParen&&(!Co(f)||f==="Action")?u():(r(),{k:"Ref",n:f})}if(d.t===T.BuiltinCall){if(e[t+1]?.t===T.LParen){let f=u();return f.k==="Comp"&&!Co(f.name)&&(f.fn=!0),f}return r(),{k:"Ref",n:d.v}}if(d.t===T.Ident)return r(),{k:"Ref",n:d.v};if(d.t===T.Not)return r(),{k:"UnaryOp",op:"!",operand:s($p)};if(d.t===T.Minus)return r(),{k:"UnaryOp",op:"-",operand:s($p)};if(d.t===T.LParen){r();let f=s(0);return o(T.RParen),f}return r(),{k:"Null"}}function c(d){let f=n();if(f.t===T.Plus)return r(),{k:"BinOp",op:"+",left:d,right:s(Il)};if(f.t===T.Minus)return r(),{k:"BinOp",op:"-",left:d,right:s(Il)};if(f.t===T.Star)return r(),{k:"BinOp",op:"*",left:d,right:s(Ji)};if(f.t===T.Slash)return r(),{k:"BinOp",op:"/",left:d,right:s(Ji)};if(f.t===T.Percent)return r(),{k:"BinOp",op:"%",left:d,right:s(Ji)};if(f.t===T.EqEq)return r(),{k:"BinOp",op:"==",left:d,right:s(Al)};if(f.t===T.NotEq)return r(),{k:"BinOp",op:"!=",left:d,right:s(Al)};if(f.t===T.Greater)return r(),{k:"BinOp",op:">",left:d,right:s(To)};if(f.t===T.Less)return r(),{k:"BinOp",op:"<",left:d,right:s(To)};if(f.t===T.GreaterEq)return r(),{k:"BinOp",op:">=",left:d,right:s(To)};if(f.t===T.LessEq)return r(),{k:"BinOp",op:"<=",left:d,right:s(To)};if(f.t===T.And)return r(),{k:"BinOp",op:"&&",left:d,right:s(Np)};if(f.t===T.Or)return r(),{k:"BinOp",op:"||",left:d,right:s(Op)};if(f.t===T.Question){r();let v=s(0);o(T.Colon);let m=s(0);return{k:"Ternary",cond:d,then:v,else:m}}if(f.t===T.Dot){r();let v=n(),m=v.t===T.Ident||v.t===T.Type||v.t===T.Str||v.t===T.Num?(r(),String(v.v)):v.t===T.StateVar?(r(),v.v.replace(/^\$/,"")):(r(),"?");return{k:"Member",obj:d,field:m}}if(f.t===T.LBrack){r();let v=s(0);return o(T.RBrack),{k:"Index",obj:d,index:v}}return d}function u(){let d=n().v;r(),o(T.LParen);let f=[];for(;n().t!==T.RParen&&n().t!==T.EOF;)f.push(s(0)),n().t===T.Comma&&r();return o(T.RParen),{k:"Comp",name:d,args:f}}function p(){r();let d=[];for(;n().t!==T.RBrack&&n().t!==T.EOF;)d.push(s(0)),n().t===T.Comma&&r();return o(T.RBrack),{k:"Arr",els:d}}function _(){r();let d=[];for(;n().t!==T.RBrace&&n().t!==T.EOF;){let f=n(),v=f.t===T.Ident||f.t===T.Str||f.t===T.Type||f.t===T.Num?(r(),String(f.v)):f.t===T.StateVar?(r(),f.v.replace(/^\$/,"")):(r(),"?");o(T.Colon),d.push([v,s(0)]),n().t===T.Comma&&r()}return o(T.RBrace),{k:"Obj",entries:d}}return s(0)}function Zi(e){let t=[],n=0,r=e.length;for(;n<r;){for(;n<r&&(e.charAt(n)===" "||e.charAt(n)===" "||e.charAt(n)==="\r");)n++;if(n>=r)break;let o=e.charAt(n);if(o===`
|
|
37
37
|
`){t.push({t:T.Newline}),n++;continue}if(o==="("){t.push({t:T.LParen}),n++;continue}if(o===")"){t.push({t:T.RParen}),n++;continue}if(o==="["){t.push({t:T.LBrack}),n++;continue}if(o==="]"){t.push({t:T.RBrack}),n++;continue}if(o==="{"){t.push({t:T.LBrace}),n++;continue}if(o==="}"){t.push({t:T.RBrace}),n++;continue}if(o===","){t.push({t:T.Comma}),n++;continue}if(o===":"){t.push({t:T.Colon}),n++;continue}if(o==="="){n+1<r&&e.charAt(n+1)==="="?(t.push({t:T.EqEq}),n+=2):(t.push({t:T.Equals}),n++);continue}if(o==="!"){n+1<r&&e.charAt(n+1)==="="?(t.push({t:T.NotEq}),n+=2):(t.push({t:T.Not}),n++);continue}if(o===">"){n+1<r&&e.charAt(n+1)==="="?(t.push({t:T.GreaterEq}),n+=2):(t.push({t:T.Greater}),n++);continue}if(o==="<"){n+1<r&&e.charAt(n+1)==="="?(t.push({t:T.LessEq}),n+=2):(t.push({t:T.Less}),n++);continue}if(o==="&"){n+1<r&&e.charAt(n+1)==="&"?(t.push({t:T.And}),n+=2):(t.push({t:T.And}),n++);continue}if(o==="|"){n+1<r&&e.charAt(n+1)==="|"?(t.push({t:T.Or}),n+=2):(t.push({t:T.Or}),n++);continue}if(o==="."){t.push({t:T.Dot}),n++;continue}if(o==="?"){t.push({t:T.Question}),n++;continue}if(o==="+"){t.push({t:T.Plus}),n++;continue}if(o==="*"){t.push({t:T.Star}),n++;continue}if(o==="/"){t.push({t:T.Slash}),n++;continue}if(o==="%"){t.push({t:T.Percent}),n++;continue}if(o==='"'){let c=n;n++;let u=!1;for(;n<r;)if(e.charAt(n)==="\\")n+=2;else if(e.charAt(n)==='"'){n++,u=!0;break}else n++;let p=e.slice(c,n);try{let _=u?p:p+'"';t.push({t:T.Str,v:JSON.parse(_)})}catch{let _=p.replace(/^"|"$/g,"");t.push({t:T.Str,v:_})}continue}if(o==="'"){n++;let c="",u=!1;for(;n<r;)if(e.charAt(n)==="\\"){if(n++,n<r){let p=e.charAt(n);p==="'"?c+="'":p==="\\"?c+="\\":p==="n"?c+=`
|
|
38
|
-
`:p==="t"?c+=" ":c+=p,n++}}else if(e.charAt(n)==="'"){n++,u=!0;break}else c+=e.charAt(n),n++;t.push({t:T.Str,v:c});continue}if(o==="-"){let c=t.length>0?t[t.length-1]:null;if(!(!(c!=null&&(c.t===T.Num||c.t===T.Str||c.t===T.Ident||c.t===T.Type||c.t===T.RParen||c.t===T.RBrack||c.t===T.True||c.t===T.False||c.t===T.Null||c.t===T.StateVar||c.t===T.BuiltinCall))&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9")){t.push({t:T.Minus}),n++;continue}}let i=o>="0"&&o<="9",s=o==="-"&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9";if(i||s){let c=n;for(e.charAt(n)==="-"&&n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;if(n<r&&e.charAt(n)==="."&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9")for(n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;if(n<r&&(e.charAt(n)==="e"||e.charAt(n)==="E"))for(n++,n<r&&(e.charAt(n)==="+"||e.charAt(n)==="-")&&n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;t.push({t:T.Num,v:+e.slice(c,n)});continue}if(o==="$"&&n+1<r&&(e.charAt(n+1)>="a"&&e.charAt(n+1)<="z"||e.charAt(n+1)>="A"&&e.charAt(n+1)<="Z"||e.charAt(n+1)==="_")){let c=n;for(n++;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;t.push({t:T.StateVar,v:e.slice(c,n)});continue}if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o==="_"){let c=n;for(;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;let u=e.slice(c,n);if(u==="true"){t.push({t:T.True});continue}if(u==="false"){t.push({t:T.False});continue}if(u==="null"){t.push({t:T.Null});continue}let p=o>="A"&&o<="Z"?T.Type:T.Ident;t.push({t:p,v:u});continue}if(o==="@"&&n+1<r&&(e.charAt(n+1)>="a"&&e.charAt(n+1)<="z"||e.charAt(n+1)>="A"&&e.charAt(n+1)<="Z"||e.charAt(n+1)==="_")){n++;let c=n;for(;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;t.push({t:T.BuiltinCall,v:e.slice(c,n)});continue}n++}return t.push({t:T.EOF}),t}function jt(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="element"&&typeof t.typeName=="string"&&typeof t.props=="object"&&t.props!==null&&typeof t.partial=="boolean"}var $p;(function(e){e.ContinueConversation="continue_conversation",e.OpenUrl="open_url"})($p||($p={}));var zb={},Fb=[];function ea(e){return Array.isArray(e)?"array":typeof e}function Dp(e){return typeof e.$ref=="string"?e.$ref.split("/").pop():void 0}function Bp(e){return"$ref"in e||"anyOf"in e||"oneOf"in e||"allOf"in e}function Up(e){if(Array.isArray(e.enum))return{enumValues:e.enum};if("const"in e)return{enumValues:[e.const]};switch(e.type){case"string":return{expectedType:"string"};case"number":case"integer":return{expectedType:"number"};case"boolean":return{expectedType:"boolean"};default:return{}}}function ta(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e.default}function El(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e,n=Dp(t);if(n)return n;let r=Up(t);return r.enumValues?r.enumValues.map(o=>JSON.stringify(o)).join("|"):r.expectedType?r.expectedType:typeof t.type=="string"?t.type:void 0}function Ml(e,t){let n=t.map(r=>{let o=El(r.schema),i=r.required?`${r.name}*`:r.name;return o?`${i}: ${o}`:i}).join(", ");return`${e}(${n})`}function Hb(e,t){let n=typeof e;return t.enumValues?t.enumValues.includes(e)?null:{expected:`one of [${t.enumValues.map(r=>JSON.stringify(r)).join(", ")}]`,actual:ea(e)}:t.expectedType&&t.expectedType!==n?{expected:t.expectedType,actual:ea(e)}:null}function qb(e,t,n){switch(n.code){case"type-mismatch":return`field "${t}" expects ${n.expected} but got ${n.actual}`;case"pruned-value":return`field "${t}" lost an unresolved or invalid value`;case"missing-required":return`missing required field "${t}"${n.signature?` \u2014 signature: ${n.signature}`:""}`;case"null-required":return`required field "${t}" cannot be null${n.signature?` \u2014 signature: ${n.signature}`:""}`;case"unknown-component":return`Unknown component "${e}" \u2014 not found in catalog or builtins${n.available?.length?`. Available components: ${n.available.join(", ")}`:""}`;case"inline-reserved":return`${e}() must be declared as a top-level statement, not used inline as a value`;case"excess-args":return`${e} takes ${n.declared} arg(s), got ${n.got} (${n.got-n.declared} excess dropped)`;case"unknown-function":return`Unknown function "@${e}": not a built-in or action step. The call evaluates to null`;case"no-root":return n.reason==="not-component"?"root does not evaluate to a component":n.reason==="fallback"?`No root statement. Rendering the first statement that calls the root component ${e}`:e?`No root statement, and no statement calls the root component ${e}`:"No root statement"}}function Ve(e,t,n,r){e.errors.push({code:r.code,component:t,path:n,message:qb(t,n,r),statementId:e.currentStatementId,...r.code==="no-root"&&r.reason==="fallback"&&{severity:"warning"}})}var wt=Symbol("invalid");function na(e,t){return t!==void 0?t:e?wt:void 0}function jb(e,t,n,r,o){return Bp(t)?!1:typeof t.type=="string"||Array.isArray(t.enum)||"const"in t?(Ve(o,n,r,{code:"type-mismatch",expected:typeof t.type=="string"?t.type:"a literal value",actual:`component "${e.typeName}"`}),!0):!1}function zp(e){return(e.anyOf??e.oneOf??[e]).map(Dp)}function Vb(e,t){let n=zp(e);return n.length>0&&n.every(r=>r!==void 0&&t.cat?.has(r))}function Wb(e,t,n,r,o){if(typeof e!="object"||Array.isArray(e))return Ve(o,n,r,{code:"type-mismatch",expected:"object",actual:ea(e)}),wt;let i=e,s,l=t.properties&&typeof t.properties=="object"?t.properties:zb,c=Array.isArray(t.required)?t.required:Fb,u=!1;if(!o.partial)for(let p of c){let _=p in i;if(!_||i[p]==null){let d=ta(l[p]);if(d!==void 0){(s??(s={...i}))[p]=d;continue}Ve(o,n,`${r}/${p}`,{code:_?"null-required":"missing-required"}),u=!0}}for(let p of Object.keys(l)){if(!(p in i))continue;let _=l[p],d=Ro(i[p],_,n,`${r}/${p}`,o);if(d===wt&&(d=na(c.includes(p),ta(_)),d===wt)){u=!0;continue}d!==i[p]&&(s??(s={...i}),d===void 0?delete s[p]:s[p]=d)}return u?wt:s??i}function Gb(e,t,n,r,o){if(!Array.isArray(e))return Ve(o,n,r,{code:"type-mismatch",expected:"array",actual:ea(e)}),wt;let i=t.items;if(!i||typeof i!="object"||Array.isArray(i))return e;let s;for(let l=0;l<e.length;l++){let c=Ro(e[l],i,n,`${r}/${l}`,o);c!==e[l]&&!s&&(s=e.slice(0,l)),s&&c!==wt&&s.push(c)}return s??e}function Kb(e,t,n,r,o){let i=Up(t);if(i.expectedType==null&&i.enumValues==null||i.enumValues&&o.partial)return!1;let s=Hb(e,i);return s?(Ve(o,n,r,{code:"type-mismatch",...s}),!0):!1}function Ro(e,t,n,r,o){if(!t||typeof t!="object"||Array.isArray(t))return e;let i=t;if(e==null||tr(e))return e;if(jt(e))return jb(e,i,n,r,o)?wt:e;if(Bp(i))return Vb(i,o)?(Ve(o,n,r,{code:"type-mismatch",expected:zp(i).join(" | "),actual:Array.isArray(e)?"array":typeof e=="object"?"plain object":typeof e}),wt):e;let s=i.type;return s==="object"?Wb(e,i,n,r,o):s==="array"?Gb(e,i,n,r,o):Kb(e,i,n,r,o)?wt:e}function ra(e){if(e==null||typeof e!="object")return!1;if(tr(e))return!0;if(Array.isArray(e))return e.some(ra);if(jt(e))return Object.values(e.props).some(ra);let t=e;return Array.isArray(t.steps)?!0:Object.values(t).some(ra)}function Fp(e,t,n){if(t.visited.has(e))return t.unres.push(e),n==="expr"?{k:"Ph",n:e}:null;let r=t.syms.get(e);if(!r)return t.unres.push(e),n==="expr"?{k:"Ph",n:e}:null;if(t.unreached?.delete(e),r.k==="Comp"&&Or(r.name)){let i=r.name===Tn.Mutation?"mutation":"query";return{k:"RuntimeRef",n:e,refType:i}}t.visited.add(e);let o=t.currentStatementId;t.currentStatementId=e;try{let i=n==="value"?nr(r,t):Ll(r,t);return n==="value"&&jt(i)&&(i.statementId=e),i}finally{t.currentStatementId=o,t.visited.delete(e)}}function oa(e,t){return ko(t.cat).has(e)||Or(e)}function Ol(e,t){let n={};for(let[r,o]of t.entries()){let i=e[r];if(i===void 0)break;n[o.name]=i}return n}function Hp(e,t,n,r){let{params:o}=n;t.length>o.length&&Ve(r,e,"",{code:"excess-args",declared:o.length,got:t.length});let i=Ol(t,o),s=!1,l=r.errors.length;for(let c of o){let u=i[c.name],p=u?Qi(u):{v:void 0};if(!p)continue;if(p.v==null){if(!c.required||c.defaultValue!==void 0)continue;Ve(r,e,`/${c.name}`,{code:u?"null-required":"missing-required",signature:Ml(e,o)}),s=!0;continue}let _=Ro(p.v,c.schema,e,`/${c.name}`,r);_===wt&&(_=na(c.required,c.defaultValue)),_===wt?s=!0:_===void 0?delete i[c.name]:_!==p.v&&(i[c.name]=Ki(_))}return n.kind==="action"&&r.errors.length>l&&(s=!0),s?null:i}function qp(e,t,n){let r=e.args.map(n),o=ko(t.cat).get(e.name);if(!o||o.lazy)return{...e,args:r};let i=o.builtin?Ol(r,o.params):Hp(e.name,r,o,t);return i?{...e,args:r,mappedProps:i}:o.kind==="action"?{k:"Comp",name:"Action",args:[{k:"Arr",els:[]}]}:{k:"Null"}}function Nl(e,t,n){let r=t.currentStatementId;t.currentStatementId=n;let o=new Set;for(let i of e)wo(i,s=>{if(s.k!=="Comp"||o.has(s))return;o.add(s);let l=ko(t.cat).get(s.name);if(!l||l.lazy)return;let c=l.builtin?null:Hp(s.name,s.args,l,t);s.mappedProps=c??Ol(s.args,l.params)});t.currentStatementId=r}function jp(e,t,n){let r=ko(t.cat).get(e.name);if(r?.kind!=="function"||!r.lazy||e.args.length<3)return null;let o=e.args[1];if(!o)return null;let i=o.k==="Ref"?o.n:o.k==="Str"?o.v:null;if(!i)return null;let s=new Set(n);s.add(i);let l=e.args.map((c,u)=>u===1?c:kt(c,t,s));return{...e,args:l}}function kt(e,t,n){switch(e.k){case"Ref":return n.has(e.n)?e:Fp(e.n,t,"expr");case"Ph":return e;case"Comp":{if(e.fn&&!oa(e.name,t))return Ve(t,e.name,"",{code:"unknown-function"}),{k:"Null"};let r=jp(e,t,n);if(r)return r;if(oa(e.name,t))return qp(e,t,s=>kt(s,t,n));let o=e.args.map(s=>kt(s,t,n)),i=t.cat?.get(e.name);if(i){let s={};for(let[l,c]of i.params.entries()){let u=o[l];u&&(s[c.name]=u)}return{...e,args:o,mappedProps:s}}return Ve(t,e.name,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),{...e,args:o}}case"Arr":return{...e,els:e.els.map(r=>kt(r,t,n))};case"Obj":return{...e,entries:e.entries.map(([r,o])=>[r,kt(o,t,n)])};case"BinOp":return{...e,left:kt(e.left,t,n),right:kt(e.right,t,n)};case"UnaryOp":return{...e,operand:kt(e.operand,t,n)};case"Ternary":return{...e,cond:kt(e.cond,t,n),then:kt(e.then,t,n),else:kt(e.else,t,n)};case"Member":return{...e,obj:kt(e.obj,t,n)};case"Index":return{...e,obj:kt(e.obj,t,n),index:kt(e.index,t,n)};case"Assign":return{...e,value:kt(e.value,t,n)};default:return e}}function Ll(e,t){return kt(e,t,new Set)}function nr(e,t){switch(e.k){case"Ref":return Fp(e.n,t,"value");case"Str":return e.v;case"Num":return e.v;case"Bool":return e.v;case"Null":return null;case"Ph":return null;case"Arr":{let n=[];for(let r of e.els){if(r.k==="Ph"){t.prunedValues++;continue}let o=nr(r,t);if(o===null&&(r.k==="Comp"||r.k==="Ref")){t.prunedValues++;continue}n.push(o)}return n}case"Obj":{let n={};for(let[r,o]of e.entries)n[r]=nr(o,t);return n}case"Comp":{let{name:n,args:r}=e;if(e.fn&&!oa(n,t))return Ve(t,n,"",{code:"unknown-function"}),null;if(Or(n))return Ve(t,n,"",{code:"inline-reserved"}),null;if(oa(n,t)){let l=jp(e,t,new Set);return l||qp(e,t,c=>Ll(c,t))}let o=t.cat?.get(n),i={};if(o){let l=!1;for(let[u,p]of o.params.entries()){let _=r[u];if(!_)break;let d=t.prunedValues,f=nr(_,t);if(t.prunedValues>d&&Ve(t,n,`/${p.name}`,{code:"pruned-value"}),i[p.name]=f,p.schema===void 0)continue;if(f==null&&p.defaultValue!==void 0){Ve(t,n,`/${p.name}`,{code:"type-mismatch",expected:El(p.schema)??"a defined value",actual:f===null?"null":"undefined"}),i[p.name]=p.defaultValue,t.prunedValues=d;continue}let v=Ro(f,p.schema,n,`/${p.name}`,t);v===wt&&(v=na(p.required,p.defaultValue),p.defaultValue!==void 0&&(t.prunedValues=d),v===wt?l=!0:v===void 0&&delete i[p.name]),v!==wt&&v!==void 0&&(i[p.name]=v)}r.length>o.params.length&&Ve(t,n,"",{code:"excess-args",declared:o.params.length,got:r.length});let c=o.params.filter(u=>u.required&&(!(u.name in i)||i[u.name]===null));if(c.length){let u=c.filter(p=>p.defaultValue!==void 0?(Ve(t,n,`/${p.name}`,{code:p.name in i?"null-required":"missing-required"}),i[p.name]=p.defaultValue,!1):!0);if(u.length){for(let p of u)Ve(t,n,`/${p.name}`,{code:p.name in i?"null-required":"missing-required",signature:Ml(n,o.params)});return null}}if(l)return null}else return Ve(t,n,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),null;let s=Object.values(i).some(l=>ra(l));return{type:"element",typeName:n,props:i,partial:t.partial,hasDynamicProps:s}}default:return Ep(e)?Ll(e,t):e}}function $l(e){let t=[],n=!1,r=!1;for(let s=0;s<e.length;s++){let l=e[s];if(r){r=!1;continue}if(l==="\\"&&n){r=!0;continue}if(n){l===n&&(n=!1);continue}if(l==='"'||l==="'"){n=l;continue}l==="("||l==="["||l==="{"?t.push(l):(l===")"&&t[t.length-1]==="("||l==="]"&&t[t.length-1]==="["||l==="}"&&t[t.length-1]==="{")&&t.pop()}if(!(!!n||t.length>0))return{text:e,wasIncomplete:!1};let i=e;n&&(r&&(i+="\\"),i+=n);for(let s=t.length-1;s>=0;s--)i+=t[s]==="("?")":t[s]==="["?"]":"}";return{text:i,wasIncomplete:!0}}function ia(e){let t=[],n=0;for(;n<e.length;){for(;n<e.length&&e[n]?.t===T.Newline;)n++;if(n>=e.length||e[n]?.t===T.EOF)break;let r=e[n];if(!r)break;if(r.t!==T.Ident&&r.t!==T.Type&&r.t!==T.StateVar){for(;n<e.length&&e[n]?.t!==T.Newline&&e[n]?.t!==T.EOF;)n++;continue}let o=r.v,i=r.t;if(n++,n>=e.length||e[n]?.t!==T.Equals){for(;n<e.length&&e[n]?.t!==T.Newline&&e[n]?.t!==T.EOF;)n++;continue}n++;let s=[],l=0,c=0;for(;n<e.length&&e[n]?.t!==T.EOF;){let u=e[n]?.t;if(u===T.Newline&&l<=0&&c<=0){let _=n+1;for(;_<e.length&&e[_]?.t===T.Newline;)_++;let d=_<e.length?e[_]?.t:T.EOF;if(d===T.Question||d===T.Colon&&c>0){n++;continue}break}if(u===T.Newline){n++;continue}u===T.LParen||u===T.LBrack||u===T.LBrace?l++:(u===T.RParen||u===T.RBrack||u===T.RBrace)&&l>0?l--:u===T.Question&&l===0?c++:u===T.Colon&&l===0&&c>0&&c--;let p=e[n++];p&&s.push(p)}s.length&&t.push({id:o,idTokenType:i,tokens:s})}return t}function sa(e=!0){return{root:null,meta:{incomplete:e,unresolved:[],orphaned:[],statementCount:0,errors:[]},stateDeclarations:{},queryStatements:[],mutationStatements:[]}}function Gp(e){if(!tr(e))return[];let t=new Set;return wo(e,n=>{n.k==="StateRef"&&t.add(n.n)}),[...t]}function Bl(e,t){if(t.k==="Comp"&&t.name===Tn.Query){let n=Gp(t.args[1]);return{kind:"query",id:e.id,call:{callee:Tn.Query,args:t.args},expr:t,deps:n.length>0?n:void 0}}return t.k==="Comp"&&t.name===Tn.Mutation?{kind:"mutation",id:e.id,call:{callee:Tn.Mutation,args:t.args},expr:t}:e.idTokenType===T.StateVar?{kind:"state",id:e.id,init:t}:{kind:"value",id:e.id,expr:t}}function Qb(e,t,n){let r={},o=[],i=[];for(let s of e)switch(s.kind){case"state":r[s.id]=nr(s.init,t);break;case"query":Nl(s.call.args,t,s.id),o.push({statementId:s.id,toolAST:s.call.args[0]??null,argsAST:s.call.args[1]??null,defaultsAST:s.call.args[2]??null,refreshAST:s.call.args[3]??null,deps:s.deps,complete:!0});break;case"mutation":Nl(s.call.args,t,s.id),i.push({statementId:s.id,toolAST:s.call.args[0]??null,argsAST:s.call.args[1]??null});break}for(let s of e){let l=s.kind==="state"?[s.init]:s.kind==="value"?[s.expr]:s.kind==="query"||s.kind==="mutation"?s.call.args:[];for(let c of l)for(let u of Gp(c))u===n?.name&&n.stmts.has(s)||u in r||(r[u]=null)}return{stateDeclarations:r,queryStatements:o,mutationStatements:i}}var Vp="root";function zl(e){return e?.k==="Comp"&&!e.fn&&!Co(e.name)&&!Or(e.name)}function Yb(e,t){if(e.has(Vp))return{id:Vp,fallback:!1};for(let n of e.values())if(n.kind==="value"&&zl(n.expr)&&n.expr.name===t)return{id:n.id,fallback:!0};return null}function Jb(e,t){let n=new Set;for(;e?.k==="Ref"&&!n.has(e.n);)n.add(e.n),e=t.get(e.n);return zl(e)}function Xb(e){let t=!1;return wo(e,n=>{zl(n)&&(t=!0)}),t}function aa(e,t,n,r,o,i,s){let l=Yb(e,i),c=new Map;for(let[S,g]of e)c.set(S,g.kind==="state"?g.init:g.expr);let u=[],p=[],_=new Set;for(let[S,g]of e)S!==l?.id&&(g.kind==="state"||g.kind==="query"||g.kind==="mutation"||_.add(S));let d={syms:c,cat:o,errors:p,unres:u,prunedValues:0,visited:new Set,partial:n,currentStatementId:l?.id,unreached:_},f=null,v,m=l&&c.get(l.id);if(l&&m){let S=nr(m,d);jt(S)?(f=S,f.statementId=l.id):tr(S)&&Xb(S)&&(v=S)}let{stateDeclarations:h,queryStatements:y,mutationStatements:P}=Qb(t,d,s);d.currentStatementId=l?.id;let x=i??"";l?!f&&!v&&!Jb(c.get(l.id),c)?Ve(d,x,"",{code:"no-root",reason:"not-component"}):l.fallback&&Ve(d,x,"",{code:"no-root",reason:f?"fallback":"missing"}):Ve(d,x,"",{code:"no-root",reason:"missing"});let C=l?[..._]:[];return{root:f,...v?{rootExpression:v}:{},meta:{incomplete:n,unresolved:u,orphaned:C,statementCount:r,errors:p},stateDeclarations:h,queryStatements:y,mutationStatements:P}}function Wp(e,t){if(e[t]!=='"')return t;let n=t+1;for(;n<e.length;){let r=e[n];if(r==="\\")n+=2;else{if(r==='"')return n+1;n++}}return n}function Zb(e){let t=[],n=0;for(;n<e.length;){let r=-1;for(;n<e.length;){let l=Wp(e,n);if(l>n){n=l;continue}if(e[n]==="`"&&n+1<e.length&&e[n+1]==="`"&&n+2<e.length&&e[n+2]==="`"){r=n;break}n++}if(r===-1)break;let o=r+3;for(;o<e.length&&e[o]!==`
|
|
39
|
-
`;)o++;if(o>=e.length){t.push(e.slice(r+3).replace(/^[^\n]*\n?/,"")),n=e.length;break}o++;let i=-1,s=o;for(;s<e.length;){let l=
|
|
38
|
+
`:p==="t"?c+=" ":c+=p,n++}}else if(e.charAt(n)==="'"){n++,u=!0;break}else c+=e.charAt(n),n++;t.push({t:T.Str,v:c});continue}if(o==="-"){let c=t.length>0?t[t.length-1]:null;if(!(!(c!=null&&(c.t===T.Num||c.t===T.Str||c.t===T.Ident||c.t===T.Type||c.t===T.RParen||c.t===T.RBrack||c.t===T.True||c.t===T.False||c.t===T.Null||c.t===T.StateVar||c.t===T.BuiltinCall))&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9")){t.push({t:T.Minus}),n++;continue}}let i=o>="0"&&o<="9",s=o==="-"&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9";if(i||s){let c=n;for(e.charAt(n)==="-"&&n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;if(n<r&&e.charAt(n)==="."&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9")for(n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;if(n<r&&(e.charAt(n)==="e"||e.charAt(n)==="E"))for(n++,n<r&&(e.charAt(n)==="+"||e.charAt(n)==="-")&&n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;t.push({t:T.Num,v:+e.slice(c,n)});continue}if(o==="$"&&n+1<r&&(e.charAt(n+1)>="a"&&e.charAt(n+1)<="z"||e.charAt(n+1)>="A"&&e.charAt(n+1)<="Z"||e.charAt(n+1)==="_")){let c=n;for(n++;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;t.push({t:T.StateVar,v:e.slice(c,n)});continue}if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o==="_"){let c=n;for(;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;let u=e.slice(c,n);if(u==="true"){t.push({t:T.True});continue}if(u==="false"){t.push({t:T.False});continue}if(u==="null"){t.push({t:T.Null});continue}let p=o>="A"&&o<="Z"?T.Type:T.Ident;t.push({t:p,v:u});continue}if(o==="@"&&n+1<r&&(e.charAt(n+1)>="a"&&e.charAt(n+1)<="z"||e.charAt(n+1)>="A"&&e.charAt(n+1)<="Z"||e.charAt(n+1)==="_")){n++;let c=n;for(;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;t.push({t:T.BuiltinCall,v:e.slice(c,n)});continue}n++}return t.push({t:T.EOF}),t}function jt(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="element"&&typeof t.typeName=="string"&&typeof t.props=="object"&&t.props!==null&&typeof t.partial=="boolean"}var Dp;(function(e){e.ContinueConversation="continue_conversation",e.OpenUrl="open_url"})(Dp||(Dp={}));var zb={},Fb=[];function ea(e){return Array.isArray(e)?"array":typeof e}function Bp(e){return typeof e.$ref=="string"?e.$ref.split("/").pop():void 0}function Up(e){return"$ref"in e||"anyOf"in e||"oneOf"in e||"allOf"in e}function zp(e){if(Array.isArray(e.enum))return{enumValues:e.enum};if("const"in e)return{enumValues:[e.const]};switch(e.type){case"string":return{expectedType:"string"};case"number":case"integer":return{expectedType:"number"};case"boolean":return{expectedType:"boolean"};default:return{}}}function ta(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e.default}function El(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e,n=Bp(t);if(n)return n;let r=zp(t);return r.enumValues?r.enumValues.map(o=>JSON.stringify(o)).join("|"):r.expectedType?r.expectedType:typeof t.type=="string"?t.type:void 0}function Ml(e,t){let n=t.map(r=>{let o=El(r.schema),i=r.required?`${r.name}*`:r.name;return o?`${i}: ${o}`:i}).join(", ");return`${e}(${n})`}function Hb(e,t){let n=typeof e;return t.enumValues?t.enumValues.includes(e)?null:{expected:`one of [${t.enumValues.map(r=>JSON.stringify(r)).join(", ")}]`,actual:ea(e)}:t.expectedType&&t.expectedType!==n?{expected:t.expectedType,actual:ea(e)}:null}function qb(e,t,n){switch(n.code){case"type-mismatch":return`field "${t}" expects ${n.expected} but got ${n.actual}`;case"pruned-value":return`field "${t}" lost an unresolved or invalid value`;case"missing-required":return`missing required field "${t}"${n.signature?` \u2014 signature: ${n.signature}`:""}`;case"null-required":return`required field "${t}" cannot be null${n.signature?` \u2014 signature: ${n.signature}`:""}`;case"unknown-component":return`Unknown component "${e}" \u2014 not found in catalog or builtins${n.available?.length?`. Available components: ${n.available.join(", ")}`:""}`;case"inline-reserved":return`${e}() must be declared as a top-level statement, not used inline as a value`;case"excess-args":return`${e} takes ${n.declared} arg(s), got ${n.got} (${n.got-n.declared} excess dropped)`;case"unknown-function":return`Unknown function "@${e}": not a built-in or action step. The call evaluates to null`;case"no-root":return n.reason==="not-component"?"root does not evaluate to a component":n.reason==="fallback"?`No root statement. Rendering the first statement that calls the root component ${e}`:e?`No root statement, and no statement calls the root component ${e}`:"No root statement"}}function Ve(e,t,n,r){e.errors.push({code:r.code,component:t,path:n,message:qb(t,n,r),statementId:e.currentStatementId,...r.code==="no-root"&&r.reason==="fallback"&&{severity:"warning"}})}var wt=Symbol("invalid");function na(e,t){return t!==void 0?t:e?wt:void 0}function jb(e,t,n,r,o){return Up(t)?!1:typeof t.type=="string"||Array.isArray(t.enum)||"const"in t?(Ve(o,n,r,{code:"type-mismatch",expected:typeof t.type=="string"?t.type:"a literal value",actual:`component "${e.typeName}"`}),!0):!1}function Fp(e){return(e.anyOf??e.oneOf??[e]).map(Bp)}function Vb(e,t){let n=Fp(e);return n.length>0&&n.every(r=>r!==void 0&&t.cat?.has(r))}function Wb(e,t,n,r,o){if(typeof e!="object"||Array.isArray(e))return Ve(o,n,r,{code:"type-mismatch",expected:"object",actual:ea(e)}),wt;let i=e,s,l=t.properties&&typeof t.properties=="object"?t.properties:zb,c=Array.isArray(t.required)?t.required:Fb,u=!1;if(!o.partial)for(let p of c){let _=p in i;if(!_||i[p]==null){let d=ta(l[p]);if(d!==void 0){(s??(s={...i}))[p]=d;continue}Ve(o,n,`${r}/${p}`,{code:_?"null-required":"missing-required"}),u=!0}}for(let p of Object.keys(l)){if(!(p in i))continue;let _=l[p],d=Ro(i[p],_,n,`${r}/${p}`,o);if(d===wt&&(d=na(c.includes(p),ta(_)),d===wt)){u=!0;continue}d!==i[p]&&(s??(s={...i}),d===void 0?delete s[p]:s[p]=d)}return u?wt:s??i}function Gb(e,t,n,r,o){if(!Array.isArray(e))return Ve(o,n,r,{code:"type-mismatch",expected:"array",actual:ea(e)}),wt;let i=t.items;if(!i||typeof i!="object"||Array.isArray(i))return e;let s;for(let l=0;l<e.length;l++){let c=Ro(e[l],i,n,`${r}/${l}`,o);c!==e[l]&&!s&&(s=e.slice(0,l)),s&&c!==wt&&s.push(c)}return s??e}function Kb(e,t,n,r,o){let i=zp(t);if(i.expectedType==null&&i.enumValues==null||i.enumValues&&o.partial)return!1;let s=Hb(e,i);return s?(Ve(o,n,r,{code:"type-mismatch",...s}),!0):!1}function Ro(e,t,n,r,o){if(!t||typeof t!="object"||Array.isArray(t))return e;let i=t;if(e==null||tr(e))return e;if(jt(e))return jb(e,i,n,r,o)?wt:e;if(Up(i))return Vb(i,o)?(Ve(o,n,r,{code:"type-mismatch",expected:Fp(i).join(" | "),actual:Array.isArray(e)?"array":typeof e=="object"?"plain object":typeof e}),wt):e;let s=i.type;return s==="object"?Wb(e,i,n,r,o):s==="array"?Gb(e,i,n,r,o):Kb(e,i,n,r,o)?wt:e}function ra(e){if(e==null||typeof e!="object")return!1;if(tr(e))return!0;if(Array.isArray(e))return e.some(ra);if(jt(e))return Object.values(e.props).some(ra);let t=e;return Array.isArray(t.steps)?!0:Object.values(t).some(ra)}function Hp(e,t,n){if(t.visited.has(e))return t.unres.push(e),n==="expr"?{k:"Ph",n:e}:null;let r=t.syms.get(e);if(!r)return t.unres.push(e),n==="expr"?{k:"Ph",n:e}:null;if(t.unreached?.delete(e),r.k==="Comp"&&Or(r.name)){let i=r.name===Tn.Mutation?"mutation":"query";return{k:"RuntimeRef",n:e,refType:i}}t.visited.add(e);let o=t.currentStatementId;t.currentStatementId=e;try{let i=n==="value"?nr(r,t):Ll(r,t);return n==="value"&&jt(i)&&(i.statementId=e),i}finally{t.currentStatementId=o,t.visited.delete(e)}}function oa(e,t){return ko(t.cat).has(e)||Or(e)}function Ol(e,t){let n={};for(let[r,o]of t.entries()){let i=e[r];if(i===void 0)break;n[o.name]=i}return n}function qp(e,t,n,r){let{params:o}=n;t.length>o.length&&Ve(r,e,"",{code:"excess-args",declared:o.length,got:t.length});let i=Ol(t,o),s=!1,l=r.errors.length;for(let c of o){let u=i[c.name],p=u?Qi(u):{v:void 0};if(!p)continue;if(p.v==null){if(!c.required||c.defaultValue!==void 0)continue;Ve(r,e,`/${c.name}`,{code:u?"null-required":"missing-required",signature:Ml(e,o)}),s=!0;continue}let _=Ro(p.v,c.schema,e,`/${c.name}`,r);_===wt&&(_=na(c.required,c.defaultValue)),_===wt?s=!0:_===void 0?delete i[c.name]:_!==p.v&&(i[c.name]=Ki(_))}return n.kind==="action"&&r.errors.length>l&&(s=!0),s?null:i}function jp(e,t,n){let r=e.args.map(n),o=ko(t.cat).get(e.name);if(!o||o.lazy)return{...e,args:r};let i=o.builtin?Ol(r,o.params):qp(e.name,r,o,t);return i?{...e,args:r,mappedProps:i}:o.kind==="action"?{k:"Comp",name:"Action",args:[{k:"Arr",els:[]}]}:{k:"Null"}}function Nl(e,t,n){let r=t.currentStatementId;t.currentStatementId=n;let o=new Set;for(let i of e)wo(i,s=>{if(s.k!=="Comp"||o.has(s))return;o.add(s);let l=ko(t.cat).get(s.name);if(!l||l.lazy)return;let c=l.builtin?null:qp(s.name,s.args,l,t);s.mappedProps=c??Ol(s.args,l.params)});t.currentStatementId=r}function Vp(e,t,n){let r=ko(t.cat).get(e.name);if(r?.kind!=="function"||!r.lazy||e.args.length<3)return null;let o=e.args[1];if(!o)return null;let i=o.k==="Ref"?o.n:o.k==="Str"?o.v:null;if(!i)return null;let s=new Set(n);s.add(i);let l=e.args.map((c,u)=>u===1?c:kt(c,t,s));return{...e,args:l}}function kt(e,t,n){switch(e.k){case"Ref":return n.has(e.n)?e:Hp(e.n,t,"expr");case"Ph":return e;case"Comp":{if(e.fn&&!oa(e.name,t))return Ve(t,e.name,"",{code:"unknown-function"}),{k:"Null"};let r=Vp(e,t,n);if(r)return r;if(oa(e.name,t))return jp(e,t,s=>kt(s,t,n));let o=e.args.map(s=>kt(s,t,n)),i=t.cat?.get(e.name);if(i){let s={};for(let[l,c]of i.params.entries()){let u=o[l];u&&(s[c.name]=u)}return{...e,args:o,mappedProps:s}}return Ve(t,e.name,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),{...e,args:o}}case"Arr":return{...e,els:e.els.map(r=>kt(r,t,n))};case"Obj":return{...e,entries:e.entries.map(([r,o])=>[r,kt(o,t,n)])};case"BinOp":return{...e,left:kt(e.left,t,n),right:kt(e.right,t,n)};case"UnaryOp":return{...e,operand:kt(e.operand,t,n)};case"Ternary":return{...e,cond:kt(e.cond,t,n),then:kt(e.then,t,n),else:kt(e.else,t,n)};case"Member":return{...e,obj:kt(e.obj,t,n)};case"Index":return{...e,obj:kt(e.obj,t,n),index:kt(e.index,t,n)};case"Assign":return{...e,value:kt(e.value,t,n)};default:return e}}function Ll(e,t){return kt(e,t,new Set)}function nr(e,t){switch(e.k){case"Ref":return Hp(e.n,t,"value");case"Str":return e.v;case"Num":return e.v;case"Bool":return e.v;case"Null":return null;case"Ph":return null;case"Arr":{let n=[];for(let r of e.els){if(r.k==="Ph"){t.prunedValues++;continue}let o=nr(r,t);if(o===null&&(r.k==="Comp"||r.k==="Ref")){t.prunedValues++;continue}n.push(o)}return n}case"Obj":{let n={};for(let[r,o]of e.entries)n[r]=nr(o,t);return n}case"Comp":{let{name:n,args:r}=e;if(e.fn&&!oa(n,t))return Ve(t,n,"",{code:"unknown-function"}),null;if(Or(n))return Ve(t,n,"",{code:"inline-reserved"}),null;if(oa(n,t)){let l=Vp(e,t,new Set);return l||jp(e,t,c=>Ll(c,t))}let o=t.cat?.get(n),i={};if(o){let l=!1;for(let[u,p]of o.params.entries()){let _=r[u];if(!_)break;let d=t.prunedValues,f=nr(_,t);if(t.prunedValues>d&&Ve(t,n,`/${p.name}`,{code:"pruned-value"}),i[p.name]=f,p.schema===void 0)continue;if(f==null&&p.defaultValue!==void 0){Ve(t,n,`/${p.name}`,{code:"type-mismatch",expected:El(p.schema)??"a defined value",actual:f===null?"null":"undefined"}),i[p.name]=p.defaultValue,t.prunedValues=d;continue}let v=Ro(f,p.schema,n,`/${p.name}`,t);v===wt&&(v=na(p.required,p.defaultValue),p.defaultValue!==void 0&&(t.prunedValues=d),v===wt?l=!0:v===void 0&&delete i[p.name]),v!==wt&&v!==void 0&&(i[p.name]=v)}r.length>o.params.length&&Ve(t,n,"",{code:"excess-args",declared:o.params.length,got:r.length});let c=o.params.filter(u=>u.required&&(!(u.name in i)||i[u.name]===null));if(c.length){let u=c.filter(p=>p.defaultValue!==void 0?(Ve(t,n,`/${p.name}`,{code:p.name in i?"null-required":"missing-required"}),i[p.name]=p.defaultValue,!1):!0);if(u.length){for(let p of u)Ve(t,n,`/${p.name}`,{code:p.name in i?"null-required":"missing-required",signature:Ml(n,o.params)});return null}}if(l)return null}else return Ve(t,n,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),null;let s=Object.values(i).some(l=>ra(l));return{type:"element",typeName:n,props:i,partial:t.partial,hasDynamicProps:s}}default:return Mp(e)?Ll(e,t):e}}function $l(e){let t=[],n=!1,r=!1;for(let s=0;s<e.length;s++){let l=e[s];if(r){r=!1;continue}if(l==="\\"&&n){r=!0;continue}if(n){l===n&&(n=!1);continue}if(l==='"'||l==="'"){n=l;continue}l==="("||l==="["||l==="{"?t.push(l):(l===")"&&t[t.length-1]==="("||l==="]"&&t[t.length-1]==="["||l==="}"&&t[t.length-1]==="{")&&t.pop()}if(!(!!n||t.length>0))return{text:e,wasIncomplete:!1};let i=e;n&&(r&&(i+="\\"),i+=n);for(let s=t.length-1;s>=0;s--)i+=t[s]==="("?")":t[s]==="["?"]":"}";return{text:i,wasIncomplete:!0}}function ia(e){let t=[],n=0;for(;n<e.length;){for(;n<e.length&&e[n]?.t===T.Newline;)n++;if(n>=e.length||e[n]?.t===T.EOF)break;let r=e[n];if(!r)break;if(r.t!==T.Ident&&r.t!==T.Type&&r.t!==T.StateVar){for(;n<e.length&&e[n]?.t!==T.Newline&&e[n]?.t!==T.EOF;)n++;continue}let o=r.v,i=r.t;if(n++,n>=e.length||e[n]?.t!==T.Equals){for(;n<e.length&&e[n]?.t!==T.Newline&&e[n]?.t!==T.EOF;)n++;continue}n++;let s=[],l=0,c=0;for(;n<e.length&&e[n]?.t!==T.EOF;){let u=e[n]?.t;if(u===T.Newline&&l<=0&&c<=0){let _=n+1;for(;_<e.length&&e[_]?.t===T.Newline;)_++;let d=_<e.length?e[_]?.t:T.EOF;if(d===T.Question||d===T.Colon&&c>0){n++;continue}break}if(u===T.Newline){n++;continue}u===T.LParen||u===T.LBrack||u===T.LBrace?l++:(u===T.RParen||u===T.RBrack||u===T.RBrace)&&l>0?l--:u===T.Question&&l===0?c++:u===T.Colon&&l===0&&c>0&&c--;let p=e[n++];p&&s.push(p)}s.length&&t.push({id:o,idTokenType:i,tokens:s})}return t}function sa(e=!0){return{root:null,meta:{incomplete:e,unresolved:[],orphaned:[],statementCount:0,errors:[]},stateDeclarations:{},queryStatements:[],mutationStatements:[]}}function Kp(e){if(!tr(e))return[];let t=new Set;return wo(e,n=>{n.k==="StateRef"&&t.add(n.n)}),[...t]}function Bl(e,t){if(t.k==="Comp"&&t.name===Tn.Query){let n=Kp(t.args[1]);return{kind:"query",id:e.id,call:{callee:Tn.Query,args:t.args},expr:t,deps:n.length>0?n:void 0}}return t.k==="Comp"&&t.name===Tn.Mutation?{kind:"mutation",id:e.id,call:{callee:Tn.Mutation,args:t.args},expr:t}:e.idTokenType===T.StateVar?{kind:"state",id:e.id,init:t}:{kind:"value",id:e.id,expr:t}}function Qb(e,t,n){let r={},o=[],i=[];for(let s of e)switch(s.kind){case"state":r[s.id]=nr(s.init,t);break;case"query":Nl(s.call.args,t,s.id),o.push({statementId:s.id,toolAST:s.call.args[0]??null,argsAST:s.call.args[1]??null,defaultsAST:s.call.args[2]??null,refreshAST:s.call.args[3]??null,deps:s.deps,complete:!0});break;case"mutation":Nl(s.call.args,t,s.id),i.push({statementId:s.id,toolAST:s.call.args[0]??null,argsAST:s.call.args[1]??null});break}for(let s of e){let l=s.kind==="state"?[s.init]:s.kind==="value"?[s.expr]:s.kind==="query"||s.kind==="mutation"?s.call.args:[];for(let c of l)for(let u of Kp(c))u===n?.name&&n.stmts.has(s)||u in r||(r[u]=null)}return{stateDeclarations:r,queryStatements:o,mutationStatements:i}}var Wp="root";function zl(e){return e?.k==="Comp"&&!e.fn&&!Co(e.name)&&!Or(e.name)}function Yb(e,t){if(e.has(Wp))return{id:Wp,fallback:!1};for(let n of e.values())if(n.kind==="value"&&zl(n.expr)&&n.expr.name===t)return{id:n.id,fallback:!0};return null}function Jb(e,t){let n=new Set;for(;e?.k==="Ref"&&!n.has(e.n);)n.add(e.n),e=t.get(e.n);return zl(e)}function Xb(e){let t=!1;return wo(e,n=>{zl(n)&&(t=!0)}),t}function aa(e,t,n,r,o,i,s){let l=Yb(e,i),c=new Map;for(let[S,g]of e)c.set(S,g.kind==="state"?g.init:g.expr);let u=[],p=[],_=new Set;for(let[S,g]of e)S!==l?.id&&(g.kind==="state"||g.kind==="query"||g.kind==="mutation"||_.add(S));let d={syms:c,cat:o,errors:p,unres:u,prunedValues:0,visited:new Set,partial:n,currentStatementId:l?.id,unreached:_},f=null,v,m=l&&c.get(l.id);if(l&&m){let S=nr(m,d);jt(S)?(f=S,f.statementId=l.id):tr(S)&&Xb(S)&&(v=S)}let{stateDeclarations:h,queryStatements:y,mutationStatements:P}=Qb(t,d,s);d.currentStatementId=l?.id;let x=i??"";l?!f&&!v&&!Jb(c.get(l.id),c)?Ve(d,x,"",{code:"no-root",reason:"not-component"}):l.fallback&&Ve(d,x,"",{code:"no-root",reason:f?"fallback":"missing"}):Ve(d,x,"",{code:"no-root",reason:"missing"});let C=l?[..._]:[];return{root:f,...v?{rootExpression:v}:{},meta:{incomplete:n,unresolved:u,orphaned:C,statementCount:r,errors:p},stateDeclarations:h,queryStatements:y,mutationStatements:P}}function Gp(e,t){if(e[t]!=='"')return t;let n=t+1;for(;n<e.length;){let r=e[n];if(r==="\\")n+=2;else{if(r==='"')return n+1;n++}}return n}function Zb(e){let t=[],n=0;for(;n<e.length;){let r=-1;for(;n<e.length;){let l=Gp(e,n);if(l>n){n=l;continue}if(e[n]==="`"&&n+1<e.length&&e[n+1]==="`"&&n+2<e.length&&e[n+2]==="`"){r=n;break}n++}if(r===-1)break;let o=r+3;for(;o<e.length&&e[o]!==`
|
|
39
|
+
`;)o++;if(o>=e.length){t.push(e.slice(r+3).replace(/^[^\n]*\n?/,"")),n=e.length;break}o++;let i=-1,s=o;for(;s<e.length;){let l=Gp(e,s);if(l>s){s=l;continue}if(e[s]==="`"&&s+1<e.length&&e[s+1]==="`"&&s+2<e.length&&e[s+2]==="`"){i=s;break}s++}i!==-1?(t.push(e.slice(o,i)),n=i+3):(t.push(e.slice(o)),n=e.length)}if(t.length>0)return t.join(`
|
|
40
40
|
`);if(e.startsWith("```")){let r=3;for(;r<e.length&&e[r]!==`
|
|
41
41
|
`;)r++;let o=r<e.length?r+1:3,i=e.slice(o),s=i.lastIndexOf("```");return s!==-1?i.slice(0,s):i}return e}function ey(e){let t=!1;return e.split(`
|
|
42
42
|
`).map(n=>{for(let r=0;r<n.length;r++){let o=n[r];if(t){if(o==="\\"&&r+1<n.length){r++;continue}o===t&&(t=!1);continue}if(o==='"'||o==="'"){t=o;continue}if(o==="/"&&n[r+1]==="/"||o==="#")return n.substring(0,r).trimEnd()}return n}).join(`
|
|
43
|
-
`)}function
|
|
43
|
+
`)}function Qp(e){return ey(Zb(e.trim())).trim()}function Yp(e,t,n){let r=Qp(e);if(!r)return sa();let{text:o,wasIncomplete:i}=$l(r),s=ia(Zi(o));if(!s.length)return sa(i);let l=new Map;for(let u of s){let p=Xi(u.tokens),_=Bl(u,p);l.set(u.id,_)}let c=[...l.values()];return aa(l,c,i,l.size,t,n)}function Jp(e,t){let n="",r="",o=0,i=new Map,s=0;function l(d){let f=d.trim();if(f)for(let v of ia(Zi(f))){let m=Xi(v.tokens),h=Bl(v,m);i.set(v.id,h),s++}}function c(){let d=Qp(n);d.startsWith(r.slice(0,o))||(o=0,i.clear(),s=0),r=d}function u(){let d=0,f=0,v=!1,m=!1,h=o;for(let y=o;y<r.length;y++){let P=r[y];if(m){m=!1;continue}if(P==="\\"&&v){m=!0;continue}if(v){P===v&&(v=!1);continue}if(P==='"'||P==="'"){v=P;continue}if(P==="("||P==="["||P==="{")d++;else if(P===")"||P==="]"||P==="}")d=Math.max(0,d-1);else if(P==="?"&&d===0)f++;else if(P===":"&&d===0&&f>0)f--;else if(P===`
|
|
44
44
|
`&&d<=0&&f<=0){let x=y+1;for(;x<r.length&&(r[x]===" "||r[x]===" "||r[x]==="\r"||r[x]===`
|
|
45
|
-
`);)x++;if(x<r.length&&(r[x]==="?"||r[x]===":"&&f>0))continue;let C=r.slice(h,y).trim();C&&l(C),h=y+1,o=y+1}}return h}function p(d=!1){c();let f=u(),v=r.slice(f).trim(),m=d?v:v.replace(/(\d)\.$/,"$1");if(!m)return s===0?sa():aa(i,[...i.values()],!1,s,e,t);let{text:h,wasIncomplete:y}=$l(m),P=ia(Zi(h));if(!P.length)return s===0?sa(y):aa(i,[...i.values()],y,s,e,t);let x=new Map(i),C=new Set;for(let k of P){if(i.has(k.id)&&y)continue;let N=Xi(k.tokens),I=Bl(k,N);x.set(k.id,I),C.add(I)}let S=d?void 0:/\$\w+$/.exec(n)?.[0],g=S&&m.endsWith(S)&&!new RegExp(`\\${S}(?!\\w)`).test(m.slice(0,-S.length))?S:void 0,b=[...x.values()];return aa(x,b,y,s+P.length,e,t,g?{name:g,stmts:C}:void 0)}function _(){n="",r="",o=0,i.clear(),s=0}return{push(d,f){return n+=d,p(f)},set(d,f){(d.length<n.length||!d.startsWith(n))&&_();let v=d.slice(n.length);return v&&(n+=v),p(f)},getResult:p}}function Ul(e,t){if(!e||typeof e!="object")return e;let n=e.$ref;if(typeof n=="string")return t.has(n)?Ul(t.get(n),t):e;let r=Array.isArray(e)?[...e]:{...e},o=!1;for(let[i,s]of Object.entries(r))r[i]=Ul(s,t),o||(o=r[i]!==s);return o?r:e}function Dl(e,t){let n=e.properties??{},r=e.required??[];return Object.keys(n).map(o=>({name:o,required:r.includes(o),defaultValue:ta(n[o]),schema:t.size?Ul(n[o],t):n[o]}))}function
|
|
45
|
+
`);)x++;if(x<r.length&&(r[x]==="?"||r[x]===":"&&f>0))continue;let C=r.slice(h,y).trim();C&&l(C),h=y+1,o=y+1}}return h}function p(d=!1){c();let f=u(),v=r.slice(f).trim(),m=d?v:v.replace(/(\d)\.$/,"$1");if(!m)return s===0?sa():aa(i,[...i.values()],!1,s,e,t);let{text:h,wasIncomplete:y}=$l(m),P=ia(Zi(h));if(!P.length)return s===0?sa(y):aa(i,[...i.values()],y,s,e,t);let x=new Map(i),C=new Set;for(let k of P){if(i.has(k.id)&&y)continue;let N=Xi(k.tokens),I=Bl(k,N);x.set(k.id,I),C.add(I)}let S=d?void 0:/\$\w+$/.exec(n)?.[0],g=S&&m.endsWith(S)&&!new RegExp(`\\${S}(?!\\w)`).test(m.slice(0,-S.length))?S:void 0,b=[...x.values()];return aa(x,b,y,s+P.length,e,t,g?{name:g,stmts:C}:void 0)}function _(){n="",r="",o=0,i.clear(),s=0}return{push(d,f){return n+=d,p(f)},set(d,f){(d.length<n.length||!d.startsWith(n))&&_();let v=d.slice(n.length);return v&&(n+=v),p(f)},getResult:p}}function Ul(e,t){if(!e||typeof e!="object")return e;let n=e.$ref;if(typeof n=="string")return t.has(n)?Ul(t.get(n),t):e;let r=Array.isArray(e)?[...e]:{...e},o=!1;for(let[i,s]of Object.entries(r))r[i]=Ul(s,t),o||(o=r[i]!==s);return o?r:e}function Dl(e,t){let n=e.properties??{},r=e.required??[];return Object.keys(n).map(o=>({name:o,required:r.includes(o),defaultValue:ta(n[o]),schema:t.size?Ul(n[o],t):n[o]}))}function Xp(e){let t=new Map,n=e.properties&&new Set(Object.keys(e.properties)),r=new Map;for(let o of[...Object.keys(Lp),...Object.keys(e.actions??{})]){let i=e.$defs?.[o];i&&!n?.has(o)&&r.set(`#/$defs/${o}`,i)}for(let[o,i]of Object.entries(e.$defs??{}))(n?!n.has(o):r.has(`#/$defs/${o}`))||t.set(o,{params:Dl(i,r)});t.callDefs=new Map(Yi);for(let[o,i]of Object.entries(e.functions??{}))t.callDefs.set(o,{kind:"function",params:Dl(i.params,r)});for(let[o,i]of Object.entries(e.actions??{}))t.callDefs.set(o,{kind:"action",params:Dl(i.params,r)});return t}var Zp=Qt.schema.$defs;function e_(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ao(e,t){if(e.$ref)return Fl(t)&&t.typeName===e.$ref.split("/").at(-1);if(e.anyOf)return e.anyOf.some(n=>Ao(n,t));if(e.enum&&!e.enum.includes(t))return!1;switch(e.type){case"string":return typeof t=="string"&&(e.pattern===void 0||new RegExp(e.pattern,"u").test(t));case"integer":return Number.isInteger(t);case"number":return typeof t=="number"&&Number.isFinite(t);case"boolean":return typeof t=="boolean";case"array":return Array.isArray(t)&&t.length>=(e.minItems??0)&&t.every(n=>e.items===void 0||Ao(e.items,n));case"object":{if(!e_(t)||!(e.required??[]).every(o=>Object.hasOwn(t,o)))return!1;let{properties:n={},additionalProperties:r}=e;return Object.entries(t).every(([o,i])=>{let s=Object.hasOwn(n,o)?n[o]:void 0;return s?Ao(s,i):typeof r=="object"?Ao(r,i):r!==!1})}default:return!0}}function Fl(e){if(!e_(e)||typeof e.typeName!="string"||typeof e.statementId!="string"||e.typeName===Qt.root)return!1;let t=Object.hasOwn(Zp,e.typeName)?Zp[e.typeName]:void 0;return t!==void 0&&Ao(t,e.props)}var n_=Xp(Qt.schema),ty={parse(e){return Yp(e,n_,Qt.root)}};function ny(){return Jp(n_,Qt.root)}var r_=Qt.schema.$defs,ry=new Map(Object.entries(r_).map(([e,t])=>[e,new Set(t.properties?.children?.items?.anyOf?.map(n=>n.$ref?.split("/").at(-1)))])),oy=new Set(Object.entries(r_).flatMap(([e,t])=>Object.values(t.properties??{}).some(n=>n.type==="object"||n.items?.type==="object")?[e]:[]));function o_(){let e=ny(),t=[];return function(r,o){let i=iy(e.set(r,!o),o,r,i_(t));return o&&t.length>0&&(i.error||i.elements.length===0)?{...i,error:!1,elements:t}:(t=i.elements,i)}}function iy(e,t,n,r){let o=a_(e,t,n,r);return!t&&(o.error||o.diagnostics.errors.length>0||o.diagnostics.unresolved.length>0||o.diagnostics.incomplete)&&console.warn("Generative UI diagnostics",{error:o.error,partial:o.partial,diagnostics:o.diagnostics}),o}function i_(e,t=new Map){for(let n of e)t.set(n.statementId,n),"children"in n.props&&i_(n.props.children,t);return t}function a_(e,t,n,r){let o=t&&!/\n\s*$/.test(n??"")?n?.match(/^\w+(?=\s*=)/gm)?.at(-1):void 0,i=e.root?.props.children,s=new Set,l=e.meta,c=e.meta.errors.some(h=>h.severity!=="warning"&&!(h.component==="Grid"&&h.path==="/columns"||h.component==="Cell"&&h.path==="/span"));function u(h,y,P){l===e.meta&&(l={...e.meta,errors:[...e.meta.errors]}),l.errors.push({code:"type-mismatch",component:h.typeName,path:y,message:P,statementId:h.statementId}),c=!0}function p(h,y,P){if(!jt(h)||typeof h.statementId!="string"||s.has(h.statementId)){u(y,`/children/${P}`,"Child must be a valid, uniquely named component");return}if(!ry.get(y.typeName)?.has(h.typeName)){u(y,`/children/${P}`,"Component is not allowed at this nesting level");return}if(s.add(h.statementId),oy.has(h.typeName)&&h.statementId===o)return r?.get(h.statementId);if((h.typeName==="Chart"||h.typeName==="Table")&&e.meta.errors.some(N=>N.statementId===h.statementId&&N.severity!=="warning"))return;let x=(h.typeName==="Grid"||h.typeName==="Cell"||h.typeName==="Carousel")&&Array.isArray(h.props.children)?h.props.children.flatMap((N,I)=>{let D=p(N,h,I);return D?[D]:[]}):void 0,C=!1;function S(N){return Object.fromEntries(Object.entries(N).flatMap(([I,D])=>D==null?[]:[[I,g(D)]]))}function g(N){return Array.isArray(N)?(N.some(I=>I==null)&&(C=!0),N.flatMap(I=>I==null?[]:[g(I)])):typeof N=="object"&&N!==null&&!jt(N)?S(N):N}let b=S(h.props);if(C&&(h.typeName==="Chart"||h.typeName==="Table")){u(h,"","A list item is missing");return}C&&(c=!0);let k={...h,props:{...b,...x&&{children:x}}};if(!Fl(k)){u(h,"","Component does not match the catalog");return}if(k.typeName==="Table"&&k.props.rows.some(N=>N.length!==k.props.columns.length)){u(h,"/rows","Every table row must contain one value per column");return}if(k.typeName==="Chart"&&!yp(k.props)){u(h,"/data","Every chart point must contain one value per series, and a pie one value");return}if(x?.length!==0&&!((k.typeName==="Chart"||k.typeName==="Table")&&(t||e.meta.incomplete)))return k}let _=e.root,d=_&&Array.isArray(i)?i.flatMap((h,y)=>{if(jt(h)&&h.typeName==="Cell")return u(_,`/children/${y}`,"Cell must be inside a Grid"),[];let P=p(h,_,y);return P&&P.typeName!=="Cell"?[P]:[]}):[],f=_?.hasDynamicProps===!0||e.queryStatements.length>0||e.mutationStatements.length>0||Object.keys(e.stateDeclarations).length>0||e.meta.errors.some(h=>h.code==="unknown-function"||h.code==="inline-reserved");f&&_&&u(_,"","Executable content is not supported by the static catalog"),_&&_.typeName!==Qt.root&&u(_,"","The block must use the catalog root component");let v=f||_!==null&&_.typeName!==Qt.root||!t&&(!Array.isArray(i)||d.length===0),m=!t&&!v&&(c||e.meta.incomplete);return{elements:v?[]:d,error:v,partial:m,diagnostics:l}}function s_(e,t){return a_(ty.parse(e),!1).elements.flatMap(r=>l_(r,t)).join(`
|
|
46
46
|
|
|
47
|
-
`)}function
|
|
47
|
+
`)}function l_(e,t){switch(e.typeName){case"Grid":case"Cell":case"Carousel":return e.props.children.flatMap(n=>l_(n,t));case"Text":return[e.props.text];case"Card":return[`${e.props.title}
|
|
48
48
|
${e.props.body}`];case"Metric":return[[e.props.label,e.props.value,e.props.change?.text,e.props.detail].filter(Boolean).join(`
|
|
49
49
|
`)];case"Table":return[[e.props.title,e.props.columns.join(" "),...e.props.rows.map(n=>n.join(" "))].join(`
|
|
50
50
|
`)];case"Chart":return[[e.props.title,...e.props.series?.length?[e.props.series.join(", ")]:[],...e.props.data.map(n=>`${n.label}: ${Cn(n.value).join(", ")}`)].join(`
|
|
51
51
|
`)];case"Product":return[[e.props.product.title,Dt(e.props.product.price,t),e.props.product.description,...e.props.product.details??[]].filter(Boolean).join(`
|
|
52
|
-
`)];case"Cart":return[[...e.props.cart.lines.map(n=>
|
|
53
|
-
`)];case"Order":return[[`${e.props.order.number} \xB7 ${e.props.order.status}`,...e.props.order.details??[],...e.props.order.items.map(n=>
|
|
52
|
+
`)];case"Cart":return[[...e.props.cart.lines.map(n=>t_(n,t)),...e.props.cart.totals.map(n=>Hl(n,t))].join(`
|
|
53
|
+
`)];case"Order":return[[`${e.props.order.number} \xB7 ${e.props.order.status}`,...e.props.order.details??[],...e.props.order.items.map(n=>t_(n,t)),...e.props.order.totals.map(n=>Hl(n,t))].join(`
|
|
54
54
|
`)];case"Flight":return[[...e.props.flight.legs.map(n=>ay(n,t)),[e.props.flight.fare,Dt(e.props.flight.price,t),e.props.flight.priceNote].filter(Boolean).join(" \xB7 "),...e.props.flight.details??[]].join(`
|
|
55
55
|
`)];case"Stay":return[[e.props.stay.name,e.props.stay.location,Zn(e.props.stay.checkIn,e.props.stay.checkOut,t),e.props.stay.room,Dt(e.props.stay.price,t),...e.props.stay.details??[]].filter(Boolean).join(`
|
|
56
56
|
`)];case"Package":return[[e.props.package.title,e.props.package.location,Zn(e.props.package.start,e.props.package.end,t),[Dt(e.props.package.price,t),e.props.package.priceNote].filter(Boolean).join(" "),...e.props.package.details??[]].filter(Boolean).join(`
|
|
57
57
|
`)];case"Booking":return[[`${e.props.booking.reference} \xB7 ${e.props.booking.status}`,e.props.booking.title,Zn(e.props.booking.start,e.props.booking.end,t),e.props.booking.travellers?.join(", "),...(e.props.booking.itinerary??[]).map(n=>[n.date&&Xn(n.date,t),n.time,n.title,n.detail].filter(Boolean).join(" \xB7 ")),...(e.props.booking.totals??[]).map(n=>Hl(n,t)),...e.props.booking.details??[]].filter(Boolean).join(`
|
|
58
|
-
`)]}}function ay(e,t){let n=xo(e.departs,e.arrives);return`${[e.carrier,e.number].filter(Boolean).join(" ")}: ${e.from} ${Xn(e.departs,t)} ${Lr(e.departs,t)} \u2192 ${e.to} ${Lr(e.arrives,t)}${n?` +${n}`:""}`}function e_(e,t){return`${[e.title,...Object.values(e.options??{})].join(", ")} \xD7 ${e.quantity}: ${Dt(e.price,t)}`}function Hl(e,t){return`${e.label}: ${Dt(e.amount,t)}`}function c_(e,{cssPrefix:t,strings:n,locale:r,onAction:o}){let i=[],s=oe(!1),l;return{...Gi(e),set_attr(c,u,p){if(u!==yo||p!=="openui"||c.index!==1)return wl(c,u,p);let _=document.createElement("div");c.nodes[c.index]?.parentElement?.replaceWith(_),l={textSig:oe(""),doneSig:oe(!1)},i.push(_),Kt(a(jl,{cssPrefix:t,textSig:l.textSig,doneSig:l.doneSig,replyDoneSig:s,strings:n,locale:r,onAction:o}),_)},add_text(c,u){l?l.textSig.value=l.textSig.peek()+u:Sl(c,u)},end_token(c){l&&(l.doneSig.value=!0,l=void 0),xl(c)},finish(){l&&(l.doneSig.value=!0),s.value=!0},dispose(){for(let c of i)Kt(null,c);i.length=0,l=void 0}}}function jl({textSig:e,doneSig:t,replyDoneSig:n,cssPrefix:r,strings:o,locale:i,onAction:s}){let l=xe(()=>{let u=r_();return Ze(()=>u(e.value,!t.value))},[e,t]),c={cssPrefix:r,strings:o,locale:i,onAction:s,busy:!n.value};return l.value.error?a("div",{role:"alert",children:o.visualError}):a("div",{class:`${r}-generative-ui`,"aria-busy":!t.value,children:[l.value.elements.map(u=>a(la,{element:u,context:c},u.statementId)),l.value.partial&&a("p",{role:"status",children:o.visualPartial}),l.value.elements.length===0&&!t.value?a("span",{role:"status",children:o.visualPreparing}):null]})}function la({element:e,context:t}){let{cssPrefix:n}=t;if(e.typeName==="Grid")return a("div",{class:`${n}-generative-ui-grid-container`,children:a("div",{class:`${n}-generative-ui-grid`,"data-equal-heights":Cp(e.props.children)||void 0,style:Object.fromEntries([2,3,4].map(r=>[`--${n}-cols-${r}`,kp(e.props.children.map(Tl),Math.min(r,e.props.columns))])),children:e.props.children.map(r=>a("div",{class:`${n}-generative-ui-cell`,style:{[`--${n}-span`]:Tl(r)},children:r.typeName==="Cell"?r.props.children.map(o=>a(la,{element:o,context:t},o.statementId)):a(la,{element:r,context:t})},r.statementId))})});switch(e.typeName){case"Carousel":return a("div",{role:"list",class:`${n}-generative-ui-carousel`,children:e.props.children.map(r=>a("div",{role:"listitem",children:a(la,{element:r,context:t})},r.statementId))});case"Text":return a("p",{children:e.props.text});case"Card":return a("section",{class:`${n}-generative-ui-card`,children:[er(e.props.image)&&a(Vl,{src:e.props.image,class:`${n}-generative-ui-photo`,wide:!0}),a("strong",{class:`${n}-generative-ui-title`,title:e.props.title,children:e.props.title}),a("p",{children:e.props.body}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Product":return a(ly,{...e.props,context:t});case"Flight":return a(dy,{...e.props,context:t});case"Stay":case"Package":return a(cy,{element:e,context:t});case"Booking":{let{booking:r}=e.props;return a("section",{class:`${n}-generative-ui-sheet`,children:[a("div",{class:`${n}-generative-ui-heading`,children:[a("strong",{dir:"ltr",children:r.reference}),a("span",{class:`${n}-generative-ui-pill`,children:r.status})]}),r.title&&a("strong",{children:r.title}),a(ca,{parts:[Zn(r.start,r.end,t.locale),r.travellers?.length&&`${t.strings.visualTravellers}: ${r.travellers.join(", ")}`],context:t}),r.itinerary?.length?a("ol",{class:`${n}-generative-ui-itinerary`,children:r.itinerary.map((o,i)=>a("li",{children:[a("span",{class:`${n}-generative-ui-muted`,children:[o.date&&Xn(o.date,t.locale),o.time].filter(Boolean).join(" \xB7 ")}),a("strong",{children:o.title}),o.detail&&a("span",{class:`${n}-generative-ui-muted`,children:o.detail})]},i))}):null,a(ql,{totals:r.totals??[],context:t}),a(Io,{details:r.details,context:t}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy})]})}case"Cart":return a("section",{class:`${n}-generative-ui-sheet`,children:[e.props.cart.messages?.map(r=>a("p",{role:r.severity==="info"?"status":"alert",class:`${n}-generative-ui-notice`,"data-severity":r.severity,children:r.text},r.text)),e.props.cart.lines.length?a(l_,{lines:e.props.cart.lines,context:t}):a("p",{class:`${n}-generative-ui-muted`,children:t.strings.visualCartEmpty}),e.props.cart.lines.length>0&&a(ql,{totals:e.props.cart.totals,context:t}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Order":return a("section",{class:`${n}-generative-ui-sheet`,children:[a("div",{class:`${n}-generative-ui-heading`,children:[a("strong",{dir:"ltr",children:e.props.order.number}),a("span",{class:`${n}-generative-ui-pill`,children:e.props.order.status})]}),e.props.order.date&&a("p",{class:`${n}-generative-ui-muted`,children:Cl(e.props.order.date,t.locale)}),a(Io,{details:e.props.order.details,context:t}),e.props.order.timeline?.length?a("ol",{class:`${n}-generative-ui-timeline`,children:e.props.order.timeline.map(r=>a("li",{"data-done":r.done,children:[a("span",{children:r.label}),r.date&&a("span",{class:`${n}-generative-ui-muted`,children:Cl(r.date,t.locale)})]},r.label))}):null,a(l_,{lines:e.props.order.items,context:t}),a(ql,{totals:e.props.order.totals,context:t}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Metric":{let r=xp(e.props.trend);return a("section",{children:[a("strong",{children:e.props.label}),a("div",{class:`${n}-generative-ui-metric`,children:[a("span",{children:e.props.value}),r&&a("svg",{viewBox:"0 0 80 24","aria-hidden":"true",children:a("polyline",{points:r,fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linejoin":"round","stroke-linecap":"round"})})]}),e.props.change&&a("span",{class:`${n}-generative-ui-change`,"data-tone":e.props.change.tone,children:e.props.change.text}),e.props.detail&&a("p",{children:e.props.detail})]})}case"Table":return a(py,{...e.props,context:t});case"Chart":return a(_y,{element:e,context:t})}}function ly({product:e,actions:t,context:n}){let{cssPrefix:r,strings:o}=n,[i,s]=$({}),l=Ip(e,i),c=Rl(t,n.onAction!==void 0).some(u=>u.message!==void 0);return a("section",{class:`${r}-generative-ui-offer`,children:[a(Wl,{image:l.image,url:e.url,badge:e.badge,available:l.available,context:n}),a("strong",{class:`${r}-generative-ui-title`,title:e.title,children:a(Gl,{title:e.title,url:e.url})}),a(Kl,{price:l.price,compareAtPrice:l.compareAtPrice,context:n}),a(ca,{parts:[],rating:e.rating,context:n}),e.description&&a("p",{class:`${r}-generative-ui-description`,title:e.description,children:e.description}),a(Io,{details:e.details,context:n}),a("div",{class:`${r}-generative-ui-footer`,children:[l.options.map(u=>a("fieldset",{class:`${r}-generative-ui-option`,children:[a("legend",{children:u.name}),a(fy,{children:u.values.map(p=>a("button",{type:"button","aria-pressed":u.value===p,disabled:u.unavailable.includes(p),onClick:()=>s({...i,[u.name]:p}),children:p},p))})]},u.name)),c&&a("p",{class:`${r}-generative-ui-hint`,children:l.missing.length>0&&`${o.visualChoose} ${l.missing.join(", ")}`}),a(Rn,{actions:t,context:n,disabled:n.busy||!l.canBuy,getMessage:u=>So(u,e.title,l.chosen)})]})]})}function l_({lines:e,context:t}){let{cssPrefix:n,strings:r}=t;if(!e.length)return null;let o=e.some(i=>i.image);return a("ul",{class:`${n}-generative-ui-lines`,children:e.map((i,s)=>a("li",{children:[o&&a(Vl,{src:i.image??"",class:`${n}-generative-ui-thumb`},i.image),a("div",{children:[a("div",{class:`${n}-generative-ui-line-head`,children:[a("span",{children:a(Gl,{title:i.title,url:i.url})}),a("strong",{children:Dt(i.price,t.locale)})]}),a("span",{class:`${n}-generative-ui-muted`,children:[...Object.entries(i.options??{}).map(([l,c])=>`${l}: ${c}`),`${r.visualQuantity} ${i.quantity}`].join(" \xB7 ")}),a(Rn,{actions:i.actions,context:t,disabled:t.busy,small:!0,getMessage:l=>So(l,i.title,i.options)})]})]},s))})}function Rn({actions:e,context:t,disabled:n,small:r,getMessage:o}){let i=Rl(e,t.onAction!==void 0);return i.length?a("div",{class:`${t.cssPrefix}-generative-ui-actions`,"data-small":r,children:i.map(s=>{if(s.message===void 0)return a("a",{href:s.url,target:"_blank",rel:"noopener noreferrer","data-primary":s.primary,title:s.label,children:a("span",{children:s.label})},s.label);let l=s.message;return a("button",{type:"button",disabled:n,"data-primary":s.primary,title:s.label,onClick:()=>t.onAction?.(o?.(l)??l),children:a("span",{children:s.label})},s.label)})}):null}function Vl({src:e,href:t,class:n,wide:r,children:o}){let[i,s]=$(!1),l=!i&&er(e)&&a("img",{src:e,alt:"",loading:"lazy",referrerpolicy:"no-referrer",onError:()=>s(!0)});return er(t)?a("a",{href:t,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,"aria-hidden":"true",class:n,"data-wide":r,children:[l,o]}):a("span",{class:n,"data-wide":r,children:[l,o]})}function Wl({image:e,url:t,badge:n,available:r,context:{cssPrefix:o,strings:i}}){let s=(n||!r)&&a("span",{class:`${o}-generative-ui-badges`,children:[n&&a("span",{class:`${o}-generative-ui-pill`,children:n}),!r&&a("span",{class:`${o}-generative-ui-pill`,children:i.visualSoldOut})]});return er(e)?a(Vl,{src:e,href:t,class:`${o}-generative-ui-photo`,children:s},e):s||null}function ca({parts:e,rating:t,context:{cssPrefix:n}}){let r=e.filter(o=>typeof o=="string"&&o).join(" \xB7 ");return!r&&!t?null:a("span",{class:`${n}-generative-ui-muted`,children:[t&&a(pe,{children:[a("span",{"aria-hidden":"true",class:`${n}-generative-ui-star`,children:["\u2605"," "]}),vp(t),t.count!==void 0&&` (${t.count})`,r&&" \xB7 "]}),r]})}function Io({details:e,context:{cssPrefix:t}}){return e?.length?a("ul",{class:`${t}-generative-ui-details`,children:e.map(n=>a("li",{children:n},n))}):null}function cy({element:e,context:t}){let{cssPrefix:n,locale:r}=t,o=hp(e,t.strings,r);return a("section",{class:`${n}-generative-ui-offer`,children:[a(Wl,{image:o.image,url:o.url,badge:o.badge,available:o.available,context:t}),a("strong",{class:`${n}-generative-ui-title`,title:o.title,children:[a(Gl,{title:o.title,url:o.url}),o.stars!==void 0&&o.stars>0&&a("span",{class:`${n}-generative-ui-stars`,role:"img","aria-label":`${o.stars} \u2605`,children:[" ","\u2605".repeat(Math.min(o.stars,5))]})]}),a(ca,{parts:[o.location],rating:o.rating,context:t}),a(ca,{parts:[o.when],context:t}),o.room&&a("p",{children:o.room}),a(Io,{details:o.details,context:t}),a("div",{class:`${n}-generative-ui-footer`,children:[a(Kl,{price:o.price,compareAtPrice:o.compareAtPrice,note:o.note,context:t}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy||!o.available,getMessage:i=>So(i,o.title,void 0)})]})]})}function dy({flight:e,actions:t,context:n}){let{cssPrefix:r,strings:o,locale:i}=n;return a("section",{class:`${r}-generative-ui-flight`,children:[e.legs.map((s,l)=>a(uy,{leg:s,strings:o,locale:i,cssPrefix:r},l)),a(Io,{details:e.details,context:n}),a("div",{class:`${r}-generative-ui-footer`,children:[a(Wl,{image:void 0,url:void 0,badge:e.badge,available:e.available!==!1,context:n}),a(Kl,{price:e.price,compareAtPrice:void 0,note:[e.fare,e.priceNote].filter(Boolean).join(" \xB7 "),context:n}),a(Rn,{actions:t,context:n,disabled:n.busy||e.available===!1,getMessage:s=>So(s,Rp(e),void 0)})]})]})}function uy({leg:e,strings:t,locale:n,cssPrefix:r}){let o=xo(e.departs,e.arrives),i=mp(e,t,n);return a("div",{class:`${r}-generative-ui-leg`,children:[a("span",{class:`${r}-generative-ui-muted`,children:[e.carrier,e.number,Xn(e.departs,n)].filter(Boolean).join(" \xB7 ")}),a("div",{class:`${r}-generative-ui-leg-times`,children:[a("span",{children:[a("strong",{children:Lr(e.departs,n)}),a("span",{children:e.from})]}),a("span",{class:`${r}-generative-ui-leg-path`,children:i}),a("span",{children:[a("strong",{children:[Lr(e.arrives,n),o!==void 0&&a("sup",{children:["+",o]})]}),a("span",{children:e.to})]})]})]})}function py({title:e,columns:t,rows:n,context:{cssPrefix:r,locale:o}}){let[i,s]=$(void 0),l=Sp(t,n),c=wp(n,i&&{...i,numeric:l[i.column]??!1},o);return a("section",{class:`${r}-generative-ui-table-card`,children:a("div",{class:`${r}-generative-ui-table`,children:a("table",{children:[a("caption",{children:e}),a("thead",{children:a("tr",{children:t.map((u,p)=>a("th",{scope:"col","data-numeric":l[p],"aria-sort":i?.column===p?i.descending?"descending":"ascending":void 0,children:a("button",{type:"button",onClick:()=>s({column:p,descending:i?.column===p&&!i.descending}),children:u})},p))})}),a("tbody",{children:c.map((u,p)=>a("tr",{children:u.map((_,d)=>a("td",{"data-numeric":l[d],"data-label":t[d],children:_},d))},p))})]})})})}function Gl({title:e,url:t}){return er(t)?a("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:e}):a(pe,{children:e})}function Kl({price:e,compareAtPrice:t,note:n,context:{cssPrefix:r,locale:o}}){return a("span",{class:`${r}-generative-ui-price`,children:[a("strong",{children:Dt(e,o)}),t&&Ap(e,t)&&a("s",{children:Dt(t,o)}),n&&a("span",{class:`${r}-generative-ui-muted`,children:n})]})}function ql({totals:e,context:{cssPrefix:t,locale:n}}){return e.length?a("dl",{class:`${t}-generative-ui-totals`,children:e.map(r=>a("div",{children:[a("dt",{children:r.label}),a("dd",{children:Dt(r.amount,n)})]},r.label))}):null}function _y({element:e,context:{cssPrefix:t,locale:n}}){let{type:r,data:o,series:i=[],title:s}=e.props,{baseline:l,barWidth:c,series:u,labels:p,ticks:_,slices:d}=Pp(e.props,n),f=["currentColor",...yp],v=r==="pie"?o.map((m,h)=>`${m.label} ${Math.round((d[h]?.share??0)*100)}%`):u.length>1?i:[];return a("section",{children:[a("strong",{children:s}),a("svg",{class:`${t}-generative-ui-chart`,viewBox:"0 0 320 168",role:"img","aria-label":`${s}. ${i.length>1?`${i.join(" / ")}. `:""}${o.map(m=>`${m.label}: ${Cn(m.value).join(" / ")}`).join(", ")}`,children:[r==="pie"?d.map((m,h)=>a("path",{d:m.path,fill:f[h%f.length]},h)):u.map((m,h)=>r==="line"?a("g",{fill:f[h%f.length],children:[a("polyline",{points:m.map(y=>`${y.x},${y.y}`).join(" "),fill:"none",stroke:f[h%f.length],"stroke-width":2.5,"stroke-linejoin":"round"}),m.map((y,P)=>a("circle",{cx:y.x,cy:y.y,r:3},P))]},h):a("g",{fill:f[h%f.length],children:m.map((y,P)=>a("rect",{x:y.x-c/2,y:Math.min(y.y,l),width:c,height:Math.abs(y.y-l),rx:2},P))},h)),r!=="pie"&&a("g",{class:`${t}-generative-ui-axis`,children:[a("line",{x1:24,x2:296,y1:l,y2:l}),p.map((m,h)=>a("text",{x:m.x,y:164,"text-anchor":"middle",children:m.text},h)),_.map(m=>a("text",{x:20,y:m.y+3,"text-anchor":"end",children:m.text},m.text))]})]}),v.length>0&&a("ul",{class:`${t}-generative-ui-legend`,children:v.map((m,h)=>a("li",{style:{color:h?f[h%f.length]:void 0},children:a("span",{children:m})},h))})]})}function da(e,t){if(!e.includes("```openui"))return e;let n="",r=0,o=0,i=0,s=0,l;function c(p){l?.language==="openui"&&(n+=e.slice(r,l.start)+a_(l.source,t)+(e[p-1]===`
|
|
58
|
+
`)]}}function ay(e,t){let n=xo(e.departs,e.arrives);return`${[e.carrier,e.number].filter(Boolean).join(" ")}: ${e.from} ${Xn(e.departs,t)} ${Lr(e.departs,t)} \u2192 ${e.to} ${Lr(e.arrives,t)}${n?` +${n}`:""}`}function t_(e,t){return`${[e.title,...Object.values(e.options??{})].join(", ")} \xD7 ${e.quantity}: ${Dt(e.price,t)}`}function Hl(e,t){return`${e.label}: ${Dt(e.amount,t)}`}function d_(e,{cssPrefix:t,strings:n,locale:r,onAction:o}){let i=[],s=oe(!1),l;return{...Gi(e),set_attr(c,u,p){if(u!==yo||p!=="openui"||c.index!==1)return wl(c,u,p);let _=document.createElement("div");c.nodes[c.index]?.parentElement?.replaceWith(_),l={textSig:oe(""),doneSig:oe(!1)},i.push(_),Kt(a(jl,{cssPrefix:t,textSig:l.textSig,doneSig:l.doneSig,replyDoneSig:s,strings:n,locale:r,onAction:o}),_)},add_text(c,u){l?l.textSig.value=l.textSig.peek()+u:Sl(c,u)},end_token(c){l&&(l.doneSig.value=!0,l=void 0),xl(c)},finish(){l&&(l.doneSig.value=!0),s.value=!0},dispose(){for(let c of i)Kt(null,c);i.length=0,l=void 0}}}function jl({textSig:e,doneSig:t,replyDoneSig:n,cssPrefix:r,strings:o,locale:i,onAction:s}){let l=xe(()=>{let u=o_();return Ze(()=>u(e.value,!t.value))},[e,t]),c={cssPrefix:r,strings:o,locale:i,onAction:s,busy:!n.value};return l.value.error?a("div",{role:"alert",children:o.visualError}):a("div",{class:`${r}-generative-ui`,"aria-busy":!t.value,children:[l.value.elements.map(u=>a(la,{element:u,context:c},u.statementId)),l.value.partial&&a("p",{role:"status",children:o.visualPartial}),l.value.elements.length===0&&!t.value?a("span",{role:"status",children:o.visualPreparing}):null]})}function la({element:e,context:t}){let{cssPrefix:n}=t;if(e.typeName==="Grid")return a("div",{class:`${n}-generative-ui-grid-container`,children:a("div",{class:`${n}-generative-ui-grid`,"data-equal-heights":Tp(e.props.children)||void 0,style:Object.fromEntries([2,3,4].map(r=>[`--${n}-cols-${r}`,Cp(e.props.children.map(Tl),Math.min(r,e.props.columns))])),children:e.props.children.map(r=>a("div",{class:`${n}-generative-ui-cell`,style:{[`--${n}-span`]:Tl(r)},children:r.typeName==="Cell"?r.props.children.map(o=>a(la,{element:o,context:t},o.statementId)):a(la,{element:r,context:t})},r.statementId))})});switch(e.typeName){case"Carousel":return a("div",{role:"list",class:`${n}-generative-ui-carousel`,children:e.props.children.map(r=>a("div",{role:"listitem",children:a(la,{element:r,context:t})},r.statementId))});case"Text":return a("p",{children:e.props.text});case"Card":return a("section",{class:`${n}-generative-ui-card`,children:[er(e.props.image)&&a(Vl,{src:e.props.image,class:`${n}-generative-ui-photo`,wide:!0}),a("strong",{class:`${n}-generative-ui-title`,title:e.props.title,children:e.props.title}),a("p",{children:e.props.body}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Product":return a(ly,{...e.props,context:t});case"Flight":return a(dy,{...e.props,context:t});case"Stay":case"Package":return a(cy,{element:e,context:t});case"Booking":{let{booking:r}=e.props;return a("section",{class:`${n}-generative-ui-sheet`,children:[a("div",{class:`${n}-generative-ui-heading`,children:[a("strong",{dir:"ltr",children:r.reference}),a("span",{class:`${n}-generative-ui-pill`,children:r.status})]}),r.title&&a("strong",{children:r.title}),a(ca,{parts:[Zn(r.start,r.end,t.locale),r.travellers?.length&&`${t.strings.visualTravellers}: ${r.travellers.join(", ")}`],context:t}),r.itinerary?.length?a("ol",{class:`${n}-generative-ui-itinerary`,children:r.itinerary.map((o,i)=>a("li",{children:[a("span",{class:`${n}-generative-ui-muted`,children:[o.date&&Xn(o.date,t.locale),o.time].filter(Boolean).join(" \xB7 ")}),a("strong",{children:o.title}),o.detail&&a("span",{class:`${n}-generative-ui-muted`,children:o.detail})]},i))}):null,a(ql,{totals:r.totals??[],context:t}),a(Io,{details:r.details,context:t}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy})]})}case"Cart":return a("section",{class:`${n}-generative-ui-sheet`,children:[e.props.cart.messages?.map(r=>a("p",{role:r.severity==="info"?"status":"alert",class:`${n}-generative-ui-notice`,"data-severity":r.severity,children:r.text},r.text)),e.props.cart.lines.length?a(c_,{lines:e.props.cart.lines,context:t}):a("p",{class:`${n}-generative-ui-muted`,children:t.strings.visualCartEmpty}),e.props.cart.lines.length>0&&a(ql,{totals:e.props.cart.totals,context:t}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Order":return a("section",{class:`${n}-generative-ui-sheet`,children:[a("div",{class:`${n}-generative-ui-heading`,children:[a("strong",{dir:"ltr",children:e.props.order.number}),a("span",{class:`${n}-generative-ui-pill`,children:e.props.order.status})]}),e.props.order.date&&a("p",{class:`${n}-generative-ui-muted`,children:Cl(e.props.order.date,t.locale)}),a(Io,{details:e.props.order.details,context:t}),e.props.order.timeline?.length?a("ol",{class:`${n}-generative-ui-timeline`,children:e.props.order.timeline.map(r=>a("li",{"data-done":r.done,children:[a("span",{children:r.label}),r.date&&a("span",{class:`${n}-generative-ui-muted`,children:Cl(r.date,t.locale)})]},r.label))}):null,a(c_,{lines:e.props.order.items,context:t}),a(ql,{totals:e.props.order.totals,context:t}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Metric":{let r=Sp(e.props.trend);return a("section",{children:[a("strong",{children:e.props.label}),a("div",{class:`${n}-generative-ui-metric`,children:[a("span",{children:e.props.value}),r&&a("svg",{viewBox:"0 0 80 24","aria-hidden":"true",children:a("polyline",{points:r,fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linejoin":"round","stroke-linecap":"round"})})]}),e.props.change&&a("span",{class:`${n}-generative-ui-change`,"data-tone":e.props.change.tone,children:e.props.change.text}),e.props.detail&&a("p",{children:e.props.detail})]})}case"Table":return a(py,{...e.props,context:t});case"Chart":return a(_y,{element:e,context:t})}}function ly({product:e,actions:t,context:n}){let{cssPrefix:r,strings:o}=n,[i,s]=$({}),l=Ep(e,i),c=Rl(t,n.onAction!==void 0).some(u=>u.message!==void 0);return a("section",{class:`${r}-generative-ui-offer`,children:[a(Wl,{image:l.image,url:e.url,badge:e.badge,available:l.available,context:n}),a("strong",{class:`${r}-generative-ui-title`,title:e.title,children:a(Gl,{title:e.title,url:e.url})}),a(Kl,{price:l.price,compareAtPrice:l.compareAtPrice,context:n}),a(ca,{parts:[],rating:e.rating,context:n}),e.description&&a("p",{class:`${r}-generative-ui-description`,title:e.description,children:e.description}),a(Io,{details:e.details,context:n}),a("div",{class:`${r}-generative-ui-footer`,children:[l.options.map(u=>a("fieldset",{class:`${r}-generative-ui-option`,children:[a("legend",{children:u.name}),a(fy,{children:u.values.map(p=>a("button",{type:"button","aria-pressed":u.value===p,disabled:u.unavailable.includes(p),onClick:()=>s({...i,[u.name]:p}),children:p},p))})]},u.name)),c&&a("p",{class:`${r}-generative-ui-hint`,children:l.missing.length>0&&`${o.visualChoose} ${l.missing.join(", ")}`}),a(Rn,{actions:t,context:n,disabled:n.busy||!l.canBuy,getMessage:u=>So(u,e.title,l.chosen)})]})]})}function c_({lines:e,context:t}){let{cssPrefix:n,strings:r}=t;if(!e.length)return null;let o=e.some(i=>i.image);return a("ul",{class:`${n}-generative-ui-lines`,children:e.map((i,s)=>a("li",{children:[o&&a(Vl,{src:i.image??"",class:`${n}-generative-ui-thumb`},i.image),a("div",{children:[a("div",{class:`${n}-generative-ui-line-head`,children:[a("span",{children:a(Gl,{title:i.title,url:i.url})}),a("strong",{children:Dt(i.price,t.locale)})]}),a("span",{class:`${n}-generative-ui-muted`,children:[...Object.entries(i.options??{}).map(([l,c])=>`${l}: ${c}`),`${r.visualQuantity} ${i.quantity}`].join(" \xB7 ")}),a(Rn,{actions:i.actions,context:t,disabled:t.busy,small:!0,getMessage:l=>So(l,i.title,i.options)})]})]},s))})}function Rn({actions:e,context:t,disabled:n,small:r,getMessage:o}){let i=Rl(e,t.onAction!==void 0);return i.length?a("div",{class:`${t.cssPrefix}-generative-ui-actions`,"data-small":r,children:i.map(s=>{if(s.message===void 0)return a("a",{href:s.url,target:"_blank",rel:"noopener noreferrer","data-primary":s.primary,title:s.label,children:a("span",{children:s.label})},s.label);let l=s.message;return a("button",{type:"button",disabled:n,"data-primary":s.primary,title:s.label,onClick:()=>t.onAction?.(o?.(l)??l),children:a("span",{children:s.label})},s.label)})}):null}function Vl({src:e,href:t,class:n,wide:r,children:o}){let[i,s]=$(!1),l=!i&&er(e)&&a("img",{src:e,alt:"",loading:"lazy",referrerpolicy:"no-referrer",onError:()=>s(!0)});return er(t)?a("a",{href:t,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,"aria-hidden":"true",class:n,"data-wide":r,children:[l,o]}):a("span",{class:n,"data-wide":r,children:[l,o]})}function Wl({image:e,url:t,badge:n,available:r,context:{cssPrefix:o,strings:i}}){let s=(n||!r)&&a("span",{class:`${o}-generative-ui-badges`,children:[n&&a("span",{class:`${o}-generative-ui-pill`,children:n}),!r&&a("span",{class:`${o}-generative-ui-pill`,children:i.visualSoldOut})]});return er(e)?a(Vl,{src:e,href:t,class:`${o}-generative-ui-photo`,children:s},e):s||null}function ca({parts:e,rating:t,context:{cssPrefix:n}}){let r=e.filter(o=>typeof o=="string"&&o).join(" \xB7 ");return!r&&!t?null:a("span",{class:`${n}-generative-ui-muted`,children:[t&&a(pe,{children:[a("span",{"aria-hidden":"true",class:`${n}-generative-ui-star`,children:["\u2605"," "]}),bp(t),t.count!==void 0&&` (${t.count})`,r&&" \xB7 "]}),r]})}function Io({details:e,context:{cssPrefix:t}}){return e?.length?a("ul",{class:`${t}-generative-ui-details`,children:e.map(n=>a("li",{children:n},n))}):null}function cy({element:e,context:t}){let{cssPrefix:n,locale:r}=t,o=vp(e,t.strings,r);return a("section",{class:`${n}-generative-ui-offer`,children:[a(Wl,{image:o.image,url:o.url,badge:o.badge,available:o.available,context:t}),a("strong",{class:`${n}-generative-ui-title`,title:o.title,children:[a(Gl,{title:o.title,url:o.url}),o.stars!==void 0&&o.stars>0&&a("span",{class:`${n}-generative-ui-stars`,role:"img","aria-label":`${o.stars} \u2605`,children:[" ","\u2605".repeat(Math.min(o.stars,5))]})]}),a(ca,{parts:[o.location],rating:o.rating,context:t}),a(ca,{parts:[o.when],context:t}),o.room&&a("p",{children:o.room}),a(Io,{details:o.details,context:t}),a("div",{class:`${n}-generative-ui-footer`,children:[a(Kl,{price:o.price,compareAtPrice:o.compareAtPrice,note:o.note,context:t}),a(Rn,{actions:e.props.actions,context:t,disabled:t.busy||!o.available,getMessage:i=>So(i,o.title,void 0)})]})]})}function dy({flight:e,actions:t,context:n}){let{cssPrefix:r,strings:o,locale:i}=n;return a("section",{class:`${r}-generative-ui-flight`,children:[e.legs.map((s,l)=>a(uy,{leg:s,strings:o,locale:i,cssPrefix:r},l)),a(Io,{details:e.details,context:n}),a("div",{class:`${r}-generative-ui-footer`,children:[a(Wl,{image:void 0,url:void 0,badge:e.badge,available:e.available!==!1,context:n}),a(Kl,{price:e.price,compareAtPrice:void 0,note:[e.fare,e.priceNote].filter(Boolean).join(" \xB7 "),context:n}),a(Rn,{actions:t,context:n,disabled:n.busy||e.available===!1,getMessage:s=>So(s,Ap(e),void 0)})]})]})}function uy({leg:e,strings:t,locale:n,cssPrefix:r}){let o=xo(e.departs,e.arrives),i=hp(e,t,n);return a("div",{class:`${r}-generative-ui-leg`,children:[a("span",{class:`${r}-generative-ui-muted`,children:[e.carrier,e.number,Xn(e.departs,n)].filter(Boolean).join(" \xB7 ")}),a("div",{class:`${r}-generative-ui-leg-times`,children:[a("span",{children:[a("strong",{children:Lr(e.departs,n)}),a("span",{children:e.from})]}),a("span",{class:`${r}-generative-ui-leg-path`,children:i}),a("span",{children:[a("strong",{children:[Lr(e.arrives,n),o!==void 0&&a("sup",{children:["+",o]})]}),a("span",{children:e.to})]})]})]})}function py({title:e,columns:t,rows:n,context:{cssPrefix:r,locale:o}}){let[i,s]=$(void 0),l=wp(t,n),c=kp(n,i&&{...i,numeric:l[i.column]??!1},o);return a("section",{class:`${r}-generative-ui-table-card`,children:a("div",{class:`${r}-generative-ui-table`,children:a("table",{children:[a("caption",{children:e}),a("thead",{children:a("tr",{children:t.map((u,p)=>a("th",{scope:"col","data-numeric":l[p],"aria-sort":i?.column===p?i.descending?"descending":"ascending":void 0,children:a("button",{type:"button",onClick:()=>s({column:p,descending:i?.column===p&&!i.descending}),children:u})},p))})}),a("tbody",{children:c.map((u,p)=>a("tr",{children:u.map((_,d)=>a("td",{"data-numeric":l[d],"data-label":t[d],children:_},d))},p))})]})})})}function Gl({title:e,url:t}){return er(t)?a("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:e}):a(pe,{children:e})}function Kl({price:e,compareAtPrice:t,note:n,context:{cssPrefix:r,locale:o}}){return a("span",{class:`${r}-generative-ui-price`,children:[a("strong",{children:Dt(e,o)}),t&&Ip(e,t)&&a("s",{children:Dt(t,o)}),n&&a("span",{class:`${r}-generative-ui-muted`,children:n})]})}function ql({totals:e,context:{cssPrefix:t,locale:n}}){return e.length?a("dl",{class:`${t}-generative-ui-totals`,children:e.map(r=>a("div",{children:[a("dt",{children:r.label}),a("dd",{children:Dt(r.amount,n)})]},r.label))}):null}function _y({element:e,context:{cssPrefix:t,locale:n}}){let{type:r,data:o,series:i=[],title:s}=e.props,{baseline:l,barWidth:c,series:u,labels:p,ticks:_,slices:d}=xp(e.props,n),f=["currentColor",...Pp],v=r==="pie"?o.map((m,h)=>`${m.label} ${Math.round((d[h]?.share??0)*100)}%`):u.length>1?i:[];return a("section",{children:[a("strong",{children:s}),a("svg",{class:`${t}-generative-ui-chart`,viewBox:"0 0 320 168",role:"img","aria-label":`${s}. ${i.length>1?`${i.join(" / ")}. `:""}${o.map(m=>`${m.label}: ${Cn(m.value).join(" / ")}`).join(", ")}`,children:[r==="pie"?d.map((m,h)=>a("path",{d:m.path,fill:f[h%f.length]},h)):u.map((m,h)=>r==="line"?a("g",{fill:f[h%f.length],children:[a("polyline",{points:m.map(y=>`${y.x},${y.y}`).join(" "),fill:"none",stroke:f[h%f.length],"stroke-width":2.5,"stroke-linejoin":"round"}),m.map((y,P)=>a("circle",{cx:y.x,cy:y.y,r:3},P))]},h):a("g",{fill:f[h%f.length],children:m.map((y,P)=>a("rect",{x:y.x-c/2,y:Math.min(y.y,l),width:c,height:Math.abs(y.y-l),rx:2},P))},h)),r!=="pie"&&a("g",{class:`${t}-generative-ui-axis`,children:[a("line",{x1:24,x2:296,y1:l,y2:l}),p.map((m,h)=>a("text",{x:m.x,y:164,"text-anchor":"middle",children:m.text},h)),_.map(m=>a("text",{x:20,y:m.y+3,"text-anchor":"end",children:m.text},m.text))]})]}),v.length>0&&a("ul",{class:`${t}-generative-ui-legend`,children:v.map((m,h)=>a("li",{style:{color:h?f[h%f.length]:void 0},children:a("span",{children:m})},h))})]})}function da(e,t){if(!e.includes("```openui"))return e;let n="",r=0,o=0,i=0,s=0,l;function c(p){l?.language==="openui"&&(n+=e.slice(r,l.start)+s_(l.source,t)+(e[p-1]===`
|
|
59
59
|
`?`
|
|
60
60
|
`:""),r=p),l=void 0}let u=Po({data:void 0,add_token(p,_){s+=1,_===10&&s===1&&(l={start:i,source:"",language:""})},set_attr(p,_,d){l&&_===yo&&(l.language=d)},add_text(p,_){l&&(l.source+=_)},end_token(){l&&c(Math.min(o+1,e.length)),s-=1}});for(;o<e.length;o++)Qe(u,e.charAt(o)),e[o]===`
|
|
61
|
-
`&&(i=o+1);return Mr(u),l&&c(e.length),n+e.slice(r)}function fy({children:e}){let t=B(null),[n,r]=$({start:!1,end:!1});return U(()=>{let o=t.current;if(!o)return;function i(){if(!o)return;let l=Tp(o);r(c=>c.start===l.start&&c.end===l.end?c:l)}i(),o.addEventListener("scroll",i,{passive:!0});let s=typeof ResizeObserver>"u"?void 0:new ResizeObserver(i);return s?.observe(o),()=>{o.removeEventListener("scroll",i),s?.disconnect()}},[]),a("div",{ref:t,"data-cut-start":n.start||void 0,"data-cut-end":n.end||void 0,children:e})}function Ql(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function gy(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function d_(e){return e.startsWith("tool-")?e.slice(5):e}var _t={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",emailTranscript:"/pai/email-transcript",cancelOperatorRequest:"/pai/cancel-request-operator",content:"/pai/content",contentCollections:"/pai/content/collection/list",contentVoteSet:"/pai/content/vote/set"},Yl="context";function ua(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pa(e){if(!ua(e))return;let t=e,n=t.controlMode,r=t.controlRevision;if(!(n!=="ai-agent"&&n!=="awaiting-operator"&&n!=="operator"||typeof r!="number"||!Number.isSafeInteger(r)||r<0))return{controlMode:n,controlRevision:r,assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,assignedOperatorName:typeof t.assignedOperatorName=="string"&&t.assignedOperatorName?t.assignedOperatorName:void 0,assignedOperatorAvatar:typeof t.assignedOperatorAvatar=="string"&&t.assignedOperatorAvatar?t.assignedOperatorAvatar:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function u_(e){if(!ua(e))return;let t=e.status,n=e.postFinishSequence;if(!(t!=="compacting"&&t!=="ready"||typeof n!="number"||!Number.isSafeInteger(n)||n<0))return{status:t,postFinishSequence:n}}function _a(e){let t=ua(e)?e.suggestions:void 0;if(!Array.isArray(t))return[];let n=[];for(let r of t){if(!ua(r))continue;let{id:o,label:i,text:s}=r;typeof i!="string"||!i||n.push({id:typeof o=="string"&&o?o:`s${n.length}`,label:i,text:typeof s=="string"&&s?s:i})}return n}function Jl(e){let n={messages:e.messages.map(r=>({id:r.serverMessageId??r.id,parts:hy(r),role:r.role})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs),e.clientTools?.length&&(n.clientTools=e.clientTools),n}function my(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function hy(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,filename:n.filename,fileId:n.fileId,fileSize:n.fileSize}),n.kind==="tool"&&my(n)){let r=n.dynamic?{type:"dynamic-tool",toolName:n.toolName,toolCallId:n.toolCallId,state:n.state}:{type:gy(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(r.input=n.input),n.output!==void 0&&(r.output=n.output),n.error!==void 0&&(r.errorText=n.error),n.approval?.approved!==void 0&&(r.approval=n.approval),n.toolMetadata&&(r.toolMetadata=n.toolMetadata),t.push(r)}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}function Zl(e,t,n=Lt()){let r=e?[{kind:"text",id:"t0",textSig:oe(e),doneSig:oe(!0)}]:[];return{id:n,role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:oe(r)}}function Yt(){return{id:Lt(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:oe([])}}function ec(e){let t=Lt();return vy({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function vy(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:oe(e.parts.map(ky))}}function by(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status==="streaming"?"streaming":"complete"}function tc(e){let t=new Set,n=e.parts.map((o,i)=>o.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:oe(o.text),doneSig:oe(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:oe(o.text),doneSig:oe(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType,filename:o.filename,fileId:o.fileId,fileSize:o.fileSize}:o.type==="source-url"?{kind:"source",sourceId:o.sourceId,url:o.url,title:o.title}:o.type==="source-document"?{kind:"source",sourceId:o.sourceId,title:o.title,filename:o.filename,mediaType:o.mediaType}:o.type==="data-suggestions"?null:o.type==="dynamic-tool"||o.type.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:o.type==="dynamic-tool"?o.toolName:d_(o.type),title:o.title,dynamic:o.type==="dynamic-tool"?!0:void 0,toolMetadata:o.toolMetadata,inputPartialSig:oe(""),inputSig:oe(o.input),outputSig:oe(o.output),errorSig:oe(o.errorText),stateSig:oe(o.state),approvalSig:oe(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),r=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:r?.type==="data-suggestions"?_a(r.data):void 0,serverMessageId:e.id,createdAt:Date.parse(e.createdAt),status:by(e),canceled:e.status==="canceled",feedback:e.feedback??null,stepTimings:fa(e.metadata?.steps),partsSig:oe(n)}}function fa(e){if(!(!e?.length||!e.every(t=>p_(t.durationMs))))return e.map(({durationMs:t,reasoningMs:n})=>({durationMs:Number(t),...p_(n)?{reasoningMs:n}:{}}))}function p_(e){return typeof e=="number"&&Number.isFinite(e)}function yy(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type==="dynamic-tool"||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function Py(e){return e.role==="assistant"&&e.status==="streaming"&&yy(e)}function In(e){let t=e.length-1;return e.filter((n,r)=>r===t||!Py(n)).map(tc)}function __(e,t){let n=!t&&e.at(-1)?.role==="assistant"?-2:-1,r=e.at(n);return!r||r.ephemeral?[]:[r]}function nc(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(Cy)}}function He(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function ga(e,t,n,r,o=t.createdAt){let i=e.find(u=>u.role==="user"&&!u.ephemeral);function s(u,p){return(u.role==="assistant"?da(He(u)):He(u)).replace(/\s+/g," ").trim().slice(0,p)}let l=i?s(i,80):"",c=s(t,120);return{conversationId:n,title:l||r,lastMessageAt:new Date(o).toISOString(),preview:c||void 0}}function Vt(e){return He(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function rc(e){return He(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function oc(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}function An(e){return e.kind==="tool"}function f_(e){return e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"}function Eo(e){let t=e.partsSig.value,n=t.findLastIndex(r=>r.kind==="tool");return t.slice(n+1).some(f_)}function ir(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(An);return t.length>0&&t.every(n=>oc(n.stateSig.value))}function ar(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!Eo(e)}function ma(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||f_(n))}function ha(e){return e.partsSig.value.some(t=>An(t)&&!oc(t.stateSig.value))}function g_(e,t){if(t.length===0)return e;let n=new Set;for(let s of e)n.add(s.id),s.serverMessageId&&n.add(s.serverMessageId);let r=t.filter(s=>{let l=[s.id,s.serverMessageId].filter(c=>c!==void 0);return l.some(c=>n.has(c))?!1:(l.forEach(c=>n.add(c)),!0)});if(r.length===0)return e;let o=e.findIndex(s=>!s.ephemeral),i=o<0?e.length:o;return[...e.slice(0,i),...r,...e.slice(i)]}function rr(e,t){return t.id=e.id,e.canceled&&(t.canceled=!0),e.feedback!==void 0&&(t.feedback=e.feedback),t.suggestions??(t.suggestions=e.suggestions),t}function m_(e,t,n,r){if(!ic(e))return;if(t.length===0){let s=Math.max(...r.values());return n.find(l=>l.role==="assistant"&&r.get(l.serverMessageId??l.id)===s&&He(l).length>=He(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let i=r.get(o.serverMessageId??o.id);if(i!==void 0)return n.find(s=>s.role==="assistant"&&r.get(s.serverMessageId??s.id)===i+1&&He(s).length>=He(e).length)}function ic(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function xy(e,t){let n=new Set(e.partsSig.value.filter(An).map(r=>r.toolCallId));return t.partsSig.value.filter(An).every(r=>n.has(r.toolCallId))}function Sy(e,t){let n=new Map(t.partsSig.value.filter(An).filter(i=>oc(i.stateSig.value)).map(i=>[i.toolCallId,i]));if(n.size===0)return;let r=!1,o=e.partsSig.value.map(i=>{if(!An(i))return i;let s=n.get(i.toolCallId);if(!s)return i;let l=i.approvalSig.value,c=s.approvalSig.value,u=l===void 0||l.approved===void 0&&c?.approved!==void 0?s.approvalSig:i.approvalSig,p=i.inputSig.value===void 0?s.inputSig:i.inputSig,_=i.toolName==="tool"?s.toolName:i.toolName,d=i.dynamic??s.dynamic,f=i.toolMetadata??s.toolMetadata;return u===i.approvalSig&&p===i.inputSig&&_===i.toolName&&d===i.dynamic&&f===i.toolMetadata?i:(r=!0,{...i,toolName:_,dynamic:d,toolMetadata:f,inputSig:p,approvalSig:u})});r&&(e.partsSig.value=o)}function h_(e){let t=e.flatMap(n=>n.role==="assistant"&&n.status!=="streaming"?Ql(n.startedAt)??[]:[]);return new Set(e.filter(n=>n.role==="user"&&t.some(r=>r>=(Ql(n.createdAt)??1/0))).map(n=>n.id))}function ac(e,t){let n=t.filter(_=>!_.ephemeral&&(_.status==="streaming"||_.status==="pending"||_.status==="error"||_.retryAction!==void 0||(_.attachments?.length??0)>0||Vt(_))),r=new Map;for(let _ of n)r.set(_.id,_),_.serverMessageId!==void 0&&r.set(_.serverMessageId,_);let o=new Set,i=[],s=e.map(_=>{let d=(_.serverMessageId!==void 0?r.get(_.serverMessageId):void 0)??r.get(_.id);return d===void 0?(i.push(_),_):(o.add(d),d.role!==_.role?_:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?rr(d,_):d.status!=="streaming"&&He(d).startsWith(He(_))&&xy(d,_)?(_.createdAt!==void 0&&(d.createdAt=_.createdAt),Sy(d,_),_.stepTimings&&(d.stepTimings=_.stepTimings),d.suggestions??(d.suggestions=_.suggestions),d.feedback===void 0&&(d.feedback=_.feedback),_.canceled&&(d.canceled=!0),d):rr(d,_))}),l=n.filter(_=>!o.has(_)),c=l.findLast(ic),u=new Map;e.forEach((_,d)=>{u.set(_.id,d),_.serverMessageId!==void 0&&u.set(_.serverMessageId,d)});let p=m_(c,c?n.slice(0,n.indexOf(c)):[],i,u);if(c&&p){let _=s.indexOf(p);_>=0&&(s[_]=rr(c,p)),l=l.filter(d=>d!==c)}return[...s,...l]}function Mo(e,t){let n=new Map(t.flatMap(_=>_.serverMessageId===void 0?[]:[[_.serverMessageId,_]])),r=new Map;t.forEach((_,d)=>{r.set(_.id,d),_.serverMessageId!==void 0&&r.set(_.serverMessageId,d)});let o=new Set(e.flatMap(_=>[_.serverMessageId,_.id].filter(d=>d!==void 0))),i=!1,s=e.map(_=>{let d=n.get(_.serverMessageId??_.id);if(d===void 0||d.role!==_.role)return _;if(_.role==="user"&&_.serverMessageId===void 0)return i=!0,rr(_,d);if(_.serverMessageId===void 0)return _;d.createdAt!==void 0&&_.createdAt!==d.createdAt&&(_.createdAt=d.createdAt,i=!0);let f=He(d),v=He(_),m=d.status!=="streaming"&&f.length>=v.length&&Xl(_,d);if(f.length>v.length||f===v&&d.partsSig.value.length>_.partsSig.value.length||m)return i=!0,rr(_,d);if((d.stepTimings?.length??0)>(_.stepTimings?.length??0)&&(_.stepTimings=d.stepTimings,i=!0),_.status==="streaming"&&d.status!=="streaming"&&wy(_,d)){if(_.continuationStreaming&&ha(d))return _;if(!Xl(d,_))return i=!0,rr(_,d)}return _}),l=[...n].filter(([_])=>!o.has(_)).map(([,_])=>_),c=s.findLastIndex(ic),u=s[c],p=m_(u,s.slice(0,c),l,r);if(u!==void 0&&p!==void 0&&He(p).length>=He(u).length&&(rr(u,p),s[c]=p,l.splice(l.indexOf(p),1),i=!0),l.length===0)return{messages:i?s:e,changed:i};for(let _ of l){let d=r.get(_.serverMessageId??_.id),f=!1,v=s.findIndex(m=>{let h=r.get(m.serverMessageId??m.id);return d===void 0?!1:h===void 0?f:h>d?!0:(f=!0,!1)});v===-1?s.push(_):s.splice(v,0,_)}return{messages:s,changed:!0}}function v_(e,t){if(e.role!==t.role)return!1;let n=He(t),r=He(e);return n.length>r.length||t.partsSig.value.length>e.partsSig.value.length||Xl(e,t)}function wy(e,t){let n=e.partsSig.value,r=t.partsSig.value;return n.length!==r.length?!1:n.every((o,i)=>{let s=r[i];switch(o.kind){case"text":return s?.kind==="text"&&s.textSig.value===o.textSig.value;case"reasoning":return s?.kind==="reasoning"&&s.textSig.value===o.textSig.value;case"step-start":return s?.kind==="step-start";case"tool":return s?.kind==="tool"&&s.toolCallId===o.toolCallId&&va(s.toolName,o.toolName);case"file":return s?.kind==="file"&&s.url===o.url&&s.mediaType===o.mediaType;case"source":return s?.kind==="source"&&s.sourceId===o.sourceId&&s.url===o.url&&s.title===o.title&&s.filename===o.filename&&s.mediaType===o.mediaType;default:return o}})}function va(e,t){let n=e.startsWith("tool:")?e.slice(5):e,r=t.startsWith("tool:")?t.slice(5):t;return n===r}var Nr={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function Xl(e,t){let n=new Map(e.partsSig.value.filter(An).map(r=>[r.toolCallId,r]));return t.partsSig.value.filter(An).some(r=>{let o=n.get(r.toolCallId);if(!o||Nr[r.stateSig.value]>Nr[o.stateSig.value])return!0;let i=r.approvalSig.value?.approved;return i!==void 0&&i!==o.approvalSig.value?.approved})}function or(e){return e.role==="assistant"&&e.status!=="streaming"&&e.canceled!==!0&&!Vt(e)}function ba(e,t){if(!e.includes(t)||t.retryAction===null)return;if(t.retryAction)return t.retryAction;if(t!==e.at(-1)||t.role!=="assistant"||t.serverMessageId===void 0||t.status!=="error"&&!or(t))return;let n=e.indexOf(t);for(let r=n-1;r>=0;r--){let o=e[r];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function b_(e,t){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!rc(e)&&!t}function y_(e,t){return e.operatorRoutedTurn?or(e)?"drop":"complete-operator-routed":t||or(e)?"error":"complete"}function ky(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:oe(e.text),doneSig:oe(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,inputPartialSig:oe(e.inputPartial),inputSig:oe(e.input),outputSig:oe(e.output),errorSig:oe(e.error),stateSig:oe(e.state),approvalSig:oe(e.approval)}:e}function Cy(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,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,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}function Ty(e){let t=new TextEncoder().encode(e),n="";for(let r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function P_(e){return e&&Object.keys(e).length>0?e:void 0}function sc(e,t,n=[]){let r=P_(e),o=P_(t),i=Date.now();for(let s=n.length;;s-=1){let l=n.slice(n.length-s).map(({name:p,data:_,at:d})=>({name:p,data:_,secondsAgo:Math.round((i-d)/1e3)})),c=l.length>0?{...o,recentEvents:l}:o;if(!r&&!c)return;let u=Ty(JSON.stringify({...r&&{user:r},...c&&{page:c}}));if(u.length<=8192||s===0)return u}}var Le=class extends Error{constructor(n,r,o,i,s,l){super(n);Z(this,"code",r);Z(this,"status",o);Z(this,"cause",i);Z(this,"retryAfterSeconds",s);Z(this,"errorCode",l);this.name="StreamError"}};var x_=ee.scope("parser");async function*S_(e,t,n){if(!e.ok){let r=await e.text().catch(()=>"");throw new Le(`server responded ${e.status}: ${r.slice(0,200)}`,"server",e.status)}for await(let r of Ry(e,t)){let o=Ay(r,n);if(o==="done")return;o&&(yield o)}}async function*Ry(e,t){if(!e.body)throw new Le("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),r="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:o,value:i}=await n.read();if(o){let l=r.trim();l&&(yield l);return}r+=i;let s;for(;(s=r.indexOf(`
|
|
61
|
+
`&&(i=o+1);return Mr(u),l&&c(e.length),n+e.slice(r)}function fy({children:e}){let t=B(null),[n,r]=$({start:!1,end:!1});return U(()=>{let o=t.current;if(!o)return;function i(){if(!o)return;let l=Rp(o);r(c=>c.start===l.start&&c.end===l.end?c:l)}i(),o.addEventListener("scroll",i,{passive:!0});let s=typeof ResizeObserver>"u"?void 0:new ResizeObserver(i);return s?.observe(o),()=>{o.removeEventListener("scroll",i),s?.disconnect()}},[]),a("div",{ref:t,"data-cut-start":n.start||void 0,"data-cut-end":n.end||void 0,children:e})}function Ql(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function gy(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function u_(e){return e.startsWith("tool-")?e.slice(5):e}var _t={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",emailTranscript:"/pai/email-transcript",cancelOperatorRequest:"/pai/cancel-request-operator",content:"/pai/content",contentCollections:"/pai/content/collection/list",contentVoteSet:"/pai/content/vote/set"},Yl="context";function ua(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pa(e){if(!ua(e))return;let t=e,n=t.controlMode,r=t.controlRevision;if(!(n!=="ai-agent"&&n!=="awaiting-operator"&&n!=="operator"||typeof r!="number"||!Number.isSafeInteger(r)||r<0))return{controlMode:n,controlRevision:r,assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,assignedOperatorName:typeof t.assignedOperatorName=="string"&&t.assignedOperatorName?t.assignedOperatorName:void 0,assignedOperatorAvatar:typeof t.assignedOperatorAvatar=="string"&&t.assignedOperatorAvatar?t.assignedOperatorAvatar:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function p_(e){if(!ua(e))return;let t=e.status,n=e.postFinishSequence;if(!(t!=="compacting"&&t!=="ready"||typeof n!="number"||!Number.isSafeInteger(n)||n<0))return{status:t,postFinishSequence:n}}function _a(e){let t=ua(e)?e.suggestions:void 0;if(!Array.isArray(t))return[];let n=[];for(let r of t){if(!ua(r))continue;let{id:o,label:i,text:s}=r;typeof i!="string"||!i||n.push({id:typeof o=="string"&&o?o:`s${n.length}`,label:i,text:typeof s=="string"&&s?s:i})}return n}function Jl(e){let n={messages:e.messages.map(r=>({id:r.serverMessageId??r.id,parts:hy(r),role:r.role})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs),e.clientTools?.length&&(n.clientTools=e.clientTools),n}function my(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function hy(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,filename:n.filename,fileId:n.fileId,fileSize:n.fileSize}),n.kind==="tool"&&my(n)){let r=n.dynamic?{type:"dynamic-tool",toolName:n.toolName,toolCallId:n.toolCallId,state:n.state}:{type:gy(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(r.input=n.input),n.output!==void 0&&(r.output=n.output),n.error!==void 0&&(r.errorText=n.error),n.approval?.approved!==void 0&&(r.approval=n.approval),n.toolMetadata&&(r.toolMetadata=n.toolMetadata),t.push(r)}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}function Zl(e,t,n=Lt()){let r=e?[{kind:"text",id:"t0",textSig:oe(e),doneSig:oe(!0)}]:[];return{id:n,role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:oe(r)}}function Yt(){return{id:Lt(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:oe([])}}function ec(e){let t=Lt();return vy({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function vy(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:oe(e.parts.map(ky))}}function by(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status==="streaming"?"streaming":"complete"}function tc(e){let t=new Set,n=e.parts.map((o,i)=>o.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:oe(o.text),doneSig:oe(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:oe(o.text),doneSig:oe(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType,filename:o.filename,fileId:o.fileId,fileSize:o.fileSize}:o.type==="source-url"?{kind:"source",sourceId:o.sourceId,url:o.url,title:o.title}:o.type==="source-document"?{kind:"source",sourceId:o.sourceId,title:o.title,filename:o.filename,mediaType:o.mediaType}:o.type==="data-suggestions"?null:o.type==="dynamic-tool"||o.type.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:o.type==="dynamic-tool"?o.toolName:u_(o.type),title:o.title,dynamic:o.type==="dynamic-tool"?!0:void 0,toolMetadata:o.toolMetadata,inputPartialSig:oe(""),inputSig:oe(o.input),outputSig:oe(o.output),errorSig:oe(o.errorText),stateSig:oe(o.state),approvalSig:oe(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),r=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:r?.type==="data-suggestions"?_a(r.data):void 0,serverMessageId:e.id,createdAt:Date.parse(e.createdAt),status:by(e),canceled:e.status==="canceled",feedback:e.feedback??null,stepTimings:fa(e.metadata?.steps),partsSig:oe(n)}}function fa(e){if(!(!e?.length||!e.every(t=>__(t.durationMs))))return e.map(({durationMs:t,reasoningMs:n})=>({durationMs:Number(t),...__(n)?{reasoningMs:n}:{}}))}function __(e){return typeof e=="number"&&Number.isFinite(e)}function yy(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type==="dynamic-tool"||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function Py(e){return e.role==="assistant"&&e.status==="streaming"&&yy(e)}function In(e){let t=e.length-1;return e.filter((n,r)=>r===t||!Py(n)).map(tc)}function f_(e,t){let n=!t&&e.at(-1)?.role==="assistant"?-2:-1,r=e.at(n);return!r||r.ephemeral?[]:[r]}function nc(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(Cy)}}function He(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function ga(e,t,n,r,o=t.createdAt){let i=e.find(u=>u.role==="user"&&!u.ephemeral);function s(u,p){return(u.role==="assistant"?da(He(u)):He(u)).replace(/\s+/g," ").trim().slice(0,p)}let l=i?s(i,80):"",c=s(t,120);return{conversationId:n,title:l||r,lastMessageAt:new Date(o).toISOString(),preview:c||void 0}}function Vt(e){return He(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function rc(e){return He(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function oc(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}function An(e){return e.kind==="tool"}function g_(e){return e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"}function Eo(e){let t=e.partsSig.value,n=t.findLastIndex(r=>r.kind==="tool");return t.slice(n+1).some(g_)}function ir(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(An);return t.length>0&&t.every(n=>oc(n.stateSig.value))}function ar(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!Eo(e)}function ma(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||g_(n))}function ha(e){return e.partsSig.value.some(t=>An(t)&&!oc(t.stateSig.value))}function m_(e,t){if(t.length===0)return e;let n=new Set;for(let s of e)n.add(s.id),s.serverMessageId&&n.add(s.serverMessageId);let r=t.filter(s=>{let l=[s.id,s.serverMessageId].filter(c=>c!==void 0);return l.some(c=>n.has(c))?!1:(l.forEach(c=>n.add(c)),!0)});if(r.length===0)return e;let o=e.findIndex(s=>!s.ephemeral),i=o<0?e.length:o;return[...e.slice(0,i),...r,...e.slice(i)]}function rr(e,t){return t.id=e.id,e.canceled&&(t.canceled=!0),e.feedback!==void 0&&(t.feedback=e.feedback),t.suggestions??(t.suggestions=e.suggestions),t}function h_(e,t,n,r){if(!ic(e))return;if(t.length===0){let s=Math.max(...r.values());return n.find(l=>l.role==="assistant"&&r.get(l.serverMessageId??l.id)===s&&He(l).length>=He(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let i=r.get(o.serverMessageId??o.id);if(i!==void 0)return n.find(s=>s.role==="assistant"&&r.get(s.serverMessageId??s.id)===i+1&&He(s).length>=He(e).length)}function ic(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function xy(e,t){let n=new Set(e.partsSig.value.filter(An).map(r=>r.toolCallId));return t.partsSig.value.filter(An).every(r=>n.has(r.toolCallId))}function Sy(e,t){let n=new Map(t.partsSig.value.filter(An).filter(i=>oc(i.stateSig.value)).map(i=>[i.toolCallId,i]));if(n.size===0)return;let r=!1,o=e.partsSig.value.map(i=>{if(!An(i))return i;let s=n.get(i.toolCallId);if(!s)return i;let l=i.approvalSig.value,c=s.approvalSig.value,u=l===void 0||l.approved===void 0&&c?.approved!==void 0?s.approvalSig:i.approvalSig,p=i.inputSig.value===void 0?s.inputSig:i.inputSig,_=i.toolName==="tool"?s.toolName:i.toolName,d=i.dynamic??s.dynamic,f=i.toolMetadata??s.toolMetadata;return u===i.approvalSig&&p===i.inputSig&&_===i.toolName&&d===i.dynamic&&f===i.toolMetadata?i:(r=!0,{...i,toolName:_,dynamic:d,toolMetadata:f,inputSig:p,approvalSig:u})});r&&(e.partsSig.value=o)}function v_(e){let t=e.flatMap(n=>n.role==="assistant"&&n.status!=="streaming"?Ql(n.startedAt)??[]:[]);return new Set(e.filter(n=>n.role==="user"&&t.some(r=>r>=(Ql(n.createdAt)??1/0))).map(n=>n.id))}function ac(e,t){let n=t.filter(_=>!_.ephemeral&&(_.status==="streaming"||_.status==="pending"||_.status==="error"||_.retryAction!==void 0||(_.attachments?.length??0)>0||Vt(_))),r=new Map;for(let _ of n)r.set(_.id,_),_.serverMessageId!==void 0&&r.set(_.serverMessageId,_);let o=new Set,i=[],s=e.map(_=>{let d=(_.serverMessageId!==void 0?r.get(_.serverMessageId):void 0)??r.get(_.id);return d===void 0?(i.push(_),_):(o.add(d),d.role!==_.role?_:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?rr(d,_):d.status!=="streaming"&&He(d).startsWith(He(_))&&xy(d,_)?(_.createdAt!==void 0&&(d.createdAt=_.createdAt),Sy(d,_),_.stepTimings&&(d.stepTimings=_.stepTimings),d.suggestions??(d.suggestions=_.suggestions),d.feedback===void 0&&(d.feedback=_.feedback),_.canceled&&(d.canceled=!0),d):rr(d,_))}),l=n.filter(_=>!o.has(_)),c=l.findLast(ic),u=new Map;e.forEach((_,d)=>{u.set(_.id,d),_.serverMessageId!==void 0&&u.set(_.serverMessageId,d)});let p=h_(c,c?n.slice(0,n.indexOf(c)):[],i,u);if(c&&p){let _=s.indexOf(p);_>=0&&(s[_]=rr(c,p)),l=l.filter(d=>d!==c)}return[...s,...l]}function Mo(e,t){let n=new Map(t.flatMap(_=>_.serverMessageId===void 0?[]:[[_.serverMessageId,_]])),r=new Map;t.forEach((_,d)=>{r.set(_.id,d),_.serverMessageId!==void 0&&r.set(_.serverMessageId,d)});let o=new Set(e.flatMap(_=>[_.serverMessageId,_.id].filter(d=>d!==void 0))),i=!1,s=e.map(_=>{let d=n.get(_.serverMessageId??_.id);if(d===void 0||d.role!==_.role)return _;if(_.role==="user"&&_.serverMessageId===void 0)return i=!0,rr(_,d);if(_.serverMessageId===void 0)return _;d.createdAt!==void 0&&_.createdAt!==d.createdAt&&(_.createdAt=d.createdAt,i=!0);let f=He(d),v=He(_),m=d.status!=="streaming"&&f.length>=v.length&&Xl(_,d);if(f.length>v.length||f===v&&d.partsSig.value.length>_.partsSig.value.length||m)return i=!0,rr(_,d);if((d.stepTimings?.length??0)>(_.stepTimings?.length??0)&&(_.stepTimings=d.stepTimings,i=!0),_.status==="streaming"&&d.status!=="streaming"&&wy(_,d)){if(_.continuationStreaming&&ha(d))return _;if(!Xl(d,_))return i=!0,rr(_,d)}return _}),l=[...n].filter(([_])=>!o.has(_)).map(([,_])=>_),c=s.findLastIndex(ic),u=s[c],p=h_(u,s.slice(0,c),l,r);if(u!==void 0&&p!==void 0&&He(p).length>=He(u).length&&(rr(u,p),s[c]=p,l.splice(l.indexOf(p),1),i=!0),l.length===0)return{messages:i?s:e,changed:i};for(let _ of l){let d=r.get(_.serverMessageId??_.id),f=!1,v=s.findIndex(m=>{let h=r.get(m.serverMessageId??m.id);return d===void 0?!1:h===void 0?f:h>d?!0:(f=!0,!1)});v===-1?s.push(_):s.splice(v,0,_)}return{messages:s,changed:!0}}function b_(e,t){if(e.role!==t.role)return!1;let n=He(t),r=He(e);return n.length>r.length||t.partsSig.value.length>e.partsSig.value.length||Xl(e,t)}function wy(e,t){let n=e.partsSig.value,r=t.partsSig.value;return n.length!==r.length?!1:n.every((o,i)=>{let s=r[i];switch(o.kind){case"text":return s?.kind==="text"&&s.textSig.value===o.textSig.value;case"reasoning":return s?.kind==="reasoning"&&s.textSig.value===o.textSig.value;case"step-start":return s?.kind==="step-start";case"tool":return s?.kind==="tool"&&s.toolCallId===o.toolCallId&&va(s.toolName,o.toolName);case"file":return s?.kind==="file"&&s.url===o.url&&s.mediaType===o.mediaType;case"source":return s?.kind==="source"&&s.sourceId===o.sourceId&&s.url===o.url&&s.title===o.title&&s.filename===o.filename&&s.mediaType===o.mediaType;default:return o}})}function va(e,t){let n=e.startsWith("tool:")?e.slice(5):e,r=t.startsWith("tool:")?t.slice(5):t;return n===r}var Nr={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function Xl(e,t){let n=new Map(e.partsSig.value.filter(An).map(r=>[r.toolCallId,r]));return t.partsSig.value.filter(An).some(r=>{let o=n.get(r.toolCallId);if(!o||Nr[r.stateSig.value]>Nr[o.stateSig.value])return!0;let i=r.approvalSig.value?.approved;return i!==void 0&&i!==o.approvalSig.value?.approved})}function or(e){return e.role==="assistant"&&e.status!=="streaming"&&e.canceled!==!0&&!Vt(e)}function ba(e,t){if(!e.includes(t)||t.retryAction===null)return;if(t.retryAction)return t.retryAction;if(t!==e.at(-1)||t.role!=="assistant"||t.serverMessageId===void 0||t.status!=="error"&&!or(t))return;let n=e.indexOf(t);for(let r=n-1;r>=0;r--){let o=e[r];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function y_(e,t){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!rc(e)&&!t}function P_(e,t){return e.operatorRoutedTurn?or(e)?"drop":"complete-operator-routed":t||or(e)?"error":"complete"}function ky(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:oe(e.text),doneSig:oe(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,inputPartialSig:oe(e.inputPartial),inputSig:oe(e.input),outputSig:oe(e.output),errorSig:oe(e.error),stateSig:oe(e.state),approvalSig:oe(e.approval)}:e}function Cy(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,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,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}function Ty(e){let t=new TextEncoder().encode(e),n="";for(let r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function x_(e){return e&&Object.keys(e).length>0?e:void 0}function sc(e,t,n=[]){let r=x_(e),o=x_(t),i=Date.now();for(let s=n.length;;s-=1){let l=n.slice(n.length-s).map(({name:p,data:_,at:d})=>({name:p,data:_,secondsAgo:Math.round((i-d)/1e3)})),c=l.length>0?{...o,recentEvents:l}:o;if(!r&&!c)return;let u=Ty(JSON.stringify({...r&&{user:r},...c&&{page:c}}));if(u.length<=8192||s===0)return u}}var Le=class extends Error{constructor(n,r,o,i,s,l){super(n);Z(this,"code",r);Z(this,"status",o);Z(this,"cause",i);Z(this,"retryAfterSeconds",s);Z(this,"errorCode",l);this.name="StreamError"}};var S_=ee.scope("parser");async function*w_(e,t,n){if(!e.ok){let r=await e.text().catch(()=>"");throw new Le(`server responded ${e.status}: ${r.slice(0,200)}`,"server",e.status)}for await(let r of Ry(e,t)){let o=Ay(r,n);if(o==="done")return;o&&(yield o)}}async function*Ry(e,t){if(!e.body)throw new Le("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),r="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:o,value:i}=await n.read();if(o){let l=r.trim();l&&(yield l);return}r+=i;let s;for(;(s=r.indexOf(`
|
|
62
62
|
|
|
63
63
|
`))!==-1;){let l=r.slice(0,s);r=r.slice(s+2),yield l}}}finally{n.releaseLock()}}function Ay(e,t){let n="",r;for(let o of e.split(`
|
|
64
64
|
`))if(o!==""){if(o.startsWith(":")){t?.(o.slice(1).trim());continue}if(o.startsWith("data:")){let i=o.slice(5).replace(/^ /,"");n=n?`${n}
|
|
65
|
-
${i}`:i;continue}o.startsWith("id:")&&(r=o.slice(3).trim())}if(n==="[DONE]")return"done";if(!n)return null;try{let o=JSON.parse(n);if(!Iy(o))throw new TypeError("unrecognized chunk");return x_.trace("chunk",{type:o.type,eventId:r}),{chunk:o,eventId:r}}catch(o){throw x_.trace("frame parse failed",{errorType:o instanceof Error?o.name:typeof o,payloadLength:n.length}),new Le("invalid SSE frame","network",void 0,o)}}function Iy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof Reflect.get(e,"type")=="string"}var Ey=new Set([101,204,205,304]);function My(e){let t=new Headers;for(let n of e.trim().split(/[\r\n]+/)){let r=n.indexOf(":");r>0&&t.append(n.slice(0,r).trim(),n.slice(r+1).trim())}return t}function w_(e){return async function(n,r){let o=new Request(n,r),i=await o.blob();return new Promise((s,l)=>{if(o.signal.aborted){l(o.signal.reason);return}let c=new XMLHttpRequest;c.open(o.method,o.url),c.withCredentials=o.credentials==="include",c.responseType="blob",o.headers.forEach((u,p)=>c.setRequestHeader(p,u)),c.upload.addEventListener("progress",u=>{u.lengthComputable&&u.total>0&&e(u.loaded/u.total)}),c.addEventListener("load",()=>{s(new Response(Ey.has(c.status)?null:c.response,{status:c.status,statusText:c.statusText,headers:My(c.getAllResponseHeaders())}))}),c.addEventListener("error",()=>l(new TypeError("Failed to fetch"))),c.addEventListener("abort",()=>l(o.signal.reason)),o.signal.addEventListener("abort",()=>c.abort(),{once:!0}),c.send(i)})}}var We=ee.scope("transport"),Ly="x-user-token",Oy="x-continue-link";async function lc(e){try{let t=await e.clone().json();if(typeof t!="object"||t===null)return{};let n=Reflect.get(t,"error");return{error:typeof n=="string"?n:void 0,loginUrl:Vi(Reflect.get(t,"login")).url}}catch{return{}}}var k_=6e4,Ny=1e4,cc=50,L_=new WeakMap;function $r(e){return L_.get(e)}function Lo(e,t){return L_.set(e,t),e}function C_(e){return Math.max(e?.upsertRevision??0,e?.read?.revision??0)}function $y(e,t){return e.conversationId===t.conversationId&&e.title===t.title&&e.lastMessageAt===t.lastMessageAt&&e.preview===t.preview&&e.hasUnread===t.hasUnread&&e.controlState===t.controlState}function cn(e,t,n=!0){switch(t.type){case"snapshot":{let r=new Map(e.map(s=>[s.conversationId,s])),o=e.filter(s=>($r(s)?.activityRevision??0)>t.requestedRevision).toSorted((s,l)=>($r(l)?.activityRevision??0)-($r(s)?.activityRevision??0)),i=new Set(o.map(s=>s.conversationId));return[...o,...t.result.conversations.filter(s=>!i.has(s.conversationId)).map(s=>{let l=r.get(s.conversationId);if(!l)return s;let c=$r(l);return(c?.upsertRevision??0)>t.requestedRevision?l:c?.read&&!l.hasUnread&&c.read.lastMessageAt===s.lastMessageAt?Lo({...s,hasUnread:!1},{upsertRevision:0,read:c.read}):s})]}case"read":{let r=e.findIndex(c=>c.conversationId===t.conversationId&&(t.lastMessageAt===void 0||c.lastMessageAt===t.lastMessageAt)),o=e[r];if(!o)return e;let i=$r(o);if(C_(i)>t.revision)return e;let s=t.lastMessageAt??o.lastMessageAt,l={upsertRevision:i?.upsertRevision??0,...i?.activityRevision===void 0?{}:{activityRevision:i.activityRevision},read:{revision:t.revision,...s?{lastMessageAt:s}:{}}};return o.hasUnread?e.map((c,u)=>u===r?Lo({...c,hasUnread:!1},l):c):(Lo(o,l),e)}case"upsert":{let r=e.findIndex(u=>u.conversationId===t.conversation.conversationId);if(r<0&&!n)return e;let o=e[r],i=o?$r(o):void 0;if(C_(i)>t.revision)return e;let s=t.activity?t.revision:i?.activityRevision,l={upsertRevision:t.revision,...s===void 0?{}:{activityRevision:s},...!t.conversation.hasUnread&&i?.read?{read:i.read}:{}},c=o?{...o,...t.conversation,title:o.title}:{...t.conversation};return o&&$y(o,c)?(Lo(o,l),e):(Lo(c,l),t.activity?[c,...e.filter(u=>u.conversationId!==c.conversationId)]:o?e.map((u,p)=>p===r?c:u):[...e,c])}default:return t}}var T_=3,Dy=400,By=3e4,Uy=6e4,zy=1e4,Fy=6e4,Hy=15e3,qy=1024*1024,R_=new Set([408,425,429,500,502,503,504]);function A_(e){return Dy*2**e+Math.floor(Math.random()*250)}function jy(e){return Fy+Math.ceil(e/qy)*Hy}function Vy(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),r=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(r)&&r>=0?Math.min(r,3e4):null}var Oo=class{constructor(t){Z(this,"ttlMs",t);Z(this,"map",new Map)}getOrFetch(t,n){let r=this.map.get(t);if(r&&performance.now()-r.at<this.ttlMs)return r.result;let o={at:performance.now(),result:n().then(i=>(o.value=i,i)).catch(i=>{throw this.map.get(t)===o&&this.map.delete(t),i})};return this.map.set(t,o),o.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&performance.now()-n.at<this.ttlMs)return n.value}update(t){for(let n of this.map.values()){if(n.value!==void 0){let r=t(n.value);n.value=r,n.result=Promise.resolve(r);continue}n.result=n.result.then(r=>{let o=t(r);return n.value=o,o})}}delete(t){this.map.delete(t)}};function I_(e,t){let{translations:n,defaultLocale:r,...o}=zn(e,t);return o}var ya=class{constructor(t){Z(this,"opts",t);Z(this,"conversationListeners",new Set);Z(this,"conversationRevision",0);Z(this,"visitorId");Z(this,"conversationId");Z(this,"userContext");Z(this,"pageContext");Z(this,"locale");Z(this,"userTokenSource");Z(this,"userToken");Z(this,"userTokenRequest");Z(this,"conversationsCache",new Oo(Ny));Z(this,"contentCache",new Oo(k_));Z(this,"contentCollectionsCache",new Oo(k_))}setUserToken(t){this.userTokenSource=t,this.userToken=typeof t=="string"&&t||void 0,this.userTokenRequest=typeof t=="function"?this.fetchUserToken():void 0,this.opts.onLoginState?.(t?{status:"pending"}:{status:"anonymous"})}async userSub(){return this.userTokenRequest&&await this.userTokenRequest,this.userToken?cp(this.userToken):void 0}reportLogin(t){this.opts.onLoginState?.(t==="loggedIn"&&this.userToken?{status:t,...lp(this.userToken)}:{status:t==="loggedIn"?"anonymous":t})}async refreshUserToken(){let t=this.userToken;return typeof this.userTokenSource!="function"?!1:(this.userTokenRequest&&await this.userTokenRequest,this.userToken===t&&await this.fetchUserToken(),!!this.userToken&&this.userToken!==t)}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:Tr};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=sc(this.userContext,this.pageContext);return n&&(t[Yl]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,r]of Object.entries(this.envelope()))t.append(n,r);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[r,o]of Object.entries(this.envelope()))n.searchParams.has(r)||n.searchParams.set(r,o);return n.toString()}async handshake(t){We.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=ln("handshake",await this.postJson(_t.handshake,t,"handshake"),M_),r=n.loginStatus==="expired"&&await this.refreshUserToken()?ln("handshake",await this.postJson(_t.handshake,t,"handshake"),M_):n;return this.reportLogin(r.loginStatus??(this.userToken?"loggedIn":"anonymous")),We.debug("handshake \u2190",{visitorId:r.visitorId,conversationId:r.conversationId,hasWelcome:!!r.welcome,hasConfig:!!r.config,rebind:r.rebind}),this.visitorId=r.visitorId,this.conversationId=r.conversationId,r}async uploadFile(t,n,r){We.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let o=new FormData;o.append("file",t,t.name);let i=ln("upload",await this.postForm(this.uploadPath,o,"upload",n,jy(t.size),r),Ky);return We.debug("uploadFile \u2190",{id:i.id,url:i.url}),i}async transcribe(t,n="audio/webm"){We.debug("transcribe \u2192",{size:t.size,mimeType:n});let r=new FormData;r.append("audio",t,`voice.${Wy(n)}`),r.append("mimeType",n);let o=ln("transcribe",await this.postForm(this.transcribePath,r,"transcribe"),Qy);return We.debug("transcribe \u2190",{textLen:o.text.length}),o}subscribeConversationChanges(t){return this.conversationListeners.add(t),()=>this.conversationListeners.delete(t)}publishConversation(t,n=!1){let r={type:"upsert",conversation:t,revision:++this.conversationRevision,...n?{activity:!0}:{}};this.conversationsCache.update(o=>{let i=o.pagination.page===1,s=o.conversations.some(_=>_.conversationId===t.conversationId),l=cn(o.conversations,r,i&&n),c=i&&l.length>o.pagination.limit?l.slice(0,o.pagination.limit):l;if(!i||!n||s||o.pagination.hasNext)return c===o.conversations?o:{...o,conversations:c};let u=Math.max(o.pagination.total,o.conversations.length)+1,p=Math.ceil(u/o.pagination.limit);return{...o,conversations:c,pagination:{...o.pagination,total:u,totalPages:p,hasNext:o.pagination.page<p}}});for(let o of this.conversationListeners)o(r)}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={},n=!1){if((t.page??1)>1)return this.fetchConversations(t);let r=this.localeCacheKey(t),o=this.conversationRevision;n&&this.conversationsCache.delete(r);let i=this.conversationsCache.getOrFetch(r,()=>this.fetchConversations(t));return n?i.then(s=>{let l={type:"snapshot",result:s,requestedRevision:o};for(let c of this.conversationListeners)c(l);return s}):i}async fetchConversations(t){let n=new URL(this.url(_t.listConversations));return t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.ids?.length&&n.searchParams.set("ids",t.ids.join(",")),ln("listConversations",await this.getJson(n.toString(),"listConversations"),Yy)}async loadConversation(t,{ids:n=[],beforeId:r,beforeCreatedAt:o}={}){let i=new URL(this.url(_t.listMessages));i.searchParams.set("conversationId",t),i.searchParams.set("limit",String(cc)),n.length>0&&i.searchParams.set("ids",n.join(",")),r&&i.searchParams.set("beforeId",r),o&&i.searchParams.set("beforeCreatedAt",o);let s=ln("loadConversation",await this.getJson(i.toString(),"loadConversation"),Jy);return{...s,messages:s.messages.toReversed()}}async markRead(t,n){if(!this.visitorId||!t)return;let r={type:"read",conversationId:t,...n===void 0?{}:{lastMessageAt:n},revision:++this.conversationRevision};this.conversationsCache.update(o=>{let i=cn(o.conversations,r);return i===o.conversations?o:{...o,conversations:i}});for(let o of this.conversationListeners)o(r);try{await this.postJson(_t.markRead,{conversationId:t},"markRead",!0)}catch(o){We.debug("markRead failed (non-fatal)",{err:o})}}async requestOperator(){if(!(!this.visitorId||!this.conversationId))try{return E_("requestOperator",await this.postJson(_t.requestOperator,{},"requestOperator"))}catch(t){We.debug("requestOperator failed (non-fatal)",{err:t});return}}async emailTranscript(t){return ln("emailTranscript",await this.postJson(_t.emailTranscript,{email:t},"emailTranscript"),Xy)}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId))try{return E_("cancelOperatorRequest",await this.postJson(_t.cancelOperatorRequest,{},"cancelOperatorRequest"))}catch(t){We.debug("cancelOperatorRequest failed (non-fatal)",{err:t});return}}listContent(t={}){return this.contentCache.getOrFetch(JSON.stringify(t,Object.keys(t).toSorted()),()=>this.fetchContent(t)).then(n=>({...n,items:n.items.map(r=>I_(r,this.locale))}))}async fetchContent(t){let n=new URL(this.dataUrl(_t.content));for(let[o,i]of Object.entries(t))i!==void 0&&n.searchParams.set(o,Array.isArray(i)?i.join(","):String(i));let r=ln("listContent",await this.getJson(n.toString(),"listContent"),Zy);return{...r,items:r.items??[]}}async setContentVote(t){try{await this.postJson(this.dataUrl(_t.contentVoteSet),t,"setContentVote")}catch{}}listContentCollections(t){return this.contentCollectionsCache.getOrFetch(t.join(","),()=>this.fetchContentCollections(t)).then(n=>({items:n.items.map(r=>I_(r,this.locale))}))}async fetchContentCollections(t){let n=new URL(this.dataUrl(_t.contentCollections));return t.length&&n.searchParams.set("ids",t.join(",")),{items:ln("listContentCollections",await this.getJson(n.toString(),"listContentCollections"),eP).items??[]}}async saveUserPrefs(t){await this.postJson(_t.updateSettings,{userPrefs:t},"saveUserPrefs")}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}async submitFeedback(t){We.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(_t.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){We.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(t,n={}){We.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});let r=JSON.stringify({...this.withEnvelope(t),[Yl]:sc(this.userContext,this.pageContext,this.opts.recentHostEvents)}),o=n.keepalive===!0&&new Blob([r]).size<Uy;try{return await this.runWithAbort(async i=>{let s=await this.withFreshUserToken(()=>this.fetchImpl(this.url(_t.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.headersFor(this.url(_t.streamMessage))},body:r,keepalive:o,signal:i}));if(s.status!==202)throw new Le(`sendTurn failed: expected 202, received ${s.status}`,"server",s.status,void 0,tP(s),(await lc(s)).error);let l;try{l=await s.json()}catch(c){throw i?.aborted?c:new Le("sendTurn failed: invalid acknowledgement","server",s.status,c)}if(!Gy(l))throw new Le("sendTurn failed: invalid acknowledgement","server",s.status);return l},void 0,By)}catch(i){throw i instanceof Le?i:new Le("sendTurn failed: network error","network",void 0,i)}}cancelTurn(t,n){!this.visitorId||!t||!n||(We.debug("cancel stream",{conversationId:t,runId:n,visitorId:this.visitorId}),this.fetchImpl(this.url(_t.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(_t.cancelStream))},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:n})),keepalive:!0}).catch(r=>We.debug("cancel POST failed (non-fatal)",{err:r})))}async connectResumeStream(t){let n=new AbortController;function r(){return n.abort(t.signal.reason)}t.signal.aborted?r():t.signal.addEventListener("abort",r,{once:!0});let o=setTimeout(()=>n.abort(),zy);function i(){clearTimeout(o),t.signal.removeEventListener("abort",r)}let s;try{s=await this.withFreshUserToken(()=>this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",cache:"no-store",headers:{accept:"text/event-stream",...this.headersFor(this.resumeUrl())},signal:n.signal}))}catch(c){return i(),t.signal.aborted||We.debug("resume-stream fetch failed \u2014 reconnecting",{err:c}),"held"}if(!s.ok)return i(),s.status===409||R_.has(s.status)?(We.debug("resume-stream \u2192 transient response; reconnecting",{status:s.status}),"held"):(We.debug("resume-stream \u2192 endpoint unavailable",{status:s.status}),"unavailable");if(!s.body)return i(),We.debug("resume-stream \u2192 bodyless response; stopping",{status:s.status}),"unavailable";if(!(s.headers.get("content-type")??"").includes("text/event-stream"))return i(),We.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";let l=!1;try{for await(let{chunk:c}of S_(s,n.signal,u=>{l||u!=="connected"||(l=!0,clearTimeout(o),t.onConnected())})){if(t.signal.aborted)return"held";t.onChunk(c)}}catch(c){if(t.signal.aborted)return"held";We.debug("resume-stream segment dropped \u2014 reconnecting",{err:c})}finally{i()}return"held"}resumeUrl(){return this.withEnvelopeQuery(_t.streamResume)}async postJson(t,n,r,o=!1){let i=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(t))},body:JSON.stringify(this.withEnvelope(n)),...o?{keepalive:!0}:{}}],r);return this.assertOk(i,r)}async postForm(t,n,r,o,i,s){let l=s?w_(s):this.fetchImpl;return this.runWithAbort(async c=>{let u=await this.withFreshUserToken(()=>l(this.url(t),{method:"POST",credentials:"omit",headers:this.headersFor(this.url(t)),body:this.appendEnvelope(n),signal:c}));return this.assertOk(u,r)},o,i)}async runWithAbort(t,n,r){if(!n&&r===void 0)return t();let o=new AbortController;function i(){return o.abort(n?.reason)}n?.aborted?i():n?.addEventListener("abort",i,{once:!0});let s=r===void 0?void 0:setTimeout(()=>o.abort(),r);try{return await t(o.signal)}finally{s!==void 0&&clearTimeout(s),n?.removeEventListener("abort",i)}}async getJson(t,n){let r=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.headersFor(this.url(t))}}],n);return this.assertOk(r,n)}async fetchWithRetry(t,n){for(let r=0;;r++){let o;try{o=await this.withFreshUserToken(()=>this.fetchImpl(...t()))}catch(s){if(r>=T_)throw new Le(`${n} failed: network error`,"network",void 0,s);We.debug("request network error \u2014 retrying",{label:n,attempt:r}),await jn(A_(r));continue}if(o.ok||!R_.has(o.status)||r>=T_)return o;let i=Vy(o.headers)??A_(r);We.debug("request retryable status \u2014 retrying",{label:n,status:o.status,attempt:r,wait:i}),await jn(i)}}async assertOk(t,n){if(!t.ok)throw new Le(`${n} failed: ${t.status}`,"server",t.status,void 0,void 0,(await lc(t)).error);return await t.json()}fetchUserToken(){let t=this.userTokenSource;if(typeof t!="function")return Promise.resolve();let n=Promise.resolve().then(t).then(r=>{this.userTokenSource===t&&(this.userToken=r||void 0)},r=>{We.warn("userToken function failed",{err:r}),this.userTokenSource===t&&(this.userToken=void 0)});return this.userTokenRequest=n,n}headersFor(t){let n=!/^https?:\/\//i.test(t)||t.startsWith(`${this.opts.agentApiBaseUrl}/`);return{...this.opts.auth.headers(),...n&&this.userToken?{[Ly]:this.userToken}:{},...n&&this.opts.continueLink?{[Oy]:this.opts.continueLink}:{}}}async withFreshUserToken(t){this.userTokenRequest&&await this.userTokenRequest;let n=await t();if(n.status!==401)return n;let r=await lc(n);if(r.error==="USER_TOKEN_REQUIRED")return this.opts.onLoginState?.({status:"required",loginUrl:r.loginUrl}),n;if(!this.userToken)return n;if(!await this.refreshUserToken())return this.reportLogin("expired"),n;this.reportLogin("loggedIn");let o=await t();return o.status===401&&this.reportLogin("expired"),o}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function Wy(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 Gy(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),n=Reflect.get(e,"conversationId"),r=Reflect.get(e,"runId");return t==="accepted"&&typeof n=="string"&&n.length>0&&(r===void 0||typeof r=="string"&&r.length>0)}function It(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ln(e,t,n){if(!n(t))throw new Le(`${e} failed: invalid response body`,"server");return t}function E_(e,t){let n=pa(It(t)?t.controlState:void 0);if(!n)throw new Le(`${e} failed: invalid response body`,"server");return n}function M_(e){return!(!It(e)||typeof e.visitorId!="string"||typeof e.conversationId!="string"||e.welcome!==void 0&&(!It(e.welcome)||e.welcome.messages!==void 0&&!Array.isArray(e.welcome.messages)))}function Ky(e){return It(e)&&typeof e.id=="string"&&typeof e.url=="string"&&typeof e.originalName=="string"&&typeof e.mimeType=="string"&&typeof e.fileSize=="number"}function Qy(e){return It(e)&&typeof e.text=="string"}function O_(e){return It(e)&&typeof e.page=="number"&&typeof e.limit=="number"&&typeof e.total=="number"&&typeof e.totalPages=="number"&&typeof e.hasNext=="boolean"&&typeof e.hasPrev=="boolean"}function Yy(e){return It(e)&&Array.isArray(e.conversations)&&e.conversations.every(It)&&O_(e.pagination)}function Jy(e){return It(e)&&typeof e.conversationId=="string"&&Array.isArray(e.messages)&&e.messages.every(It)}function Xy(e){return It(e)&&typeof e.status=="string"&&typeof e.to=="string"}function Zy(e){return It(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(It))&&(e.pagination===void 0||O_(e.pagination))}function eP(e){return It(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(It))}function tP(e){let t=Number(e.headers.get("retry-after"));return Number.isInteger(t)&&t>0?t:void 0}function Dr(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"popOut":return t!=="standalone"&&t!=="page";case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Pa(e,t,n){return Dr("close",e,t)?n.includes("close"):!1}function N_(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}function Br(e,t,n,r){let o={role:n,text:r};e.emit("message",o),t.onMessage?.(o)}function $_(e){return Object.fromEntries(e.map(t=>[t,[]]))}function dc(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}function D_(e,t,n){let r=[...new Set(t)],o=dc(r,e,""),i=oe({activeTab:o,stacks:$_(r)});return{sig:i,reconcile(s,l){let c=[...new Set(s)],u=i.value,p=dc(c,u.activeTab,l),_=Object.fromEntries(c.map(f=>[f,u.stacks[f]??[]])),d=p===u.activeTab&&c.length===Object.keys(u.stacks).length&&c.every(f=>u.stacks[f]===_[f]);r=c,!d&&(i.value={activeTab:p,stacks:_},p!==u.activeTab&&p&&n?.(p))},switchTab(s){!(s in i.value.stacks)||i.value.activeTab===s||(i.value={...i.value,activeTab:s},n?.(s))},open(s,l){let c=i.value;s in c.stacks&&(i.value={activeTab:s,stacks:{...c.stacks,[s]:l?[l]:[]}},c.activeTab!==s&&n?.(s))},push(s){let l=i.value,c=l.stacks[l.activeTab]??[];i.value={...l,stacks:{...l.stacks,[l.activeTab]:[...c,s]}}},pop(){let s=i.value,l=s.stacks[s.activeTab]??[];l.length!==0&&(i.value={...s,stacks:{...s.stacks,[s.activeTab]:l.slice(0,-1)}})},reset(s){i.value={activeTab:dc(r,s,""),stacks:$_(r)}}}}function B_(e){return e.stacks[e.activeTab]??[]}function U_(e){return B_(e).at(-1)}function z_(e){return B_(e).length===0}function No(e){/^(https?:)?\//i.test(e)&&window.open(e,"_blank","noopener,noreferrer")}function xa(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 nP=900,rP=640;function uc(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let r=t.initialSize;return r==="expanded"||r==="fullscreen"||r==="normal"?r:n>0&&n<rP?"fullscreen":n>=(t.autoSizeBreakpoint??nP)?"expanded":"normal"}function $o(e,t,n,r=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:uc(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function Ur(){return typeof window>"u"?0:window.innerWidth}var re={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Sa=`${L.cssPrefix}-icon-dir`;function pc(){return a("svg",{...re,"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"})})}function Ct(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})})}function F_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})})}function H_(){return a("svg",{...re,class:Sa,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]})}function q_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function j_(){return a("svg",{...re,class:Sa,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})})}function wa(){return a("svg",{...re,class:Sa,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})})}function En(){return a("svg",{...re,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function ka(){return a("svg",{...re,"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"})})}function V_(){return a("svg",{...re,"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"})]})}function dn(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"8",r:"4.5"}),a("path",{d:"M4.5 20.5a7.5 7.5 0 0 1 15 0"})]})}function W_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})})}function G_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})})}function K_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})})}function Q_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})})}function Y_(){return a("svg",{...re,"aria-hidden":"true",children:[a("path",{d:"M14 3h7v7M21 3l-9 9"}),a("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function J_(){return a("svg",{...re,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})})}function X_(){return a("svg",{...re,"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"})]})}function Z_(){return a("svg",{...re,"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"})})}function ef(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})})}function tf(){return a("svg",{...re,"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"})]})}function zr(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})})}function nf(){return a("svg",{...re,"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"})]})}function rf(){return a("svg",{...re,"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"})]})}function Do(){return a("svg",{...re,class:Sa,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}function of(){return a("svg",{...re,"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"})]})}function Ca(){return a("svg",{...re,"aria-hidden":"true",children:[a("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),a("path",{d:"m3 7 9 6 9-6"})]})}function Wt(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})})}function Ta(){return a("svg",{...re,"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"})]})}function oP(){return a("svg",{...re,"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"})]})}function _c(){return a("svg",{...re,"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"})})}function Bo(){return a("svg",{...re,"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"})]})}function iP(){return a("svg",{...re,"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"})]})}function aP(){return a("svg",{...re,"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"})]})}function sP(){return a("svg",{...re,"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"})]})}function lP(){return a("svg",{...re,"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"})]})}function fc(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]})}function af(){return a("svg",{...re,"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"})]})}function sf(){return a("svg",{...re,"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"})]})}function Ra(){return a("svg",{...re,"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"})]})}function Uo(){return a("svg",{...re,"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"})]})}function lf(){return a("svg",{...re,"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"})]})}function cf(){return a("svg",{...re,"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"})})}function df(){return a("svg",{...re,"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"})]})}function cP(){return a("svg",{...re,"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"})]})}function dP(){return a("svg",{...re,"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"})]})}function uP(){return a("svg",{...re,"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"})]})}function pP(){return a("svg",{...re,"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"})]})}function uf(){return a("svg",{...re,"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"})]})}function pf(){return a("svg",{...re,"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"})]})}function _f(){return a("svg",{...re,"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"})]})}function ff(){return a("svg",{...re,"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"})]})}function gf(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]})}function sr(){return a("svg",{...re,"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"})]})}function zo(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]})}function mf(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M12 18V5M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294M17.996 5.125a4 4 0 012.526 5.77M18 18a4 4 0 002-7.465M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517M6 18a4 4 0 01-2-7.465M6.004 5.125a4 4 0 00-2.526 5.77"})})}function Fr(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M12 8v4M12 16h.01"})]})}var hf={chat:pc,message:_c,bubbles:Uo,spark:oP,wand:iP,bot:aP,help:Bo,lifebuoy:lP,headset:sP,search:cP,sparkles:dP,concierge:uP,wave:pP};var q=L.cssPrefix,O={launcher:`${q}-launcher`,callout:`${q}-callout`,calloutDismiss:`${q}-callout-dismiss`,panel:`${q}-panel`,panelHeader:`${q}-panel-header`,resizeGrip:`${q}-resize-grip`,scrollToBottom:`${q}-scroll-to-bottom`,loadPreviousMessages:`${q}-load-previous-messages`,actionHistory:`${q}-action-history`,actionClose:`${q}-action-close`,emailTranscriptSheet:`${q}-email-transcript-sheet`,emailTranscriptEmail:`${q}-email-transcript-email`,emailTranscriptSend:`${q}-email-transcript-send`,langSegment:`${q}-lang-segment`,composer:`${q}-composer`,composerInput:`${q}-composer-input`,composerCount:`${q}-composer-count`,composerSend:`${q}-composer-send`,composerStop:`${q}-composer-stop`,compactionStatus:`${q}-compaction-status`,messageQueue:`${q}-message-queue`,queuedMessage:`${q}-queued-message`,queuedMessageRemove:`${q}-queued-message-remove`,composerAttach:`${q}-composer-attach`,composerFileInput:`${q}-composer-file-input`,composerVoice:`${q}-composer-voice`,attachmentChip:`${q}-attachment-chip`,attachmentRemove:`${q}-attachment-remove`,attachmentRetry:`${q}-attachment-retry`,suggestion:`${q}-suggestion`,messageBubble:`${q}-message`,messageRetry:`${q}-message-retry`,messageFile:`${q}-message-file`,messageFeedback:`${q}-message-feedback`,feedbackUp:`${q}-feedback-up`,feedbackDown:`${q}-feedback-down`,messageCopy:`${q}-message-copy`,historyItem:`${q}-history-item`,historyLoadMore:`${q}-history-load-more`,sidebar:`${q}-sidebar`,sidebarToggle:`${q}-sidebar-toggle`,sidebarNewConversation:`${q}-sidebar-new-conversation`,messengerHome:`${q}-messenger-home`,panelNotice:`${q}-panel-notice`,tab:`${q}-tab`,tabBadge:`${q}-tab-badge`,homeView:`${q}-home-view`,homeGreeting:`${q}-home-greeting`,homeBrand:`${q}-home-brand`,backHeader:`${q}-back-header`,contentView:`${q}-content-view`,contentScroll:`${q}-content-scroll`,homeSearch:`${q}-home-search`,helpSearch:`${q}-help-search`,homeRecent:`${q}-home-recent`,homeAsk:`${q}-home-ask`,homeWhatsNew:`${q}-home-whats-new`,homeContentRow:`${q}-home-content-row`,helpArticle:`${q}-help-article`,newsItem:`${q}-news-item`,newsMore:`${q}-news-more`,formField:`${q}-form-field`,toolAskQuestions:`${q}-tool-ask-questions`,toolInputSubmit:`${q}-tool-input-submit`,toolInputSkip:`${q}-tool-input-skip`,toolApproval:`${q}-tool-approval`,toolPreview:`${q}-tool-preview`,toolApprove:`${q}-tool-approve`,toolDecline:`${q}-tool-decline`,toolEdit:`${q}-tool-edit`,toolDecision:`${q}-tool-decision`,typingDots:`${q}-typing-dots`,reasoning:`${q}-reasoning`,replyStopped:`${q}-reply-stopped`,toolAskSummary:`${q}-ask-questions-summary`,toolAskOptions:`${q}-ask-questions-options-toggle`,toolSteps:`${q}-tool-steps`,toolStep:`${q}-tool-step`,source:`${q}-source`,operatorRequest:`${q}-operator-request`,chatNotice:`${q}-chat-notice`,operatorBanner:`${q}-operator-banner`,cancelOperatorRequest:`${q}-cancel-operator-request`,loginBar:`${q}-login-bar`,loginBarAction:`${q}-login-bar-action`,loginBarHide:`${q}-login-bar-hide`,loginGate:`${q}-login-gate`,loginGateAction:`${q}-login-gate-action`,loginGateGuest:`${q}-login-gate-guest`,loggedIn:`${q}-logged-in`};function ft(e,t){return`${e}-${t}`}var Aa=L.cssPrefix;function vf({buttonRef:e,onToggle:t,launcher:n,strings:r,leaving:o,edgeTab:i}){let s=n.variant==="circle"?"":_P(n,r);return a("button",{ref:e,type:"button",class:`${Aa}-fab`,part:"launcher","data-variant":n.variant,"data-size":n.size,"data-edge-tab":i?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":O.launcher,onClick:t,"aria-label":r.launcherOpen,children:[fP(n.icon),s?a("span",{class:`${Aa}-fab-label`,children:s}):null]})}function _P(e,t){return e.label?at(t,e.label):e.personaName?t.launcherAsk.replace("{name}",at(t,e.personaName)):""}function fP(e){let t=hf[e];return t?a(t,{}):a(gP,{source:e})}function gP({source:e}){return a("span",{ref:t=>{t&&mP(t,e)},"aria-hidden":"true"})}function mP(e,t){if(e.dataset.svgMounted!==t)try{let r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;r.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(r,!0)),e.dataset.svgMounted=t)}catch{}}function bf({callout:e,launcherPosition:t,strings:n,closeLabel:r,onDismiss:o}){let[i,s]=$(!1),l=B(null),[c,u]=$(!0);return ut(()=>{let p=l.current?.parentElement;if(!p)return;let _=()=>u(window.innerWidth-p.getBoundingClientRect().width>=hP);return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)}),U(()=>{let p=setTimeout(()=>s(!0),e.delayMs);return()=>clearTimeout(p)},[e.delayMs]),U(()=>{if(!i||e.autoDismissMs<=0)return;let p=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(p)},[i,e.autoDismissMs,o]),i?a("div",{ref:l,class:`${Aa}-callout`,role:"status","data-shape":e.shape,"data-position":vP(e.position,t,c),"data-animated":e.animated?"true":void 0,"data-testid":O.callout,children:[a("span",{children:at(n,e.text)}),a("button",{type:"button",class:`${Aa}-callout-close`,onClick:o,"aria-label":r,title:r,"data-testid":O.calloutDismiss,children:a(Ct,{})})]}):null}var hP=200;function vP(e,t,n=!0){let r=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"||e==="auto"&&!n?o?"top":"bottom":r?"left":"right"}var bP='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Hr(e){function t(n){if(n.key!=="Tab")return;let r=[...e.querySelectorAll(bP)].filter(c=>c.offsetParent!==null||c===document.activeElement);if(r.length===0){n.preventDefault();return}let o=r[0],i=r[r.length-1];if(!o||!i)return;let s=e.getRootNode(),l=s instanceof ShadowRoot?s.activeElement:null;n.shiftKey&&l===o?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),o.focus())}return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var Mn=L.cssPrefix;function Ia({title:e,actions:t}){return a("header",{class:`${Mn}-back-header`,part:"header","data-variant":"title",children:[a("span",{class:`${Mn}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${Mn}-back-title`,children:e}),t??a("span",{class:`${Mn}-back-spacer`,"aria-hidden":"true"})]})}function yf({title:e,backLabel:t,onBack:n,actions:r,testid:o}){return a("header",{class:`${Mn}-back-header`,part:"header","data-testid":o,children:[a("button",{type:"button",class:`${Mn}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(Do,{})}),a("h1",{class:`${Mn}-back-title`,children:e}),r??a("span",{class:`${Mn}-back-spacer`,"aria-hidden":"true"})]})}function Fo({textSig:e,doneSig:t,generativeUi:n=!1,strings:r=ui,onCardAction:o}){let i=B(null),s=B(null);return ut(()=>{let l=i.current;if(!l)return;l.classList.add(`${L.cssPrefix}-md`);let c=s.current,u={generativeUi:n,strings:r,onCardAction:o},p=()=>{s.current?.renderer?.dispose();let m=document.createElement("div"),h=n?c_(m,{cssPrefix:L.cssPrefix,strings:r,onAction:o}):void 0,y=Po(EP(NP(h??Gi(m)))),P=e.value,x=P.length-Pf(P);if(!t.value)for(;x>0&&P[x-1]==="_";)x--;let C=gc(P.slice(0,x));return C&&Qe(y,C),t.value&&(Mr(y),h?.finish()),l.replaceChildren(m),{settings:u,container:m,parser:y,renderer:h,lastLen:x,lastText:P.slice(0,x)}},_=c&&c.settings.generativeUi===n&&c.settings.strings===r&&c.settings.onCardAction===o&&e.value.startsWith(c.lastText)?c:p();s.current=_;let d=qt(()=>{let m=e.value,h=t.value;if(m.length<_.lastLen){_=p(),s.current=_;return}let y=Math.max(m.length-Pf(m),_.lastLen);if(!h)for(;y>_.lastLen&&m[y-1]==="_";)y--;let P=Math.max(_.lastLen-1,0),x=gc(m.slice(P,y)).slice(_.lastLen-P);x&&Qe(_.parser,x),_.lastLen=y,_.lastText=m.slice(0,y),h&&(Mr(_.parser),_.renderer?.finish())}),f=new MutationObserver(()=>xf(l));f.observe(l,{childList:!0,subtree:!0}),xf(l);function v(m){let h=m.target instanceof Element?m.target.closest("a"):null;if(!h||!(h instanceof HTMLAnchorElement))return;let y=h.getAttribute("href")??"";!y||y.startsWith("#")||(m.preventDefault(),window.open(y,"_blank","noopener,noreferrer"))}return l.addEventListener("click",v),()=>{d(),f.disconnect(),l.removeEventListener("click",v)}},[e,t,n,r,o]),U(()=>()=>{s.current?.renderer?.dispose(),s.current=null},[]),a("div",{ref:i})}function Ma({text:e}){let t=xe(()=>oe(e),[e]),n=xe(()=>oe(!0),[]);return a(Fo,{textSig:t,doneSig:n})}var Ea="\uE000",IP=/([\p{L}\p{N}])(_+)(?=[\p{L}\p{N}])/gu;function Pf(e){if((e.match(/^[ \t]*`{3,}/gm)?.length??0)%2===0)return 0;let t=e.trimEnd(),n=t.lastIndexOf(`
|
|
66
|
-
`)+1;return/^[ \t]*`{3,}[^`]*$/.test(t.slice(n))?e.length-n:0}function gc(e){return e.replace(IP,(t,n,r)=>n+Ea.repeat(r.length))}function EP(e){return{...e,add_text:(t,n)=>e.add_text(t,n.replaceAll(Ea,"_")),set_attr:(t,n,r)=>e.set_attr(t,n,r.replaceAll(Ea,"_"))}}var MP=/<(\/?)(?:(Note|Info|Tip|Warning|Danger|Check|Callout)|Tabs?|Steps?|AccordionGroup|Accordion|Expandable|Columns|CardGroup|Card|Frame|CodeGroup|Badge|Icon|Video|Embed|ParamField|ResponseField)\b((?:"[^"]*"|'[^']*'|[^>"'])*?)(\/?)>|(^|\n)([ \t]*)(```[^]*?(?:\n[ \t]*```|$))?/g;function
|
|
65
|
+
${i}`:i;continue}o.startsWith("id:")&&(r=o.slice(3).trim())}if(n==="[DONE]")return"done";if(!n)return null;try{let o=JSON.parse(n);if(!Iy(o))throw new TypeError("unrecognized chunk");return S_.trace("chunk",{type:o.type,eventId:r}),{chunk:o,eventId:r}}catch(o){throw S_.trace("frame parse failed",{errorType:o instanceof Error?o.name:typeof o,payloadLength:n.length}),new Le("invalid SSE frame","network",void 0,o)}}function Iy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof Reflect.get(e,"type")=="string"}var Ey=new Set([101,204,205,304]);function My(e){let t=new Headers;for(let n of e.trim().split(/[\r\n]+/)){let r=n.indexOf(":");r>0&&t.append(n.slice(0,r).trim(),n.slice(r+1).trim())}return t}function k_(e){return async function(n,r){let o=new Request(n,r),i=await o.blob();return new Promise((s,l)=>{if(o.signal.aborted){l(o.signal.reason);return}let c=new XMLHttpRequest;c.open(o.method,o.url),c.withCredentials=o.credentials==="include",c.responseType="blob",o.headers.forEach((u,p)=>c.setRequestHeader(p,u)),c.upload.addEventListener("progress",u=>{u.lengthComputable&&u.total>0&&e(u.loaded/u.total)}),c.addEventListener("load",()=>{s(new Response(Ey.has(c.status)?null:c.response,{status:c.status,statusText:c.statusText,headers:My(c.getAllResponseHeaders())}))}),c.addEventListener("error",()=>l(new TypeError("Failed to fetch"))),c.addEventListener("abort",()=>l(o.signal.reason)),o.signal.addEventListener("abort",()=>c.abort(),{once:!0}),c.send(i)})}}var We=ee.scope("transport"),Ly="x-user-token",Oy="x-continue-link";async function lc(e){try{let t=await e.clone().json();if(typeof t!="object"||t===null)return{};let n=Reflect.get(t,"error");return{error:typeof n=="string"?n:void 0,loginUrl:Vi(Reflect.get(t,"login")).url}}catch{return{}}}var C_=6e4,Ny=1e4,cc=50,O_=new WeakMap;function $r(e){return O_.get(e)}function Lo(e,t){return O_.set(e,t),e}function T_(e){return Math.max(e?.upsertRevision??0,e?.read?.revision??0)}function $y(e,t){return e.conversationId===t.conversationId&&e.title===t.title&&e.lastMessageAt===t.lastMessageAt&&e.preview===t.preview&&e.hasUnread===t.hasUnread&&e.controlState===t.controlState}function un(e,t,n=!0){switch(t.type){case"snapshot":{let r=new Map(e.map(s=>[s.conversationId,s])),o=e.filter(s=>($r(s)?.activityRevision??0)>t.requestedRevision).toSorted((s,l)=>($r(l)?.activityRevision??0)-($r(s)?.activityRevision??0)),i=new Set(o.map(s=>s.conversationId));return[...o,...t.result.conversations.filter(s=>!i.has(s.conversationId)).map(s=>{let l=r.get(s.conversationId);if(!l)return s;let c=$r(l);return(c?.upsertRevision??0)>t.requestedRevision?l:c?.read&&!l.hasUnread&&c.read.lastMessageAt===s.lastMessageAt?Lo({...s,hasUnread:!1},{upsertRevision:0,read:c.read}):s})]}case"read":{let r=e.findIndex(c=>c.conversationId===t.conversationId&&(t.lastMessageAt===void 0||c.lastMessageAt===t.lastMessageAt)),o=e[r];if(!o)return e;let i=$r(o);if(T_(i)>t.revision)return e;let s=t.lastMessageAt??o.lastMessageAt,l={upsertRevision:i?.upsertRevision??0,...i?.activityRevision===void 0?{}:{activityRevision:i.activityRevision},read:{revision:t.revision,...s?{lastMessageAt:s}:{}}};return o.hasUnread?e.map((c,u)=>u===r?Lo({...c,hasUnread:!1},l):c):(Lo(o,l),e)}case"upsert":{let r=e.findIndex(u=>u.conversationId===t.conversation.conversationId);if(r<0&&!n)return e;let o=e[r],i=o?$r(o):void 0;if(T_(i)>t.revision)return e;let s=t.activity?t.revision:i?.activityRevision,l={upsertRevision:t.revision,...s===void 0?{}:{activityRevision:s},...!t.conversation.hasUnread&&i?.read?{read:i.read}:{}},c=o?{...o,...t.conversation,title:o.title}:{...t.conversation};return o&&$y(o,c)?(Lo(o,l),e):(Lo(c,l),t.activity?[c,...e.filter(u=>u.conversationId!==c.conversationId)]:o?e.map((u,p)=>p===r?c:u):[...e,c])}default:return t}}var R_=3,Dy=400,By=3e4,Uy=6e4,zy=1e4,Fy=6e4,Hy=15e3,qy=1024*1024,A_=new Set([408,425,429,500,502,503,504]);function I_(e){return Dy*2**e+Math.floor(Math.random()*250)}function jy(e){return Fy+Math.ceil(e/qy)*Hy}function Vy(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),r=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(r)&&r>=0?Math.min(r,3e4):null}var Oo=class{constructor(t){Z(this,"ttlMs",t);Z(this,"map",new Map)}getOrFetch(t,n){let r=this.map.get(t);if(r&&performance.now()-r.at<this.ttlMs)return r.result;let o={at:performance.now(),result:n().then(i=>(o.value=i,i)).catch(i=>{throw this.map.get(t)===o&&this.map.delete(t),i})};return this.map.set(t,o),o.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&performance.now()-n.at<this.ttlMs)return n.value}update(t){for(let n of this.map.values()){if(n.value!==void 0){let r=t(n.value);n.value=r,n.result=Promise.resolve(r);continue}n.result=n.result.then(r=>{let o=t(r);return n.value=o,o})}}delete(t){this.map.delete(t)}};function E_(e,t){let{translations:n,defaultLocale:r,...o}=zn(e,t);return o}var ya=class{constructor(t){Z(this,"opts",t);Z(this,"conversationListeners",new Set);Z(this,"conversationRevision",0);Z(this,"visitorId");Z(this,"conversationId");Z(this,"userContext");Z(this,"pageContext");Z(this,"locale");Z(this,"userTokenSource");Z(this,"userToken");Z(this,"userTokenRequest");Z(this,"conversationsCache",new Oo(Ny));Z(this,"contentCache",new Oo(C_));Z(this,"contentCollectionsCache",new Oo(C_))}setUserToken(t){this.userTokenSource=t,this.userToken=typeof t=="string"&&t||void 0,this.userTokenRequest=typeof t=="function"?this.fetchUserToken():void 0,this.opts.onLoginState?.(t?{status:"pending"}:{status:"anonymous"})}async userSub(){return this.userTokenRequest&&await this.userTokenRequest,this.userToken?dp(this.userToken):void 0}reportLogin(t){this.opts.onLoginState?.(t==="loggedIn"&&this.userToken?{status:t,...cp(this.userToken)}:{status:t==="loggedIn"?"anonymous":t})}async refreshUserToken(){let t=this.userToken;return typeof this.userTokenSource!="function"?!1:(this.userTokenRequest&&await this.userTokenRequest,this.userToken===t&&await this.fetchUserToken(),!!this.userToken&&this.userToken!==t)}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:Tr};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=sc(this.userContext,this.pageContext);return n&&(t[Yl]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,r]of Object.entries(this.envelope()))t.append(n,r);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[r,o]of Object.entries(this.envelope()))n.searchParams.has(r)||n.searchParams.set(r,o);return n.toString()}async handshake(t){We.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=dn("handshake",await this.postJson(_t.handshake,t,"handshake"),L_),r=n.loginStatus==="expired"&&await this.refreshUserToken()?dn("handshake",await this.postJson(_t.handshake,t,"handshake"),L_):n;return this.reportLogin(r.loginStatus??(this.userToken?"loggedIn":"anonymous")),We.debug("handshake \u2190",{visitorId:r.visitorId,conversationId:r.conversationId,hasWelcome:!!r.welcome,hasConfig:!!r.config,rebind:r.rebind}),this.visitorId=r.visitorId,this.conversationId=r.conversationId,r}async uploadFile(t,n,r){We.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let o=new FormData;o.append("file",t,t.name);let i=dn("upload",await this.postForm(this.uploadPath,o,"upload",n,jy(t.size),r),Ky);return We.debug("uploadFile \u2190",{id:i.id,url:i.url}),i}async transcribe(t,n="audio/webm"){We.debug("transcribe \u2192",{size:t.size,mimeType:n});let r=new FormData;r.append("audio",t,`voice.${Wy(n)}`),r.append("mimeType",n);let o=dn("transcribe",await this.postForm(this.transcribePath,r,"transcribe"),Qy);return We.debug("transcribe \u2190",{textLen:o.text.length}),o}subscribeConversationChanges(t){return this.conversationListeners.add(t),()=>this.conversationListeners.delete(t)}publishConversation(t,n=!1){let r={type:"upsert",conversation:t,revision:++this.conversationRevision,...n?{activity:!0}:{}};this.conversationsCache.update(o=>{let i=o.pagination.page===1,s=o.conversations.some(_=>_.conversationId===t.conversationId),l=un(o.conversations,r,i&&n),c=i&&l.length>o.pagination.limit?l.slice(0,o.pagination.limit):l;if(!i||!n||s||o.pagination.hasNext)return c===o.conversations?o:{...o,conversations:c};let u=Math.max(o.pagination.total,o.conversations.length)+1,p=Math.ceil(u/o.pagination.limit);return{...o,conversations:c,pagination:{...o.pagination,total:u,totalPages:p,hasNext:o.pagination.page<p}}});for(let o of this.conversationListeners)o(r)}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={},n=!1){if((t.page??1)>1)return this.fetchConversations(t);let r=this.localeCacheKey(t),o=this.conversationRevision;n&&this.conversationsCache.delete(r);let i=this.conversationsCache.getOrFetch(r,()=>this.fetchConversations(t));return n?i.then(s=>{let l={type:"snapshot",result:s,requestedRevision:o};for(let c of this.conversationListeners)c(l);return s}):i}async fetchConversations(t){let n=new URL(this.url(_t.listConversations));return t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.ids?.length&&n.searchParams.set("ids",t.ids.join(",")),dn("listConversations",await this.getJson(n.toString(),"listConversations"),Yy)}async loadConversation(t,{ids:n=[],beforeId:r,beforeCreatedAt:o}={}){let i=new URL(this.url(_t.listMessages));i.searchParams.set("conversationId",t),i.searchParams.set("limit",String(cc)),n.length>0&&i.searchParams.set("ids",n.join(",")),r&&i.searchParams.set("beforeId",r),o&&i.searchParams.set("beforeCreatedAt",o);let s=dn("loadConversation",await this.getJson(i.toString(),"loadConversation"),Jy);return{...s,messages:s.messages.toReversed()}}async markRead(t,n){if(!this.visitorId||!t)return;let r={type:"read",conversationId:t,...n===void 0?{}:{lastMessageAt:n},revision:++this.conversationRevision};this.conversationsCache.update(o=>{let i=un(o.conversations,r);return i===o.conversations?o:{...o,conversations:i}});for(let o of this.conversationListeners)o(r);try{await this.postJson(_t.markRead,{conversationId:t},"markRead",!0)}catch(o){We.debug("markRead failed (non-fatal)",{err:o})}}async requestOperator(){if(!(!this.visitorId||!this.conversationId))try{return M_("requestOperator",await this.postJson(_t.requestOperator,{},"requestOperator"))}catch(t){We.debug("requestOperator failed (non-fatal)",{err:t});return}}async emailTranscript(t){return dn("emailTranscript",await this.postJson(_t.emailTranscript,{email:t},"emailTranscript"),Xy)}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId))try{return M_("cancelOperatorRequest",await this.postJson(_t.cancelOperatorRequest,{},"cancelOperatorRequest"))}catch(t){We.debug("cancelOperatorRequest failed (non-fatal)",{err:t});return}}listContent(t={}){return this.contentCache.getOrFetch(JSON.stringify(t,Object.keys(t).toSorted()),()=>this.fetchContent(t)).then(n=>({...n,items:n.items.map(r=>E_(r,this.locale))}))}async fetchContent(t){let n=new URL(this.dataUrl(_t.content));for(let[o,i]of Object.entries(t))i!==void 0&&n.searchParams.set(o,Array.isArray(i)?i.join(","):String(i));let r=dn("listContent",await this.getJson(n.toString(),"listContent"),Zy);return{...r,items:r.items??[]}}async setContentVote(t){try{await this.postJson(this.dataUrl(_t.contentVoteSet),t,"setContentVote")}catch{}}listContentCollections(t){return this.contentCollectionsCache.getOrFetch(t.join(","),()=>this.fetchContentCollections(t)).then(n=>({items:n.items.map(r=>E_(r,this.locale))}))}async fetchContentCollections(t){let n=new URL(this.dataUrl(_t.contentCollections));return t.length&&n.searchParams.set("ids",t.join(",")),{items:dn("listContentCollections",await this.getJson(n.toString(),"listContentCollections"),eP).items??[]}}async saveUserPrefs(t){await this.postJson(_t.updateSettings,{userPrefs:t},"saveUserPrefs")}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}async submitFeedback(t){We.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(_t.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){We.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(t,n={}){We.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});let r=JSON.stringify({...this.withEnvelope(t),[Yl]:sc(this.userContext,this.pageContext,this.opts.recentHostEvents)}),o=n.keepalive===!0&&new Blob([r]).size<Uy;try{return await this.runWithAbort(async i=>{let s=await this.withFreshUserToken(()=>this.fetchImpl(this.url(_t.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.headersFor(this.url(_t.streamMessage))},body:r,keepalive:o,signal:i}));if(s.status!==202)throw new Le(`sendTurn failed: expected 202, received ${s.status}`,"server",s.status,void 0,tP(s),(await lc(s)).error);let l;try{l=await s.json()}catch(c){throw i?.aborted?c:new Le("sendTurn failed: invalid acknowledgement","server",s.status,c)}if(!Gy(l))throw new Le("sendTurn failed: invalid acknowledgement","server",s.status);return l},void 0,By)}catch(i){throw i instanceof Le?i:new Le("sendTurn failed: network error","network",void 0,i)}}cancelTurn(t,n){!this.visitorId||!t||!n||(We.debug("cancel stream",{conversationId:t,runId:n,visitorId:this.visitorId}),this.fetchImpl(this.url(_t.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(_t.cancelStream))},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:n})),keepalive:!0}).catch(r=>We.debug("cancel POST failed (non-fatal)",{err:r})))}async connectResumeStream(t){let n=new AbortController;function r(){return n.abort(t.signal.reason)}t.signal.aborted?r():t.signal.addEventListener("abort",r,{once:!0});let o=setTimeout(()=>n.abort(),zy);function i(){clearTimeout(o),t.signal.removeEventListener("abort",r)}let s;try{s=await this.withFreshUserToken(()=>this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",cache:"no-store",headers:{accept:"text/event-stream",...this.headersFor(this.resumeUrl())},signal:n.signal}))}catch(c){return i(),t.signal.aborted||We.debug("resume-stream fetch failed \u2014 reconnecting",{err:c}),"held"}if(!s.ok)return i(),s.status===409||A_.has(s.status)?(We.debug("resume-stream \u2192 transient response; reconnecting",{status:s.status}),"held"):(We.debug("resume-stream \u2192 endpoint unavailable",{status:s.status}),"unavailable");if(!s.body)return i(),We.debug("resume-stream \u2192 bodyless response; stopping",{status:s.status}),"unavailable";if(!(s.headers.get("content-type")??"").includes("text/event-stream"))return i(),We.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";let l=!1;try{for await(let{chunk:c}of w_(s,n.signal,u=>{l||u!=="connected"||(l=!0,clearTimeout(o),t.onConnected())})){if(t.signal.aborted)return"held";t.onChunk(c)}}catch(c){if(t.signal.aborted)return"held";We.debug("resume-stream segment dropped \u2014 reconnecting",{err:c})}finally{i()}return"held"}resumeUrl(){return this.withEnvelopeQuery(_t.streamResume)}async postJson(t,n,r,o=!1){let i=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(t))},body:JSON.stringify(this.withEnvelope(n)),...o?{keepalive:!0}:{}}],r);return this.assertOk(i,r)}async postForm(t,n,r,o,i,s){let l=s?k_(s):this.fetchImpl;return this.runWithAbort(async c=>{let u=await this.withFreshUserToken(()=>l(this.url(t),{method:"POST",credentials:"omit",headers:this.headersFor(this.url(t)),body:this.appendEnvelope(n),signal:c}));return this.assertOk(u,r)},o,i)}async runWithAbort(t,n,r){if(!n&&r===void 0)return t();let o=new AbortController;function i(){return o.abort(n?.reason)}n?.aborted?i():n?.addEventListener("abort",i,{once:!0});let s=r===void 0?void 0:setTimeout(()=>o.abort(),r);try{return await t(o.signal)}finally{s!==void 0&&clearTimeout(s),n?.removeEventListener("abort",i)}}async getJson(t,n){let r=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.headersFor(this.url(t))}}],n);return this.assertOk(r,n)}async fetchWithRetry(t,n){for(let r=0;;r++){let o;try{o=await this.withFreshUserToken(()=>this.fetchImpl(...t()))}catch(s){if(r>=R_)throw new Le(`${n} failed: network error`,"network",void 0,s);We.debug("request network error \u2014 retrying",{label:n,attempt:r}),await jn(I_(r));continue}if(o.ok||!A_.has(o.status)||r>=R_)return o;let i=Vy(o.headers)??I_(r);We.debug("request retryable status \u2014 retrying",{label:n,status:o.status,attempt:r,wait:i}),await jn(i)}}async assertOk(t,n){if(!t.ok)throw new Le(`${n} failed: ${t.status}`,"server",t.status,void 0,void 0,(await lc(t)).error);return await t.json()}fetchUserToken(){let t=this.userTokenSource;if(typeof t!="function")return Promise.resolve();let n=Promise.resolve().then(t).then(r=>{this.userTokenSource===t&&(this.userToken=r||void 0)},r=>{We.warn("userToken function failed",{err:r}),this.userTokenSource===t&&(this.userToken=void 0)});return this.userTokenRequest=n,n}headersFor(t){let n=!/^https?:\/\//i.test(t)||t.startsWith(`${this.opts.agentApiBaseUrl}/`);return{...this.opts.auth.headers(),...n&&this.userToken?{[Ly]:this.userToken}:{},...n&&this.opts.continueLink?{[Oy]:this.opts.continueLink}:{}}}async withFreshUserToken(t){this.userTokenRequest&&await this.userTokenRequest;let n=await t();if(n.status!==401)return n;let r=await lc(n);if(r.error==="USER_TOKEN_REQUIRED")return this.opts.onLoginState?.({status:"required",loginUrl:r.loginUrl}),n;if(!this.userToken)return n;if(!await this.refreshUserToken())return this.reportLogin("expired"),n;this.reportLogin("loggedIn");let o=await t();return o.status===401&&this.reportLogin("expired"),o}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function Wy(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 Gy(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),n=Reflect.get(e,"conversationId"),r=Reflect.get(e,"runId");return t==="accepted"&&typeof n=="string"&&n.length>0&&(r===void 0||typeof r=="string"&&r.length>0)}function It(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dn(e,t,n){if(!n(t))throw new Le(`${e} failed: invalid response body`,"server");return t}function M_(e,t){let n=pa(It(t)?t.controlState:void 0);if(!n)throw new Le(`${e} failed: invalid response body`,"server");return n}function L_(e){return!(!It(e)||typeof e.visitorId!="string"||typeof e.conversationId!="string"||e.welcome!==void 0&&(!It(e.welcome)||e.welcome.messages!==void 0&&!Array.isArray(e.welcome.messages)))}function Ky(e){return It(e)&&typeof e.id=="string"&&typeof e.url=="string"&&typeof e.originalName=="string"&&typeof e.mimeType=="string"&&typeof e.fileSize=="number"}function Qy(e){return It(e)&&typeof e.text=="string"}function N_(e){return It(e)&&typeof e.page=="number"&&typeof e.limit=="number"&&typeof e.total=="number"&&typeof e.totalPages=="number"&&typeof e.hasNext=="boolean"&&typeof e.hasPrev=="boolean"}function Yy(e){return It(e)&&Array.isArray(e.conversations)&&e.conversations.every(It)&&N_(e.pagination)}function Jy(e){return It(e)&&typeof e.conversationId=="string"&&Array.isArray(e.messages)&&e.messages.every(It)}function Xy(e){return It(e)&&typeof e.status=="string"&&typeof e.to=="string"}function Zy(e){return It(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(It))&&(e.pagination===void 0||N_(e.pagination))}function eP(e){return It(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(It))}function tP(e){let t=Number(e.headers.get("retry-after"));return Number.isInteger(t)&&t>0?t:void 0}function Dr(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"popOut":return t!=="standalone"&&t!=="page";case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Pa(e,t,n){return Dr("close",e,t)?n.includes("close"):!1}function $_(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}function Br(e,t,n,r){let o={role:n,text:r};e.emit("message",o),t.onMessage?.(o)}function D_(e){return Object.fromEntries(e.map(t=>[t,[]]))}function dc(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}function B_(e,t,n){let r=[...new Set(t)],o=dc(r,e,""),i=oe({activeTab:o,stacks:D_(r)});return{sig:i,reconcile(s,l){let c=[...new Set(s)],u=i.value,p=dc(c,u.activeTab,l),_=Object.fromEntries(c.map(f=>[f,u.stacks[f]??[]])),d=p===u.activeTab&&c.length===Object.keys(u.stacks).length&&c.every(f=>u.stacks[f]===_[f]);r=c,!d&&(i.value={activeTab:p,stacks:_},p!==u.activeTab&&p&&n?.(p))},switchTab(s){!(s in i.value.stacks)||i.value.activeTab===s||(i.value={...i.value,activeTab:s},n?.(s))},open(s,l){let c=i.value;s in c.stacks&&(i.value={activeTab:s,stacks:{...c.stacks,[s]:l?[l]:[]}},c.activeTab!==s&&n?.(s))},push(s){let l=i.value,c=l.stacks[l.activeTab]??[];i.value={...l,stacks:{...l.stacks,[l.activeTab]:[...c,s]}}},pop(){let s=i.value,l=s.stacks[s.activeTab]??[];l.length!==0&&(i.value={...s,stacks:{...s.stacks,[s.activeTab]:l.slice(0,-1)}})},reset(s){i.value={activeTab:dc(r,s,""),stacks:D_(r)}}}}function U_(e){return e.stacks[e.activeTab]??[]}function z_(e){return U_(e).at(-1)}function F_(e){return U_(e).length===0}function No(e){/^(https?:)?\//i.test(e)&&window.open(e,"_blank","noopener,noreferrer")}function xa(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 nP=900,rP=640;function uc(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let r=t.initialSize;return r==="expanded"||r==="fullscreen"||r==="normal"?r:n>0&&n<rP?"fullscreen":n>=(t.autoSizeBreakpoint??nP)?"expanded":"normal"}function $o(e,t,n,r=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:uc(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function Ur(){return typeof window>"u"?0:window.innerWidth}var re={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Sa=`${L.cssPrefix}-icon-dir`;function pc(){return a("svg",{...re,"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"})})}function Ct(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})})}function H_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})})}function q_(){return a("svg",{...re,class:Sa,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]})}function j_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function V_(){return a("svg",{...re,class:Sa,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})})}function wa(){return a("svg",{...re,class:Sa,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})})}function En(){return a("svg",{...re,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function ka(){return a("svg",{...re,"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"})})}function W_(){return a("svg",{...re,"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"})]})}function pn(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"8",r:"4.5"}),a("path",{d:"M4.5 20.5a7.5 7.5 0 0 1 15 0"})]})}function G_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})})}function K_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})})}function Q_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})})}function Y_(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})})}function J_(){return a("svg",{...re,"aria-hidden":"true",children:[a("path",{d:"M14 3h7v7M21 3l-9 9"}),a("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function X_(){return a("svg",{...re,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})})}function Z_(){return a("svg",{...re,"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"})]})}function ef(){return a("svg",{...re,"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"})})}function tf(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})})}function nf(){return a("svg",{...re,"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"})]})}function zr(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})})}function rf(){return a("svg",{...re,"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"})]})}function of(){return a("svg",{...re,"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"})]})}function Do(){return a("svg",{...re,class:Sa,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}function af(){return a("svg",{...re,"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"})]})}function Ca(){return a("svg",{...re,"aria-hidden":"true",children:[a("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),a("path",{d:"m3 7 9 6 9-6"})]})}function Wt(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})})}function Ta(){return a("svg",{...re,"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"})]})}function oP(){return a("svg",{...re,"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"})]})}function _c(){return a("svg",{...re,"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"})})}function Bo(){return a("svg",{...re,"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"})]})}function iP(){return a("svg",{...re,"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"})]})}function aP(){return a("svg",{...re,"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"})]})}function sP(){return a("svg",{...re,"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"})]})}function lP(){return a("svg",{...re,"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"})]})}function fc(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]})}function sf(){return a("svg",{...re,"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"})]})}function lf(){return a("svg",{...re,"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"})]})}function Ra(){return a("svg",{...re,"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"})]})}function Uo(){return a("svg",{...re,"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"})]})}function cf(){return a("svg",{...re,"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"})]})}function df(){return a("svg",{...re,"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"})})}function uf(){return a("svg",{...re,"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"})]})}function cP(){return a("svg",{...re,"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"})]})}function dP(){return a("svg",{...re,"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"})]})}function uP(){return a("svg",{...re,"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"})]})}function pP(){return a("svg",{...re,"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"})]})}function pf(){return a("svg",{...re,"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"})]})}function _f(){return a("svg",{...re,"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"})]})}function ff(){return a("svg",{...re,"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"})]})}function gf(){return a("svg",{...re,"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"})]})}function mf(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]})}function sr(){return a("svg",{...re,"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"})]})}function zo(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]})}function hf(){return a("svg",{...re,"aria-hidden":"true",children:a("path",{d:"M12 18V5M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294M17.996 5.125a4 4 0 012.526 5.77M18 18a4 4 0 002-7.465M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517M6 18a4 4 0 01-2-7.465M6.004 5.125a4 4 0 00-2.526 5.77"})})}function Fr(){return a("svg",{...re,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M12 8v4M12 16h.01"})]})}var vf={chat:pc,message:_c,bubbles:Uo,spark:oP,wand:iP,bot:aP,help:Bo,lifebuoy:lP,headset:sP,search:cP,sparkles:dP,concierge:uP,wave:pP};var q=L.cssPrefix,O={launcher:`${q}-launcher`,callout:`${q}-callout`,calloutDismiss:`${q}-callout-dismiss`,panel:`${q}-panel`,panelHeader:`${q}-panel-header`,resizeGrip:`${q}-resize-grip`,scrollToBottom:`${q}-scroll-to-bottom`,loadPreviousMessages:`${q}-load-previous-messages`,actionHistory:`${q}-action-history`,actionClose:`${q}-action-close`,emailTranscriptSheet:`${q}-email-transcript-sheet`,emailTranscriptEmail:`${q}-email-transcript-email`,emailTranscriptSend:`${q}-email-transcript-send`,langSegment:`${q}-lang-segment`,composer:`${q}-composer`,composerInput:`${q}-composer-input`,composerCount:`${q}-composer-count`,composerSend:`${q}-composer-send`,composerStop:`${q}-composer-stop`,compactionStatus:`${q}-compaction-status`,messageQueue:`${q}-message-queue`,queuedMessage:`${q}-queued-message`,queuedMessageRemove:`${q}-queued-message-remove`,composerAttach:`${q}-composer-attach`,composerFileInput:`${q}-composer-file-input`,composerVoice:`${q}-composer-voice`,attachmentChip:`${q}-attachment-chip`,attachmentRemove:`${q}-attachment-remove`,attachmentRetry:`${q}-attachment-retry`,suggestion:`${q}-suggestion`,messageBubble:`${q}-message`,messageRetry:`${q}-message-retry`,messageFile:`${q}-message-file`,messageFeedback:`${q}-message-feedback`,feedbackUp:`${q}-feedback-up`,feedbackDown:`${q}-feedback-down`,messageCopy:`${q}-message-copy`,historyItem:`${q}-history-item`,historyLoadMore:`${q}-history-load-more`,sidebar:`${q}-sidebar`,sidebarToggle:`${q}-sidebar-toggle`,sidebarNewConversation:`${q}-sidebar-new-conversation`,messengerHome:`${q}-messenger-home`,panelNotice:`${q}-panel-notice`,tab:`${q}-tab`,tabBadge:`${q}-tab-badge`,homeView:`${q}-home-view`,homeGreeting:`${q}-home-greeting`,homeBrand:`${q}-home-brand`,backHeader:`${q}-back-header`,contentView:`${q}-content-view`,contentScroll:`${q}-content-scroll`,homeSearch:`${q}-home-search`,helpSearch:`${q}-help-search`,homeRecent:`${q}-home-recent`,homeAsk:`${q}-home-ask`,homeWhatsNew:`${q}-home-whats-new`,homeContentRow:`${q}-home-content-row`,helpArticle:`${q}-help-article`,newsItem:`${q}-news-item`,newsMore:`${q}-news-more`,formField:`${q}-form-field`,toolAskQuestions:`${q}-tool-ask-questions`,toolInputSubmit:`${q}-tool-input-submit`,toolInputSkip:`${q}-tool-input-skip`,toolApproval:`${q}-tool-approval`,toolPreview:`${q}-tool-preview`,toolApprove:`${q}-tool-approve`,toolDecline:`${q}-tool-decline`,toolEdit:`${q}-tool-edit`,toolDecision:`${q}-tool-decision`,typingDots:`${q}-typing-dots`,reasoning:`${q}-reasoning`,replyStopped:`${q}-reply-stopped`,toolAskSummary:`${q}-ask-questions-summary`,toolAskOptions:`${q}-ask-questions-options-toggle`,toolSteps:`${q}-tool-steps`,toolStep:`${q}-tool-step`,source:`${q}-source`,operatorRequest:`${q}-operator-request`,chatNotice:`${q}-chat-notice`,operatorBanner:`${q}-operator-banner`,cancelOperatorRequest:`${q}-cancel-operator-request`,loginBar:`${q}-login-bar`,loginBarAction:`${q}-login-bar-action`,loginBarHide:`${q}-login-bar-hide`,loginGate:`${q}-login-gate`,loginGateAction:`${q}-login-gate-action`,loginGateGuest:`${q}-login-gate-guest`,loggedIn:`${q}-logged-in`};function ft(e,t){return`${e}-${t}`}var Aa=L.cssPrefix;function bf({buttonRef:e,onToggle:t,launcher:n,strings:r,leaving:o,edgeTab:i}){let s=n.variant==="circle"?"":_P(n,r);return a("button",{ref:e,type:"button",class:`${Aa}-fab`,part:"launcher","data-variant":n.variant,"data-size":n.size,"data-edge-tab":i?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":O.launcher,onClick:t,"aria-label":r.launcherOpen,children:[fP(n.icon),s?a("span",{class:`${Aa}-fab-label`,children:s}):null]})}function _P(e,t){return e.label?at(t,e.label):e.personaName?t.launcherAsk.replace("{name}",at(t,e.personaName)):""}function fP(e){let t=vf[e];return t?a(t,{}):a(gP,{source:e})}function gP({source:e}){return a("span",{ref:t=>{t&&mP(t,e)},"aria-hidden":"true"})}function mP(e,t){if(e.dataset.svgMounted!==t)try{let r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;r.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(r,!0)),e.dataset.svgMounted=t)}catch{}}function yf({callout:e,launcherPosition:t,strings:n,closeLabel:r,onDismiss:o}){let[i,s]=$(!1),l=B(null),[c,u]=$(!0);return ut(()=>{let p=l.current?.parentElement;if(!p)return;let _=()=>u(window.innerWidth-p.getBoundingClientRect().width>=hP);return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)}),U(()=>{let p=setTimeout(()=>s(!0),e.delayMs);return()=>clearTimeout(p)},[e.delayMs]),U(()=>{if(!i||e.autoDismissMs<=0)return;let p=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(p)},[i,e.autoDismissMs,o]),i?a("div",{ref:l,class:`${Aa}-callout`,role:"status","data-shape":e.shape,"data-position":vP(e.position,t,c),"data-animated":e.animated?"true":void 0,"data-testid":O.callout,children:[a("span",{children:at(n,e.text)}),a("button",{type:"button",class:`${Aa}-callout-close`,onClick:o,"aria-label":r,title:r,"data-testid":O.calloutDismiss,children:a(Ct,{})})]}):null}var hP=200;function vP(e,t,n=!0){let r=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"||e==="auto"&&!n?o?"top":"bottom":r?"left":"right"}var bP='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Hr(e){function t(n){if(n.key!=="Tab")return;let r=[...e.querySelectorAll(bP)].filter(c=>c.offsetParent!==null||c===document.activeElement);if(r.length===0){n.preventDefault();return}let o=r[0],i=r[r.length-1];if(!o||!i)return;let s=e.getRootNode(),l=s instanceof ShadowRoot?s.activeElement:null;n.shiftKey&&l===o?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),o.focus())}return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var Mn=L.cssPrefix;function Ia({title:e,actions:t}){return a("header",{class:`${Mn}-back-header`,part:"header","data-variant":"title",children:[a("span",{class:`${Mn}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${Mn}-back-title`,children:e}),t??a("span",{class:`${Mn}-back-spacer`,"aria-hidden":"true"})]})}function Pf({title:e,backLabel:t,onBack:n,actions:r,testid:o}){return a("header",{class:`${Mn}-back-header`,part:"header","data-testid":o,children:[a("button",{type:"button",class:`${Mn}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(Do,{})}),a("h1",{class:`${Mn}-back-title`,children:e}),r??a("span",{class:`${Mn}-back-spacer`,"aria-hidden":"true"})]})}function Fo({textSig:e,doneSig:t,generativeUi:n=!1,strings:r=ui,onCardAction:o}){let i=B(null),s=B(null);return ut(()=>{let l=i.current;if(!l)return;l.classList.add(`${L.cssPrefix}-md`);let c=s.current,u={generativeUi:n,strings:r,onCardAction:o},p=()=>{s.current?.renderer?.dispose();let m=document.createElement("div"),h=n?d_(m,{cssPrefix:L.cssPrefix,strings:r,onAction:o}):void 0,y=Po(EP(NP(h??Gi(m)))),P=e.value,x=P.length-xf(P);if(!t.value)for(;x>0&&P[x-1]==="_";)x--;let C=gc(P.slice(0,x));return C&&Qe(y,C),t.value&&(Mr(y),h?.finish()),l.replaceChildren(m),{settings:u,container:m,parser:y,renderer:h,lastLen:x,lastText:P.slice(0,x)}},_=c&&c.settings.generativeUi===n&&c.settings.strings===r&&c.settings.onCardAction===o&&e.value.startsWith(c.lastText)?c:p();s.current=_;let d=qt(()=>{let m=e.value,h=t.value;if(m.length<_.lastLen){_=p(),s.current=_;return}let y=Math.max(m.length-xf(m),_.lastLen);if(!h)for(;y>_.lastLen&&m[y-1]==="_";)y--;let P=Math.max(_.lastLen-1,0),x=gc(m.slice(P,y)).slice(_.lastLen-P);x&&Qe(_.parser,x),_.lastLen=y,_.lastText=m.slice(0,y),h&&(Mr(_.parser),_.renderer?.finish())}),f=new MutationObserver(()=>Sf(l));f.observe(l,{childList:!0,subtree:!0}),Sf(l);function v(m){let h=m.target instanceof Element?m.target.closest("a"):null;if(!h||!(h instanceof HTMLAnchorElement))return;let y=h.getAttribute("href")??"";!y||y.startsWith("#")||(m.preventDefault(),window.open(y,"_blank","noopener,noreferrer"))}return l.addEventListener("click",v),()=>{d(),f.disconnect(),l.removeEventListener("click",v)}},[e,t,n,r,o]),U(()=>()=>{s.current?.renderer?.dispose(),s.current=null},[]),a("div",{ref:i})}function Ma({text:e}){let t=xe(()=>oe(e),[e]),n=xe(()=>oe(!0),[]);return a(Fo,{textSig:t,doneSig:n})}var Ea="\uE000",IP=/([\p{L}\p{N}])(_+)(?=[\p{L}\p{N}])/gu;function xf(e){if((e.match(/^[ \t]*`{3,}/gm)?.length??0)%2===0)return 0;let t=e.trimEnd(),n=t.lastIndexOf(`
|
|
66
|
+
`)+1;return/^[ \t]*`{3,}[^`]*$/.test(t.slice(n))?e.length-n:0}function gc(e){return e.replace(IP,(t,n,r)=>n+Ea.repeat(r.length))}function EP(e){return{...e,add_text:(t,n)=>e.add_text(t,n.replaceAll(Ea,"_")),set_attr:(t,n,r)=>e.set_attr(t,n,r.replaceAll(Ea,"_"))}}var MP=/<(\/?)(?:(Note|Info|Tip|Warning|Danger|Check|Callout)|Tabs?|Steps?|AccordionGroup|Accordion|Expandable|Columns|CardGroup|Card|Frame|CodeGroup|Badge|Icon|Video|Embed|ParamField|ResponseField)\b((?:"[^"]*"|'[^']*'|[^>"'])*?)(\/?)>|(^|\n)([ \t]*)(```[^]*?(?:\n[ \t]*```|$))?/g;function kf(e){let t=0,n="";return e.replace(MP,(r,o,i,s,l,c,u,p)=>{if(o===void 0)return t?c+(p?.split(`
|
|
67
67
|
${u}`).join(`
|
|
68
68
|
`)??n):r;if(o)return t--,i&&(n=n.slice(2)),i?`
|
|
69
69
|
${n}`:"";l||(t++,i&&(n+="> "));let _={};s.replace(/(\w+)=(["'])(.*?)\2/g,(v,m,h,y)=>_[m]=y);let d=_.href??_.src,f=_.title??_.path??_.query??_.body??_.header??_.name??d;return(i?"> ":"")+(f?`**${d?`[${f}](${d})`:f}**${_.type?` \`${_.type}\``:""}
|
|
70
|
-
${n}`:"")})}var LP=new Set(["http:","https:","mailto:","tel:"]),OP=new Set(["http:","https:"]);function NP(e){let t=document.createElement("a");return{...e,set_attr:(n,r,o)=>{if(r!==Er&&r!==bo||(t.href=o,(r===Er?LP:OP).has(t.protocol)))return e.set_attr(n,r,o);let i=r===bo?n.nodes[n.index]:void 0;i?.replaceWith(...i.childNodes)}}}function xf(e){for(let t of e.querySelectorAll("a")){let n=t.getAttribute("href")??"";!n||n.startsWith("#")||(t.target="_blank",t.rel="noopener noreferrer")}}var Sf=new Set([11,12,13,14,15,16,17,18,19,31]);function La(e){let t="",n=[],r=Po({data:void 0,add_token:(o,i)=>{n.push(i),Sf.has(i)||(t+=" ")},end_token:()=>{let o=n.pop();o!==void 0&&!Sf.has(o)&&(t+=" ")},add_text:(o,i)=>{t+=i},set_attr:()=>{}});return Qe(r,gc(e)),Mr(r),t.replaceAll(Ea,"_").replace(/\s+/g," ").trim()}var kf=L.cssPrefix;function Et({tone:e="info",message:t,onRetry:n,strings:r}){return a("div",{class:`${kf}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${kf}-module-retry`,onClick:n,children:r.errorRetry}):null]})}var Ln=L.cssPrefix,$P=ee.scope("content"),DP=5e3;function Cf({id:e,title:t,transport:n,strings:r,bus:o,onBack:i,actions:s}){let[l,c]=$(null),[u,p]=$(!1),[_,d]=$(!1),[f,v]=$(0),[m,h]=$(null),y=F(()=>{d(!1),c(null),v(S=>S+1)},[]);U(()=>{let S=!1,g=n.listContentCollections([]).catch(()=>{});return Promise.all([n.listContent({ids:[e],limit:1}),g]).then(([b,k])=>{if(S)return;let N=b.items[0];N?(c(N),p(k?.items.find(I=>I.id===N.contentCollectionId)?.settings?.voteAccess==="portal"),o.emit("contentOpen",{contentId:e,contentCollectionId:N.contentCollectionId})):d(!0)}).catch(b=>{S||($P.warn("listContent (reader) failed",{err:b}),d(!0))}),()=>{S=!0}},[n,e,f,o]),U(()=>{if(!l)return;let S=setTimeout(()=>o.emit("contentRead",{contentId:e}),DP);return()=>clearTimeout(S)},[l,e,o]);let P=F(S=>{let b=(S.target instanceof HTMLElement?S.target.closest("a"):null)?.getAttribute("href")??"";b&&!b.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function x(S){h(e),n.setContentVote({contentId:e,value:S})}function C(){return _?a(Et,{tone:"error",message:r.errorGeneric,onRetry:y,strings:r}):l===null?a(Et,{message:r.contentLoading,strings:r}):a("article",{class:`${Ln}-content`,"data-testid":O.contentView,onClick:P,children:[l.image?a("img",{class:`${Ln}-content-hero`,src:l.image,alt:"",loading:"lazy"}):null,l.description?a("p",{class:`${Ln}-content-subtitle`,children:l.description}):null,a(Ma,{text:wf(l.content??"")}),u?a("div",{class:`${Ln}-content-vote`,"aria-live":"polite",children:m===e?r.feedbackThanks:a(pe,{children:[a("span",{children:r.contentHelpful}),a("button",{type:"button",class:`${Ln}-module-retry`,onClick:()=>x(1),children:r.confirmYes}),a("button",{type:"button",class:`${Ln}-module-retry`,onClick:()=>x(0),children:r.confirmNo})]})}):null]})}return a("div",{class:`${Ln}-module`,children:[a(yf,{title:l?.title||t||r.moduleBack,backLabel:r.moduleBack,onBack:i,actions:s,testid:O.backHeader}),a("div",{class:`${Ln}-module-scroll`,"data-testid":O.contentScroll,children:C()})]})}function Tf({itemCount:e,initialFocusIndex:t}){let[n,r]=$(!1),o=B(null),i=B(null),[s,l]=$(-1),c=F(()=>{r(!1),l(-1),o.current?.focus()},[]),u=F(()=>r(d=>!d),[]);U(()=>{if(!n)return;function d(f){let v=i.current,m=o.current;if(!v||!m)return;let h=f.composedPath();h.includes(v)||h.includes(m)||(r(!1),l(-1))}return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[n]),U(()=>{if(!n||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;l(f)},[n,e,t]),U(()=>{if(!n||s<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let p=F(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(!0))},[]),_=F(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),d.stopPropagation(),c();return;case"ArrowDown":d.preventDefault(),l(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),l(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),l(0);return;case"End":d.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:o,menuRef:i,toggle:u,close:c,onTriggerKey:p,onMenuKey:_}}function Rf({items:e,triggerLabel:t}){let n=L.cssPrefix,r=Tf({itemCount:e.length});function o(l){l.disabled||(l.onSelect?.(),l.keepOpen||r.close())}function i(l,c){return l.onSelectValue?.(c)}function s(l,c){let u=c.segments;if(!u?.length)return;let p=Math.max(0,u.findIndex(f=>f.value===c.value)),_=-1;if(l.key==="ArrowRight"||l.key==="Enter"||l.key===" ")_=(p+1)%u.length;else if(l.key==="ArrowLeft")_=(p-1+u.length)%u.length;else return;let d=u[_];d&&(l.preventDefault(),l.stopPropagation(),i(c,d.value))}return a("div",{class:`${n}-menu-wrap`,children:[a("button",{ref:r.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":r.open,title:t,onClick:r.toggle,onKeyDown:r.onTriggerKey,children:a(X_,{})}),r.open?a("div",{ref:r.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:r.onMenuKey,tabIndex:-1,children:e.map(l=>l.segments?a("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":l.label,tabIndex:-1,onKeyDown:c=>s(c,l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":l.label,children:l.segments.map(c=>{let u=c.value===l.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${n}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${O.langSegment}-${c.value}`,onClick:()=>i(l,c.value),children:c.label},c.value)})})]},l.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":l.type==="switch"?l.on:void 0,disabled:l.disabled,onClick:()=>o(l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),l.type==="switch"&&l.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(zr,{})}):null]},l.id))}):null]})}var mc=L.cssPrefix;function BP(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 UP={normal:"large",large:"small",small:"normal"};function zP(e){return e==="light"?a(lf,{}):e==="dark"?a(cf,{}):a(df,{})}function FP(e,t){let n=e.split("-")[0];return(t.some(o=>o!==e&&o.split("-")[0]===n)?e:n??e).toUpperCase()}function HP(e,t){let n;try{n=new URL(e,window.location.href)}catch{return}if(!(n.protocol!=="http:"&&n.protocol!=="https:"))return t.conversationId&&n.searchParams.set("chat",t.conversationId),n.searchParams.set("widgetId",t.widgetId),t.publicKey&&n.searchParams.set("public_key",t.publicKey),n.searchParams.set("ai_agent_deployment_id",t.aiAgentDeploymentId),n.href}function Jt({panelProps:e,variant:t,onEmailTranscript:n,onLogIn:r}){let{options:o,panelSize:i,feedback:s,onClose:l,onClear:c,onExpand:u,onFullscreen:p,onSoundToggle:_}=e,{onToggleHistory:d,onLocaleChange:f,onThemeChange:v,onTextSizeChange:m}=e,h=o.strings,y=o.mode,P=t==="chat",x=mt(()=>s.mutedSig.value).value,C=new Set(o.actions);function S(K){return C.has(K)}let g=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches;function b(K){return g?!1:Dr(K,y,i)}let k=o.themeMode,N={auto:h.themeAuto,light:h.themeLight,dark:h.themeDark},I=o.textSize,D={small:h.textSizeSmall,normal:h.textSizeNormal,large:h.textSizeLarge},A=[];if(P&&S("clear")&&A.push({id:"clear",icon:a(of,{}),label:h.newConversation,onSelect:c}),P&&n&&A.push({id:"emailTranscript",icon:a(Ca,{}),label:h.emailTranscript,onSelect:n}),P&&r&&A.push({id:"logIn",icon:a(dn,{}),label:h.loginAction,onSelect:r}),S("expand")&&b("expand")){let K=i==="expanded";A.push({id:"expand",icon:K?a(G_,{}):a(W_,{}),label:K?h.collapse:h.expand,type:"switch",on:K,onSelect:u})}if(S("fullscreen")&&b("fullscreen")){let K=i==="fullscreen";A.push({id:"fullscreen",icon:K?a(Q_,{}):a(K_,{}),label:K?h.exitFullscreen:h.fullscreen,type:"switch",on:K,onSelect:p})}let z=o.popOutUrl,j=o.aiAgentDeploymentId;S("popOut")&&z&&j&&Dr("popOut",y,i)&&A.push({id:"popOut",icon:a(Y_,{}),label:h.popOut,onSelect:()=>{let K=HP(z,{conversationId:e.conversationId,widgetId:o.widgetId,publicKey:o.publicKey,aiAgentDeploymentId:j});K&&window.open(K,"_blank","noopener,noreferrer")}}),P&&S("sound")&&A.push({id:"sound",icon:x?a(ef,{}):a(Z_,{}),label:x?h.soundOff:h.soundOn,type:"switch",on:!x,onSelect:_}),S("theme")&&k!=="host"&&A.push({id:"theme",icon:zP(k),label:`${h.theme}: ${N[k]}`,onSelect:()=>v(BP(k)),keepOpen:!0}),S("textSize")&&A.push({id:"textSize",icon:a(tf,{}),label:`${h.textSize}: ${D[I]}`,onSelect:()=>m(UP[I]),keepOpen:!0}),S("language")&&o.availableLocales.length>1&&A.push({id:"language",icon:a(rf,{}),label:h.language,segments:o.availableLocales.map(K=>({value:K,label:FP(K,o.availableLocales),lang:K})),value:o.locale,onSelectValue:f});let Y=!!l&&Pa(y,i,o.actions),ie=P&&S("history");return a("div",{class:`${mc}-header-actions`,children:[ie?a("button",{type:"button",class:`${mc}-icon-btn`,onClick:d,"aria-label":h.history,title:h.history,"data-testid":O.actionHistory,children:a(nf,{})}):null,A.length>0?a(Rf,{items:A,triggerLabel:h.moreActions}):null,Y?a("button",{type:"button",class:`${mc}-icon-btn`,onClick:l,"aria-label":h.close,title:h.close,"data-testid":O.actionClose,children:a(Ct,{})}):null]})}var Af={Icon:Uo};function un(e,t){return e instanceof Le?e.status===429?e.retryAfterSeconds?t.errorRateLimitedIn.replace("{seconds}",String(e.retryAfterSeconds)):t.errorRateLimited:e.code==="network"?t.errorOffline:e.status===403?t.errorOriginNotAllowed:e.errorCode==="MESSAGE_TOO_LONG"?t.errorMessageTooLong:e.status!==void 0&&e.status>=500?t.errorServer:t.errorGeneric:t.errorGeneric}var qr=L.cssPrefix;function If({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${qr}-home-search`,onClick:t,"data-testid":O.homeSearch,children:[a("span",{class:`${qr}-home-search-text`,children:e}),a("span",{class:`${qr}-home-search-icon`,"aria-hidden":"true",children:a(fc,{})})]})}function Ef({placeholder:e,value:t,onInput:n}){return a("div",{class:`${qr}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${qr}-home-search-input`,placeholder:e,value:t,maxLength:200,onInput:r=>n(r.currentTarget.value),"data-testid":O.helpSearch}),a("span",{class:`${qr}-home-search-icon`,"aria-hidden":"true",children:a(fc,{})})]})}var Ho=L.cssPrefix;function Oa({title:e,subtitle:t,onClick:n,testid:r}){return a("button",{type:"button",class:`${Ho}-list-row`,onClick:n,"data-testid":r,children:[a("span",{class:`${Ho}-list-row-body`,children:[a("span",{class:`${Ho}-list-row-title`,children:e}),t?a("span",{class:`${Ho}-list-row-sub`,children:t}):null]}),a("span",{class:`${Ho}-list-row-chevron`,"aria-hidden":"true",children:a(wa,{})})]})}var Xt=L.cssPrefix,qP=ee.scope("help"),jP=20,VP=300;function WP(e,t,n){let r=new Map(n.map(o=>[o.id,o.title]));return t.map(o=>({id:o,title:r.get(o),rows:e.filter(i=>i.contentCollectionId===o)})).filter(o=>o.rows.length>0)}function Mf({transport:e,strings:t,bus:n},r,o){let[i,s]=$(),l=B(void 0),c=r?.join(",");function u(p){if(!r?.length)return;let _={};l.current=_,s(d=>({search:o,items:[],collections:[],...d,pagination:p>1?d?.pagination:void 0,loading:!0,error:void 0})),Promise.all([e.listContent({contentCollectionIds:r,sortBy:"order",page:p,limit:jP,search:o}),p>1?void 0:e.listContentCollections(r)]).then(([d,f])=>{l.current===_&&(s(v=>({search:o,items:[...p>1?v?.items??[]:[],...d.items],collections:f?.items??v?.collections??[],pagination:d.pagination,loading:!1})),!(p>1)&&(o?n.emit("contentSearch",{queryLength:o.length,hitCount:d.pagination.total}):n.emit("contentView",{section:"help",count:d.items.length})))}).catch(d=>{l.current===_&&(qP.warn("listContent (help) failed",{err:d,page:p}),s(f=>f&&{...f,loading:!1,error:un(d,t)}))})}return U(()=>{if(!r?.length){s(void 0);return}return u(1),()=>{l.current=void 0}},[e,c,o]),[i,()=>!i?.loading&&u((i?.pagination?.page??0)+1)]}function GP(e){let{strings:t,config:n,nav:r,panelProps:o}=e,i=n.contentCollectionIds,[s,l]=$(""),[c,u]=$(""),p=Mf(e,i),_=Mf(e,c?i:void 0,c),[d,f]=s.trim()?_:p;U(()=>{let m=setTimeout(()=>u(s.trim()),VP);return()=>clearTimeout(m)},[s]);function v(){if(!i?.length)return a(Et,{message:t.helpEmpty,strings:t});let m=d?.error?a(Et,{tone:"error",message:d.error,onRetry:f,strings:t}):null;return m&&!d?.pagination?m:!d||!d.pagination&&!d.items.length?a(Et,{message:t.helpLoading,strings:t}):d.items.length?a(pe,{children:[WP(d.items,i,d.collections).map(h=>a("section",{class:`${Xt}-help-group`,children:[h.title?a("h2",{class:`${Xt}-help-section-title`,children:h.title}):null,a("div",{class:`${Xt}-help-card`,children:h.rows.map(y=>a(Oa,{title:y.title,subtitle:y.description,onClick:()=>y.url?No(y.url):r.push({kind:"content",id:y.id,title:y.title}),testid:ft(O.helpArticle,y.id)},y.id))})]},h.id)),m,d.pagination?.hasNext&&!m?a("div",{children:a("div",{class:`${Xt}-help-card`,children:a("button",{type:"button",class:`${Xt}-list-row ${Xt}-help-more`,onClick:f,"aria-busy":d.loading,children:[d.loading?a("span",{class:`${Xt}-loading-spinner`,"aria-hidden":"true"}):null,t.helpShowMore]})})}):null]}):a(Et,{message:d.search?t.helpSearchEmpty.replace("{query}",d.search):t.helpEmpty,strings:t})}return a("div",{class:`${Xt}-module`,children:[a(Ia,{title:t.helpTitle,actions:a(Jt,{panelProps:o,variant:"plain"})}),a("div",{class:`${Xt}-module-pad`,children:a(Ef,{placeholder:t.helpSearchPlaceholder,value:s,onInput:l})}),a("div",{class:`${Xt}-help-list`,children:v()})]})}var Lf={Icon:Bo,Root:e=>a(GP,{...e})};var Of=ee.scope("attachments");function Na(e,t,n){let r=QP(e),o=[],i=[],s=$f(n.accept),l=t.reduce((u,p)=>u+p.size,0),c=t.length;for(let u of r){let p=KP(u,c,l,n,s);if(p){i.push({file:u,reason:p});continue}o.push(ZP(u)),l+=u.size,c+=1}return(o.length||i.length)&&Of.debug("ingest",{accepted:o.length,rejected:i.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:i}}function jr(e){let t=Math.min(Math.floor(Math.log10(Math.max(e,1))/3),2);return new Intl.NumberFormat(void 0,{style:"unit",unit:["byte","kilobyte","megabyte"][t],unitDisplay:"narrow",maximumFractionDigits:1}).format(e/1e3**t)}function Nf(e,t){let n=$f(t);return!e||n.length===0||n.some(r=>r.kind==="ext"||Df(new File([],"",{type:e}),[r]))}function Vr(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Of.debug("revokeObjectURL failed",{error:t})}}function KP(e,t,n,r,o){return t>=r.maxCount?"count":n+e.size>r.maxBytes?"bytes":Df(e,o)?null:"mime"}function QP(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:YP(t)).filter(t=>t!==null):[]}function YP(e){let t=JP(e)?e:null;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function JP(e){return XP(e)&&(e.getAsFile===void 0||typeof e.getAsFile=="function")}function XP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ZP(e){return{file:e,id:Lt(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function $f(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",r="*"]=t.split("/");return{kind:"mime",type:n,subtype:r}})}function Df(e,t){if(t.length===0)return!0;let[n="*",r="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?o.endsWith(i.ext):i.type==="image"&&i.subtype==="*"&&/\.(heic|heif|avif|bmp|tif|tiff)$/.test(o)?!0:(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===r))}var On=L.cssPrefix,ex={error:Fr,done:zr};function Bf({attachment:e,upload:t,strings:n,onRemove:r,disabled:o=!1}){let i=/^image\/(jpeg|png|gif|webp|avif|bmp|x-ms-bmp|svg\+xml)$/i.test(e.mediaType),s=Math.round((t?.fraction??0)*100),l=jr(e.size),c=t?.status==="error"||t?.status==="done"?ex[t.status]:void 0;return a("span",{class:`${On}-attachment-chip`,"data-upload":t?.status,title:e.name,"data-testid":ft(O.attachmentChip,e.id),children:[i?a("img",{class:`${On}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${On}-attachment-thumb`,"aria-hidden":"true",children:a(Ta,{})}),a("span",{class:`${On}-attachment-text`,children:[a("span",{class:`${On}-attachment-name`,children:e.name}),a("span",{class:`${On}-attachment-meta`,children:[c?a(c,{}):null,t?.status==="uploading"?`${s}% \xB7 ${l}`:l]})]}),a("button",{type:"button",class:`${On}-attachment-remove`,onClick:r,disabled:o,"aria-label":n.removeAttachment.replace("{name}",e.name),"data-testid":ft(O.attachmentRemove,e.id),children:a(Ct,{})}),t?.status==="uploading"?a("span",{class:`${On}-attachment-progress`,role:"progressbar","aria-label":e.name,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":s,children:a("span",{style:{width:`${s}%`}})}):null]})}var Uf=new WeakMap;function $a(e){e.currentTarget&&Uf.set(e.currentTarget,e.timeStamp)}function Da(e){let t=e.currentTarget?Uf.get(e.currentTarget):void 0;return e.isComposing||t!==void 0&&e.timeStamp-t<100}var Ba=L.cssPrefix;function qo({text:e,retryLabel:t,onRetry:n,retryTestId:r}){return a("div",{class:`${Ba}-error`,role:"alert",children:[a("span",{class:`${Ba}-error-icon`,"aria-hidden":"true",children:a(Fr,{})}),a("span",{class:`${Ba}-error-text`,children:e}),n&&t?a("button",{type:"button",class:`${Ba}-error-retry`,onClick:n,"data-testid":r,children:t}):null]})}var hc={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function vc(e,t,n){return e==="disabled"?hc:e==="server"?ox(n):tx(t)}function tx(e){let t=nx();if(!t)return hc;let n=null,r=0;return{isSupported:!0,start(o,i){let s=n,l=++r;n=null,s?.abort();let c=new t;n=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",_=>{if(r!==l||n!==c)return;let d=_,f="",v=!1;for(let m=d.resultIndex;m<d.results.length;m++){let h=d.results[m];h&&(f+=h[0].transcript,h.isFinal&&(v=!0))}o(f,v)});function p(_){u||r!==l||n!==c||(u=!0,n=null,i(_))}c.addEventListener("end",()=>p(!1)),c.addEventListener("error",_=>p("error"in _&&(_.error==="not-allowed"||_.error==="service-not-allowed")));try{c.start()}catch{p(!1)}},stop(){n?.stop()},cancel(){r++;let o=n;n=null,o?.abort()}}}function nx(){return window.SpeechRecognition??window.webkitSpeechRecognition}var rx=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function ox(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return hc;let t=0,n=null;function r(s){for(let l of s.stream?.getTracks()??[])l.stop();s.stream=null}function o(){t++;let s=n;n=null,s&&(r(s),s.recorder?.state!=="inactive"&&s.recorder?.stop())}async function i(s){if(s.finishing)return;s.finishing=!0;let l=s.recorder?.mimeType??"audio/webm";r(s);let c=new Blob(s.chunks,{type:l});s.chunks=[];try{let{text:u}=await e(c,l);n===s&&t===s.generation&&u&&s.onText(u,!0)}catch{}finally{n===s&&t===s.generation&&(n=null,s.onEnd(!1))}}return{isSupported:!0,async start(s,l){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:s,onEnd:l,finishing:!1};n=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(n!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let p=ix(),_=new MediaRecorder(u,p?{mimeType:p}:void 0);c.recorder=_,_.addEventListener("dataavailable",d=>{n===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),_.addEventListener("stop",()=>{n===c&&t===c.generation&&i(c)}),_.start()}catch(u){r(c),n===c&&t===c.generation&&(n=null,l(u instanceof DOMException&&u.name==="NotAllowedError"))}},stop(){let s=n;if(s){if(!s.recorder){o();return}s.recorder.state!=="inactive"&&s.recorder.stop()}},cancel(){o()}}}function ix(){for(let e of rx)if(MediaRecorder.isTypeSupported(e))return e}function ax(e,{file:t,reason:n},r){return n==="count"?e.attachmentTooMany.replace("{count}",String(r.maxCount)):n==="bytes"?e.attachmentTooLarge.replace("{name}",t.name).replace("{max}",jr(r.maxBytes)):e.attachmentMimeRejected.replace("{name}",t.name)}var qe=L.cssPrefix,Wr=ee.scope("composer"),sx=300;function Gr(e){return e.reduce((t,n)=>t+n.size,0)}var bc={arrowUp:q_,paperPlane:H_,send:j_,chevron:wa};function zf(e){return"activeElement"in e}function lx(e){return"host"in e&&"activeElement"in e}function cx(e){return"clipboardData"in e}function Ff({options:e,transport:t,feedback:n,bus:r,persistence:o,conversationId:i,maxMessageCharacters:s,isStreaming:l,pageToolRunning:c=!1,isMemoryCompacting:u=!1,canReleaseQueuedMessages:p=!0,queueManualMessages:_=!1,replyAwaitsCard:d=!1,active:f=!0,isPreparing:v=!1,attachmentUploadsSig:m,operatorRequestEnabled:h,canRequestOperator:y=!1,controlMode:P="ai-agent",onRequestOperator:x,onSend:C,onStop:S,apiRef:g}){let b=e.strings,[k,N]=$(()=>o.loadDraft(i)),[I,D]=$([]),[A,z]=$(),[j,Y]=$(()=>o.loadMessageQueue(i).map(H=>({id:H.id,text:H.text,attachments:[]}))),ie=B(j),K=B(!1),Te=B(void 0),[Re,ye]=$(!1),[Oe,fe]=$(!1),[tt,ht]=$(!1),[nt,bt]=$(!1),Ee=B(!1),Ue=B(null),Rt=B(null),gt=B(null),ze=B(0),ae=B(i);ae.current=i;let ve=B(f);ve.current=f;let _e=B(v);_e.current=v;let be=nt||v||!f,Ce=l&&P==="ai-agent",ct=Ce||u&&P==="ai-agent",M=P==="ai-agent"&&(ct||_||j.length>0),R=F(H=>{Y(Q=>{let W=H(Q);return o.saveMessageQueue(ae.current,W.filter(ce=>ce.attachments.length===0).map(({id:ce,text:Me})=>({id:ce,text:Me}))),ie.current=W,W})},[o]),G=F(H=>{R(Q=>(Q.find(W=>W.id===H)?.attachments.forEach(Vr),Q.filter(W=>W.id!==H)))},[R]),V=F(H=>{N(Q=>{let W=(typeof H=="function"?H(Q):H).slice(0,s);return W===Q?Q:(o.saveDraft(ae.current,W),W)})},[o,s]),te=e.features.fileUpload,ge=e.features.voice,[le,me]=$(()=>vc(ge,e.locale,(H,Q)=>t.transcribe(H,Q))),Ye=B(le);Ye.current=le;let $e=B({mode:ge,locale:e.locale,transport:t});U(()=>{let H=$e.current;H.mode===ge&&H.locale===e.locale&&H.transport===t||($e.current={mode:ge,locale:e.locale,transport:t},ze.current++,Ye.current.cancel(),gt.current=null,fe(!1),me(vc(ge,e.locale,(Q,W)=>t.transcribe(Q,W))))},[e.locale,ge,t]),ut(()=>()=>{ze.current++,le.cancel()},[le]);let rt=F(H=>{let Q=gt.current;if(Q===null)return!1;let W=Math.round(performance.now()-Q);return Wr[H]("voiceStop",{durationMs:W}),r.emit("voiceStop",{durationMs:W}),gt.current=null,!0},[r]),Be=F(()=>{gt.current!==null&&(le.stop(),fe(!1),rt("info")&&n.play("voiceStop"))},[rt,n,le]),yt=F(()=>{ze.current++,le.cancel(),fe(!1),rt("info")&&n.play("voiceStop")},[rt,n,le]);U(()=>{(v||!f)&&yt()},[f,yt,v]),U(()=>{let H=Ue.current;if(!H)return;let Q=H.getRootNode(),W=zf(Q)?Q.activeElement:null;W&&H.closest(`.${qe}-panel`)?.contains(W)||H.focus({preventScroll:!0})},[]),U(()=>{let H=Ue.current;if(!H)return;if(k.length===0){H.style.height="";return}H.style.height="auto";let Q=getComputedStyle(H),W=Number.parseFloat(Q.getPropertyValue(`--${qe}-textarea-base-height`)),ce=Number.parseFloat(Q.borderTopWidth)+Number.parseFloat(Q.borderBottomWidth),Me=Math.min(H.scrollHeight+ce,Number.parseFloat(Q.maxHeight)),vt=Number.parseFloat(Q.fontSize)*.7;H.style.height=`${Me<W+vt?W:Me}px`},[k]);let Mt=B(I);Mt.current=I,U(()=>()=>{Mt.current.forEach(Vr);for(let H of ie.current)H.attachments.forEach(Vr)},[]),ut(()=>{if(g)return g.current={attachFromDrop:H=>{if(!te||!ve.current||Ee.current||_e.current)return;let Q=Na(H,Mt.current,e.attachments);z(Q.rejected[0]),Q.accepted.length!==0&&(Wr.info("attach (drop)",{count:Q.accepted.length,totalBytes:Gr(Q.accepted)}),r.emit("attach",{count:Q.accepted.length,totalBytes:Gr(Q.accepted)}),D(W=>[...W,...Q.accepted]))},fill:H=>{if(!ve.current||Ee.current||_e.current)return;V(H);let Q=Ue.current;Q&&(Q.focus({preventScroll:!0}),requestAnimationFrame(()=>Q.setSelectionRange(Q.value.length,Q.value.length)))},acceptQueuedMessage:G},()=>{g.current&&(g.current=null)}},[g,te,v,e.attachments,G,V]),U(()=>{let H=Ue.current;if(!H)return;let Q=H.closest(`.${qe}-panel`);if(!Q)return;let W=Me=>{if(!ve.current||Ee.current||_e.current)return;let vt=Me.clipboardData;if(!vt)return;let Zt=Me.target instanceof HTMLElement?Me.target.closest("input, textarea, [contenteditable]:not([contenteditable='false'])"):null;if(Zt&&Zt!==H)return;if(te){let At=Na(vt.items,Mt.current,e.attachments);if(z(At.rejected[0]),At.accepted.length>0){Me.preventDefault(),Wr.info("attach (paste)",{count:At.accepted.length,totalBytes:Gr(At.accepted)}),r.emit("attach",{count:At.accepted.length,totalBytes:Gr(At.accepted)}),D(ss=>[...ss,...At.accepted]);return}}if(Zt===H)return;let en=vt.getData("text/plain");en&&(Me.preventDefault(),V(At=>At+en),H.focus())};function ce(Me){cx(Me)&&W(Me)}return Q.addEventListener("paste",ce),()=>Q.removeEventListener("paste",ce)},[te,e.attachments,V]);async function Nt(){let H=k.trim();if(!H&&I.length===0||!f||Ce||Ee.current||v)return;yt(),Ee.current=!0,bt(!0);let Q=k,W=I;try{await C(H,W)&&(z(void 0),V(ce=>ce===Q?"":ce),D(ce=>ce!==W?ce:(W.forEach(Vr),Mt.current=[],[])))}finally{Ee.current=!1,bt(!1),requestAnimationFrame(()=>{let ce=Ue.current;if(!ce||ce.disabled||!ve.current)return;let Me=ce.getRootNode(),vt=zf(Me)?Me.activeElement:null,Zt=vt?.getAttribute("data-testid");if(!(vt&&vt!==ce&&Zt!==O.composerSend&&Zt!==O.composerStop)){if(lx(Me)){let en=Me.host.ownerDocument;if(!en.hasFocus())return;let At=en.activeElement;if(At&&At!==Me.host&&At!==en.body)return}ce.focus({preventScroll:!0})}})}}function ot(){let H=k.trim();if(!H&&I.length===0||!f||!M||Ee.current||v)return;yt();let Q=I;R(W=>[...W,{id:Lt(),text:H,attachments:Q}]),ct||ye(!0),V(""),D(W=>W!==Q?W:(Mt.current=[],[])),Ue.current?.focus({preventScroll:!0})}U(()=>{ct&&(K.current=!1,Te.current=void 0,ye(!1))},[ct]),U(()=>{let H=j[0];if(!H||!p||ct||K.current||nt||v||!f)return;let Q=d&&!Re?(Te.current??(Te.current=performance.now()+e.cardAnswerWaitSeconds*1e3))-performance.now():0,W=setTimeout(()=>{K.current=!0,C(H.text,H.attachments,H.id).then(ce=>{if(ce){G(H.id);return}K.current=!1})},Math.max(Q,sx));return()=>clearTimeout(W)},[f,p,Re,v,C,e.cardAnswerWaitSeconds,ct,j,G,d,nt]);function dt(H){H.key!=="Enter"||H.shiftKey||Da(H)||(H.preventDefault(),M&&(k.trim()||I.length>0)?ot():Ce?S():Nt())}function Ut(H){if(!(H.target instanceof HTMLInputElement))return;let Q=H.target;if(!f||Ee.current||v){Q.value="";return}let W=Na(Q.files,I,e.attachments);z(W.rejected[0]),W.accepted.length>0&&(Wr.info("attach (file picker)",{count:W.accepted.length,totalBytes:Gr(W.accepted)}),r.emit("attach",{count:W.accepted.length,totalBytes:Gr(W.accepted)}),D(ce=>[...ce,...W.accepted])),Q.value=""}function ur(H){!f||Ee.current||v||(Wr.info("removeAttachment",{id:H}),r.emit("removeAttachment",{id:H}),z(void 0),D(Q=>{let W=Q.find(ce=>ce.id===H);return W&&Vr(W),Q.filter(ce=>ce.id!==H)}))}function pr(){if(Oe){Be();return}if(!f||!le.isSupported||Ee.current||v)return;let H=++ze.current;gt.current=performance.now(),Wr.info("voiceStart"),r.emit("voiceStart",void 0),ht(!1),fe(!0),n.play("voiceStart"),le.start((Q,W)=>{ze.current!==H||!ve.current||_e.current||Ee.current||!W||V(ce=>`${ce}${Q} `)},Q=>{ze.current!==H||!ve.current||(fe(!1),ht(Q),rt("debug"))})}let $n=bc[e.composer.sendButton.icon],_r=!!(k.trim()||I.length>0),Dn=m?.value,ti=I.some(H=>Dn?.get(H.id)?.status==="uploading"),Bn=I.filter(H=>Dn?.get(H.id)?.status==="error"),fr=Bn.find(H=>Dn?.get(H.id)?.refusal),as=fr&&(Dn?.get(fr.id)?.refusal==="INVALID_FILE_TYPE"?b.attachmentMimeRejected:b.attachmentUploadFailed).replace("{name}",fr.name),ni=Ce||ti||c&&!_r;return a("div",{class:`${qe}-composer`,part:"composer","data-testid":O.composer,children:[j.length>0?a("div",{class:`${qe}-message-queue`,"aria-label":b.queueMessage,"data-testid":O.messageQueue,children:j.map(H=>a("div",{class:`${qe}-attachment-chip ${qe}-queued-message`,"data-testid":`${O.queuedMessage}-${H.id}`,children:[a("span",{class:`${qe}-attachment-name ${qe}-queued-text`,children:H.text||H.attachments.map(Q=>Q.name).join(", ")}),a("button",{type:"button",class:`${qe}-attachment-remove`,onClick:()=>G(H.id),"aria-label":b.removeQueuedMessage,title:b.removeQueuedMessage,"data-testid":`${O.queuedMessageRemove}-${H.id}`,children:a(Ct,{})})]},H.id))}):null,I.length>0?a("div",{class:`${qe}-attachments`,children:I.map(H=>a(Bf,{attachment:H,upload:Dn?.get(H.id),strings:b,onRemove:()=>ur(H.id),disabled:be},H.id))}):null,Bn.length>0&&!be?a(qo,{text:as??b.attachmentUploadFailed.replace("{name}",Bn.map(H=>H.name).join(", ")),retryLabel:b.errorRetry,onRetry:fr?void 0:()=>{Nt()},retryTestId:O.attachmentRetry}):null,A?a("p",{class:`${qe}-field-error`,role:"alert",children:ax(b,A,e.attachments)}):null,tt?a("p",{class:`${qe}-field-error`,role:"alert",children:b.micBlocked}):null,s!==void 0&&k.length>=s*.9?a("p",{class:`${qe}-field-${k.length<s?"hint":"error"}`,"data-testid":O.composerCount,children:`${k.length} / ${s}`}):null,a("div",{class:`${qe}-composer-row`,children:[a("div",{class:`${qe}-composer-actions`,children:[te?a("button",{type:"button",class:`${qe}-icon-btn`,onClick:()=>Rt.current?.click(),disabled:be,"aria-label":b.attach,title:b.attach,"data-testid":O.composerAttach,children:a(ka,{})}):null,le.isSupported?a("button",{type:"button",class:`${qe}-icon-btn`,onClick:pr,disabled:be,"aria-label":Oe?b.micStop:b.micStart,title:Oe?b.micStop:b.micStart,"aria-pressed":Oe,"data-recording":Oe?"true":void 0,"data-testid":O.composerVoice,children:a(V_,{})}):null,h&&P==="ai-agent"&&x?a("button",{type:"button",class:`${qe}-icon-btn`,onClick:x,disabled:be||!y,"aria-label":b.talkToOperator,title:b.talkToOperator,"data-testid":O.operatorRequest,children:a(dn,{})}):null]}),a("textarea",{ref:Ue,name:"message",class:`${qe}-textarea`,rows:1,value:k,maxLength:s,placeholder:b.composerPlaceholder,onInput:H=>V(H.currentTarget.value),onKeyDown:dt,onCompositionEnd:$a,disabled:be,"aria-label":b.composerPlaceholder,"data-testid":O.composerInput}),M&&_r?a("button",{type:"button",class:`${qe}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:ot,disabled:be,"aria-label":b.queueMessage,title:b.queueMessage,"data-testid":O.composerSend,children:a($n,{})}):null,ni?a("button",{type:"button",class:`${qe}-send`,onClick:S,disabled:be&&!ti,"aria-label":b.stop,"data-testid":O.composerStop,children:a(En,{})}):null,!ni&&(!M||!_r)?a("button",{type:"button",class:`${qe}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{Nt()},disabled:be||!k.trim()&&I.length===0,"aria-label":b.send,"data-testid":O.composerSend,children:a($n,{})}):null]}),a("input",{ref:Rt,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Ut,disabled:be,class:`${qe}-sr-only`,"data-testid":O.composerFileInput})]})}var Hf=L.cssPrefix;function Ua({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${Hf}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${Hf}-home-card`,"data-testid":n,children:t})}function za(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var Ht=L.cssPrefix,dx=ee.scope("news"),ux=10;function yc(e,t){let n=e?new Date(e):void 0;if(!(!n||Number.isNaN(n.getTime())))return new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(n)}function px({options:e,transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s,latestNews:l}){let c=r.contentCollectionIds,u=c?.join(","),[p,_]=$({items:[],loading:!0}),d=B(void 0);function f(y){if(!c?.length)return;let P={};d.current=P,_(x=>({...x,loading:!0,error:void 0})),t.listContent({contentCollectionIds:c,sortBy:"publishedAt",sortOrder:"desc",page:y,limit:ux}).then(x=>{if(d.current!==P||(_(S=>({items:y>1?[...S.items,...x.items]:x.items,pagination:x.pagination,loading:!1})),y>1))return;i.emit("contentView",{section:"news",count:x.items.length});let C=x.items[0];C&&l.markSeen(C.id)}).catch(x=>{d.current===P&&(dx.warn("listContent (news) failed",{err:x,page:y}),_(C=>({...C,loading:!1,error:un(x,n)})))})}function v(){p.loading||f((p.pagination?.page??0)+1)}U(()=>(_({items:[],loading:!0}),f(1),()=>{d.current=void 0}),[t,u]);function m(y){let P=yc(y.publishedAt,e.locale);return a("button",{type:"button",class:`${Ht}-news-card`,onClick:()=>o.push({kind:"content",id:y.id,title:y.title}),"data-testid":ft(O.newsItem,y.id),children:[y.image?a("img",{class:`${Ht}-news-hero`,src:y.image,alt:"",loading:"lazy"}):null,a("span",{class:`${Ht}-news-body`,children:[a("span",{class:`${Ht}-news-title`,children:y.title}),P||y.tags?.length?a("span",{class:`${Ht}-news-meta`,children:[P?a("time",{dateTime:y.publishedAt,children:P}):null,y.tags?.map(x=>a("span",{class:`${Ht}-news-tag`,children:x},x))]}):null,y.description?a("span",{class:`${Ht}-news-summary`,children:y.description}):null]})]},y.id)}function h(){if(!c?.length)return a(Et,{message:n.newsEmpty,strings:n});let y=p.error?a(Et,{tone:"error",message:p.error,onRetry:v,strings:n}):null;return y&&!p.pagination?y:p.pagination?p.items.length?a("div",{class:`${Ht}-news-list`,children:[p.items.map(m),y,p.pagination.hasNext&&!y?a("button",{type:"button",class:`${Ht}-news-more`,onClick:v,"aria-busy":p.loading,"data-testid":O.newsMore,children:[p.loading?a("span",{class:`${Ht}-loading-spinner`,"aria-hidden":"true"}):null,n.newsShowMore]}):null]}):a(Et,{message:n.newsEmpty,strings:n}):a(Et,{message:n.newsLoading,strings:n})}return a("div",{class:`${Ht}-module`,children:[a(Ia,{title:n.newsTitle,actions:a(Jt,{panelProps:s,variant:"plain"})}),a("div",{class:`${Ht}-module-scroll`,children:h()})]})}var qf={Icon:Ra,Root:e=>a(px,{...e})};var Pe=L.cssPrefix,jf=ee.scope("home");function _x(e){let t=e.options.userContext?.name,n=e.config.greetingText?at(e.strings,e.config.greetingText):void 0;if(n){let r=t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),o=e.strings.homeGreetingLead;return{title:r,subtitle:r.toLowerCase()===o.toLowerCase()?void 0:o}}return t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}function fx(e,t){return t.url?No(t.url):e.push({kind:"content",id:t.id,title:t.title})}function gx({options:e,onAsk:t}){let[n,r]=$(""),{sendButton:o}=e.composer,i=bc[o.icon];function s(l){l.preventDefault();let c=n.trim();c&&(r(""),t(c))}return a("form",{class:`${Pe}-home-search ${Pe}-home-ask`,"data-input":"true",onSubmit:s,"data-testid":O.homeAsk,children:[a("input",{type:"text",class:`${Pe}-home-search-input`,placeholder:e.strings.homeAskPlaceholder,"aria-label":e.strings.homeAskPlaceholder,value:n,enterKeyHint:"send",onInput:l=>r(l.currentTarget.value)}),a("button",{type:"submit",class:`${Pe}-send`,"data-shape":o.shape,"data-variant":o.variant,disabled:!n.trim(),"aria-label":e.strings.send,children:a(i,{})})]})}function Vf(e,t){return cn(e,t,t.type!=="upsert"||t.activity===!0)}function mx(e){let{transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s,latestNews:l}=e,[c,u]=$(null),[p,_]=$([]),d=r.contentCollectionIds?.join(","),f=e.options.modules.list.some(g=>g.layout==="chat");U(()=>{if(r.showRecentConversations===!1)return;let g=!1,b=!0,k=[],N=t.subscribeConversationChanges(I=>{b&&k.push(I),u(D=>Vf(D?[D]:[],I)[0]??null)});return t.listConversations({limit:f?50:1}).then(I=>{if(g)return;let D=k.reduce(Vf,I.conversations);k=[],b=!1,u(D[0]??null)}).catch(I=>{g||(k=[],b=!1,jf.warn("listConversations (home) failed",{err:I}))}),()=>{g=!0,N()}},[t,r.showRecentConversations,f]),U(()=>{if(!r.contentCollectionIds?.length)return;let g=!1;return t.listContent({contentCollectionIds:r.contentCollectionIds,pinned:!0,limit:6}).then(b=>{g||(_(b.items),i.emit("contentView",{section:"home",count:b.items.length}))}).catch(b=>!g&&jf.warn("listContent (home) failed",{err:b})),()=>{g=!0}},[t,d,i]);let v=_x(e),m=r.userAvatars??[],h=r.status,y=h?.text?at(n,h.text):n.homeStatus,P=h?.url,x=r.contentBlockTitle?at(n,r.contentBlockTitle):n.homeContentTitle,C=l.item,S=yc(C?.publishedAt,e.options.locale);return a("div",{class:`${Pe}-module ${Pe}-home`,"data-testid":O.homeView,children:a("div",{class:`${Pe}-home-scroll`,children:[a("div",{class:`${Pe}-home-hero`,children:[a("div",{class:`${Pe}-home-hero-top`,children:[r.brandName?a("span",{class:`${Pe}-home-brand`,"data-testid":O.homeBrand,children:r.brandName}):a("span",{class:`${Pe}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${Pe}-home-hero-actions`,children:[m.length>0?a("div",{class:`${Pe}-home-avatars`,children:m.map(g=>a("span",{class:`${Pe}-home-avatar`,title:g.role?`${g.name} \xB7 ${g.role}`:g.name,children:g.avatar?a("img",{src:g.avatar,alt:"",loading:"lazy"}):a("span",{children:za(g.name)})},g.name))}):null,a(Jt,{panelProps:s,variant:"plain"})]})]}),r.showGreeting!==!1?a(pe,{children:[a("h1",{class:`${Pe}-home-greeting`,"data-testid":O.homeGreeting,children:v.title}),v.subtitle?a("p",{class:`${Pe}-home-lead`,children:v.subtitle}):null]}):null]}),a("div",{class:`${Pe}-home-cards`,children:[f?a(gx,{options:e.options,onAsk:g=>o.startNewConversation(g)}):null,r.showSearchBar!==!1?a(If,{placeholder:n.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,C?a(Ua,{onClick:()=>{l.markSeen(C.id),o.push({kind:"content",id:C.id,title:C.title})},testid:O.homeWhatsNew,children:a("div",{class:`${Pe}-home-recent-row`,"data-unread":l.unseen?"true":void 0,children:[a("span",{class:`${Pe}-home-recent-avatar`,"aria-hidden":"true",children:a(Ra,{})}),a("span",{class:`${Pe}-home-recent-body`,children:[a("span",{class:`${Pe}-home-recent-title`,children:n.homeWhatsNew}),a("span",{class:`${Pe}-home-recent-preview`,children:S?`${C.title} \xB7 ${S}`:C.title})]}),l.unseen?a("span",{class:`${Pe}-home-recent-dot`,role:"img","aria-label":n.newsUnseen}):null]})}):null,c?a(Ua,{onClick:()=>o.selectConversation(c),testid:O.homeRecent,children:a("div",{class:`${Pe}-home-recent-row`,"data-unread":c.hasUnread?"true":void 0,children:[a("span",{class:`${Pe}-home-recent-avatar`,"aria-hidden":"true",children:a(Uo,{})}),a("span",{class:`${Pe}-home-recent-body`,children:[a("span",{class:`${Pe}-home-recent-title`,children:c.title}),c.preview?a("span",{class:`${Pe}-home-recent-preview`,children:La(c.preview)}):null]}),c.hasUnread?a("span",{class:`${Pe}-home-recent-dot`,role:"img","aria-label":n.unread}):null]})}):null,h?a(Ua,{onClick:P?()=>No(P):void 0,children:a("div",{class:`${Pe}-home-status`,"data-level":h.level??"operational",children:[a("span",{class:`${Pe}-home-status-icon`,"aria-hidden":"true",children:a(af,{})}),a("span",{class:`${Pe}-home-status-text`,children:y})]})}):null,p.length>0?a("section",{class:`${Pe}-home-content`,children:[a("div",{class:`${Pe}-home-content-title`,children:x}),a("div",{class:`${Pe}-home-content-list`,children:p.map(g=>a(Oa,{title:g.title,subtitle:g.description,onClick:()=>fx(o,g),testid:ft(O.homeContentRow,g.id)},g.id))})]}):null]})]})})}var Wf={Icon:sf,Root:e=>a(mx,{...e})};var Fa={chat:Af,home:Wf,help:Lf,news:qf};var jo=L.cssPrefix;function Gf({modules:e,activeTab:t,strings:n,hasUnread:r,onSelect:o}){return a("nav",{class:`${jo}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let s=Fa[i.layout].Icon,l=i.id===t,c=i.layout==="chat"&&r;return a("button",{type:"button",role:"tab","aria-selected":l,class:`${jo}-tab`,onClick:()=>o(i.id),"data-testid":ft(O.tab,i.id),children:[a("span",{class:`${jo}-tab-icon`,children:[a(s,{}),c?a("span",{class:`${jo}-tab-badge`,"data-testid":O.tabBadge,role:"img","aria-label":n.unread}):null]}),a("span",{class:`${jo}-tab-label`,children:at(n,i.label)})]},i.id)})})}var Vo=L.cssPrefix;function Kf({agent:e,strings:t,ticketReference:n,person:r=!1}){let o=e.status??"online",i=at(t,e.name),s=e.title?at(t,e.title):null,l=r?a(dn,{}):a("span",{children:za(i)});return a("div",{class:`${Vo}-agent`,children:[a("div",{class:`${Vo}-agent-avatar`,"data-status":o,children:e.avatar?a("img",{src:e.avatar,alt:""}):l}),a("div",{class:`${Vo}-agent-meta`,children:[a("strong",{children:i}),s||n?a("div",{class:`${Vo}-agent-sub`,children:[n?a(hx,{reference:n,strings:t}):null,s?a("span",{children:s}):null]}):null]})]})}function hx({reference:e,strings:t}){let[n,r]=$(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})}return a("button",{type:"button",class:`${Vo}-agent-ticket`,onClick:o,title:t.copy,"aria-label":n?t.copied:t.copyTicketReference.replace("{reference}",e),children:n?t.copied:e})}var vx=["today","yesterday","lastWeek","older"];function bx(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let r=Math.round((Qf(e)-Qf(n))/(1440*60*1e3));return r<=0?"today":r===1?"yesterday":r<7?"lastWeek":"older"}function Yf(e,t){let n=new Map;for(let r of t){let o=bx(e,r.lastMessageAt),i=n.get(o);i?i.push(r):n.set(o,[r])}return vx.flatMap(r=>{let o=n.get(r);return o?[{bucket:r,conversations:o}]:[]})}function Qf(e){return new Date(e).setHours(0,0,0,0)}var Jf=ee.scope("history"),yx=3,Px=6,xx={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Xf(e,t){let n=t.type!=="upsert"||t.activity===!0;if(t.type==="snapshot"&&t.result.pagination.page===1&&e.pagination.page>1){let o=cn(e.conversations.slice(0,t.result.pagination.limit),t,n);if(t.result.conversations.length===0){if(o.length===0)return t.result;let u=Math.max(t.result.pagination.total,o.length);return{...t.result,conversations:o,pagination:{...t.result.pagination,total:u,totalPages:Math.ceil(u/t.result.pagination.limit)}}}let i=new Set(o.map(u=>u.conversationId)),s=e.conversations.slice(t.result.pagination.limit).filter(u=>!i.has(u.conversationId)),l=e.pagination.page,c={...t.result.pagination,page:l,hasPrev:l>1,hasNext:l<t.result.pagination.totalPages};return{conversations:[...o,...s],pagination:c}}let r=cn(e.conversations,t,n);return r===e.conversations?e:{...t.type==="snapshot"?t.result:e,conversations:r}}function Sx(e,t,n){let r=Date.parse(e);return Number.isFinite(r)?new Date(r).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(r):t-r<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(r):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(r):""}function Ha({transport:e,strings:t,locale:n,persistence:r,onSelect:o,onNewConversation:i}){let s=L.cssPrefix,l=e.peekConversations({limit:50}),[c,u]=$(l?"loaded":"loading"),[p,_]=$(0),[d,f]=$(l),[v,m]=$(!1),h=B(void 0),y=d?.conversations??[],P=d?.pagination;U(()=>{let b=!1,k=!0,N=[],I=e.subscribeConversationChanges(A=>{k&&N.push(A),f(z=>z&&Xf(z,A))});h.current=void 0,m(!1);let D=e.peekConversations({limit:50});return f(D),u(D?"loaded":"loading"),e.listConversations({limit:50}).then(A=>{if(b)return;let z=A;for(let j of N)z=Xf(z,j);N=[],k=!1,f(z),u("loaded"),r.saveHistoryCount(z.conversations.length)}).catch(A=>{b||(N=[],k=!1,Jf.warn("listConversations failed",{err:A}),u({failure:un(A,t)}))}),()=>{b=!0,I(),h.current=void 0}},[e,r,n,p]);async function x(){if(h.current||!P?.hasNext)return;let b={};h.current=b,m(!0);try{let k=await e.listConversations({page:P.page+1,limit:P.limit});if(h.current!==b)return;f(N=>{if(!N)return N;let I=new Set(N.conversations.map(z=>z.conversationId)),D=k.conversations.filter(z=>I.has(z.conversationId)?!1:(I.add(z.conversationId),!0)),A={conversations:[...N.conversations,...D],pagination:k.pagination};return r.saveHistoryCount(A.conversations.length),A})}catch(k){if(h.current!==b)return;Jf.warn("listConversations page failed",{err:k,page:P.page+1})}finally{h.current===b&&(h.current=void 0,m(!1))}}let C=i?a("div",{class:`${s}-history-footer`,children:a("button",{type:"button",class:`${s}-history-new`,onClick:i,"data-testid":O.sidebarNewConversation,children:[a(F_,{}),t.newConversation]})}):null;if(c==="loading"){let b=Math.min(r.loadHistoryCount()??yx,Px);return a(pe,{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,b)},(k,N)=>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`})})})]})]},N))})]})}),C]})}if(typeof c=="object")return a(pe,{children:[a(Et,{tone:"error",message:c.failure,onRetry:()=>_(b=>b+1),strings:t}),C]});if(y.length===0)return a(pe,{children:[a("div",{class:`${s}-history-empty`,children:t.historyEmpty}),C]});let S=Date.now(),g=Yf(S,y);return a(pe,{children:[a("div",{class:`${s}-history`,role:"list",children:[g.map(b=>a("div",{class:`${s}-history-group`,children:[a("div",{class:`${s}-history-heading`,children:t[xx[b.bucket]]}),a("div",{class:`${s}-history-card`,children:b.conversations.map(k=>a("div",{role:"listitem",children:a("button",{type:"button",class:`${s}-history-item`,onClick:()=>o(k),"data-unread":k.hasUnread?"true":void 0,"data-testid":ft(O.historyItem,k.conversationId),children:[a("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:a(_c,{})}),a("span",{class:`${s}-history-body`,children:[a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-title`,children:k.title}),a("span",{class:`${s}-history-time`,children:[k.ticketReference&&`${k.ticketReference} \xB7 `,Sx(k.lastMessageAt,S,n)]})]}),a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-preview`,children:k.preview&&La(k.preview)||t.historyContinue}),k.hasUnread?a("span",{class:`${s}-history-dot`,role:"img","aria-label":t.unread}):null]})]})]})},k.conversationId))})]},b.bucket)),P?.hasNext?a("div",{class:`${s}-history-more`,children:a("button",{type:"button",onClick:x,disabled:v,"aria-busy":v,"data-testid":O.historyLoadMore,children:t.loadMoreConversations})}):null]}),C]})}var Zf=L.cssPrefix;function eg({state:e,strings:t}){return e?a("div",{class:`${Zf}-dropzone`,"data-state":e,role:"status","aria-live":"polite",children:[a("span",{class:`${Zf}-dropzone-icon`,"aria-hidden":"true",children:e==="reject"?a(Fr,{}):a(ka,{})}),e==="reject"?t.dropZoneRejected:t.dropZone]}):null}var Pc=new RegExp(String.raw`^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$`),wx=/^[+]?[\d\s().-]{6,}$/;function kx(e,t,n){let r=Array.isArray(t)?t.join(""):t?.trim()??"";if(!r)return e.required?n.formRequired:void 0;if(e.type==="email"&&!Pc.test(r))return n.formInvalidEmail;if(e.type==="tel"&&!wx.test(r))return n.formInvalidTel;if(e.type==="number"&&!Number.isFinite(Number(r)))return n.formInvalidNumber}function tg(e,t,n){return Object.fromEntries(e.flatMap(r=>{let o=kx(r,t[r.name],n);return o?[[r.name,o]]:[]}))}var st=L.cssPrefix;function ng(e){return e.tokenEmail||e.userContext?.email?.trim()}function Cx(e,t){let n=e instanceof Le?e.status:void 0;return n===400?t.formInvalidEmail:n===409?t.emailTranscriptAlreadySent:n===422?t.emailTranscriptNotDelivered:n===429?t.emailTranscriptLimited:t.emailTranscriptFailed}function Tx(e){return"host"in e&&"activeElement"in e}function rg({transport:e,strings:t,knownEmail:n,onClose:r}){let[o,i]=$(n??""),[s,l]=$(!1),[c,u]=$({status:"idle"}),p=B(null),_=_o(),d=`${_}-title`,f=`${_}-error`,v=c.status==="sending",m=c.status==="sent";ut(()=>{let P=p.current;if(!P)return;let x=P.getRootNode(),C=Tx(x)?x.activeElement:null,S=Hr(P);return()=>{S(),C instanceof HTMLElement&&C.isConnected&&C.focus({preventScroll:!0})}},[]),ut(()=>{p.current?.querySelector("[data-autofocus]")?.focus({preventScroll:!0})},[m]);async function h(P){if(P.preventDefault(),v)return;let x=o.trim();if(!Pc.test(x)){l(!0),p.current?.querySelector("input")?.focus();return}l(!1),u({status:"sending"});let C=await e.emailTranscript(x).then(S=>({status:"sent",to:S.to}),S=>({status:"failed",message:Cx(S,t)}));u(C)}function y(P){P.key==="Tab"&&P.stopPropagation(),P.key==="Escape"&&(P.stopPropagation(),r())}return a("div",{class:`${st}-transcript-layer`,children:[a("div",{class:`${st}-transcript-backdrop`,"aria-hidden":"true",onClick:r}),a("section",{ref:p,class:`${st}-transcript-sheet`,role:"dialog","aria-modal":"true","aria-labelledby":d,onKeyDown:y,"data-testid":O.emailTranscriptSheet,children:[a("header",{class:`${st}-transcript-sheet-head`,children:[a("span",{class:`${st}-transcript-sheet-icon`,children:a(Ca,{})}),a("h2",{id:d,class:`${st}-transcript-sheet-title`,children:t.emailTranscript}),a("button",{type:"button",class:`${st}-icon-btn`,onClick:r,"aria-label":t.emailTranscriptCancel,title:t.emailTranscriptCancel,children:a(Ct,{})})]}),c.status==="sent"?a(pe,{children:[a("p",{class:`${st}-transcript-sheet-text ${st}-transcript-sheet-sent`,role:"status",children:[a(sr,{}),a("span",{children:t.emailTranscriptSent.replace("{email}",c.to)})]}),a("button",{type:"button",class:`${st}-form-submit ${st}-transcript-sheet-action`,onClick:r,"data-autofocus":!0,children:t.emailTranscriptDone})]}):a("form",{class:`${st}-transcript-sheet-form`,onSubmit:P=>{h(P)},noValidate:!0,children:[a("p",{class:`${st}-transcript-sheet-text`,children:t.emailTranscriptPrompt}),a("label",{class:`${st}-field`,"data-invalid":s?"true":void 0,children:[a("span",{class:`${st}-field-label`,children:t.emailTranscriptEmailLabel}),a("input",{class:`${st}-field-input`,type:"email",name:"email",autocomplete:"email",inputMode:"email",autocapitalize:"off",spellcheck:!1,value:o,readOnly:v,"aria-invalid":s,"aria-describedby":s?f:void 0,onInput:P=>{i(P.currentTarget.value),l(!1)},"data-autofocus":!0,"data-testid":O.emailTranscriptEmail}),s?a("span",{id:f,class:`${st}-field-error`,role:"alert",children:t.formInvalidEmail}):null]}),a("button",{type:"submit",class:`${st}-form-submit ${st}-transcript-sheet-action`,disabled:v,"aria-busy":v,"data-testid":O.emailTranscriptSend,children:v?t.emailTranscriptSending:t.emailTranscriptSend}),c.status==="failed"?a("p",{class:`${st}-field-error`,role:"alert",children:c.message}):null]})]})]})}var og=Object.assign;function Ix(e,t){for(var n in e)if(n!="__source"&&e[n]!==t[n])return!0;for(var r in t)if(r!="__source"&&!(r in e))return!0;return!1}var Ex=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini|asp|fill|st)/;function sg(e,t){function n(o){var i=this.props.ref;return i!=o.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,o)||i!=o.ref:Ix(this.props,o)}function r(o){return this.shouldComponentUpdate=n,xn(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.type=e,r}var Mx=Symbol.for("react.element"),Lx=/^(?: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]/,Ox=/[A-Z0-9]/g,Nx=typeof document<"u";var $x=function(e){return/fil|che|rad/.test(e)};zt.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(zt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ig=he.event;he.event=function(e){return ig&&(e=ig(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Dx={configurable:!0,get:function(){return this.class}},ag=he.vnode;he.vnode=function(e){if(typeof e.type=="string")(function(r){var o=r.props,i=r.type,s={},l=i.indexOf("-")==-1;for(var c in o){var u=o[c];if(!(c=="value"&&"defaultValue"in o&&u==null||Nx&&c=="children"&&i=="noscript"||c=="class"||c=="className")){if(c=="style"&&u&&u.constructor==Object){var p=void 0;for(var _ in u)typeof u[_]!="number"||Ex.test(_)||(p||(p=u=og({},u)),u[_]+="px")}else if(c=="defaultValue"&&"value"in o&&o.value==null)c="value";else if(c=="download"&&u===!0)u="";else if(c=="translate"&&u==="no")u=!1;else if(c[0]=="o"&&c[1]=="n"){var d=c.toLowerCase();d=="ondoubleclick"?c="ondblclick":d!="onchange"||i!="input"&&i!="textarea"||$x(o.type)?d=="onfocus"?c="onfocusin":d=="onblur"&&(c="onfocusout"):d=c="oninput",d=="oninput"&&s[c=d]&&(c="oninputCapture")}else l&&Lx.test(c)?c=c.replace(Ox,"-$&").toLowerCase():u===null&&(u=void 0);s[c]=u}}if(i=="select"){var f=s.defaultValue!=null?s.defaultValue:s.multiple&&Array.isArray(s.value)?s.value:null;f!=null&&(s.value=tl(o.children).forEach(function(v){v.props.selected=s.multiple?f.indexOf(v.props.value)!=-1:f==v.props.value}))}o.class&&!o.className?(s.class=o.class,Object.defineProperty(s,"className",Dx)):o.className&&(s.class=s.className=o.className),r.props=s})(e);else if(typeof e.type=="function"&&("ref"in e.props&&"prototype"in e.type&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=og({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.ref&&!("ref"in e.props)&&Object.defineProperty(e.props,"ref",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=Mx,ag&&ag(e)};var qa=L.cssPrefix;function lg({messageId:e,initial:t,strings:n,onFeedback:r}){let[o,i]=$(t);U(()=>i(t),[e,t]);function s(l){let c=o===l?null:l;i(c),r(e,c)}return a("div",{class:`${qa}-feedback`,role:"group","data-testid":O.messageFeedback,children:[a("button",{type:"button",class:`${qa}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>s("up"),"data-testid":O.feedbackUp,children:a(pf,{})}),a("button",{type:"button",class:`${qa}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>s("down"),"data-testid":O.feedbackDown,children:a(_f,{})}),a("span",{class:`${qa}-sr-only`,role:"status","aria-live":"polite",children:o?n.feedbackThanks:""})]})}function cg(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function dg(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function Bx(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function ug(e){let{streaming:t,reasoningVisible:n,emptyReply:r,hidden:o}=e,i=e.responseMode==="buffered"&&t,s=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:i,reasoningVisible:n,working:s,showStreamDots:Bx({streaming:t,bufferedHold:i,reasoningVisible:n,working:s}),emptyReply:r,hidden:o}}var Kr=L.cssPrefix;function pg({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${Kr}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":O.source,children:[a("span",{class:`${Kr}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${Kr}-source-label`,children:n})]}):a("span",{class:`${Kr}-source`,"data-testid":O.source,children:[a("span",{class:`${Kr}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${Kr}-source-label`,children:n})]})}var Bt=L.cssPrefix;function gg(e){return{toolCallId:e.toolCallId,toolName:e.toolName,...e.title?{title:e.title}:{},state:e.stateSig.value,input:e.inputSig.value,output:e.outputSig.value,...e.errorSig.value?{errorText:e.errorSig.value}:{},...e.approvalSig.value?{approval:e.approvalSig.value}:{},...e.toolMetadata?{toolMetadata:e.toolMetadata}:{}}}function mg(e,t){if(t?.replacedByMessageId)return{terminal:!1,responded:!1,decided:!1};let n=e==="output-available"||e==="output-error"||e==="output-denied",r=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:r,decided:n||r}}function ja({status:e,label:t,icon:n}){return a("span",{class:`${Bt}-toolui-badge ${Bt}-toolui-status`,"data-status":e,children:[a("span",{class:`${Bt}-toolui-status-icon`,children:n??a(xc,{status:e})}),t]})}function xc({status:e}){return e==="running"?a("span",{class:`${Bt}-loading-spinner`}):e==="stopped"?a(En,{}):e==="waiting"||e==="submitted"?a(gf,{}):e==="failed"||e==="declined"||e==="replaced"?a(zo,{}):a(sr,{})}function Wo({decision:e}){return a("span",{class:`${Bt}-steps-decision`,"data-approved":e.approved?"true":"false",title:e.title,children:[e.approved?a(sr,{}):a(zo,{}),e.label]})}function Va({view:e,strings:t}){let n=e.raw;return a(pe,{children:[e.error?a("p",{class:`${Bt}-steps-row-error`,children:e.error}):null,e.fields.length>0?a(_g,{fields:e.fields,label:e.tables?t.stepInput:void 0,plain:!e.tables}):null,e.resultFields?a(_g,{fields:e.resultFields,label:t.toolResult}):null,n?.input||n?.output?a("details",{class:`${Bt}-toolui-raw`,open:!e.tables,children:[a("summary",{children:t.stepRawData}),n.input?a(fg,{label:t.stepInput,text:n.input}):null,n.output?a(fg,{label:t.toolResult,text:n.output}):null]}):null]})}function _g({fields:e,label:t,plain:n=!1}){let r=a("div",{class:`${Bt}-toolui-fields`,"data-plain":n?"true":void 0,children:a("table",{children:a("tbody",{children:e.map(({label:o,value:i},s)=>a("tr",{children:[a("th",{scope:"row",children:o}),a("td",{children:i})]},`${o}#${s}`))})})});return t?a("div",{class:`${Bt}-toolui-section`,children:[a("span",{class:`${Bt}-toolui-label`,children:t}),r]}):r}function fg({label:e,text:t}){return a("div",{class:`${Bt}-toolui-section`,children:[a("span",{class:`${Bt}-toolui-label`,children:e}),a("pre",{class:`${Bt}-toolui-code`,children:t})]})}var Tt=L.cssPrefix;function hg({part:e,view:t,strings:n,locale:r,canAct:o,onDecision:i,onEdit:s,preview:l}){let c=t.approval,u=t.status==="waiting"||t.status==="submitted"||t.status==="approved",p=e.toolCallId;return a("details",{class:`${Tt}-toolui ${Tt}-toolui-collapsible`,open:u||c?.buttons==="change"||void 0,"data-testid":t.status==="waiting"?O.toolApproval:O.toolDecision,"data-status":t.status,children:[a("summary",{class:`${Tt}-toolui-head`,children:[a("span",{class:`${Tt}-toolui-prompt`,children:u&&c?c.ask:t.name}),t.system?a("span",{class:`${Tt}-toolui-system`,children:t.system}):null,a("span",{class:`${Tt}-toolui-head-end`,children:[t.decision?a(Wo,{decision:t.decision}):null,t.statusLabel?a(ja,{status:t.status,label:t.statusLabel}):null,a("span",{class:`${Tt}-toolui-chevron`,children:a(Wt,{})})]})]}),a("div",{class:`${Tt}-toolui-collapse-body`,children:[u&&l&&Wn(e.toolMetadata)?a(zx,{toolName:e.toolName,input:e.inputSig.value,preview:l,strings:n,locale:r}):null,a(Va,{view:t,strings:n}),c?.note?a("p",{class:`${Tt}-toolui-subtle`,children:c.note}):null,c?.buttons==="decide"?a("div",{class:`${Tt}-toolui-actions`,children:[a("button",{type:"button",class:`${Tt}-form-skip`,disabled:!o,onClick:()=>i(p,!1),"data-testid":O.toolDecline,children:n.decline}),a("button",{type:"button",class:`${Tt}-form-submit`,disabled:!o,onClick:()=>i(p,!0),"data-testid":O.toolApprove,children:n.approve})]}):null,c?.buttons==="change"?a("div",{class:`${Tt}-toolui-actions`,children:a("button",{type:"button",class:`${Tt}-form-skip`,onClick:()=>s(p),"data-testid":O.toolEdit,children:n.changeAnswer})}):null]})]})}function Ux(e){if(!(typeof e!="object"||e===null)&&"totals"in e)return"number"in e&&"items"in e?`root = Root([preview])
|
|
70
|
+
${n}`:"")})}var LP=new Set(["http:","https:","mailto:","tel:"]),OP=new Set(["http:","https:"]);function NP(e){let t=document.createElement("a");return{...e,set_attr:(n,r,o)=>{if(r!==Er&&r!==bo||(t.href=o,(r===Er?LP:OP).has(t.protocol)))return e.set_attr(n,r,o);let i=r===bo?n.nodes[n.index]:void 0;i?.replaceWith(...i.childNodes)}}}function Sf(e){for(let t of e.querySelectorAll("a")){let n=t.getAttribute("href")??"";!n||n.startsWith("#")||(t.target="_blank",t.rel="noopener noreferrer")}}var wf=new Set([11,12,13,14,15,16,17,18,19,31]);function La(e){let t="",n=[],r=Po({data:void 0,add_token:(o,i)=>{n.push(i),wf.has(i)||(t+=" ")},end_token:()=>{let o=n.pop();o!==void 0&&!wf.has(o)&&(t+=" ")},add_text:(o,i)=>{t+=i},set_attr:()=>{}});return Qe(r,gc(e)),Mr(r),t.replaceAll(Ea,"_").replace(/\s+/g," ").trim()}var Cf=L.cssPrefix;function Et({tone:e="info",message:t,onRetry:n,strings:r}){return a("div",{class:`${Cf}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${Cf}-module-retry`,onClick:n,children:r.errorRetry}):null]})}var Ln=L.cssPrefix,$P=ee.scope("content"),DP=5e3;function Tf({id:e,title:t,transport:n,strings:r,bus:o,onBack:i,actions:s}){let[l,c]=$(null),[u,p]=$(!1),[_,d]=$(!1),[f,v]=$(0),[m,h]=$(null),y=F(()=>{d(!1),c(null),v(S=>S+1)},[]);U(()=>{let S=!1,g=n.listContentCollections([]).catch(()=>{});return Promise.all([n.listContent({ids:[e],limit:1}),g]).then(([b,k])=>{if(S)return;let N=b.items[0];N?(c(N),p(k?.items.find(I=>I.id===N.contentCollectionId)?.settings?.voteAccess==="portal"),o.emit("contentOpen",{contentId:e,contentCollectionId:N.contentCollectionId})):d(!0)}).catch(b=>{S||($P.warn("listContent (reader) failed",{err:b}),d(!0))}),()=>{S=!0}},[n,e,f,o]),U(()=>{if(!l)return;let S=setTimeout(()=>o.emit("contentRead",{contentId:e}),DP);return()=>clearTimeout(S)},[l,e,o]);let P=F(S=>{let b=(S.target instanceof HTMLElement?S.target.closest("a"):null)?.getAttribute("href")??"";b&&!b.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function x(S){h(e),n.setContentVote({contentId:e,value:S})}function C(){return _?a(Et,{tone:"error",message:r.errorGeneric,onRetry:y,strings:r}):l===null?a(Et,{message:r.contentLoading,strings:r}):a("article",{class:`${Ln}-content`,"data-testid":O.contentView,onClick:P,children:[l.image?a("img",{class:`${Ln}-content-hero`,src:l.image,alt:"",loading:"lazy"}):null,l.description?a("p",{class:`${Ln}-content-subtitle`,children:l.description}):null,a(Ma,{text:kf(l.content??"")}),u?a("div",{class:`${Ln}-content-vote`,"aria-live":"polite",children:m===e?r.feedbackThanks:a(pe,{children:[a("span",{children:r.contentHelpful}),a("button",{type:"button",class:`${Ln}-module-retry`,onClick:()=>x(1),children:r.confirmYes}),a("button",{type:"button",class:`${Ln}-module-retry`,onClick:()=>x(0),children:r.confirmNo})]})}):null]})}return a("div",{class:`${Ln}-module`,children:[a(Pf,{title:l?.title||t||r.moduleBack,backLabel:r.moduleBack,onBack:i,actions:s,testid:O.backHeader}),a("div",{class:`${Ln}-module-scroll`,"data-testid":O.contentScroll,children:C()})]})}function Rf({itemCount:e,initialFocusIndex:t}){let[n,r]=$(!1),o=B(null),i=B(null),[s,l]=$(-1),c=F(()=>{r(!1),l(-1),o.current?.focus()},[]),u=F(()=>r(d=>!d),[]);U(()=>{if(!n)return;function d(f){let v=i.current,m=o.current;if(!v||!m)return;let h=f.composedPath();h.includes(v)||h.includes(m)||(r(!1),l(-1))}return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[n]),U(()=>{if(!n||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;l(f)},[n,e,t]),U(()=>{if(!n||s<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let p=F(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(!0))},[]),_=F(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),d.stopPropagation(),c();return;case"ArrowDown":d.preventDefault(),l(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),l(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),l(0);return;case"End":d.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:o,menuRef:i,toggle:u,close:c,onTriggerKey:p,onMenuKey:_}}function Af({items:e,triggerLabel:t}){let n=L.cssPrefix,r=Rf({itemCount:e.length});function o(l){l.disabled||(l.onSelect?.(),l.keepOpen||r.close())}function i(l,c){return l.onSelectValue?.(c)}function s(l,c){let u=c.segments;if(!u?.length)return;let p=Math.max(0,u.findIndex(f=>f.value===c.value)),_=-1;if(l.key==="ArrowRight"||l.key==="Enter"||l.key===" ")_=(p+1)%u.length;else if(l.key==="ArrowLeft")_=(p-1+u.length)%u.length;else return;let d=u[_];d&&(l.preventDefault(),l.stopPropagation(),i(c,d.value))}return a("div",{class:`${n}-menu-wrap`,children:[a("button",{ref:r.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":r.open,title:t,onClick:r.toggle,onKeyDown:r.onTriggerKey,children:a(Z_,{})}),r.open?a("div",{ref:r.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:r.onMenuKey,tabIndex:-1,children:e.map(l=>l.segments?a("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":l.label,tabIndex:-1,onKeyDown:c=>s(c,l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":l.label,children:l.segments.map(c=>{let u=c.value===l.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${n}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${O.langSegment}-${c.value}`,onClick:()=>i(l,c.value),children:c.label},c.value)})})]},l.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":l.type==="switch"?l.on:void 0,disabled:l.disabled,onClick:()=>o(l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),l.type==="switch"&&l.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(zr,{})}):null]},l.id))}):null]})}var mc=L.cssPrefix;function BP(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 UP={normal:"large",large:"small",small:"normal"};function zP(e){return e==="light"?a(cf,{}):e==="dark"?a(df,{}):a(uf,{})}function FP(e,t){let n=e.split("-")[0];return(t.some(o=>o!==e&&o.split("-")[0]===n)?e:n??e).toUpperCase()}function HP(e,t){let n;try{n=new URL(e,window.location.href)}catch{return}if(!(n.protocol!=="http:"&&n.protocol!=="https:"))return t.conversationId&&n.searchParams.set("chat",t.conversationId),n.searchParams.set("widgetId",t.widgetId),t.publicKey&&n.searchParams.set("public_key",t.publicKey),n.searchParams.set("ai_agent_deployment_id",t.aiAgentDeploymentId),n.href}function Jt({panelProps:e,variant:t,onEmailTranscript:n,onLogIn:r}){let{options:o,panelSize:i,feedback:s,onClose:l,onClear:c,onExpand:u,onFullscreen:p,onSoundToggle:_}=e,{onToggleHistory:d,onLocaleChange:f,onThemeChange:v,onTextSizeChange:m}=e,h=o.strings,y=o.mode,P=t==="chat",x=mt(()=>s.mutedSig.value).value,C=new Set(o.actions);function S(K){return C.has(K)}let g=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches;function b(K){return g?!1:Dr(K,y,i)}let k=o.themeMode,N={auto:h.themeAuto,light:h.themeLight,dark:h.themeDark},I=o.textSize,D={small:h.textSizeSmall,normal:h.textSizeNormal,large:h.textSizeLarge},A=[];if(P&&S("clear")&&A.push({id:"clear",icon:a(af,{}),label:h.newConversation,onSelect:c}),P&&n&&A.push({id:"emailTranscript",icon:a(Ca,{}),label:h.emailTranscript,onSelect:n}),P&&r&&A.push({id:"logIn",icon:a(pn,{}),label:h.loginAction,onSelect:r}),S("expand")&&b("expand")){let K=i==="expanded";A.push({id:"expand",icon:K?a(K_,{}):a(G_,{}),label:K?h.collapse:h.expand,type:"switch",on:K,onSelect:u})}if(S("fullscreen")&&b("fullscreen")){let K=i==="fullscreen";A.push({id:"fullscreen",icon:K?a(Y_,{}):a(Q_,{}),label:K?h.exitFullscreen:h.fullscreen,type:"switch",on:K,onSelect:p})}let z=o.popOutUrl,j=o.aiAgentDeploymentId;S("popOut")&&z&&j&&Dr("popOut",y,i)&&A.push({id:"popOut",icon:a(J_,{}),label:h.popOut,onSelect:()=>{let K=HP(z,{conversationId:e.conversationId,widgetId:o.widgetId,publicKey:o.publicKey,aiAgentDeploymentId:j});K&&window.open(K,"_blank","noopener,noreferrer")}}),P&&S("sound")&&A.push({id:"sound",icon:x?a(tf,{}):a(ef,{}),label:x?h.soundOff:h.soundOn,type:"switch",on:!x,onSelect:_}),S("theme")&&k!=="host"&&A.push({id:"theme",icon:zP(k),label:`${h.theme}: ${N[k]}`,onSelect:()=>v(BP(k)),keepOpen:!0}),S("textSize")&&A.push({id:"textSize",icon:a(nf,{}),label:`${h.textSize}: ${D[I]}`,onSelect:()=>m(UP[I]),keepOpen:!0}),S("language")&&o.availableLocales.length>1&&A.push({id:"language",icon:a(of,{}),label:h.language,segments:o.availableLocales.map(K=>({value:K,label:FP(K,o.availableLocales),lang:K})),value:o.locale,onSelectValue:f});let Y=!!l&&Pa(y,i,o.actions),ie=P&&S("history");return a("div",{class:`${mc}-header-actions`,children:[ie?a("button",{type:"button",class:`${mc}-icon-btn`,onClick:d,"aria-label":h.history,title:h.history,"data-testid":O.actionHistory,children:a(rf,{})}):null,A.length>0?a(Af,{items:A,triggerLabel:h.moreActions}):null,Y?a("button",{type:"button",class:`${mc}-icon-btn`,onClick:l,"aria-label":h.close,title:h.close,"data-testid":O.actionClose,children:a(Ct,{})}):null]})}var If={Icon:Uo};function _n(e,t){return e instanceof Le?e.status===429?e.retryAfterSeconds?t.errorRateLimitedIn.replace("{seconds}",String(e.retryAfterSeconds)):t.errorRateLimited:e.code==="network"?t.errorOffline:e.status===403?t.errorOriginNotAllowed:e.errorCode==="MESSAGE_TOO_LONG"?t.errorMessageTooLong:e.status!==void 0&&e.status>=500?t.errorServer:t.errorGeneric:t.errorGeneric}var qr=L.cssPrefix;function Ef({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${qr}-home-search`,onClick:t,"data-testid":O.homeSearch,children:[a("span",{class:`${qr}-home-search-text`,children:e}),a("span",{class:`${qr}-home-search-icon`,"aria-hidden":"true",children:a(fc,{})})]})}function Mf({placeholder:e,value:t,onInput:n}){return a("div",{class:`${qr}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${qr}-home-search-input`,placeholder:e,value:t,maxLength:200,onInput:r=>n(r.currentTarget.value),"data-testid":O.helpSearch}),a("span",{class:`${qr}-home-search-icon`,"aria-hidden":"true",children:a(fc,{})})]})}var Ho=L.cssPrefix;function Oa({title:e,subtitle:t,onClick:n,testid:r}){return a("button",{type:"button",class:`${Ho}-list-row`,onClick:n,"data-testid":r,children:[a("span",{class:`${Ho}-list-row-body`,children:[a("span",{class:`${Ho}-list-row-title`,children:e}),t?a("span",{class:`${Ho}-list-row-sub`,children:t}):null]}),a("span",{class:`${Ho}-list-row-chevron`,"aria-hidden":"true",children:a(wa,{})})]})}var Xt=L.cssPrefix,qP=ee.scope("help"),jP=20,VP=300;function WP(e,t,n){let r=new Map(n.map(o=>[o.id,o.title]));return t.map(o=>({id:o,title:r.get(o),rows:e.filter(i=>i.contentCollectionId===o)})).filter(o=>o.rows.length>0)}function Lf({transport:e,strings:t,bus:n},r,o){let[i,s]=$(),l=B(void 0),c=r?.join(",");function u(p){if(!r?.length)return;let _={};l.current=_,s(d=>({search:o,items:[],collections:[],...d,pagination:p>1?d?.pagination:void 0,loading:!0,error:void 0})),Promise.all([e.listContent({contentCollectionIds:r,sortBy:"order",page:p,limit:jP,search:o}),p>1?void 0:e.listContentCollections(r)]).then(([d,f])=>{l.current===_&&(s(v=>({search:o,items:[...p>1?v?.items??[]:[],...d.items],collections:f?.items??v?.collections??[],pagination:d.pagination,loading:!1})),!(p>1)&&(o?n.emit("contentSearch",{queryLength:o.length,hitCount:d.pagination.total}):n.emit("contentView",{section:"help",count:d.items.length})))}).catch(d=>{l.current===_&&(qP.warn("listContent (help) failed",{err:d,page:p}),s(f=>f&&{...f,loading:!1,error:_n(d,t)}))})}return U(()=>{if(!r?.length){s(void 0);return}return u(1),()=>{l.current=void 0}},[e,c,o]),[i,()=>!i?.loading&&u((i?.pagination?.page??0)+1)]}function GP(e){let{strings:t,config:n,nav:r,panelProps:o}=e,i=n.contentCollectionIds,[s,l]=$(""),[c,u]=$(""),p=Lf(e,i),_=Lf(e,c?i:void 0,c),[d,f]=s.trim()?_:p;U(()=>{let m=setTimeout(()=>u(s.trim()),VP);return()=>clearTimeout(m)},[s]);function v(){if(!i?.length)return a(Et,{message:t.helpEmpty,strings:t});let m=d?.error?a(Et,{tone:"error",message:d.error,onRetry:f,strings:t}):null;return m&&!d?.pagination?m:!d||!d.pagination&&!d.items.length?a(Et,{message:t.helpLoading,strings:t}):d.items.length?a(pe,{children:[WP(d.items,i,d.collections).map(h=>a("section",{class:`${Xt}-help-group`,children:[h.title?a("h2",{class:`${Xt}-help-section-title`,children:h.title}):null,a("div",{class:`${Xt}-help-card`,children:h.rows.map(y=>a(Oa,{title:y.title,subtitle:y.description,onClick:()=>y.url?No(y.url):r.push({kind:"content",id:y.id,title:y.title}),testid:ft(O.helpArticle,y.id)},y.id))})]},h.id)),m,d.pagination?.hasNext&&!m?a("div",{children:a("div",{class:`${Xt}-help-card`,children:a("button",{type:"button",class:`${Xt}-list-row ${Xt}-help-more`,onClick:f,"aria-busy":d.loading,children:[d.loading?a("span",{class:`${Xt}-loading-spinner`,"aria-hidden":"true"}):null,t.helpShowMore]})})}):null]}):a(Et,{message:d.search?t.helpSearchEmpty.replace("{query}",d.search):t.helpEmpty,strings:t})}return a("div",{class:`${Xt}-module`,children:[a(Ia,{title:t.helpTitle,actions:a(Jt,{panelProps:o,variant:"plain"})}),a("div",{class:`${Xt}-module-pad`,children:a(Mf,{placeholder:t.helpSearchPlaceholder,value:s,onInput:l})}),a("div",{class:`${Xt}-help-list`,children:v()})]})}var Of={Icon:Bo,Root:e=>a(GP,{...e})};var Nf=ee.scope("attachments");function Na(e,t,n){let r=QP(e),o=[],i=[],s=Df(n.accept),l=t.reduce((u,p)=>u+p.size,0),c=t.length;for(let u of r){let p=KP(u,c,l,n,s);if(p){i.push({file:u,reason:p});continue}o.push(ZP(u)),l+=u.size,c+=1}return(o.length||i.length)&&Nf.debug("ingest",{accepted:o.length,rejected:i.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:i}}function jr(e){let t=Math.min(Math.floor(Math.log10(Math.max(e,1))/3),2);return new Intl.NumberFormat(void 0,{style:"unit",unit:["byte","kilobyte","megabyte"][t],unitDisplay:"narrow",maximumFractionDigits:1}).format(e/1e3**t)}function $f(e,t){let n=Df(t);return!e||n.length===0||n.some(r=>r.kind==="ext"||Bf(new File([],"",{type:e}),[r]))}function Vr(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Nf.debug("revokeObjectURL failed",{error:t})}}function KP(e,t,n,r,o){return t>=r.maxCount?"count":n+e.size>r.maxBytes?"bytes":Bf(e,o)?null:"mime"}function QP(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:YP(t)).filter(t=>t!==null):[]}function YP(e){let t=JP(e)?e:null;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function JP(e){return XP(e)&&(e.getAsFile===void 0||typeof e.getAsFile=="function")}function XP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ZP(e){return{file:e,id:Lt(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Df(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",r="*"]=t.split("/");return{kind:"mime",type:n,subtype:r}})}function Bf(e,t){if(t.length===0)return!0;let[n="*",r="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?o.endsWith(i.ext):i.type==="image"&&i.subtype==="*"&&/\.(heic|heif|avif|bmp|tif|tiff)$/.test(o)?!0:(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===r))}var On=L.cssPrefix,ex={error:Fr,done:zr};function Uf({attachment:e,upload:t,strings:n,onRemove:r,disabled:o=!1}){let i=/^image\/(jpeg|png|gif|webp|avif|bmp|x-ms-bmp|svg\+xml)$/i.test(e.mediaType),s=Math.round((t?.fraction??0)*100),l=jr(e.size),c=t?.status==="error"||t?.status==="done"?ex[t.status]:void 0;return a("span",{class:`${On}-attachment-chip`,"data-upload":t?.status,title:e.name,"data-testid":ft(O.attachmentChip,e.id),children:[i?a("img",{class:`${On}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${On}-attachment-thumb`,"aria-hidden":"true",children:a(Ta,{})}),a("span",{class:`${On}-attachment-text`,children:[a("span",{class:`${On}-attachment-name`,children:e.name}),a("span",{class:`${On}-attachment-meta`,children:[c?a(c,{}):null,t?.status==="uploading"?`${s}% \xB7 ${l}`:l]})]}),a("button",{type:"button",class:`${On}-attachment-remove`,onClick:r,disabled:o,"aria-label":n.removeAttachment.replace("{name}",e.name),"data-testid":ft(O.attachmentRemove,e.id),children:a(Ct,{})}),t?.status==="uploading"?a("span",{class:`${On}-attachment-progress`,role:"progressbar","aria-label":e.name,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":s,children:a("span",{style:{width:`${s}%`}})}):null]})}var zf=new WeakMap;function $a(e){e.currentTarget&&zf.set(e.currentTarget,e.timeStamp)}function Da(e){let t=e.currentTarget?zf.get(e.currentTarget):void 0;return e.isComposing||t!==void 0&&e.timeStamp-t<100}var Ba=L.cssPrefix;function qo({text:e,retryLabel:t,onRetry:n,retryTestId:r}){return a("div",{class:`${Ba}-error`,role:"alert",children:[a("span",{class:`${Ba}-error-icon`,"aria-hidden":"true",children:a(Fr,{})}),a("span",{class:`${Ba}-error-text`,children:e}),n&&t?a("button",{type:"button",class:`${Ba}-error-retry`,onClick:n,"data-testid":r,children:t}):null]})}var hc={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function vc(e,t,n){return e==="disabled"?hc:e==="server"?ox(n):tx(t)}function tx(e){let t=nx();if(!t)return hc;let n=null,r=0;return{isSupported:!0,start(o,i){let s=n,l=++r;n=null,s?.abort();let c=new t;n=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",_=>{if(r!==l||n!==c)return;let d=_,f="",v=!1;for(let m=d.resultIndex;m<d.results.length;m++){let h=d.results[m];h&&(f+=h[0].transcript,h.isFinal&&(v=!0))}o(f,v)});function p(_){u||r!==l||n!==c||(u=!0,n=null,i(_))}c.addEventListener("end",()=>p(!1)),c.addEventListener("error",_=>p("error"in _&&(_.error==="not-allowed"||_.error==="service-not-allowed")));try{c.start()}catch{p(!1)}},stop(){n?.stop()},cancel(){r++;let o=n;n=null,o?.abort()}}}function nx(){return window.SpeechRecognition??window.webkitSpeechRecognition}var rx=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function ox(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return hc;let t=0,n=null;function r(s){for(let l of s.stream?.getTracks()??[])l.stop();s.stream=null}function o(){t++;let s=n;n=null,s&&(r(s),s.recorder?.state!=="inactive"&&s.recorder?.stop())}async function i(s){if(s.finishing)return;s.finishing=!0;let l=s.recorder?.mimeType??"audio/webm";r(s);let c=new Blob(s.chunks,{type:l});s.chunks=[];try{let{text:u}=await e(c,l);n===s&&t===s.generation&&u&&s.onText(u,!0)}catch{}finally{n===s&&t===s.generation&&(n=null,s.onEnd(!1))}}return{isSupported:!0,async start(s,l){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:s,onEnd:l,finishing:!1};n=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(n!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let p=ix(),_=new MediaRecorder(u,p?{mimeType:p}:void 0);c.recorder=_,_.addEventListener("dataavailable",d=>{n===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),_.addEventListener("stop",()=>{n===c&&t===c.generation&&i(c)}),_.start()}catch(u){r(c),n===c&&t===c.generation&&(n=null,l(u instanceof DOMException&&u.name==="NotAllowedError"))}},stop(){let s=n;if(s){if(!s.recorder){o();return}s.recorder.state!=="inactive"&&s.recorder.stop()}},cancel(){o()}}}function ix(){for(let e of rx)if(MediaRecorder.isTypeSupported(e))return e}function ax(e,{file:t,reason:n},r){return n==="count"?e.attachmentTooMany.replace("{count}",String(r.maxCount)):n==="bytes"?e.attachmentTooLarge.replace("{name}",t.name).replace("{max}",jr(r.maxBytes)):e.attachmentMimeRejected.replace("{name}",t.name)}var qe=L.cssPrefix,Wr=ee.scope("composer"),sx=300;function Gr(e){return e.reduce((t,n)=>t+n.size,0)}var bc={arrowUp:j_,paperPlane:q_,send:V_,chevron:wa};function Ff(e){return"activeElement"in e}function lx(e){return"host"in e&&"activeElement"in e}function cx(e){return"clipboardData"in e}function Hf({options:e,transport:t,feedback:n,bus:r,persistence:o,conversationId:i,maxMessageCharacters:s,isStreaming:l,pageToolRunning:c=!1,isMemoryCompacting:u=!1,canReleaseQueuedMessages:p=!0,queueManualMessages:_=!1,replyAwaitsCard:d=!1,active:f=!0,isPreparing:v=!1,attachmentUploadsSig:m,operatorRequestEnabled:h,canRequestOperator:y=!1,controlMode:P="ai-agent",onRequestOperator:x,onSend:C,onStop:S,apiRef:g}){let b=e.strings,[k,N]=$(()=>o.loadDraft(i)),[I,D]=$([]),[A,z]=$(),[j,Y]=$(()=>o.loadMessageQueue(i).map(H=>({id:H.id,text:H.text,attachments:[]}))),ie=B(j),K=B(!1),Te=B(void 0),[Re,ye]=$(!1),[Oe,fe]=$(!1),[tt,ht]=$(!1),[nt,bt]=$(!1),Ee=B(!1),Ue=B(null),Rt=B(null),gt=B(null),ze=B(0),ae=B(i);ae.current=i;let ve=B(f);ve.current=f;let _e=B(v);_e.current=v;let be=nt||v||!f,Ce=l&&P==="ai-agent",ct=Ce||u&&P==="ai-agent",M=P==="ai-agent"&&(ct||_||j.length>0),R=F(H=>{Y(Q=>{let W=H(Q);return o.saveMessageQueue(ae.current,W.filter(ce=>ce.attachments.length===0).map(({id:ce,text:Me})=>({id:ce,text:Me}))),ie.current=W,W})},[o]),G=F(H=>{R(Q=>(Q.find(W=>W.id===H)?.attachments.forEach(Vr),Q.filter(W=>W.id!==H)))},[R]),V=F(H=>{N(Q=>{let W=(typeof H=="function"?H(Q):H).slice(0,s);return W===Q?Q:(o.saveDraft(ae.current,W),W)})},[o,s]),te=e.features.fileUpload,ge=e.features.voice,[le,me]=$(()=>vc(ge,e.locale,(H,Q)=>t.transcribe(H,Q))),Ye=B(le);Ye.current=le;let $e=B({mode:ge,locale:e.locale,transport:t});U(()=>{let H=$e.current;H.mode===ge&&H.locale===e.locale&&H.transport===t||($e.current={mode:ge,locale:e.locale,transport:t},ze.current++,Ye.current.cancel(),gt.current=null,fe(!1),me(vc(ge,e.locale,(Q,W)=>t.transcribe(Q,W))))},[e.locale,ge,t]),ut(()=>()=>{ze.current++,le.cancel()},[le]);let rt=F(H=>{let Q=gt.current;if(Q===null)return!1;let W=Math.round(performance.now()-Q);return Wr[H]("voiceStop",{durationMs:W}),r.emit("voiceStop",{durationMs:W}),gt.current=null,!0},[r]),Be=F(()=>{gt.current!==null&&(le.stop(),fe(!1),rt("info")&&n.play("voiceStop"))},[rt,n,le]),yt=F(()=>{ze.current++,le.cancel(),fe(!1),rt("info")&&n.play("voiceStop")},[rt,n,le]);U(()=>{(v||!f)&&yt()},[f,yt,v]),U(()=>{let H=Ue.current;if(!H)return;let Q=H.getRootNode(),W=Ff(Q)?Q.activeElement:null;W&&H.closest(`.${qe}-panel`)?.contains(W)||H.focus({preventScroll:!0})},[]),U(()=>{let H=Ue.current;if(!H)return;if(k.length===0){H.style.height="";return}H.style.height="auto";let Q=getComputedStyle(H),W=Number.parseFloat(Q.getPropertyValue(`--${qe}-textarea-base-height`)),ce=Number.parseFloat(Q.borderTopWidth)+Number.parseFloat(Q.borderBottomWidth),Me=Math.min(H.scrollHeight+ce,Number.parseFloat(Q.maxHeight)),vt=Number.parseFloat(Q.fontSize)*.7;H.style.height=`${Me<W+vt?W:Me}px`},[k]);let Mt=B(I);Mt.current=I,U(()=>()=>{Mt.current.forEach(Vr);for(let H of ie.current)H.attachments.forEach(Vr)},[]),ut(()=>{if(g)return g.current={attachFromDrop:H=>{if(!te||!ve.current||Ee.current||_e.current)return;let Q=Na(H,Mt.current,e.attachments);z(Q.rejected[0]),Q.accepted.length!==0&&(Wr.info("attach (drop)",{count:Q.accepted.length,totalBytes:Gr(Q.accepted)}),r.emit("attach",{count:Q.accepted.length,totalBytes:Gr(Q.accepted)}),D(W=>[...W,...Q.accepted]))},fill:H=>{if(!ve.current||Ee.current||_e.current)return;V(H);let Q=Ue.current;Q&&(Q.focus({preventScroll:!0}),requestAnimationFrame(()=>Q.setSelectionRange(Q.value.length,Q.value.length)))},acceptQueuedMessage:G},()=>{g.current&&(g.current=null)}},[g,te,v,e.attachments,G,V]),U(()=>{let H=Ue.current;if(!H)return;let Q=H.closest(`.${qe}-panel`);if(!Q)return;let W=Me=>{if(!ve.current||Ee.current||_e.current)return;let vt=Me.clipboardData;if(!vt)return;let tn=Me.target instanceof HTMLElement?Me.target.closest("input, textarea, [contenteditable]:not([contenteditable='false'])"):null;if(tn&&tn!==H)return;if(te){let At=Na(vt.items,Mt.current,e.attachments);if(z(At.rejected[0]),At.accepted.length>0){Me.preventDefault(),Wr.info("attach (paste)",{count:At.accepted.length,totalBytes:Gr(At.accepted)}),r.emit("attach",{count:At.accepted.length,totalBytes:Gr(At.accepted)}),D(ss=>[...ss,...At.accepted]);return}}if(tn===H)return;let nn=vt.getData("text/plain");nn&&(Me.preventDefault(),V(At=>At+nn),H.focus())};function ce(Me){cx(Me)&&W(Me)}return Q.addEventListener("paste",ce),()=>Q.removeEventListener("paste",ce)},[te,e.attachments,V]);async function Nt(){let H=k.trim();if(!H&&I.length===0||!f||Ce||Ee.current||v)return;yt(),Ee.current=!0,bt(!0);let Q=k,W=I;try{await C(H,W)&&(z(void 0),V(ce=>ce===Q?"":ce),D(ce=>ce!==W?ce:(W.forEach(Vr),Mt.current=[],[])))}finally{Ee.current=!1,bt(!1),requestAnimationFrame(()=>{let ce=Ue.current;if(!ce||ce.disabled||!ve.current)return;let Me=ce.getRootNode(),vt=Ff(Me)?Me.activeElement:null,tn=vt?.getAttribute("data-testid");if(!(vt&&vt!==ce&&tn!==O.composerSend&&tn!==O.composerStop)){if(lx(Me)){let nn=Me.host.ownerDocument;if(!nn.hasFocus())return;let At=nn.activeElement;if(At&&At!==Me.host&&At!==nn.body)return}ce.focus({preventScroll:!0})}})}}function ot(){let H=k.trim();if(!H&&I.length===0||!f||!M||Ee.current||v)return;yt();let Q=I;R(W=>[...W,{id:Lt(),text:H,attachments:Q}]),ct||ye(!0),V(""),D(W=>W!==Q?W:(Mt.current=[],[])),Ue.current?.focus({preventScroll:!0})}U(()=>{ct&&(K.current=!1,Te.current=void 0,ye(!1))},[ct]),U(()=>{let H=j[0];if(!H||!p||ct||K.current||nt||v||!f)return;let Q=d&&!Re?(Te.current??(Te.current=performance.now()+e.cardAnswerWaitSeconds*1e3))-performance.now():0,W=setTimeout(()=>{K.current=!0,C(H.text,H.attachments,H.id).then(ce=>{if(ce){G(H.id);return}K.current=!1})},Math.max(Q,sx));return()=>clearTimeout(W)},[f,p,Re,v,C,e.cardAnswerWaitSeconds,ct,j,G,d,nt]);function dt(H){H.key!=="Enter"||H.shiftKey||Da(H)||(H.preventDefault(),M&&(k.trim()||I.length>0)?ot():Ce?S():Nt())}function Ut(H){if(!(H.target instanceof HTMLInputElement))return;let Q=H.target;if(!f||Ee.current||v){Q.value="";return}let W=Na(Q.files,I,e.attachments);z(W.rejected[0]),W.accepted.length>0&&(Wr.info("attach (file picker)",{count:W.accepted.length,totalBytes:Gr(W.accepted)}),r.emit("attach",{count:W.accepted.length,totalBytes:Gr(W.accepted)}),D(ce=>[...ce,...W.accepted])),Q.value=""}function ur(H){!f||Ee.current||v||(Wr.info("removeAttachment",{id:H}),r.emit("removeAttachment",{id:H}),z(void 0),D(Q=>{let W=Q.find(ce=>ce.id===H);return W&&Vr(W),Q.filter(ce=>ce.id!==H)}))}function pr(){if(Oe){Be();return}if(!f||!le.isSupported||Ee.current||v)return;let H=++ze.current;gt.current=performance.now(),Wr.info("voiceStart"),r.emit("voiceStart",void 0),ht(!1),fe(!0),n.play("voiceStart"),le.start((Q,W)=>{ze.current!==H||!ve.current||_e.current||Ee.current||!W||V(ce=>`${ce}${Q} `)},Q=>{ze.current!==H||!ve.current||(fe(!1),ht(Q),rt("debug"))})}let $n=bc[e.composer.sendButton.icon],_r=!!(k.trim()||I.length>0),Dn=m?.value,ti=I.some(H=>Dn?.get(H.id)?.status==="uploading"),Bn=I.filter(H=>Dn?.get(H.id)?.status==="error"),fr=Bn.find(H=>Dn?.get(H.id)?.refusal),as=fr&&(Dn?.get(fr.id)?.refusal==="INVALID_FILE_TYPE"?b.attachmentMimeRejected:b.attachmentUploadFailed).replace("{name}",fr.name),ni=Ce||ti||c&&!_r;return a("div",{class:`${qe}-composer`,part:"composer","data-testid":O.composer,children:[j.length>0?a("div",{class:`${qe}-message-queue`,"aria-label":b.queueMessage,"data-testid":O.messageQueue,children:j.map(H=>a("div",{class:`${qe}-attachment-chip ${qe}-queued-message`,"data-testid":`${O.queuedMessage}-${H.id}`,children:[a("span",{class:`${qe}-attachment-name ${qe}-queued-text`,children:H.text||H.attachments.map(Q=>Q.name).join(", ")}),a("button",{type:"button",class:`${qe}-attachment-remove`,onClick:()=>G(H.id),"aria-label":b.removeQueuedMessage,title:b.removeQueuedMessage,"data-testid":`${O.queuedMessageRemove}-${H.id}`,children:a(Ct,{})})]},H.id))}):null,I.length>0?a("div",{class:`${qe}-attachments`,children:I.map(H=>a(Uf,{attachment:H,upload:Dn?.get(H.id),strings:b,onRemove:()=>ur(H.id),disabled:be},H.id))}):null,Bn.length>0&&!be?a(qo,{text:as??b.attachmentUploadFailed.replace("{name}",Bn.map(H=>H.name).join(", ")),retryLabel:b.errorRetry,onRetry:fr?void 0:()=>{Nt()},retryTestId:O.attachmentRetry}):null,A?a("p",{class:`${qe}-field-error`,role:"alert",children:ax(b,A,e.attachments)}):null,tt?a("p",{class:`${qe}-field-error`,role:"alert",children:b.micBlocked}):null,s!==void 0&&k.length>=s*.9?a("p",{class:`${qe}-field-${k.length<s?"hint":"error"}`,"data-testid":O.composerCount,children:`${k.length} / ${s}`}):null,a("div",{class:`${qe}-composer-row`,children:[a("div",{class:`${qe}-composer-actions`,children:[te?a("button",{type:"button",class:`${qe}-icon-btn`,onClick:()=>Rt.current?.click(),disabled:be,"aria-label":b.attach,title:b.attach,"data-testid":O.composerAttach,children:a(ka,{})}):null,le.isSupported?a("button",{type:"button",class:`${qe}-icon-btn`,onClick:pr,disabled:be,"aria-label":Oe?b.micStop:b.micStart,title:Oe?b.micStop:b.micStart,"aria-pressed":Oe,"data-recording":Oe?"true":void 0,"data-testid":O.composerVoice,children:a(W_,{})}):null,h&&P==="ai-agent"&&x?a("button",{type:"button",class:`${qe}-icon-btn`,onClick:x,disabled:be||!y,"aria-label":b.talkToOperator,title:b.talkToOperator,"data-testid":O.operatorRequest,children:a(pn,{})}):null]}),a("textarea",{ref:Ue,name:"message",class:`${qe}-textarea`,rows:1,value:k,maxLength:s,placeholder:b.composerPlaceholder,onInput:H=>V(H.currentTarget.value),onKeyDown:dt,onCompositionEnd:$a,disabled:be,"aria-label":b.composerPlaceholder,"data-testid":O.composerInput}),M&&_r?a("button",{type:"button",class:`${qe}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:ot,disabled:be,"aria-label":b.queueMessage,title:b.queueMessage,"data-testid":O.composerSend,children:a($n,{})}):null,ni?a("button",{type:"button",class:`${qe}-send`,onClick:S,disabled:be&&!ti,"aria-label":b.stop,"data-testid":O.composerStop,children:a(En,{})}):null,!ni&&(!M||!_r)?a("button",{type:"button",class:`${qe}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{Nt()},disabled:be||!k.trim()&&I.length===0,"aria-label":b.send,"data-testid":O.composerSend,children:a($n,{})}):null]}),a("input",{ref:Rt,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Ut,disabled:be,class:`${qe}-sr-only`,"data-testid":O.composerFileInput})]})}var qf=L.cssPrefix;function Ua({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${qf}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${qf}-home-card`,"data-testid":n,children:t})}function za(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var Ht=L.cssPrefix,dx=ee.scope("news"),ux=10;function yc(e,t){let n=e?new Date(e):void 0;if(!(!n||Number.isNaN(n.getTime())))return new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(n)}function px({options:e,transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s,latestNews:l}){let c=r.contentCollectionIds,u=c?.join(","),[p,_]=$({items:[],loading:!0}),d=B(void 0);function f(y){if(!c?.length)return;let P={};d.current=P,_(x=>({...x,loading:!0,error:void 0})),t.listContent({contentCollectionIds:c,sortBy:"publishedAt",sortOrder:"desc",page:y,limit:ux}).then(x=>{if(d.current!==P||(_(S=>({items:y>1?[...S.items,...x.items]:x.items,pagination:x.pagination,loading:!1})),y>1))return;i.emit("contentView",{section:"news",count:x.items.length});let C=x.items[0];C&&l.markSeen(C.id)}).catch(x=>{d.current===P&&(dx.warn("listContent (news) failed",{err:x,page:y}),_(C=>({...C,loading:!1,error:_n(x,n)})))})}function v(){p.loading||f((p.pagination?.page??0)+1)}U(()=>(_({items:[],loading:!0}),f(1),()=>{d.current=void 0}),[t,u]);function m(y){let P=yc(y.publishedAt,e.locale);return a("button",{type:"button",class:`${Ht}-news-card`,onClick:()=>o.push({kind:"content",id:y.id,title:y.title}),"data-testid":ft(O.newsItem,y.id),children:[y.image?a("img",{class:`${Ht}-news-hero`,src:y.image,alt:"",loading:"lazy"}):null,a("span",{class:`${Ht}-news-body`,children:[a("span",{class:`${Ht}-news-title`,children:y.title}),P||y.tags?.length?a("span",{class:`${Ht}-news-meta`,children:[P?a("time",{dateTime:y.publishedAt,children:P}):null,y.tags?.map(x=>a("span",{class:`${Ht}-news-tag`,children:x},x))]}):null,y.description?a("span",{class:`${Ht}-news-summary`,children:y.description}):null]})]},y.id)}function h(){if(!c?.length)return a(Et,{message:n.newsEmpty,strings:n});let y=p.error?a(Et,{tone:"error",message:p.error,onRetry:v,strings:n}):null;return y&&!p.pagination?y:p.pagination?p.items.length?a("div",{class:`${Ht}-news-list`,children:[p.items.map(m),y,p.pagination.hasNext&&!y?a("button",{type:"button",class:`${Ht}-news-more`,onClick:v,"aria-busy":p.loading,"data-testid":O.newsMore,children:[p.loading?a("span",{class:`${Ht}-loading-spinner`,"aria-hidden":"true"}):null,n.newsShowMore]}):null]}):a(Et,{message:n.newsEmpty,strings:n}):a(Et,{message:n.newsLoading,strings:n})}return a("div",{class:`${Ht}-module`,children:[a(Ia,{title:n.newsTitle,actions:a(Jt,{panelProps:s,variant:"plain"})}),a("div",{class:`${Ht}-module-scroll`,children:h()})]})}var jf={Icon:Ra,Root:e=>a(px,{...e})};var Pe=L.cssPrefix,Vf=ee.scope("home");function _x(e){let t=e.options.userContext?.name,n=e.config.greetingText?at(e.strings,e.config.greetingText):void 0;if(n){let r=t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),o=e.strings.homeGreetingLead;return{title:r,subtitle:r.toLowerCase()===o.toLowerCase()?void 0:o}}return t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}function fx(e,t){return t.url?No(t.url):e.push({kind:"content",id:t.id,title:t.title})}function gx({options:e,onAsk:t}){let[n,r]=$(""),{sendButton:o}=e.composer,i=bc[o.icon];function s(l){l.preventDefault();let c=n.trim();c&&(r(""),t(c))}return a("form",{class:`${Pe}-home-search ${Pe}-home-ask`,"data-input":"true",onSubmit:s,"data-testid":O.homeAsk,children:[a("input",{type:"text",class:`${Pe}-home-search-input`,placeholder:e.strings.homeAskPlaceholder,"aria-label":e.strings.homeAskPlaceholder,value:n,enterKeyHint:"send",onInput:l=>r(l.currentTarget.value)}),a("button",{type:"submit",class:`${Pe}-send`,"data-shape":o.shape,"data-variant":o.variant,disabled:!n.trim(),"aria-label":e.strings.send,children:a(i,{})})]})}function Wf(e,t){return un(e,t,t.type!=="upsert"||t.activity===!0)}function mx(e){let{transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s,latestNews:l}=e,[c,u]=$(null),[p,_]=$([]),d=r.contentCollectionIds?.join(","),f=e.options.modules.list.some(g=>g.layout==="chat");U(()=>{if(r.showRecentConversations===!1)return;let g=!1,b=!0,k=[],N=t.subscribeConversationChanges(I=>{b&&k.push(I),u(D=>Wf(D?[D]:[],I)[0]??null)});return t.listConversations({limit:f?50:1}).then(I=>{if(g)return;let D=k.reduce(Wf,I.conversations);k=[],b=!1,u(D[0]??null)}).catch(I=>{g||(k=[],b=!1,Vf.warn("listConversations (home) failed",{err:I}))}),()=>{g=!0,N()}},[t,r.showRecentConversations,f]),U(()=>{if(!r.contentCollectionIds?.length)return;let g=!1;return t.listContent({contentCollectionIds:r.contentCollectionIds,pinned:!0,limit:6}).then(b=>{g||(_(b.items),i.emit("contentView",{section:"home",count:b.items.length}))}).catch(b=>!g&&Vf.warn("listContent (home) failed",{err:b})),()=>{g=!0}},[t,d,i]);let v=_x(e),m=r.userAvatars??[],h=r.status,y=h?.text?at(n,h.text):n.homeStatus,P=h?.url,x=r.contentBlockTitle?at(n,r.contentBlockTitle):n.homeContentTitle,C=l.item,S=yc(C?.publishedAt,e.options.locale);return a("div",{class:`${Pe}-module ${Pe}-home`,"data-testid":O.homeView,children:a("div",{class:`${Pe}-home-scroll`,children:[a("div",{class:`${Pe}-home-hero`,children:[a("div",{class:`${Pe}-home-hero-top`,children:[r.brandName?a("span",{class:`${Pe}-home-brand`,"data-testid":O.homeBrand,children:r.brandName}):a("span",{class:`${Pe}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${Pe}-home-hero-actions`,children:[m.length>0?a("div",{class:`${Pe}-home-avatars`,children:m.map(g=>a("span",{class:`${Pe}-home-avatar`,title:g.role?`${g.name} \xB7 ${g.role}`:g.name,children:g.avatar?a("img",{src:g.avatar,alt:"",loading:"lazy"}):a("span",{children:za(g.name)})},g.name))}):null,a(Jt,{panelProps:s,variant:"plain"})]})]}),r.showGreeting!==!1?a(pe,{children:[a("h1",{class:`${Pe}-home-greeting`,"data-testid":O.homeGreeting,children:v.title}),v.subtitle?a("p",{class:`${Pe}-home-lead`,children:v.subtitle}):null]}):null]}),a("div",{class:`${Pe}-home-cards`,children:[f?a(gx,{options:e.options,onAsk:g=>o.startNewConversation(g)}):null,r.showSearchBar!==!1?a(Ef,{placeholder:n.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,C?a(Ua,{onClick:()=>{l.markSeen(C.id),o.push({kind:"content",id:C.id,title:C.title})},testid:O.homeWhatsNew,children:a("div",{class:`${Pe}-home-recent-row`,"data-unread":l.unseen?"true":void 0,children:[a("span",{class:`${Pe}-home-recent-avatar`,"aria-hidden":"true",children:a(Ra,{})}),a("span",{class:`${Pe}-home-recent-body`,children:[a("span",{class:`${Pe}-home-recent-title`,children:n.homeWhatsNew}),a("span",{class:`${Pe}-home-recent-preview`,children:S?`${C.title} \xB7 ${S}`:C.title})]}),l.unseen?a("span",{class:`${Pe}-home-recent-dot`,role:"img","aria-label":n.newsUnseen}):null]})}):null,c?a(Ua,{onClick:()=>o.selectConversation(c),testid:O.homeRecent,children:a("div",{class:`${Pe}-home-recent-row`,"data-unread":c.hasUnread?"true":void 0,children:[a("span",{class:`${Pe}-home-recent-avatar`,"aria-hidden":"true",children:a(Uo,{})}),a("span",{class:`${Pe}-home-recent-body`,children:[a("span",{class:`${Pe}-home-recent-title`,children:c.title}),c.preview?a("span",{class:`${Pe}-home-recent-preview`,children:La(c.preview)}):null]}),c.hasUnread?a("span",{class:`${Pe}-home-recent-dot`,role:"img","aria-label":n.unread}):null]})}):null,h?a(Ua,{onClick:P?()=>No(P):void 0,children:a("div",{class:`${Pe}-home-status`,"data-level":h.level??"operational",children:[a("span",{class:`${Pe}-home-status-icon`,"aria-hidden":"true",children:a(sf,{})}),a("span",{class:`${Pe}-home-status-text`,children:y})]})}):null,p.length>0?a("section",{class:`${Pe}-home-content`,children:[a("div",{class:`${Pe}-home-content-title`,children:x}),a("div",{class:`${Pe}-home-content-list`,children:p.map(g=>a(Oa,{title:g.title,subtitle:g.description,onClick:()=>fx(o,g),testid:ft(O.homeContentRow,g.id)},g.id))})]}):null]})]})})}var Gf={Icon:lf,Root:e=>a(mx,{...e})};var Fa={chat:If,home:Gf,help:Of,news:jf};var jo=L.cssPrefix;function Kf({modules:e,activeTab:t,strings:n,hasUnread:r,onSelect:o}){return a("nav",{class:`${jo}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let s=Fa[i.layout].Icon,l=i.id===t,c=i.layout==="chat"&&r;return a("button",{type:"button",role:"tab","aria-selected":l,class:`${jo}-tab`,onClick:()=>o(i.id),"data-testid":ft(O.tab,i.id),children:[a("span",{class:`${jo}-tab-icon`,children:[a(s,{}),c?a("span",{class:`${jo}-tab-badge`,"data-testid":O.tabBadge,role:"img","aria-label":n.unread}):null]}),a("span",{class:`${jo}-tab-label`,children:at(n,i.label)})]},i.id)})})}var Vo=L.cssPrefix;function Qf({agent:e,strings:t,ticketReference:n,person:r=!1}){let o=e.status??"online",i=at(t,e.name),s=e.title?at(t,e.title):null,l=r?a(pn,{}):a("span",{children:za(i)});return a("div",{class:`${Vo}-agent`,children:[a("div",{class:`${Vo}-agent-avatar`,"data-status":o,children:e.avatar?a("img",{src:e.avatar,alt:""}):l}),a("div",{class:`${Vo}-agent-meta`,children:[a("strong",{children:i}),s||n?a("div",{class:`${Vo}-agent-sub`,children:[n?a(hx,{reference:n,strings:t}):null,s?a("span",{children:s}):null]}):null]})]})}function hx({reference:e,strings:t}){let[n,r]=$(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})}return a("button",{type:"button",class:`${Vo}-agent-ticket`,onClick:o,title:t.copy,"aria-label":n?t.copied:t.copyTicketReference.replace("{reference}",e),children:n?t.copied:e})}var vx=["today","yesterday","lastWeek","older"];function bx(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let r=Math.round((Yf(e)-Yf(n))/(1440*60*1e3));return r<=0?"today":r===1?"yesterday":r<7?"lastWeek":"older"}function Jf(e,t){let n=new Map;for(let r of t){let o=bx(e,r.lastMessageAt),i=n.get(o);i?i.push(r):n.set(o,[r])}return vx.flatMap(r=>{let o=n.get(r);return o?[{bucket:r,conversations:o}]:[]})}function Yf(e){return new Date(e).setHours(0,0,0,0)}var Xf=ee.scope("history"),yx=3,Px=6,xx={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Zf(e,t){let n=t.type!=="upsert"||t.activity===!0;if(t.type==="snapshot"&&t.result.pagination.page===1&&e.pagination.page>1){let o=un(e.conversations.slice(0,t.result.pagination.limit),t,n);if(t.result.conversations.length===0){if(o.length===0)return t.result;let u=Math.max(t.result.pagination.total,o.length);return{...t.result,conversations:o,pagination:{...t.result.pagination,total:u,totalPages:Math.ceil(u/t.result.pagination.limit)}}}let i=new Set(o.map(u=>u.conversationId)),s=e.conversations.slice(t.result.pagination.limit).filter(u=>!i.has(u.conversationId)),l=e.pagination.page,c={...t.result.pagination,page:l,hasPrev:l>1,hasNext:l<t.result.pagination.totalPages};return{conversations:[...o,...s],pagination:c}}let r=un(e.conversations,t,n);return r===e.conversations?e:{...t.type==="snapshot"?t.result:e,conversations:r}}function Sx(e,t,n){let r=Date.parse(e);return Number.isFinite(r)?new Date(r).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(r):t-r<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(r):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(r):""}function Ha({transport:e,strings:t,locale:n,persistence:r,onSelect:o,onNewConversation:i}){let s=L.cssPrefix,l=e.peekConversations({limit:50}),[c,u]=$(l?"loaded":"loading"),[p,_]=$(0),[d,f]=$(l),[v,m]=$(!1),h=B(void 0),y=d?.conversations??[],P=d?.pagination;U(()=>{let b=!1,k=!0,N=[],I=e.subscribeConversationChanges(A=>{k&&N.push(A),f(z=>z&&Zf(z,A))});h.current=void 0,m(!1);let D=e.peekConversations({limit:50});return f(D),u(D?"loaded":"loading"),e.listConversations({limit:50}).then(A=>{if(b)return;let z=A;for(let j of N)z=Zf(z,j);N=[],k=!1,f(z),u("loaded"),r.saveHistoryCount(z.conversations.length)}).catch(A=>{b||(N=[],k=!1,Xf.warn("listConversations failed",{err:A}),u({failure:_n(A,t)}))}),()=>{b=!0,I(),h.current=void 0}},[e,r,n,p]);async function x(){if(h.current||!P?.hasNext)return;let b={};h.current=b,m(!0);try{let k=await e.listConversations({page:P.page+1,limit:P.limit});if(h.current!==b)return;f(N=>{if(!N)return N;let I=new Set(N.conversations.map(z=>z.conversationId)),D=k.conversations.filter(z=>I.has(z.conversationId)?!1:(I.add(z.conversationId),!0)),A={conversations:[...N.conversations,...D],pagination:k.pagination};return r.saveHistoryCount(A.conversations.length),A})}catch(k){if(h.current!==b)return;Xf.warn("listConversations page failed",{err:k,page:P.page+1})}finally{h.current===b&&(h.current=void 0,m(!1))}}let C=i?a("div",{class:`${s}-history-footer`,children:a("button",{type:"button",class:`${s}-history-new`,onClick:i,"data-testid":O.sidebarNewConversation,children:[a(H_,{}),t.newConversation]})}):null;if(c==="loading"){let b=Math.min(r.loadHistoryCount()??yx,Px);return a(pe,{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,b)},(k,N)=>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`})})})]})]},N))})]})}),C]})}if(typeof c=="object")return a(pe,{children:[a(Et,{tone:"error",message:c.failure,onRetry:()=>_(b=>b+1),strings:t}),C]});if(y.length===0)return a(pe,{children:[a("div",{class:`${s}-history-empty`,children:t.historyEmpty}),C]});let S=Date.now(),g=Jf(S,y);return a(pe,{children:[a("div",{class:`${s}-history`,role:"list",children:[g.map(b=>a("div",{class:`${s}-history-group`,children:[a("div",{class:`${s}-history-heading`,children:t[xx[b.bucket]]}),a("div",{class:`${s}-history-card`,children:b.conversations.map(k=>a("div",{role:"listitem",children:a("button",{type:"button",class:`${s}-history-item`,onClick:()=>o(k),"data-unread":k.hasUnread?"true":void 0,"data-testid":ft(O.historyItem,k.conversationId),children:[a("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:a(_c,{})}),a("span",{class:`${s}-history-body`,children:[a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-title`,children:k.title}),a("span",{class:`${s}-history-time`,children:[k.ticketReference&&`${k.ticketReference} \xB7 `,Sx(k.lastMessageAt,S,n)]})]}),a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-preview`,children:k.preview&&La(k.preview)||t.historyContinue}),k.hasUnread?a("span",{class:`${s}-history-dot`,role:"img","aria-label":t.unread}):null]})]})]})},k.conversationId))})]},b.bucket)),P?.hasNext?a("div",{class:`${s}-history-more`,children:a("button",{type:"button",onClick:x,disabled:v,"aria-busy":v,"data-testid":O.historyLoadMore,children:t.loadMoreConversations})}):null]}),C]})}var eg=L.cssPrefix;function tg({state:e,strings:t}){return e?a("div",{class:`${eg}-dropzone`,"data-state":e,role:"status","aria-live":"polite",children:[a("span",{class:`${eg}-dropzone-icon`,"aria-hidden":"true",children:e==="reject"?a(Fr,{}):a(ka,{})}),e==="reject"?t.dropZoneRejected:t.dropZone]}):null}var Pc=new RegExp(String.raw`^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$`),wx=/^[+]?[\d\s().-]{6,}$/;function kx(e,t,n){let r=Array.isArray(t)?t.join(""):t?.trim()??"";if(!r)return e.required?n.formRequired:void 0;if(e.type==="email"&&!Pc.test(r))return n.formInvalidEmail;if(e.type==="tel"&&!wx.test(r))return n.formInvalidTel;if(e.type==="number"&&!Number.isFinite(Number(r)))return n.formInvalidNumber}function ng(e,t,n){return Object.fromEntries(e.flatMap(r=>{let o=kx(r,t[r.name],n);return o?[[r.name,o]]:[]}))}var st=L.cssPrefix;function rg(e){return e.tokenEmail||e.userContext?.email?.trim()}function Cx(e,t){let n=e instanceof Le?e.status:void 0;return n===400?t.formInvalidEmail:n===409?t.emailTranscriptAlreadySent:n===422?t.emailTranscriptNotDelivered:n===429?t.emailTranscriptLimited:t.emailTranscriptFailed}function Tx(e){return"host"in e&&"activeElement"in e}function og({transport:e,strings:t,knownEmail:n,onClose:r}){let[o,i]=$(n??""),[s,l]=$(!1),[c,u]=$({status:"idle"}),p=B(null),_=_o(),d=`${_}-title`,f=`${_}-error`,v=c.status==="sending",m=c.status==="sent";ut(()=>{let P=p.current;if(!P)return;let x=P.getRootNode(),C=Tx(x)?x.activeElement:null,S=Hr(P);return()=>{S(),C instanceof HTMLElement&&C.isConnected&&C.focus({preventScroll:!0})}},[]),ut(()=>{p.current?.querySelector("[data-autofocus]")?.focus({preventScroll:!0})},[m]);async function h(P){if(P.preventDefault(),v)return;let x=o.trim();if(!Pc.test(x)){l(!0),p.current?.querySelector("input")?.focus();return}l(!1),u({status:"sending"});let C=await e.emailTranscript(x).then(S=>({status:"sent",to:S.to}),S=>({status:"failed",message:Cx(S,t)}));u(C)}function y(P){P.key==="Tab"&&P.stopPropagation(),P.key==="Escape"&&(P.stopPropagation(),r())}return a("div",{class:`${st}-transcript-layer`,children:[a("div",{class:`${st}-transcript-backdrop`,"aria-hidden":"true",onClick:r}),a("section",{ref:p,class:`${st}-transcript-sheet`,role:"dialog","aria-modal":"true","aria-labelledby":d,onKeyDown:y,"data-testid":O.emailTranscriptSheet,children:[a("header",{class:`${st}-transcript-sheet-head`,children:[a("span",{class:`${st}-transcript-sheet-icon`,children:a(Ca,{})}),a("h2",{id:d,class:`${st}-transcript-sheet-title`,children:t.emailTranscript}),a("button",{type:"button",class:`${st}-icon-btn`,onClick:r,"aria-label":t.emailTranscriptCancel,title:t.emailTranscriptCancel,children:a(Ct,{})})]}),c.status==="sent"?a(pe,{children:[a("p",{class:`${st}-transcript-sheet-text ${st}-transcript-sheet-sent`,role:"status",children:[a(sr,{}),a("span",{children:t.emailTranscriptSent.replace("{email}",c.to)})]}),a("button",{type:"button",class:`${st}-form-submit ${st}-transcript-sheet-action`,onClick:r,"data-autofocus":!0,children:t.emailTranscriptDone})]}):a("form",{class:`${st}-transcript-sheet-form`,onSubmit:P=>{h(P)},noValidate:!0,children:[a("p",{class:`${st}-transcript-sheet-text`,children:t.emailTranscriptPrompt}),a("label",{class:`${st}-field`,"data-invalid":s?"true":void 0,children:[a("span",{class:`${st}-field-label`,children:t.emailTranscriptEmailLabel}),a("input",{class:`${st}-field-input`,type:"email",name:"email",autocomplete:"email",inputMode:"email",autocapitalize:"off",spellcheck:!1,value:o,readOnly:v,"aria-invalid":s,"aria-describedby":s?f:void 0,onInput:P=>{i(P.currentTarget.value),l(!1)},"data-autofocus":!0,"data-testid":O.emailTranscriptEmail}),s?a("span",{id:f,class:`${st}-field-error`,role:"alert",children:t.formInvalidEmail}):null]}),a("button",{type:"submit",class:`${st}-form-submit ${st}-transcript-sheet-action`,disabled:v,"aria-busy":v,"data-testid":O.emailTranscriptSend,children:v?t.emailTranscriptSending:t.emailTranscriptSend}),c.status==="failed"?a("p",{class:`${st}-field-error`,role:"alert",children:c.message}):null]})]})]})}var ig=Object.assign;function Ix(e,t){for(var n in e)if(n!="__source"&&e[n]!==t[n])return!0;for(var r in t)if(r!="__source"&&!(r in e))return!0;return!1}var Ex=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini|asp|fill|st)/;function lg(e,t){function n(o){var i=this.props.ref;return i!=o.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,o)||i!=o.ref:Ix(this.props,o)}function r(o){return this.shouldComponentUpdate=n,xn(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.type=e,r}var Mx=Symbol.for("react.element"),Lx=/^(?: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]/,Ox=/[A-Z0-9]/g,Nx=typeof document<"u";var $x=function(e){return/fil|che|rad/.test(e)};zt.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(zt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ag=he.event;he.event=function(e){return ag&&(e=ag(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Dx={configurable:!0,get:function(){return this.class}},sg=he.vnode;he.vnode=function(e){if(typeof e.type=="string")(function(r){var o=r.props,i=r.type,s={},l=i.indexOf("-")==-1;for(var c in o){var u=o[c];if(!(c=="value"&&"defaultValue"in o&&u==null||Nx&&c=="children"&&i=="noscript"||c=="class"||c=="className")){if(c=="style"&&u&&u.constructor==Object){var p=void 0;for(var _ in u)typeof u[_]!="number"||Ex.test(_)||(p||(p=u=ig({},u)),u[_]+="px")}else if(c=="defaultValue"&&"value"in o&&o.value==null)c="value";else if(c=="download"&&u===!0)u="";else if(c=="translate"&&u==="no")u=!1;else if(c[0]=="o"&&c[1]=="n"){var d=c.toLowerCase();d=="ondoubleclick"?c="ondblclick":d!="onchange"||i!="input"&&i!="textarea"||$x(o.type)?d=="onfocus"?c="onfocusin":d=="onblur"&&(c="onfocusout"):d=c="oninput",d=="oninput"&&s[c=d]&&(c="oninputCapture")}else l&&Lx.test(c)?c=c.replace(Ox,"-$&").toLowerCase():u===null&&(u=void 0);s[c]=u}}if(i=="select"){var f=s.defaultValue!=null?s.defaultValue:s.multiple&&Array.isArray(s.value)?s.value:null;f!=null&&(s.value=tl(o.children).forEach(function(v){v.props.selected=s.multiple?f.indexOf(v.props.value)!=-1:f==v.props.value}))}o.class&&!o.className?(s.class=o.class,Object.defineProperty(s,"className",Dx)):o.className&&(s.class=s.className=o.className),r.props=s})(e);else if(typeof e.type=="function"&&("ref"in e.props&&"prototype"in e.type&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=ig({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.ref&&!("ref"in e.props)&&Object.defineProperty(e.props,"ref",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=Mx,sg&&sg(e)};var qa=L.cssPrefix;function cg({messageId:e,initial:t,strings:n,onFeedback:r}){let[o,i]=$(t);U(()=>i(t),[e,t]);function s(l){let c=o===l?null:l;i(c),r(e,c)}return a("div",{class:`${qa}-feedback`,role:"group","data-testid":O.messageFeedback,children:[a("button",{type:"button",class:`${qa}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>s("up"),"data-testid":O.feedbackUp,children:a(_f,{})}),a("button",{type:"button",class:`${qa}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>s("down"),"data-testid":O.feedbackDown,children:a(ff,{})}),a("span",{class:`${qa}-sr-only`,role:"status","aria-live":"polite",children:o?n.feedbackThanks:""})]})}function dg(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function ug(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function Bx(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function pg(e){let{streaming:t,reasoningVisible:n,emptyReply:r,hidden:o}=e,i=e.responseMode==="buffered"&&t,s=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:i,reasoningVisible:n,working:s,showStreamDots:Bx({streaming:t,bufferedHold:i,reasoningVisible:n,working:s}),emptyReply:r,hidden:o}}var Kr=L.cssPrefix;function _g({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${Kr}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":O.source,children:[a("span",{class:`${Kr}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${Kr}-source-label`,children:n})]}):a("span",{class:`${Kr}-source`,"data-testid":O.source,children:[a("span",{class:`${Kr}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${Kr}-source-label`,children:n})]})}var Bt=L.cssPrefix;function mg(e){return{toolCallId:e.toolCallId,toolName:e.toolName,...e.title?{title:e.title}:{},state:e.stateSig.value,input:e.inputSig.value,output:e.outputSig.value,...e.errorSig.value?{errorText:e.errorSig.value}:{},...e.approvalSig.value?{approval:e.approvalSig.value}:{},...e.toolMetadata?{toolMetadata:e.toolMetadata}:{}}}function hg(e,t){if(t?.replacedByMessageId)return{terminal:!1,responded:!1,decided:!1};let n=e==="output-available"||e==="output-error"||e==="output-denied",r=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:r,decided:n||r}}function ja({status:e,label:t,icon:n}){return a("span",{class:`${Bt}-toolui-badge ${Bt}-toolui-status`,"data-status":e,children:[a("span",{class:`${Bt}-toolui-status-icon`,children:n??a(xc,{status:e})}),t]})}function xc({status:e}){return e==="running"?a("span",{class:`${Bt}-loading-spinner`}):e==="stopped"?a(En,{}):e==="waiting"||e==="submitted"?a(mf,{}):e==="failed"||e==="declined"||e==="replaced"?a(zo,{}):a(sr,{})}function Wo({decision:e}){return a("span",{class:`${Bt}-steps-decision`,"data-approved":e.approved?"true":"false",title:e.title,children:[e.approved?a(sr,{}):a(zo,{}),e.label]})}function Va({view:e,strings:t}){let n=e.raw;return a(pe,{children:[e.error?a("p",{class:`${Bt}-steps-row-error`,children:e.error}):null,e.fields.length>0?a(fg,{fields:e.fields,label:e.tables?t.stepInput:void 0,plain:!e.tables}):null,e.resultFields?a(fg,{fields:e.resultFields,label:t.toolResult}):null,n?.input||n?.output?a("details",{class:`${Bt}-toolui-raw`,open:!e.tables,children:[a("summary",{children:t.stepRawData}),n.input?a(gg,{label:t.stepInput,text:n.input}):null,n.output?a(gg,{label:t.toolResult,text:n.output}):null]}):null]})}function fg({fields:e,label:t,plain:n=!1}){let r=a("div",{class:`${Bt}-toolui-fields`,"data-plain":n?"true":void 0,children:a("table",{children:a("tbody",{children:e.map(({label:o,value:i},s)=>a("tr",{children:[a("th",{scope:"row",children:o}),a("td",{children:i})]},`${o}#${s}`))})})});return t?a("div",{class:`${Bt}-toolui-section`,children:[a("span",{class:`${Bt}-toolui-label`,children:t}),r]}):r}function gg({label:e,text:t}){return a("div",{class:`${Bt}-toolui-section`,children:[a("span",{class:`${Bt}-toolui-label`,children:e}),a("pre",{class:`${Bt}-toolui-code`,children:t})]})}var Tt=L.cssPrefix;function vg({part:e,view:t,strings:n,locale:r,canAct:o,onDecision:i,onEdit:s,preview:l}){let c=t.approval,u=t.status==="waiting"||t.status==="submitted"||t.status==="approved",p=e.toolCallId;return a("details",{class:`${Tt}-toolui ${Tt}-toolui-collapsible`,open:u||c?.buttons==="change"||void 0,"data-testid":t.status==="waiting"?O.toolApproval:O.toolDecision,"data-status":t.status,children:[a("summary",{class:`${Tt}-toolui-head`,children:[a("span",{class:`${Tt}-toolui-prompt`,children:u&&c?c.ask:t.name}),t.system?a("span",{class:`${Tt}-toolui-system`,children:t.system}):null,a("span",{class:`${Tt}-toolui-head-end`,children:[t.decision?a(Wo,{decision:t.decision}):null,t.statusLabel?a(ja,{status:t.status,label:t.statusLabel}):null,a("span",{class:`${Tt}-toolui-chevron`,children:a(Wt,{})})]})]}),a("div",{class:`${Tt}-toolui-collapse-body`,children:[u&&l&&Wn(e.toolMetadata)?a(zx,{toolName:e.toolName,input:e.inputSig.value,preview:l,strings:n,locale:r}):null,a(Va,{view:t,strings:n}),c?.note?a("p",{class:`${Tt}-toolui-subtle`,children:c.note}):null,c?.buttons==="decide"?a("div",{class:`${Tt}-toolui-actions`,children:[a("button",{type:"button",class:`${Tt}-form-skip`,disabled:!o,onClick:()=>i(p,!1),"data-testid":O.toolDecline,children:n.decline}),a("button",{type:"button",class:`${Tt}-form-submit`,disabled:!o,onClick:()=>i(p,!0),"data-testid":O.toolApprove,children:n.approve})]}):null,c?.buttons==="change"?a("div",{class:`${Tt}-toolui-actions`,children:a("button",{type:"button",class:`${Tt}-form-skip`,onClick:()=>s(p),"data-testid":O.toolEdit,children:n.changeAnswer})}):null]})]})}function Ux(e){if(!(typeof e!="object"||e===null)&&"totals"in e)return"number"in e&&"items"in e?`root = Root([preview])
|
|
71
71
|
preview = Order(${JSON.stringify(e)})`:"lines"in e?`root = Root([preview])
|
|
72
|
-
preview = Cart(${JSON.stringify(e)})`:void 0}function zx({toolName:e,input:t,preview:n,strings:r,locale:o}){let[i,s]=$();U(()=>{let c=!0;return n(e,t).then(u=>{c&&s(Ux(u))}),()=>{c=!1}},[e,t,n]);let l=xe(()=>i?{textSig:oe(i),doneSig:oe(!0),replyDoneSig:oe(!0)}:void 0,[i]);return l?a("div",{class:`${Tt}-toolui-preview`,"data-testid":O.toolPreview,children:a(jl,{cssPrefix:Tt,textSig:l.textSig,doneSig:l.doneSig,replyDoneSig:l.replyDoneSig,strings:r,locale:o})}):null}var Fx=["text","email","phone","number","date","single-select","multi-select","boolean"];function vg(e){return e!==null&&typeof e=="object"}function bg(e,t){let n=vg(e)?e:{},o=(Array.isArray(n.questions)?n.questions:[]).map((i,s)=>Hx(i,s,t)).filter(i=>i!==null);return{intro:Wa(n.intro),questions:o}}function Hx(e,t,n){if(!vg(e))return null;let r=Fx.find(o=>o===e.type)??"text";return{key:Wa(e.key)??`q${t+1}`,question:Wa(e.question)??n,type:r,options:Array.isArray(e.options)?e.options.filter(o=>typeof o=="string"&&o.trim().length>0):void 0,required:typeof e.required=="boolean"?e.required:void 0,helpText:Wa(e.helpText)}}function qx(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 Sc(e,t,n){return e.questions.map(r=>{let o=qx(r.type),i=r.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(r.options??[]).map(s=>({value:s,label:s}));return{name:r.key,label:r.question,type:o,required:r.required??!1,options:i.length>0?i:void 0,validationHint:r.helpText}})}function Wa(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var lt=L.cssPrefix;function wc({fields:e,strings:t,submitLabel:n,onSubmit:r,skipLabel:o,onSkip:i,footerHint:s,submitOnEnter:l,disabled:c,initialValues:u,hideActions:p,fieldTypeLabels:_,rootTestId:d,submitTestId:f,skipTestId:v}){let[m,h]=$(()=>u??{}),[y,P]=$({}),[x,C]=$({});function S(I){x[I]&&C(D=>({...D,[I]:""}))}function g(I,D){h(A=>({...A,[I]:D})),S(I)}function b(I,D){P(A=>({...A,[I]:D})),S(I)}function k(I){if(I.preventDefault(),c)return;let D=Gx(e,m,y),A=tg(e,D,t);if(Object.keys(A).length>0){C(A);return}r(D)}function N(I){!l||I.key!=="Enter"||I.shiftKey||Da(I)||!I.target||!("tagName"in I.target)||I.target.tagName!=="TEXTAREA"||k(I)}return a("form",{class:`${lt}-form`,onSubmit:k,onKeyDown:N,onCompositionEnd:$a,"data-testid":d,noValidate:!0,children:[e.map(I=>a(jx,{field:I,value:m[I.name],otherText:y[I.name]??"",error:x[I.name],disabled:c,typeLabel:_?.[I.name],strings:t,onChange:D=>g(I.name,D),onOtherChange:D=>b(I.name,D)},I.name)),p?null:a("div",{class:`${lt}-form-actions`,children:[s?a("span",{class:`${lt}-form-hint`,children:s}):null,o&&i?a("button",{type:"button",class:`${lt}-form-skip`,onClick:i,disabled:c,"data-testid":v,children:o}):null,a("button",{type:"submit",class:`${lt}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function jx({field:e,value:t,otherText:n,error:r,disabled:o,typeLabel:i,strings:s,onChange:l,onOtherChange:c}){let u=ft(O.formField,e.name),p=_o(),_=Vx({field:e,value:t,otherText:n,disabled:o,strings:s,onChange:l,onOtherChange:c,fieldTid:u,labelId:p}),d=e.type==="radio"||e.type==="multiselect"?"div":"label";return a(d,{class:`${lt}-field`,"data-field":e.name,"data-invalid":r?"true":void 0,children:[a("span",{class:`${lt}-field-head`,children:[a("span",{class:`${lt}-field-label`,id:p,children:[e.label,e.required?a("span",{class:`${lt}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${lt}-field-type`,children:i}):null]}),_,e.validationHint&&!r?a("span",{class:`${lt}-field-hint`,children:e.validationHint}):null,r?a("span",{class:`${lt}-field-error`,role:"alert",children:r}):null]})}function Vx(e){let{field:t,value:n,otherText:r,disabled:o,strings:i,onChange:s,onOtherChange:l,fieldTid:c,labelId:u}=e,p=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${lt}-field-input`,rows:3,value:p,disabled:o,onInput:d=>s(d.currentTarget.value),"data-testid":c});case"radio":return a("div",{class:`${lt}-field-choices`,role:"radiogroup","aria-labelledby":u,"data-testid":c,children:(t.options??[]).map(d=>a("label",{class:`${lt}-choice`,children:[a("input",{type:"radio",name:`${lt}-${t.name}`,checked:p===d.value,disabled:o,onChange:()=>s(d.value)}),a("span",{children:d.label})]},d.value))});case"multiselect":{let f=function(v,m){return s(m?[...d,v]:d.filter(h=>h!==v))};var _=f;let d=Array.isArray(n)?n:[];return a("div",{class:`${lt}-field-choices`,role:"group","aria-labelledby":u,"data-testid":c,children:[(t.options??[]).map(v=>a("label",{class:`${lt}-choice`,children:[a("input",{type:"checkbox",checked:d.includes(v.value),disabled:o,onChange:m=>f(v.value,m.currentTarget.checked)}),a("span",{children:v.label})]},v.value)),(t.options??[]).length===0?a("textarea",{class:`${lt}-field-input`,rows:2,value:r,placeholder:i.formOtherPlaceholder,disabled:o,onInput:v=>l(v.currentTarget.value)}):null]})}default:return a("input",{...Wx(t.type),class:`${lt}-field-input`,value:p,disabled:o,onInput:d=>s(d.currentTarget.value),"data-testid":c})}}function Wx(e){switch(e){case"number":return{type:e};case"email":return{type:e};case"tel":return{type:e};case"date":return{type:e};default:return{type:"text"}}}function Gx(e,t,n){let r={...t};for(let o of e){let i=n[o.name]?.trim();if(o.type==="multiselect"&&i){let s=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),l=t[o.name];r[o.name]=[...Array.isArray(l)?l:[],...s]}}return r}var et=L.cssPrefix;function Kx({skipped:e,submitted:t,strings:n}){return e?{status:"replaced",statusLabel:n.inputSkipped}:t?{status:"submitted",statusLabel:n.stepWorkingOnIt}:{status:"done",statusLabel:n.inputAnswered}}var Qx={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Pg(e,t){let n={};for(let r of e)n[r.key]=t[Qx[r.type]];return n}function kc({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,folded:i=!1,onDecision:s,onEdit:l}){let c=xe(()=>Ze(()=>e.stateSig.value),[e]).value,u=xe(()=>Ze(()=>e.approvalSig.value),[e]).value,p=xe(()=>Ze(()=>bg(e.inputSig.value,t.askFallbackQuestion)),[e,t]).value,{terminal:_,decided:d}=mg(c,u),f=d&&u?.approved===!0,v=o&&!d,m=!d&&!r&&!v,h=!m&&!f&&!v,y=f&&n&&!_,P=p.questions,[x,C]=$(null),g=x??(m||f||v),[b,k]=$(!1),N=P.length>1?pc:Bo,I=m?t.inputRequired:t.inputBadge,D=v?a("p",{class:`${et}-toolui-subtle`,children:t.stepWorkingOnIt}):m?a(Yx,{req:p,strings:t,active:n,resolve:(j,Y)=>s(e.toolCallId,Y,j)}):b?a(wc,{fields:Sc(p,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Pg(P,t),initialValues:f?tS(P,u?.reason):void 0}):a(Jx,{questions:P,answers:f?eS(u?.reason):{},strings:t}),{status:A,statusLabel:z}=Kx({skipped:h,submitted:v,strings:t});return a("details",{class:`${et}-toolui ${et}-toolui-collapsible${r?` ${et}-toolui-stale`:""}`,open:g,onToggle:j=>{let Y=j.currentTarget.open;Y!==g&&C(Y)},"data-testid":m?O.toolAskQuestions:O.toolDecision,children:[a("summary",{class:`${et}-toolui-head`,children:[a("span",{class:`${et}-toolui-q-pill`,children:[a(N,{}),I]}),a("span",{class:`${et}-toolui-head-end`,children:[m||i?null:a(ja,{status:A,icon:h?a(zo,{}):a(sr,{}),label:z}),a("span",{class:`${et}-toolui-chevron`,children:a(Wt,{})})]})]}),a("div",{class:`${et}-toolui-collapse-body`,children:[p.intro?a("div",{class:`${et}-toolui-desc`,children:p.intro}):null,D,m||v?null:a("div",{class:`${et}-toolui-footer`,children:[a("button",{type:"button",class:`${et}-toolui-options-toggle`,onClick:()=>k(j=>!j),"data-testid":O.toolAskOptions,children:[a("span",{class:`${et}-toolui-options-chevron${b?` ${et}-open`:""}`,children:a(Wt,{})}),b?t.hideOptions:t.showOptions]}),y?a("button",{type:"button",class:`${et}-form-skip`,onClick:()=>l(e.toolCallId),"data-testid":O.toolEdit,children:t.edit}):null]})]})]})}function Yx({req:e,strings:t,active:n,resolve:r}){let o=Sc(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(wc,{fields:o,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:s=>r(Zx(e.questions,s),!0),skipLabel:t.inputSkip,onSkip:()=>r(void 0,!1),submitOnEnter:i,fieldTypeLabels:Pg(e.questions,t),submitTestId:O.toolInputSubmit,skipTestId:O.toolInputSkip})}function Jx({questions:e,answers:t,strings:n}){return a("div",{class:`${et}-toolui-summary`,"data-testid":O.toolAskSummary,children:e.map(r=>a("div",{class:`${et}-field`,children:[a("span",{class:`${et}-field-head`,children:a("span",{class:`${et}-field-label`,children:[r.question,r.required?a("span",{class:`${et}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${et}-toolui-answer`,children:Xx(r,t[r.key],n)||"\u2014"})]},r.key))})}function Xx(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Zx(e,t){let n=e.flatMap(r=>{let o=t[r.key],i=typeof o=="string"?o.trim():o;return i?.length?[{key:r.key,value:i}]:[]});return JSON.stringify({answers:n})}function xg(e){if(!e)return{};let t=(()=>{try{return JSON.parse(e)}catch{return}})(),n=yg(t)?t.answers:void 0;if(!Array.isArray(n))return{};let r={};for(let o of n)if(yg(o)){let{key:i,value:s}=o;if(typeof i!="string")continue;typeof s=="string"?r[i]=s:Array.isArray(s)&&(r[i]=s.filter(l=>typeof l=="string"))}return r}function yg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function eS(e){let t=xg(e),n={};for(let[r,o]of Object.entries(t))n[r]=Array.isArray(o)?o.join(", "):o;return n}function tS(e,t){let n=xg(t),r={};for(let o of e){let i=n[o.key];i!==void 0&&(o.type==="multi-select"?r[o.key]=Array.isArray(i)?i:[i]:r[o.key]=Array.isArray(i)?i[0]??"":i)}return r}var ue=L.cssPrefix;function kg(e,t){let n=[];for(let[r,o]of e.entries()){let i=n.at(-1),s=o.kind==="tool"?t.viewOf(o):void 0,l=nS(o,s,t.showReasoning);if(l){i?.kind==="steps"?(i.rows.push(l),i.indices.push(r)):n.push({kind:"steps",rows:[l],indices:[r]});continue}o.kind==="step-start"||o.kind==="reasoning"||o.kind==="source"&&!t.showSources||s?.placement==="hidden"||n.push({kind:"part",part:o,index:r})}return n}function nS(e,t,n){return e.kind==="reasoning"?n?{kind:"thought",part:e}:void 0:e.kind==="tool"&&t?.placement==="step"?{kind:"tool",part:e,view:t}:void 0}function rS(e,t){let n=[...new Set(t)];if(!(!e||n.length===0||n.some(r=>r<0||r>=e.length)))return n.reduce((r,o)=>r+(e[o]?.durationMs??0),0)}function Cg(e){let t=[];for(let n of e)t.push((t.at(-1)??-1)+(n.kind==="step-start"?1:0));return t}function oS(e,t){return e.streaming?t.thinking:e.reasoningMs===void 0?t.thought:t.thoughtFor.replace("{time}",Ga(e.reasoningMs))}function Ga(e){if(e<1e4)return`${Number((e/1e3).toFixed(1))} s`;let t=Math.round(e/1e3);return t<60?`${t} s`:`${Math.floor(t/60)} m ${t%60} s`}function iS(e){return e.split(`
|
|
73
|
-
`).map(t=>t.trim()).findLast(t=>/^\*\*[^*].*\*\*$/.test(t))?.slice(2,-2).trim()}function aS(e,t){return e?.kind==="tool"?`${e.view.name}\u2026`:(e&&iS(e.part.textSig.value))??t.thinking}function
|
|
72
|
+
preview = Cart(${JSON.stringify(e)})`:void 0}function zx({toolName:e,input:t,preview:n,strings:r,locale:o}){let[i,s]=$();U(()=>{let c=!0;return n(e,t).then(u=>{c&&s(Ux(u))}),()=>{c=!1}},[e,t,n]);let l=xe(()=>i?{textSig:oe(i),doneSig:oe(!0),replyDoneSig:oe(!0)}:void 0,[i]);return l?a("div",{class:`${Tt}-toolui-preview`,"data-testid":O.toolPreview,children:a(jl,{cssPrefix:Tt,textSig:l.textSig,doneSig:l.doneSig,replyDoneSig:l.replyDoneSig,strings:r,locale:o})}):null}var Fx=["text","email","phone","number","date","single-select","multi-select","boolean"];function bg(e){return e!==null&&typeof e=="object"}function yg(e,t){let n=bg(e)?e:{},o=(Array.isArray(n.questions)?n.questions:[]).map((i,s)=>Hx(i,s,t)).filter(i=>i!==null);return{intro:Wa(n.intro),questions:o}}function Hx(e,t,n){if(!bg(e))return null;let r=Fx.find(o=>o===e.type)??"text";return{key:Wa(e.key)??`q${t+1}`,question:Wa(e.question)??n,type:r,options:Array.isArray(e.options)?e.options.filter(o=>typeof o=="string"&&o.trim().length>0):void 0,required:typeof e.required=="boolean"?e.required:void 0,helpText:Wa(e.helpText)}}function qx(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 Sc(e,t,n){return e.questions.map(r=>{let o=qx(r.type),i=r.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(r.options??[]).map(s=>({value:s,label:s}));return{name:r.key,label:r.question,type:o,required:r.required??!1,options:i.length>0?i:void 0,validationHint:r.helpText}})}function Wa(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var lt=L.cssPrefix;function wc({fields:e,strings:t,submitLabel:n,onSubmit:r,skipLabel:o,onSkip:i,footerHint:s,submitOnEnter:l,disabled:c,initialValues:u,hideActions:p,fieldTypeLabels:_,rootTestId:d,submitTestId:f,skipTestId:v}){let[m,h]=$(()=>u??{}),[y,P]=$({}),[x,C]=$({});function S(I){x[I]&&C(D=>({...D,[I]:""}))}function g(I,D){h(A=>({...A,[I]:D})),S(I)}function b(I,D){P(A=>({...A,[I]:D})),S(I)}function k(I){if(I.preventDefault(),c)return;let D=Gx(e,m,y),A=ng(e,D,t);if(Object.keys(A).length>0){C(A);return}r(D)}function N(I){!l||I.key!=="Enter"||I.shiftKey||Da(I)||!I.target||!("tagName"in I.target)||I.target.tagName!=="TEXTAREA"||k(I)}return a("form",{class:`${lt}-form`,onSubmit:k,onKeyDown:N,onCompositionEnd:$a,"data-testid":d,noValidate:!0,children:[e.map(I=>a(jx,{field:I,value:m[I.name],otherText:y[I.name]??"",error:x[I.name],disabled:c,typeLabel:_?.[I.name],strings:t,onChange:D=>g(I.name,D),onOtherChange:D=>b(I.name,D)},I.name)),p?null:a("div",{class:`${lt}-form-actions`,children:[s?a("span",{class:`${lt}-form-hint`,children:s}):null,o&&i?a("button",{type:"button",class:`${lt}-form-skip`,onClick:i,disabled:c,"data-testid":v,children:o}):null,a("button",{type:"submit",class:`${lt}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function jx({field:e,value:t,otherText:n,error:r,disabled:o,typeLabel:i,strings:s,onChange:l,onOtherChange:c}){let u=ft(O.formField,e.name),p=_o(),_=Vx({field:e,value:t,otherText:n,disabled:o,strings:s,onChange:l,onOtherChange:c,fieldTid:u,labelId:p}),d=e.type==="radio"||e.type==="multiselect"?"div":"label";return a(d,{class:`${lt}-field`,"data-field":e.name,"data-invalid":r?"true":void 0,children:[a("span",{class:`${lt}-field-head`,children:[a("span",{class:`${lt}-field-label`,id:p,children:[e.label,e.required?a("span",{class:`${lt}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${lt}-field-type`,children:i}):null]}),_,e.validationHint&&!r?a("span",{class:`${lt}-field-hint`,children:e.validationHint}):null,r?a("span",{class:`${lt}-field-error`,role:"alert",children:r}):null]})}function Vx(e){let{field:t,value:n,otherText:r,disabled:o,strings:i,onChange:s,onOtherChange:l,fieldTid:c,labelId:u}=e,p=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${lt}-field-input`,rows:3,value:p,disabled:o,onInput:d=>s(d.currentTarget.value),"data-testid":c});case"radio":return a("div",{class:`${lt}-field-choices`,role:"radiogroup","aria-labelledby":u,"data-testid":c,children:(t.options??[]).map(d=>a("label",{class:`${lt}-choice`,children:[a("input",{type:"radio",name:`${lt}-${t.name}`,checked:p===d.value,disabled:o,onChange:()=>s(d.value)}),a("span",{children:d.label})]},d.value))});case"multiselect":{let f=function(v,m){return s(m?[...d,v]:d.filter(h=>h!==v))};var _=f;let d=Array.isArray(n)?n:[];return a("div",{class:`${lt}-field-choices`,role:"group","aria-labelledby":u,"data-testid":c,children:[(t.options??[]).map(v=>a("label",{class:`${lt}-choice`,children:[a("input",{type:"checkbox",checked:d.includes(v.value),disabled:o,onChange:m=>f(v.value,m.currentTarget.checked)}),a("span",{children:v.label})]},v.value)),(t.options??[]).length===0?a("textarea",{class:`${lt}-field-input`,rows:2,value:r,placeholder:i.formOtherPlaceholder,disabled:o,onInput:v=>l(v.currentTarget.value)}):null]})}default:return a("input",{...Wx(t.type),class:`${lt}-field-input`,value:p,disabled:o,onInput:d=>s(d.currentTarget.value),"data-testid":c})}}function Wx(e){switch(e){case"number":return{type:e};case"email":return{type:e};case"tel":return{type:e};case"date":return{type:e};default:return{type:"text"}}}function Gx(e,t,n){let r={...t};for(let o of e){let i=n[o.name]?.trim();if(o.type==="multiselect"&&i){let s=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),l=t[o.name];r[o.name]=[...Array.isArray(l)?l:[],...s]}}return r}var et=L.cssPrefix;function Kx({skipped:e,submitted:t,strings:n}){return e?{status:"replaced",statusLabel:n.inputSkipped}:t?{status:"submitted",statusLabel:n.stepWorkingOnIt}:{status:"done",statusLabel:n.inputAnswered}}var Qx={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function xg(e,t){let n={};for(let r of e)n[r.key]=t[Qx[r.type]];return n}function kc({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,folded:i=!1,onDecision:s,onEdit:l}){let c=xe(()=>Ze(()=>e.stateSig.value),[e]).value,u=xe(()=>Ze(()=>e.approvalSig.value),[e]).value,p=xe(()=>Ze(()=>yg(e.inputSig.value,t.askFallbackQuestion)),[e,t]).value,{terminal:_,decided:d}=hg(c,u),f=d&&u?.approved===!0,v=o&&!d,m=!d&&!r&&!v,h=!m&&!f&&!v,y=f&&n&&!_,P=p.questions,[x,C]=$(null),g=x??(m||f||v),[b,k]=$(!1),N=P.length>1?pc:Bo,I=m?t.inputRequired:t.inputBadge,D=v?a("p",{class:`${et}-toolui-subtle`,children:t.stepWorkingOnIt}):m?a(Yx,{req:p,strings:t,active:n,resolve:(j,Y)=>s(e.toolCallId,Y,j)}):b?a(wc,{fields:Sc(p,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:xg(P,t),initialValues:f?tS(P,u?.reason):void 0}):a(Jx,{questions:P,answers:f?eS(u?.reason):{},strings:t}),{status:A,statusLabel:z}=Kx({skipped:h,submitted:v,strings:t});return a("details",{class:`${et}-toolui ${et}-toolui-collapsible${r?` ${et}-toolui-stale`:""}`,open:g,onToggle:j=>{let Y=j.currentTarget.open;Y!==g&&C(Y)},"data-testid":m?O.toolAskQuestions:O.toolDecision,children:[a("summary",{class:`${et}-toolui-head`,children:[a("span",{class:`${et}-toolui-q-pill`,children:[a(N,{}),I]}),a("span",{class:`${et}-toolui-head-end`,children:[m||i?null:a(ja,{status:A,icon:h?a(zo,{}):a(sr,{}),label:z}),a("span",{class:`${et}-toolui-chevron`,children:a(Wt,{})})]})]}),a("div",{class:`${et}-toolui-collapse-body`,children:[p.intro?a("div",{class:`${et}-toolui-desc`,children:p.intro}):null,D,m||v?null:a("div",{class:`${et}-toolui-footer`,children:[a("button",{type:"button",class:`${et}-toolui-options-toggle`,onClick:()=>k(j=>!j),"data-testid":O.toolAskOptions,children:[a("span",{class:`${et}-toolui-options-chevron${b?` ${et}-open`:""}`,children:a(Wt,{})}),b?t.hideOptions:t.showOptions]}),y?a("button",{type:"button",class:`${et}-form-skip`,onClick:()=>l(e.toolCallId),"data-testid":O.toolEdit,children:t.edit}):null]})]})]})}function Yx({req:e,strings:t,active:n,resolve:r}){let o=Sc(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(wc,{fields:o,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:s=>r(Zx(e.questions,s),!0),skipLabel:t.inputSkip,onSkip:()=>r(void 0,!1),submitOnEnter:i,fieldTypeLabels:xg(e.questions,t),submitTestId:O.toolInputSubmit,skipTestId:O.toolInputSkip})}function Jx({questions:e,answers:t,strings:n}){return a("div",{class:`${et}-toolui-summary`,"data-testid":O.toolAskSummary,children:e.map(r=>a("div",{class:`${et}-field`,children:[a("span",{class:`${et}-field-head`,children:a("span",{class:`${et}-field-label`,children:[r.question,r.required?a("span",{class:`${et}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${et}-toolui-answer`,children:Xx(r,t[r.key],n)||"\u2014"})]},r.key))})}function Xx(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Zx(e,t){let n=e.flatMap(r=>{let o=t[r.key],i=typeof o=="string"?o.trim():o;return i?.length?[{key:r.key,value:i}]:[]});return JSON.stringify({answers:n})}function Sg(e){if(!e)return{};let t=(()=>{try{return JSON.parse(e)}catch{return}})(),n=Pg(t)?t.answers:void 0;if(!Array.isArray(n))return{};let r={};for(let o of n)if(Pg(o)){let{key:i,value:s}=o;if(typeof i!="string")continue;typeof s=="string"?r[i]=s:Array.isArray(s)&&(r[i]=s.filter(l=>typeof l=="string"))}return r}function Pg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function eS(e){let t=Sg(e),n={};for(let[r,o]of Object.entries(t))n[r]=Array.isArray(o)?o.join(", "):o;return n}function tS(e,t){let n=Sg(t),r={};for(let o of e){let i=n[o.key];i!==void 0&&(o.type==="multi-select"?r[o.key]=Array.isArray(i)?i:[i]:r[o.key]=Array.isArray(i)?i[0]??"":i)}return r}var ue=L.cssPrefix;function Cg(e,t){let n=[];for(let[r,o]of e.entries()){let i=n.at(-1),s=o.kind==="tool"?t.viewOf(o):void 0,l=nS(o,s,t.showReasoning);if(l){i?.kind==="steps"?(i.rows.push(l),i.indices.push(r)):n.push({kind:"steps",rows:[l],indices:[r]});continue}o.kind==="step-start"||o.kind==="reasoning"||o.kind==="source"&&!t.showSources||s?.placement==="hidden"||n.push({kind:"part",part:o,index:r})}return n}function nS(e,t,n){return e.kind==="reasoning"?n?{kind:"thought",part:e}:void 0:e.kind==="tool"&&t?.placement==="step"?{kind:"tool",part:e,view:t}:void 0}function rS(e,t){let n=[...new Set(t)];if(!(!e||n.length===0||n.some(r=>r<0||r>=e.length)))return n.reduce((r,o)=>r+(e[o]?.durationMs??0),0)}function Tg(e){let t=[];for(let n of e)t.push((t.at(-1)??-1)+(n.kind==="step-start"?1:0));return t}function oS(e,t){return e.streaming?t.thinking:e.reasoningMs===void 0?t.thought:t.thoughtFor.replace("{time}",Ga(e.reasoningMs))}function Ga(e){if(e<1e4)return`${Number((e/1e3).toFixed(1))} s`;let t=Math.round(e/1e3);return t<60?`${t} s`:`${Math.floor(t/60)} m ${t%60} s`}function iS(e){return e.split(`
|
|
73
|
+
`).map(t=>t.trim()).findLast(t=>/^\*\*[^*].*\*\*$/.test(t))?.slice(2,-2).trim()}function aS(e,t){return e?.kind==="tool"?`${e.view.name}\u2026`:(e&&iS(e.part.textSig.value))??t.thinking}function Rg({rows:e,steps:t=[],stepTimings:n,timed:r=!0,strings:o,running:i,runStartedAt:s,renderCard:l}){let[c,u]=$(!1),[p,_]=$(!1),d=vd(e.flatMap(P=>P.kind==="tool"?[P.view]:[])),f=e.at(-1),v=xe(()=>Ze(()=>aS(f,o)),[f,o]).value,m=r?rS(n,t):void 0;function h(){u(!c),_(!0)}let[y]=e;return!i&&e.length===1&&y?.kind==="tool"?a("div",{class:`${ue}-steps`,"data-testid":O.toolSteps,"data-stopped":d.stopped?"true":void 0,children:a(kg,{part:y.part,view:y.view,strings:o,durationMs:m,standalone:!0,renderCard:l})}):a("div",{class:`${ue}-steps`,"data-testid":O.toolSteps,"data-running":i?"true":void 0,"data-stopped":d.stopped?"true":void 0,children:[a("button",{type:"button",class:`${ue}-steps-head`,"aria-expanded":c,onClick:h,children:[a("span",{class:`${ue}-steps-icon`,"aria-hidden":"true",children:a(lS,{running:i,stopped:d.stopped!==void 0})}),a("span",{class:`${ue}-steps-label`,children:i?a("span",{class:`${ue}-steps-live`,children:v}):a(cS,{line:d,strings:o})}),!i&&d.failed>0?a("span",{class:`${ue}-steps-failed`,children:o.toolStepsFailed.replace("{count}",String(d.failed))}):null,i?null:d.marks.map(P=>a(Wo,{decision:P},P.title)),i&&s?a(sS,{since:s}):null,!i&&m!==void 0?a("span",{class:`${ue}-steps-time`,children:Ga(m)}):null,a("span",{class:`${ue}-steps-chevron`,"data-open":c?"true":void 0,children:a(Wt,{})})]}),a("span",{class:`${ue}-sr-only`,role:"status",children:i?v:""}),a("div",{class:`${ue}-steps-body`,"data-open":c?"true":void 0,inert:!c,children:a("div",{class:`${ue}-steps-body-inner`,children:p?a("ol",{class:`${ue}-steps-list`,children:e.map((P,x)=>P.kind==="tool"?a(kg,{part:P.part,view:P.view,strings:o,renderCard:l},P.part.toolCallId):a(Cc,{part:P.part,current:i&&x===e.length-1,reasoningMs:n?.[t[x]??-1]?.reasoningMs,strings:o},`${P.part.id}#${x}`))}):null})})]})}function sS({since:e}){let[t,n]=$(()=>Date.now());U(()=>{let o=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(o)},[]);let r=Math.max(0,Math.floor((t-Date.parse(e))/1e3));return a("span",{class:`${ue}-steps-time`,children:Ga(r*1e3)})}function lS({running:e,stopped:t}){return e?a("span",{class:`${ue}-loading-spinner`}):t?a(En,{}):a(gf,{})}function cS({line:e,strings:t}){return e.stopped?a(pe,{children:bd(e.stopped.finished,t)}):e.single?a(pe,{children:[e.single.name,e.single.summary?a(pe,{children:[a("span",{class:`${ue}-steps-sep`,"aria-hidden":"true",children:"\xB7"}),a("span",{class:`${ue}-steps-summary`,children:e.single.summary})]}):null,e.single.outcome?a("span",{class:`${ue}-steps-denied`,children:e.single.outcome}):null]}):a(pe,{children:e.tools.map(({name:n,count:r},o)=>a("span",{class:`${ue}-steps-name`,children:[o>0?a("span",{class:`${ue}-steps-sep`,"aria-hidden":"true",children:"\xB7"}):null,n,r>1?a("span",{class:`${ue}-steps-count`,children:["\xD7",r]}):null]},n))})}function dS({view:e}){let t=e.statusLabel&&e.status!=="running"?a("span",{class:e.status==="failed"?`${ue}-steps-failed`:`${ue}-steps-denied`,children:e.statusLabel}):null;return a(pe,{children:[e.decision?a(Wo,{decision:e.decision}):null,t]})}function wg({view:e,durationMs:t}){return a(pe,{children:[a("span",{class:`${ue}-steps-row-label`,children:[a("span",{class:`${ue}-steps-row-name`,children:e.name}),e.system?a("span",{class:`${ue}-steps-row-system`,children:e.system}):null,e.summary?a("span",{class:`${ue}-steps-row-summary`,children:e.summary}):null]}),a(dS,{view:e}),t!==void 0?a("span",{class:`${ue}-steps-time`,children:Ga(t)}):null]})}function kg({part:e,view:t,strings:n,durationMs:r,standalone:o=!1,renderCard:i}){let[s,l]=$(!1);return a(o?"div":"li",{class:`${ue}-steps-row`,"data-testid":O.toolStep,"data-status":t.status,"data-standalone":o?"true":void 0,children:[a("span",{class:`${ue}-steps-row-icon`,"aria-hidden":"true",children:a(xc,{status:t.status})}),a("div",{class:`${ue}-steps-row-main`,children:t.opens?a("button",{type:"button",class:`${ue}-steps-row-head`,"aria-expanded":s,onClick:()=>l(!s),children:[a(wg,{view:t,durationMs:r}),a("span",{class:`${ue}-steps-chevron`,"data-open":s?"true":void 0,children:a(Wt,{})})]}):a("span",{class:`${ue}-steps-row-head`,children:a(wg,{view:t,durationMs:r})})}),s&&t.opens?a("div",{class:`${ue}-steps-row-body`,children:(t.card?i?.(e,t):void 0)??a(Va,{view:t,strings:n})}):null]})}function Cc({part:e,current:t,reasoningMs:n,strings:r,standalone:o=!1}){let[i,s]=$(!1),l=xe(()=>Ze(()=>e.textSig.value.trim()===""),[e]).value,c=a("span",{class:t?`${ue}-steps-thought-label ${ue}-steps-live`:`${ue}-steps-thought-label`,children:oS({streaming:t,reasoningMs:n},r)});return a(o?"div":"li",{class:`${ue}-steps-row ${ue}-steps-thought`,"data-status":"thought","data-testid":o?O.reasoning:void 0,"data-standalone":o?"true":void 0,children:[a("span",{class:`${ue}-steps-row-icon`,"aria-hidden":"true",children:a(hf,{})}),a("div",{class:`${ue}-steps-row-main`,children:l?c:a("button",{type:"button",class:`${ue}-steps-row-head`,"aria-expanded":i,onClick:()=>s(!i),children:[c,a("span",{class:`${ue}-steps-chevron`,"data-open":i?"true":void 0,children:a(Wt,{})})]})}),i&&!l?a("div",{class:`${ue}-steps-thought-text ${ue}-reasoning-body`,children:a(Fo,{textSig:e.textSig,doneSig:e.doneSig})}):null]})}var Ge=L.cssPrefix,Ag=lg(uS);function uS({message:e,status:t,createdAt:n,strings:r,locale:o,responseMode:i,showReasoning:s,stepDisplay:l,showSources:c,interactive:u=!1,superseded:p=!1,tool:_,onRetry:d,enableMessageFeedback:f=!1,onFeedback:v,reconnecting:m=!1,clientToolRunning:h=!1,onCardAction:y}){let x=[...xe(()=>Ze(()=>e.partsSig.value),[e]).value];for(let ae of e.attachments??[])!ae.url||x.some(ve=>ve.kind==="file"&&ve.url===ae.url)||x.push({kind:"file",url:ae.url,mediaType:ae.mediaType,filename:ae.name,fileId:ae.id,fileSize:ae.size});let C=xe(()=>Ze(()=>or(e)),[e,t,e.canceled]),S=xe(()=>Ze(()=>dg(e)),[e]),g=xe(()=>Ze(()=>s&&ug(e)),[e,s]),b=xe(()=>Ze(()=>y_(e,g.value)),[e,g,t,e.canceled]),k=xe(()=>Ze(()=>!rc(e)),[e]),N=t==="streaming",I=e.role==="assistant"&&h,D=e.role==="assistant"&&(N||I),A=N||I,z=pg({streaming:D,responseMode:i,reasoningVisible:g.value,hasAnswerText:S.value,emptyReply:C.value,hidden:b.value}),{bufferedHold:j,showStreamDots:Y}=z;if(z.hidden)return null;let ie=_S(n,o),K=e.role==="assistant"||e.role==="operator",Te=f&&!!v&&!!e.serverMessageId&&K&&!A&&t!=="error"&&!C.value,Re=A?"":x.filter(ae=>ae.kind==="text").map(ae=>e.role==="assistant"?da(ae.textSig.peek()):ae.textSig.peek()).join(`
|
|
74
74
|
|
|
75
|
-
`).trim(),ye=!A&&t!=="error"&&!C.value&&Re.length>0,Oe=e.canceled===!0||t==="error";function fe(ae){return u&&t==="complete"&&ma(e,ae)}let tt=new Map;for(let[ae,ve]of x.entries()){if(ve.kind!=="tool")continue;let _e=Wn(ve.toolMetadata),be=md(gg(ve),{turn:{live:D||_e&&!p,cutOff:Oe,superseded:p,submitted:e.continuationStreaming===!0&&ve.approvalSig.value?.approved===void 0,canAct:fe(ae),interrupted:_e&&iu(ve.errorSig.value)},reader:{decides:!0},display:l,strings:r});tt.set(ve.toolCallId,be.placement==="card"&&!_?.humanInLoop?{...be,placement:"hidden"}:be)}function ht(ae){let ve=tt.get(ae.toolCallId);if(!ve)throw new Error(`no step view for ${ae.toolCallId}`);return ve}let nt=kg(x,{showReasoning:s,showSources:c,viewOf:ht}),bt=Cg(x),Ee=e.canceled===!0&&!N&&k.value&&g.value,Ue=nt.at(-1),Rt=Ue?.kind==="steps"?Ue.indices.at(-1):Ue?.index;function gt(ae,ve){return a(fS,{part:ae,generativeUi:e.role==="assistant",onCardAction:y,current:D&&ve===Rt,reasoningMs:e.stepTimings?.[bt[ve]??-1]?.reasoningMs,strings:r,locale:o,showReasoning:s,showSources:c,view:ae.kind==="tool"?tt.get(ae.toolCallId):void 0,canAct:fe(ve),superseded:p,continuationStreaming:e.continuationStreaming===!0,tool:_},`${hS(ae)}#${ve}`)}let ze=Te||ye;return a("div",{class:`${Ge}-bubble-row`,"data-role":e.role,"aria-busy":D?"true":void 0,"data-testid":ft(O.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${Ge}-bubble-col`,children:[a("div",{class:`${Ge}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${Ge}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${Ge}-bubble-body`,children:[j?a(bS,{label:r.loading}):nt.flatMap((ae,ve)=>ae.kind==="part"?[gt(ae.part,ae.index)]:ae.rows.some(_e=>_e.kind==="tool")?[a(Tg,{rows:ae.rows,steps:ae.indices.map(_e=>bt[_e]??-1),stepTimings:e.stepTimings,timed:!Oe,strings:r,running:D&&ve===nt.length-1,runStartedAt:e.runStartedAt,renderCard:(_e,be)=>be.card==="questions"&&_?a(kc,{part:_e,strings:r,active:!1,superseded:be.status==="replaced",folded:!0,onDecision:_.onDecision,onEdit:_.onEdit}):void 0},`steps#${ae.indices[0]}`)]:ae.rows.map((_e,be)=>gt(_e.part,ae.indices[be]??be))),Ee?a("div",{class:`${Ge}-steps-row`,"data-status":"stopped","data-testid":O.replyStopped,children:[a("span",{class:`${Ge}-steps-row-icon`,"aria-hidden":"true",children:a(En,{})}),a("div",{class:`${Ge}-steps-row-main`,children:a("span",{class:`${Ge}-steps-stopped-label`,children:r.statusStopped})})]}):null,Y&&!m?a(vS,{}):null,t==="error"||C.value?a(qo,{text:mS(e,t,r),retryLabel:r.errorRetry,onRetry:d?()=>d(e):void 0,retryTestId:O.messageRetry}):null,m&&D?a(qo,{text:r.errorReconnecting,retryTestId:O.messageRetry}):null]})]}),ie||ze?a("div",{class:`${Ge}-bubble-meta`,children:[ie?a("time",{class:`${Ge}-bubble-time`,dateTime:ie.iso,title:ie.full,children:ie.short}):null,ze?a("div",{class:`${Ge}-bubble-actions`,children:[Te&&e.serverMessageId?a(lg,{messageId:e.serverMessageId,initial:e.feedback??null,strings:r,onFeedback:v}):null,ye?a(pS,{text:Re,strings:r}):null]}):null]}):null]})})}function pS({text:e,strings:t}){let[n,r]=$(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})}let i=n?t.copied:t.copy;return a("button",{type:"button",class:`${Ge}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:o,"data-testid":O.messageCopy,children:n?a(zr,{}):a(uf,{})})}function _S(e,t){if(typeof e!="number"||!Number.isFinite(e))return null;try{let n=new Date(e);return{short:n.toLocaleTimeString(t,{hour:"numeric",minute:"2-digit"}),full:n.toLocaleString(t,{dateStyle:"full",timeStyle:"short"}),iso:n.toISOString()}}catch{return null}}function fS({part:e,generativeUi:t,onCardAction:n,current:r,reasoningMs:o,strings:i,locale:s,showReasoning:l,showSources:c,view:u,canAct:p,superseded:_,continuationStreaming:d,tool:f}){switch(e.kind){case"step-start":return null;case"text":return a(Fo,{textSig:e.textSig,doneSig:e.doneSig,generativeUi:t,strings:i,onCardAction:n});case"reasoning":return l?a(Cc,{part:e,current:r,reasoningMs:o,strings:i,standalone:!0}):null;case"tool":return u?.placement!=="card"||!f?null:u.card==="questions"?a(kc,{part:e,strings:i,active:p,superseded:_,continuationStreaming:d,onDecision:f.onDecision,onEdit:f.onEdit}):a(hg,{part:e,view:u,strings:i,locale:s,canAct:p,onDecision:f.onDecision,onEdit:f.onEdit,preview:f.preview});case"file":return a(gS,{part:e,strings:i});case"source":return c?a(pg,{part:e,strings:i}):null}}function gS({part:e,strings:t}){let n=e.filename??t.file;if(e.mediaType.startsWith("image/"))return a("a",{class:`${Ge}-file-image`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:n,"data-testid":O.messageFile,children:a("img",{src:e.url,alt:n,loading:"lazy"})});let r=(n.includes(".")?n.split(".").pop():e.mediaType.split("/").pop())?.toUpperCase(),o=e.fileSize===void 0?void 0:jr(e.fileSize);return a("a",{class:`${Ge}-file-chip`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:n,"data-testid":O.messageFile,children:[a("span",{class:`${Ge}-file-chip-icon`,"aria-hidden":"true",children:a(Ta,{})}),a("span",{class:`${Ge}-file-chip-text`,children:[a("span",{class:`${Ge}-file-chip-name`,children:n}),a("span",{class:`${Ge}-file-chip-meta`,children:[r,o].filter(Boolean).join(" \xB7 ")})]})]})}function mS(e,t,n){return e.errorText?e.errorText:t==="error"&&e.role==="assistant"?n.errorServer:n.errorGeneric}function hS(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 vS(){return a("span",{class:`${Ge}-typing`,"data-testid":O.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function bS({label:e}){return a("span",{class:`${Ge}-loading`,role:"status",children:[a("span",{class:`${Ge}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${Ge}-loading-label`,children:e})]})}var pn=L.cssPrefix,Ka=120,yS=350;function Ag({messagesSig:e,reconnectingSig:t,pageToolRunning:n,strings:r,notice:o,locale:i,responseMode:s,showReasoning:l,stepDisplay:c,showSources:u,enableMessageFeedback:p,onFeedback:_,loading:d,onLoadPreviousMessages:f,idle:v,controlMode:m="ai-agent",tool:h,onRetry:y,onCardAction:P}){let x=B(null),C=mt(()=>e.value),S=PS(i),[g,b]=$(!1),[k,N]=$(!1),I=B(!1),D=B(!1),[A,z]=$(),j=B(!1),Y=B(!1),ie=B(!1),K=B(0);function Te(){return ie.current||performance.now()-K.current<yS}let Re=B(0);function ye(M){let R=M.scrollHeight-M.clientHeight>1;M.dataset.fadeTop=R&&M.scrollTop>1?"true":"false",M.dataset.fadeBottom=R&&M.scrollHeight-M.scrollTop-M.clientHeight>1?"true":"false"}function Oe(M){return b(M.scrollHeight-M.scrollTop-M.clientHeight>Ka*2)}function fe(M){Re.current=performance.now(),M.scrollTop=M.scrollHeight,ye(M)}function tt(M,R){fe(M);let G=R,V=0;function te(){Y.current||Te()||(fe(M),--G>0&&(V=requestAnimationFrame(te)))}return R>0&&(V=requestAnimationFrame(te)),()=>cancelAnimationFrame(V)}function ht(M,R){let G,V,te,ge=-1;function le(){G.disconnect(),V.disconnect(),clearTimeout(te)}function me(){if(Y.current||Te()||ge>=0&&M.scrollTop<ge-4)return le();fe(M),ge=M.scrollTop}return G=new ResizeObserver(me),V=new MutationObserver(me),me(),G.observe(M),V.observe(M,{childList:!0,subtree:!0,characterData:!0}),te=setTimeout(le,R),le}let nt=C.value[0]?.id;ut(()=>{let M=x.current;if(M&&C.value.length!==0&&!D.current&&(j.current=!0,!!C.value.some(R=>R.role==="user")))return ht(M,300)},[nt]);let bt=B(0);U(()=>{let M=x.current,R=C.value,G=bt.current;if(bt.current=R.length,!M||!j.current||D.current)return;if(R.slice(G).some(te=>te.role==="user"))return Y.current=!1,tt(M,3);if(!R.some(te=>te.role==="user")||Y.current||Te())return;M.scrollHeight-M.scrollTop-M.clientHeight<Ka&&fe(M)},[C.value.length]);let Ee=B(null);U(()=>{let M=x.current,R=C.value.at(-1),G=Ee.current;if(Ee.current=R?{id:R.id,streaming:R.status==="streaming"}:null,!!M&&j.current&&!(!R||R.id!==G?.id||G.streaming||R.status!=="streaming"))return Y.current=!1,tt(M,3)},[C.value]),U(()=>{let M=x.current;if(!M)return;let R=C.value.at(-1);if(!R||R.status!=="streaming"&&!C.value.some(te=>te.role==="user"))return;let G=()=>{if(Y.current||Te())return;M.scrollHeight-M.scrollTop-M.clientHeight<Ka*2&&fe(M)};if(R.status!=="streaming")return ht(M,300);G();let V=new MutationObserver(G);return V.observe(M,{childList:!0,subtree:!0,characterData:!0}),()=>V.disconnect()},[C.value]),U(()=>{let M=x.current;if(!M)return;let R=()=>{Oe(M),ye(M),performance.now()-Re.current>150&&(Y.current=M.scrollHeight-M.scrollTop-M.clientHeight>8)};function G(){Y.current=!0}function V($e){$e.deltaY<0&&G()}let te=0;function ge($e){te=$e.touches[0]?.clientY??0,ie.current=!0}function le($e){($e.touches[0]?.clientY??0)>te+4&&G()}function me(){ie.current=!1,K.current=performance.now()}function Ye(){ie.current=!0}return M.addEventListener("scroll",R,{passive:!0}),M.addEventListener("wheel",V,{passive:!0}),M.addEventListener("touchstart",ge,{passive:!0}),M.addEventListener("touchmove",le,{passive:!0}),M.addEventListener("touchend",me,{passive:!0}),M.addEventListener("touchcancel",me,{passive:!0}),M.addEventListener("pointerdown",Ye,{passive:!0}),window.addEventListener("pointerup",me,{passive:!0}),window.addEventListener("pointercancel",me,{passive:!0}),Oe(M),()=>{M.removeEventListener("scroll",R),M.removeEventListener("wheel",V),M.removeEventListener("touchstart",ge),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",me),M.removeEventListener("touchcancel",me),M.removeEventListener("pointerdown",Ye),window.removeEventListener("pointerup",me),window.removeEventListener("pointercancel",me)}},[]),U(()=>{let M=x.current;if(!M)return;let R=M.clientHeight,G=new ResizeObserver(()=>{if(M.clientHeight===R)return;let V=M.scrollHeight-M.scrollTop-R<=Ka;R=M.clientHeight,!(!V||D.current)&&C.value.some(te=>te.role==="user")&&(Y.current=!1,fe(M))});return G.observe(M),()=>G.disconnect()},[]);function Ue(){let M=x.current;M&&(Y.current=!1,fe(M))}let Rt=C.value.filter(M=>!M.ephemeral),gt=Rt[0],ze=gt?.serverMessageId??gt?.id,ae=!!(f&&Rt.length>=cc&&ze!==A);async function ve(){if(!f||I.current)return;let M=x.current,R=M?.scrollHeight??0,G=M?.scrollTop??0;I.current=!0,D.current=!0,N(!0);try{let V=await f();V===!1&&ze&&z(ze),V&&M&&(await new Promise(te=>requestAnimationFrame(()=>requestAnimationFrame(()=>te()))),M.scrollTop=G+M.scrollHeight-R,ye(M),Oe(M))}finally{D.current=!1,I.current=!1,N(!1)}}let _e=[],be="",Ce=C.value.at(-1)?.id,Ot=t?.value===!0,ct=n===!0;for(let M of C.value){if(M.role==="assistant"&&M.id!==Ce&&or(M))continue;let R=xS(M.createdAt);R&&R!==be&&(_e.push(a("div",{class:`${pn}-date-divider`,children:a("span",{class:`${pn}-date-pill`,title:SS(M.createdAt,S),children:wS(M.createdAt,r,S)})},`day:${R}`)),be=R);let V=M.retryAction!==void 0||M.role==="assistant"&&M.id===Ce?ba(C.value,M):void 0,te=V!==void 0&&(V.kind!=="continue-assistant"||m==="ai-agent");_e.push(a(Rg,{message:M,status:M.status,createdAt:M.createdAt,strings:r,locale:S,responseMode:s,showReasoning:l,stepDisplay:c,showSources:u,interactive:!!v&&m==="ai-agent"&&M.id===Ce,superseded:M.id!==Ce,tool:h,onRetry:v&&te&&(M.role==="user"||M.id===Ce)?y:void 0,enableMessageFeedback:p,onFeedback:_,reconnecting:Ot&&M.id===Ce,clientToolRunning:ct&&M.id===Ce&&M.role==="assistant",onCardAction:P},M.id))}return a("div",{class:`${pn}-list-wrap`,children:[a("div",{ref:x,class:`${pn}-list ${pn}-list--fade`,part:"messages",role:"log","aria-live":"polite","aria-relevant":"additions text",children:[d&&C.value.length===0?a("div",{class:`${pn}-list-loading`,role:"status",children:r.conversationLoading}):null,o&&!ae?a("div",{class:`${pn}-chat-notice`,role:"note","data-testid":O.chatNotice,children:a(Ma,{text:o})}):null,ae?a("div",{class:`${pn}-load-previous`,children:a("button",{type:"button",onClick:ve,disabled:k,"aria-busy":k,"data-testid":O.loadPreviousMessages,children:r.loadPreviousMessages})}):null,_e]}),g?a("button",{type:"button",class:`${pn}-jump`,onClick:Ue,"aria-label":r.scrollToBottom,title:r.scrollToBottom,"data-testid":O.scrollToBottom,children:a(Wt,{})}):null]})}function PS(e){try{return Intl.getCanonicalLocales(e)[0]}catch{return}}function xS(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function SS(e,t){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(t,{dateStyle:"full"})}catch{return""}}function wS(e,t,n){let r=new Date(e);function o(s){return new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime()}let i=Math.round((o(new Date)-o(r))/864e5);return i<=0?t.dateToday:i===1?t.dateYesterday:i<7?r.toLocaleDateString(n,{weekday:"long"}):r.toLocaleDateString(n,{month:"long",day:"numeric",year:"numeric"})}var kS=16,CS=64;function Qa({panelEl:e,resize:t,position:n,edge:r,initialSize:o,onSizeChange:i,onResizeStart:s,strings:l}){let c=L.cssPrefix,u=B(null),[p,_]=$(null),d=o?.width,f=o?.height;if(U(()=>{if(!e)return;let A=e.style;A.setProperty(`--${c}-resize-min-w`,t.minWidth??"320px"),A.setProperty(`--${c}-resize-min-h`,t.minHeight??"400px"),t.maxWidth&&A.setProperty(`--${c}-resize-max-w`,t.maxWidth),t.maxHeight&&A.setProperty(`--${c}-resize-max-h`,t.maxHeight),d!==void 0&&f!==void 0&&(A.setProperty(`--${c}-widget-w`,`${d}px`),A.setProperty(`--${c}-widget-h`,`${f}px`)),_(Math.round(e.getBoundingClientRect().width/window.innerWidth*100))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,c,d,f]),!e)return null;let v=n.startsWith("top-"),m=n.endsWith("-right"),h=m?-1:1,y=v?1:-1,P=`${c}-resize-grip--${r?"edge":`${v?"bottom":"top"}-${m?"left":"right"}`}`;function x(A){A.setAttribute("data-resizing",""),s?.()}function C(A,z,j){A.style.setProperty(`--${c}-widget-w`,`${z}px`),r||A.style.setProperty(`--${c}-widget-h`,`${j}px`)}function S(A){let z=A.getBoundingClientRect(),j={width:Math.round(z.width),height:Math.round(z.height)};A.style.setProperty(`--${c}-widget-w`,`${j.width}px`),r||A.style.setProperty(`--${c}-widget-h`,`${j.height}px`),_(Math.round(j.width/window.innerWidth*100)),i(j)}function g(A){if(!e)return;let z=e.getBoundingClientRect();u.current={pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,startW:z.width,startH:z.height,moved:!1},A.currentTarget.setPointerCapture(A.pointerId),A.preventDefault()}function b(A){let z=u.current;if(!z||A.pointerId!==z.pointerId||!e)return;let j=(A.clientX-z.startX)*h,Y=r?0:(A.clientY-z.startY)*y;!z.moved&&j===0&&Y===0||(z.moved||x(e),z.moved=!0,C(e,z.startW+j,z.startH+Y))}function k(A){let z=u.current;!z||A.pointerId!==z.pointerId||!e||(A.currentTarget.releasePointerCapture(A.pointerId),u.current=null,z.moved&&(e.removeAttribute("data-resizing"),S(e)))}function N(A){return A==="ArrowLeft"?[-1,0]:A==="ArrowRight"?[1,0]:r?null:A==="ArrowUp"?[0,-1]:A==="ArrowDown"?[0,1]:null}function I(A){let z=N(A.key);if(!z||!e)return;A.preventDefault();let j=A.shiftKey?CS:kS;A.repeat||x(e);let Y=e.getBoundingClientRect();C(e,Y.width+z[0]*j*h,Y.height+z[1]*j*y)}function D(A){!N(A.key)||!e||(e.removeAttribute("data-resizing"),S(e))}return a("div",{class:`${c}-resize-grip ${P}`,role:"separator","aria-orientation":"vertical","aria-label":l.resizeHandle,"aria-valuenow":p??void 0,tabIndex:0,title:l.resizeHandle,onPointerDown:g,onPointerMove:b,onPointerUp:k,onPointerCancel:k,onKeyDown:I,onKeyUp:D,"data-testid":O.resizeGrip,children:r?null:a(J_,{})})}var Ig=L.cssPrefix;function Eg({suggestions:e,strings:t,onPick:n,disabled:r=!1}){let o=B(null),[i,s]=$({start:!1,end:!1});return U(()=>{let l=o.current;if(!l)return;function c(){if(!l)return;let p=Math.abs(l.scrollLeft),_=p>1,d=p<l.scrollWidth-l.clientWidth-1;s(f=>f.start===_&&f.end===d?f:{start:_,end:d})}c(),l.addEventListener("scroll",c,{passive:!0});let u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(c);return u?.observe(l),()=>{l.removeEventListener("scroll",c),u?.disconnect()}},[e]),e.length===0?null:a("div",{ref:o,class:`${Ig}-suggestions`,role:"group","aria-label":t.suggestedReplies,"data-cut-start":i.start?"true":void 0,"data-cut-end":i.end?"true":void 0,children:e.map((l,c)=>a("button",{type:"button",class:`${Ig}-suggestion`,onClick:()=>n(l),disabled:r,"data-testid":ft(O.suggestion,c),children:l.label},l.id))})}var lr=L.cssPrefix,TS=`.${lr}-header, .${lr}-back-header, .${lr}-home-hero`,RS='button, a, input, textarea, select, [role="tab"], [contenteditable]',Mg=56;function Ya(e,t){U(()=>{if(!t||!e)return;function n(c){return Number.parseFloat(c)||0}function r(c,u){return Math.min(u,Math.max(-u,c))}let o=null,i=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(TS)||u.closest(RS))return;let p=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${lr}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${lr}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-Mg,maxY:(window.innerHeight+p.height)/2-Mg},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!o||c.pointerId!==o.id)return;let u=r(o.dx+c.clientX-o.x,o.maxX),p=r(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${lr}-modal-dx`,`${u}px`),e.style.setProperty(`--${lr}-modal-dy`,`${p}px`)},l=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Ja({containerRef:e,onDrop:t,accept:n,disabled:r=!1}){let[o,i]=$();return U(()=>{if(r){i(void 0);return}let s=e.current;if(!s)return;let l=0;function c(d){l+=1,d.dataTransfer?.types.includes("Files")&&(d.preventDefault(),i([...d.dataTransfer.items].every(f=>f.kind!=="file"||Nf(f.type,n))?"accept":"reject"))}function u(){l-=1,!(l>0)&&(l=0,i(void 0))}function p(d){d.dataTransfer?.types.includes("Files")&&d.preventDefault()}function _(d){l=0,i(void 0),d.dataTransfer&&(d.preventDefault(),t(d.dataTransfer.items))}return s.addEventListener("dragenter",c),s.addEventListener("dragleave",u),s.addEventListener("dragover",p),s.addEventListener("drop",_),()=>{s.removeEventListener("dragenter",c),s.removeEventListener("dragleave",u),s.removeEventListener("dragover",p),s.removeEventListener("drop",_)}},[n,e,r,t]),r?void 0:o}var Se=L.cssPrefix;function Lg(e){let{options:t,onClose:n}=e,r=t.strings,o=B(null);U(()=>{let u=o.current;if(!u||!n)return;let p=Hr(u);function _(d){d.key==="Escape"&&n?.()}return u.addEventListener("keydown",_),()=>{p(),u.removeEventListener("keydown",_)}},[n]);let i=e.composerApiRef,s=e.composerActive&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,l=F(u=>{s&&i.current?.attachFromDrop(u)},[i,s]),c=Ja({containerRef:o,onDrop:l,accept:e.options.attachments.accept,disabled:!s});return Ya(o.current,t.mode==="modal"),a("div",{ref:o,class:`${Se}-panel`,part:"panel",role:"dialog","aria-modal":"false","aria-label":r.panelTitle,style:{position:"relative"},"data-testid":O.panel,children:[a(Tc,{...e,containerEl:o.current,dragOver:c}),a(Rc,{poweredBy:e.options.poweredBy,strings:e.options.strings})]})}function Tc(e){let{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,composerKey:l,panelSize:c,view:u,isStreaming:p,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,sendPreparing:m,attachmentUploadsSig:h,controlMode:y,assignedOperator:P,operatorAvailable:x,operatorRequestEnabled:C,onRequestOperator:S,onCancelOperatorRequest:g,loadingMessages:b,onLoadPreviousMessages:k,messagesSig:N,reconnectingSig:I,agent:D,ticketReference:A,login:z,onStartAsGuest:j,suggestions:Y,initialWidgetSize:ie,onClose:K,onBack:Te,onExpand:Re,onToggleHistory:ye,onSelectHistoryConversation:Oe,onNewConversation:fe,onWidgetSizeChange:tt,onSend:ht,onStop:nt,onSuggestion:bt,tool:Ee,onRetry:Ue,onMessageFeedback:Rt,onCardAction:gt,containerEl:ze,dragOver:ae,composerApiRef:ve}=e,_e=t.strings,be=y==="operator"?P:void 0,Ce=be?{name:be.name??be.initials,avatar:be.avatar,title:_e.operatorBadgeTitle,status:"online"}:D,Ot=t.header.showNotice?at(_e,t.header.notice||"chatNotice"):void 0,ct=mt(()=>N.value.some(le=>!le.ephemeral&&le.role!=="system")).value,M=mt(()=>N.value.length>0).value,[R,G]=$(),V=R===s,te=t.features.emailTranscript&&ct?()=>G(s):void 0,ge=z.gate?a(NS,{login:{...z,gate:z.gate},alone:!M,onStartAsGuest:j,strings:_e}):a(pe,{children:[y&&y!=="ai-agent"?a(IS,{controlMode:y,operatorName:P?.name??P?.initials,operatorAvailable:x,onCancelOperatorRequest:g,strings:_e}):null,_&&y==="ai-agent"?a("div",{class:`${Se}-loading ${Se}-compaction-status`,role:"status","data-testid":O.compactionStatus,children:[a("span",{class:`${Se}-loading-spinner`,"aria-hidden":"true"}),_e.compactingContext]}):null,!p&&!_&&y==="ai-agent"&&a(Eg,{suggestions:Y,strings:_e,onPick:bt,disabled:m}),a(Ff,{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,maxMessageCharacters:e.maxMessageCharacters,isStreaming:p,pageToolRunning:e.pageToolRunning,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,active:e.composerActive&&u==="chat",isPreparing:m,attachmentUploadsSig:h,operatorRequestEnabled:C,canRequestOperator:ct,controlMode:y,onRequestOperator:S,onSend:ht,onStop:nt,apiRef:ve},l)]});return a(pe,{children:[u==="history"?a(AS,{strings:_e,onBack:ye,onClose:K,showClose:Pa(t.mode,c,t.actions)}):a("header",{class:`${Se}-header`,part:"header","data-variant":t.header.variant,"data-testid":O.panelHeader,children:[Te?a("button",{type:"button",class:`${Se}-icon-btn`,onClick:Te,"aria-label":_e.moduleBack,title:_e.moduleBack,children:a(Do,{})}):null,Ce?a(Kf,{agent:Ce,strings:_e,ticketReference:A,person:!!be}):a("h1",{children:_e.panelTitle}),a(Jt,{panelProps:z.gate?{...e,options:{...t,actions:t.actions.filter(le=>le!=="history")}}:e,variant:"chat",onEmailTranscript:te,onLogIn:z.menuLogIn})]}),u==="history"?a(Ha,{transport:n,strings:_e,locale:t.locale,persistence:i,onSelect:Oe,onNewConversation:fe}):a(pe,{children:[a(eg,{state:ae,strings:_e}),z.strip?a(LS,{strip:z.strip,onLogIn:z.onLogIn,onHide:z.onHidePrompt,strings:_e}):null,z.gate&&!M?null:a(Ag,{messagesSig:N,reconnectingSig:I,pageToolRunning:e.pageToolRunning,strings:_e,notice:Ot,locale:t.locale,responseMode:t.responseMode,showReasoning:t.showReasoning,stepDisplay:t.stepDisplay,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Rt,loading:b,onLoadPreviousMessages:k,idle:!p&&!m,controlMode:y,tool:Ee,onRetry:Ue,onCardAction:gt}),ge,a(MS,{disclaimer:t.composerDisclaimer}),V?a(rg,{transport:n,strings:_e,knownEmail:ng({tokenEmail:z.email,userContext:t.userContext}),onClose:()=>G(void 0)}):null]}),t.size.resize?.enabled?a(Qa,{panelEl:ze,resize:t.size.resize,position:t.position,edge:t.mode==="drawer",initialSize:ie,onSizeChange:tt,onResizeStart:t.mode==="floating"&&c==="expanded"?Re:void 0,strings:_e}):null]})}function AS({strings:e,onBack:t,onClose:n,showClose:r}){return a("header",{class:`${Se}-header`,part:"header",children:[a("button",{type:"button",class:`${Se}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(Do,{})}),a("h1",{children:e.historyTitle}),r?a("button",{type:"button",class:`${Se}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(Ct,{})}):null]})}function IS({controlMode:e,operatorName:t,operatorAvailable:n,onCancelOperatorRequest:r,strings:o}){let[i,s]=$(!1),l=ES(e,t,n,o);function c(){r&&(s(!0),r().finally(()=>s(!1)))}return a("div",{class:`${Se}-operator-banner`,"data-mode":e,"data-available":n===!1?"false":void 0,"data-testid":O.operatorBanner,children:[a("span",{class:`${Se}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${Se}-operator-label`,role:"status",children:l}),e==="awaiting-operator"&&r?a("button",{type:"button",class:`${Se}-icon-btn ${Se}-operator-dismiss`,onClick:c,disabled:i,"aria-label":o.cancelOperatorRequest,title:o.cancelOperatorRequest,"data-testid":O.cancelOperatorRequest,children:a(Ct,{})}):null]})}function ES(e,t,n,r){return e==="operator"?r.chattingWithOperator.replace("{operator}",t??""):n===!1?r.noOperatorAvailable:r.connectingOperator}function MS({disclaimer:e}){return e?a("div",{class:`${Se}-composer-footer`,children:a("div",{class:`${Se}-disclaimer`,children:e})}):null}function LS({strip:e,onLogIn:t,onHide:n,strings:r}){let o=e.kind==="user";return a("div",{class:`${Se}-login-bar`,"data-kind":e.kind,role:o?"status":"note","data-testid":o?O.loggedIn:O.loginBar,children:[a("span",{class:`${Se}-login-bar-icon`,"aria-hidden":"true",children:a(dn,{})}),o?a("span",{class:`${Se}-login-bar-text`,children:e.who?r.loggedInAs.replace("{name}",e.who):r.loggedIn}):a(pe,{children:[a("span",{class:`${Se}-login-bar-text`,children:r.loginPrompt}),a("button",{type:"button",class:`${Se}-login-bar-action`,onClick:t,"data-testid":O.loginBarAction,children:r.loginAction}),a("button",{type:"button",class:`${Se}-icon-btn ${Se}-login-bar-hide`,onClick:n,"aria-label":r.dismissLoginPrompt,title:r.dismissLoginPrompt,"data-testid":O.loginBarHide,children:a(Ct,{})})]})]})}function OS(e,t){return e.gate==="required"?t.loginRequired:e.canStartAsGuest?t.loginExpiredGuest:t.loginExpired}function NS({login:e,alone:t,onStartAsGuest:n,strings:r}){return a("div",{class:`${Se}-login-gate`,"data-gate":e.gate,"data-alone":t?"":void 0,"data-testid":O.loginGate,children:[a("span",{class:`${Se}-login-gate-icon`,"aria-hidden":"true",children:a(dn,{})}),a("p",{class:`${Se}-login-gate-title`,role:"status",children:OS(e,r)}),e.canLogIn||e.canStartAsGuest?a("div",{class:`${Se}-form-actions ${Se}-login-gate-actions`,children:[e.canStartAsGuest?a("button",{type:"button",class:`${Se}-form-skip`,onClick:n,"data-testid":O.loginGateGuest,children:r.startAsGuest}):null,e.canLogIn?a("button",{type:"button",class:`${Se}-form-submit`,onClick:e.onLogIn,"data-testid":O.loginGateAction,children:r.loginAction}):null]}):null]})}function Rc({poweredBy:e,strings:t}){return e?a("div",{class:`${Se}-poweredby-bar`,children:a($S,{logoUrl:e.logoUrl,text:e.text??t.poweredBy.replace("{name}",L.displayName),href:e.href})}):null}function $S({logoUrl:e,text:t,href:n}){let r=a(pe,{children:[e?a("img",{class:`${Se}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${Se}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:r}):a("span",{class:`${Se}-poweredby`,children:r})}var Xa=L.cssPrefix;function Og({panelProps:e,enabledModules:t,nav:n,bus:r,hasUnread:o,latestNews:i,onSelectConversation:s,onStartNewConversation:l,onSetPanelSize:c}){let u=e.options,p=u.strings,_=B(null),d=B(new Set);U(()=>{let j=_.current;if(!j||!e.onClose)return;let Y=Hr(j);function ie(K){K.key==="Escape"&&e.onClose?.()}return j.addEventListener("keydown",ie),()=>{Y(),j.removeEventListener("keydown",ie)}},[e.onClose]);let f=mt(()=>n.sig.value).value,v=U_(f),m=u.modules.byId[f.activeTab],h=e.composerActive&&m?.layout==="chat"&&v===void 0,y=e.composerApiRef,P=h&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,x=F(j=>{P&&y.current?.attachFromDrop(j)},[y,P]),C=Ja({containerRef:_,onDrop:x,accept:e.options.attachments.accept,disabled:!P});Ya(_.current,u.mode==="modal");let S=v?.kind==="content",g=t.length>1&&z_(f),b=B(null);U(()=>{if(S&&b.current===null)b.current=e.panelSize,e.panelSize==="normal"&&c("expanded");else if(!S&&b.current!==null){let j=b.current;b.current=null,c(j)}},[S]);let k={push:j=>n.push(j),pop:()=>n.pop(),switchTab:j=>n.switchTab(j),switchToLayout:j=>{let Y=t.find(ie=>ie.layout===j);Y&&n.switchTab(Y.id)},selectConversation:s,startNewConversation:l};function N(j){return{options:u,transport:e.transport,strings:p,config:j,nav:k,bus:r,panelProps:e,latestNews:i}}let I=a(Jt,{panelProps:e,variant:"plain"});m&&d.current.add(m.id);let D=t.filter(j=>d.current.has(j.id));function A(j){if(j.layout==="chat")return a(Tc,{...e,composerActive:h,containerEl:_.current,dragOver:C});let Y=Fa[j.layout].Root;return Y?a(Y,{...N(j)}):null}function z(){return v?.kind==="content"?a(Cf,{id:v.id,title:v.title,transport:e.transport,strings:p,bus:r,onBack:()=>n.pop(),actions:I}):null}return a("div",{ref:_,class:`${Xa}-panel ${Xa}-messenger`,part:"panel",role:"dialog","aria-modal":"false","aria-label":p.panelTitle,style:{position:"relative"},"data-testid":O.messengerHome,children:[a("div",{class:`${Xa}-messenger-body`,children:[D.map(j=>a("div",{class:`${Xa}-messenger-pane`,hidden:S||j.id!==m?.id,children:A(j)},j.id)),z()]}),g?a(Gf,{modules:t,activeTab:f.activeTab,strings:p,hasUnread:o,onSelect:j=>n.switchTab(j)}):null,a(Rc,{poweredBy:u.poweredBy,strings:u.strings}),u.size.resize?.enabled&&!(m?.layout==="chat"&&!v)?a(Qa,{panelEl:_.current,resize:u.size.resize,position:u.position,edge:u.mode==="drawer",initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,onResizeStart:u.mode==="floating"&&e.panelSize==="expanded"?e.onExpand:void 0,strings:p}):null]})}function Ng(e){let t=L.cssPrefix,{site:n,blocks:r,strings:o,collapsed:i}=e,s=r?.navigation??[],l=r?.linkCards??[],c=i?o.expandSidebar:o.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":O.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(DS,{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":O.sidebarToggle,children:a(BS,{collapsed:i})})]}),i?null:a(pe,{children:[s.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(US,{items:s})}):null,l.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(zS,{items:l})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(Ha,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function DS({site:e}){let t=L.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??L.name})}function BS({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 US({items:e}){let t=L.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 zS({items:e}){let t=L.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 $g=L.cssPrefix;function Dg(e){return a("main",{class:`${$g}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a(Ng,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),a("section",{class:`${$g}-page-chat`,"aria-label":e.strings.panelTitle,children:e.children})]})}var Go=L.cssPrefix;function Ac({strings:e,text:t,onClose:n}){return a("div",{class:`${Go}-panel ${Go}-panel-notice`,part:"panel",role:"dialog","aria-label":e.panelTitle,"data-testid":O.panelNotice,children:[n?a("button",{type:"button",class:`${Go}-icon-btn ${Go}-panel-notice-close`,onClick:n,"aria-label":e.close,title:e.close,children:a(Ct,{})}):null,a("p",{class:`${Go}-panel-notice-text`,children:t})]})}var Ko=ee.scope("hitl");function Qo(e){return e.kind==="tool"&&Wn(e.toolMetadata)&&(e.stateSig.value==="input-available"||e.stateSig.value==="approval-responded"&&e.approvalSig.value?.approved===!0)}function Bg(e,t){t.errorSig.value=Qs(t.toolCallId),t.stateSig.value="output-error",e.partsSig.value=[...e.partsSig.value]}function Ug(e,t){let n=e.slice(0,e.indexOf(t)).findLast(r=>r.role==="user");return n!==void 0&&xt.sentHere(n.id)}function zg(e){let{streaming:t,controlModeSig:n,messagesSig:r,sendAiTurn:o,bus:i,humanInLoop:s,tools:l}=e,c=B(t);c.current=t;let u=B(l);u.current=l;let p=B(new Map),_=mt(()=>{let x=r.value,C=x.at(-1);return n.value!=="ai-agent"||C?.role!=="assistant"||C.status!=="complete"?!1:C.partsSig.value.some(S=>Qo(S)&&xt.get(S.toolCallId)?.state!=="stopped")&&Ug(x,C)}).value,d=F((x,C,S)=>{if(c.current||n.value!=="ai-agent")return!1;let g=r.value.at(-1),b=g?.partsSig.value.findIndex(I=>I.kind==="tool"&&I.toolCallId===x)??-1,k=g?.partsSig.value[b];if(!g||k?.kind!=="tool")return Ko.warn("decideTool: tool part not found",{toolCallId:x}),!1;if(g.status!=="complete"||!ma(g,b)||!C(k))return!1;if(S(k),g.partsSig.value=[...g.partsSig.value],!ir(g)||g.partsSig.value.some(Qo))return!0;g.status="streaming",g.retryAction={kind:"continue-assistant",messageId:g.serverMessageId??g.id},g.awaitingContinuation=!0,r.value=[...r.value];let N=g.partsSig.value.flatMap(I=>I.kind==="tool"?[I.toolCallId]:[]);return o({continueExisting:!0}).then(I=>I&&xt.clear(N)),!0},[n,r,o]),f=F((x,C)=>{let{toolCallId:S,toolName:g}=C;p.current.has(S)||(p.current.set(S,x),ou({toolCallId:S,toolName:g,input:C.inputSig.value,optionTools:u.current??[],onSettled:(b,k)=>{Ko.info("toolResult",{toolCallId:S,status:b}),i.emit("toolResult",{toolCallId:S,name:Cr(g),status:b,durationMs:k})}}).then(b=>{p.current.delete(S)&&d(S,Qo,k=>{b.state==="output-available"?k.outputSig.value=b.output:k.errorSig.value=b.errorText,k.stateSig.value=b.state})}))},[i,d]),v=F(()=>{let x=r.value;for(let[g,b]of p.current){let k=x.findIndex(N=>N.id===b);k<0||k===x.length-1||(p.current.delete(g),au(g))}let C=x.at(-1);if(c.current||C?.role!=="assistant"||C.status!=="complete")return;let S=C.partsSig.value.filter(Qo);if(!(S.length===0||!Ug(x,C)))for(let g of S)xt.get(g.toolCallId)?.state==="stopped"?Bg(C,g):f(C.id,g)},[r,f]);U(()=>v(),[t,v]),U(()=>r.subscribe(()=>v()),[r,v]);let m=F((x,C,S)=>{let g=!1,b;if(!d(x,I=>I.stateSig.value==="approval-requested",I=>{Wn(I.toolMetadata)&&(b=I),g=I.toolMetadata?.card==="questions";let D=I.approvalSig.value?.id??x;I.approvalSig.value={id:D,approved:C,reason:S},I.stateSig.value="approval-responded"}))return;let N=r.value.at(-1);if(b&&C&&N&&f(N.id,b),b&&!C&&i.emit("toolResult",{toolCallId:x,name:Cr(b.toolName),status:"declined",durationMs:0}),g){Ko.info("toolResult",{toolCallId:x}),i.emit("toolResult",{toolCallId:x});return}Ko.info("toolDecision",{toolCallId:x,approved:C}),i.emit("toolDecision",{toolCallId:x,approved:C})},[i,d,r,f]),h=F(x=>{d(x,C=>C.stateSig.value==="approval-responded"&&C.approvalSig.value?.approved!==void 0&&!Qo(C),C=>{let S=C.approvalSig.value?.id??x;C.approvalSig.value={id:S},C.stateSig.value="approval-requested"})},[d]),y=xe(()=>({humanInLoop:s,onDecision:m,onEdit:h,preview:(x,C)=>ru({toolName:x,input:C,optionTools:u.current??[]})}),[s,m,h]),P=F(()=>{let x=r.value.at(-1);for(let C of p.current.keys()){let S=x?.partsSig.value.find(g=>g.kind==="tool"&&g.toolCallId===C);x&&S?Bg(x,S):Qs(C),Ko.info("toolResult",{toolCallId:C,status:"stopped"}),i.emit("toolResult",{toolCallId:C,name:S?Cr(S.toolName):void 0,status:"stopped",durationMs:0})}p.current.clear()},[i,r]);return{toolInteraction:y,pageToolsRunning:_,stopPageTools:P}}var FS=ee.scope("latest-news");function Fg({transport:e,options:t,persistence:n,enabled:r}){let o=t.modules.list.find(_=>_.layout==="news")?.contentCollectionIds,i=o?.join(","),[s,l]=$(),[c,u]=$(()=>n.loadSeenNewsId());U(()=>{if(!r||!o?.length)return;let _=!1;return e.listContent({contentCollectionIds:o,sortBy:"publishedAt",sortOrder:"desc",limit:1}).then(d=>{_||l(d.items[0])}).catch(d=>FS.debug("listContent (latest news) failed (non-fatal)",{err:d})),()=>{_=!0}},[e,r,i]);let p=F(_=>{n.saveSeenNewsId(_),u(_)},[n]);return{item:s,unseen:s!==void 0&&s.id!==c,markSeen:p}}function Hg({callout:e,persistence:t}){let n=e?.text??"",r=e?.persistent??!0,[o,i]=$(()=>r?!1:t.loadCalloutDismissed(n));U(()=>{i(r?!1:t.loadCalloutDismissed(n))},[n,r,t]);let s=F(()=>{i(!0),r||t.saveCalloutDismissed(n)},[t,n,r]);return{dismissed:o,dismissCallout:s}}var HS=ee.scope("login");function qS(e,t){switch(e.status){case"required":return"required";case"expired":return"expired";case"anonymous":return t?"required":void 0;case"pending":case"loggedIn":return;default:return e}}function jS(e,t,n){if(e.status==="loggedIn")return t.hideUser?void 0:{kind:"user",who:e.name??e.email};if(!(e.status!=="anonymous"||!t.url||t.hidePrompt||n))return{kind:"prompt"}}function qg(e){let{state:t,deployment:n,bus:r,persistence:o,conversationIdSig:i}=e,[s,l]=$(()=>o.loadLoginPromptDismissedIn()),c=mt(()=>i.value).value,u=s!==void 0&&s===c,p=(t.status==="required"?t.loginUrl:void 0)??n.url,_=qS(t,n.required),d=F(()=>{let m=dp(),h=r.listensTo("loginRequested");if(HS.info("loginRequested",{pageLogsIn:h}),r.emit("loginRequested",{returnTo:m}),h||!p)return;let y=i.value;y&&o.saveLoginReturn({conversationId:y,draft:o.loadDraft(y)}),o.savePanelOpen(!1),up(ap(p,m))},[r,i,p,o]),f=F(()=>{let m=i.value;m&&(o.dismissLoginPromptIn(m),l(m))},[i,o]),v=!!p||r.listensTo("loginRequested");return{strip:jS(t,n,!!_||u),gate:_,canStartAsGuest:_==="expired"&&!n.required,email:t.status==="loggedIn"?t.email:void 0,canLogIn:v,onLogIn:d,menuLogIn:t.status==="anonymous"&&!_&&v?d:void 0,onHidePrompt:f}}function jg(e){let{transport:t,conversationIdSig:n}=e,r=St("ai-agent"),o=St(void 0),i=St(void 0),s=B(void 0),l=F(_=>{let d=_.controlRevision,f=s.current;if(f&&f.conversationId===n.value&&d<f.revision)return;s.current={conversationId:n.value,revision:d},r.value=_.controlMode;let v=_.assignedOperatorInitials;o.value=v?{initials:v,name:_.assignedOperatorName,avatar:_.assignedOperatorAvatar}:void 0,_.controlMode!=="awaiting-operator"?i.value=void 0:_.operatorAvailable!==void 0&&(i.value=_.operatorAvailable)},[n,r,o,i]),c=F(_=>{if(_.type!=="data-control-state")return;let d=pa(_.data);d&&l(d)},[l]),u=F(async()=>{let _=n.value,d=await t.requestOperator();d&&n.value===_&&l(d)},[t,n,l]),p=F(async()=>{let _=n.value,d=await t.cancelOperatorRequest();d&&n.value===_&&l(d)},[t,n,l]);return{controlModeSig:r,assignedOperatorSig:o,operatorAvailableSig:i,applyControlState:l,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:p}}var Za=L.cssPrefix,Vg=`--${Za}-visual-viewport-height`,Wg=`--${Za}-visual-viewport-top`;function Gg(e){let{hostElement:t,mode:n,panelSize:r,isOpen:o,surfaceReady:i,onClose:s}=e;ut(()=>{Ni(t,xa(n,r,o))},[t,o,r,n]),ut(()=>{if(!o||!i)return;let l=t.ownerDocument.defaultView,c=l?.visualViewport,u=t.shadowRoot?.querySelector(`.${Za}-anchor`);if(!l||!c||!u)return;let p=()=>{u.style.setProperty(Vg,`${c.height}px`),u.style.setProperty(Wg,`${c.offsetTop}px`)},_=0,d=()=>{l.cancelAnimationFrame(_),_=l.requestAnimationFrame(()=>{_=l.requestAnimationFrame(p)})};return p(),c.addEventListener("resize",d),c.addEventListener("scroll",d),()=>{l.cancelAnimationFrame(_),c.removeEventListener("resize",d),c.removeEventListener("scroll",d),u.style.removeProperty(Vg),u.style.removeProperty(Wg)}},[t,o,i]),U(()=>{if(n!=="modal"||!o)return;function l(c){c.composedPath().some(p=>p instanceof HTMLElement&&p.classList.contains(`${Za}-panel`))||s()}return t.addEventListener("click",l),()=>t.removeEventListener("click",l)},[t,o,n,s]),U(()=>{if(n!=="drawer"||!o)return;function l(c){c.key==="Escape"&&!c.composedPath().includes(t)&&s()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,o,n,s])}var Ic=ee.scope("reducer"),es=class{constructor(t,n){Z(this,"messagesSig",t);Z(this,"onReconcileNeeded",n);Z(this,"active",null);Z(this,"openTextParts",new Map);Z(this,"partSeq",0);Z(this,"replay",null);Z(this,"turnChunks",[]);Z(this,"turnRow",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,n){let r=Yt();r.id=t.id;let o=cr(t)||ar(t)&&(t.status!=="streaming"||ir(t)),i=t.status==="streaming"&&ir(t)&&Eo(t);this.replay={baseline:t,shadow:r,chunks:[n],probeContinuation:o,continuationTailReplay:i,liveCatchUp:t.status==="streaming"&&!o},this.attach(r),this.apply(n)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let n=t.shadow.serverMessageId??t.baseline.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t.baseline||o?.id===t.baseline.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t.baseline)??r.find(l=>l.id===t.baseline.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t.baseline)return t;let s=t.baseline;return t.baseline=i,Kg(s,i),t.liveCatchUp&&cr(t.shadow)&&(i.status==="streaming"||ar(i))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=cr(i)||ar(i)&&(i.status!=="streaming"||ir(i)),t.continuationTailReplay=i.status==="streaming"&&ir(i)&&Eo(i),t.liveCatchUp=i.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let n=t.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t||o?.id===t.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t)??r.find(l=>l.id===t.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t)return t;Kg(t,i);let s=cr(t)&&ar(i);return i.status!=="streaming"&&!s?(this.detach(),null):(this.replayTurn(),this.replay?this.replay.shadow:this.active)}replayTurn(){let[t,...n]=this.turnChunks;if(t?.type!=="start")return;let r=this.messagesSig.value.find(o=>o.serverMessageId===t.messageId);if(!(r===void 0||r===this.turnRow)){this.detach();for(let o of[t,...n])this.applyResume(o)}}promoteReplay(t){let{baseline:n,shadow:r}=t;return Ft(()=>{n.role=r.role,n.serverMessageId=r.serverMessageId,n.operatorInitials=r.operatorInitials,n.status=r.status,r.canceled&&(n.canceled=!0),n.finishReason=r.finishReason,n.errorText=r.errorText,n.suggestions=r.suggestions??n.suggestions,n.runStartedAt=r.runStartedAt??n.runStartedAt,n.stepTimings=r.stepTimings??n.stepTimings,n.partsSig.value=r.partsSig.value,this.messagesSig.value=[...this.messagesSig.value]}),this.replay=null,this.active=n,n}promoteContinuation(t){let{baseline:n,chunks:r}=t,o=ha(n);return this.replay=null,Ft(()=>{n.partsSig.value=n.partsSig.value.slice(0,VS(n,r)+1),n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n);for(let i of r)this.apply(i);n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}settleOwnedContinuation(t,n){let{baseline:r}=t,o=ha(r);return this.replay=null,Ft(()=>{r.awaitingContinuation=!1,r.status="streaming",r.finishReason=void 0,r.errorText=void 0,r.suggestions=void 0,this.attach(r),this.apply(n),r.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),r}applyResume(t){t.type==="start"&&(this.turnChunks=[]);let n=this.applyTurnChunk(t);return this.turnChunks.push(t),this.turnRow=n??this.replay?.baseline??this.active??this.turnRow,n}applyTurnChunk(t){if(t.type==="start"){let o=(this.replay?.baseline??this.active)?.serverMessageId;o!==void 0&&t.messageId!==void 0&&o!==t.messageId&&this.onReconcileNeeded?.({messageId:o}),this.detach();let i=t.messageId,s=i!==void 0?this.messagesSig.value.find(p=>p.serverMessageId===i||p.id===i):void 0;if(s!==void 0)return t.messageMetadata?.senderRole==="visitor"&&s.role==="user"&&(s.status==="pending"||s.status==="error")&&(s.serverMessageId=i,s.status="complete",s.errorText=void 0,s.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(s,t),null;let l=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(l===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!Vt(c))return this.attach(c),this.apply(t),null;let u=Yt();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let r=this.refreshReplayBaseline();if(!r)return null;r.chunks.push(t),t.type==="data-control-state"&&(r.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:i,probeContinuation:s,continuationTailReplay:l,liveCatchUp:c}=r,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(s){if(!KS(o,i,t)){if(u){if(o.status==="streaming"&&o.awaitingContinuation!==!0){let d=this.settleOwnedContinuation(r,t);return this.detach(),d}XS(o,i)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id})),this.detach()}return null}let _=cr(o)&&u?this.settleOwnedContinuation(r,t):this.promoteContinuation(r);return u?(_.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:_.serverMessageId??_.id}):_.continuationStreaming=!1),this.detach(),_):null}if(l&&GS(o,i)){let _=this.promoteContinuation(r);return u?(this.detach(),_):null}if(!c)return u&&this.detach(),null;if(u&&!Vt(o)&&Vt(i)){let _=this.promoteReplay(r);return this.detach(),_}if(!WS(o,i))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}),this.detach()),null;let p=this.promoteReplay(r);return u?(this.detach(),p):null}let n=this.refreshActive();if(!n)return null;if(this.replay)return this.applyTurnChunk(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let r=n;return r.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:r.serverMessageId??r.id}):r.continuationStreaming=!1),this.detach(),r}return null}ensureTextPart(t,n,r){let o=`${n}:${r}`,i=this.openTextParts.get(o);if(i)return i;let s={kind:n,id:`${r}#${this.partSeq++}`,textSig:oe(""),doneSig:oe(!1)};return this.openTextParts.set(o,s),Yo(t,s),s}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let r=t.messageMetadata;r?.runStartedAt&&(n.runStartedAt=r.runStartedAt),r?.senderRole==="operator"?(n.role="operator",r.operatorInitials&&(n.operatorInitials=r.operatorInitials)):r?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":Yo(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"message-metadata":n.stepTimings=fa(t.messageMetadata?.steps)??n.stepTimings;return;case"finish":Ic.debug("finish",{reason:t.finishReason}),n.stepTimings=fa(t.messageMetadata?.steps)??n.stepTimings,n.status="complete",n.retryAction=void 0,t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Ic.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=void 0,this.bumpDone(n);return;case"abort":Ic.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,n.retryAction=void 0,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let r=this.ensureTextPart(n,"text",t.id);r.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 r=this.ensureTextPart(n,"reasoning",t.id);r.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-input-error":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":case"tool-approval-response":ZS(n,t);return;case"file":Yo(n,{kind:"file",url:t.url,mediaType:t.mediaType,filename:t.filename,fileId:t.fileId,fileSize:t.fileSize});return;case"source-url":Qg(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Qg(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":n.suggestions=_a(t.data);return;case"data-control-state":n.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;case"data-memory-compaction-state":return;default:{let r=t}}}bumpDone(t){Ft(()=>{t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])})}};function cr(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function Kg(e,t){e.canceled&&(t.canceled=!0),!(!cr(e)||t.status!=="streaming"&&!ar(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function VS(e,t){let n=e.partsSig.value,r=t.findIndex(l=>l.type==="start-step"),o=new Set(t.slice(0,r<0?t.length:r).flatMap(l=>"toolCallId"in l&&l.type.startsWith("tool-output")?[l.toolCallId]:[])),i=n.findLastIndex(l=>l.kind==="tool"&&(l.stateSig.value==="approval-requested"||l.stateSig.value==="approval-responded"||o.has(l.toolCallId)));if(i>=0)return i;let s=new Set(t.flatMap(l=>l.type==="tool-input-start"||l.type==="tool-input-available"?[l.toolCallId]:[]));return n.some(l=>l.kind==="tool"&&s.has(l.toolCallId))?-1:n.findLastIndex(l=>l.kind==="tool")}function WS(e,t){let n=e.partsSig.value,r=t.partsSig.value;return e.role!==t.role||r.length<n.length?!1:n.every((o,i)=>Yg(o,r[i]))}function GS(e,t){let n=e.partsSig.value,r=n.findLastIndex(l=>l.kind==="tool"),o=new Set(n.slice(0,r+1).flatMap(l=>l.kind==="tool"?[l.toolCallId]:[])),i=t.partsSig.value.filter(l=>l.kind!=="tool"||!o.has(l.toolCallId)),s=n.slice(r+1);return i.length<s.length?!1:s.every((l,c)=>Yg(l,i[c]))}function Yg(e,t){switch(e.kind){case"text":case"reasoning":return t?.kind===e.kind&&t.textSig.value.startsWith(e.textSig.value);case"step-start":return t?.kind==="step-start";case"tool":{if(t?.kind!=="tool"||t.toolCallId!==e.toolCallId||!va(t.toolName,e.toolName)||Nr[t.stateSig.value]<Nr[e.stateSig.value])return!1;let n=e.approvalSig.value?.approved;return n===void 0||t.approvalSig.value?.approved===n}case"file":return t?.kind==="file"&&t.url===e.url&&t.mediaType===e.mediaType;case"source":return t?.kind==="source"&&t.sourceId===e.sourceId&&t.url===e.url&&t.title===e.title&&t.filename===e.filename&&t.mediaType===e.mediaType;default:return e}}function KS(e,t,n){return QS(e,n)||!YS(e,t)?!0:n.type!=="finish"&&n.type!=="error"&&n.type!=="abort"?!1:Eo(t)||e.awaitingContinuation===!0&&n.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(r=>r.kind==="step-start")}function QS(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId);return n!==void 0&&Nr[n.stateSig.value]<4}function YS(e,t){let n=t.partsSig.value;if(n.length===0)return!0;let r=e.partsSig.value;return r.some((o,i)=>n.every((s,l)=>JS(r[i+l],s)))}function JS(e,t){switch(t.kind){case"text":case"reasoning":return e?.kind===t.kind&&e.textSig.value.startsWith(t.textSig.value);case"step-start":return e?.kind==="step-start";case"tool":return e?.kind==="tool"&&e.toolCallId===t.toolCallId&&(t.toolName==="tool"||va(e.toolName,t.toolName));case"file":return e?.kind==="file"&&e.url===t.url&&e.mediaType===t.mediaType;case"source":return e?.kind==="source"&&e.sourceId===t.sourceId&&e.url===t.url&&e.title===t.title&&e.filename===t.filename&&e.mediaType===t.mediaType;default:return t}}function XS(e,t){if(cr(e)||!ar(e))return!1;let n=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&n.has(o.toolCallId))}function Nn(e,t,n={}){let r=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(r)return n.dynamic&&(r.dynamic=!0),r.toolMetadata??(r.toolMetadata=n.toolMetadata),r.title=n.title??r.title,r;let o={kind:"tool",toolCallId:t,toolName:n.toolName??"tool",title:n.title,dynamic:n.dynamic?!0:void 0,toolMetadata:n.toolMetadata,inputPartialSig:oe(""),inputSig:oe(void 0),outputSig:oe(void 0),errorSig:oe(void 0),stateSig:oe("input-streaming"),approvalSig:oe(void 0)};return Yo(e,o),o}function Yo(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Qg(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||Yo(e,t)}function ZS(e,t){switch(t.type){case"tool-input-start":Nn(e,t.toolCallId,t);return;case"tool-input-delta":{let n=Nn(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Nn(e,t.toolCallId,t);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-input-error":{let n=Nn(e,t.toolCallId,t);n.inputSig.value=t.input,n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-approval-request":{let n=Nn(e,t.toolCallId,t);if(t.isAutomatic){n.approvalSig.value={id:t.approvalId,isAutomatic:!0};return}n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-approval-response":{let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.approvalSig.value?.id===t.approvalId);n?.approvalSig.value&&(n.approvalSig.value={...n.approvalSig.value,approved:t.approved,reason:t.reason});return}case"tool-output-available":{let n=Nn(e,t.toolCallId,t);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Nn(e,t.toolCallId,t);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Nn(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function Jg(e){let t=1e3,n=!1,r=!1,o=!1;function i(){o||e.signal.aborted||(o=!0,e.onInitialBoundaryReady())}for(;!e.signal.aborted;){let s,l="held";try{l=await e.connect(()=>{if(e.signal.aborted)return;s=e.now();let c=n||r;n=!0,r=!1,o?c&&e.backfill():i()})}catch{}if(e.signal.aborted||(!n&&s===void 0&&(r=!0,i()),l==="unavailable"))return;e.onDropped?.(),s!==void 0&&e.now()-s>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var ew=120;function Xg(e){let{activated:t,conversationReady:n,paused:r,conversationIdSig:o,messagesSig:i,optionsRef:s,transport:l,visitorId:c,adoptControlStateChunk:u,adoptMemoryCompactionStateChunk:p,settleSuggestions:_,recordConversationReply:d,transcriptRecoverySig:f,beginConversationTranscript:v,commitConversationTranscript:m,runCancellation:h,feedback:y,bus:P,loadInitialThread:x,shouldReconcileOnConnect:C,reconnectingSig:S}=e,g=B(0);U(()=>{if(!t||!n||r||!o.value)return;let b=o.value,k=new AbortController,N=R=>{},I=new es(i,R=>N(R));l.primeIdentity(c,b);let D=!1,A=!1,z,j=!1,Y,ie=0,K,Te,Re=Date.now(),ye,Oe=!1,fe=!1,tt=!1,ht;function nt(R,G){if(!Vt(R))return;let V=i.value.findLast(ge=>!ge.ephemeral),te=R.serverMessageId??R.id;if(!(V&&(V.serverMessageId??V.id)!==te)){if(ye&&Oe&&!i.value.some(ge=>ge.role==="user"&&!ge.ephemeral)){ht={replyId:te,activityAt:G};return}return ga(i.value,R,b,s.current.strings.newConversation,G)}}function bt(R,G,V){let te=nt(R,V);if(!te)return;let le=`${R.serverMessageId??R.id}:${G}:${te.preview??""}`;le!==Te&&(Te=le,l.publishConversation({...te,hasUnread:!0},!0))}let Ee;function Ue(){Ee&&(clearTimeout(Ee.timer),Ee=void 0)}function Rt(){let R=Ee;if(!R)return;clearTimeout(R.timer),Ee=void 0;let G=i.value.find(V=>(V.serverMessageId??V.id)===R.replyId);G?.role!=="assistant"&&G?.role!=="operator"||bt(G,R.generation,R.activityAt)}function gt(R,G,V){Ue(),Ee={replyId:R.serverMessageId??R.id,generation:G,activityAt:V,timer:setTimeout(Rt,ew)}}function ze(R,G,V=Date.now(),te=!0){Ue();let ge=nt(R,V);if(!ge)return;let me=`${R.serverMessageId??R.id}:${G}`;me!==K&&(K=me,d(ge),te&&ye&&!Oe&&(fe=!0))}function ae(R,G){(R||!h.localSendRef.current)&&h.settle(G)}function ve(R,G=[],V=!1,te,ge=ie,le=Date.now(),me=!0){let Ye=s.current;if(R.canceled){ze(R,ge,le,me),ae(V,te);return}let $e=!0,rt=R.status==="error";switch(y_(R,rt)){case"drop":i.value=i.value.filter(Be=>Be!==R),$e=!1;break;case"complete-operator-routed":R.status="complete",V&&(y.play("messageReceived"),Br(P,Ye,"assistant",He(R)));break;case"error":{if(R.status="error",V){y.play("error");let Be=new Error(rt?"stream error chunk":"empty reply");P.emit("error",Be),Ye.onError?.(Be)}break}case"complete":R.status="complete",V&&(y.play("messageReceived"),Br(P,Ye,"assistant",He(R))),_(R,G);break}$e&&ze(R,ge,le,me),ae(V,te)}function _e(R){if(k.signal.aborted||o.value!==b)return;if(u(R),p?.(R),R.type==="start"){let ot=function(dt){return dt.role==="assistant"&&dt.retryAction?.kind==="resend-user"&&dt.retryAction.messageId===Nt};var Be=ot;Rt();let yt=R.messageId===void 0?void 0:i.value.find(dt=>dt.serverMessageId===R.messageId||dt.id===R.messageId);j=yt!==void 0&&yt.status!=="streaming";let Mt=Y?.senderRole==="visitor"?Y.messageId:void 0;Y={messageId:R.messageId,senderRole:R.messageMetadata?.senderRole},ie+=1,Re=Date.now(),Te=void 0,D=R.messageMetadata?.senderRole===void 0,A=!1,z=D?R.messageMetadata?.runId:void 0;let Nt=D?R.messageMetadata?.senderMessageId:void 0;if(Nt&&i.value.some(ot)&&(i.value=i.value.filter(dt=>!ot(dt))),D){let dt=R.messageId!==void 0&&i.value.some($n=>$n.serverMessageId===R.messageId||$n.id===R.messageId),Ut=i.value.at(-1),ur=R.messageId!==void 0&&(Ut?.serverMessageId===R.messageId||Ut?.id===R.messageId),pr=h.localSendRef.current&&(!dt||ur)&&Ut?.role==="assistant"&&Ut.status==="streaming"&&(ur||Ut.serverMessageId===void 0&&Ut.partsSig.value.length===0);A=h.captureStart(b,R,pr,Mt)}}let G=D&&(R.type==="finish"||R.type==="error"||R.type==="abort"),V=G?z:void 0,te=G&&(A||h.ownsLocalRun(V)),ge=ie,le=j;G&&(D=!1,A=!1,z=void 0);let me=I.applyResume(R),Ye=Y?.messageId,$e=Ye===void 0?void 0:i.value.find(yt=>yt.serverMessageId===Ye||yt.id===Ye);j&&Y?.senderRole!=="visitor"&&(me!==null||$e?.status==="streaming")&&(j=!1,le=!1);let rt=!j&&($e?.role==="assistant"||$e?.role==="operator");if(R.type==="text-delta"&&rt&>($e,ie,Re),R.type==="text-end"&&(Ue(),rt&&bt($e,ie,Re)),!me){G&&(te||!h.localSendRef.current)&&h.settle(V);return}if(me.role==="operator"){le||(y.play("messageReceived"),Br(P,s.current,"operator",He(me))),ze(me,ge,Re),j=!1,G&&(te||!h.localSendRef.current)&&h.settle(V);return}me.role==="assistant"&&(ve(me,[],te,V,ge,Re),j=!1)}async function be(R){let G=ie,V=await l.loadConversation(b,R?{ids:[R]}:void 0).catch(()=>null);if(k.signal.aborted||o.value!==b||!V)return!1;V.controlState&&u({type:"data-control-state",data:V.controlState});let te=i.value.at(-1),ge=G===ie&&(R===void 0||te!==void 0&&(te.serverMessageId===R||te.id===R));if(V.messages.length===0)return!0;let le=i.value,me=R===void 0?le.at(-1):le.find(ot=>ot.serverMessageId===R||ot.id===R),Ye=Mo(le,In(V.messages)),$e=h_(V.messages),rt=Ye.messages.filter(ot=>!(ot.role==="assistant"&&ot.retryAction?.kind==="resend-user"&&$e.has(ot.retryAction.messageId)));if(!Ye.changed&&rt.length===Ye.messages.length)return!0;i.value=rt;let Be=R===void 0?rt.at(-1):rt.find(ot=>ot.serverMessageId===R||ot.id===R),yt=me!==void 0&&Be!==void 0&&(me.id===Be.id||me.serverMessageId!==void 0&&me.serverMessageId===Be.serverMessageId),Mt=Be!==void 0&&Be.status!=="streaming"&&(!yt||me?.status==="streaming"),Nt=yt&&me?.status==="streaming"?Date.now():Be?.createdAt;return ge&&Mt&&Be.role==="assistant"?ve(Be,Be.suggestions??[],h.localSendRef.current,void 0,G,Nt,!1):ge&&Mt&&Be.role==="operator"?ze(Be,G,Nt,!1):ge&&Be?.role==="assistant"&&Be.status!=="streaming"&&_(Be,Be.suggestions??[]),!0}let Ce=new Set;N=({messageId:R})=>{if(Ce.has(R)||!i.value.some(V=>V.serverMessageId===R||V.id===R))return;Ce.add(R);function G(){return Ce.delete(R)}be(R).then(G,G)};function Ot(){let R=ht;ht=void 0;let G=R&&i.value.find(te=>(te.serverMessageId??te.id)===R.replyId),V=G&&nt(G,R.activityAt);V&&d(V)}function ct(R=!1){if(k.signal.aborted||o.value!==b){fe=!1;return}if(ye){fe=!0;return}let G=R?x(b):void 0,V=G??(!R||C()?be():void 0);if(!V)return;v(b),ye=V,Oe=G!==void 0;function te(ge=!1){if(ye===V){if(ye=void 0,I.replayTurn(),fe){fe=!1,ct();return}Ot(),ge&&m(b)}}V.then(te,()=>te(!1))}let M=f.subscribe(R=>{R<=g.current||(g.current=R,tt&&ct())});return Jg({signal:k.signal,now:()=>performance.now(),sleep:R=>jn(R,k.signal),connect:R=>l.connectResumeStream({signal:k.signal,onChunk:_e,onConnected:()=>{S.value=!1,R()}}),onDropped:()=>{S.value=!0},onInitialBoundaryReady:()=>{tt=!0,ct(!0)},backfill:()=>ct()}),()=>{k.abort(),S.value=!1,Ue(),M(),I.detach()}},[t,n,r,o,o.value,c,l,u,p,_,d,f,v,m,h,i,P,y,x,C,S])}var tw=32;function Zg(e){let{transport:t,setStreaming:n}=e,r=B(void 0),o=B(void 0),i=B(!1),s=B(void 0),l=B(!1),c=B(new Map),u=B(new Set),p=F((S,g)=>{let b=`${S}:${g}`;s.current!==b&&(s.current=b,t.cancelTurn(S,g))},[t]),_=F(S=>{r.current=void 0,o.current=S,i.current=!1,s.current=void 0,l.current=!0,n(!0)},[n]),d=F((S,g)=>{c.current.set(S,{messageId:g})},[]),f=F(S=>{if(S!==void 0){u.current.add(S);let g=u.current.values().next().value;u.current.size>tw&&g!==void 0&&u.current.delete(g)}S!==void 0&&r.current?.runId!==S||(r.current=void 0,o.current=void 0,i.current=!1,l.current=!1,n(!1))},[n]),v=F((S,g)=>o.current!==S?g.runId&&r.current?.runId===g.runId?(r.current={conversationId:g.conversationId,runId:g.runId},i.current&&p(g.conversationId,g.runId),!0):!1:(o.current=void 0,g.runId?(r.current={conversationId:g.conversationId,runId:g.runId},n(!0),i.current&&p(g.conversationId,g.runId),!0):(f(),!0)),[p,n,f]),m=F((S,g)=>{let b=c.current.get(S);return b?(c.current.delete(S),!g.runId||u.current.has(g.runId)?!0:b.runId!==void 0?(b.runId!==g.runId||r.current?.runId===g.runId&&(r.current={conversationId:g.conversationId,runId:g.runId},i.current&&p(g.conversationId,g.runId)),!0):(l.current||o.current||(r.current={conversationId:g.conversationId,runId:g.runId},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0)),!0)):!1},[p,n]),h=F(S=>o.current!==S?!1:(f(),!0),[f]),y=F(S=>{let g=c.current.get(S);return g?(c.current.delete(S),g.runId===void 0):!1},[]),P=F((S,g,b,k)=>{let N=g.messageMetadata?.runId;if(g.messageMetadata?.senderRole!==void 0||typeof N!="string"||!N||u.current.has(N))return!1;if(r.current?.runId===N)return l.current;if(l.current)return r.current||!b?!1:(o.current=void 0,r.current={conversationId:S,runId:N},n(!0),i.current&&p(S,N),!0);let D=[...c.current.values()].filter(A=>A.runId===void 0).find(A=>A.messageId===k);return D?(D.runId=N,r.current={conversationId:S,runId:N},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0),!0):(o.current=void 0,r.current={conversationId:S,runId:N},n(!0),i.current&&p(S,N),l.current)},[p,n]),x=F(S=>typeof S=="string"&&r.current?.runId===S&&l.current,[]),C=F(()=>{let S=r.current;if(S)return i.current=!0,p(S.conversationId,S.runId),!0;let g=o.current;return g?(i.current=!0,g.then(b=>{b.runId&&p(b.conversationId,b.runId)}).catch(()=>{}),!0):!1},[p]);return xe(()=>({localSendRef:l,begin:_,beginRouted:d,acceptAck:v,acceptRoutedAck:m,reject:h,rejectRouted:y,captureStart:P,ownsLocalRun:x,settle:f,stop:C}),[v,m,_,d,P,x,h,y,f,C])}var nw=ee.scope("send");function nm(e,t,n,r,o){e.publishConversation({...ga(t,n,r,o),hasUnread:!1},!0)}function rm(e,t){return e.id===t.id||(e.serverMessageId??e.id)===(t.serverMessageId??t.id)}function om(e){return e.findLast(t=>!t.ephemeral&&t.role!=="system"&&(t.role==="user"||t.status!=="streaming"||Vt(t)))}function Jo(e,t,n,r,o){let i=om(t);i?.role!=="user"||!rm(i,n)||nm(e,t,i,r,o)}function em(e){return e instanceof Le&&e.status===404&&e.errorCode==="CONVERSATION_NOT_FOUND"}function tm(e){return!(e instanceof Le)||e.code==="network"||e.status===void 0||e.status===202?!0:e.status===408||e.status===425||e.status===429||e.status>=500&&e.status<600}function im(e){let{transport:t,messagesSig:n,conversationIdSig:r,options:o,bus:i,feedback:s,persistence:l,visitorId:c,adoptConversationId:u,applyControlState:p,setTicket:_,settleSuggestions:d,runCancellation:f,onConversationNotFound:v}=e,m=F(()=>{let P=r.value??Lt();return r.value||(r.value=P,l.saveConversationId(P)),P},[r,l]),h=F(async({continueExisting:P,turn:x,movedFromConversation:C=!1})=>{let S=m(),g=n.value.at(-1),b=x?[x]:__(n.value,P),k=b[0];k?.role==="user"&&xt.markSent(k.id);let N=b.map(nc),I=l.loadUserPrefs(),D=ao(o.tools).then(A=>t.sendTurn(Jl({messages:N,conversationId:S,visitorId:c,userPrefs:I,clientTools:Ks(A)}),{keepalive:P}));f.begin(D);try{let A=await D;if(r.value!==S||!f.acceptAck(D,A))return!1;if(u(A.conversationId),_({conversationId:A.conversationId,reference:A.ticketReference}),A.runId&&k?.role==="user"&&Jo(t,n.value,k,A.conversationId,o.strings.newConversation),!A.runId){let z=await t.loadConversation(A.conversationId).catch(()=>null);if(r.value!==A.conversationId)return!0;if(z){z.controlState&&p(z.controlState);let j=In(z.messages),{messages:Y,changed:ie}=Mo(n.value,j);ie&&(n.value=Y);let K=j.findLast(ye=>!ye.ephemeral&&ye.role!=="system"),Te=om(n.value);Te&&K&&rm(Te,K)&&nm(t,n.value,Te,A.conversationId,o.strings.newConversation);let Re=g?n.value.find(ye=>ye.id===g.id&&ye.role==="assistant"&&ye.status!=="streaming"):void 0;Re&&d(Re,Re.suggestions??[]),!P&&g?.role==="assistant"&&n.value.includes(g)&&g.serverMessageId===void 0&&!Vt(g)&&(n.value=n.value.filter(ye=>ye!==g))}else g?.role==="assistant"&&n.value.includes(g)&&(g.status="error",g.errorText=o.strings.errorGeneric,P?g.retryAction={kind:"continue-assistant",messageId:g.serverMessageId??g.id}:g.retryAction=k?.role==="user"?{kind:"resend-user",messageId:k.id}:null,n.value=[...n.value])}return!0}catch(A){if(r.value!==S)return!1;if(!f.reject(D))return k?.role==="user"&&Jo(t,n.value,k,S,o.strings.newConversation),!0;if(!P&&!C&&k?.role==="user"&&em(A))return v(k);if(!P&&k?.role==="user"&&A instanceof Le&&A.status===401){let ie=g?.role==="assistant"&&g.serverMessageId===void 0?g:void 0;return n.value=n.value.filter(K=>K!==k&&K!==ie),l.saveDraft(S,He(k)),!1}let z=un(A,o.strings),j=tm(A),Y=x?.role==="assistant"?x:n.value.at(-1);if(P&&Y?.role==="assistant"&&A instanceof Le&&A.status===409){let ie=Y.serverMessageId??Y.id,K=await t.loadConversation(S,{ids:[ie]}).catch(()=>null);if(r.value!==S)return!1;if(K){K.controlState&&p(K.controlState);let Te=In(K.messages),Re=Te.find(ye=>(ye.serverMessageId??ye.id)===ie);if(Re&&v_(Y,Re)){let{messages:ye,changed:Oe}=Mo(n.value,Te),fe=ye.find(tt=>(tt.serverMessageId??tt.id)===ie);if(Oe&&fe&&fe!==Y)return fe.awaitingContinuation=!1,fe.continuationStreaming=void 0,fe.retryAction=null,n.value=ye,fe.status!=="streaming"&&d(fe,fe.suggestions??[]),!0}}if(!n.value.includes(Y)||Y.status!=="streaming")return!1;Y.continuationStreaming=!0}if(P&&Y?.role==="assistant")Y.status="error",Y.errorText=z,Y.retryAction=j?{kind:"continue-assistant",messageId:Y.serverMessageId??Y.id}:null,n.value=[...n.value];else if(g?.role==="assistant"&&n.value.includes(g)){g.status="error",g.errorText=z;let ie=b[0];g.retryAction=j&&ie?.role==="user"?{kind:"resend-user",messageId:ie.id}:null,n.value=[...n.value]}else{let ie=Yt();ie.status="error",ie.errorText=z;let K=b[0];ie.retryAction=j&&K?.role==="user"?{kind:"resend-user",messageId:K.id}:null,n.value=[...n.value,ie]}return s.play("error"),i.emit("error",A),o.onError?.(A),!1}},[t,n,o,i,s,l,c,u,p,_,d,m,f,v]),y=F(async P=>{let x=m();P.status="pending",P.errorText=void 0,P.retryAction=void 0,n.value.includes(P)&&(n.value=[...n.value]),xt.markSent(P.id);let C=[nc(P)],S=l.loadUserPrefs(),g=ao(o.tools).then(b=>t.sendTurn(Jl({messages:C,conversationId:x,visitorId:c,userPrefs:S,clientTools:Ks(b)})));f.beginRouted(g,P.id);try{let b=await g;return r.value!==x?(f.rejectRouted(g),!1):f.acceptRoutedAck(g,b)?(u(b.conversationId),_({conversationId:b.conversationId,reference:b.ticketReference}),Jo(t,n.value,P,b.conversationId,o.strings.newConversation),P.status==="pending"&&(P.status="complete",n.value.includes(P)&&(n.value=[...n.value])),!0):!1}catch(b){let k=f.rejectRouted(g);if(r.value!==x)return!1;if(!k)return Jo(t,n.value,P,x,o.strings.newConversation),P.status==="pending"&&(P.status="complete",n.value.includes(P)&&(n.value=[...n.value])),!0;if(P.status!=="pending")return Jo(t,n.value,P,x,o.strings.newConversation),!0;if(em(b))return v(P);nw.debug("operator-routed send failed",{error:b});let N=b instanceof Error?b:new Error(String(b));return P.status="error",P.errorText=un(b,o.strings),P.retryAction=tm(b)?{kind:"resend-user",messageId:P.id}:null,n.value.includes(P)&&(n.value=[...n.value]),s.play("error"),i.emit("error",N),o.onError?.(N),!1}},[t,n,o,i,s,l,c,u,_,m,f,v]);return{sendAiTurn:h,sendRoutedTurn:y}}var rw=ee.scope("unread");function am(e){let{transport:t,options:n,conversationIdSig:r,isConversationVisibleRef:o,activated:i,conversationReady:s}=e,l=St(!1),c=St(0),u=St(0),p=B([]),_=B(void 0),d=B(!1),f=B(!1),v=F(()=>{let b=r.value,k=o.current()&&_.current===b?b:void 0,N=p.current.filter(I=>I.hasUnread&&I.conversationId!==k).length;c.value=N,l.value=N>0},[r,l,c,o]),m=F(b=>{let k=r.value,N=p.current.find(z=>z.conversationId===k),I=cn(p.current,b),D=I.find(z=>z.conversationId===k),A=b.type==="snapshot"&&k!==void 0&&D?.hasUnread===!0&&_.current===k&&N!==void 0&&N.lastMessageAt!==D.lastMessageAt;A&&(_.current=void 0),p.current=I,v(),A&&(u.value+=1)},[r,v,u]),h=F(()=>{if(v(),!o.current())return;let b=r.value;if(!b||_.current!==b)return;let k=p.current.find(N=>N.conversationId===b);k?.hasUnread&&t.markRead(b,k.lastMessageAt)},[r,o,v,t]),y=F(b=>{r.value===b&&(_.current=void 0,v())},[r,v]),P=F(b=>{r.value===b&&(_.current=b,h())},[r,h]),x=F(b=>_.current===b,[]),C=F((b=!1)=>{if(!n.history.enabled||!n.modules.list.some(N=>N.layout==="chat"))return;function k(N){if(d.current){N&&(f.current=!0);return}d.current=!0,t.listConversations({limit:50},N).then(I=>{N||m({type:"snapshot",result:I,requestedRevision:0}),h()}).catch(I=>rw.debug("refreshUnread failed (non-fatal)",{err:I})).finally(()=>{d.current=!1,f.current&&(f.current=!1,k(!0))})}k(b)},[m,h,n.history.enabled,n.modules,t]),S=F(b=>{let k=b.conversationId,N=o.current()&&r.value===k&&_.current===k,I=p.current.find(A=>A.conversationId===k),D=N&&(I?.lastMessageAt!==b.lastMessageAt||I.hasUnread);t.publishConversation({...b,hasUnread:!N},!0),D&&t.markRead(k,b.lastMessageAt)},[r,o,t]);U(()=>t.subscribeConversationChanges(m),[m,t]);let g=B(!1);return U(()=>{!i||!s||g.current||(g.current=!0,C())},[i,s,C]),U(()=>{if(!i)return;function b(){document.visibilityState==="visible"&&(h(),C(!0))}return document.addEventListener("visibilitychange",b),()=>document.removeEventListener("visibilitychange",b)},[i,h,C]),{hasUnreadSig:l,unreadCountSig:c,transcriptRecoverySig:u,markVisibleConversationRead:h,beginConversationTranscript:y,commitConversationTranscript:P,isConversationTranscriptCommitted:x,recordConversationReply:S,refreshUnread:C}}var Xo=ee.scope("settings");function sm(e){let{options:t,persistence:n,transport:r,feedback:o,hostElement:i,bus:s}=e,l=n.loadUserPrefs(),[c,u]=$(()=>l.locale??t.locale),[p,_]=$(l.themeMode),d=no(t.themeMode,p),[f,v]=$(()=>l.textSize??t.textSize),m=F(S=>{n.patchUserPrefs(S),r.saveUserPrefs(n.loadUserPrefs()).catch(g=>Xo.warn("saveUserPrefs failed",{err:g}))},[n,r]);U(()=>{l.soundMuted!==void 0&&o.setMuted(l.soundMuted)},[]),U(()=>{if(d!=="host"){i.dataset.theme=d;return}return Tu(S=>{i.dataset.theme=S})},[i,d,t]),U(()=>{i.dataset.textSize=f},[i,f,t]),U(()=>{let S=!0;return o.mutedSig.subscribe(g=>{if(S){S=!1;return}m({soundMuted:g})})},[o,m]);let h=Sr(c,t.availableLocales,t.defaultLocale);U(()=>{r.setLocale(h)},[r,h]),U(()=>{i.dir=_i(h)?"rtl":"ltr"},[i,h]),U(()=>{h!==c&&u(h)},[h,c]);let y=F(S=>{Xo.info("localeChange",{locale:S}),u(S),m({locale:S}),s.emit("localeChange",S)},[m,s]),P=F(S=>{Xo.info("themeChange",{mode:S}),_(S),i.dataset.theme=S,m({themeMode:S}),s.emit("themeChange",S)},[i,m,s]),x=F(S=>{Xo.info("textSizeChange",{size:S}),v(S),i.dataset.textSize=S,m({textSize:S}),s.emit("textSizeChange",S)},[i,m,s]),C=F(()=>{o.toggleMuted();let S=o.mutedSig.value;Xo.info("soundToggle",{muted:S}),s.emit("soundToggle",{muted:S})},[o,s]);return{activeLocale:c,activeThemeMode:d,activeTextSize:f,setActiveLocale:u,setActiveThemeMode:_,setActiveTextSize:v,patchAndSync:m,handleLocaleChange:y,handleThemeChange:P,handleTextSizeChange:x,handleSoundToggle:C}}var we=ee.scope("app"),Zo=L.cssPrefix,ow={home:"home",chats:"chat",help:"help",news:"news"};function cm({options:e,hostElement:t,bus:n,recentHostEvents:r,loginRevision:o=0,onPersonChanged:i,onStartAsGuest:s}){let l=e.aiAgentDeploymentId;if(!l)throw new Error("aiAgentDeploymentId is required");let[c]=$(()=>wn(e.widgetId,e.storage,e.aiAgentDeploymentId)),[u,p]=$(()=>c.getVisitorId()),_=c.loadUserPrefs(),d=St(c.loadConversationId()),f=B(d.value!==void 0),v=St(d.value??""),m=St([]),h=St(!1),[y,P]=$(!1),x=B(void 0);function C(){let w=e.modules.list,E=new Set(w.map(ne=>ne.id)),J=c.loadActiveModule();return J&&E.has(J)?J:w[0]?.id??""}function S(){return e.modules.list.find(w=>w.layout==="chat")?.id}function g(){let w=S();return w?e.modules.list.length===1?!0:k.sig.value.activeTab===w:!1}let b=B(void 0);if(!b.current){let w=e.modules.list.map(J=>J.id),E=c.loadActiveModule()??w[0]??"";b.current=D_(E,E?[...w,E]:w,J=>c.saveActiveModule(J))}let k=b.current,N=mt(()=>k.sig.value.activeTab).value,I=mt(()=>d.value).value,[D,A]=$(!1),[z,j]=$(!1),Y=e.mode==="standalone"||e.mode==="inline",ie=B($o(e,Ur(),c.loadPanelOpen(),c.loadPanelSize())),[K,Te]=$(ie.current.panelOpen),[Re,ye]=$(ie.current.panelOpen),Oe=B(void 0),fe=B(void 0),tt=B(!1),ht=B(void 0),nt=B(e.strings),bt=B(void 0);U(()=>{K&&ye(!0)},[K]);let Ee=B(!1),[Ue,Rt]=$(!1),gt=B(null),ze=B(!1),{dismissed:ae,dismissCallout:ve}=Hg({callout:e.launcher.callout,persistence:c}),_e=e.launcher.callout?.persistent??!0,be=F(()=>{we.info("calloutDismiss"),n.emit("calloutDismiss",void 0),ve()},[n,ve]),[Ce,Ot]=$(ie.current.panelSize),ct=B(!1),[M,R]=$("chat"),G=B(()=>!1);G.current=()=>K&&M==="chat"&&!document.hidden&&g();let[V,te]=$(!1),ge=B(V);ge.current=V;let le=B(null),[me,Ye]=$(!1),$e=St(new Map),rt=F((w,E)=>{let J=new Map($e.value);E?J.set(w,E):J.delete(w),$e.value=J},[$e]),[Be,yt]=$(null),[Mt,Nt]=$(),[ot,dt]=$([]),Ut=B(e);Ut.current=e;let[ur,pr]=$(void 0),[$n,_r]=$(void 0),[Dn,ti]=$(()=>c.loadSidebarCollapsed()??!1),[Bn,fr]=$({status:"anonymous"}),[as,ni]=$({}),[H,Q]=$(),[W]=$(()=>new ya({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ju({publicKey:e.publicKey,aiAgentDeploymentId:l,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints,recentHostEvents:r,onLoginState:fr,continueLink:e.continueLink})),[ce]=$(()=>new ji(e.sound,e.haptics)),Me=Zg({transport:W,setStreaming:te}),{activeLocale:vt,activeThemeMode:Zt,activeTextSize:en,setActiveLocale:At,setActiveThemeMode:ss,setActiveTextSize:bm,patchAndSync:$c,handleLocaleChange:ym,handleThemeChange:Pm,handleTextSizeChange:xm,handleSoundToggle:Sm}=sm({options:e,persistence:c,transport:W,feedback:ce,hostElement:t,bus:n}),{controlModeSig:Gt,assignedOperatorSig:wm,operatorAvailableSig:km,applyControlState:Qr,adoptControlStateChunk:Cm,requestOperator:Tm,cancelOperatorRequest:Rm}=jg({transport:W,conversationIdSig:d}),gn=St(new Map),Am=F(w=>{if(w.type!=="data-memory-compaction-state")return;let E=d.value;if(!E)return;let J=u_(w.data);if(!J)return;let ne=gn.value.get(E);if(ne&&(J.postFinishSequence<ne.postFinishSequence||J.postFinishSequence===ne.postFinishSequence&&(ne.status==="ready"||ne.status===J.status)))return;let de=new Map(gn.value);de.set(E,J),gn.value=de},[d,gn]),{hasUnreadSig:Im,unreadCountSig:Dc,transcriptRecoverySig:Em,markVisibleConversationRead:Bc,beginConversationTranscript:ls,commitConversationTranscript:gr,isConversationTranscriptCommitted:Uc,recordConversationReply:Mm,refreshUnread:Lm}=am({transport:W,options:e,conversationIdSig:d,isConversationVisibleRef:G,activated:Re,conversationReady:D}),cs=qg({state:Bn,deployment:as,bus:n,persistence:c,conversationIdSig:d}),Om=K&&e.modules.byId[N]?.layout==="home",Nm=Fg({transport:W,options:e,persistence:c,enabled:D&&Om});U(()=>{Bc()},[N,K,M,I,Bc]),U(()=>{ce.update(e.sound,e.haptics)},[ce,e.sound,e.haptics]),U(()=>()=>ce.destroy(),[ce]),U(()=>{ct.current||!e.size.initialSize||(ct.current=!0,!c.loadPanelSize()&&Ot(uc(e.mode,e.size,Ur())))},[e.mode,e.size,c]),U(()=>{if(!D||Ee.current)return;Ee.current=!0;let w=$o(e,Ur(),c.loadPanelOpen(),c.loadPanelSize());Te(w.panelOpen),Ot(w.panelSize)},[D,e,c]);let mr=B(null);U(()=>{D&&k.reconcile(e.modules.list.map(w=>w.id),C())},[D,e.modules.list,k]);let ri=F(w=>{!w||w.length===0||(m.value=w.map(E=>ec({...E,text:at(nt.current,E.text)})))},[m]),Yr=B(0),tn=B(0),ds=F(w=>{if(w===d.value)return;let E=d.value;tn.current++,P(!1),E&&(c.saveDraft(w,c.loadDraft(E)),c.saveDraft(E,""),c.saveMessageQueue(w,c.loadMessageQueue(E)),c.saveMessageQueue(E,[])),d.value=w,c.saveConversationId(w),W.primeIdentity(void 0,w),we.info("conversation rebound",{previous:E,current:w}),E&&n.emit("conversationRebound",{previous:E,current:w})},[n,d,c,W]),oi=F(w=>{let E=w.map(de=>de.createdAt).filter(de=>de!==void 0),J=(E.length?Math.min(...E):Date.now())-1;return[...(ht.current?.messages??[]).map(de=>{let X=ec({...de,text:at(nt.current,de.text)});return X.createdAt=J,X}),...w]},[]),zc=F(async w=>{let E=tn.current;function J(){return E!==tn.current||d.value!==w}fe.current===w&&(fe.current=void 0),P(!0);try{let ne=await W.loadConversation(w);if(J())return!1;let de=In(ne.messages),X=oi(ac(de,m.value));if(m.value=X,fe.current=X.some(ke=>ke.role==="user")?void 0:w,de.length>0||ne.controlState!==void 0){Nt({conversationId:w,reference:ne.ticketReference}),ne.controlState&&Qr(ne.controlState);let ke=de.findLast(Ne=>Ne.role==="assistant"&&!Ne.ephemeral);dt(ke?.suggestions??[])}return!0}catch(ne){return J()||(we.warn("loadThread failed; keeping conversation active",{err:ne,conversationId:w}),n.emit("error",ne),Ut.current.onError?.(ne)),!1}finally{J()||P(!1)}},[W,m,d,oi,n]),$m=F(w=>{if(Oe.current===w)return Oe.current=void 0,zc(w)},[zc]),Dm=F(()=>{if(x.current)return Promise.resolve(void 0);let w=d.value,E=m.value.find(se=>se.serverMessageId!==void 0),J=E?.serverMessageId,ne=E?new Date(E.createdAt).toISOString():void 0;if(!w||!J||!ne)return Promise.resolve(void 0);let de=tn.current,X={};return x.current=X,(async()=>{try{let se=await W.loadConversation(w,{beforeId:J,beforeCreatedAt:ne});if(x.current!==X||tn.current!==de||d.value!==w)return;if(se.messages.length===0)return!1;let ke=se.messages.map(tc),Ne=m.value,rn=g_(Ne,ke);if(rn!==Ne){let je=Math.min(...ke.map(De=>De.createdAt??1/0));if(Number.isFinite(je))for(let De of Ne){if(!De.ephemeral)break;(De.createdAt??1/0)>=je&&(De.createdAt=je-1)}m.value=rn}return!0}catch(se){if(x.current!==X||tn.current!==de||d.value!==w)return;we.warn("load previous messages failed",{err:se,conversationId:w,beforeId:J}),n.emit("error",se),e.onError?.(se);return}finally{x.current===X&&(x.current=void 0)}})()},[n,d,m,e,W]),hr=F(async({newConversation:w})=>{let E=++Yr.current;function J(){return E!==Yr.current}if(!w){let je=await W.userSub(),De=c.loadLastUserSub();if(J())return;if(De&&De!==je){i?.();return}je&&c.saveLastUserSub(je)}let ne=d.value,de=w||!ne?Lt():ne;de!==ne&&(tn.current++,P(!1),Ft(()=>{d.value=de,v.value=de}),c.saveConversationId(de)),W.primeIdentity(u,de);let X;try{X=await W.handshake({visitorId:u,conversationId:de,userPrefs:c.loadUserPrefs(),locale:vt})}catch(je){if(J())return;n.emit("error",je),e.onError?.(je);let De=je instanceof Le&&je.errorCode?aw[je.errorCode]:void 0;if(De){we.warn(`the widget is not shown: ${De}`),(Y||e.mode==="page")&&j(!0);return}w||A(!0);return}if(J())return;e.continueLink&&X.visitorId!==u&&p(X.visitorId),X.conversationId!==de&&ds(X.conversationId),bt.current=X;let se=zn(X,vt);yt(se.agent),ni(Vi(X.config?.login));let ke=X.config?.maxMessageCharacters;Q(typeof ke=="number"&&ke>0?ke:void 0),se.site&&hl(se.site)?pr(se.site):se.site&&we.warn("invalid site config, using fallback",{site:se.site}),se.blocks&&vl(se.blocks)?_r(se.blocks):se.blocks&&we.warn("invalid blocks config, using fallback",{blocks:se.blocks});let Ne=il(X.userPrefs);if(Object.keys(Ne).length>0&&!w&&(c.saveUserPrefs(Ne),Ne.locale&&At(Ne.locale),Ne.soundMuted!==void 0&&ce.setMuted(Ne.soundMuted),Ne.themeMode&&ss(Ne.themeMode),Ne.textSize&&bm(Ne.textSize)),ht.current=se.welcome,w||n.emit("handshake",X),se.welcome?.suggestions){let je=nt.current;dt(se.welcome.suggestions.map(De=>({...De,label:at(je,De.label),...De.text===void 0?{}:{text:at(je,De.text)}})))}let rn=!w&&(X.conversationId===ne||e.continueLink!==void 0);f.current=rn,rn?tt.current||(Oe.current=X.conversationId):(fe.current=X.conversationId,ri(se.welcome?.messages),gr(X.conversationId)),w||A(!0)},[W,u,c,e,n,d,v,ce,ri,vt,ds,gr,i]),Jr=JSON.stringify(e.userContext??null),Bm=JSON.stringify(e.pageContext??null);U(()=>{W.setContext(e.userContext,iw(e.pageContext))},[W,Jr,Bm]);let Fc=B(!1);U(()=>{if(W.setUserToken(e.userToken),!Fc.current){Fc.current=!0;return}hr({newConversation:!1}).then(()=>{Re&&Lm(!0)})},[W,e.userToken,o]);let Hc=F((w,E=[])=>dt(w.suggestions??E),[]);U(()=>(W.primeIdentity(u,d.value),hr({newConversation:!1}),()=>{Yr.current++,tn.current++}),[]),U(()=>{!Re||!D||tt.current||(tt.current=!0,Oe.current===d.value&&P(!0))},[Re,D]);let qc=B(Jr);U(()=>{!D||qc.current===Jr||(qc.current=Jr,hr({newConversation:!1}))},[Jr,D,hr]);let jc=B(async()=>!1),{sendAiTurn:nn,sendRoutedTurn:vr}=im({onConversationNotFound:w=>jc.current(w),transport:W,messagesSig:m,conversationIdSig:d,options:e,bus:n,feedback:ce,persistence:c,visitorId:u,adoptConversationId:ds,applyControlState:Qr,setTicket:Nt,settleSuggestions:Hc,runCancellation:Me}),{toolInteraction:Um,pageToolsRunning:us,stopPageTools:Vc}=zg({streaming:V,controlModeSig:Gt,messagesSig:m,sendAiTurn:nn,bus:n,humanInLoop:e.features.humanInLoop,tools:e.tools}),zm=F((w,E)=>{let J=m.value.find(ne=>ne.serverMessageId===w);J&&(J.feedback=E),we.info("messageFeedback",{messageId:w,value:E}),n.emit("messageFeedback",{messageId:w,value:E}),W.submitFeedback({messageId:w,value:E})},[n,m,W]),Fm=F(()=>f.current||m.value.some(w=>!w.ephemeral&&w.role==="user"),[m]);Xg({activated:Re,conversationReady:D,paused:Bn.status==="pending"||Bn.status==="expired",conversationIdSig:d,messagesSig:m,optionsRef:Ut,transport:W,visitorId:u,adoptControlStateChunk:Cm,adoptMemoryCompactionStateChunk:Am,settleSuggestions:Hc,recordConversationReply:Mm,transcriptRecoverySig:Em,beginConversationTranscript:ls,commitConversationTranscript:gr,runCancellation:Me,feedback:ce,bus:n,loadInitialThread:$m,shouldReconcileOnConnect:Fm,reconnectingSig:h});let br=F(async(w,E,J)=>{if(le.current||cs.gate)return!1;let ne=d.value,de=ne?gn.value.get(ne):void 0,X=Gt.value!=="ai-agent";if(!X&&de?.status==="compacting"||(we.info("send",{textLen:w.length,attachments:E.length,streaming:ge.current,routedToOperator:X}),ge.current&&!X))return!1;let se=new AbortController,ke={conversationId:ne,controller:se};le.current=ke,Ye(!0);try{ce.unlock(),$e.value=new Map;let Ne=await lw(W,E,se.signal,rt,bs=>{se.signal.aborted||(we.warn("upload failed",{err:bs}),n.emit("error",bs),e.onError?.(bs))});if(se.signal.aborted||d.value!==ne)return!1;let rn=ne?gn.value.get(ne):void 0,je=Gt.value!=="ai-agent";if(!je&&rn?.status==="compacting"||ge.current&&!je||!J&&Ne.length<E.length||!w&&Ne.length===0)return!1;n.emit("send",{text:w,attachmentCount:E.length}),ot.length>0&&dt([]),ce.play("messageSent");let De=Zl(w,Ne,J);return Br(n,e,"user",w),je?(m.value=[...m.value,De],J?await vr(De):(vr(De),!0)):(m.value=[...m.value,De,Yt()],J?await nn({continueExisting:!1}):(nn({continueExisting:!1}),!0))}finally{le.current===ke&&(le.current=null,Ye(!1))}},[W,n,e,ot.length,m,d,gn,nn,vr,Gt,$e,rt,cs.gate]),ps=B(br);ps.current=br;let Wc=d.value,Gc=(Wc?gn.value.get(Wc):void 0)?.status==="compacting",ii=Gt.value==="ai-agent",Hm=mt(()=>{let w=m.value.at(-1);return w?.role==="assistant"&&w.partsSig.value.some(E=>E.kind==="tool"&&(E.stateSig.value==="approval-requested"||E.stateSig.value==="approval-responded"))}),Kc=mt(()=>m.value.some(w=>w.retryAction?.kind==="resend-user"||w.retryAction?.kind==="continue-assistant"));ut(()=>{let w=d.value;return()=>{let E=le.current;!E||E.conversationId!==w||(le.current=null,Ye(!1),E.controller.abort())}},[d.value]);let qm=F(()=>{if(le.current){we.info("stop uploads"),le.current.controller.abort();return}if(us){we.info("stop page tools"),n.emit("stop",void 0),Vc();return}if(!Me.stop())return;we.info("stop"),n.emit("stop",void 0);let w=m.value.at(-1);w&&w.role!=="user"&&w.status==="streaming"&&(w.canceled=!0,m.value=[...m.value])},[Me,n,m,us,Vc]),jm=F(w=>{we.info("card action",{text:w}),ps.current(w,[])},[]),Vm=F(w=>{if(V)return;let E=m.value,J=ba(E,w);if(J)switch(we.info("retry",{kind:J.kind,messageId:J.messageId}),J.kind){case"continue-assistant":{if(Gt.value!=="ai-agent"||w.role!=="assistant"||(w.serverMessageId??w.id)!==J.messageId)return;w.status="streaming",w.errorText=void 0,w.retryAction=void 0,w.awaitingContinuation=!0,m.value=[...E],nn({continueExisting:!0,turn:w});return}case"resend-user":{let ne=E.find(se=>se.role==="user"&&se.id===J.messageId);if(!ne)return;let de=se=>{se&&mr.current?.acceptQueuedMessage(J.messageId)};if(ne.status="complete",ne.errorText=void 0,ne.retryAction=void 0,Gt.value!=="ai-agent"){m.value=w.role==="assistant"?E.filter(se=>se!==w):[...E],vr(ne).then(de);return}let X=Yt();m.value=w.role==="assistant"?E.map(se=>se===w?X:se):[...E,X],nn({continueExisting:!1,turn:ne}).then(de);return}case"repeat-user":{let ne=E.find(ke=>ke.role==="user"&&ke.id===J.messageId);if(!ne)return;let de=Zl(He(ne),ne.attachments?.map(ke=>({...ke}))??[]),X=new Set(de.attachments?.flatMap(ke=>ke.url?[ke.url]:[])??[]),se=ne.partsSig.value.flatMap(ke=>ke.kind==="file"&&!X.has(ke.url)?[{...ke}]:[]);if(se.length>0&&(de.partsSig.value=[...de.partsSig.value,...se]),Gt.value!=="ai-agent"){m.value=[...E,de],vr(de);return}m.value=[...E,de,Yt()],nn({continueExisting:!1,turn:de});return}default:return J}},[V,m,Gt,nn,vr]),ai=F(()=>{if(N_(e.mode,Ce)==="exit-fullscreen"){we.info("close \u2192 exit-fullscreen",{mode:e.mode}),Ot("normal"),n.emit("fullscreen",!1);return}we.info("close \u2192 panel closed",{mode:e.mode}),ze.current=t.contains(t.ownerDocument.activeElement),Te(!1),c.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,c,Ce,t]);Gg({hostElement:t,mode:e.mode,panelSize:Ce,isOpen:K,surfaceReady:D,onClose:ai}),U(()=>{K||!ze.current||(ze.current=!1,gt.current?.focus())},[K]);let Xr=F(()=>{we.info("open",{mode:e.mode}),ce.unlock(),Rt(!0),Te(!0),c.savePanelOpen(!0),!ae&&!_e&&be(),setTimeout(()=>Rt(!1),sw),n.emit("open",void 0),e.onOpen?.()},[n,e,ce,c,ae,_e,be]),si=F(()=>{let w=m.value.some(E=>E.role==="user");if(fe.current===d.value&&!w&&d.value){we.info("clear \u2192 reusing empty conversation",{conversationId:d.value}),m.value.length===0&&ri(ht.current?.messages);return}return we.info("clear \u2192 new conversation",{wasStreaming:V}),n.emit("clear",void 0),Me.settle(),f.current=!1,Oe.current=void 0,fe.current=void 0,Ft(()=>{m.value=[],d.value=void 0,Qr({controlMode:"ai-agent",controlRevision:0})}),c.clearConversation(),dt([]),hr({newConversation:!0})},[V,m,d,c,hr,n,ri,Me,Qr]);jc.current=async w=>(we.info("conversation not found \u2192 new conversation",{messageId:w.id}),await si(),w.status="complete",w.errorText=void 0,w.retryAction=void 0,m.value=[...m.value,w,Yt()],nn({continueExisting:!1,turn:w,movedFromConversation:!0}));let li=F(()=>{let w=si();R("chat");let E=e.modules.list.find(J=>J.layout==="chat")?.id;return E&&k.switchTab(E),w},[si,k,e]),Wm=F(async w=>{await li(),await ps.current(w,[])||mr.current?.fill(w)},[li]),_s=F(()=>{let w=Ce==="expanded"?"normal":"expanded";we.info("expand",{from:Ce,expanded:w==="expanded"}),Ot(w),c.savePanelSize(w),n.emit("expand",w==="expanded")},[n,Ce,c]),fs=F(()=>{let w=Ce==="fullscreen"?"normal":"fullscreen";we.info("fullscreen",{from:Ce,fullscreen:w==="fullscreen"}),Ot(w),c.savePanelSize(w),n.emit("fullscreen",w==="fullscreen")},[n,Ce,c]),Gm=F(()=>{R(w=>{let E=w==="history"?"chat":"history";return we.info("toggleHistory",{view:E}),n.emit("toggleHistory",{view:E}),E})},[n]),Km=F(()=>{ti(w=>{let E=!w;return we.info("sidebarToggle",{collapsed:E}),c.saveSidebarCollapsed(E),n.emit("sidebarToggle",{collapsed:E}),E})},[c,n]),Qm=F(w=>{we.info("resize",w),$c({widgetSize:w}),n.emit("resize",w)},[$c,n]),Ym=F(async w=>{let E=w.conversationId;if(E===d.value&&Uc(E)){we.info("selectConversation",{conversationId:E,cached:!0}),n.emit("selectConversation",{conversationId:E}),W.publishConversation(w),R("chat");let X=S();X&&k.switchTab(X),gr(E);return}let ne=++Yr.current;tn.current++,P(!1);function de(){return ne!==Yr.current}we.info("selectConversation",{conversationId:E,wasStreaming:V}),n.emit("selectConversation",{conversationId:E}),W.publishConversation(w);try{let X=await W.loadConversation(E);if(de())return;Me.settle(),f.current=!0,Oe.current=void 0;let se=In(X.messages),ke=X.conversationId!==d.value,Ne=ke?se:ac(se,m.value);fe.current=Ne.some(De=>De.role==="user")?void 0:X.conversationId,Ft(()=>{m.value=oi(Ne),ke&&(v.value=X.conversationId),d.value=X.conversationId}),c.saveConversationId(X.conversationId),W.primeIdentity(u,X.conversationId),Nt({conversationId:X.conversationId,reference:X.ticketReference}),X.controlState&&Qr(X.controlState);let rn=Ne.findLast(De=>De.role==="assistant"&&!De.ephemeral);dt(rn?.suggestions??[]),ke?ls(X.conversationId):gr(X.conversationId),R("chat");let je=S();je&&k.switchTab(je)}catch(X){if(de())return;n.emit("error",X),e.onError?.(X)}},[W,m,d,v,n,e,c,oi,V,u,Me,ls,gr,Uc,k]),ci=B(void 0),di=F(w=>{let E=e.modules.list.find(ne=>ne.layout===ow[w.to]);if(!E){we.warn("open: the widget has no such tab",{to:w.to});return}let J=w.id&&(E.layout==="help"||E.layout==="news")?{kind:"content",id:w.id,title:""}:void 0;k.open(E.id,J)},[e.modules,k]),Qc=F(w=>{if(K||Xr(),w!=null){if(!Fd(w)){we.warn("open: unknown target",{detail:w});return}D?di(w):ci.current=w}},[K,Xr,D,di]);U(()=>{!D||!ci.current||(di(ci.current),ci.current=void 0)},[D,di]);let Yc=D&&!y&&(!ii||!Kc.value),[Un,gs]=$(),Jc=F(w=>{let E=Hd(w);if(!E){we.warn("ask: expected { text, send? } with non-empty text",{detail:w});return}K||Xr(),gs(E)},[K,Xr]),ms=K&&D&&!y,Xc=ms&&Yc&&!me&&!(ii&&(V||Gc));U(()=>{if(Un===void 0||!(Un.send?Xc:ms))return;let w=S();if(!w){we.warn("ask: the widget has no chat"),gs(void 0);return}if(M!=="chat"||!g()){R("chat"),k.switchTab(w);return}if(gs(void 0),!Un.send){mr.current?.fill(Un.text);return}br(Un.text,[]).then(E=>{E||mr.current?.fill(Un.text)})},[Un,ms,Xc,M,N,e.modules,k,br]),U(()=>{if(e.widgetId!=="default")return;let w=`data-${L.cssPrefix}-`,E=["ask","open","close"].map(ne=>w+ne);function J(ne){let de=ne.composedPath().find(ke=>ke instanceof Element&&E.some(Ne=>ke.hasAttribute(Ne)));if(!(de instanceof Element))return;ne.preventDefault();let X=de.getAttribute(`${w}ask`),se=de.getAttribute(`${w}open`);X!==null?Pt(t,"ask",on(X||(de.textContent??""),{send:de.hasAttribute(`${w}send`)})):se!==null?Pt(t,"open",Si(se)):Pt(t,"close")}return document.addEventListener("click",J),()=>document.removeEventListener("click",J)},[e.widgetId,t]),U(()=>{if(e.widgetId!=="default")return;let w=Xu(location.href);w&&(history.replaceState(history.state,"",w.url),w.ask?Pt(t,"ask",on(w.ask)):Pt(t,"open",w.target))},[e.widgetId,t]);let Zc=B(vn),ed=e.mode==="page"||e.mode==="inline"||e.mode==="standalone";U(()=>qt(()=>{let w=d.value,E={open:ed||K,ready:D,unread:Dc.value,...w?{conversationId:w}:{}},J=Zc.current;E.open===J.open&&E.ready===J.ready&&E.unread===J.unread&&E.conversationId===J.conversationId||(Zc.current=E,n.emit("state",E),E.unread!==J.unread&&n.emit("unread",E.unread))}),[n,ed,K,D,Dc,d]);let yr=B({handleOpenCommand:Qc,handleClose:ai,handleExpand:_s,handleFullscreen:fs,handleAskCommand:Jc});yr.current={handleOpenCommand:Qc,handleClose:ai,handleExpand:_s,handleFullscreen:fs,handleAskCommand:Jc},ut(()=>jd(t,{open:w=>yr.current.handleOpenCommand(w),close:()=>yr.current.handleClose(),expand:()=>yr.current.handleExpand(),fullscreen:()=>yr.current.handleFullscreen(),ask:w=>yr.current.handleAskCommand(w)}),[t]);let it=xe(()=>$s(e,vt,Zt,en),[e,vt,Zt,en]);nt.current=it.strings,U(()=>{let w=bt.current;if(!w?.translations?.length)return;let E=zn(w,vt);yt(E.agent),E.site&&hl(E.site)&&pr(E.site),E.blocks&&vl(E.blocks)&&_r(E.blocks)},[vt]);function hs(w){Ym(w)}let td={options:it,transport:W,feedback:ce,bus:n,persistence:c,conversationId:d.value??"",composerKey:v.value,composerApiRef:mr,view:M,isStreaming:V,pageToolRunning:us,isMemoryCompacting:Gc,canReleaseQueuedMessages:Yc,queueManualMessages:ii&&Kc.value,replyAwaitsCard:ii&&Hm.value,sendPreparing:me,attachmentUploadsSig:$e,composerActive:it.mode==="page"||it.mode==="inline"||it.mode==="standalone"||K,controlMode:Gt.value,assignedOperator:wm.value,operatorAvailable:km.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Tm,onCancelOperatorRequest:Rm,loadingMessages:y,onLoadPreviousMessages:Dm,messagesSig:m,reconnectingSig:h,agent:Be,ticketReference:Mt?.conversationId===d.value?Mt?.reference:void 0,login:cs,onStartAsGuest:s,maxMessageCharacters:H,suggestions:ot,initialWidgetSize:_.widgetSize??null,onClear:si,onExpand:_s,onFullscreen:fs,onSoundToggle:Sm,onToggleHistory:Gm,onSelectHistoryConversation:hs,onNewConversation:li,onLocaleChange:ym,onThemeChange:Pm,onTextSizeChange:xm,onWidgetSizeChange:Qm,onSend:br,onStop:qm,onSuggestion:w=>{if(le.current)return;let E=w.text??w.label;we.info("suggestion",{text:E,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:E}),e.autoSendSuggestions?br(E,[]):mr.current?.fill(E)},tool:Um,onRetry:Vm,onMessageFeedback:zm,onCardAction:jm};if(z)return a("div",{class:`${Zo}-anchor`,children:a(Ac,{strings:it.strings,text:it.strings.chatUnavailable})});if(!D)return null;let Zr=it.modules.list;function vs(w){let E=Dr("close",it.mode,w)?ai:void 0;return Zr.length===0?a(Ac,{strings:it.strings,text:it.strings.modulesEmpty,onClose:E}):Zr.length===1&&Zr[0]?.layout==="chat"?a(Lg,{...td,panelSize:w,onClose:E}):a(Og,{panelProps:{...td,panelSize:w,onClose:E},enabledModules:Zr,nav:k,bus:n,hasUnread:Im.value,latestNews:Nm,onSelectConversation:hs,onStartNewConversation:Wm,onSetPanelSize:Ot})}if(e.mode==="page"){let w=e.history.enabled&&Zr.some(E=>E.layout==="chat");return a("div",{class:`${Zo}-anchor`,children:a(Dg,{site:ur,blocks:$n,transport:W,strings:it.strings,locale:it.locale,persistence:c,showConversations:w,onSelectConversation:hs,onNewConversation:li,sidebarCollapsed:Dn,onToggleSidebarCollapsed:Km,children:vs("fullscreen")})})}if(Y){let w=e.mode==="standalone"?"fullscreen":Ce;return a("div",{class:`${Zo}-anchor`,children:vs(w)})}let nd=e.mode==="drawer",rd=!(e.mode==="modal")&&!e.launcher.hidden&&(!K||Ue),od=rd&&!Ue&&!ae&&!nd?it.launcher.callout:null;return a("div",{class:`${Zo}-anchor`,"data-launcher-size":it.launcher.size,children:[K||Re?a("div",{class:`${Zo}-surface`,hidden:!K,children:vs(Ce)}):null,rd?a(vf,{buttonRef:gt,onToggle:Xr,launcher:it.launcher,strings:it.strings,leaving:Ue,edgeTab:nd}):null,od?a(bf,{callout:od,launcherPosition:it.position,strings:it.strings,closeLabel:it.strings.close,onDismiss:be}):null]})}function iw(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var aw={AI_AGENT_PUBLIC_ACCESS_NOT_FOUND:"the deployment was not found or is turned off",AI_AGENT_PUBLIC_ORIGIN_NOT_ALLOWED:"this website is not in the deployment's allowed origins"},sw=120,lm=new WeakMap;async function lw(e,t,n,r,o){return(await Promise.all(t.map(async s=>{try{r(s.id,{status:"uploading"});let l=lm.get(s)??await e.uploadFile(s.file,n,c=>r(s.id,{status:"uploading",fraction:c}));return lm.set(s,l),r(s.id,{status:"done"}),{id:l.id,name:l.originalName,mediaType:l.mimeType,size:l.fileSize,url:l.url}}catch(l){r(s.id,n.aborted?void 0:{status:"error",refusal:l instanceof Le&&l.status===400?l.errorCode:void 0}),o(l);return}}))).filter(s=>s!==void 0)}var cw=ee.scope("error-boundary"),ts=class extends zt{constructor(){super(...arguments);Z(this,"state",{crashed:!("toSorted"in Array.prototype)})}componentDidCatch(n,r){cw.error("widget render crashed",{error:n,componentStack:r?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,r?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};function ns(e){let{bus:t,host:n,appRoot:r,persistence:o,reportError:i}=e,s=e.initialRaw,l,c,u=mn(s),p=o.loadUserPrefs().locale??u.locale,_=!0,d=0,f=0,v=Wd(t);function m(){let b=l&&zn({config:l,translations:c},p).config;u=mn(b?Ds(s,b):s)}function h(){cl(n,Rr(u.mode)),Au(n,{...u,themeMode:no(u.themeMode,o.loadUserPrefs().themeMode)}),_&&(Ni(n,dm(u)),_=!1)}function y(){h(),Kt(xn(ts,{onError:i},xn(cm,{key:d,bus:t,hostElement:n,options:u,recentHostEvents:v,loginRevision:f,onPersonChanged:C,onStartAsGuest:S})),r)}t.on("handshake",b=>{b.config&&(b.config.storageVersion&&o.rememberStorageVersion(b.config.storageVersion),l=b.config,c=b.translations,m(),y())}),t.on("localeChange",b=>{p=b,c?.length&&(m(),y())});let P=bu(t,{getOptions:()=>u,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});function x(){let b=o.takeLoginReturn();return b?(o.saveConversationId(b.conversationId),o.saveDraft(b.conversationId,b.draft),o.savePanelOpen(!0),!0):!1}s.userToken&&x();function C(){o.reset(),v.length=0,d+=1,_=!0,m(),y()}function S(){s={...s,userContext:void 0,userToken:void 0},C()}function g(b){"userToken"in b&&b.userToken&&!s.userToken&&x()&&(d+=1),s={...s,...b},m(),y()}return{getOptions:()=>u,getUserOptions:()=>s,render:y,setUserOptions:b=>{s=b,m(),y()},patchUserOptions:g,login:b=>{f+=1,g({userToken:b})},reset:()=>S(),destroy:()=>P()}}function dm(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=wn(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:r}=$o(e,Ur(),t.loadPanelOpen(),t.loadPanelSize());return xa(e.mode,r,n)}var _n=new Map;function rs(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");e.debug!==void 0&&xr(e.debug);let t=ee.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=mn(e),r=n.widgetId,o=_n.get(r);o&&(t.debug("destroy existing instance at slot",{widgetId:r}),o.destroy());let i=Oi({position:Rr(n.mode),target:e.target??null});i.hostElement.dataset.widgetId=r;let s=new wr,l=wn(r,n.storage,n.aiAgentDeploymentId);function c(y){s.emit("error",y),u.getOptions().onError?.(y)}let u=ns({bus:s,host:i.hostElement,appRoot:i.appRoot,persistence:l,initialRaw:e,reportError:c}),p=vn,_=()=>{},d=new Promise(y=>{_=y});s.on("state",y=>{p=y,y.ready&&_()}),u.render();let f=i.hostElement,v=null;function m(y){y.debug!==void 0&&xr(y.debug),u.patchUserOptions(y)}let h={widgetId:r,open:y=>Pt(f,"open",y),close:()=>Pt(f,"close"),expand:()=>Pt(f,"expand"),ask:(y,P)=>Pt(f,"ask",on(y,P)),on:(y,P)=>s.on(y,P),update:y=>{t.debug("update",{patch:y}),m(y)},setUserContext:y=>{t.debug("setUserContext",{keys:Object.keys(y)}),m({userContext:{...u.getUserOptions().userContext,...y}})},clearUserContext:()=>{t.debug("clearUserContext"),m({userContext:void 0})},setPageContext:y=>{t.debug("setPageContext",{keys:Object.keys(y)}),m({pageContext:{...u.getUserOptions().pageContext,...y}})},clearPageContext:()=>{t.debug("clearPageContext"),m({pageContext:void 0})},get state(){return p},ready:d,reset:()=>{t.info("reset",{widgetId:r}),u.reset()},login:y=>{t.info("login",{widgetId:r}),u.login(y)},track:(y,P)=>{let x=kr(y,P);x&&s.emit("hostEvent",x)},registerTool:Vn,setDebug:y=>{xr(y),t.info("debug level set",{level:eo()})},debugLevel:()=>eo(),onLog:y=>to(y),destroy:()=>{t.info("destroy",{widgetId:r}),s.emit("state",vn),v?.(),u.destroy(),s.clear(),Kt(null,i.appRoot),i.destroy(),_n.get(r)===h&&_n.delete(r)}};return v=Ud(h,s),_n.set(r,h),h}function os(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");let t=e.widgetId??"default",n=_n.get(t);return n?(n.update(e),n):rs(e)}function Ec(e){if(e!==void 0){_n.get(e)?.destroy();return}let t=[..._n.values()];for(let n of t)n.destroy()}function fn(e="default"){return _n.get(e)??null}function um(){return[..._n.values()]}var pm=Tr;var Mc=class extends HTMLElement{constructor(){super(...arguments);Z(this,"bus",new wr);Z(this,"widgetState",vn);Z(this,"userToken");Z(this,"pageTools",[]);Z(this,"markReady",()=>{});Z(this,"ready",new Promise(n=>{this.markReady=n}));Z(this,"mountResult",null);Z(this,"runtime",null)}static get observedAttributes(){return Bs}connectedCallback(){if(Object.hasOwn(this,"tools")){let n=Reflect.get(this,"tools");Reflect.deleteProperty(this,"tools"),this.pageTools=Array.isArray(n)?n:[]}this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Kt(null,this.mountResult.appRoot),this.bus.clear(),this.widgetState=vn)}attributeChangedCallback(){this.isConnected&&this.boot()}open(n){Pt(this,"open",n)}close(){Pt(this,"close")}expand(){Pt(this,"expand")}ask(n,r){Pt(this,"ask",on(n,r))}get state(){return this.widgetState}reset(){this.userToken=void 0,this.runtime?.reset()}login(n){this.userToken=n,this.runtime?.login(n)}track(n,r){let o=kr(n,r);o&&this.bus.emit("hostEvent",o)}get tools(){return this.pageTools}set tools(n){this.pageTools=n,this.runtime?.patchUserOptions({tools:n})}registerTool(n,r){Vn(n,r)}on(n,r){return this.bus.on(n,r)}boot(){let n={...Pi(i=>this.getAttribute(i)),...this.userToken?{userToken:this.userToken}:{},tools:this.pageTools};if(!n.aiAgentDeploymentId)throw new Error("ai-agent-deployment-id is required");if(this.runtime){this.runtime.setUserOptions(n);return}let r=mn(n);this.mountResult??(this.mountResult=Oi({existingHost:this,position:Rr(r.mode)}));let o=wn(r.widgetId,r.storage,r.aiAgentDeploymentId);this.bus.on("state",i=>{this.widgetState=i,i.ready&&this.markReady()}),this.runtime=ns({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},_m=!1;function Lc(){if(_m||typeof customElements>"u")return;let e=L.tagName;customElements.get(e)||customElements.define(e,Mc),_m=!0}typeof customElements<"u"&&Lc();var gm=ee.scope("iife");function dw(e){return typeof e=="string"||typeof e=="function"}function mm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fm(e){return mm(e)}function uw(e){return mm(e)}function pw(e){return e===null||typeof e=="function"}var hm=[];function dr(e){let t=fn();if(t)return e(t);hm.push(e)}function ei(e){let t=fn();if(t)for(let n of hm.splice(0))n(t);return e}function Oc(e){if(document.readyState!=="loading")return e();document.addEventListener("DOMContentLoaded",e,{once:!0})}function is(){return new Promise(e=>{dr(t=>{t.ready.then(()=>e(t))})})}var Nc={ask:(e,t)=>typeof e=="string"?dr(n=>n.ask(e,on(e,t))):void 0,close:()=>dr(e=>e.close()),ready:e=>is().then(t=>typeof e=="function"?e(t):void 0),reset:()=>fn()?.reset(),login:e=>{if(!dw(e))return;let t=fn();return t?t.login(e):is().then(n=>n.login(e))},destroy:()=>Ec(),expand:()=>dr(e=>e.expand()),track:(e,t)=>{let n=kr(e,t);if(!n)return;let r=fn();return r?r.track(n.name,n.data):is().then(o=>o.track(n.name,n.data))},hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&Fs(n)?ro(e,t,n):void 0,init:e=>fm(e)?Oc(()=>ei(os(e))):void 0,mount:e=>fm(e)?Oc(()=>ei(rs(e))):void 0,on:(e,t)=>dr(n=>n.on(e,t)),onLog:e=>to(pw(e)?e:null),registerTool:Vn,open:e=>dr(t=>t.open(e)),setDebug:e=>typeof e=="boolean"||typeof e=="number"||typeof e=="string"?xr(e):void 0,update:e=>uw(e)?dr(t=>t.update(e)):void 0};function _w(e){return Object.hasOwn(Nc,e)}function vm(e,...t){let n=_w(e)?Nc[e]:void 0;if(!n){gm.warn("unknown command",{command:e});return}return n(...t)}function fw(){let e=((t,...n)=>vm(t,...n));e.init=t=>ei(os(t)),e.mount=t=>ei(rs(t)),e.destroy=Ec,e.getInstance=fn,e.getAllInstances=um,e.version=pm,e.ready=is,e.hook=ro,e.debugLevel=()=>eo(),e.onLog=to,e.registerTool=Vn;for(let t of["ask","close","expand","login","on","open","reset","setDebug","track","update"])Reflect.set(e,t,Nc[t]);return e}function gw(e){let t=e?.q;if(t)for(let n of t){let r=[...n],[o,...i]=r;if(typeof o=="string")try{vm(o,...i)}catch(s){gm.warn("queued command failed",{command:o,error:s})}}}function mw(){let e=[],t=e.push.bind(e);return e.push=(...n)=>(Hs(n),t(...n)),e}function hw(){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 vw(e){return typeof e=="function"}function bw(){if(typeof window>"u"||typeof document>"u")return;let e=Reflect.get(globalThis,L.global),t=vw(e)?e:void 0,n=fw();Reflect.set(globalThis,L.global,n),Lc();let r=`${L.global}Hooks`,o=Reflect.get(globalThis,r);if(Hs(o),Reflect.set(globalThis,r,mw()),gw(t),fn())return;let i=document.currentScript,s=(i instanceof HTMLScriptElement?i:null)??hw(),l=Us(s?.dataset),c=l.aiAgentDeploymentId;c&&Oc(()=>{fn()||ei(os({...l,aiAgentDeploymentId:c}))})}bw();})();
|
|
75
|
+
`).trim(),ye=!A&&t!=="error"&&!C.value&&Re.length>0,Oe=e.canceled===!0||t==="error";function fe(ae){return u&&t==="complete"&&ma(e,ae)}let tt=new Map;for(let[ae,ve]of x.entries()){if(ve.kind!=="tool")continue;let _e=Wn(ve.toolMetadata),be=hd(mg(ve),{turn:{live:D||_e&&!p,cutOff:Oe,superseded:p,submitted:e.continuationStreaming===!0&&ve.approvalSig.value?.approved===void 0,canAct:fe(ae),interrupted:_e&&au(ve.errorSig.value)},reader:{decides:!0},display:l,strings:r});tt.set(ve.toolCallId,be.placement==="card"&&!_?.humanInLoop?{...be,placement:"hidden"}:be)}function ht(ae){let ve=tt.get(ae.toolCallId);if(!ve)throw new Error(`no step view for ${ae.toolCallId}`);return ve}let nt=Cg(x,{showReasoning:s,showSources:c,viewOf:ht}),bt=Tg(x),Ee=e.canceled===!0&&!N&&k.value&&g.value,Ue=nt.at(-1),Rt=Ue?.kind==="steps"?Ue.indices.at(-1):Ue?.index;function gt(ae,ve){return a(fS,{part:ae,generativeUi:e.role==="assistant",onCardAction:y,current:D&&ve===Rt,reasoningMs:e.stepTimings?.[bt[ve]??-1]?.reasoningMs,strings:r,locale:o,showReasoning:s,showSources:c,view:ae.kind==="tool"?tt.get(ae.toolCallId):void 0,canAct:fe(ve),superseded:p,continuationStreaming:e.continuationStreaming===!0,tool:_},`${hS(ae)}#${ve}`)}let ze=Te||ye;return a("div",{class:`${Ge}-bubble-row`,"data-role":e.role,"aria-busy":D?"true":void 0,"data-testid":ft(O.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${Ge}-bubble-col`,children:[a("div",{class:`${Ge}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${Ge}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${Ge}-bubble-body`,children:[j?a(bS,{label:r.loading}):nt.flatMap((ae,ve)=>ae.kind==="part"?[gt(ae.part,ae.index)]:ae.rows.some(_e=>_e.kind==="tool")?[a(Rg,{rows:ae.rows,steps:ae.indices.map(_e=>bt[_e]??-1),stepTimings:e.stepTimings,timed:!Oe,strings:r,running:D&&ve===nt.length-1,runStartedAt:e.runStartedAt,renderCard:(_e,be)=>be.card==="questions"&&_?a(kc,{part:_e,strings:r,active:!1,superseded:be.status==="replaced",folded:!0,onDecision:_.onDecision,onEdit:_.onEdit}):void 0},`steps#${ae.indices[0]}`)]:ae.rows.map((_e,be)=>gt(_e.part,ae.indices[be]??be))),Ee?a("div",{class:`${Ge}-steps-row`,"data-status":"stopped","data-testid":O.replyStopped,children:[a("span",{class:`${Ge}-steps-row-icon`,"aria-hidden":"true",children:a(En,{})}),a("div",{class:`${Ge}-steps-row-main`,children:a("span",{class:`${Ge}-steps-stopped-label`,children:r.statusStopped})})]}):null,Y&&!m?a(vS,{}):null,t==="error"||C.value?a(qo,{text:mS(e,t,r),retryLabel:r.errorRetry,onRetry:d?()=>d(e):void 0,retryTestId:O.messageRetry}):null,m&&D?a(qo,{text:r.errorReconnecting,retryTestId:O.messageRetry}):null]})]}),ie||ze?a("div",{class:`${Ge}-bubble-meta`,children:[ie?a("time",{class:`${Ge}-bubble-time`,dateTime:ie.iso,title:ie.full,children:ie.short}):null,ze?a("div",{class:`${Ge}-bubble-actions`,children:[Te&&e.serverMessageId?a(cg,{messageId:e.serverMessageId,initial:e.feedback??null,strings:r,onFeedback:v}):null,ye?a(pS,{text:Re,strings:r}):null]}):null]}):null]})})}function pS({text:e,strings:t}){let[n,r]=$(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})}let i=n?t.copied:t.copy;return a("button",{type:"button",class:`${Ge}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:o,"data-testid":O.messageCopy,children:n?a(zr,{}):a(pf,{})})}function _S(e,t){if(typeof e!="number"||!Number.isFinite(e))return null;try{let n=new Date(e);return{short:n.toLocaleTimeString(t,{hour:"numeric",minute:"2-digit"}),full:n.toLocaleString(t,{dateStyle:"full",timeStyle:"short"}),iso:n.toISOString()}}catch{return null}}function fS({part:e,generativeUi:t,onCardAction:n,current:r,reasoningMs:o,strings:i,locale:s,showReasoning:l,showSources:c,view:u,canAct:p,superseded:_,continuationStreaming:d,tool:f}){switch(e.kind){case"step-start":return null;case"text":return a(Fo,{textSig:e.textSig,doneSig:e.doneSig,generativeUi:t,strings:i,onCardAction:n});case"reasoning":return l?a(Cc,{part:e,current:r,reasoningMs:o,strings:i,standalone:!0}):null;case"tool":return u?.placement!=="card"||!f?null:u.card==="questions"?a(kc,{part:e,strings:i,active:p,superseded:_,continuationStreaming:d,onDecision:f.onDecision,onEdit:f.onEdit}):a(vg,{part:e,view:u,strings:i,locale:s,canAct:p,onDecision:f.onDecision,onEdit:f.onEdit,preview:f.preview});case"file":return a(gS,{part:e,strings:i});case"source":return c?a(_g,{part:e,strings:i}):null}}function gS({part:e,strings:t}){let n=e.filename??t.file;if(e.mediaType.startsWith("image/"))return a("a",{class:`${Ge}-file-image`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:n,"data-testid":O.messageFile,children:a("img",{src:e.url,alt:n,loading:"lazy"})});let r=(n.includes(".")?n.split(".").pop():e.mediaType.split("/").pop())?.toUpperCase(),o=e.fileSize===void 0?void 0:jr(e.fileSize);return a("a",{class:`${Ge}-file-chip`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:n,"data-testid":O.messageFile,children:[a("span",{class:`${Ge}-file-chip-icon`,"aria-hidden":"true",children:a(Ta,{})}),a("span",{class:`${Ge}-file-chip-text`,children:[a("span",{class:`${Ge}-file-chip-name`,children:n}),a("span",{class:`${Ge}-file-chip-meta`,children:[r,o].filter(Boolean).join(" \xB7 ")})]})]})}function mS(e,t,n){return e.errorText?e.errorText:t==="error"&&e.role==="assistant"?n.errorServer:n.errorGeneric}function hS(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 vS(){return a("span",{class:`${Ge}-typing`,"data-testid":O.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function bS({label:e}){return a("span",{class:`${Ge}-loading`,role:"status",children:[a("span",{class:`${Ge}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${Ge}-loading-label`,children:e})]})}var fn=L.cssPrefix,Ka=120,yS=350;function Ig({messagesSig:e,reconnectingSig:t,pageToolRunning:n,strings:r,notice:o,locale:i,responseMode:s,showReasoning:l,stepDisplay:c,showSources:u,enableMessageFeedback:p,onFeedback:_,loading:d,onLoadPreviousMessages:f,idle:v,controlMode:m="ai-agent",tool:h,onRetry:y,onCardAction:P}){let x=B(null),C=mt(()=>e.value),S=PS(i),[g,b]=$(!1),[k,N]=$(!1),I=B(!1),D=B(!1),[A,z]=$(),j=B(!1),Y=B(!1),ie=B(!1),K=B(0);function Te(){return ie.current||performance.now()-K.current<yS}let Re=B(0);function ye(M){let R=M.scrollHeight-M.clientHeight>1;M.dataset.fadeTop=R&&M.scrollTop>1?"true":"false",M.dataset.fadeBottom=R&&M.scrollHeight-M.scrollTop-M.clientHeight>1?"true":"false"}function Oe(M){return b(M.scrollHeight-M.scrollTop-M.clientHeight>Ka*2)}function fe(M){Re.current=performance.now(),M.scrollTop=M.scrollHeight,ye(M)}function tt(M,R){fe(M);let G=R,V=0;function te(){Y.current||Te()||(fe(M),--G>0&&(V=requestAnimationFrame(te)))}return R>0&&(V=requestAnimationFrame(te)),()=>cancelAnimationFrame(V)}function ht(M,R){let G,V,te,ge=-1;function le(){G.disconnect(),V.disconnect(),clearTimeout(te)}function me(){if(Y.current||Te()||ge>=0&&M.scrollTop<ge-4)return le();fe(M),ge=M.scrollTop}return G=new ResizeObserver(me),V=new MutationObserver(me),me(),G.observe(M),V.observe(M,{childList:!0,subtree:!0,characterData:!0}),te=setTimeout(le,R),le}let nt=C.value[0]?.id;ut(()=>{let M=x.current;if(M&&C.value.length!==0&&!D.current&&(j.current=!0,!!C.value.some(R=>R.role==="user")))return ht(M,300)},[nt]);let bt=B(0);U(()=>{let M=x.current,R=C.value,G=bt.current;if(bt.current=R.length,!M||!j.current||D.current)return;if(R.slice(G).some(te=>te.role==="user"))return Y.current=!1,tt(M,3);if(!R.some(te=>te.role==="user")||Y.current||Te())return;M.scrollHeight-M.scrollTop-M.clientHeight<Ka&&fe(M)},[C.value.length]);let Ee=B(null);U(()=>{let M=x.current,R=C.value.at(-1),G=Ee.current;if(Ee.current=R?{id:R.id,streaming:R.status==="streaming"}:null,!!M&&j.current&&!(!R||R.id!==G?.id||G.streaming||R.status!=="streaming"))return Y.current=!1,tt(M,3)},[C.value]),U(()=>{let M=x.current;if(!M)return;let R=C.value.at(-1);if(!R||R.status!=="streaming"&&!C.value.some(te=>te.role==="user"))return;let G=()=>{if(Y.current||Te())return;M.scrollHeight-M.scrollTop-M.clientHeight<Ka*2&&fe(M)};if(R.status!=="streaming")return ht(M,300);G();let V=new MutationObserver(G);return V.observe(M,{childList:!0,subtree:!0,characterData:!0}),()=>V.disconnect()},[C.value]),U(()=>{let M=x.current;if(!M)return;let R=()=>{Oe(M),ye(M),performance.now()-Re.current>150&&(Y.current=M.scrollHeight-M.scrollTop-M.clientHeight>8)};function G(){Y.current=!0}function V($e){$e.deltaY<0&&G()}let te=0;function ge($e){te=$e.touches[0]?.clientY??0,ie.current=!0}function le($e){($e.touches[0]?.clientY??0)>te+4&&G()}function me(){ie.current=!1,K.current=performance.now()}function Ye(){ie.current=!0}return M.addEventListener("scroll",R,{passive:!0}),M.addEventListener("wheel",V,{passive:!0}),M.addEventListener("touchstart",ge,{passive:!0}),M.addEventListener("touchmove",le,{passive:!0}),M.addEventListener("touchend",me,{passive:!0}),M.addEventListener("touchcancel",me,{passive:!0}),M.addEventListener("pointerdown",Ye,{passive:!0}),window.addEventListener("pointerup",me,{passive:!0}),window.addEventListener("pointercancel",me,{passive:!0}),Oe(M),()=>{M.removeEventListener("scroll",R),M.removeEventListener("wheel",V),M.removeEventListener("touchstart",ge),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",me),M.removeEventListener("touchcancel",me),M.removeEventListener("pointerdown",Ye),window.removeEventListener("pointerup",me),window.removeEventListener("pointercancel",me)}},[]),U(()=>{let M=x.current;if(!M)return;let R=M.clientHeight,G=new ResizeObserver(()=>{if(M.clientHeight===R)return;let V=M.scrollHeight-M.scrollTop-R<=Ka;R=M.clientHeight,!(!V||D.current)&&C.value.some(te=>te.role==="user")&&(Y.current=!1,fe(M))});return G.observe(M),()=>G.disconnect()},[]);function Ue(){let M=x.current;M&&(Y.current=!1,fe(M))}let Rt=C.value.filter(M=>!M.ephemeral),gt=Rt[0],ze=gt?.serverMessageId??gt?.id,ae=!!(f&&Rt.length>=cc&&ze!==A);async function ve(){if(!f||I.current)return;let M=x.current,R=M?.scrollHeight??0,G=M?.scrollTop??0;I.current=!0,D.current=!0,N(!0);try{let V=await f();V===!1&&ze&&z(ze),V&&M&&(await new Promise(te=>requestAnimationFrame(()=>requestAnimationFrame(()=>te()))),M.scrollTop=G+M.scrollHeight-R,ye(M),Oe(M))}finally{D.current=!1,I.current=!1,N(!1)}}let _e=[],be="",Ce=C.value.at(-1)?.id,Ot=t?.value===!0,ct=n===!0;for(let M of C.value){if(M.role==="assistant"&&M.id!==Ce&&or(M))continue;let R=xS(M.createdAt);R&&R!==be&&(_e.push(a("div",{class:`${fn}-date-divider`,children:a("span",{class:`${fn}-date-pill`,title:SS(M.createdAt,S),children:wS(M.createdAt,r,S)})},`day:${R}`)),be=R);let V=M.retryAction!==void 0||M.role==="assistant"&&M.id===Ce?ba(C.value,M):void 0,te=V!==void 0&&(V.kind!=="continue-assistant"||m==="ai-agent");_e.push(a(Ag,{message:M,status:M.status,createdAt:M.createdAt,strings:r,locale:S,responseMode:s,showReasoning:l,stepDisplay:c,showSources:u,interactive:!!v&&m==="ai-agent"&&M.id===Ce,superseded:M.id!==Ce,tool:h,onRetry:v&&te&&(M.role==="user"||M.id===Ce)?y:void 0,enableMessageFeedback:p,onFeedback:_,reconnecting:Ot&&M.id===Ce,clientToolRunning:ct&&M.id===Ce&&M.role==="assistant",onCardAction:P},M.id))}return a("div",{class:`${fn}-list-wrap`,children:[a("div",{ref:x,class:`${fn}-list ${fn}-list--fade`,part:"messages",role:"log","aria-live":"polite","aria-relevant":"additions text",children:[d&&C.value.length===0?a("div",{class:`${fn}-list-loading`,role:"status",children:r.conversationLoading}):null,o&&!ae?a("div",{class:`${fn}-chat-notice`,role:"note","data-testid":O.chatNotice,children:a(Ma,{text:o})}):null,ae?a("div",{class:`${fn}-load-previous`,children:a("button",{type:"button",onClick:ve,disabled:k,"aria-busy":k,"data-testid":O.loadPreviousMessages,children:r.loadPreviousMessages})}):null,_e]}),g?a("button",{type:"button",class:`${fn}-jump`,onClick:Ue,"aria-label":r.scrollToBottom,title:r.scrollToBottom,"data-testid":O.scrollToBottom,children:a(Wt,{})}):null]})}function PS(e){try{return Intl.getCanonicalLocales(e)[0]}catch{return}}function xS(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function SS(e,t){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(t,{dateStyle:"full"})}catch{return""}}function wS(e,t,n){let r=new Date(e);function o(s){return new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime()}let i=Math.round((o(new Date)-o(r))/864e5);return i<=0?t.dateToday:i===1?t.dateYesterday:i<7?r.toLocaleDateString(n,{weekday:"long"}):r.toLocaleDateString(n,{month:"long",day:"numeric",year:"numeric"})}var kS=16,CS=64;function Qa({panelEl:e,resize:t,position:n,edge:r,initialSize:o,onSizeChange:i,onResizeStart:s,strings:l}){let c=L.cssPrefix,u=B(null),[p,_]=$(null),d=o?.width,f=o?.height;if(U(()=>{if(!e)return;let A=e.style;A.setProperty(`--${c}-resize-min-w`,t.minWidth??"320px"),A.setProperty(`--${c}-resize-min-h`,t.minHeight??"400px"),t.maxWidth&&A.setProperty(`--${c}-resize-max-w`,t.maxWidth),t.maxHeight&&A.setProperty(`--${c}-resize-max-h`,t.maxHeight),d!==void 0&&f!==void 0&&(A.setProperty(`--${c}-widget-w`,`${d}px`),A.setProperty(`--${c}-widget-h`,`${f}px`)),_(Math.round(e.getBoundingClientRect().width/window.innerWidth*100))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,c,d,f]),!e)return null;let v=n.startsWith("top-"),m=n.endsWith("-right"),h=m?-1:1,y=v?1:-1,P=`${c}-resize-grip--${r?"edge":`${v?"bottom":"top"}-${m?"left":"right"}`}`;function x(A){A.setAttribute("data-resizing",""),s?.()}function C(A,z,j){A.style.setProperty(`--${c}-widget-w`,`${z}px`),r||A.style.setProperty(`--${c}-widget-h`,`${j}px`)}function S(A){let z=A.getBoundingClientRect(),j={width:Math.round(z.width),height:Math.round(z.height)};A.style.setProperty(`--${c}-widget-w`,`${j.width}px`),r||A.style.setProperty(`--${c}-widget-h`,`${j.height}px`),_(Math.round(j.width/window.innerWidth*100)),i(j)}function g(A){if(!e)return;let z=e.getBoundingClientRect();u.current={pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,startW:z.width,startH:z.height,moved:!1},A.currentTarget.setPointerCapture(A.pointerId),A.preventDefault()}function b(A){let z=u.current;if(!z||A.pointerId!==z.pointerId||!e)return;let j=(A.clientX-z.startX)*h,Y=r?0:(A.clientY-z.startY)*y;!z.moved&&j===0&&Y===0||(z.moved||x(e),z.moved=!0,C(e,z.startW+j,z.startH+Y))}function k(A){let z=u.current;!z||A.pointerId!==z.pointerId||!e||(A.currentTarget.releasePointerCapture(A.pointerId),u.current=null,z.moved&&(e.removeAttribute("data-resizing"),S(e)))}function N(A){return A==="ArrowLeft"?[-1,0]:A==="ArrowRight"?[1,0]:r?null:A==="ArrowUp"?[0,-1]:A==="ArrowDown"?[0,1]:null}function I(A){let z=N(A.key);if(!z||!e)return;A.preventDefault();let j=A.shiftKey?CS:kS;A.repeat||x(e);let Y=e.getBoundingClientRect();C(e,Y.width+z[0]*j*h,Y.height+z[1]*j*y)}function D(A){!N(A.key)||!e||(e.removeAttribute("data-resizing"),S(e))}return a("div",{class:`${c}-resize-grip ${P}`,role:"separator","aria-orientation":"vertical","aria-label":l.resizeHandle,"aria-valuenow":p??void 0,tabIndex:0,title:l.resizeHandle,onPointerDown:g,onPointerMove:b,onPointerUp:k,onPointerCancel:k,onKeyDown:I,onKeyUp:D,"data-testid":O.resizeGrip,children:r?null:a(X_,{})})}var Eg=L.cssPrefix;function Mg({suggestions:e,strings:t,onPick:n,disabled:r=!1}){let o=B(null),[i,s]=$({start:!1,end:!1});return U(()=>{let l=o.current;if(!l)return;function c(){if(!l)return;let p=Math.abs(l.scrollLeft),_=p>1,d=p<l.scrollWidth-l.clientWidth-1;s(f=>f.start===_&&f.end===d?f:{start:_,end:d})}c(),l.addEventListener("scroll",c,{passive:!0});let u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(c);return u?.observe(l),()=>{l.removeEventListener("scroll",c),u?.disconnect()}},[e]),e.length===0?null:a("div",{ref:o,class:`${Eg}-suggestions`,role:"group","aria-label":t.suggestedReplies,"data-cut-start":i.start?"true":void 0,"data-cut-end":i.end?"true":void 0,children:e.map((l,c)=>a("button",{type:"button",class:`${Eg}-suggestion`,onClick:()=>n(l),disabled:r,"data-testid":ft(O.suggestion,c),children:l.label},l.id))})}var lr=L.cssPrefix,TS=`.${lr}-header, .${lr}-back-header, .${lr}-home-hero`,RS='button, a, input, textarea, select, [role="tab"], [contenteditable]',Lg=56;function Ya(e,t){U(()=>{if(!t||!e)return;function n(c){return Number.parseFloat(c)||0}function r(c,u){return Math.min(u,Math.max(-u,c))}let o=null,i=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(TS)||u.closest(RS))return;let p=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${lr}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${lr}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-Lg,maxY:(window.innerHeight+p.height)/2-Lg},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!o||c.pointerId!==o.id)return;let u=r(o.dx+c.clientX-o.x,o.maxX),p=r(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${lr}-modal-dx`,`${u}px`),e.style.setProperty(`--${lr}-modal-dy`,`${p}px`)},l=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Ja({containerRef:e,onDrop:t,accept:n,disabled:r=!1}){let[o,i]=$();return U(()=>{if(r){i(void 0);return}let s=e.current;if(!s)return;let l=0;function c(d){l+=1,d.dataTransfer?.types.includes("Files")&&(d.preventDefault(),i([...d.dataTransfer.items].every(f=>f.kind!=="file"||$f(f.type,n))?"accept":"reject"))}function u(){l-=1,!(l>0)&&(l=0,i(void 0))}function p(d){d.dataTransfer?.types.includes("Files")&&d.preventDefault()}function _(d){l=0,i(void 0),d.dataTransfer&&(d.preventDefault(),t(d.dataTransfer.items))}return s.addEventListener("dragenter",c),s.addEventListener("dragleave",u),s.addEventListener("dragover",p),s.addEventListener("drop",_),()=>{s.removeEventListener("dragenter",c),s.removeEventListener("dragleave",u),s.removeEventListener("dragover",p),s.removeEventListener("drop",_)}},[n,e,r,t]),r?void 0:o}var Se=L.cssPrefix;function Og(e){let{options:t,onClose:n}=e,r=t.strings,o=B(null);U(()=>{let u=o.current;if(!u||!n)return;let p=Hr(u);function _(d){d.key==="Escape"&&n?.()}return u.addEventListener("keydown",_),()=>{p(),u.removeEventListener("keydown",_)}},[n]);let i=e.composerApiRef,s=e.composerActive&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,l=F(u=>{s&&i.current?.attachFromDrop(u)},[i,s]),c=Ja({containerRef:o,onDrop:l,accept:e.options.attachments.accept,disabled:!s});return Ya(o.current,t.mode==="modal"),a("div",{ref:o,class:`${Se}-panel`,part:"panel",role:"dialog","aria-modal":"false","aria-label":r.panelTitle,style:{position:"relative"},"data-testid":O.panel,children:[a(Tc,{...e,containerEl:o.current,dragOver:c}),a(Rc,{poweredBy:e.options.poweredBy,strings:e.options.strings})]})}function Tc(e){let{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,composerKey:l,panelSize:c,view:u,isStreaming:p,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,sendPreparing:m,attachmentUploadsSig:h,controlMode:y,assignedOperator:P,operatorAvailable:x,operatorRequestEnabled:C,onRequestOperator:S,onCancelOperatorRequest:g,loadingMessages:b,onLoadPreviousMessages:k,messagesSig:N,reconnectingSig:I,agent:D,ticketReference:A,login:z,onStartAsGuest:j,suggestions:Y,initialWidgetSize:ie,onClose:K,onBack:Te,onExpand:Re,onToggleHistory:ye,onSelectHistoryConversation:Oe,onNewConversation:fe,onWidgetSizeChange:tt,onSend:ht,onStop:nt,onSuggestion:bt,tool:Ee,onRetry:Ue,onMessageFeedback:Rt,onCardAction:gt,containerEl:ze,dragOver:ae,composerApiRef:ve}=e,_e=t.strings,be=y==="operator"?P:void 0,Ce=be?{name:be.name??be.initials,avatar:be.avatar,title:_e.operatorBadgeTitle,status:"online"}:D,Ot=t.header.showNotice?at(_e,t.header.notice||"chatNotice"):void 0,ct=mt(()=>N.value.some(le=>!le.ephemeral&&le.role!=="system")).value,M=mt(()=>N.value.length>0).value,[R,G]=$(),V=R===s,te=t.features.emailTranscript&&ct?()=>G(s):void 0,ge=z.gate?a(NS,{login:{...z,gate:z.gate},alone:!M,onStartAsGuest:j,strings:_e}):a(pe,{children:[y&&y!=="ai-agent"?a(IS,{controlMode:y,operatorName:P?.name??P?.initials,operatorAvailable:x,onCancelOperatorRequest:g,strings:_e}):null,_&&y==="ai-agent"?a("div",{class:`${Se}-loading ${Se}-compaction-status`,role:"status","data-testid":O.compactionStatus,children:[a("span",{class:`${Se}-loading-spinner`,"aria-hidden":"true"}),_e.compactingContext]}):null,!p&&!_&&y==="ai-agent"&&a(Mg,{suggestions:Y,strings:_e,onPick:bt,disabled:m}),a(Hf,{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,maxMessageCharacters:e.maxMessageCharacters,isStreaming:p,pageToolRunning:e.pageToolRunning,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,active:e.composerActive&&u==="chat",isPreparing:m,attachmentUploadsSig:h,operatorRequestEnabled:C,canRequestOperator:ct,controlMode:y,onRequestOperator:S,onSend:ht,onStop:nt,apiRef:ve},l)]});return a(pe,{children:[u==="history"?a(AS,{strings:_e,onBack:ye,onClose:K,showClose:Pa(t.mode,c,t.actions)}):a("header",{class:`${Se}-header`,part:"header","data-variant":t.header.variant,"data-testid":O.panelHeader,children:[Te?a("button",{type:"button",class:`${Se}-icon-btn`,onClick:Te,"aria-label":_e.moduleBack,title:_e.moduleBack,children:a(Do,{})}):null,Ce?a(Qf,{agent:Ce,strings:_e,ticketReference:A,person:!!be}):a("h1",{children:_e.panelTitle}),a(Jt,{panelProps:z.gate?{...e,options:{...t,actions:t.actions.filter(le=>le!=="history")}}:e,variant:"chat",onEmailTranscript:te,onLogIn:z.menuLogIn})]}),u==="history"?a(Ha,{transport:n,strings:_e,locale:t.locale,persistence:i,onSelect:Oe,onNewConversation:fe}):a(pe,{children:[a(tg,{state:ae,strings:_e}),z.strip?a(LS,{strip:z.strip,onLogIn:z.onLogIn,onHide:z.onHidePrompt,strings:_e}):null,z.gate&&!M?null:a(Ig,{messagesSig:N,reconnectingSig:I,pageToolRunning:e.pageToolRunning,strings:_e,notice:Ot,locale:t.locale,responseMode:t.responseMode,showReasoning:t.showReasoning,stepDisplay:t.stepDisplay,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Rt,loading:b,onLoadPreviousMessages:k,idle:!p&&!m,controlMode:y,tool:Ee,onRetry:Ue,onCardAction:gt}),ge,a(MS,{disclaimer:t.composerDisclaimer}),V?a(og,{transport:n,strings:_e,knownEmail:rg({tokenEmail:z.email,userContext:t.userContext}),onClose:()=>G(void 0)}):null]}),t.size.resize?.enabled?a(Qa,{panelEl:ze,resize:t.size.resize,position:t.position,edge:t.mode==="drawer",initialSize:ie,onSizeChange:tt,onResizeStart:t.mode==="floating"&&c==="expanded"?Re:void 0,strings:_e}):null]})}function AS({strings:e,onBack:t,onClose:n,showClose:r}){return a("header",{class:`${Se}-header`,part:"header",children:[a("button",{type:"button",class:`${Se}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(Do,{})}),a("h1",{children:e.historyTitle}),r?a("button",{type:"button",class:`${Se}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(Ct,{})}):null]})}function IS({controlMode:e,operatorName:t,operatorAvailable:n,onCancelOperatorRequest:r,strings:o}){let[i,s]=$(!1),l=ES(e,t,n,o);function c(){r&&(s(!0),r().finally(()=>s(!1)))}return a("div",{class:`${Se}-operator-banner`,"data-mode":e,"data-available":n===!1?"false":void 0,"data-testid":O.operatorBanner,children:[a("span",{class:`${Se}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${Se}-operator-label`,role:"status",children:l}),e==="awaiting-operator"&&r?a("button",{type:"button",class:`${Se}-icon-btn ${Se}-operator-dismiss`,onClick:c,disabled:i,"aria-label":o.cancelOperatorRequest,title:o.cancelOperatorRequest,"data-testid":O.cancelOperatorRequest,children:a(Ct,{})}):null]})}function ES(e,t,n,r){return e==="operator"?r.chattingWithOperator.replace("{operator}",t??""):n===!1?r.noOperatorAvailable:r.connectingOperator}function MS({disclaimer:e}){return e?a("div",{class:`${Se}-composer-footer`,children:a("div",{class:`${Se}-disclaimer`,children:e})}):null}function LS({strip:e,onLogIn:t,onHide:n,strings:r}){let o=e.kind==="user";return a("div",{class:`${Se}-login-bar`,"data-kind":e.kind,role:o?"status":"note","data-testid":o?O.loggedIn:O.loginBar,children:[a("span",{class:`${Se}-login-bar-icon`,"aria-hidden":"true",children:a(pn,{})}),o?a("span",{class:`${Se}-login-bar-text`,children:e.who?r.loggedInAs.replace("{name}",e.who):r.loggedIn}):a(pe,{children:[a("span",{class:`${Se}-login-bar-text`,children:r.loginPrompt}),a("button",{type:"button",class:`${Se}-login-bar-action`,onClick:t,"data-testid":O.loginBarAction,children:r.loginAction}),a("button",{type:"button",class:`${Se}-icon-btn ${Se}-login-bar-hide`,onClick:n,"aria-label":r.dismissLoginPrompt,title:r.dismissLoginPrompt,"data-testid":O.loginBarHide,children:a(Ct,{})})]})]})}function OS(e,t){return e.gate==="required"?t.loginRequired:e.canStartAsGuest?t.loginExpiredGuest:t.loginExpired}function NS({login:e,alone:t,onStartAsGuest:n,strings:r}){return a("div",{class:`${Se}-login-gate`,"data-gate":e.gate,"data-alone":t?"":void 0,"data-testid":O.loginGate,children:[a("span",{class:`${Se}-login-gate-icon`,"aria-hidden":"true",children:a(pn,{})}),a("p",{class:`${Se}-login-gate-title`,role:"status",children:OS(e,r)}),e.canLogIn||e.canStartAsGuest?a("div",{class:`${Se}-form-actions ${Se}-login-gate-actions`,children:[e.canStartAsGuest?a("button",{type:"button",class:`${Se}-form-skip`,onClick:n,"data-testid":O.loginGateGuest,children:r.startAsGuest}):null,e.canLogIn?a("button",{type:"button",class:`${Se}-form-submit`,onClick:e.onLogIn,"data-testid":O.loginGateAction,children:r.loginAction}):null]}):null]})}function Rc({poweredBy:e,strings:t}){return e?a("div",{class:`${Se}-poweredby-bar`,children:a($S,{logoUrl:e.logoUrl,text:e.text??t.poweredBy.replace("{name}",L.displayName),href:e.href})}):null}function $S({logoUrl:e,text:t,href:n}){let r=a(pe,{children:[e?a("img",{class:`${Se}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${Se}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:r}):a("span",{class:`${Se}-poweredby`,children:r})}var Xa=L.cssPrefix;function Ng({panelProps:e,enabledModules:t,nav:n,bus:r,hasUnread:o,latestNews:i,onSelectConversation:s,onStartNewConversation:l,onSetPanelSize:c}){let u=e.options,p=u.strings,_=B(null),d=B(new Set);U(()=>{let j=_.current;if(!j||!e.onClose)return;let Y=Hr(j);function ie(K){K.key==="Escape"&&e.onClose?.()}return j.addEventListener("keydown",ie),()=>{Y(),j.removeEventListener("keydown",ie)}},[e.onClose]);let f=mt(()=>n.sig.value).value,v=z_(f),m=u.modules.byId[f.activeTab],h=e.composerActive&&m?.layout==="chat"&&v===void 0,y=e.composerApiRef,P=h&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,x=F(j=>{P&&y.current?.attachFromDrop(j)},[y,P]),C=Ja({containerRef:_,onDrop:x,accept:e.options.attachments.accept,disabled:!P});Ya(_.current,u.mode==="modal");let S=v?.kind==="content",g=t.length>1&&F_(f),b=B(null);U(()=>{if(S&&b.current===null)b.current=e.panelSize,e.panelSize==="normal"&&c("expanded");else if(!S&&b.current!==null){let j=b.current;b.current=null,c(j)}},[S]);let k={push:j=>n.push(j),pop:()=>n.pop(),switchTab:j=>n.switchTab(j),switchToLayout:j=>{let Y=t.find(ie=>ie.layout===j);Y&&n.switchTab(Y.id)},selectConversation:s,startNewConversation:l};function N(j){return{options:u,transport:e.transport,strings:p,config:j,nav:k,bus:r,panelProps:e,latestNews:i}}let I=a(Jt,{panelProps:e,variant:"plain"});m&&d.current.add(m.id);let D=t.filter(j=>d.current.has(j.id));function A(j){if(j.layout==="chat")return a(Tc,{...e,composerActive:h,containerEl:_.current,dragOver:C});let Y=Fa[j.layout].Root;return Y?a(Y,{...N(j)}):null}function z(){return v?.kind==="content"?a(Tf,{id:v.id,title:v.title,transport:e.transport,strings:p,bus:r,onBack:()=>n.pop(),actions:I}):null}return a("div",{ref:_,class:`${Xa}-panel ${Xa}-messenger`,part:"panel",role:"dialog","aria-modal":"false","aria-label":p.panelTitle,style:{position:"relative"},"data-testid":O.messengerHome,children:[a("div",{class:`${Xa}-messenger-body`,children:[D.map(j=>a("div",{class:`${Xa}-messenger-pane`,hidden:S||j.id!==m?.id,children:A(j)},j.id)),z()]}),g?a(Kf,{modules:t,activeTab:f.activeTab,strings:p,hasUnread:o,onSelect:j=>n.switchTab(j)}):null,a(Rc,{poweredBy:u.poweredBy,strings:u.strings}),u.size.resize?.enabled&&!(m?.layout==="chat"&&!v)?a(Qa,{panelEl:_.current,resize:u.size.resize,position:u.position,edge:u.mode==="drawer",initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,onResizeStart:u.mode==="floating"&&e.panelSize==="expanded"?e.onExpand:void 0,strings:p}):null]})}function $g(e){let t=L.cssPrefix,{site:n,blocks:r,strings:o,collapsed:i}=e,s=r?.navigation??[],l=r?.linkCards??[],c=i?o.expandSidebar:o.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":O.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(DS,{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":O.sidebarToggle,children:a(BS,{collapsed:i})})]}),i?null:a(pe,{children:[s.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(US,{items:s})}):null,l.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(zS,{items:l})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(Ha,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function DS({site:e}){let t=L.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??L.name})}function BS({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 US({items:e}){let t=L.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 zS({items:e}){let t=L.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 Dg=L.cssPrefix;function Bg(e){return a("main",{class:`${Dg}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a($g,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),a("section",{class:`${Dg}-page-chat`,"aria-label":e.strings.panelTitle,children:e.children})]})}var Go=L.cssPrefix;function Ac({strings:e,text:t,onClose:n}){return a("div",{class:`${Go}-panel ${Go}-panel-notice`,part:"panel",role:"dialog","aria-label":e.panelTitle,"data-testid":O.panelNotice,children:[n?a("button",{type:"button",class:`${Go}-icon-btn ${Go}-panel-notice-close`,onClick:n,"aria-label":e.close,title:e.close,children:a(Ct,{})}):null,a("p",{class:`${Go}-panel-notice-text`,children:t})]})}var Ko=ee.scope("hitl");function Qo(e){return e.kind==="tool"&&Wn(e.toolMetadata)&&(e.stateSig.value==="input-available"||e.stateSig.value==="approval-responded"&&e.approvalSig.value?.approved===!0)}function Ug(e,t){t.errorSig.value=Qs(t.toolCallId),t.stateSig.value="output-error",e.partsSig.value=[...e.partsSig.value]}function zg(e,t){let n=e.slice(0,e.indexOf(t)).findLast(r=>r.role==="user");return n!==void 0&&xt.sentHere(n.id)}function Fg(e){let{streaming:t,controlModeSig:n,messagesSig:r,sendAiTurn:o,bus:i,humanInLoop:s,tools:l}=e,c=B(t);c.current=t;let u=B(l);u.current=l;let p=B(new Map),_=mt(()=>{let x=r.value,C=x.at(-1);return n.value!=="ai-agent"||C?.role!=="assistant"||C.status!=="complete"?!1:C.partsSig.value.some(S=>Qo(S)&&xt.get(S.toolCallId)?.state!=="stopped")&&zg(x,C)}).value,d=F((x,C,S)=>{if(c.current||n.value!=="ai-agent")return!1;let g=r.value.at(-1),b=g?.partsSig.value.findIndex(I=>I.kind==="tool"&&I.toolCallId===x)??-1,k=g?.partsSig.value[b];if(!g||k?.kind!=="tool")return Ko.warn("decideTool: tool part not found",{toolCallId:x}),!1;if(g.status!=="complete"||!ma(g,b)||!C(k))return!1;if(S(k),g.partsSig.value=[...g.partsSig.value],!ir(g)||g.partsSig.value.some(Qo))return!0;g.status="streaming",g.retryAction={kind:"continue-assistant",messageId:g.serverMessageId??g.id},g.awaitingContinuation=!0,r.value=[...r.value];let N=g.partsSig.value.flatMap(I=>I.kind==="tool"?[I.toolCallId]:[]);return o({continueExisting:!0}).then(I=>I&&xt.clear(N)),!0},[n,r,o]),f=F((x,C)=>{let{toolCallId:S,toolName:g}=C;p.current.has(S)||(p.current.set(S,x),iu({toolCallId:S,toolName:g,input:C.inputSig.value,optionTools:u.current??[],onSettled:(b,k)=>{Ko.info("toolResult",{toolCallId:S,status:b}),i.emit("toolResult",{toolCallId:S,name:Cr(g),status:b,durationMs:k})}}).then(b=>{p.current.delete(S)&&d(S,Qo,k=>{b.state==="output-available"?k.outputSig.value=b.output:k.errorSig.value=b.errorText,k.stateSig.value=b.state})}))},[i,d]),v=F(()=>{let x=r.value;for(let[g,b]of p.current){let k=x.findIndex(N=>N.id===b);k<0||k===x.length-1||(p.current.delete(g),su(g))}let C=x.at(-1);if(c.current||C?.role!=="assistant"||C.status!=="complete")return;let S=C.partsSig.value.filter(Qo);if(!(S.length===0||!zg(x,C)))for(let g of S)xt.get(g.toolCallId)?.state==="stopped"?Ug(C,g):f(C.id,g)},[r,f]);U(()=>v(),[t,v]),U(()=>r.subscribe(()=>v()),[r,v]);let m=F((x,C,S)=>{let g=!1,b;if(!d(x,I=>I.stateSig.value==="approval-requested",I=>{Wn(I.toolMetadata)&&(b=I),g=I.toolMetadata?.card==="questions";let D=I.approvalSig.value?.id??x;I.approvalSig.value={id:D,approved:C,reason:S},I.stateSig.value="approval-responded"}))return;let N=r.value.at(-1);if(b&&C&&N&&f(N.id,b),b&&!C&&i.emit("toolResult",{toolCallId:x,name:Cr(b.toolName),status:"declined",durationMs:0}),g){Ko.info("toolResult",{toolCallId:x}),i.emit("toolResult",{toolCallId:x});return}Ko.info("toolDecision",{toolCallId:x,approved:C}),i.emit("toolDecision",{toolCallId:x,approved:C})},[i,d,r,f]),h=F(x=>{d(x,C=>C.stateSig.value==="approval-responded"&&C.approvalSig.value?.approved!==void 0&&!Qo(C),C=>{let S=C.approvalSig.value?.id??x;C.approvalSig.value={id:S},C.stateSig.value="approval-requested"})},[d]),y=xe(()=>({humanInLoop:s,onDecision:m,onEdit:h,preview:(x,C)=>ou({toolName:x,input:C,optionTools:u.current??[]})}),[s,m,h]),P=F(()=>{let x=r.value.at(-1);for(let C of p.current.keys()){let S=x?.partsSig.value.find(g=>g.kind==="tool"&&g.toolCallId===C);x&&S?Ug(x,S):Qs(C),Ko.info("toolResult",{toolCallId:C,status:"stopped"}),i.emit("toolResult",{toolCallId:C,name:S?Cr(S.toolName):void 0,status:"stopped",durationMs:0})}p.current.clear()},[i,r]);return{toolInteraction:y,pageToolsRunning:_,stopPageTools:P}}var FS=ee.scope("latest-news");function Hg({transport:e,options:t,persistence:n,enabled:r}){let o=t.modules.list.find(_=>_.layout==="news")?.contentCollectionIds,i=o?.join(","),[s,l]=$(),[c,u]=$(()=>n.loadSeenNewsId());U(()=>{if(!r||!o?.length)return;let _=!1;return e.listContent({contentCollectionIds:o,sortBy:"publishedAt",sortOrder:"desc",limit:1}).then(d=>{_||l(d.items[0])}).catch(d=>FS.debug("listContent (latest news) failed (non-fatal)",{err:d})),()=>{_=!0}},[e,r,i]);let p=F(_=>{n.saveSeenNewsId(_),u(_)},[n]);return{item:s,unseen:s!==void 0&&s.id!==c,markSeen:p}}function qg({callout:e,persistence:t}){let n=e?.text??"",r=e?.persistent??!0,[o,i]=$(()=>r?!1:t.loadCalloutDismissed(n));U(()=>{i(r?!1:t.loadCalloutDismissed(n))},[n,r,t]);let s=F(()=>{i(!0),r||t.saveCalloutDismissed(n)},[t,n,r]);return{dismissed:o,dismissCallout:s}}var HS=ee.scope("login");function qS(e,t){switch(e.status){case"required":return"required";case"expired":return"expired";case"anonymous":return t?"required":void 0;case"pending":case"loggedIn":return;default:return e}}function jS(e,t,n){if(e.status==="loggedIn")return t.hideUser?void 0:{kind:"user",who:e.name??e.email};if(!(e.status!=="anonymous"||!t.url||t.hidePrompt||n))return{kind:"prompt"}}function jg(e){let{state:t,deployment:n,bus:r,persistence:o,conversationIdSig:i}=e,[s,l]=$(()=>o.loadLoginPromptDismissedIn()),c=mt(()=>i.value).value,u=s!==void 0&&s===c,p=(t.status==="required"?t.loginUrl:void 0)??n.url,_=qS(t,n.required),d=F(()=>{let m=up(),h=r.listensTo("loginRequested");if(HS.info("loginRequested",{pageLogsIn:h}),r.emit("loginRequested",{returnTo:m}),h||!p)return;let y=i.value;y&&o.saveLoginReturn({conversationId:y,draft:o.loadDraft(y)}),o.savePanelOpen(!1),pp(sp(p,m))},[r,i,p,o]),f=F(()=>{let m=i.value;m&&(o.dismissLoginPromptIn(m),l(m))},[i,o]),v=!!p||r.listensTo("loginRequested");return{strip:jS(t,n,!!_||u),gate:_,canStartAsGuest:_==="expired"&&!n.required,email:t.status==="loggedIn"?t.email:void 0,canLogIn:v,onLogIn:d,menuLogIn:t.status==="anonymous"&&!_&&v?d:void 0,onHidePrompt:f}}function Vg(e){let{transport:t,conversationIdSig:n}=e,r=St("ai-agent"),o=St(void 0),i=St(void 0),s=B(void 0),l=F(_=>{let d=_.controlRevision,f=s.current;if(f&&f.conversationId===n.value&&d<f.revision)return;s.current={conversationId:n.value,revision:d},r.value=_.controlMode;let v=_.assignedOperatorInitials;o.value=v?{initials:v,name:_.assignedOperatorName,avatar:_.assignedOperatorAvatar}:void 0,_.controlMode!=="awaiting-operator"?i.value=void 0:_.operatorAvailable!==void 0&&(i.value=_.operatorAvailable)},[n,r,o,i]),c=F(_=>{if(_.type!=="data-control-state")return;let d=pa(_.data);d&&l(d)},[l]),u=F(async()=>{let _=n.value,d=await t.requestOperator();d&&n.value===_&&l(d)},[t,n,l]),p=F(async()=>{let _=n.value,d=await t.cancelOperatorRequest();d&&n.value===_&&l(d)},[t,n,l]);return{controlModeSig:r,assignedOperatorSig:o,operatorAvailableSig:i,applyControlState:l,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:p}}var Za=L.cssPrefix,Wg=`--${Za}-visual-viewport-height`,Gg=`--${Za}-visual-viewport-top`;function Kg(e){let{hostElement:t,mode:n,panelSize:r,isOpen:o,surfaceReady:i,onClose:s}=e;ut(()=>{Ni(t,xa(n,r,o))},[t,o,r,n]),ut(()=>{if(!o||!i)return;let l=t.ownerDocument.defaultView,c=l?.visualViewport,u=t.shadowRoot?.querySelector(`.${Za}-anchor`);if(!l||!c||!u)return;let p=()=>{u.style.setProperty(Wg,`${c.height}px`),u.style.setProperty(Gg,`${c.offsetTop}px`)},_=0,d=()=>{l.cancelAnimationFrame(_),_=l.requestAnimationFrame(()=>{_=l.requestAnimationFrame(p)})};return p(),c.addEventListener("resize",d),c.addEventListener("scroll",d),()=>{l.cancelAnimationFrame(_),c.removeEventListener("resize",d),c.removeEventListener("scroll",d),u.style.removeProperty(Wg),u.style.removeProperty(Gg)}},[t,o,i]),U(()=>{if(n!=="modal"||!o)return;function l(c){c.composedPath().some(p=>p instanceof HTMLElement&&p.classList.contains(`${Za}-panel`))||s()}return t.addEventListener("click",l),()=>t.removeEventListener("click",l)},[t,o,n,s]),U(()=>{if(n!=="drawer"||!o)return;function l(c){c.key==="Escape"&&!c.composedPath().includes(t)&&s()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,o,n,s])}var Ic=ee.scope("reducer"),es=class{constructor(t,n){Z(this,"messagesSig",t);Z(this,"onReconcileNeeded",n);Z(this,"active",null);Z(this,"openTextParts",new Map);Z(this,"partSeq",0);Z(this,"replay",null);Z(this,"turnChunks",[]);Z(this,"turnRow",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,n){let r=Yt();r.id=t.id;let o=cr(t)||ar(t)&&(t.status!=="streaming"||ir(t)),i=t.status==="streaming"&&ir(t)&&Eo(t);this.replay={baseline:t,shadow:r,chunks:[n],probeContinuation:o,continuationTailReplay:i,liveCatchUp:t.status==="streaming"&&!o},this.attach(r),this.apply(n)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let n=t.shadow.serverMessageId??t.baseline.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t.baseline||o?.id===t.baseline.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t.baseline)??r.find(l=>l.id===t.baseline.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t.baseline)return t;let s=t.baseline;return t.baseline=i,Qg(s,i),t.liveCatchUp&&cr(t.shadow)&&(i.status==="streaming"||ar(i))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=cr(i)||ar(i)&&(i.status!=="streaming"||ir(i)),t.continuationTailReplay=i.status==="streaming"&&ir(i)&&Eo(i),t.liveCatchUp=i.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let n=t.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t||o?.id===t.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t)??r.find(l=>l.id===t.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t)return t;Qg(t,i);let s=cr(t)&&ar(i);return i.status!=="streaming"&&!s?(this.detach(),null):(this.replayTurn(),this.replay?this.replay.shadow:this.active)}replayTurn(){let[t,...n]=this.turnChunks;if(t?.type!=="start")return;let r=this.messagesSig.value.find(o=>o.serverMessageId===t.messageId);if(!(r===void 0||r===this.turnRow)){this.detach();for(let o of[t,...n])this.applyResume(o)}}promoteReplay(t){let{baseline:n,shadow:r}=t;return Ft(()=>{n.role=r.role,n.serverMessageId=r.serverMessageId,n.operatorInitials=r.operatorInitials,n.status=r.status,r.canceled&&(n.canceled=!0),n.finishReason=r.finishReason,n.errorText=r.errorText,n.suggestions=r.suggestions??n.suggestions,n.runStartedAt=r.runStartedAt??n.runStartedAt,n.stepTimings=r.stepTimings??n.stepTimings,n.partsSig.value=r.partsSig.value,this.messagesSig.value=[...this.messagesSig.value]}),this.replay=null,this.active=n,n}promoteContinuation(t){let{baseline:n,chunks:r}=t,o=ha(n);return this.replay=null,Ft(()=>{n.partsSig.value=n.partsSig.value.slice(0,VS(n,r)+1),n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n);for(let i of r)this.apply(i);n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}settleOwnedContinuation(t,n){let{baseline:r}=t,o=ha(r);return this.replay=null,Ft(()=>{r.awaitingContinuation=!1,r.status="streaming",r.finishReason=void 0,r.errorText=void 0,r.suggestions=void 0,this.attach(r),this.apply(n),r.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),r}applyResume(t){t.type==="start"&&(this.turnChunks=[]);let n=this.applyTurnChunk(t);return this.turnChunks.push(t),this.turnRow=n??this.replay?.baseline??this.active??this.turnRow,n}applyTurnChunk(t){if(t.type==="start"){let o=(this.replay?.baseline??this.active)?.serverMessageId;o!==void 0&&t.messageId!==void 0&&o!==t.messageId&&this.onReconcileNeeded?.({messageId:o}),this.detach();let i=t.messageId,s=i!==void 0?this.messagesSig.value.find(p=>p.serverMessageId===i||p.id===i):void 0;if(s!==void 0)return t.messageMetadata?.senderRole==="visitor"&&s.role==="user"&&(s.status==="pending"||s.status==="error")&&(s.serverMessageId=i,s.status="complete",s.errorText=void 0,s.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(s,t),null;let l=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(l===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!Vt(c))return this.attach(c),this.apply(t),null;let u=Yt();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let r=this.refreshReplayBaseline();if(!r)return null;r.chunks.push(t),t.type==="data-control-state"&&(r.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:i,probeContinuation:s,continuationTailReplay:l,liveCatchUp:c}=r,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(s){if(!KS(o,i,t)){if(u){if(o.status==="streaming"&&o.awaitingContinuation!==!0){let d=this.settleOwnedContinuation(r,t);return this.detach(),d}XS(o,i)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id})),this.detach()}return null}let _=cr(o)&&u?this.settleOwnedContinuation(r,t):this.promoteContinuation(r);return u?(_.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:_.serverMessageId??_.id}):_.continuationStreaming=!1),this.detach(),_):null}if(l&&GS(o,i)){let _=this.promoteContinuation(r);return u?(this.detach(),_):null}if(!c)return u&&this.detach(),null;if(u&&!Vt(o)&&Vt(i)){let _=this.promoteReplay(r);return this.detach(),_}if(!WS(o,i))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}),this.detach()),null;let p=this.promoteReplay(r);return u?(this.detach(),p):null}let n=this.refreshActive();if(!n)return null;if(this.replay)return this.applyTurnChunk(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let r=n;return r.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:r.serverMessageId??r.id}):r.continuationStreaming=!1),this.detach(),r}return null}ensureTextPart(t,n,r){let o=`${n}:${r}`,i=this.openTextParts.get(o);if(i)return i;let s={kind:n,id:`${r}#${this.partSeq++}`,textSig:oe(""),doneSig:oe(!1)};return this.openTextParts.set(o,s),Yo(t,s),s}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let r=t.messageMetadata;r?.runStartedAt&&(n.runStartedAt=r.runStartedAt),r?.senderRole==="operator"?(n.role="operator",r.operatorInitials&&(n.operatorInitials=r.operatorInitials)):r?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":Yo(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"message-metadata":n.stepTimings=fa(t.messageMetadata?.steps)??n.stepTimings;return;case"finish":Ic.debug("finish",{reason:t.finishReason}),n.stepTimings=fa(t.messageMetadata?.steps)??n.stepTimings,n.status="complete",n.retryAction=void 0,t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Ic.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=void 0,this.bumpDone(n);return;case"abort":Ic.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,n.retryAction=void 0,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let r=this.ensureTextPart(n,"text",t.id);r.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 r=this.ensureTextPart(n,"reasoning",t.id);r.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-input-error":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":case"tool-approval-response":ZS(n,t);return;case"file":Yo(n,{kind:"file",url:t.url,mediaType:t.mediaType,filename:t.filename,fileId:t.fileId,fileSize:t.fileSize});return;case"source-url":Yg(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Yg(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":n.suggestions=_a(t.data);return;case"data-control-state":n.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;case"data-memory-compaction-state":return;default:{let r=t}}}bumpDone(t){Ft(()=>{t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])})}};function cr(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function Qg(e,t){e.canceled&&(t.canceled=!0),!(!cr(e)||t.status!=="streaming"&&!ar(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function VS(e,t){let n=e.partsSig.value,r=t.findIndex(l=>l.type==="start-step"),o=new Set(t.slice(0,r<0?t.length:r).flatMap(l=>"toolCallId"in l&&l.type.startsWith("tool-output")?[l.toolCallId]:[])),i=n.findLastIndex(l=>l.kind==="tool"&&(l.stateSig.value==="approval-requested"||l.stateSig.value==="approval-responded"||o.has(l.toolCallId)));if(i>=0)return i;let s=new Set(t.flatMap(l=>l.type==="tool-input-start"||l.type==="tool-input-available"?[l.toolCallId]:[]));return n.some(l=>l.kind==="tool"&&s.has(l.toolCallId))?-1:n.findLastIndex(l=>l.kind==="tool")}function WS(e,t){let n=e.partsSig.value,r=t.partsSig.value;return e.role!==t.role||r.length<n.length?!1:n.every((o,i)=>Jg(o,r[i]))}function GS(e,t){let n=e.partsSig.value,r=n.findLastIndex(l=>l.kind==="tool"),o=new Set(n.slice(0,r+1).flatMap(l=>l.kind==="tool"?[l.toolCallId]:[])),i=t.partsSig.value.filter(l=>l.kind!=="tool"||!o.has(l.toolCallId)),s=n.slice(r+1);return i.length<s.length?!1:s.every((l,c)=>Jg(l,i[c]))}function Jg(e,t){switch(e.kind){case"text":case"reasoning":return t?.kind===e.kind&&t.textSig.value.startsWith(e.textSig.value);case"step-start":return t?.kind==="step-start";case"tool":{if(t?.kind!=="tool"||t.toolCallId!==e.toolCallId||!va(t.toolName,e.toolName)||Nr[t.stateSig.value]<Nr[e.stateSig.value])return!1;let n=e.approvalSig.value?.approved;return n===void 0||t.approvalSig.value?.approved===n}case"file":return t?.kind==="file"&&t.url===e.url&&t.mediaType===e.mediaType;case"source":return t?.kind==="source"&&t.sourceId===e.sourceId&&t.url===e.url&&t.title===e.title&&t.filename===e.filename&&t.mediaType===e.mediaType;default:return e}}function KS(e,t,n){return QS(e,n)||!YS(e,t)?!0:n.type!=="finish"&&n.type!=="error"&&n.type!=="abort"?!1:Eo(t)||e.awaitingContinuation===!0&&n.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(r=>r.kind==="step-start")}function QS(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId);return n!==void 0&&Nr[n.stateSig.value]<4}function YS(e,t){let n=t.partsSig.value;if(n.length===0)return!0;let r=e.partsSig.value;return r.some((o,i)=>n.every((s,l)=>JS(r[i+l],s)))}function JS(e,t){switch(t.kind){case"text":case"reasoning":return e?.kind===t.kind&&e.textSig.value.startsWith(t.textSig.value);case"step-start":return e?.kind==="step-start";case"tool":return e?.kind==="tool"&&e.toolCallId===t.toolCallId&&(t.toolName==="tool"||va(e.toolName,t.toolName));case"file":return e?.kind==="file"&&e.url===t.url&&e.mediaType===t.mediaType;case"source":return e?.kind==="source"&&e.sourceId===t.sourceId&&e.url===t.url&&e.title===t.title&&e.filename===t.filename&&e.mediaType===t.mediaType;default:return t}}function XS(e,t){if(cr(e)||!ar(e))return!1;let n=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&n.has(o.toolCallId))}function Nn(e,t,n={}){let r=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(r)return n.dynamic&&(r.dynamic=!0),r.toolMetadata??(r.toolMetadata=n.toolMetadata),r.title=n.title??r.title,r;let o={kind:"tool",toolCallId:t,toolName:n.toolName??"tool",title:n.title,dynamic:n.dynamic?!0:void 0,toolMetadata:n.toolMetadata,inputPartialSig:oe(""),inputSig:oe(void 0),outputSig:oe(void 0),errorSig:oe(void 0),stateSig:oe("input-streaming"),approvalSig:oe(void 0)};return Yo(e,o),o}function Yo(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Yg(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||Yo(e,t)}function ZS(e,t){switch(t.type){case"tool-input-start":Nn(e,t.toolCallId,t);return;case"tool-input-delta":{let n=Nn(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Nn(e,t.toolCallId,t);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-input-error":{let n=Nn(e,t.toolCallId,t);n.inputSig.value=t.input,n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-approval-request":{let n=Nn(e,t.toolCallId,t);if(t.isAutomatic){n.approvalSig.value={id:t.approvalId,isAutomatic:!0};return}n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-approval-response":{let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.approvalSig.value?.id===t.approvalId);n?.approvalSig.value&&(n.approvalSig.value={...n.approvalSig.value,approved:t.approved,reason:t.reason});return}case"tool-output-available":{let n=Nn(e,t.toolCallId,t);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Nn(e,t.toolCallId,t);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Nn(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function Xg(e){let t=1e3,n=!1,r=!1,o=!1;function i(){o||e.signal.aborted||(o=!0,e.onInitialBoundaryReady())}for(;!e.signal.aborted;){let s,l="held";try{l=await e.connect(()=>{if(e.signal.aborted)return;s=e.now();let c=n||r;n=!0,r=!1,o?c&&e.backfill():i()})}catch{}if(e.signal.aborted||(!n&&s===void 0&&(r=!0,i()),l==="unavailable"))return;e.onDropped?.(),s!==void 0&&e.now()-s>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var ew=120;function Zg(e){let{activated:t,conversationReady:n,paused:r,conversationIdSig:o,messagesSig:i,optionsRef:s,transport:l,visitorId:c,adoptControlStateChunk:u,adoptMemoryCompactionStateChunk:p,settleSuggestions:_,recordConversationReply:d,transcriptRecoverySig:f,beginConversationTranscript:v,commitConversationTranscript:m,runCancellation:h,feedback:y,bus:P,loadInitialThread:x,shouldReconcileOnConnect:C,reconnectingSig:S}=e,g=B(0);U(()=>{if(!t||!n||r||!o.value)return;let b=o.value,k=new AbortController,N=R=>{},I=new es(i,R=>N(R));l.primeIdentity(c,b);let D=!1,A=!1,z,j=!1,Y,ie=0,K,Te,Re=Date.now(),ye,Oe=!1,fe=!1,tt=!1,ht;function nt(R,G){if(!Vt(R))return;let V=i.value.findLast(ge=>!ge.ephemeral),te=R.serverMessageId??R.id;if(!(V&&(V.serverMessageId??V.id)!==te)){if(ye&&Oe&&!i.value.some(ge=>ge.role==="user"&&!ge.ephemeral)){ht={replyId:te,activityAt:G};return}return ga(i.value,R,b,s.current.strings.newConversation,G)}}function bt(R,G,V){let te=nt(R,V);if(!te)return;let le=`${R.serverMessageId??R.id}:${G}:${te.preview??""}`;le!==Te&&(Te=le,l.publishConversation({...te,hasUnread:!0},!0))}let Ee;function Ue(){Ee&&(clearTimeout(Ee.timer),Ee=void 0)}function Rt(){let R=Ee;if(!R)return;clearTimeout(R.timer),Ee=void 0;let G=i.value.find(V=>(V.serverMessageId??V.id)===R.replyId);G?.role!=="assistant"&&G?.role!=="operator"||bt(G,R.generation,R.activityAt)}function gt(R,G,V){Ue(),Ee={replyId:R.serverMessageId??R.id,generation:G,activityAt:V,timer:setTimeout(Rt,ew)}}function ze(R,G,V=Date.now(),te=!0){Ue();let ge=nt(R,V);if(!ge)return;let me=`${R.serverMessageId??R.id}:${G}`;me!==K&&(K=me,d(ge),te&&ye&&!Oe&&(fe=!0))}function ae(R,G){(R||!h.localSendRef.current)&&h.settle(G)}function ve(R,G=[],V=!1,te,ge=ie,le=Date.now(),me=!0){let Ye=s.current;if(R.canceled){ze(R,ge,le,me),ae(V,te);return}let $e=!0,rt=R.status==="error";switch(P_(R,rt)){case"drop":i.value=i.value.filter(Be=>Be!==R),$e=!1;break;case"complete-operator-routed":R.status="complete",V&&(y.play("messageReceived"),Br(P,Ye,"assistant",He(R)));break;case"error":{if(R.status="error",V){y.play("error");let Be=new Error(rt?"stream error chunk":"empty reply");P.emit("error",Be),Ye.onError?.(Be)}break}case"complete":R.status="complete",V&&(y.play("messageReceived"),Br(P,Ye,"assistant",He(R))),_(R,G);break}$e&&ze(R,ge,le,me),ae(V,te)}function _e(R){if(k.signal.aborted||o.value!==b)return;if(u(R),p?.(R),R.type==="start"){let ot=function(dt){return dt.role==="assistant"&&dt.retryAction?.kind==="resend-user"&&dt.retryAction.messageId===Nt};var Be=ot;Rt();let yt=R.messageId===void 0?void 0:i.value.find(dt=>dt.serverMessageId===R.messageId||dt.id===R.messageId);j=yt!==void 0&&yt.status!=="streaming";let Mt=Y?.senderRole==="visitor"?Y.messageId:void 0;Y={messageId:R.messageId,senderRole:R.messageMetadata?.senderRole},ie+=1,Re=Date.now(),Te=void 0,D=R.messageMetadata?.senderRole===void 0,A=!1,z=D?R.messageMetadata?.runId:void 0;let Nt=D?R.messageMetadata?.senderMessageId:void 0;if(Nt&&i.value.some(ot)&&(i.value=i.value.filter(dt=>!ot(dt))),D){let dt=R.messageId!==void 0&&i.value.some($n=>$n.serverMessageId===R.messageId||$n.id===R.messageId),Ut=i.value.at(-1),ur=R.messageId!==void 0&&(Ut?.serverMessageId===R.messageId||Ut?.id===R.messageId),pr=h.localSendRef.current&&(!dt||ur)&&Ut?.role==="assistant"&&Ut.status==="streaming"&&(ur||Ut.serverMessageId===void 0&&Ut.partsSig.value.length===0);A=h.captureStart(b,R,pr,Mt)}}let G=D&&(R.type==="finish"||R.type==="error"||R.type==="abort"),V=G?z:void 0,te=G&&(A||h.ownsLocalRun(V)),ge=ie,le=j;G&&(D=!1,A=!1,z=void 0);let me=I.applyResume(R),Ye=Y?.messageId,$e=Ye===void 0?void 0:i.value.find(yt=>yt.serverMessageId===Ye||yt.id===Ye);j&&Y?.senderRole!=="visitor"&&(me!==null||$e?.status==="streaming")&&(j=!1,le=!1);let rt=!j&&($e?.role==="assistant"||$e?.role==="operator");if(R.type==="text-delta"&&rt&>($e,ie,Re),R.type==="text-end"&&(Ue(),rt&&bt($e,ie,Re)),!me){G&&(te||!h.localSendRef.current)&&h.settle(V);return}if(me.role==="operator"){le||(y.play("messageReceived"),Br(P,s.current,"operator",He(me))),ze(me,ge,Re),j=!1,G&&(te||!h.localSendRef.current)&&h.settle(V);return}me.role==="assistant"&&(ve(me,[],te,V,ge,Re),j=!1)}async function be(R){let G=ie,V=await l.loadConversation(b,R?{ids:[R]}:void 0).catch(()=>null);if(k.signal.aborted||o.value!==b||!V)return!1;V.controlState&&u({type:"data-control-state",data:V.controlState});let te=i.value.at(-1),ge=G===ie&&(R===void 0||te!==void 0&&(te.serverMessageId===R||te.id===R));if(V.messages.length===0)return!0;let le=i.value,me=R===void 0?le.at(-1):le.find(ot=>ot.serverMessageId===R||ot.id===R),Ye=Mo(le,In(V.messages)),$e=v_(V.messages),rt=Ye.messages.filter(ot=>!(ot.role==="assistant"&&ot.retryAction?.kind==="resend-user"&&$e.has(ot.retryAction.messageId)));if(!Ye.changed&&rt.length===Ye.messages.length)return!0;i.value=rt;let Be=R===void 0?rt.at(-1):rt.find(ot=>ot.serverMessageId===R||ot.id===R),yt=me!==void 0&&Be!==void 0&&(me.id===Be.id||me.serverMessageId!==void 0&&me.serverMessageId===Be.serverMessageId),Mt=Be!==void 0&&Be.status!=="streaming"&&(!yt||me?.status==="streaming"),Nt=yt&&me?.status==="streaming"?Date.now():Be?.createdAt;return ge&&Mt&&Be.role==="assistant"?ve(Be,Be.suggestions??[],h.localSendRef.current,void 0,G,Nt,!1):ge&&Mt&&Be.role==="operator"?ze(Be,G,Nt,!1):ge&&Be?.role==="assistant"&&Be.status!=="streaming"&&_(Be,Be.suggestions??[]),!0}let Ce=new Set;N=({messageId:R})=>{if(Ce.has(R)||!i.value.some(V=>V.serverMessageId===R||V.id===R))return;Ce.add(R);function G(){return Ce.delete(R)}be(R).then(G,G)};function Ot(){let R=ht;ht=void 0;let G=R&&i.value.find(te=>(te.serverMessageId??te.id)===R.replyId),V=G&&nt(G,R.activityAt);V&&d(V)}function ct(R=!1){if(k.signal.aborted||o.value!==b){fe=!1;return}if(ye){fe=!0;return}let G=R?x(b):void 0,V=G??(!R||C()?be():void 0);if(!V)return;v(b),ye=V,Oe=G!==void 0;function te(ge=!1){if(ye===V){if(ye=void 0,I.replayTurn(),fe){fe=!1,ct();return}Ot(),ge&&m(b)}}V.then(te,()=>te(!1))}let M=f.subscribe(R=>{R<=g.current||(g.current=R,tt&&ct())});return Xg({signal:k.signal,now:()=>performance.now(),sleep:R=>jn(R,k.signal),connect:R=>l.connectResumeStream({signal:k.signal,onChunk:_e,onConnected:()=>{S.value=!1,R()}}),onDropped:()=>{S.value=!0},onInitialBoundaryReady:()=>{tt=!0,ct(!0)},backfill:()=>ct()}),()=>{k.abort(),S.value=!1,Ue(),M(),I.detach()}},[t,n,r,o,o.value,c,l,u,p,_,d,f,v,m,h,i,P,y,x,C,S])}var tw=32;function em(e){let{transport:t,setStreaming:n}=e,r=B(void 0),o=B(void 0),i=B(!1),s=B(void 0),l=B(!1),c=B(new Map),u=B(new Set),p=F((S,g)=>{let b=`${S}:${g}`;s.current!==b&&(s.current=b,t.cancelTurn(S,g))},[t]),_=F(S=>{r.current=void 0,o.current=S,i.current=!1,s.current=void 0,l.current=!0,n(!0)},[n]),d=F((S,g)=>{c.current.set(S,{messageId:g})},[]),f=F(S=>{if(S!==void 0){u.current.add(S);let g=u.current.values().next().value;u.current.size>tw&&g!==void 0&&u.current.delete(g)}S!==void 0&&r.current?.runId!==S||(r.current=void 0,o.current=void 0,i.current=!1,l.current=!1,n(!1))},[n]),v=F((S,g)=>o.current!==S?g.runId&&r.current?.runId===g.runId?(r.current={conversationId:g.conversationId,runId:g.runId},i.current&&p(g.conversationId,g.runId),!0):!1:(o.current=void 0,g.runId?(r.current={conversationId:g.conversationId,runId:g.runId},n(!0),i.current&&p(g.conversationId,g.runId),!0):(f(),!0)),[p,n,f]),m=F((S,g)=>{let b=c.current.get(S);return b?(c.current.delete(S),!g.runId||u.current.has(g.runId)?!0:b.runId!==void 0?(b.runId!==g.runId||r.current?.runId===g.runId&&(r.current={conversationId:g.conversationId,runId:g.runId},i.current&&p(g.conversationId,g.runId)),!0):(l.current||o.current||(r.current={conversationId:g.conversationId,runId:g.runId},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0)),!0)):!1},[p,n]),h=F(S=>o.current!==S?!1:(f(),!0),[f]),y=F(S=>{let g=c.current.get(S);return g?(c.current.delete(S),g.runId===void 0):!1},[]),P=F((S,g,b,k)=>{let N=g.messageMetadata?.runId;if(g.messageMetadata?.senderRole!==void 0||typeof N!="string"||!N||u.current.has(N))return!1;if(r.current?.runId===N)return l.current;if(l.current)return r.current||!b?!1:(o.current=void 0,r.current={conversationId:S,runId:N},n(!0),i.current&&p(S,N),!0);let D=[...c.current.values()].filter(A=>A.runId===void 0).find(A=>A.messageId===k);return D?(D.runId=N,r.current={conversationId:S,runId:N},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0),!0):(o.current=void 0,r.current={conversationId:S,runId:N},n(!0),i.current&&p(S,N),l.current)},[p,n]),x=F(S=>typeof S=="string"&&r.current?.runId===S&&l.current,[]),C=F(()=>{let S=r.current;if(S)return i.current=!0,p(S.conversationId,S.runId),!0;let g=o.current;return g?(i.current=!0,g.then(b=>{b.runId&&p(b.conversationId,b.runId)}).catch(()=>{}),!0):!1},[p]);return xe(()=>({localSendRef:l,begin:_,beginRouted:d,acceptAck:v,acceptRoutedAck:m,reject:h,rejectRouted:y,captureStart:P,ownsLocalRun:x,settle:f,stop:C}),[v,m,_,d,P,x,h,y,f,C])}var nw=ee.scope("send");function rm(e,t,n,r,o){e.publishConversation({...ga(t,n,r,o),hasUnread:!1},!0)}function om(e,t){return e.id===t.id||(e.serverMessageId??e.id)===(t.serverMessageId??t.id)}function im(e){return e.findLast(t=>!t.ephemeral&&t.role!=="system"&&(t.role==="user"||t.status!=="streaming"||Vt(t)))}function Jo(e,t,n,r,o){let i=im(t);i?.role!=="user"||!om(i,n)||rm(e,t,i,r,o)}function tm(e){return e instanceof Le&&e.status===404&&e.errorCode==="CONVERSATION_NOT_FOUND"}function nm(e){return!(e instanceof Le)||e.code==="network"||e.status===void 0||e.status===202?!0:e.status===408||e.status===425||e.status===429||e.status>=500&&e.status<600}function am(e){let{transport:t,messagesSig:n,conversationIdSig:r,options:o,bus:i,feedback:s,persistence:l,visitorId:c,adoptConversationId:u,applyControlState:p,setTicket:_,settleSuggestions:d,runCancellation:f,onConversationNotFound:v}=e,m=F(()=>{let P=r.value??Lt();return r.value||(r.value=P,l.saveConversationId(P)),P},[r,l]),h=F(async({continueExisting:P,turn:x,movedFromConversation:C=!1})=>{let S=m(),g=n.value.at(-1),b=x?[x]:f_(n.value,P),k=b[0];k?.role==="user"&&xt.markSent(k.id);let N=b.map(nc),I=l.loadUserPrefs(),D=ao(o.tools).then(A=>t.sendTurn(Jl({messages:N,conversationId:S,visitorId:c,userPrefs:I,clientTools:Ks(A)}),{keepalive:P}));f.begin(D);try{let A=await D;if(r.value!==S||!f.acceptAck(D,A))return!1;if(u(A.conversationId),_({conversationId:A.conversationId,reference:A.ticketReference}),A.runId&&k?.role==="user"&&Jo(t,n.value,k,A.conversationId,o.strings.newConversation),!A.runId){let z=await t.loadConversation(A.conversationId).catch(()=>null);if(r.value!==A.conversationId)return!0;if(z){z.controlState&&p(z.controlState);let j=In(z.messages),{messages:Y,changed:ie}=Mo(n.value,j);ie&&(n.value=Y);let K=j.findLast(ye=>!ye.ephemeral&&ye.role!=="system"),Te=im(n.value);Te&&K&&om(Te,K)&&rm(t,n.value,Te,A.conversationId,o.strings.newConversation);let Re=g?n.value.find(ye=>ye.id===g.id&&ye.role==="assistant"&&ye.status!=="streaming"):void 0;Re&&d(Re,Re.suggestions??[]),!P&&g?.role==="assistant"&&n.value.includes(g)&&g.serverMessageId===void 0&&!Vt(g)&&(n.value=n.value.filter(ye=>ye!==g))}else g?.role==="assistant"&&n.value.includes(g)&&(g.status="error",g.errorText=o.strings.errorGeneric,P?g.retryAction={kind:"continue-assistant",messageId:g.serverMessageId??g.id}:g.retryAction=k?.role==="user"?{kind:"resend-user",messageId:k.id}:null,n.value=[...n.value])}return!0}catch(A){if(r.value!==S)return!1;if(!f.reject(D))return k?.role==="user"&&Jo(t,n.value,k,S,o.strings.newConversation),!0;if(!P&&!C&&k?.role==="user"&&tm(A))return v(k);if(!P&&k?.role==="user"&&A instanceof Le&&A.status===401){let ie=g?.role==="assistant"&&g.serverMessageId===void 0?g:void 0;return n.value=n.value.filter(K=>K!==k&&K!==ie),l.saveDraft(S,He(k)),!1}let z=_n(A,o.strings),j=nm(A),Y=x?.role==="assistant"?x:n.value.at(-1);if(P&&Y?.role==="assistant"&&A instanceof Le&&A.status===409){let ie=Y.serverMessageId??Y.id,K=await t.loadConversation(S,{ids:[ie]}).catch(()=>null);if(r.value!==S)return!1;if(K){K.controlState&&p(K.controlState);let Te=In(K.messages),Re=Te.find(ye=>(ye.serverMessageId??ye.id)===ie);if(Re&&b_(Y,Re)){let{messages:ye,changed:Oe}=Mo(n.value,Te),fe=ye.find(tt=>(tt.serverMessageId??tt.id)===ie);if(Oe&&fe&&fe!==Y)return fe.awaitingContinuation=!1,fe.continuationStreaming=void 0,fe.retryAction=null,n.value=ye,fe.status!=="streaming"&&d(fe,fe.suggestions??[]),!0}}if(!n.value.includes(Y)||Y.status!=="streaming")return!1;Y.continuationStreaming=!0}if(P&&Y?.role==="assistant")Y.status="error",Y.errorText=z,Y.retryAction=j?{kind:"continue-assistant",messageId:Y.serverMessageId??Y.id}:null,n.value=[...n.value];else if(g?.role==="assistant"&&n.value.includes(g)){g.status="error",g.errorText=z;let ie=b[0];g.retryAction=j&&ie?.role==="user"?{kind:"resend-user",messageId:ie.id}:null,n.value=[...n.value]}else{let ie=Yt();ie.status="error",ie.errorText=z;let K=b[0];ie.retryAction=j&&K?.role==="user"?{kind:"resend-user",messageId:K.id}:null,n.value=[...n.value,ie]}return s.play("error"),i.emit("error",A),o.onError?.(A),!1}},[t,n,o,i,s,l,c,u,p,_,d,m,f,v]),y=F(async P=>{let x=m();P.status="pending",P.errorText=void 0,P.retryAction=void 0,n.value.includes(P)&&(n.value=[...n.value]),xt.markSent(P.id);let C=[nc(P)],S=l.loadUserPrefs(),g=ao(o.tools).then(b=>t.sendTurn(Jl({messages:C,conversationId:x,visitorId:c,userPrefs:S,clientTools:Ks(b)})));f.beginRouted(g,P.id);try{let b=await g;return r.value!==x?(f.rejectRouted(g),!1):f.acceptRoutedAck(g,b)?(u(b.conversationId),_({conversationId:b.conversationId,reference:b.ticketReference}),Jo(t,n.value,P,b.conversationId,o.strings.newConversation),P.status==="pending"&&(P.status="complete",n.value.includes(P)&&(n.value=[...n.value])),!0):!1}catch(b){let k=f.rejectRouted(g);if(r.value!==x)return!1;if(!k)return Jo(t,n.value,P,x,o.strings.newConversation),P.status==="pending"&&(P.status="complete",n.value.includes(P)&&(n.value=[...n.value])),!0;if(P.status!=="pending")return Jo(t,n.value,P,x,o.strings.newConversation),!0;if(tm(b))return v(P);nw.debug("operator-routed send failed",{error:b});let N=b instanceof Error?b:new Error(String(b));return P.status="error",P.errorText=_n(b,o.strings),P.retryAction=nm(b)?{kind:"resend-user",messageId:P.id}:null,n.value.includes(P)&&(n.value=[...n.value]),s.play("error"),i.emit("error",N),o.onError?.(N),!1}},[t,n,o,i,s,l,c,u,_,m,f,v]);return{sendAiTurn:h,sendRoutedTurn:y}}var rw=ee.scope("unread");function sm(e){let{transport:t,options:n,conversationIdSig:r,isConversationVisibleRef:o,activated:i,conversationReady:s}=e,l=St(!1),c=St(0),u=St(0),p=B([]),_=B(void 0),d=B(!1),f=B(!1),v=F(()=>{let b=r.value,k=o.current()&&_.current===b?b:void 0,N=p.current.filter(I=>I.hasUnread&&I.conversationId!==k).length;c.value=N,l.value=N>0},[r,l,c,o]),m=F(b=>{let k=r.value,N=p.current.find(z=>z.conversationId===k),I=un(p.current,b),D=I.find(z=>z.conversationId===k),A=b.type==="snapshot"&&k!==void 0&&D?.hasUnread===!0&&_.current===k&&N!==void 0&&N.lastMessageAt!==D.lastMessageAt;A&&(_.current=void 0),p.current=I,v(),A&&(u.value+=1)},[r,v,u]),h=F(()=>{if(v(),!o.current())return;let b=r.value;if(!b||_.current!==b)return;let k=p.current.find(N=>N.conversationId===b);k?.hasUnread&&t.markRead(b,k.lastMessageAt)},[r,o,v,t]),y=F(b=>{r.value===b&&(_.current=void 0,v())},[r,v]),P=F(b=>{r.value===b&&(_.current=b,h())},[r,h]),x=F(b=>_.current===b,[]),C=F((b=!1)=>{if(!n.history.enabled||!n.modules.list.some(N=>N.layout==="chat"))return;function k(N){if(d.current){N&&(f.current=!0);return}d.current=!0,t.listConversations({limit:50},N).then(I=>{N||m({type:"snapshot",result:I,requestedRevision:0}),h()}).catch(I=>rw.debug("refreshUnread failed (non-fatal)",{err:I})).finally(()=>{d.current=!1,f.current&&(f.current=!1,k(!0))})}k(b)},[m,h,n.history.enabled,n.modules,t]),S=F(b=>{let k=b.conversationId,N=o.current()&&r.value===k&&_.current===k,I=p.current.find(A=>A.conversationId===k),D=N&&(I?.lastMessageAt!==b.lastMessageAt||I.hasUnread);t.publishConversation({...b,hasUnread:!N},!0),D&&t.markRead(k,b.lastMessageAt)},[r,o,t]);U(()=>t.subscribeConversationChanges(m),[m,t]);let g=B(!1);return U(()=>{!i||!s||g.current||(g.current=!0,C())},[i,s,C]),U(()=>{if(!i)return;function b(){document.visibilityState==="visible"&&(h(),C(!0))}return document.addEventListener("visibilitychange",b),()=>document.removeEventListener("visibilitychange",b)},[i,h,C]),{hasUnreadSig:l,unreadCountSig:c,transcriptRecoverySig:u,markVisibleConversationRead:h,beginConversationTranscript:y,commitConversationTranscript:P,isConversationTranscriptCommitted:x,recordConversationReply:S,refreshUnread:C}}var Xo=ee.scope("settings");function lm(e){let{options:t,persistence:n,transport:r,feedback:o,hostElement:i,bus:s}=e,l=n.loadUserPrefs(),[c,u]=$(()=>l.locale??t.locale),[p,_]=$(l.themeMode),d=no(t.themeMode,p),[f,v]=$(()=>l.textSize??t.textSize),m=F(S=>{n.patchUserPrefs(S),r.saveUserPrefs(n.loadUserPrefs()).catch(g=>Xo.warn("saveUserPrefs failed",{err:g}))},[n,r]);U(()=>{l.soundMuted!==void 0&&o.setMuted(l.soundMuted)},[]),U(()=>{if(d!=="host"){i.dataset.theme=d;return}return Ru(S=>{i.dataset.theme=S})},[i,d,t]),U(()=>{i.dataset.textSize=f},[i,f,t]),U(()=>{let S=!0;return o.mutedSig.subscribe(g=>{if(S){S=!1;return}m({soundMuted:g})})},[o,m]);let h=Sr(c,t.availableLocales,t.defaultLocale);U(()=>{r.setLocale(h)},[r,h]),U(()=>{i.dir=_i(h)?"rtl":"ltr"},[i,h]),U(()=>{h!==c&&u(h)},[h,c]);let y=F(S=>{Xo.info("localeChange",{locale:S}),u(S),m({locale:S}),s.emit("localeChange",S)},[m,s]),P=F(S=>{Xo.info("themeChange",{mode:S}),_(S),i.dataset.theme=S,m({themeMode:S}),s.emit("themeChange",S)},[i,m,s]),x=F(S=>{Xo.info("textSizeChange",{size:S}),v(S),i.dataset.textSize=S,m({textSize:S}),s.emit("textSizeChange",S)},[i,m,s]),C=F(()=>{o.toggleMuted();let S=o.mutedSig.value;Xo.info("soundToggle",{muted:S}),s.emit("soundToggle",{muted:S})},[o,s]);return{activeLocale:c,activeThemeMode:d,activeTextSize:f,setActiveLocale:u,setActiveThemeMode:_,setActiveTextSize:v,patchAndSync:m,handleLocaleChange:y,handleThemeChange:P,handleTextSizeChange:x,handleSoundToggle:C}}var we=ee.scope("app"),Zo=L.cssPrefix,ow={home:"home",chats:"chat",help:"help",news:"news"};function dm({options:e,hostElement:t,bus:n,recentHostEvents:r,loginRevision:o=0,onPersonChanged:i,onStartAsGuest:s}){let l=e.aiAgentDeploymentId;if(!l)throw new Error("aiAgentDeploymentId is required");let[c]=$(()=>wn(e.widgetId,e.storage,e.aiAgentDeploymentId)),[u,p]=$(()=>c.getVisitorId()),_=c.loadUserPrefs(),d=St(c.loadConversationId()),f=B(d.value!==void 0),v=St(d.value??""),m=St([]),h=St(!1),[y,P]=$(!1),x=B(void 0);function C(){let w=e.modules.list,E=new Set(w.map(ne=>ne.id)),J=c.loadActiveModule();return J&&E.has(J)?J:w[0]?.id??""}function S(){return e.modules.list.find(w=>w.layout==="chat")?.id}function g(){let w=S();return w?e.modules.list.length===1?!0:k.sig.value.activeTab===w:!1}let b=B(void 0);if(!b.current){let w=e.modules.list.map(J=>J.id),E=c.loadActiveModule()??w[0]??"";b.current=B_(E,E?[...w,E]:w,J=>c.saveActiveModule(J))}let k=b.current,N=mt(()=>k.sig.value.activeTab).value,I=mt(()=>d.value).value,[D,A]=$(!1),[z,j]=$(!1),Y=e.mode==="standalone"||e.mode==="inline",ie=B($o(e,Ur(),c.loadPanelOpen(),c.loadPanelSize())),[K,Te]=$(ie.current.panelOpen),[Re,ye]=$(ie.current.panelOpen),Oe=B(void 0),fe=B(void 0),tt=B(!1),ht=B(void 0),nt=B(e.strings),bt=B(void 0);U(()=>{K&&ye(!0)},[K]);let Ee=B(!1),[Ue,Rt]=$(!1),gt=B(null),ze=B(!1),{dismissed:ae,dismissCallout:ve}=qg({callout:e.launcher.callout,persistence:c}),_e=e.launcher.callout?.persistent??!0,be=F(()=>{we.info("calloutDismiss"),n.emit("calloutDismiss",void 0),ve()},[n,ve]),[Ce,Ot]=$(ie.current.panelSize),ct=B(!1),[M,R]=$("chat"),G=B(()=>!1);G.current=()=>K&&M==="chat"&&!document.hidden&&g();let[V,te]=$(!1),ge=B(V);ge.current=V;let le=B(null),[me,Ye]=$(!1),$e=St(new Map),rt=F((w,E)=>{let J=new Map($e.value);E?J.set(w,E):J.delete(w),$e.value=J},[$e]),[Be,yt]=$(null),[Mt,Nt]=$(),[ot,dt]=$([]),Ut=B(e);Ut.current=e;let[ur,pr]=$(void 0),[$n,_r]=$(void 0),[Dn,ti]=$(()=>c.loadSidebarCollapsed()??!1),[Bn,fr]=$({status:"anonymous"}),[as,ni]=$({}),[H,Q]=$(),[W]=$(()=>new ya({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Xu({publicKey:e.publicKey,aiAgentDeploymentId:l,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints,recentHostEvents:r,onLoginState:fr,continueLink:e.continueLink})),[ce]=$(()=>new ji(e.sound,e.haptics)),Me=em({transport:W,setStreaming:te}),{activeLocale:vt,activeThemeMode:tn,activeTextSize:nn,setActiveLocale:At,setActiveThemeMode:ss,setActiveTextSize:bm,patchAndSync:Dc,handleLocaleChange:ym,handleThemeChange:Pm,handleTextSizeChange:xm,handleSoundToggle:Sm}=lm({options:e,persistence:c,transport:W,feedback:ce,hostElement:t,bus:n}),{controlModeSig:Gt,assignedOperatorSig:wm,operatorAvailableSig:km,applyControlState:Qr,adoptControlStateChunk:Cm,requestOperator:Tm,cancelOperatorRequest:Rm}=Vg({transport:W,conversationIdSig:d}),gn=St(new Map),Am=F(w=>{if(w.type!=="data-memory-compaction-state")return;let E=d.value;if(!E)return;let J=p_(w.data);if(!J)return;let ne=gn.value.get(E);if(ne&&(J.postFinishSequence<ne.postFinishSequence||J.postFinishSequence===ne.postFinishSequence&&(ne.status==="ready"||ne.status===J.status)))return;let de=new Map(gn.value);de.set(E,J),gn.value=de},[d,gn]),{hasUnreadSig:Im,unreadCountSig:Bc,transcriptRecoverySig:Em,markVisibleConversationRead:Uc,beginConversationTranscript:ls,commitConversationTranscript:gr,isConversationTranscriptCommitted:zc,recordConversationReply:Mm,refreshUnread:Lm}=sm({transport:W,options:e,conversationIdSig:d,isConversationVisibleRef:G,activated:Re,conversationReady:D}),cs=jg({state:Bn,deployment:as,bus:n,persistence:c,conversationIdSig:d}),Om=K&&e.modules.byId[N]?.layout==="home",Nm=Hg({transport:W,options:e,persistence:c,enabled:D&&Om});U(()=>{Uc()},[N,K,M,I,Uc]),U(()=>{ce.update(e.sound,e.haptics)},[ce,e.sound,e.haptics]),U(()=>()=>ce.destroy(),[ce]),U(()=>{ct.current||!e.size.initialSize||(ct.current=!0,!c.loadPanelSize()&&Ot(uc(e.mode,e.size,Ur())))},[e.mode,e.size,c]),U(()=>{if(!D||Ee.current)return;Ee.current=!0;let w=$o(e,Ur(),c.loadPanelOpen(),c.loadPanelSize());Te(w.panelOpen),Ot(w.panelSize)},[D,e,c]);let mr=B(null);U(()=>{D&&k.reconcile(e.modules.list.map(w=>w.id),C())},[D,e.modules.list,k]);let ri=F(w=>{!w||w.length===0||(m.value=w.map(E=>ec({...E,text:at(nt.current,E.text)})))},[m]),Yr=B(0),rn=B(0),ds=F(w=>{if(w===d.value)return;let E=d.value;rn.current++,P(!1),E&&(c.saveDraft(w,c.loadDraft(E)),c.saveDraft(E,""),c.saveMessageQueue(w,c.loadMessageQueue(E)),c.saveMessageQueue(E,[])),d.value=w,c.saveConversationId(w),W.primeIdentity(void 0,w),we.info("conversation rebound",{previous:E,current:w}),E&&n.emit("conversationRebound",{previous:E,current:w})},[n,d,c,W]),oi=F(w=>{let E=w.map(de=>de.createdAt).filter(de=>de!==void 0),J=(E.length?Math.min(...E):Date.now())-1;return[...(ht.current?.messages??[]).map(de=>{let X=ec({...de,text:at(nt.current,de.text)});return X.createdAt=J,X}),...w]},[]),Fc=F(async w=>{let E=rn.current;function J(){return E!==rn.current||d.value!==w}fe.current===w&&(fe.current=void 0),P(!0);try{let ne=await W.loadConversation(w);if(J())return!1;let de=In(ne.messages),X=oi(ac(de,m.value));if(m.value=X,fe.current=X.some(ke=>ke.role==="user")?void 0:w,de.length>0||ne.controlState!==void 0){Nt({conversationId:w,reference:ne.ticketReference}),ne.controlState&&Qr(ne.controlState);let ke=de.findLast(Ne=>Ne.role==="assistant"&&!Ne.ephemeral);dt(ke?.suggestions??[])}return!0}catch(ne){return J()||(we.warn("loadThread failed; keeping conversation active",{err:ne,conversationId:w}),n.emit("error",ne),Ut.current.onError?.(ne)),!1}finally{J()||P(!1)}},[W,m,d,oi,n]),$m=F(w=>{if(Oe.current===w)return Oe.current=void 0,Fc(w)},[Fc]),Dm=F(()=>{if(x.current)return Promise.resolve(void 0);let w=d.value,E=m.value.find(se=>se.serverMessageId!==void 0),J=E?.serverMessageId,ne=E?new Date(E.createdAt).toISOString():void 0;if(!w||!J||!ne)return Promise.resolve(void 0);let de=rn.current,X={};return x.current=X,(async()=>{try{let se=await W.loadConversation(w,{beforeId:J,beforeCreatedAt:ne});if(x.current!==X||rn.current!==de||d.value!==w)return;if(se.messages.length===0)return!1;let ke=se.messages.map(tc),Ne=m.value,an=m_(Ne,ke);if(an!==Ne){let je=Math.min(...ke.map(De=>De.createdAt??1/0));if(Number.isFinite(je))for(let De of Ne){if(!De.ephemeral)break;(De.createdAt??1/0)>=je&&(De.createdAt=je-1)}m.value=an}return!0}catch(se){if(x.current!==X||rn.current!==de||d.value!==w)return;we.warn("load previous messages failed",{err:se,conversationId:w,beforeId:J}),n.emit("error",se),e.onError?.(se);return}finally{x.current===X&&(x.current=void 0)}})()},[n,d,m,e,W]),hr=F(async({newConversation:w})=>{let E=++Yr.current;function J(){return E!==Yr.current}if(!w){let je=await W.userSub(),De=c.loadLastUserSub();if(J())return;if(De&&De!==je){i?.();return}je&&c.saveLastUserSub(je)}let ne=d.value,de=w||!ne?Lt():ne;de!==ne&&(rn.current++,P(!1),Ft(()=>{d.value=de,v.value=de}),c.saveConversationId(de)),W.primeIdentity(u,de);let X;try{X=await W.handshake({visitorId:u,conversationId:de,userPrefs:c.loadUserPrefs(),locale:vt})}catch(je){if(J())return;n.emit("error",je),e.onError?.(je);let De=je instanceof Le&&je.errorCode?aw[je.errorCode]:void 0;if(De){we.warn(`the widget is not shown: ${De}`),(Y||e.mode==="page")&&j(!0);return}w||A(!0);return}if(J())return;e.continueLink&&X.visitorId!==u&&p(X.visitorId),X.conversationId!==de&&ds(X.conversationId),bt.current=X;let se=zn(X,vt);yt(se.agent),ni(Vi(X.config?.login));let ke=X.config?.maxMessageCharacters;Q(typeof ke=="number"&&ke>0?ke:void 0),se.site&&hl(se.site)?pr(se.site):se.site&&we.warn("invalid site config, using fallback",{site:se.site}),se.blocks&&vl(se.blocks)?_r(se.blocks):se.blocks&&we.warn("invalid blocks config, using fallback",{blocks:se.blocks});let Ne=il(X.userPrefs);if(Object.keys(Ne).length>0&&!w&&(c.saveUserPrefs(Ne),Ne.locale&&At(Ne.locale),Ne.soundMuted!==void 0&&ce.setMuted(Ne.soundMuted),Ne.themeMode&&ss(Ne.themeMode),Ne.textSize&&bm(Ne.textSize)),ht.current=se.welcome,w||n.emit("handshake",X),se.welcome?.suggestions){let je=nt.current;dt(se.welcome.suggestions.map(De=>({...De,label:at(je,De.label),...De.text===void 0?{}:{text:at(je,De.text)}})))}let an=!w&&(X.conversationId===ne||e.continueLink!==void 0);f.current=an,an?tt.current||(Oe.current=X.conversationId):(fe.current=X.conversationId,ri(se.welcome?.messages),gr(X.conversationId)),w||A(!0)},[W,u,c,e,n,d,v,ce,ri,vt,ds,gr,i]),Jr=JSON.stringify(e.userContext??null),Bm=JSON.stringify(e.pageContext??null);U(()=>{W.setContext(e.userContext,iw(e.pageContext))},[W,Jr,Bm]);let Hc=B(!1);U(()=>{if(W.setUserToken(e.userToken),!Hc.current){Hc.current=!0;return}hr({newConversation:!1}).then(()=>{Re&&Lm(!0)})},[W,e.userToken,o]);let qc=F((w,E=[])=>dt(w.suggestions??E),[]);U(()=>(W.primeIdentity(u,d.value),hr({newConversation:!1}),()=>{Yr.current++,rn.current++}),[]),U(()=>{!Re||!D||tt.current||(tt.current=!0,Oe.current===d.value&&P(!0))},[Re,D]);let jc=B(Jr);U(()=>{!D||jc.current===Jr||(jc.current=Jr,hr({newConversation:!1}))},[Jr,D,hr]);let Vc=B(async()=>!1),{sendAiTurn:on,sendRoutedTurn:vr}=am({onConversationNotFound:w=>Vc.current(w),transport:W,messagesSig:m,conversationIdSig:d,options:e,bus:n,feedback:ce,persistence:c,visitorId:u,adoptConversationId:ds,applyControlState:Qr,setTicket:Nt,settleSuggestions:qc,runCancellation:Me}),{toolInteraction:Um,pageToolsRunning:us,stopPageTools:Wc}=Fg({streaming:V,controlModeSig:Gt,messagesSig:m,sendAiTurn:on,bus:n,humanInLoop:e.features.humanInLoop,tools:e.tools}),zm=F((w,E)=>{let J=m.value.find(ne=>ne.serverMessageId===w);J&&(J.feedback=E),we.info("messageFeedback",{messageId:w,value:E}),n.emit("messageFeedback",{messageId:w,value:E}),W.submitFeedback({messageId:w,value:E})},[n,m,W]),Fm=F(()=>f.current||m.value.some(w=>!w.ephemeral&&w.role==="user"),[m]);Zg({activated:Re,conversationReady:D,paused:Bn.status==="pending"||Bn.status==="expired",conversationIdSig:d,messagesSig:m,optionsRef:Ut,transport:W,visitorId:u,adoptControlStateChunk:Cm,adoptMemoryCompactionStateChunk:Am,settleSuggestions:qc,recordConversationReply:Mm,transcriptRecoverySig:Em,beginConversationTranscript:ls,commitConversationTranscript:gr,runCancellation:Me,feedback:ce,bus:n,loadInitialThread:$m,shouldReconcileOnConnect:Fm,reconnectingSig:h});let br=F(async(w,E,J)=>{if(le.current||cs.gate)return!1;let ne=d.value,de=ne?gn.value.get(ne):void 0,X=Gt.value!=="ai-agent";if(!X&&de?.status==="compacting"||(we.info("send",{textLen:w.length,attachments:E.length,streaming:ge.current,routedToOperator:X}),ge.current&&!X))return!1;let se=new AbortController,ke={conversationId:ne,controller:se};le.current=ke,Ye(!0);try{ce.unlock(),$e.value=new Map;let Ne=await lw(W,E,se.signal,rt,bs=>{se.signal.aborted||(we.warn("upload failed",{err:bs}),n.emit("error",bs),e.onError?.(bs))});if(se.signal.aborted||d.value!==ne)return!1;let an=ne?gn.value.get(ne):void 0,je=Gt.value!=="ai-agent";if(!je&&an?.status==="compacting"||ge.current&&!je||!J&&Ne.length<E.length||!w&&Ne.length===0)return!1;n.emit("send",{text:w,attachmentCount:E.length}),ot.length>0&&dt([]),ce.play("messageSent");let De=Zl(w,Ne,J);return Br(n,e,"user",w),je?(m.value=[...m.value,De],J?await vr(De):(vr(De),!0)):(m.value=[...m.value,De,Yt()],J?await on({continueExisting:!1}):(on({continueExisting:!1}),!0))}finally{le.current===ke&&(le.current=null,Ye(!1))}},[W,n,e,ot.length,m,d,gn,on,vr,Gt,$e,rt,cs.gate]),ps=B(br);ps.current=br;let Gc=d.value,Kc=(Gc?gn.value.get(Gc):void 0)?.status==="compacting",ii=Gt.value==="ai-agent",Hm=mt(()=>{let w=m.value.at(-1);return w?.role==="assistant"&&w.partsSig.value.some(E=>E.kind==="tool"&&(E.stateSig.value==="approval-requested"||E.stateSig.value==="approval-responded"))}),Qc=mt(()=>m.value.some(w=>w.retryAction?.kind==="resend-user"||w.retryAction?.kind==="continue-assistant"));ut(()=>{let w=d.value;return()=>{let E=le.current;!E||E.conversationId!==w||(le.current=null,Ye(!1),E.controller.abort())}},[d.value]);let qm=F(()=>{if(le.current){we.info("stop uploads"),le.current.controller.abort();return}if(us){we.info("stop page tools"),n.emit("stop",void 0),Wc();return}if(!Me.stop())return;we.info("stop"),n.emit("stop",void 0);let w=m.value.at(-1);w&&w.role!=="user"&&w.status==="streaming"&&(w.canceled=!0,m.value=[...m.value])},[Me,n,m,us,Wc]),jm=F(w=>{we.info("card action",{text:w}),ps.current(w,[])},[]),Vm=F(w=>{if(V)return;let E=m.value,J=ba(E,w);if(J)switch(we.info("retry",{kind:J.kind,messageId:J.messageId}),J.kind){case"continue-assistant":{if(Gt.value!=="ai-agent"||w.role!=="assistant"||(w.serverMessageId??w.id)!==J.messageId)return;w.status="streaming",w.errorText=void 0,w.retryAction=void 0,w.awaitingContinuation=!0,m.value=[...E],on({continueExisting:!0,turn:w});return}case"resend-user":{let ne=E.find(se=>se.role==="user"&&se.id===J.messageId);if(!ne)return;let de=se=>{se&&mr.current?.acceptQueuedMessage(J.messageId)};if(ne.status="complete",ne.errorText=void 0,ne.retryAction=void 0,Gt.value!=="ai-agent"){m.value=w.role==="assistant"?E.filter(se=>se!==w):[...E],vr(ne).then(de);return}let X=Yt();m.value=w.role==="assistant"?E.map(se=>se===w?X:se):[...E,X],on({continueExisting:!1,turn:ne}).then(de);return}case"repeat-user":{let ne=E.find(ke=>ke.role==="user"&&ke.id===J.messageId);if(!ne)return;let de=Zl(He(ne),ne.attachments?.map(ke=>({...ke}))??[]),X=new Set(de.attachments?.flatMap(ke=>ke.url?[ke.url]:[])??[]),se=ne.partsSig.value.flatMap(ke=>ke.kind==="file"&&!X.has(ke.url)?[{...ke}]:[]);if(se.length>0&&(de.partsSig.value=[...de.partsSig.value,...se]),Gt.value!=="ai-agent"){m.value=[...E,de],vr(de);return}m.value=[...E,de,Yt()],on({continueExisting:!1,turn:de});return}default:return J}},[V,m,Gt,on,vr]),ai=F(()=>{if($_(e.mode,Ce)==="exit-fullscreen"){we.info("close \u2192 exit-fullscreen",{mode:e.mode}),Ot("normal"),n.emit("fullscreen",!1);return}we.info("close \u2192 panel closed",{mode:e.mode}),ze.current=t.contains(t.ownerDocument.activeElement),Te(!1),c.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,c,Ce,t]);Kg({hostElement:t,mode:e.mode,panelSize:Ce,isOpen:K,surfaceReady:D,onClose:ai}),U(()=>{K||!ze.current||(ze.current=!1,gt.current?.focus())},[K]);let Xr=F(()=>{we.info("open",{mode:e.mode}),ce.unlock(),Rt(!0),Te(!0),c.savePanelOpen(!0),!ae&&!_e&&be(),setTimeout(()=>Rt(!1),sw),n.emit("open",void 0),e.onOpen?.()},[n,e,ce,c,ae,_e,be]),si=F(()=>{let w=m.value.some(E=>E.role==="user");if(fe.current===d.value&&!w&&d.value){we.info("clear \u2192 reusing empty conversation",{conversationId:d.value}),m.value.length===0&&ri(ht.current?.messages);return}return we.info("clear \u2192 new conversation",{wasStreaming:V}),n.emit("clear",void 0),Me.settle(),f.current=!1,Oe.current=void 0,fe.current=void 0,Ft(()=>{m.value=[],d.value=void 0,Qr({controlMode:"ai-agent",controlRevision:0})}),c.clearConversation(),dt([]),hr({newConversation:!0})},[V,m,d,c,hr,n,ri,Me,Qr]);Vc.current=async w=>(we.info("conversation not found \u2192 new conversation",{messageId:w.id}),await si(),w.status="complete",w.errorText=void 0,w.retryAction=void 0,m.value=[...m.value,w,Yt()],on({continueExisting:!1,turn:w,movedFromConversation:!0}));let li=F(()=>{let w=si();R("chat");let E=e.modules.list.find(J=>J.layout==="chat")?.id;return E&&k.switchTab(E),w},[si,k,e]),Wm=F(async w=>{await li(),await ps.current(w,[])||mr.current?.fill(w)},[li]),_s=F(()=>{let w=Ce==="expanded"?"normal":"expanded";we.info("expand",{from:Ce,expanded:w==="expanded"}),Ot(w),c.savePanelSize(w),n.emit("expand",w==="expanded")},[n,Ce,c]),fs=F(()=>{let w=Ce==="fullscreen"?"normal":"fullscreen";we.info("fullscreen",{from:Ce,fullscreen:w==="fullscreen"}),Ot(w),c.savePanelSize(w),n.emit("fullscreen",w==="fullscreen")},[n,Ce,c]),Gm=F(()=>{R(w=>{let E=w==="history"?"chat":"history";return we.info("toggleHistory",{view:E}),n.emit("toggleHistory",{view:E}),E})},[n]),Km=F(()=>{ti(w=>{let E=!w;return we.info("sidebarToggle",{collapsed:E}),c.saveSidebarCollapsed(E),n.emit("sidebarToggle",{collapsed:E}),E})},[c,n]),Qm=F(w=>{we.info("resize",w),Dc({widgetSize:w}),n.emit("resize",w)},[Dc,n]),Ym=F(async w=>{let E=w.conversationId;if(E===d.value&&zc(E)){we.info("selectConversation",{conversationId:E,cached:!0}),n.emit("selectConversation",{conversationId:E}),W.publishConversation(w),R("chat");let X=S();X&&k.switchTab(X),gr(E);return}let ne=++Yr.current;rn.current++,P(!1);function de(){return ne!==Yr.current}we.info("selectConversation",{conversationId:E,wasStreaming:V}),n.emit("selectConversation",{conversationId:E}),W.publishConversation(w);try{let X=await W.loadConversation(E);if(de())return;Me.settle(),f.current=!0,Oe.current=void 0;let se=In(X.messages),ke=X.conversationId!==d.value,Ne=ke?se:ac(se,m.value);fe.current=Ne.some(De=>De.role==="user")?void 0:X.conversationId,Ft(()=>{m.value=oi(Ne),ke&&(v.value=X.conversationId),d.value=X.conversationId}),c.saveConversationId(X.conversationId),W.primeIdentity(u,X.conversationId),Nt({conversationId:X.conversationId,reference:X.ticketReference}),X.controlState&&Qr(X.controlState);let an=Ne.findLast(De=>De.role==="assistant"&&!De.ephemeral);dt(an?.suggestions??[]),ke?ls(X.conversationId):gr(X.conversationId),R("chat");let je=S();je&&k.switchTab(je)}catch(X){if(de())return;n.emit("error",X),e.onError?.(X)}},[W,m,d,v,n,e,c,oi,V,u,Me,ls,gr,zc,k]),ci=B(void 0),di=F(w=>{let E=e.modules.list.find(ne=>ne.layout===ow[w.to]);if(!E){we.warn("open: the widget has no such tab",{to:w.to});return}let J=w.id&&(E.layout==="help"||E.layout==="news")?{kind:"content",id:w.id,title:""}:void 0;k.open(E.id,J)},[e.modules,k]),Yc=F(w=>{if(K||Xr(),w!=null){if(!Hd(w)){we.warn("open: unknown target",{detail:w});return}D?di(w):ci.current=w}},[K,Xr,D,di]);U(()=>{!D||!ci.current||(di(ci.current),ci.current=void 0)},[D,di]);let Jc=D&&!y&&(!ii||!Qc.value),[Un,gs]=$(),Xc=F(w=>{let E=qd(w);if(!E){we.warn("ask: expected { text, send? } with non-empty text",{detail:w});return}K||Xr(),gs(E)},[K,Xr]),ms=K&&D&&!y,Zc=ms&&Jc&&!me&&!(ii&&(V||Kc));U(()=>{if(Un===void 0||!(Un.send?Zc:ms))return;let w=S();if(!w){we.warn("ask: the widget has no chat"),gs(void 0);return}if(M!=="chat"||!g()){R("chat"),k.switchTab(w);return}if(gs(void 0),!Un.send){mr.current?.fill(Un.text);return}br(Un.text,[]).then(E=>{E||mr.current?.fill(Un.text)})},[Un,ms,Zc,M,N,e.modules,k,br]),U(()=>{if(e.widgetId!=="default")return;let w=`data-${L.cssPrefix}-`,E=["ask","open","close"].map(ne=>w+ne);function J(ne){let de=ne.composedPath().find(ke=>ke instanceof Element&&E.some(Ne=>ke.hasAttribute(Ne)));if(!(de instanceof Element))return;ne.preventDefault();let X=de.getAttribute(`${w}ask`),se=de.getAttribute(`${w}open`);X!==null?Pt(t,"ask",sn(X||(de.textContent??""),{send:de.hasAttribute(`${w}send`)})):se!==null?Pt(t,"open",Si(se)):Pt(t,"close")}return document.addEventListener("click",J),()=>document.removeEventListener("click",J)},[e.widgetId,t]),U(()=>{if(e.widgetId!=="default")return;let w=Zu(location.href);w&&(history.replaceState(history.state,"",w.url),w.ask?Pt(t,"ask",sn(w.ask)):Pt(t,"open",w.target))},[e.widgetId,t]);let ed=B(vn),td=e.mode==="page"||e.mode==="inline"||e.mode==="standalone";U(()=>qt(()=>{let w=d.value,E={open:td||K,ready:D,unread:Bc.value,...w?{conversationId:w}:{}},J=ed.current;E.open===J.open&&E.ready===J.ready&&E.unread===J.unread&&E.conversationId===J.conversationId||(ed.current=E,n.emit("state",E),E.unread!==J.unread&&n.emit("unread",E.unread))}),[n,td,K,D,Bc,d]);let yr=B({handleOpenCommand:Yc,handleClose:ai,handleExpand:_s,handleFullscreen:fs,handleAskCommand:Xc});yr.current={handleOpenCommand:Yc,handleClose:ai,handleExpand:_s,handleFullscreen:fs,handleAskCommand:Xc},ut(()=>Vd(t,{open:w=>yr.current.handleOpenCommand(w),close:()=>yr.current.handleClose(),expand:()=>yr.current.handleExpand(),fullscreen:()=>yr.current.handleFullscreen(),ask:w=>yr.current.handleAskCommand(w)}),[t]);let it=xe(()=>$s(e,vt,tn,nn),[e,vt,tn,nn]);nt.current=it.strings,U(()=>{let w=bt.current;if(!w?.translations?.length)return;let E=zn(w,vt);yt(E.agent),E.site&&hl(E.site)&&pr(E.site),E.blocks&&vl(E.blocks)&&_r(E.blocks)},[vt]);function hs(w){Ym(w)}let nd={options:it,transport:W,feedback:ce,bus:n,persistence:c,conversationId:d.value??"",composerKey:v.value,composerApiRef:mr,view:M,isStreaming:V,pageToolRunning:us,isMemoryCompacting:Kc,canReleaseQueuedMessages:Jc,queueManualMessages:ii&&Qc.value,replyAwaitsCard:ii&&Hm.value,sendPreparing:me,attachmentUploadsSig:$e,composerActive:it.mode==="page"||it.mode==="inline"||it.mode==="standalone"||K,controlMode:Gt.value,assignedOperator:wm.value,operatorAvailable:km.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Tm,onCancelOperatorRequest:Rm,loadingMessages:y,onLoadPreviousMessages:Dm,messagesSig:m,reconnectingSig:h,agent:Be,ticketReference:Mt?.conversationId===d.value?Mt?.reference:void 0,login:cs,onStartAsGuest:s,maxMessageCharacters:H,suggestions:ot,initialWidgetSize:_.widgetSize??null,onClear:si,onExpand:_s,onFullscreen:fs,onSoundToggle:Sm,onToggleHistory:Gm,onSelectHistoryConversation:hs,onNewConversation:li,onLocaleChange:ym,onThemeChange:Pm,onTextSizeChange:xm,onWidgetSizeChange:Qm,onSend:br,onStop:qm,onSuggestion:w=>{if(le.current)return;let E=w.text??w.label;we.info("suggestion",{text:E,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:E}),e.autoSendSuggestions?br(E,[]):mr.current?.fill(E)},tool:Um,onRetry:Vm,onMessageFeedback:zm,onCardAction:jm};if(z)return a("div",{class:`${Zo}-anchor`,children:a(Ac,{strings:it.strings,text:it.strings.chatUnavailable})});if(!D)return null;let Zr=it.modules.list;function vs(w){let E=Dr("close",it.mode,w)?ai:void 0;return Zr.length===0?a(Ac,{strings:it.strings,text:it.strings.modulesEmpty,onClose:E}):Zr.length===1&&Zr[0]?.layout==="chat"?a(Og,{...nd,panelSize:w,onClose:E}):a(Ng,{panelProps:{...nd,panelSize:w,onClose:E},enabledModules:Zr,nav:k,bus:n,hasUnread:Im.value,latestNews:Nm,onSelectConversation:hs,onStartNewConversation:Wm,onSetPanelSize:Ot})}if(e.mode==="page"){let w=e.history.enabled&&Zr.some(E=>E.layout==="chat");return a("div",{class:`${Zo}-anchor`,children:a(Bg,{site:ur,blocks:$n,transport:W,strings:it.strings,locale:it.locale,persistence:c,showConversations:w,onSelectConversation:hs,onNewConversation:li,sidebarCollapsed:Dn,onToggleSidebarCollapsed:Km,children:vs("fullscreen")})})}if(Y){let w=e.mode==="standalone"?"fullscreen":Ce;return a("div",{class:`${Zo}-anchor`,children:vs(w)})}let rd=e.mode==="drawer",od=!(e.mode==="modal")&&!e.launcher.hidden&&(!K||Ue),id=od&&!Ue&&!ae&&!rd?it.launcher.callout:null;return a("div",{class:`${Zo}-anchor`,"data-launcher-size":it.launcher.size,children:[K||Re?a("div",{class:`${Zo}-surface`,hidden:!K,children:vs(Ce)}):null,od?a(bf,{buttonRef:gt,onToggle:Xr,launcher:it.launcher,strings:it.strings,leaving:Ue,edgeTab:rd}):null,id?a(yf,{callout:id,launcherPosition:it.position,strings:it.strings,closeLabel:it.strings.close,onDismiss:be}):null]})}function iw(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var aw={AI_AGENT_PUBLIC_ACCESS_NOT_FOUND:"the deployment was not found or is turned off",AI_AGENT_PUBLIC_ORIGIN_NOT_ALLOWED:"this website is not in the deployment's allowed origins"},sw=120,cm=new WeakMap;async function lw(e,t,n,r,o){return(await Promise.all(t.map(async s=>{try{r(s.id,{status:"uploading"});let l=cm.get(s)??await e.uploadFile(s.file,n,c=>r(s.id,{status:"uploading",fraction:c}));return cm.set(s,l),r(s.id,{status:"done"}),{id:l.id,name:l.originalName,mediaType:l.mimeType,size:l.fileSize,url:l.url}}catch(l){r(s.id,n.aborted?void 0:{status:"error",refusal:l instanceof Le&&l.status===400?l.errorCode:void 0}),o(l);return}}))).filter(s=>s!==void 0)}var cw=ee.scope("error-boundary"),ts=class extends zt{constructor(){super(...arguments);Z(this,"state",{crashed:!("toSorted"in Array.prototype)})}componentDidCatch(n,r){cw.error("widget render crashed",{error:n,componentStack:r?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,r?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};function ns(e){let{bus:t,host:n,appRoot:r,persistence:o,reportError:i}=e,s=e.initialRaw,l,c,u=mn(s),p=o.loadUserPrefs().locale??u.locale,_=!0,d=0,f=0,v=Gd(t);function m(){let b=l&&zn({config:l,translations:c},p).config;u=mn(b?Ds(s,b):s)}function h(){cl(n,Rr(u.mode)),Iu(n,{...u,themeMode:no(u.themeMode,o.loadUserPrefs().themeMode)}),_&&(Ni(n,um(u)),_=!1)}function y(){h(),Kt(xn(ts,{onError:i},xn(dm,{key:d,bus:t,hostElement:n,options:u,recentHostEvents:v,loginRevision:f,onPersonChanged:C,onStartAsGuest:S})),r)}t.on("handshake",b=>{b.config&&(b.config.storageVersion&&o.rememberStorageVersion(b.config.storageVersion),l=b.config,c=b.translations,m(),y())}),t.on("localeChange",b=>{p=b,c?.length&&(m(),y())});let P=yu(t,{getOptions:()=>u,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});function x(){let b=o.takeLoginReturn();return b?(o.saveConversationId(b.conversationId),o.saveDraft(b.conversationId,b.draft),o.savePanelOpen(!0),!0):!1}s.userToken&&x();function C(){o.reset(),v.length=0,d+=1,_=!0,m(),y()}function S(){s={...s,userContext:void 0,userToken:void 0},C()}function g(b){"userToken"in b&&b.userToken&&!s.userToken&&x()&&(d+=1),s={...s,...b},m(),y()}return{getOptions:()=>u,getUserOptions:()=>s,render:y,setUserOptions:b=>{s=b,m(),y()},patchUserOptions:g,login:b=>{f+=1,g({userToken:b})},reset:()=>S(),destroy:()=>P()}}function um(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=wn(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:r}=$o(e,Ur(),t.loadPanelOpen(),t.loadPanelSize());return xa(e.mode,r,n)}var Zt=new Map;function en(e="default"){return Zt.get(e)??null}function Ec(){return[...Zt.values()]}function rs(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");e.debug!==void 0&&xr(e.debug);let t=ee.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=mn(e),r=n.widgetId,o=Zt.get(r);o&&(t.debug("destroy existing instance at slot",{widgetId:r}),o.destroy());let i=Oi({position:Rr(n.mode),target:e.target??null});i.hostElement.dataset.widgetId=r;let s=new wr,l=wn(r,n.storage,n.aiAgentDeploymentId);function c(y){s.emit("error",y),u.getOptions().onError?.(y)}let u=ns({bus:s,host:i.hostElement,appRoot:i.appRoot,persistence:l,initialRaw:e,reportError:c}),p=vn,_=()=>{},d=new Promise(y=>{_=y});s.on("state",y=>{p=y,y.ready&&_()}),u.render();let f=i.hostElement,v=null;function m(y){y.debug!==void 0&&xr(y.debug),u.patchUserOptions(y)}let h={widgetId:r,open:y=>Pt(f,"open",y),close:()=>Pt(f,"close"),expand:()=>Pt(f,"expand"),ask:(y,P)=>Pt(f,"ask",sn(y,P)),on:(y,P)=>s.on(y,P),update:y=>{t.debug("update",{patch:y}),m(y)},setUserContext:y=>{t.debug("setUserContext",{keys:Object.keys(y)}),m({userContext:{...u.getUserOptions().userContext,...y}})},clearUserContext:()=>{t.debug("clearUserContext"),m({userContext:void 0})},setPageContext:y=>{t.debug("setPageContext",{keys:Object.keys(y)}),m({pageContext:{...u.getUserOptions().pageContext,...y}})},clearPageContext:()=>{t.debug("clearPageContext"),m({pageContext:void 0})},get state(){return p},ready:d,reset:()=>{t.info("reset",{widgetId:r}),u.reset()},login:y=>{t.info("login",{widgetId:r}),u.login(y)},track:(y,P)=>{let x=kr(y,P);x&&s.emit("hostEvent",x)},registerTool:Vn,setDebug:y=>{xr(y),t.info("debug level set",{level:eo()})},debugLevel:()=>eo(),onLog:y=>to(y),destroy:()=>{t.info("destroy",{widgetId:r}),s.emit("state",vn),v?.(),u.destroy(),s.clear(),Kt(null,i.appRoot),i.destroy(),Zt.get(r)===h&&Zt.delete(r)}};return v=zd(h,s),Zt.set(r,h),h}function os(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");let t=e.widgetId??"default",n=Zt.get(t);return n?(n.update(e),n):rs(e)}function Mc(e){if(e!==void 0){Zt.get(e)?.destroy();return}let t=[...Zt.values()];for(let n of t)n.destroy()}var pm=Tr;var Lc=class extends HTMLElement{constructor(){super(...arguments);Z(this,"bus",new wr);Z(this,"widgetState",vn);Z(this,"userToken");Z(this,"pageTools",[]);Z(this,"markReady",()=>{});Z(this,"ready",new Promise(n=>{this.markReady=n}));Z(this,"mountResult",null);Z(this,"runtime",null)}static get observedAttributes(){return Bs}connectedCallback(){if(Object.hasOwn(this,"tools")){let n=Reflect.get(this,"tools");Reflect.deleteProperty(this,"tools"),this.pageTools=Array.isArray(n)?n:[]}this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Kt(null,this.mountResult.appRoot),this.bus.clear(),this.widgetState=vn)}attributeChangedCallback(){this.isConnected&&this.boot()}open(n){Pt(this,"open",n)}close(){Pt(this,"close")}expand(){Pt(this,"expand")}ask(n,r){Pt(this,"ask",sn(n,r))}get state(){return this.widgetState}reset(){this.userToken=void 0,this.runtime?.reset()}login(n){this.userToken=n,this.runtime?.login(n)}track(n,r){let o=kr(n,r);o&&this.bus.emit("hostEvent",o)}get tools(){return this.pageTools}set tools(n){this.pageTools=n,this.runtime?.patchUserOptions({tools:n})}registerTool(n,r){Vn(n,r)}on(n,r){return this.bus.on(n,r)}boot(){let n={...Pi(i=>this.getAttribute(i)),...this.userToken?{userToken:this.userToken}:{},tools:this.pageTools};if(!n.aiAgentDeploymentId)throw new Error("ai-agent-deployment-id is required");if(this.runtime){this.runtime.setUserOptions(n);return}let r=mn(n);this.mountResult??(this.mountResult=Oi({existingHost:this,position:Rr(r.mode)}));let o=wn(r.widgetId,r.storage,r.aiAgentDeploymentId);this.bus.on("state",i=>{this.widgetState=i,i.ready&&this.markReady()}),this.runtime=ns({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},_m=!1;function Oc(){if(_m||typeof customElements>"u")return;let e=L.tagName;customElements.get(e)||customElements.define(e,Lc),_m=!0}typeof customElements<"u"&&Oc();var gm=ee.scope("iife");function dw(e){return typeof e=="string"||typeof e=="function"}function mm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fm(e){return mm(e)}function uw(e){return mm(e)}function pw(e){return e===null||typeof e=="function"}var hm=[];function dr(e){let t=en();if(t)return e(t);hm.push(e)}function ei(e){let t=en();if(t)for(let n of hm.splice(0))n(t);return e}function Nc(e){if(document.readyState!=="loading")return e();document.addEventListener("DOMContentLoaded",e,{once:!0})}function is(){return new Promise(e=>{dr(t=>{t.ready.then(()=>e(t))})})}var $c={ask:(e,t)=>typeof e=="string"?dr(n=>n.ask(e,sn(e,t))):void 0,close:()=>dr(e=>e.close()),ready:e=>is().then(t=>typeof e=="function"?e(t):void 0),reset:()=>en()?.reset(),login:e=>{if(!dw(e))return;let t=en();return t?t.login(e):is().then(n=>n.login(e))},destroy:()=>Mc(),expand:()=>dr(e=>e.expand()),track:(e,t)=>{let n=kr(e,t);if(!n)return;let r=en();return r?r.track(n.name,n.data):is().then(o=>o.track(n.name,n.data))},hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&Fs(n)?ro(e,t,n):void 0,init:e=>fm(e)?Nc(()=>ei(os(e))):void 0,mount:e=>fm(e)?Nc(()=>ei(rs(e))):void 0,on:(e,t)=>dr(n=>n.on(e,t)),onLog:e=>to(pw(e)?e:null),registerTool:Vn,open:e=>dr(t=>t.open(e)),setDebug:e=>typeof e=="boolean"||typeof e=="number"||typeof e=="string"?xr(e):void 0,update:e=>uw(e)?dr(t=>t.update(e)):void 0};function _w(e){return Object.hasOwn($c,e)}function vm(e,...t){let n=_w(e)?$c[e]:void 0;if(!n){gm.warn("unknown command",{command:e});return}return n(...t)}function fw(){let e=((t,...n)=>vm(t,...n));e.init=t=>ei(os(t)),e.mount=t=>ei(rs(t)),e.destroy=Mc,e.getInstance=en,e.getAllInstances=Ec,e.version=pm,e.ready=is,e.hook=ro,e.debugLevel=()=>eo(),e.onLog=to,e.registerTool=Vn;for(let t of["ask","close","expand","login","on","open","reset","setDebug","track","update"])Reflect.set(e,t,$c[t]);return e}function gw(e){let t=e?.q;if(t)for(let n of t){let r=[...n],[o,...i]=r;if(typeof o=="string")try{vm(o,...i)}catch(s){gm.warn("queued command failed",{command:o,error:s})}}}function mw(){let e=[],t=e.push.bind(e);return e.push=(...n)=>(Hs(n),t(...n)),e}function hw(){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 vw(e){return typeof e=="function"}function bw(){if(typeof window>"u"||typeof document>"u")return;let e=Reflect.get(globalThis,L.global),t=vw(e)?e:void 0,n=fw();Reflect.set(globalThis,L.global,n),Oc();let r=`${L.global}Hooks`,o=Reflect.get(globalThis,r);if(Hs(o),Reflect.set(globalThis,r,mw()),gw(t),en())return;let i=document.currentScript,s=(i instanceof HTMLScriptElement?i:null)??hw(),l=Us(s?.dataset),c=l.aiAgentDeploymentId;c&&Nc(()=>{en()||ei(os({...l,aiAgentDeploymentId:c}))})}bw();})();
|
|
76
76
|
//# sourceMappingURL=elements.js.map
|