@helpai/elements 6.4.10 → 6.5.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/elements.js CHANGED
@@ -1,17 +1,17 @@
1
- "use strict";(()=>{var Eg=Object.defineProperty;var Mg=(e,t,r)=>t in e?Eg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ee=(e,t,r)=>Mg(e,typeof t!="symbol"?t+"":t,r);var q={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 Lg=["en","fr","es","ar","he","zh"];function cd(e){let t=e?.split("-")[0]?.toLowerCase();return Lg.find(r=>r===t)??"en"}function Ns(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ls(e){return Ns(e)?e.id??e.key:void 0}function Os(e,t){return Ns(e)&&Ns(t)?Object.fromEntries([...new Set([...Object.keys(e),...Object.keys(t)])].map(r=>[r,Os(e[r],t[r])])):Array.isArray(e)&&Array.isArray(t)&&t.length>0&&t.every(r=>Ls(r)!==void 0)?e.map(r=>Os(r,t.find(n=>Ls(n)===Ls(r)))):t==null||typeof t=="string"&&!t.trim()?e:t}function Jr(e,t){let r=t?.toLowerCase(),n=r?.split("-")[0],o=e.translations??[],s=o.find(c=>c.locale.toLowerCase()===r)??o.find(c=>c.locale.toLowerCase().split("-")[0]===n);if(!s)return e;let{locale:i,...a}=s;return Os(e,a)}var Pa={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",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",reject:"Reject",approvalPrompt:"Allow {tool}?",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Submitted",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusApproved:"Approved",statusDeclined:"Declined",statusAutoApproved:"Approved automatically",statusAutoDeclined:"Declined automatically",statusError:"Error",statusSuperseded:"Skipped",statusIncomplete:"Not completed",toolStepsFailed:"{count} failed",toolStepsNotRun:"{count} not run",toolStepsApproved:"{count} approved",toolStepsDeclined:"{count} declined",statusStopped:"Stopped",toolStepsStopped:"Stopped after {count} steps",toolStepsStoppedOne:"Stopped after 1 step"},Ng={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",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",reject:"Refuser",approvalPrompt:"Autoriser {tool} ?",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"Envoy\xE9",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusApproved:"Approuv\xE9",statusDeclined:"Refus\xE9",statusAutoApproved:"Approuv\xE9 automatiquement",statusAutoDeclined:"Refus\xE9 automatiquement",statusError:"Erreur",statusSuperseded:"Ignor\xE9",statusIncomplete:"Non termin\xE9",toolStepsFailed:"{count} en \xE9chec",toolStepsNotRun:"{count} non ex\xE9cut\xE9(s)",toolStepsApproved:"{count} approuv\xE9(s)",toolStepsDeclined:"{count} refus\xE9(s)",statusStopped:"Arr\xEAt\xE9",toolStepsStopped:"Arr\xEAt\xE9 apr\xE8s {count} \xE9tapes",toolStepsStoppedOne:"Arr\xEAt\xE9 apr\xE8s 1 \xE9tape"},Og={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",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",reject:"\u0631\u0641\u0636",approvalPrompt:"\u0647\u0644 \u062A\u0633\u0645\u062D \u0628\u0640 {tool}\u061F",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusDeclined:"\u0645\u0631\u0641\u0648\u0636",statusAutoApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",statusAutoDeclined:"\u0631\u064F\u0641\u0636 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",statusIncomplete:"\u0644\u0645 \u064A\u0643\u062A\u0645\u0644",toolStepsFailed:"\u0641\u0634\u0644 {count}",toolStepsNotRun:"\u0644\u0645 \u064A\u064F\u0646\u0641\u064E\u0651\u0630 {count}",toolStepsApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629 \u0639\u0644\u0649 {count}",toolStepsDeclined:"\u0631\u064F\u0641\u0636 {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"},$g={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",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",reject:"Rechazar",approvalPrompt:"\xBFPermitir {tool}?",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Enviado",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusApproved:"Aprobado",statusDeclined:"Rechazado",statusAutoApproved:"Aprobado autom\xE1ticamente",statusAutoDeclined:"Rechazado autom\xE1ticamente",statusError:"Error",statusSuperseded:"Omitido",statusIncomplete:"No completado",toolStepsFailed:"{count} con error",toolStepsNotRun:"{count} sin ejecutar",toolStepsApproved:"{count} aprobado(s)",toolStepsDeclined:"{count} rechazado(s)",statusStopped:"Detenido",toolStepsStopped:"Detenido tras {count} pasos",toolStepsStoppedOne:"Detenido tras 1 paso"},Dg={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",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",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05DC\u05D0\u05E9\u05E8 \u05D0\u05EA {tool}?",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E9\u05DC\u05D7",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusApproved:"\u05D0\u05D5\u05E9\u05E8",statusDeclined:"\u05E0\u05D3\u05D7\u05D4",statusAutoApproved:"\u05D0\u05D5\u05E9\u05E8 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",statusAutoDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2",statusIncomplete:"\u05DC\u05D0 \u05D4\u05D5\u05E9\u05DC\u05DD",toolStepsFailed:"{count} \u05E0\u05DB\u05E9\u05DC\u05D5",toolStepsNotRun:"{count} \u05DC\u05D0 \u05D4\u05D5\u05E4\u05E2\u05DC\u05D5",toolStepsApproved:"{count} \u05D0\u05D5\u05E9\u05E8\u05D5",toolStepsDeclined:"{count} \u05E0\u05D3\u05D7\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"},qg={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",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",reject:"\u62D2\u7EDD",approvalPrompt:"\u5141\u8BB8 {tool}\uFF1F",approvalYourResponse:"\u4F60\u7684\u56DE\u590D\uFF1A{decision}",approvalEditHint:"\u5728\u6B64\u6B65\u9AA4\u7EE7\u7EED\u4E4B\u524D\uFF0C\u4F60\u53EF\u4EE5\u4FEE\u6539\u6B64\u56DE\u590D\u3002",approvalSubmitting:"\u56DE\u590D\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u6C42\u5904\u7406\u4E2D\u2026",edit:"\u7F16\u8F91",toolParameters:"\u53C2\u6570",statusAwaiting:"\u7B49\u5F85\u6279\u51C6",statusResponded:"\u5DF2\u63D0\u4EA4",statusRunning:"\u8FD0\u884C\u4E2D",statusCompleted:"\u5DF2\u5B8C\u6210",statusDenied:"\u5DF2\u62D2\u7EDD",statusApproved:"\u5DF2\u6279\u51C6",statusDeclined:"\u5DF2\u62D2\u7EDD",statusAutoApproved:"\u5DF2\u81EA\u52A8\u6279\u51C6",statusAutoDeclined:"\u5DF2\u81EA\u52A8\u62D2\u7EDD",statusError:"\u9519\u8BEF",statusSuperseded:"\u5DF2\u8DF3\u8FC7",statusIncomplete:"\u672A\u5B8C\u6210",toolStepsFailed:"{count} \u4E2A\u5931\u8D25",toolStepsNotRun:"{count} \u4E2A\u672A\u8FD0\u884C",toolStepsApproved:"{count} \u4E2A\u5DF2\u6279\u51C6",toolStepsDeclined:"{count} \u4E2A\u5DF2\u62D2\u7EDD",statusStopped:"\u5DF2\u505C\u6B62",toolStepsStopped:"\u5728 {count} \u6B65\u540E\u505C\u6B62",toolStepsStoppedOne:"\u5728 1 \u6B65\u540E\u505C\u6B62"},Ug={en:Pa,fr:Ng,es:$g,ar:Og,he:Dg,zh:qg};function xa(e,t){let r=dd(e),n=wa(t),o=Ug[cd(r)],s=n?{...t[r],...t[e]}:t??{},i=n?t.en??{}:{};return{...Pa,...o,...i,...s}}function dd(e){return(e.split("-")[0]??"en").toLowerCase()}var Bg=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function Sa(e){return Bg.has(dd(e))}function mt(e,t){return e[t]??t}function wa(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}var $s=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,r){try{localStorage.setItem(t,r)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},ka=new $s,Zr={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 Ca={maxBytes:10485760,maxCount:10,accept:"*/*"},ud={voice:"local"},Ds={enabled:!0,sampleRate:1},qs={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio"},En={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"]},Us={enabled:!0,volume:.3,events:void 0},_d={enabled:!0,events:void 0},fd=[{label:"tabConversations",layout:"chat"}];var Hs=["off","error","warn","info","debug","trace"],Fs=q.cssPrefix,md=`${Fs}.debug`,zg=`__${q.global}_DEBUG__`,Hg=`${Fs}-debug`,Ta=2,Bs=null;function Fg(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Hg);if(e!==null){let t=zs(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(md);if(e){let t=zs(e);if(t>=0)return t}}catch{}return Reflect.get(window,zg)?4:2}function zs(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=Hs.findIndex(r=>r===e);if(t>=0)return t}return-1}function Mn(e){let t=zs(e);if(!(t<0)){Ta=t;try{window.localStorage?.setItem(md,Hs[t]??"off")}catch{}}}function po(){return Hs[Ta]??"warn"}Ta=Fg();function gd(e){let t=`[${Fs}:${e}]`;function r(n,o,s){return(i,a)=>{if(!(Ta<n)&&(a===void 0?console[o](t,i):console[o](t,i,a),Bs))try{Bs({level:s,scope:e,message:i,payload:a})}catch{}}}return{error:r(1,"error","error"),warn:r(2,"warn","warn"),info:r(3,"info","info"),debug:r(4,"debug","debug"),trace:r(5,"debug","trace"),scope:n=>gd(`${e}:${n}`)}}var te=gd("core");function _o(e){Bs=e}var en=te.scope("context"),jg=new Set(["visitorId","conversationId","jwt","token","authorization","password"]),vd=50,js=1024,Vg=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Vs(e){return hd(e,"userContext",!0)}function Ws(e){return hd(e,"pageContext",!1)}function Wg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function hd(e,t,r){if(e==null)return;if(!Wg(e)){en.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let n={},o=0;for(let[s,i]of Object.entries(e)){if(jg.has(s)){en.warn(`dropped reserved ${t} key "${s}" \u2014 managed by the widget, not host-settable`);continue}if(i==null)continue;if(o>=vd){en.warn(`${t} truncated at ${vd} keys \u2014 dropped "${s}"`);continue}let a=Gg(t,s,i);a!==void 0&&(n[s]=a,o++)}return r&&typeof n.email=="string"&&!Vg.test(n.email)&&(en.warn("dropped malformed context field",{field:`${t}.email`,reason:"invalid format"}),delete n.email),Object.keys(n).length>0?n:void 0}function Gg(e,t,r){if(typeof r=="boolean")return r;if(typeof r=="number"){if(!Number.isFinite(r)){en.warn(`dropped non-finite ${e}.${t}`);return}return r}if(typeof r=="string"){let n=r.trim();return n===""?void 0:n.length>js?(en.warn(`truncated ${e}.${t} to ${js} chars`),n.slice(0,js)):n}en.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof r})}function Lr(e){let t=e!==null&&typeof e=="object"?e:{},r=t.presentation??{},n=t.behavior??{},o=t.i18n??{},s=t.feedback??{},i=t.footer??{},a=t.header??{},c={enabled:t.history?.enabled??!0},{themeMode:u,themeOverrides:p}=Kg(t.theme),_=r.mode??"floating",d=Qg(o.defaultLocale),f=o.availableLocales??[o.locale??d],v=Ln(o.locale??d,f,d),g=(t.baseUrl??q.defaultBaseUrl).replace(/\/$/,""),P=(t.agentApiBaseUrl??`${g}/api/agent`).replace(/\/$/,""),b=(t.dataApiBaseUrl??`${g}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:g,agentApiBaseUrl:P,dataApiBaseUrl:b,userContext:Vs(t.userContext),pageContext:Ws(t.pageContext),position:r.position??(Sa(v)?"bottom-left":"bottom-right"),themeMode:u,textSize:"normal",themeOverrides:p,mode:_,responseMode:n.responseMode??"streaming",showReasoning:n.showReasoning??!1,showToolCalls:n.showToolCalls??!1,showSources:n.showSources??!1,enableMessageFeedback:!(n.disableMessageFeedback??!1),autoSendSuggestions:n.autoSendSuggestions??!1,cardAnswerWaitSeconds:n.cardAnswerWaitSeconds??60,popOutUrl:n.popOutUrl,features:{voice:t.features?.voice??ud.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??qs.upload,transcribe:t.endpoints?.transcribe??qs.transcribe},attachments:{accept:t.composer?.attachments?.accept??Ca.accept,maxBytes:t.composer?.attachments?.maxBytes??Ca.maxBytes,maxCount:t.composer?.attachments?.maxCount??Ca.maxCount},locale:v,defaultLocale:d,availableLocales:f,startMinimized:n.startMinimized??!0,actions:Yg(_,a.actions,c.enabled),size:{...r.size,resize:{...r.size?.resize,enabled:r.size?.resize?.enabled??!0}},launcher:nv(t.launcher,t.agent?.name),sound:Xg(s.sound),haptics:Jg(s.haptics),strings:xa(v,o.strings),stringsOverride:o.strings,composerDisclaimer:i.composerDisclaimer??"",header:{variant:a.variant??"plain",notice:a.notice,showNotice:!(a.hideNotice??!1)},poweredBy:ev(i.poweredBy),composer:tv(t.composer),modules:rv(t.modules,c.enabled),tracking:Zg(t.tracking,b),history:c,storage:t.storage??ka,userToken:t.userToken,continueLink:t.continueLink,tools:t.tools,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Kg(e){if(typeof e=="string")return{themeMode:e,themeOverrides:{}};if(!e||typeof e!="object")return{themeMode:"host",themeOverrides:{}};let{mode:t,...r}=e;return{themeMode:t??"host",themeOverrides:r}}function Qg(e){return e&&e!=="auto"?e:globalThis.navigator?.language||"en"}function Ln(e,t,r){if(t.length<=1||t.includes(e))return e;let n=e.split("-")[0];return n&&t.includes(n)?n:t.includes(r)?r:t[0]??e}function Yg(e,t,r){let n=t??pd[e];return r?n:n.filter(o=>o!=="history")}function Xg(e){return{enabled:e?.enabled??Us.enabled,volume:e?.volume??Us.volume,events:e?.events}}function Jg(e){return{enabled:e?.enabled??_d.enabled,events:e?.events}}function Zg(e,t){let r=e?.sampleRate??Ds.sampleRate;return{enabled:e?.enabled??Ds.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(r)?r:1)),token:e?.token}}function ev(e){return e?.text===""&&!e.logoUrl?null:{href:q.siteUrl,...e}}function tv(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function rv(e,t){let r=(e??fd).slice(0,4),n=r.some(a=>a?.label&&a.layout==="help"),o=new Set,s=[];for(let a of r){if(!a?.label||!a?.layout)continue;let c=a.contentCollectionIds?.filter(Boolean),u=a.id??c?.[0]??a.layout;for(;o.has(u);)u=`${u}-${s.length}`;o.add(u);let p={id:u,label:a.label,layout:a.layout};c?.length&&(p.contentCollectionIds=c),a.layout==="home"&&(p.brandName=a.brandName,p.greetingText=a.greetingText,p.showGreeting=!(a.hideGreeting??!1),p.showSearchBar=n&&!(a.hideSearchBar??!1),p.showRecentConversations=t&&!(a.hideRecentConversations??!1),a.userAvatars?.length&&(p.userAvatars=a.userAvatars),a.status&&(p.status=a.status),p.contentBlockTitle=a.contentBlockTitle),s.push(p)}let i=Object.fromEntries(s.map(a=>[a.id,a]));return{list:s,byId:i}}function nv(e,t){let r=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??En.variant,size:e?.size??En.size,label:e?.label??En.label,icon:e?.icon??En.icon,hidden:e?.hidden??En.hidden,...t&&{personaName:t},callout:r}}function fo(e,t){return e==="host"?"host":t??e}function Gs(e,t,r,n){let o=Ln(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&r===e.themeMode&&n===e.textSize)return e;let s={...e};return o!==e.locale&&(s.locale=o,s.strings=xa(o,e.stringsOverride)),r!==e.themeMode&&(s.themeMode=r),n!==e.textSize&&(s.textSize=n),s}function Ia(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ov=["agent","presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints","history"];function Ks(e,t){if(!t)return e;let r={...e};for(let s of ov){let i=t[s];if(i===void 0)continue;let a=e[s];if(s==="theme"){a===void 0?r[s]=i:typeof a=="string"&&typeof i=="object"&&i!==null&&(r[s]={...i,mode:a});continue}s!=="i18n"&&(r[s]=yd(Ia(i)?i:{},Ia(a)?a:void 0))}t.modules!==void 0&&e.modules===void 0&&(r.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(r.dataApiBaseUrl=t.dataApiBaseUrl);let n=e.i18n,o=t.i18n;if(n||o){let s=yd(Ia(o)?o:{},Ia(n)?n:void 0);o?.availableLocales!==void 0&&(s.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(s.defaultLocale=o.defaultLocale);let i=n?.strings,a=o?.strings;(i||a)&&(s.strings=av(a,i)),r.i18n=s}return r}function yd(e,t){if(!t)return e;let r={...e};for(let[n,o]of Object.entries(t))o!==void 0&&(r[n]=o);return r}function av(e,t){if(!e)return t;if(!t)return e;let r=wa(e),n=wa(t);if(!r&&!n)return{...e,...t};let o={},s=r?e:{en:e},i=n?t:{en:t};for(let[a,c]of Object.entries(s))o[a]={...c};for(let[a,c]of Object.entries(i))o[a]={...o[a],...c};return o}var iv=["clear","expand","fullscreen","popOut","sound","history","language","theme","textSize","close"];function sv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function hr(e){return e!=="false"}function lv(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function cv(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}var Pd=[["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]],xd=[["mode","mode",e=>e],["position","position",e=>e]],Sd=[["width","width"],["height","height"]],wd=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",hr],["show-reasoning","showReasoning",hr],["show-tool-calls","showToolCalls",hr],["show-sources","showSources",hr],["disable-message-feedback","disableMessageFeedback",hr],["auto-send-suggestions","autoSendSuggestions",hr],["card-answer-wait-seconds","cardAnswerWaitSeconds",lv],["pop-out-url","popOutUrl"]],kd=[["locale","locale"]],dv=new Set(iv);function uv(e){return cv(e).filter(t=>dv.has(t))}var Cd=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",hr]],Td=[["features-disable-file-upload","disableFileUpload",hr],["features-disable-email-transcript","disableEmailTranscript",hr],["features-voice","voice",e=>e]],Id=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Ad=[["user-id","id"],["user-email","email"],["user-name","name"]],Rd=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],pv=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],_v=[Pd,xd,Sd,wd,kd,Cd,Td,Id,Ad,Rd],fv=new Set(["start-minimized"]),Qs=[..._v.flatMap(e=>e.map(([t])=>t).filter(t=>!fv.has(t))),...pv];function Aa(e){let t={};function r(f){let v=e(f);return v===null||v===""?void 0:v}for(let[f,v,g]of Pd){let P=r(f);P!==void 0&&Reflect.set(t,v,g?g(P):P)}let n=tn(r,xd),o=tn(r,Sd);(n||o)&&(t.presentation={...n,...o?{size:o}:{}});let s=tn(r,wd);s&&(t.behavior=s);let i=tn(r,kd);i&&(t.i18n=i);let a=gv(e,r);a&&(t.launcher=a);let c=tn(r,Td);c&&(t.features=c);let u=tn(r,Id);u&&(t.endpoints=u);let p=bd(r,Ad,"user-context");p&&(t.userContext=p);let _=bd(r,Rd,"page-context");_&&(t.pageContext=_);let d=r("actions");return d!==void 0&&(t.header={actions:uv(d)}),t}function Ys(e){return e?Aa(t=>e[mv(t==="data-api-base-url"?"api-base-url":t)]??null):{}}function mv(e){return e.replaceAll(/-([a-z])/g,(t,r)=>r.toUpperCase())}function tn(e,t){let r={};for(let[n,o,s]of t){let i=e(n);i!==void 0&&Reflect.set(r,o,s?s(i):i)}return Object.keys(r).length>0?r:null}function bd(e,t,r){let n={};for(let[a,c]of t){let u=e(a);u!==void 0&&(n[c]=u)}let o={},s=e(r);if(s)try{let a=JSON.parse(s);if(sv(a))for(let[c,u]of Object.entries(a))(typeof u=="string"||typeof u=="number"||typeof u=="boolean")&&(o[c]=u)}catch{}let i={...o,...n};return Object.keys(i).length>0?i:null}function gv(e,t){let r=tn(t,Cd)??{},n=e("launcher-label");n!==null&&(r.label=n);let o=t("callout-text");if(o){let s=Number.parseInt(t("callout-delay")??"",10);r.callout={text:o,...Number.isFinite(s)?{delayMs:s}:{}}}return Object.keys(r).length>0?r:null}var vv=te.scope("events"),Nr={open:!1,ready:!1,unread:0},Nn=class{constructor(){ee(this,"handlers",new Map);ee(this,"taps",new Set)}on(t,r){let n=this.handlers.get(t);return n||(n=new Set,this.handlers.set(t,n)),n.add(r),()=>this.handlers.get(t)?.delete(r)}tap(t){return this.taps.add(t),()=>this.taps.delete(t)}listensTo(t){return(this.handlers.get(t)?.size??0)>0||[...this.taps].some(r=>r.listensTo(t))}emit(t,r){for(let n of this.handlers.get(t)??[])try{n(r)}catch(o){vv.warn("listener threw",{event:t,error:o})}for(let n of this.taps)n.hear(t,r)}clear(){this.handlers.clear(),this.taps.clear()}};var hv=te.scope("hooks"),Xs="*";function Js(e){return typeof e=="function"}var Ra=new Set;function mo(e,t,r){let n={widgetId:e,event:t,listener:r};return Ra.add(n),()=>{Ra.delete(n)}}function yv(e,t,r){let n=[...Ra];for(let o of n)if(Md(o.widgetId,e.widgetId)&&!(o.event!==Xs&&o.event!==t))try{o.listener(e,t,r)}catch(s){hv.warn("hook listener threw",{event:t,error:s})}}function Ed(e,t){return t.tap({hear:(r,n)=>yv(e,r,n),listensTo:r=>[...Ra].some(n=>n.event===r&&Md(n.widgetId,e.widgetId))})}function Zs(e){if(Array.isArray(e))for(let t of e){let r=bv(t);r&&mo(r.widgetId,r.event,r.listener)}}function Md(e,t){return e===Xs||e===t}function bv(e){let t,r,n;if(Array.isArray(e))[t,r,n]=e;else if(Pv(e))({widgetId:t,event:r,listener:n}=e);else return null;return typeof t!="string"||typeof r!="string"||!Js(n)?null:{widgetId:t,event:r,listener:n}}function Pv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var xv=new Set(["home","chats","help","news"]);function Ld(e){return typeof e!="object"||e===null||!("to"in e)||typeof e.to!="string"||!xv.has(e.to)?!1:!("id"in e)||e.id===void 0||typeof e.id=="string"}function Ea(e){let[t="",...r]=e.trim().split("/");if(t===""||t==="open")return;let n=r.join("/");return n?{to:t,id:n}:{to:t}}function yr(e,t){return{text:e,send:typeof t=="object"&&t!==null&&"send"in t&&t.send===!0}}function Nd(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 Od(e){return`${q.cssPrefix}:${e}`}function Nt(e,t,r){e.dispatchEvent(new CustomEvent(Od(t),{detail:r}))}function $d(e,t){let r=Object.keys(t).filter(n=>Object.hasOwn(t,n)).map(n=>{let o=t[n],s=Od(n);function i(a){return o(a instanceof CustomEvent?a.detail:void 0)}return e.addEventListener(s,i),[s,i]});return()=>{for(let[n,o]of r)e.removeEventListener(n,o)}}var Dd=te.scope("track"),Sv=64,wv=256,kv=10;function On(e,t){let r=typeof e=="string"?e.trim():"";if(!r||r.length>Sv){Dd.warn("track: ignored an event without a name of 1\u201364 characters",{name:e});return}let n=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(n).length>wv?(Dd.warn("track: sent the event without its data, which is over 256 characters",{name:r}),{name:r}):Object.keys(n).length>0?{name:r,data:n}:{name:r}}function qd(e){let t=[];return e.on("hostEvent",r=>{t.push({...r,at:Date.now()}),t.length>kv&&t.shift()}),t}var Cv=new Set(["hidden","submit","button","reset","image","file","password"]);function Bd(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Tv(e){return!Bd(e)||e.name===""||e.disabled?!1:!(e instanceof HTMLInputElement&&Cv.has(e.type))}function Iv(e){let t=e.labels?.[0]?.textContent?.trim();return e.getAttribute("toolparamdescription")??(t||e.getAttribute("aria-description"))??void 0}function Av(e,t){let r=Iv(e),n=r?{description:r}:{};return e instanceof HTMLSelectElement?{...n,type:"string",enum:[...e.options].map(o=>o.value)}:e instanceof HTMLTextAreaElement?{...n,type:"string"}:e.type==="checkbox"?{...n,type:"boolean"}:e.type==="radio"?{...n,type:"string",enum:t}:e.type==="number"||e.type==="range"?{...n,type:"number"}:{...n,type:"string"}}function Rv(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 Ud(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e)}function Ev(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===Ud(t)&&!e.checked&&e.click();return}Rv(e,Ud(t))}function Mv(e,t,r){var i;let n=[...e.elements].filter(Tv),o={},s=new Set;for(let a of n){let c=n.flatMap(u=>u instanceof HTMLInputElement&&u.type==="radio"&&u.name===a.name?[u.value]:[]);o[i=a.name]??(o[i]=Av(a,c)),a.required&&s.add(a.name)}return{name:t,description:r,inputSchema:{type:"object",properties:o,...s.size>0?{required:[...s]}:{}},execute(a){let c=typeof a=="object"&&a!==null?Object.entries(a):[];for(let[p,_]of c)for(let d of n)d.name===p&&Ev(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=>Bd(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 zd(){return[...document.querySelectorAll("form[toolname][tooldescription]")].flatMap(e=>{let t=e.getAttribute("toolname")?.trim()??"",r=e.getAttribute("tooldescription")?.trim()??"";return t&&r?[Mv(e,t,r)]:[]})}var Hd=`${q.cssPrefix}.page-tools`,Lv=20,Nv=50;function Ma(e){return typeof e=="object"&&e!==null}function Ov(e){return Ma(e)&&(e.state==="running"||e.state==="stopped"||e.state==="finished"&&Ma(e.outcome))}function $v(e){let t=e?JSON.parse(e):void 0;if(!Ma(t))return{sent:[],calls:{}};let r=Array.isArray(t.sent)?t.sent.filter(o=>typeof o=="string"):[],n=Object.fromEntries(Object.entries(Ma(t.calls)?t.calls:{}).filter(o=>Ov(o[1])));return{sent:r,calls:n}}var tl={sent:[],calls:{}};function go(){try{tl=$v(sessionStorage.getItem(Hd))}catch{}return tl}function el(e){tl=e;try{sessionStorage.setItem(Hd,JSON.stringify(e))}catch{}}var Ot={markSent(e){let t=go();el({...t,sent:[...t.sent.filter(r=>r!==e),e].slice(-Lv)})},sentHere(e){return go().sent.includes(e)},get(e){return go().calls[e]},set(e,t){let r=go(),n=Object.entries(r.calls).filter(([o])=>o!==e);el({...r,calls:Object.fromEntries([...n,[e,t]].slice(-Nv))})},clear(e){let t=go();e.some(r=>r in t.calls)&&el({...t,calls:Object.fromEntries(Object.entries(t.calls).filter(([r])=>!e.includes(r)))})}};function rn(e,t){return new Promise(r=>{if(t?.aborted)return r();let n=setTimeout(s,e);function o(){return s()}t?.addEventListener("abort",o,{once:!0});function s(){clearTimeout(n),t?.removeEventListener("abort",o),r()}})}var Gd=te.scope("page-tools"),Fd="site__",jd=3e4,Dv=1e3,Vd=Symbol.for(`${q.cssPrefix}.page-tools`),nl={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."},Kd="The visitor stopped this before it finished.";function Or(e){return typeof e=="object"&&e!==null}function qv(e){return Or(e)&&Array.isArray(e.registered)&&e.runs instanceof Map}function vo(){let e=Reflect.get(globalThis,Vd);if(qv(e))return e;let t={registered:[],runs:new Map};return Reflect.set(globalThis,Vd,t),t}function nn(e,t){let r=Or(t)&&t.signal instanceof AbortSignal?t.signal:void 0;if(r?.aborted)return;let n=vo().registered;n.push(e);function o(){let s=n.indexOf(e);s>=0&&n.splice(s,1)}r?.addEventListener("abort",o,{once:!0})}function Wd(e){return e.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,58)}function Qd(e){if(!Or(e)||typeof e.name!="string"||!Wd(e.name))return;let t=[e.description,e.title].find(r=>typeof r=="string"&&r.trim()!=="")??e.name;return{name:Wd(e.name),description:t.trim().slice(0,1024),inputSchema:{properties:{},...Or(e.inputSchema)?e.inputSchema:{},type:"object"},consequential:Or(e.annotations)&&e.annotations.consequentialHint===!0}}function rl(e){return e.flatMap(t=>{let r=Qd(t),n=Or(t)?t.execute:void 0;return!r||typeof n!="function"?(Gd.warn("skipped a tool without a name or an execute function",t),[]):[{...r,run:(o,s)=>Reflect.apply(n,t,[o,{signal:s}])}]})}async function Uv(){let e=Reflect.get(document,"modelContext")??Reflect.get(navigator,"modelContext");if(!Or(e)||typeof e.getTools!="function"||typeof e.executeTool!="function")return[];let t=e.getTools,r=e.executeTool,n=await Promise.race([Promise.resolve().then(()=>Reflect.apply(t,e,[])),rn(Dv).then(()=>[])]).catch(()=>[]);return(Array.isArray(n)?n:[]).flatMap(o=>{let s=Qd(o);return s?[{...s,run:(i,a)=>Reflect.apply(r,e,[o,i,{signal:a}])}]:[]})}async function La(e=[]){let t=rl(zd()),r=new Set(t.map(s=>s.name)),o=[...(await Uv()).filter(s=>!r.has(s.name)),...t,...rl(e),...rl(vo().registered)];return new Map(o.map(s=>[s.name,s]))}function ol(e){return[...e.values()].map(({name:t,description:r,inputSchema:n,consequential:o})=>o?{name:t,description:r,inputSchema:n,annotations:{consequentialHint:!0}}:{name:t,description:r,inputSchema:n})}function nr(e){return e?.execution==="client"}function ho(e){return e.startsWith(Fd)?e.slice(Fd.length):e}function Bv(e){if(e===void 0||typeof e=="function"||typeof e=="symbol")return null;let t=new WeakSet,r=JSON.stringify(e,(n,o)=>{if(typeof o=="bigint")return o.toString();if(!(typeof o=="function"||typeof o=="symbol"))return o instanceof Node?`[${o.nodeName.toLowerCase()}]`:Or(o)?t.has(o)?"[circular]":(t.add(o),o):o});return r.length>jd?{truncated:!0,preview:r.slice(0,jd)}:JSON.parse(r)}async function zv(e){let t=ho(e.toolName),r=(await La(e.optionTools)).get(t);return r?Promise.resolve().then(()=>r.run(e.input,e.signal)).then(n=>({state:"output-available",output:Bv(n)})).catch(n=>(Gd.warn("a page tool failed",{name:t,error:n}),{state:"output-error",errorText:(n instanceof Error?n.message:String(n)).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 Yd(e){let{toolCallId:t}=e,r=Ot.get(t);if(r?.state==="finished")return Promise.resolve(r.outcome);let{runs:n}=vo(),o=n.get(t);if(o)return o.outcome;if(r?.state==="running")return Ot.set(t,{state:"finished",outcome:nl}),e.onSettled("interrupted",0),Promise.resolve(nl);let s=new AbortController,i=performance.now();Ot.set(t,{state:"running"});let a=zv({...e,signal:s.signal}).then(c=>(n.delete(t),Ot.get(t)?.state!=="running"||(Ot.set(t,{state:"finished",outcome:c}),e.onSettled(c.state==="output-available"?"completed":"failed",Math.round(performance.now()-i))),c));return n.set(t,{outcome:a,controller:s}),a}function Na(e){return e===nl.errorText||e===Kd}function al(e){return Ot.set(e,{state:"stopped"}),vo().runs.get(e)?.controller.abort(),Kd}function Xd(e){Ot.clear([e]),vo().runs.get(e)?.controller.abort()}var xe,eu,ll,$r,il,qa,tu,$a,ru,cl,sl,Hv,bo=Symbol.for("pv"),Ua={},Ba=[],Fv=/^m(i|n|o|s|text|space)$/,za=Array.isArray,dl=Ba.slice,an=Object.assign;function on(e){e&&e.parentNode&&e.remove()}function qr(e,t,r){var n,o,s,i={},a=arguments.length;for(s in t)s=="key"?n=t[s]:s=="ref"&&typeof e!="function"?o=t[s]:i[s]=t[s];return a>2&&(i.children=a>3?dl.call(arguments,2):r),yo(e,i,n,o,null)}function yo(e,t,r,n,o){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:bo,__v:o||++eu,__i:-1,__u:0};return!o&&xe.vnode&&xe.vnode(s),s}function ge(e){return e.children}function Zt(e,t){this.props=e,this.context=t,this.__g=0}function Dr(e,t){if(t==null)return e.__&&Dr(e.__,e.__i+1);for(var r;t<e.__k.length;t++)if((r=e.__k[t])&&r.__e)return r.__e;return typeof e.type!="function"||e.props.__P?null:Dr(e)}function jv(e){var t,r=e.__v,n=r.__e,o=[],s=[],i=e.__P;i&&((t=an({constructor:bo},r)).__v=r.__v+1,xe.vnode&&xe.vnode(t),pl(i,t,r,e.__n,i.namespaceURI,32&r.__u?[n]:null,o,n||Dr(r),32&r.__u,s),t.__v=r.__v,t.__.__k[t.__i]=t,lu(o,t,s),r.__=r.__e=null,t.__e!=n&&nu(t))}function nu(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),nu(e)}function Jd(e){(8&e.__g||(e.__g|=8,$r.push(e),qa++))&&il==xe.debounceRendering||((il=xe.debounceRendering)||queueMicrotask)(ou)}function ou(){try{for(var e,t=1;$r.length;)$r.length>t&&$r.sort(tu),e=$r.shift(),t=$r.length,8&e.__g&&jv(e)}finally{(qa=$r.length)&&(il||queueMicrotask)(ou)}}function au(e,t,r,n,o,s,i,a,c,u,p){var _,d,f,v,g,P,b=n.__k||Ba,y=t.length;for(c=Vv(r,t,b,c,y),_=0;_<y;_++)(f=r.__k[_])!=null&&(d=~f.__i&&b[f.__i]||Ua,f.__i=_,P=pl(e,f,d,o,s,i,a,c,u,p),v=f.__e,(d.ref!=f.ref||8&d.__u)&&(d.ref&&_l(d.ref,null,f,d),f.ref&&p.push(f.ref,f.__c||v,f)),g=g||v,4&f.__u?(c=iu(f,c,e,!d.__v),d.__e&&(d.__e=null)):typeof f.type=="function"&&P!==void 0?c=P:v&&(c=v.nextSibling),f.__u&=-21);return r.__e=g,c}function Vv(e,t,r,n,o){var s,i,a,c,u,p,_,d,f,v=r.length,g=v,P=0,b=0,y=e.__k=Array(o);for(s=0;s<o;s++)(i=t[s])!=null&&typeof i!="boolean"&&typeof i!="function"?(typeof i!="object"||i.constructor===String?i=y[s]=yo(null,i):za(i)?i=y[s]=yo(ge,{children:i}):i.constructor===bo&&i.__b?i=y[s]=yo(i.type,i.props,i.key,i.ref,i.__v):y[s]=i,c=s+P,i.__=e,i.__b=e.__b+1,a=null,~(u=i.__i=Wv(i,r,c,g))&&(g--,(a=r[u])&&(a.__u|=2)),a&&a.__v?(i.__u|=16,u==c-1?P--:u==c+1?P++:u!=c&&(u>c?P--:P++,b=1)):(~u||(o>v?P--:o<v&&P++),typeof i.type!="function"&&(i.__u|=4))):y[s]=null;if(b){for(p=[],_=[],s=0;s<o;s++)if((i=y[s])&&16&i.__u){for(P=0,d=p.length;P<d;)p[f=P+d>>1]<i.__i?P=f+1:d=f;p[P]=i.__i,_[s]=P+1}for(P=p.length;s--;)_[s]&&(_[s]==P?P--:y[s].__u|=4)}if(g)for(s=0;s<v;s++)!(a=r[s])||2&a.__u||(a.__e==n&&(n=Dr(a)),fl(a,a));return n}function iu(e,t,r,n){var o,s,i,a;if(typeof e.type=="function"){if(e.props.__P)return t;if(o=e.__k)for(s=0;s<o.length;s++)o[s]&&(o[s].__=e,t=iu(o[s],t,r,!1));return t}for(t&&!t.parentNode&&(t=Dr(e))&&!t.parentNode&&(t=null),i=e.__e,a=t;a&&a.nodeType==8;)a=a.nextSibling;for(i!=a&&(!n&&r.moveBefore&&i.parentNode?r.moveBefore(i,t):r.insertBefore(i,t||null)),t=i;(t=t&&t.nextSibling)&&t.nodeType==8&&!t.data.startsWith("$s"););return t}function ul(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(za(e)?e.some(function(r){ul(r,t)}):t.push(e)),t}function Wv(e,t,r,n){var o,s=e.key,i=e.type,a=t[r],c=a&&!(2&a.__u);if(a===null&&s==null||c&&s==a.key&&i==a.type)return r;if(n>(c?1:0)){for(o=r-1;o>=0;o--)if((a=t[o])&&!(2&a.__u)&&s==a.key&&i==a.type)return o;for(o=r+1;o<t.length;o++)if((a=t[o])&&!(2&a.__u)&&s==a.key&&i==a.type)return o}return-1}function Zd(e,t,r){r==null&&(r=""),t[0]=="-"?e.setProperty(t,r):e[t]=r}function Oa(e,t,r,n,o){var s,i;if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Zd(e.style,t);if(r)for(t in r)n&&r[t]==n[t]||Zd(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")typeof r!="function"&&(r=null),typeof n!="function"&&(n=null),(e.__e||(e.__e={}))[t]=r,r&&n||(i=sl[t]||(sl[t]=Gv(t)),(e.__a||(e.__a={}))[t]=cl,s=t!=(t=t.replace(ru,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),r?e.addEventListener(t,i,s):e.removeEventListener(t,i,s));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]=r??"")}catch{}if(typeof r=="function")return;r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r)}}function Gv(e){return function(t){var r=this.__e;if(r){if(r=r[e],t[$a]==null)t[$a]=cl++;else if(t[$a]<this.__a[e])return;return r(xe.event?xe.event(t):t)}}}function pl(e,t,r,n,o,s,i,a,c,u){var p,_,d,f,v,g,P,b,y,x,S,k,h,m,w,A,I,R,C=t.type;if(t.constructor!==bo)return null;128&r.__u&&(c=32&r.__u,p=r.__c.__z)&&(t.__u|=c,_=s=[],p.nodeType==8?a=Da(p,s):s.push(p),a=s[0]||a),(p=xe.__b)&&p(t);e:if(typeof C=="function"){d=i.length;try{if(b=t.props,y=(p=C.prototype)&&p.render,x=(p=C.contextType)&&n[p.__c],S=p?x?x.props.value:p.__:n,(f=r.__c)?(t.__c=f,2&f.__g&&(f.__g|=1)):(y?t.__c=f=new C(b,S):(t.__c=f=new Zt(b,S),f.constructor=C,f.render=Qv),x&&x.sub(f),f.state||(f.state={}),f.__n=n,f.__g|=8,f.__h=[],f.__k=[]),y&&(f.__s||(f.__s=f.state),C.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=an({},f.__s)),an(f.__s,C.getDerivedStateFromProps(b,f.__s)))),v=f.props,g=f.state,f.__v=t,r.__c){if(b!==v&&y&&!C.getDerivedStateFromProps&&f.componentWillReceiveProps&&f.componentWillReceiveProps(b,S),t.__v==r.__v&&!(8&f.__g)||!(4&f.__g)&&f.shouldComponentUpdate&&f.shouldComponentUpdate(b,f.__s,S)===!1){t.__v!=r.__v&&(f.props=b,f.state=f.__s,f.__g&=-9),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(M){M&&(M.__=t)}),Ba.push.apply(f.__h,f.__k),f.__k=[],f.__h.length&&i.push(f),a=Dr(r);break e}f.componentWillUpdate&&f.componentWillUpdate(b,f.__s,S),y&&f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,g,P)})}else y&&!C.getDerivedStateFromProps&&f.componentWillMount&&f.componentWillMount(),y&&f.componentDidMount&&f.__h.push(f.componentDidMount);f.context=S,f.props=b,f.__P=e,f.__g&=-5,k=xe.__r,h=y?25:0;do f.__g&=-9,k&&k(t),p=f.render(f.props,f.state=f.__s,f.context);while(8&f.__g&&++h<25);y&&(Ba.push.apply(f.__h,f.__k),f.__k=[]),f.state=f.__s,f.getChildContext&&(n=an({},n,f.getChildContext())),y&&r.__c&&f.getSnapshotBeforeUpdate&&(P=f.getSnapshotBeforeUpdate(v,g)),m=p&&p.type===ge&&p.key==null?p.props.children:p,b.__P&&(p=a,o=(e=b.__P).namespaceURI,c=s=null,r.props&&r.props.__P!=e&&(r.__k.some(function(M){M&&fl(M,M)}),r.__k=null),a=r.__k?Dr(r,0):null),a=au(e,za(m)?m:[m],t,r,n,o,s,i,a,c,u),b.__P&&(t.__e=null,a=p),t.__u&=-161,_&&_.some(on),f.__h.length&&i.push(f),1&f.__g&&(f.__g&=-4)}catch(M){if(i.length=d,t.__v=null,c||s)if(M&&M.then){if(t.__u|=128|c,s){for(~(I=s.indexOf(a||void 0))||(I=s.length);(R=s[I-1])&&R.nodeType==8;)I--;for(;I<s.length;I++)if(R=s[I])if(s[I]=null,w){if(R==A)break}else{if(R.nodeType!=8)break;R.data.startsWith("$s")&&(A=Da(w=R))}}if(!w){for(;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;w=a}(p=Da(w=t.__c.__z||(t.__c.__z=w)))?(t.__e=w,a=p):t.__e=a,a=a&&a.nextSibling}else s&&s.some(on);else t.__e=r.__e;t.__k||(t.__k=r.__k||[]),M&&M.then||su(t),xe.__e(M,t,r)}}else a=t.__e=Kv(r.__e,t,r,n,o,s,i,c,u,e);return(p=xe.diffed)&&p(t),a}function Da(e,t){if(e&&e.nodeType==8&&e.data.startsWith("$s"))for(var r=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith("$s"))r++;else if(e.data.startsWith("/$s")&&!--r)return e}t&&t.push(e)}}function su(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(su))}function lu(e,t,r){for(var n=0;n<r.length;)_l(r[n++],r[n++],r[n++]);xe.__c&&xe.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){xe.__e(s,o.__v)}})}function Kv(e,t,r,n,o,s,i,a,c,u){var p,_,d,f,v,g,P,b,y=r.props||Ua,x=t.props,S=t.type;if(S=="svg"?o="http://www.w3.org/2000/svg":S=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),s){for(p=0;p<s.length;p++)if((v=s[p])&&(S?v.localName==S:v.nodeType==3)){e=v,s[p]=null;break}}if(!e){if(b=u.ownerDocument||document,!S)return b.createTextNode(x);e=b.createElementNS(o,S,x.is?x:u),a&&(xe.__m&&xe.__m(t,s),a=!1),s=null}if(S){if(u=S=="template"&&e.content||e,s=S=="textarea"&&x.defaultValue!=null?null:s&&dl.call(u.childNodes),!a&&s)for(y={},p=0;p<e.attributes.length;p++)y[(v=e.attributes[p]).name]=v.value;for(p in y)v=y[p],p=="dangerouslySetInnerHTML"?d=v:p=="children"||p in x||p=="value"&&"defaultValue"in x||p=="checked"&&"defaultChecked"in x||Oa(e,p,null,v,o);for(p in x)v=x[p],p=="children"?f=v:p=="dangerouslySetInnerHTML"?_=v:p=="value"?g=v:p=="checked"?P=v:a&&typeof v!="function"||y[p]===v||Oa(e,p,v,y[p],o);_?(a||d&&(_.__html==d.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[]):(d&&(e.textContent=""),(S=="foreignObject"||o=="http://www.w3.org/1998/Math/MathML"&&Fv.test(S))&&(o="http://www.w3.org/1999/xhtml"),au(u,za(f)?f:[f],t,r,n,o,s,i,s?s[0]:r.__k&&Dr(r,0),a,c),s&&s.some(on)),a&&S!="textarea"||(p="value",S=="progress"&&g==null?e.removeAttribute(p):g==null||g===e[p]&&(S!="progress"||g)||Oa(e,p,g,y[p],o),p="checked",P!=null&&P!=e[p]&&Oa(e,p,P,y[p],o))}else y===x||a&&e.data==x||(e.data=x);return e}function _l(e,t,r,n){try{typeof e=="function"?t?t.__x=e(t)||1:n&&(n=n.__c||n.__e)&&(t=n.__x)&&(n.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(o){xe.__e(o,r)}}function fl(e,t,r){var n,o,s,i;if(xe.unmount&&xe.unmount(e),!(n=e.ref)||n.current&&n.current!=e.__e||_l(n,null,t,e),n=e.__c){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(a){xe.__e(a,t)}n.__P=n.__n=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&fl(n[i],t,typeof e.type!="function"||r&&!e.props.__P);!r&&(n=e.__c)&&(n=n.__z)&&(o=Da(n,s=[]))&&(n==e.__e&&s.some(on),on(o),on(n)),r||on(e.__e),e.__e=e.__c=e.__=null}function Qv(e,t,r){return this.constructor(e,r)}function cr(e,t){var r,n,o,s;xe.__&&xe.__(e,t),t.nodeType==9&&(t=t.documentElement),n=(r=e&&32&e.__u)?null:t.__k,t.__k=yo(ge,{children:[e]}),o=[],s=[],pl(t,t.__k,n||Ua,Ua,t.namespaceURI,n?null:t.firstChild?dl.call(t.childNodes):null,o,n?n.__e:t.firstChild,r,s),lu(o,t.__k,s),t.__k.props.children=null}xe={__e:function(e,t,r,n){for(var o,s,i;t=t.__;)if((o=t.__c)&&!(1&o.__g)){o.__g|=4;try{if((i=(s=o.constructor)&&s.getDerivedStateFromError)&&o.setState(s.getDerivedStateFromError(e)),o.componentDidCatch&&(o.componentDidCatch(e,n||{}),i=1),i&&8&o.__g)return void(o.__g|=2)}catch(a){e=a}}throw qa=0,e}},eu=0,ll=function(e){return e!=null&&e.constructor===bo},Zt.prototype.setState=function(e,t){var r=this.__s;r&&r!=this.state||(r=this.__s=an({},this.state)),typeof e=="function"&&(e=e(an({},r),this.props)),e&&(an(r,e),this.__v&&(t&&this.__k.push(t),Jd(this)))},Zt.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Jd(this))},Zt.prototype.render=ge,$r=[],qa=0,tu=function(e,t){return e.__v.__b-t.__v.__b},$a=Symbol(),ru=/(PointerCapture)$|Capture$/i,cl=0,sl={},Hv=0;function Wt(){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,Yv(t.subarray(6)),t[6]=(t[6]??0)&15|112,t[8]=(t[8]??0)&63|128;let r=Array.from(t,n=>n.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function Yv(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 Ur=te.scope("persistence");function Br(e,t=ka,r){let n=r?`${e}.${r}`:e,o=`${q.cssPrefix}.${n}.storageVersion`,s=t.get(o)??void 0,i=s?`.v${s}`:"",a=`${q.cssPrefix}.${n}${i}`,c=`${q.cssPrefix}${i}.visitorId`,u=`${q.cssPrefix}${i}.lastUserSub`,p=`${a}.conversationId`,_=`${a}.userPrefs`,d=`${a}.panelOpen`,f=`${a}.panelSize`,v=`${a}.calloutDismissed`,g=`${a}.sidebarCollapsed`,P=`${a}.activeModule`,b=`${a}.seenNewsId`,y=`${a}.historyCount`,x=`${a}.loginReturn`,S=`${a}.loginPromptDismissedIn`,k={getVisitorId(){let h=t.get(c);if(h)return h;let m=Wt();return t.set(c,m),m},loadLastUserSub(){return t.get(u)??void 0},saveLastUserSub(h){t.set(u,h)},loadConversationId(){return t.get(p)??void 0},saveConversationId(h){Ur.trace("saveConversationId",{id:h,scope:n}),h?t.set(p,h):t.remove(p)},loadDraft(h){return t.get(`${a}.draft.${h}`)??""},saveDraft(h,m){let w=`${a}.draft.${h}`;m?t.set(w,m):t.remove(w)},loadMessageQueue(h){let m=t.get(`${a}.messageQueue.${h}`);if(!m)return[];try{let w=JSON.parse(m);return!Array.isArray(w)||!w.every(Xv)?[]:w}catch(w){return Ur.warn("loadMessageQueue parse failed",{error:w}),[]}},saveMessageQueue(h,m){let w=`${a}.messageQueue.${h}`;if(m.length===0){t.remove(w);return}try{t.set(w,JSON.stringify(m))}catch(A){Ur.warn("saveMessageQueue serialise failed",{error:A})}},loadUserPrefs(){let h=t.get(_);if(!h)return{};try{return ml(JSON.parse(h))}catch(m){return Ur.warn("loadUserPrefs parse failed",{error:m}),{}}},saveUserPrefs(h){try{t.set(_,JSON.stringify(h))}catch(m){Ur.warn("saveUserPrefs serialise failed",{error:m})}},patchUserPrefs(h){let m=k.loadUserPrefs();k.saveUserPrefs({...m,...h})},loadPanelOpen(){let h=t.get(d);return h==="1"?!0:h==="0"?!1:null},savePanelOpen(h){t.set(d,h?"1":"0")},loadPanelSize(){let h=t.get(f);return h==="normal"||h==="expanded"||h==="fullscreen"?h:null},savePanelSize(h){t.set(f,h)},loadCalloutDismissed(h){if(!h)return!1;let m=t.get(v);return!!m&&m===h},saveCalloutDismissed(h){h?t.set(v,h):t.remove(v)},loadSidebarCollapsed(){let h=t.get(g);return h==="1"?!0:h==="0"?!1:null},saveSidebarCollapsed(h){t.set(g,h?"1":"0")},loadActiveModule(){return t.get(P)||null},saveActiveModule(h){t.set(P,h)},loadSeenNewsId(){return t.get(b)||null},saveSeenNewsId(h){t.set(b,h)},loadHistoryCount(){let h=t.get(y);if(!h)return null;let m=Number.parseInt(h,10);return Number.isFinite(m)&&m>=0?m:null},saveHistoryCount(h){t.set(y,String(h))},rememberStorageVersion(h){h&&h!==t.get(o)&&(Ur.debug("rememberStorageVersion (force-reset on next load)",{version:h}),t.set(o,h))},saveLoginReturn(h){Zr.set(x,JSON.stringify(h))},takeLoginReturn(){let h=Zr.get(x);if(h){Zr.remove(x);try{let m=JSON.parse(h);return Ha(m)&&typeof m.conversationId=="string"&&m.conversationId&&typeof m.draft=="string"?{conversationId:m.conversationId,draft:m.draft}:void 0}catch(m){Ur.warn("takeLoginReturn parse failed",{error:m});return}}},loadLoginPromptDismissedIn(){return Zr.get(S)??void 0},dismissLoginPromptIn(h){Zr.set(S,h)},clearConversation(){t.remove(p)},reset(){let h=t.get(p);h&&(t.remove(`${a}.draft.${h}`),t.remove(`${a}.messageQueue.${h}`));for(let m of[x,S])Zr.remove(m);for(let m of[c,u,p,_,f,v,g,P,b,y])t.remove(m);Ur.info("reset: forgot the visitor",{scope:n})}};return k}function Ha(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Xv(e){return Ha(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.text=="string"}function ml(e){if(!Ha(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),Ha(e.widgetSize)&&typeof e.widgetSize.width=="number"&&typeof e.widgetSize.height=="number"&&(t.widgetSize={width:e.widgetSize.width,height:e.widgetSize.height}),t}var $n="6.4.10";var Jv="1",cu=60,Zv=2e3,gl={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 eh(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function th(){return location.origin+location.pathname}function rh(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function du(e,t){let r=Math.random(),n=0,o=0,s=new Set;function i(_,d){let{tracking:f,publicKey:v,aiAgentDeploymentId:g,mode:P,themeMode:b}=t.getOptions();if(!f.enabled||eh()||r>=f.sampleRate)return;let y=performance.now();if(y-n>6e4&&(n=y,o=0),++o>cu)return;let x=new URLSearchParams;x.set("v",Jv),x.set("_ev",$n),x.set("e",_),f.token&&x.set("tk",f.token),v&&x.set("pk",v),g&&x.set("dep",g),x.set("vid",t.getVisitorId());let S=t.getConversationId();S&&x.set("cid",S),x.set("url",th());let k=rh();k&&x.set("ref",k),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",P),x.set("th",b),d)for(let[A,I]of Object.entries(d))I!==void 0&&x.set(A,String(I));x.set("ts",String(Date.now()));let h=`${f.endpoint}?${x}`;if(h.length>Zv)return;let m=new Image(1,1);s.add(m);function w(){return s.delete(m)}m.addEventListener("load",w,{once:!0}),m.addEventListener("error",w,{once:!0}),m.src=h}let a=[];function c(_,d){if(a&&_!=="handshake"){a.length<cu&&a.push([_,d]);return}let f=a??[];a=void 0;for(let[v,g]of f)i(v,g);i(_,d)}function u(_,d){return gl[_]?.(d)}let p=Object.keys(gl).filter(_=>Object.hasOwn(gl,_)).map(_=>e.on(_,d=>c(_,u(_,d))));return()=>{for(let _ of p)_();s.clear()}}var uu=`.__P__-generative-ui{display:grid;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{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}.__P__-generative-ui-cell{display:flex;flex-direction:column;align-self: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:is([data-columns="2"],[data-columns="3"],[data-columns="4"]){grid-template-columns:repeat(2,minmax(0,1fr))}.__P__-generative-ui-grid:is([data-columns="2"],[data-columns="3"],[data-columns="4"])>.__P__-generative-ui-cell:is([data-span="2"],[data-span="3"],[data-span="4"]){grid-column:span 2}}@container __P__-generative-ui-grid (min-width: 752px){.__P__-generative-ui-grid:is([data-columns="3"],[data-columns="4"]){grid-template-columns:repeat(3,minmax(0,1fr))}.__P__-generative-ui-grid:is([data-columns="3"],[data-columns="4"])>.__P__-generative-ui-cell:is([data-span="3"],[data-span="4"]){grid-column:span 3}}@container __P__-generative-ui-grid (min-width: 1008px){.__P__-generative-ui-grid[data-columns="4"]{grid-template-columns:repeat(4,minmax(0,1fr))}.__P__-generative-ui-grid[data-columns="4"]>.__P__-generative-ui-cell[data-span="4"]{grid-column:span 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{font-size:1.6em;font-weight:700}.__P__-generative-ui-table{overflow-x:auto}.__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-chart{display:block;width:100%;color:var(--__P__-accent)}.__P__-generative-ui-axis{stroke:var(--__P__-border)}.__P__-generative-ui-data{display:flex;flex-wrap:wrap;gap:var(--__P__-space-2);font-size:.85em}.__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-carousel>[role=listitem]{display:flex;flex:0 0 min(250px,80%);scroll-snap-align:start;min-width:0}.__P__-generative-ui-carousel>[role=listitem]>section{flex:1}.__P__-generative-ui-product{overflow:hidden}.__P__-generative-ui>.__P__-generative-ui-product{max-width:320px}.__P__-generative-ui-footer{display:flex;flex-direction:column;gap:var(--__P__-space-1);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{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-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-product>.__P__-generative-ui-heading{justify-content:flex-start}.__P__-generative-ui-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.__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[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 dd{margin:0}.__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}
2
- `;var pu=`: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}}
3
- `;var _u=`.__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-reason{margin:0;color:var(--__P__-fg-muted)}.__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-summary{margin-inline-start:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-steps-row-body{display:flex;flex-direction:column;gap:var(--__P__-space-2);width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__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{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=completed]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=responded]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=awaiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=denied]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=error]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=superseded],.__P__-toolui-status[data-status=incomplete],.__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-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-fields{display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px var(--__P__-space-2);margin:0;font-size:var(--__P__-text-xs);line-height:1.5}.__P__-toolui-fields>div{display:contents}.__P__-toolui-fields dt{color:var(--__P__-fg-muted)}.__P__-toolui-fields dd{margin:0;min-width:0;overflow:hidden;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-fields-full{max-height:240px;overflow:auto;overscroll-behavior:contain}.__P__-toolui-fields-full dd{overflow:visible;font-family:inherit;white-space:pre-wrap;overflow-wrap:anywhere}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
4
- `;var fu=`*,*: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}
5
- `;var mu=`: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}}
6
- `;var lh="helpai",ch="#5B5BD6",dh="#FFFFFF",uh="12px",ph="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",hl=[mu,fu,_u,uu,pu].join(`
7
- `).replace(/__P__/g,lh).replaceAll("__BRAND_ACCENT_TEXT__",dh).replaceAll("__BRAND_ACCENT__",ch).replaceAll("__BRAND_RADIUS__",uh).replaceAll("__BRAND_FONT__",ph);var vu=["data-theme","data-color-scheme","data-mode","data-bs-theme"];function gu(e){if(e){if(e.classList.contains("dark"))return"dark";if(e.classList.contains("light"))return"light";for(let t of vu){let r=e.getAttribute(t);if(r==="dark"||r==="light")return r}}}function Fa(e=document){let t=gu(e.documentElement)??gu(e.body);if(t)return t;let r=getComputedStyle(e.documentElement).colorScheme.trim();return r==="dark"||r==="light"?r:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function hu(e,t=document){let r=Fa(t);e(r);function n(){let a=Fa(t);a!==r&&(r=a,e(a))}let o=new MutationObserver(n),s={attributes:!0,attributeFilter:["class","style",...vu]};o.observe(t.documentElement,s),t.body&&o.observe(t.body,s);let i=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):void 0;return i?.addEventListener("change",n),()=>{o.disconnect(),i?.removeEventListener("change",n)}}var _h=te.scope("mount"),yu=new WeakMap,fh={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 yl(e,t){let r=t==="flow"?e.style.height:"";e.style.cssText=fh[t],r&&(e.style.height=r)}function Dn(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function ja(e={}){let t=e.position??"flow";_h.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let r=`${q.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(r)&&customElements.define(r,class extends HTMLElement{});let n;e.existingHost?n=e.existingHost:(n=document.createElement(r),(e.target??document.body).appendChild(n)),n.setAttribute("data-brand",q.id),yl(n,t);let o=n.shadowRoot??n.attachShadow({mode:"open"});for(let a of["keydown","keypress","keyup"])o.addEventListener(a,mh);let s=n.ownerDocument;if(!gh(o,s)){let a=s.createElement("style");a.textContent=hl,o.appendChild(a)}let i=document.createElement("div");return i.className=`${q.cssPrefix}-app`,o.appendChild(i),{appRoot:i,destroy:()=>n.remove(),hostElement:n,shadowRoot:o}}function mh(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 gh(e,t){if(!("adoptedStyleSheets"in e))return!1;let r=t.defaultView;if(!r||typeof r.CSSStyleSheet!="function")return!1;let n=yu.get(t);if(!n)try{n=new r.CSSStyleSheet,n.replaceSync(hl),yu.set(t,n)}catch{return!1}try{return e.adoptedStyleSheets=[n],!0}catch{return!1}}function vh(e,t){let r=q.cssPrefix;t.accent&&e.style.setProperty(`--${r}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${r}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${r}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${r}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${r}-conversation-max`,t.contentMaxWidth)}function hh(e,t){e.dataset.theme=t==="host"?Fa():t}function yh(e,t){let r=q.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${r}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${r}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${r}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${r}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${r}-panel-inset`,t.inset)}function bh(e,t){e.dataset.position=t}function Va(e,t){e.dataset.mode=t}function bu(e,t){hh(e,t.themeMode),vh(e,t.themeOverrides),bh(e,t.position),yh(e,t.size)}var sn,dt,bl,Pu,Pl=Object.is,xo=0,Ru=[],xl=[],ct=xe,xu=ct.__b,Su=ct.__r,wu=ct.diffed,ku=ct.__c,Cu=ct.unmount,Tu=ct.__;function So(e,t){ct.__h&&ct.__h(dt,e,xo||t),xo=0;var r=dt.__H||(dt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function U(e){return xo=1,Eu(Mu,e)}function Eu(e,t,r){var n=So(sn++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Mu(void 0,t),function(s){var i=(n.__N||n.__)[0],a=n.t(i,s);Pl(i,a)||(n.__N=[a,n.__[1]],n.__c.setState({}))}],n.__c=dt,!dt.__f)){dt.__f=!0;var o=dt.shouldComponentUpdate;dt.shouldComponentUpdate=function(s,i,a){var c=this.__H;if(!c)return!0;var u=!1,p=this.props!=s;if(c.__.some(function(d){d.__N&&(u=!0,Pl(d.__[0],d.__N[0])||(p=!0))}),o){var _=o.call(this,s,i,a);return u?_||p:_}return!u||p}}return n.__}function H(e,t){var r=So(sn++,3);!ct.__s&&wl(r.__H,t)&&(r.__P=!0,r.__=e,r.u=t,dt.__H.__h.push(r))}function St(e,t){var r=So(sn++,4);!ct.__s&&wl(r.__H,t)&&(r.__P=!1,r.__=e,r.u=t,dt.__h.push(r))}function B(e){return xo=5,ve(function(){return{current:e}},[])}function ve(e,t){var r=So(sn++,7);return wl(r.__H,t)&&(r.__=e(),r.__H=t),r.__}function F(e,t){return xo=8,ve(function(){return e},t)}function wo(){var e=So(sn++,11);if(!e.__){for(var t=dt.__v;!t.__m&&t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Ph(){var e;do{for(;e=xl.shift();)try{Po(e)}catch(r){ct.__e(r,{__:(e=e.__P)&&e.__v})}for(;e=Ru.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Po),t.__h.some(Sl),t.__h=[]}catch(r){t.__h=[],ct.__e(r,e.__v)}}}while(xl.length)}ct.__b=function(e){dt=null,xu&&xu(e)},ct.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Tu&&Tu(e,t)},ct.__r=function(e){Su&&Su(e),sn=0;var t=(dt=e.__c).__H;t&&(bl==dt?dt.__h=[]:(t.__h.some(Po),t.__h.some(Sl),sn=0),t.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})),bl=dt},ct.diffed=function(e){wu&&wu(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Au(Ru.push(t)),t.__H.__.some(function(r){r.u&&(r.__H=r.u)})),bl=dt=null},ct.__c=function(e,t){t.some(function(r){try{r.__h.some(Po),r.__h=r.__h.filter(function(n){return!n.__||Sl(n)})}catch(n){r.__h=[function(){throw n}]}}),ku&&ku(e,t)},ct.unmount=function(e){Cu&&Cu(e);var t,r,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{if(o.__P&&o.__c){if(r===void 0){for(r=e.__;r&&(!r.__c||!r.__c.__P);)r=r.__;r=r&&r.__c}o.__P=r,Au(xl.push(o))}else Po(o)}catch(s){t=s}}),n.__H=void 0,t&&ct.__e(t,n.__v))};var Iu=typeof requestAnimationFrame=="function";function xh(e){var t,r=function(){clearTimeout(n),Iu&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Iu&&(t=requestAnimationFrame(r))}function Au(e){e!=1&&Pu==ct.requestAnimationFrame||((Pu=ct.requestAnimationFrame)||xh)(Ph)}function Po(e){var t=dt,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),dt=t}function Sl(e){var t=dt;e.__c=e.__(),dt=t}function wl(e,t){return!e||e.length!=t.length||t.some(function(r,n){return!Pl(r,e[n])})}function Mu(e,t){return typeof t=="function"?t(e):t}var Sh=Symbol.for("preact-signals");function Qa(){if(br>1)br--;else{var e,t=!1;for((function(){var o=Ga;for(Ga=void 0;o!==void 0;){var s=o.S;if(s.v===o.v)for(var i=s.t;i!==void 0;i=i.x)i.i===o.i&&(i.i=s.i);o=o.o}})();Co!==void 0;){var r=Co;for(Co=void 0,Wa++;r!==void 0;){var n=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&Nu(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(Wa=0,br--,t)throw e}}function er(e){if(br>0)return e();kl=++wh,br++;try{return e()}finally{Qa()}}var ko,Qe=void 0;function To(e){var t=Qe,r=ko;Qe=void 0,ko=void 0;try{return e()}finally{Qe=t,ko=r}}var Co=void 0,br=0,Wa=0,wh=0,kl=0,Ga=void 0,Ka=0;function Lu(e){if(Qe!==void 0){var t=e.n;if(t===void 0||t.t!==Qe)return t={i:0,S:e,p:Qe.s,n:void 0,t:Qe,e:void 0,x:void 0,r:t},Qe.s!==void 0&&(Qe.s.n=t),Qe.s=t,e.n=t,32&Qe.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=Qe.s,t.n=void 0,Qe.s.n=t,Qe.s=t),t}}function wt(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}wt.prototype.brand=Sh;wt.prototype.h=function(){return!0};wt.prototype.S=function(e){var t=this,r=this.t;r!==e&&e.e===void 0&&(e.x=r,this.t=e,r!==void 0?r.e=e:To(function(){var n;(n=t.W)==null||n.call(t)}))};wt.prototype.U=function(e){var t=this;if(this.t!==void 0){var r=e.e,n=e.x;r!==void 0&&(r.x=n,e.e=void 0),n!==void 0&&(n.e=r,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&To(function(){var o;(o=t.Z)==null||o.call(t)}))}};wt.prototype.subscribe=function(e){var t=this;return or(function(){var r=t.value;To(function(){return e(r)})},{name:"sub"})};wt.prototype.valueOf=function(){return this.value};wt.prototype.toString=function(){return this.value+""};wt.prototype.toJSON=function(){return this.value};wt.prototype.peek=function(){var e=this;return To(function(){return e.value})};Object.defineProperty(wt.prototype,"value",{get:function(){var e=Lu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Wa>100)throw new Error("Cycle detected");(function(r){br!==0&&Wa===0&&r.l!==kl&&(r.l=kl,Ga={S:r,v:r.v,i:r.i,o:Ga})})(this),this.v=e,this.i++,Ka++,br++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Qa()}}}});function se(e,t){return new wt(e,t)}function Nu(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 Ou(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function $u(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function ln(e,t){wt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Ka-1,this.f=4}ln.prototype=new wt;ln.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ka))return!0;if(this.g=Ka,this.f|=1,this.i>0&&!Nu(this))return this.f&=-2,!0;var e=Qe;try{Ou(this),Qe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Qe=e,$u(this),this.f&=-2,!0};ln.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)}wt.prototype.S.call(this,e)};ln.prototype.U=function(e){if(this.t!==void 0&&(wt.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)}};ln.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(ln.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Lu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Se(e,t){return new ln(e,t)}function Du(e){var t=e.j;if(e.j=void 0,typeof t=="function"){br++;var r=Qe;Qe=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Cl(e),n}finally{Qe=r,Qa()}}}function Cl(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Du(e)}function kh(e){if(Qe!==this)throw new Error("Out-of-order effect");$u(this),Qe=e,this.f&=-2;try{8&this.f&&Cl(this)}finally{Qa()}}function qn(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ko&&ko.push(this)}qn.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()}};qn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Du(this),Ou(this),br++;var e=Qe;return Qe=this,kh.bind(this,e)};qn.prototype.N=function(){2&this.f||(this.f|=2,this.u=Co,Co=this)};qn.prototype.d=function(){this.f|=8,1&this.f||Cl(this)};qn.prototype.dispose=function(){this.d()};function or(e,t){var r=new qn(e,t);try{r.c()}catch(o){throw r.d(),o}var n=r.d.bind(r);return n[Symbol.dispose]=n,n}var qu,Ao,Ya,Ch=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Uu=[];or(function(){qu=this.N})();function Un(e,t){xe[e]=t.bind(null,xe[e]||function(){})}function Io(e){if(Ya){var t=Ya;Ya=void 0,t()}Ya=e&&e.S()}function Bu(e){var t=this,r=e.data,n=$t(r);n.name="ReactiveDom",n.value=r;var o=ve(function(){for(var a=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=Se(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),p=Se(function(){return!Array.isArray(u.value)&&!ll(u.value)}),_=or(function(){if(this.N=zu,p.value){var f=u.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){_(),d.call(this)},[p,u]},[]),s=o[0],i=o[1];return s.value?i.peek():i.value}Bu.displayName="ReactiveTextNode";Object.defineProperties(wt.prototype,{constructor:{configurable:!0,value:qr(ge,null).constructor},type:{configurable:!0,value:Bu},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Un("__b",function(e,t){if(Io(),Ao=void 0,typeof t.type=="string"){var r,n=t.props;for(var o in n)if(o!=="children"){var s=n[o];s instanceof wt&&(r||(t.__np=r={}),r[o]=s,n[o]=s.peek())}}e(t)});Un("__r",function(e,t){if(e(t),t.type!==ge){Io();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=(function(o,s){var i;return or(function(){i=this},{name:s}),i.c=o,i})((function(o){return function(){var s;Ch&&((s=this.y)==null||s.call(this)),o.__$f|=1,o.setState({})}})(n),typeof t.type=="function"?t.type.displayName||t.type.name:""))),Ao=n,Io(r)}});Un("__e",function(e,t,r,n){Io(),Ao=void 0,e(t,r,n)});Un("diffed",function(e,t){Io(),Ao=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,o=t.props,s=r.U;if(s)for(var i in s){var a=s[i];a===void 0||n&&i in n||(a.d(),s[i]=void 0)}if(n){s||(s={},r.U=s);for(var c in n){var u=s[c],p=n[c];u===void 0?(u=Th(r,c,p,o),s[c]=u):u.o(p,o)}}}e(t)});function Th(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,s=se(r);return{o:function(i,a){s.value=i,n=a},d:or(function(){this.N=zu;var i=s.value.value;n[t]!==i&&(n[t]=i,o?e[t]=i:i!=null&&(i!==!1||t[4]==="-")?e.setAttribute(t,i):e.removeAttribute(t))})}}Un("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var s=n[o];s&&s.d()}}}var i=t.__np;if(i){var a=t.props;for(var c in i)a[c]=i[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)});Un("__h",function(e,t,r,n){n<3&&(t.__$f|=2),e(t,r,n)});Zt.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var r=this.__$u,n=r&&r.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var s=2&this.__$f;if(!(n||s||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function $t(e,t){return ve(function(){return se(e,t)},[])}function It(e,t){var r=B(e);return r.current=e,Ao.__$f|=4,ve(function(){return Se(function(){return r.current()},t)},[])}var Ih=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Ah(){er(function(){for(var e;e=Uu.shift();)qu.call(e)})}function zu(){Uu.push(this)===1&&(xe.requestAnimationFrame||Ih)(Ah)}var Rh="x-public-key",Eh="x-ai-agent-deployment-id";function Hu(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");return{headers(){let t={[Eh]:e.aiAgentDeploymentId};return e.publicKey&&(t[e.publicKeyHeader??Rh]=e.publicKey),t}}}function Xa(e,t){let r=[],n;for(let o of e){let s=new URLSearchParams(o);s.has(t)?n??(n=s.get(t)??""):r.push(o)}return{value:n,rest:r}}function Fu(e){let t=new URL(e),r=q.cssPrefix,n=`${q.cssPrefix}-ask`,o=t.search.slice(1).split("&").filter(Boolean),s=t.hash.slice(1).split("&").filter(Boolean),i=Xa(o,r),a=Xa(i.rest,n),c=Xa(s,r),u=Xa(c.rest,n),p=i.value??c.value,_=(a.value??u.value)?.trim()||void 0;if(!(p===void 0&&_===void 0))return t.search=a.rest.join("&"),t.hash=u.rest.join("&"),{target:p===void 0?void 0:Ea(p),..._?{ask:_}:{},url:t.toString()}}var ju=te.scope("feedback:audio"),Ja=class{constructor(){ee(this,"ctx",null);ee(this,"master",null);ee(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(r){ju.warn("AudioContext init failed",{err:r})}}setVolume(t){if(!this.master||!this.ctx)return;let r=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(r,this.ctx.currentTime,.01)}playTone(t){let r=this.ctx,n=this.master;if(!r||!n||r.state!=="running")return;let o=r.currentTime,s=t.noteMs/1e3;t.notes.forEach((i,a)=>{let c=r.createOscillator();c.type=t.type,c.frequency.value=i;let u=r.createGain(),p=o+a*s;u.gain.setValueAtTime(1e-4,p),u.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),u.gain.exponentialRampToValueAtTime(1e-4,p+s),c.connect(u).connect(n),c.start(p),c.stop(p+s+.01)})}async playUrl(t){let r=this.ctx,n=this.master;if(!r||!n||r.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let s=r.createBufferSource();s.buffer=o,s.connect(n),s.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 r=this.buffers.get(t);if(r)return r instanceof Promise,r;let n=this.ctx,o=fetch(t).then(s=>s.ok?s.arrayBuffer():Promise.reject(new Error(`fetch ${s.status}`))).then(s=>n.decodeAudioData(s)).then(s=>(this.buffers.set(t,s),s)).catch(s=>(ju.warn("audio fetch/decode failed",{url:t,err:s}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var Vu={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Wu={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 zr=null,Za=0;function Mh(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function Lh(){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=`__${q.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let r="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=r,t.style.cssText=r;for(let n of[e,t])n.addEventListener("click",o=>o.stopPropagation());return document.body.append(e,t),{input:e,label:t}}function Gu(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(Mh())try{navigator.vibrate(e);return}catch{}if(zr??(zr=Lh()),!!zr)try{zr.label.click()}catch{}}}function Ku(){Za++;let e=!1;return()=>{e||(e=!0,Za=Math.max(0,Za-1),Za===0&&zr&&(zr.input.remove(),zr.label.remove(),zr=null))}}var Nh=te.scope("feedback"),Oh=100,ei=class{constructor(t,r){ee(this,"mutedSig",se(!1));ee(this,"audio",new Ja);ee(this,"releaseHaptics");ee(this,"sound");ee(this,"haptics");ee(this,"lastPlayed",new Map);ee(this,"reducedMotionMq",null);this.sound=t,this.haptics=r,this.releaseHaptics=Ku(),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,r){this.sound=t,this.haptics=r,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 r=this.lastPlayed.get(t);return r===void 0?!1:performance.now()-r<Oh}playSound(t){let r=this.sound.events?.[t];if(r===!1)return;if(typeof r=="string"){this.audio.playUrl(r).catch(o=>Nh.warn("audio play failed",{err:o,url:r}));return}let n=Wu[t];n&&this.audio.playTone(n)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let r=this.haptics.events?.[t];if(r===!1)return;let n=r===!0||r===void 0?Vu[t]:r;Gu(n)}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 Qu(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Tl(e){return Qu(e)}function Il(e){return!(!Qu(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function ti(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 Xu(e,t){let r=encodeURIComponent(t).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return e.replaceAll("{returnTo}",r)}function Ju(e){let t=e.split(".")[1];if(t)try{let r=atob(t.replace(/-/g,"+").replace(/_/g,"/")),n=JSON.parse(new TextDecoder().decode(Uint8Array.from(r,o=>o.charCodeAt(0))));return typeof n=="object"&&n!==null&&!Array.isArray(n)?Object.fromEntries(Object.entries(n)):void 0}catch{return}}function Yu(e,t){let r=e?.[t];return typeof r=="string"&&r.trim()?{[t]:r.trim()}:{}}function Zu(e){let t=Ju(e);return{...Yu(t,"name"),...Yu(t,"email")}}function ep(e){let t=Ju(e)?.sub;return typeof t=="string"&&t!==""?t:void 0}function tp(){try{return window.top?.location.href??location.href}catch{return location.href}}function rp(e){try{(window.top??window).location.assign(e)}catch{location.assign(e)}}var $h=Symbol.for("pv"),Dh=0;function l(e,t,r,n,o,s){t||(t={});var i,a,c=t;if("ref"in c&&typeof e!="function")for(a in c={},t)a=="ref"?i=t[a]:c[a]=t[a];var u={type:e,props:c,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:$h,__v:--Dh,__i:-1,__u:0};return(o||s)&&(u.__source=o,u.__self=s),xe.vnode&&xe.vnode(u),u}var Bn=1,Ro=2,Eo=4,op=8,ap=16;function qh(e){switch(e){case Bn:return"href";case Ro:return"src";case Eo:return"class";case op:return"checked";case ap:return"start"}}var Uh=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}},Bh=Uh;var np=24;function Mo(e){let t=new Uint32Array(np);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(np),indent:"",indent_len:0,table_state:0}}function zn(e){e.pending.length>0&&it(e,`
8
- `)}function Ee(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 at(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 Ne(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&at(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function zh(e,t,r){for(;r<=e.len;){if(e.tokens[r]===t)return r;r+=1}return-1}function cn(e,t){for(e.fence_start=0;e.len>t;)at(e)}function ri(e,t){let r=0;for(let n=0;n<=e.len&&(t-=e.spaces[n],!(t<0));n+=1)switch(e.tokens[n]){case 9:case 10:case 20:case 25:r=n;break}for(;e.len>r;)at(e);return t}function Al(e,t){let r=-1,n=-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]){n=-1;break}n=o}else e.tokens[o]===t&&(r=o);return n===-1?r===-1?(cn(e,e.blockquote_idx),Ne(e,t),!0):(cn(e,r),!1):(cn(e,n),Ne(e,t),!0)}function Rl(e,t){Ne(e,25),e.spaces[e.len]=e.indent_len+t,Pr(e),e.token=103}function Pr(e){e.indent="",e.indent_len=0,e.pending=""}function El(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 Hh(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 Fh(e){return El(e)||Hh(e)}function it(e,t){for(let r of t){if(e.token===101){switch(r){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let o=ri(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],o>0&&it(e," ".repeat(o))}let n=e.pending+r;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=r;continue;case" ":console.assert(e.pending.length===1),e.pending=r,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=r,e.indent+=" ",e.indent_len+=4;continue;case`
9
- `:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){at(e),Pr(e),e.pending=r;continue}cn(e,e.blockquote_idx),Pr(e),e.blockquote_idx=0,e.fence_start=0,e.pending=r;continue;case"#":switch(r){case"#":if(e.pending.length<6){e.pending=n;continue}break;case" ":ri(e,e.indent_len),Ne(e,Bh(e.pending.length)),Pr(e);continue}break;case">":{let s=zh(e,20,e.blockquote_idx+1);s===-1?(cn(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,Ne(e,20)):e.blockquote_idx=s,Pr(e),e.pending=r;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(r){case e.hr_char:e.hr_chars+=1,e.pending=n;continue;case" ":e.pending=n;continue;case`
10
- `:if(e.hr_chars<3)break;ri(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),Pr(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Al(e,23),Rl(e,2),it(e,n.slice(2));continue}break;case"`":if(e.pending.length<3){if(r==="`"){e.pending=n,e.fence_start=n.length;continue}e.fence_start=0;break}switch(r){case"`":e.pending.length===e.fence_start?(e.pending=n,e.fence_start=n.length):(Ne(e,2),Pr(e),e.fence_start=0,it(e,n));continue;case`
11
- `:{ri(e,e.indent_len),Ne(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,Eo,e.pending.slice(e.fence_start)),Pr(e),e.token=101;continue}default:e.pending=n;continue}case"+":if(r!==" ")break;Al(e,23),Rl(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(r!==" ")break;Al(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,ap,e.pending.slice(0,-1)),Rl(e,e.pending.length+1);continue}else{let s=r.charCodeAt(0);if(s===46||El(s)){e.pending=n;continue}}break;case"|":cn(e,e.blockquote_idx),Ne(e,27),Ne(e,28),e.pending="",it(e,r);continue}let o=n;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 s=0;for(;s<4;s+=1)if(e.indent[s]===" "){s=s+1;break}o=e.indent.slice(s)+n,Ne(e,9)}else Ne(e,2);Pr(e),it(e,o);continue;case 27:if(e.table_state===1)switch(r){case"-":case" ":case"|":case":":e.pending=n;continue;case`
12
- `:e.table_state=2,e.pending="";continue;default:at(e),e.table_state=0;break}else switch(e.pending){case"|":Ne(e,28),e.pending="",it(e,r);continue;case`
13
- `:at(e),e.pending="",e.table_state=0,it(e,r);continue}break;case 28:switch(e.pending){case"":break;case"|":Ne(e,29),at(e),e.pending="",it(e,r);continue;case`
14
- `:at(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",it(e,r);continue;default:Ne(e,29),it(e,r);continue}break;case 29:if(e.pending==="|"){Ee(e),at(e),e.pending="",it(e,r);continue}break;case 9:switch(n){case`
1
+ "use strict";(()=>{var Dg=Object.defineProperty;var qg=(e,t,r)=>t in e?Dg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ee=(e,t,r)=>qg(e,typeof t!="symbol"?t+"":t,r);var D={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 Ug=["en","fr","es","ar","he","zh"];function id(e){let t=e?.split("-")[0]?.toLowerCase();return Ug.find(r=>r===t)??"en"}function As(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Is(e){return As(e)?e.id??e.key:void 0}function Rs(e,t){return As(e)&&As(t)?Object.fromEntries([...new Set([...Object.keys(e),...Object.keys(t)])].map(r=>[r,Rs(e[r],t[r])])):Array.isArray(e)&&Array.isArray(t)&&t.length>0&&t.every(r=>Is(r)!==void 0)?e.map(r=>Rs(r,t.find(n=>Is(n)===Is(r)))):t==null||typeof t=="string"&&!t.trim()?e:t}function Yr(e,t){let r=t?.toLowerCase(),n=r?.split("-")[0],o=e.translations??[],s=o.find(c=>c.locale.toLowerCase()===r)??o.find(c=>c.locale.toLowerCase().split("-")[0]===n);if(!s)return e;let{locale:a,...i}=s;return Rs(e,i)}var Pi={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",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:"Approved by the visitor",decidedVisitorDeclined:"Declined by the visitor",decidedTeamApproved:"Approved by a team member",decidedTeamDeclined:"Declined by a team member",decidedRulesApproved:"Approved automatically",decidedRulesDeclined:"Declined automatically",edit:"Edit",statusError:"Error",toolStepsFailed:"{count} failed",statusStopped:"Stopped",toolStepsStopped:"Stopped after {count} steps",toolStepsStoppedOne:"Stopped after 1 step"},Bg={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",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",decidedRulesApproved:"Approuv\xE9 automatiquement",decidedRulesDeclined:"Refus\xE9 automatiquement",edit:"Modifier",statusError:"Erreur",toolStepsFailed:"{count} en \xE9chec",statusStopped:"Arr\xEAt\xE9",toolStepsStopped:"Arr\xEAt\xE9 apr\xE8s {count} \xE9tapes",toolStepsStoppedOne:"Arr\xEAt\xE9 apr\xE8s 1 \xE9tape"},zg={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",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",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",statusError:"\u062E\u0637\u0623",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"},Hg={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",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:"Aprobado por el visitante",decidedVisitorDeclined:"Rechazado por el visitante",decidedTeamApproved:"Aprobado por un miembro del equipo",decidedTeamDeclined:"Rechazado por un miembro del equipo",decidedRulesApproved:"Aprobado autom\xE1ticamente",decidedRulesDeclined:"Rechazado autom\xE1ticamente",edit:"Editar",statusError:"Error",toolStepsFailed:"{count} con error",statusStopped:"Detenido",toolStepsStopped:"Detenido tras {count} pasos",toolStepsStoppedOne:"Detenido tras 1 paso"},Fg={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",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",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",statusError:"\u05E9\u05D2\u05D9\u05D0\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"},jg={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",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",decidedRulesApproved:"\u5DF2\u81EA\u52A8\u6279\u51C6",decidedRulesDeclined:"\u5DF2\u81EA\u52A8\u62D2\u7EDD",edit:"\u7F16\u8F91",statusError:"\u9519\u8BEF",toolStepsFailed:"{count} \u4E2A\u5931\u8D25",statusStopped:"\u5DF2\u505C\u6B62",toolStepsStopped:"\u5728 {count} \u6B65\u540E\u505C\u6B62",toolStepsStoppedOne:"\u5728 1 \u6B65\u540E\u505C\u6B62"},Vg={en:Pi,fr:Bg,es:Hg,ar:zg,he:Fg,zh:jg};function xi(e,t){let r=ad(e),n=wi(t),o=Vg[id(r)],s=n?{...t[r],...t[e]}:t??{},a=n?t.en??{}:{};return{...Pi,...o,...a,...s}}function ad(e){return(e.split("-")[0]??"en").toLowerCase()}var Wg=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function Si(e){return Wg.has(ad(e))}function gt(e,t){return e[t]??t}function wi(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}var Ci={simple:{showSteps:!1,showStepDetails:!1,showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},technical:{showSteps:!0,showStepDetails:!0,showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}};function ld(e){return Object.hasOwn(Ci,e)}function cd(e,t){return{...Ci[t],...e}}var dd=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Gg=4e3;function Es(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 Kg(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,""),r=t.indexOf("__");return Es(r>0?t.slice(r+2):t)}function Qg(e,t){let r=e.approval;return r?.replacedByMessageId?"replaced":e.state==="output-available"?"done":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 Yg(e,t){if(e.isAutomatic)return"rules";let r=e.respondedBy;return r?.visitorId?"visitor":r?.userId?r.userId===t.userId?"you":"teamMember":t.decides?"you":"visitor"}var Jg={you:["decidedYouApproved","decidedYouDeclined"],visitor:["decidedVisitorApproved","decidedVisitorDeclined"],teamMember:["decidedTeamApproved","decidedTeamDeclined"],rules:["decidedRulesApproved","decidedRulesDeclined"]};function Xg(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.strings.stepDeclined;case"replaced":return t.strings.stepReplaced;case"stopped":return t.strings.statusStopped;case"failed":return t.display.showStepDetails?t.strings.stepFailed:t.strings.stepDidNotWork;case"done":return"";default:return e}}function co(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ud(e){return typeof e=="string"?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):""}function sd(e){return ud(e)||(e!==null&&typeof e=="object"?JSON.stringify(e):"")}function Zg(e){if(!co(e))return sd(e);let[t,...r]=Object.values(e).map(sd).filter(Boolean);return t===void 0?"":r.length>0?`${t} (${r.join(", ")})`:t}function ev(e,t){if(!co(e))return[];let r=[];function n(s,a){if(Array.isArray(s)){let c=s.map(Zg).filter(Boolean).join(", ");c&&r.push({path:a,value:c});return}if(co(s)){for(let[c,u]of Object.entries(s))n(u,[...a,c]);return}let i=ud(s);i&&(t.withIds||!dd.test(i))&&r.push({path:a,value:i})}n(e,[]);let o=r.map(({path:s})=>Es(s.at(-1)??""));return r.map(({path:s,value:a},i)=>{let c=o[i]??"";return{label:o.filter(p=>p===c).length>1&&s.length>1?`${Es(s.at(-2)??"")} \xB7 ${c.toLowerCase()}`:c,value:a}})}function tv(e){if(co(e))return Object.values(e).find(t=>typeof t=="string"&&t.trim().length>0&&!dd.test(t.trim()))?.trim()}function ki(e,t=Number.POSITIVE_INFINITY){if(e==null)return;let r=typeof e=="string"?e:JSON.stringify(e,null,2);if(!(!r||r==="{}"||r==="[]"||r==='""'))return r.length>t?`${r.slice(0,t)}\u2026`:r}function pd(e){return co(e)&&e.storage==="tool-result-ref"&&"summary"in e?e.summary:e}function rv(e){return ki(e.input)!==void 0||ki(pd(e.output))!==void 0||!!e.errorText}function nv(e,t,r){let{display:n}=r,o=e.approval;if(typeof e.toolMetadata?.card=="string"&&o)return"card";let s=o!==void 0&&!o.isAutomatic;if(s&&Ms(e,r.turn))return"card";let a=t.decision?.by==="you"||s&&t.decision===void 0&&r.reader.decides;return s&&a?n.foldApprovals?"step":"card":s?n.showSteps||n.showDecidedBy?n.foldApprovals?"step":"card":"hidden":o?.isAutomatic?n.showSteps||n.showDecidedBy?"step":"hidden":n.showSteps&&rv(e)?"step":"hidden"}function Ms(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 _d(e,t){let{turn:r,reader:n,display:o,strings:s}=t,a=Qg(e,r),i=e.approval,c=i?.replacedByMessageId?void 0:i?.approved,u=i&&c!==void 0?Yg(i,n):void 0,p=u&&c!==void 0&&(u==="you"||o.showDecidedBy)?{approved:c,by:u,label:s[Jg[u][c?0:1]]}:void 0,_=Kg(e),d=typeof e.toolMetadata?.system=="string"&&o.showStepSystem?e.toolMetadata.system:void 0,f=tv(e.input),v=pd(e.output),g=o.showStepDetails?{input:ki(e.input),output:ki(v,Gg),error:e.errorText}:void 0,y=i!==void 0&&!i.isAutomatic&&!e.toolMetadata?.card,b={toolCallId:e.toolCallId,placement:"hidden",...typeof e.toolMetadata?.card=="string"&&i?{card:e.toolMetadata.card}:{},name:_,...d?{system:d}:{},status:a,statusLabel:Xg(a,{reader:n,display:o,strings:s}),...p?{decision:p}:{},...p?.by==="rules"&&i?.reason?{reason:i.reason}:{},...f?{summary:f}:{},fields:ev(e.input,{withIds:o.showStepDetails||i!==void 0&&!i.isAutomatic&&Ms(e,r)}),...g?{raw:g}:{},...y?{approval:ov(e,a,{turn:r,reader:n,strings:s,name:_})}:{}};return{...b,placement:nv(e,b,{turn:r,reader:n,display:o})}}function ov(e,t,r){let n=r.strings.approvalPrompt.replace("{action}",r.name);return t==="waiting"?{ask:n,buttons:r.reader.decides?"decide":"none"}:t==="submitted"?{ask:n,buttons:"none"}:Ms(e,r.turn)?r.turn.canAct&&r.reader.decides?{ask:n,buttons:"change",note:r.strings.approvalEditHint}:t==="approved"?{ask:n,buttons:"none",note:r.strings.stepWorkingOnIt}:{ask:n,buttons:"none"}:{ask:n,buttons:"none"}}function fd(e){let t=new Map;for(let s of e)t.set(s.name,(t.get(s.name)??0)+1);let r=new Map;for(let{decision:s}of e){if(!s)continue;let a=r.get(s.label)??{approved:s.approved,label:s.label,count:0};r.set(s.label,{...a,count:a.count+1})}let[n]=e,o=e.some(s=>s.status==="stopped");return{tools:[...t].map(([s,a])=>({name:s,count:a})),...e.length===1&&n?{single:{name:n.name,...n.summary?{summary:n.summary}:{},...iv(n)}}:{},marks:[...r.values()].map(({approved:s,label:a,count:i})=>({approved:s,label:i>1?`${a} \xD7${i}`:a})),failed:e.filter(s=>s.status==="failed").length,...o?{stopped:{finished:e.filter(s=>s.status!=="stopped").length}}:{}}}function iv(e){return!e.decision&&(e.status==="replaced"||e.status==="declined")?{outcome:e.statusLabel}:{}}function md(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace("{count}",String(e))}var Ls=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,r){try{localStorage.setItem(t,r)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},Ti=new Ls,Jr={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 Ii={maxBytes:10485760,maxCount:10,accept:"*/*"},gd={voice:"local"},Ns={enabled:!0,sampleRate:1},Os={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio"},An={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},vd={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"]},$s={enabled:!0,volume:.3,events:void 0},hd={enabled:!0,events:void 0},yd=[{label:"tabConversations",layout:"chat"}];var Us=["off","error","warn","info","debug","trace"],Bs=D.cssPrefix,bd=`${Bs}.debug`,av=`__${D.global}_DEBUG__`,sv=`${Bs}-debug`,Ai=2,Ds=null;function lv(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(sv);if(e!==null){let t=qs(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(bd);if(e){let t=qs(e);if(t>=0)return t}}catch{}return Reflect.get(window,av)?4:2}function qs(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=Us.findIndex(r=>r===e);if(t>=0)return t}return-1}function Rn(e){let t=qs(e);if(!(t<0)){Ai=t;try{window.localStorage?.setItem(bd,Us[t]??"off")}catch{}}}function uo(){return Us[Ai]??"warn"}Ai=lv();function Pd(e){let t=`[${Bs}:${e}]`;function r(n,o,s){return(a,i)=>{if(!(Ai<n)&&(i===void 0?console[o](t,a):console[o](t,a,i),Ds))try{Ds({level:s,scope:e,message:a,payload:i})}catch{}}}return{error:r(1,"error","error"),warn:r(2,"warn","warn"),info:r(3,"info","info"),debug:r(4,"debug","debug"),trace:r(5,"debug","trace"),scope:n=>Pd(`${e}:${n}`)}}var te=Pd("core");function po(e){Ds=e}var Xr=te.scope("context"),cv=new Set(["visitorId","conversationId","jwt","token","authorization","password"]),xd=50,zs=1024,dv=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Hs(e){return Sd(e,"userContext",!0)}function Fs(e){return Sd(e,"pageContext",!1)}function uv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Sd(e,t,r){if(e==null)return;if(!uv(e)){Xr.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let n={},o=0;for(let[s,a]of Object.entries(e)){if(cv.has(s)){Xr.warn(`dropped reserved ${t} key "${s}" \u2014 managed by the widget, not host-settable`);continue}if(a==null)continue;if(o>=xd){Xr.warn(`${t} truncated at ${xd} keys \u2014 dropped "${s}"`);continue}let i=pv(t,s,a);i!==void 0&&(n[s]=i,o++)}return r&&typeof n.email=="string"&&!dv.test(n.email)&&(Xr.warn("dropped malformed context field",{field:`${t}.email`,reason:"invalid format"}),delete n.email),Object.keys(n).length>0?n:void 0}function pv(e,t,r){if(typeof r=="boolean")return r;if(typeof r=="number"){if(!Number.isFinite(r)){Xr.warn(`dropped non-finite ${e}.${t}`);return}return r}if(typeof r=="string"){let n=r.trim();return n===""?void 0:n.length>zs?(Xr.warn(`truncated ${e}.${t} to ${zs} chars`),n.slice(0,zs)):n}Xr.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof r})}function Ar(e){let t=e!==null&&typeof e=="object"?e:{},r=t.presentation??{},n=t.behavior??{},o=t.i18n??{},s=t.feedback??{},a=t.footer??{},i=t.header??{},c={enabled:t.history?.enabled??!0},{themeMode:u,themeOverrides:p}=_v(t.theme),_=r.mode??"floating",d=fv(o.defaultLocale),f=o.availableLocales??[o.locale??d],v=En(o.locale??d,f,d),g=(t.baseUrl??D.defaultBaseUrl).replace(/\/$/,""),y=(t.agentApiBaseUrl??`${g}/api/agent`).replace(/\/$/,""),b=(t.dataApiBaseUrl??`${g}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:g,agentApiBaseUrl:y,dataApiBaseUrl:b,userContext:Hs(t.userContext),pageContext:Fs(t.pageContext),position:r.position??(Si(v)?"bottom-left":"bottom-right"),themeMode:u,textSize:"normal",themeOverrides:p,mode:_,responseMode:n.responseMode??"streaming",showReasoning:n.showReasoning??!1,stepDisplay:cd(n.stepDisplay,"simple"),showSources:n.showSources??!1,enableMessageFeedback:!(n.disableMessageFeedback??!1),autoSendSuggestions:n.autoSendSuggestions??!1,cardAnswerWaitSeconds:n.cardAnswerWaitSeconds??60,popOutUrl:n.popOutUrl,features:{voice:t.features?.voice??gd.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??Os.upload,transcribe:t.endpoints?.transcribe??Os.transcribe},attachments:{accept:t.composer?.attachments?.accept??Ii.accept,maxBytes:t.composer?.attachments?.maxBytes??Ii.maxBytes,maxCount:t.composer?.attachments?.maxCount??Ii.maxCount},locale:v,defaultLocale:d,availableLocales:f,startMinimized:n.startMinimized??!0,actions:mv(_,i.actions,c.enabled),size:{...r.size,resize:{...r.size?.resize,enabled:r.size?.resize?.enabled??!0}},launcher:xv(t.launcher,t.agent?.name),sound:gv(s.sound),haptics:vv(s.haptics),strings:xi(v,o.strings),stringsOverride:o.strings,composerDisclaimer:a.composerDisclaimer??"",header:{variant:i.variant??"plain",notice:i.notice,showNotice:!(i.hideNotice??!1)},poweredBy:yv(a.poweredBy),composer:bv(t.composer),modules:Pv(t.modules,c.enabled),tracking:hv(t.tracking,b),history:c,storage:t.storage??Ti,userToken:t.userToken,continueLink:t.continueLink,tools:t.tools,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function _v(e){if(typeof e=="string")return{themeMode:e,themeOverrides:{}};if(!e||typeof e!="object")return{themeMode:"host",themeOverrides:{}};let{mode:t,...r}=e;return{themeMode:t??"host",themeOverrides:r}}function fv(e){return e&&e!=="auto"?e:globalThis.navigator?.language||"en"}function En(e,t,r){if(t.length<=1||t.includes(e))return e;let n=e.split("-")[0];return n&&t.includes(n)?n:t.includes(r)?r:t[0]??e}function mv(e,t,r){let n=t??vd[e];return r?n:n.filter(o=>o!=="history")}function gv(e){return{enabled:e?.enabled??$s.enabled,volume:e?.volume??$s.volume,events:e?.events}}function vv(e){return{enabled:e?.enabled??hd.enabled,events:e?.events}}function hv(e,t){let r=e?.sampleRate??Ns.sampleRate;return{enabled:e?.enabled??Ns.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(r)?r:1)),token:e?.token}}function yv(e){return e?.text===""&&!e.logoUrl?null:{href:D.siteUrl,...e}}function bv(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Pv(e,t){let r=(e??yd).slice(0,4),n=r.some(i=>i?.label&&i.layout==="help"),o=new Set,s=[];for(let i of r){if(!i?.label||!i?.layout)continue;let c=i.contentCollectionIds?.filter(Boolean),u=i.id??c?.[0]??i.layout;for(;o.has(u);)u=`${u}-${s.length}`;o.add(u);let p={id:u,label:i.label,layout:i.layout};c?.length&&(p.contentCollectionIds=c),i.layout==="home"&&(p.brandName=i.brandName,p.greetingText=i.greetingText,p.showGreeting=!(i.hideGreeting??!1),p.showSearchBar=n&&!(i.hideSearchBar??!1),p.showRecentConversations=t&&!(i.hideRecentConversations??!1),i.userAvatars?.length&&(p.userAvatars=i.userAvatars),i.status&&(p.status=i.status),p.contentBlockTitle=i.contentBlockTitle),s.push(p)}let a=Object.fromEntries(s.map(i=>[i.id,i]));return{list:s,byId:a}}function xv(e,t){let r=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??An.variant,size:e?.size??An.size,label:e?.label??An.label,icon:e?.icon??An.icon,hidden:e?.hidden??An.hidden,...t&&{personaName:t},callout:r}}function _o(e,t){return e==="host"?"host":t??e}function js(e,t,r,n){let o=En(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&r===e.themeMode&&n===e.textSize)return e;let s={...e};return o!==e.locale&&(s.locale=o,s.strings=xi(o,e.stringsOverride)),r!==e.themeMode&&(s.themeMode=r),n!==e.textSize&&(s.textSize=n),s}function Ri(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Sv=["agent","presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints","history"];function Vs(e,t){if(!t)return e;let r={...e};for(let s of Sv){let a=t[s];if(a===void 0)continue;let i=e[s];if(s==="theme"){i===void 0?r[s]=a:typeof i=="string"&&typeof a=="object"&&a!==null&&(r[s]={...a,mode:i});continue}s!=="i18n"&&(r[s]=wd(Ri(a)?a:{},Ri(i)?i:void 0))}t.modules!==void 0&&e.modules===void 0&&(r.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(r.dataApiBaseUrl=t.dataApiBaseUrl);let n=e.i18n,o=t.i18n;if(n||o){let s=wd(Ri(o)?o:{},Ri(n)?n:void 0);o?.availableLocales!==void 0&&(s.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(s.defaultLocale=o.defaultLocale);let a=n?.strings,i=o?.strings;(a||i)&&(s.strings=wv(i,a)),r.i18n=s}return r}function wd(e,t){if(!t)return e;let r={...e};for(let[n,o]of Object.entries(t))o!==void 0&&(r[n]=o);return r}function wv(e,t){if(!e)return t;if(!t)return e;let r=wi(e),n=wi(t);if(!r&&!n)return{...e,...t};let o={},s=r?e:{en:e},a=n?t:{en:t};for(let[i,c]of Object.entries(s))o[i]={...c};for(let[i,c]of Object.entries(a))o[i]={...o[i],...c};return o}var kv=["clear","expand","fullscreen","popOut","sound","history","language","theme","textSize","close"];function Cv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rr(e){return e!=="false"}function Tv(e){return ld(e)?Ci[e]:void 0}function Iv(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function Av(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}var Cd=[["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]],Td=[["mode","mode",e=>e],["position","position",e=>e]],Id=[["width","width"],["height","height"]],Ad=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",Rr],["show-reasoning","showReasoning",Rr],["step-display","stepDisplay",Tv],["show-sources","showSources",Rr],["disable-message-feedback","disableMessageFeedback",Rr],["auto-send-suggestions","autoSendSuggestions",Rr],["card-answer-wait-seconds","cardAnswerWaitSeconds",Iv],["pop-out-url","popOutUrl"]],Rd=[["locale","locale"]],Rv=new Set(kv);function Ev(e){return Av(e).filter(t=>Rv.has(t))}var Ed=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",Rr]],Md=[["features-disable-file-upload","disableFileUpload",Rr],["features-disable-email-transcript","disableEmailTranscript",Rr],["features-voice","voice",e=>e]],Ld=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Nd=[["user-id","id"],["user-email","email"],["user-name","name"]],Od=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Mv=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],Lv=[Cd,Td,Id,Ad,Rd,Ed,Md,Ld,Nd,Od],Nv=new Set(["start-minimized"]),Ws=[...Lv.flatMap(e=>e.map(([t])=>t).filter(t=>!Nv.has(t))),...Mv];function Ei(e){let t={};function r(f){let v=e(f);return v===null||v===""?void 0:v}for(let[f,v,g]of Cd){let y=r(f);y!==void 0&&Reflect.set(t,v,g?g(y):y)}let n=Zr(r,Td),o=Zr(r,Id);(n||o)&&(t.presentation={...n,...o?{size:o}:{}});let s=Zr(r,Ad);s&&(t.behavior=s);let a=Zr(r,Rd);a&&(t.i18n=a);let i=$v(e,r);i&&(t.launcher=i);let c=Zr(r,Md);c&&(t.features=c);let u=Zr(r,Ld);u&&(t.endpoints=u);let p=kd(r,Nd,"user-context");p&&(t.userContext=p);let _=kd(r,Od,"page-context");_&&(t.pageContext=_);let d=r("actions");return d!==void 0&&(t.header={actions:Ev(d)}),t}function Gs(e){return e?Ei(t=>e[Ov(t==="data-api-base-url"?"api-base-url":t)]??null):{}}function Ov(e){return e.replaceAll(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Zr(e,t){let r={};for(let[n,o,s]of t){let a=e(n);a!==void 0&&Reflect.set(r,o,s?s(a):a)}return Object.keys(r).length>0?r:null}function kd(e,t,r){let n={};for(let[i,c]of t){let u=e(i);u!==void 0&&(n[c]=u)}let o={},s=e(r);if(s)try{let i=JSON.parse(s);if(Cv(i))for(let[c,u]of Object.entries(i))(typeof u=="string"||typeof u=="number"||typeof u=="boolean")&&(o[c]=u)}catch{}let a={...o,...n};return Object.keys(a).length>0?a:null}function $v(e,t){let r=Zr(t,Ed)??{},n=e("launcher-label");n!==null&&(r.label=n);let o=t("callout-text");if(o){let s=Number.parseInt(t("callout-delay")??"",10);r.callout={text:o,...Number.isFinite(s)?{delayMs:s}:{}}}return Object.keys(r).length>0?r:null}var Dv=te.scope("events"),Er={open:!1,ready:!1,unread:0},Mn=class{constructor(){ee(this,"handlers",new Map);ee(this,"taps",new Set)}on(t,r){let n=this.handlers.get(t);return n||(n=new Set,this.handlers.set(t,n)),n.add(r),()=>this.handlers.get(t)?.delete(r)}tap(t){return this.taps.add(t),()=>this.taps.delete(t)}listensTo(t){return(this.handlers.get(t)?.size??0)>0||[...this.taps].some(r=>r.listensTo(t))}emit(t,r){for(let n of this.handlers.get(t)??[])try{n(r)}catch(o){Dv.warn("listener threw",{event:t,error:o})}for(let n of this.taps)n.hear(t,r)}clear(){this.handlers.clear(),this.taps.clear()}};var qv=te.scope("hooks"),Ks="*";function Qs(e){return typeof e=="function"}var Mi=new Set;function fo(e,t,r){let n={widgetId:e,event:t,listener:r};return Mi.add(n),()=>{Mi.delete(n)}}function Uv(e,t,r){let n=[...Mi];for(let o of n)if(Dd(o.widgetId,e.widgetId)&&!(o.event!==Ks&&o.event!==t))try{o.listener(e,t,r)}catch(s){qv.warn("hook listener threw",{event:t,error:s})}}function $d(e,t){return t.tap({hear:(r,n)=>Uv(e,r,n),listensTo:r=>[...Mi].some(n=>n.event===r&&Dd(n.widgetId,e.widgetId))})}function Ys(e){if(Array.isArray(e))for(let t of e){let r=Bv(t);r&&fo(r.widgetId,r.event,r.listener)}}function Dd(e,t){return e===Ks||e===t}function Bv(e){let t,r,n;if(Array.isArray(e))[t,r,n]=e;else if(zv(e))({widgetId:t,event:r,listener:n}=e);else return null;return typeof t!="string"||typeof r!="string"||!Qs(n)?null:{widgetId:t,event:r,listener:n}}function zv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Hv=new Set(["home","chats","help","news"]);function qd(e){return typeof e!="object"||e===null||!("to"in e)||typeof e.to!="string"||!Hv.has(e.to)?!1:!("id"in e)||e.id===void 0||typeof e.id=="string"}function Li(e){let[t="",...r]=e.trim().split("/");if(t===""||t==="open")return;let n=r.join("/");return n?{to:t,id:n}:{to:t}}function vr(e,t){return{text:e,send:typeof t=="object"&&t!==null&&"send"in t&&t.send===!0}}function Ud(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 Bd(e){return`${D.cssPrefix}:${e}`}function Nt(e,t,r){e.dispatchEvent(new CustomEvent(Bd(t),{detail:r}))}function zd(e,t){let r=Object.keys(t).filter(n=>Object.hasOwn(t,n)).map(n=>{let o=t[n],s=Bd(n);function a(i){return o(i instanceof CustomEvent?i.detail:void 0)}return e.addEventListener(s,a),[s,a]});return()=>{for(let[n,o]of r)e.removeEventListener(n,o)}}var Hd=te.scope("track"),Fv=64,jv=256,Vv=10;function Ln(e,t){let r=typeof e=="string"?e.trim():"";if(!r||r.length>Fv){Hd.warn("track: ignored an event without a name of 1\u201364 characters",{name:e});return}let n=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(n).length>jv?(Hd.warn("track: sent the event without its data, which is over 256 characters",{name:r}),{name:r}):Object.keys(n).length>0?{name:r,data:n}:{name:r}}function Fd(e){let t=[];return e.on("hostEvent",r=>{t.push({...r,at:Date.now()}),t.length>Vv&&t.shift()}),t}var Wv=new Set(["hidden","submit","button","reset","image","file","password"]);function Vd(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Gv(e){return!Vd(e)||e.name===""||e.disabled?!1:!(e instanceof HTMLInputElement&&Wv.has(e.type))}function Kv(e){let t=e.labels?.[0]?.textContent?.trim();return e.getAttribute("toolparamdescription")??(t||e.getAttribute("aria-description"))??void 0}function Qv(e,t){let r=Kv(e),n=r?{description:r}:{};return e instanceof HTMLSelectElement?{...n,type:"string",enum:[...e.options].map(o=>o.value)}:e instanceof HTMLTextAreaElement?{...n,type:"string"}:e.type==="checkbox"?{...n,type:"boolean"}:e.type==="radio"?{...n,type:"string",enum:t}:e.type==="number"||e.type==="range"?{...n,type:"number"}:{...n,type:"string"}}function Yv(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 jd(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e)}function Jv(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===jd(t)&&!e.checked&&e.click();return}Yv(e,jd(t))}function Xv(e,t,r){var a;let n=[...e.elements].filter(Gv),o={},s=new Set;for(let i of n){let c=n.flatMap(u=>u instanceof HTMLInputElement&&u.type==="radio"&&u.name===i.name?[u.value]:[]);o[a=i.name]??(o[a]=Qv(i,c)),i.required&&s.add(i.name)}return{name:t,description:r,inputSchema:{type:"object",properties:o,...s.size>0?{required:[...s]}:{}},execute(i){let c=typeof i=="object"&&i!==null?Object.entries(i):[];for(let[p,_]of c)for(let d of n)d.name===p&&Jv(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=>Vd(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 Wd(){return[...document.querySelectorAll("form[toolname][tooldescription]")].flatMap(e=>{let t=e.getAttribute("toolname")?.trim()??"",r=e.getAttribute("tooldescription")?.trim()??"";return t&&r?[Xv(e,t,r)]:[]})}var Gd=`${D.cssPrefix}.page-tools`,Zv=20,eh=50;function Ni(e){return typeof e=="object"&&e!==null}function th(e){return Ni(e)&&(e.state==="running"||e.state==="stopped"||e.state==="finished"&&Ni(e.outcome))}function rh(e){let t=e?JSON.parse(e):void 0;if(!Ni(t))return{sent:[],calls:{}};let r=Array.isArray(t.sent)?t.sent.filter(o=>typeof o=="string"):[],n=Object.fromEntries(Object.entries(Ni(t.calls)?t.calls:{}).filter(o=>th(o[1])));return{sent:r,calls:n}}var Xs={sent:[],calls:{}};function mo(){try{Xs=rh(sessionStorage.getItem(Gd))}catch{}return Xs}function Js(e){Xs=e;try{sessionStorage.setItem(Gd,JSON.stringify(e))}catch{}}var Ot={markSent(e){let t=mo();Js({...t,sent:[...t.sent.filter(r=>r!==e),e].slice(-Zv)})},sentHere(e){return mo().sent.includes(e)},get(e){return mo().calls[e]},set(e,t){let r=mo(),n=Object.entries(r.calls).filter(([o])=>o!==e);Js({...r,calls:Object.fromEntries([...n,[e,t]].slice(-eh))})},clear(e){let t=mo();e.some(r=>r in t.calls)&&Js({...t,calls:Object.fromEntries(Object.entries(t.calls).filter(([r])=>!e.includes(r)))})}};function en(e,t){return new Promise(r=>{if(t?.aborted)return r();let n=setTimeout(s,e);function o(){return s()}t?.addEventListener("abort",o,{once:!0});function s(){clearTimeout(n),t?.removeEventListener("abort",o),r()}})}var tl=te.scope("page-tools"),Kd="site__",Qd=3e4,nh=1e3,Yd=Symbol.for(`${D.cssPrefix}.page-tools`),el={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."},Xd="The visitor stopped this before it finished.";function Mr(e){return typeof e=="object"&&e!==null}function oh(e){return Mr(e)&&Array.isArray(e.registered)&&e.runs instanceof Map}function go(){let e=Reflect.get(globalThis,Yd);if(oh(e))return e;let t={registered:[],runs:new Map};return Reflect.set(globalThis,Yd,t),t}function tn(e,t){let r=Mr(t)&&t.signal instanceof AbortSignal?t.signal:void 0;if(r?.aborted)return;let n=go().registered;n.push(e);function o(){let s=n.indexOf(e);s>=0&&n.splice(s,1)}r?.addEventListener("abort",o,{once:!0})}function Jd(e){return e.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,58)}function Zd(e){if(!Mr(e)||typeof e.name!="string"||!Jd(e.name))return;let t=typeof e.title=="string"&&e.title.trim()!==""?e.title.trim().slice(0,120):void 0,r=[e.description,t].find(o=>typeof o=="string"&&o.trim()!=="")??e.name,n=e.preview;return{name:Jd(e.name),...t?{title:t}:{},...typeof n=="function"?{preview:o=>Reflect.apply(n,e,[o])}:{},description:r.trim().slice(0,1024),inputSchema:{properties:{},...Mr(e.inputSchema)?e.inputSchema:{},type:"object"},consequential:Mr(e.annotations)&&e.annotations.consequentialHint===!0}}function Zs(e){return e.flatMap(t=>{let r=Zd(t),n=Mr(t)?t.execute:void 0;return!r||typeof n!="function"?(tl.warn("skipped a tool without a name or an execute function",t),[]):[{...r,run:(o,s)=>Reflect.apply(n,t,[o,{signal:s}])}]})}async function ih(){let e=Reflect.get(document,"modelContext")??Reflect.get(navigator,"modelContext");if(!Mr(e)||typeof e.getTools!="function"||typeof e.executeTool!="function")return[];let t=e.getTools,r=e.executeTool,n=await Promise.race([Promise.resolve().then(()=>Reflect.apply(t,e,[])),en(nh).then(()=>[])]).catch(()=>[]);return(Array.isArray(n)?n:[]).flatMap(o=>{let s=Zd(o);return s?[{...s,run:(a,i)=>Reflect.apply(r,e,[o,a,{signal:i}])}]:[]})}async function vo(e=[]){let t=Zs(Wd()),r=new Set(t.map(s=>s.name)),o=[...(await ih()).filter(s=>!r.has(s.name)),...t,...Zs(e),...Zs(go().registered)];return new Map(o.map(s=>[s.name,s]))}function rl(e){return[...e.values()].map(({name:t,title:r,description:n,inputSchema:o,consequential:s})=>{let a={name:t,description:n,inputSchema:o};return r&&(a.title=r),s&&(a.annotations={consequentialHint:!0}),a})}function rn(e){return e?.execution==="client"}function Nn(e){return e.startsWith(Kd)?e.slice(Kd.length):e}function ah(e){if(e===void 0||typeof e=="function"||typeof e=="symbol")return null;let t=new WeakSet,r=JSON.stringify(e,(n,o)=>{if(typeof o=="bigint")return o.toString();if(!(typeof o=="function"||typeof o=="symbol"))return o instanceof Node?`[${o.nodeName.toLowerCase()}]`:Mr(o)?t.has(o)?"[circular]":(t.add(o),o):o});return r.length>Qd?{truncated:!0,preview:r.slice(0,Qd)}:JSON.parse(r)}async function eu(e){let t=(await vo(e.optionTools)).get(Nn(e.toolName));if(!t?.preview)return;let r=t.preview;return Promise.resolve().then(()=>r(e.input)).catch(n=>{tl.warn("a page tool preview failed",{name:t.name,error:n})})}async function sh(e){let t=Nn(e.toolName),r=(await vo(e.optionTools)).get(t);return r?Promise.resolve().then(()=>r.run(e.input,e.signal)).then(n=>({state:"output-available",output:ah(n)})).catch(n=>(tl.warn("a page tool failed",{name:t,error:n}),{state:"output-error",errorText:(n instanceof Error?n.message:String(n)).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 tu(e){let{toolCallId:t}=e,r=Ot.get(t);if(r?.state==="finished")return Promise.resolve(r.outcome);let{runs:n}=go(),o=n.get(t);if(o)return o.outcome;if(r?.state==="running")return Ot.set(t,{state:"finished",outcome:el}),e.onSettled("interrupted",0),Promise.resolve(el);let s=new AbortController,a=performance.now();Ot.set(t,{state:"running"});let i=sh({...e,signal:s.signal}).then(c=>(n.delete(t),Ot.get(t)?.state!=="running"||(Ot.set(t,{state:"finished",outcome:c}),e.onSettled(c.state==="output-available"?"completed":"failed",Math.round(performance.now()-a))),c));return n.set(t,{outcome:i,controller:s}),i}function ru(e){return e===el.errorText||e===Xd}function nl(e){return Ot.set(e,{state:"stopped"}),go().runs.get(e)?.controller.abort(),Xd}function nu(e){Ot.clear([e]),go().runs.get(e)?.controller.abort()}var xe,au,al,Lr,ol,qi,su,$i,lu,sl,il,lh,yo=Symbol.for("pv"),Ui={},Bi=[],ch=/^m(i|n|o|s|text|space)$/,zi=Array.isArray,ll=Bi.slice,on=Object.assign;function nn(e){e&&e.parentNode&&e.remove()}function Or(e,t,r){var n,o,s,a={},i=arguments.length;for(s in t)s=="key"?n=t[s]:s=="ref"&&typeof e!="function"?o=t[s]:a[s]=t[s];return i>2&&(a.children=i>3?ll.call(arguments,2):r),ho(e,a,n,o,null)}function ho(e,t,r,n,o){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:yo,__v:o||++au,__i:-1,__u:0};return!o&&xe.vnode&&xe.vnode(s),s}function ve(e){return e.children}function Xt(e,t){this.props=e,this.context=t,this.__g=0}function Nr(e,t){if(t==null)return e.__&&Nr(e.__,e.__i+1);for(var r;t<e.__k.length;t++)if((r=e.__k[t])&&r.__e)return r.__e;return typeof e.type!="function"||e.props.__P?null:Nr(e)}function dh(e){var t,r=e.__v,n=r.__e,o=[],s=[],a=e.__P;a&&((t=on({constructor:yo},r)).__v=r.__v+1,xe.vnode&&xe.vnode(t),dl(a,t,r,e.__n,a.namespaceURI,32&r.__u?[n]:null,o,n||Nr(r),32&r.__u,s),t.__v=r.__v,t.__.__k[t.__i]=t,fu(o,t,s),r.__=r.__e=null,t.__e!=n&&cu(t))}function cu(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),cu(e)}function ou(e){(8&e.__g||(e.__g|=8,Lr.push(e),qi++))&&ol==xe.debounceRendering||((ol=xe.debounceRendering)||queueMicrotask)(du)}function du(){try{for(var e,t=1;Lr.length;)Lr.length>t&&Lr.sort(su),e=Lr.shift(),t=Lr.length,8&e.__g&&dh(e)}finally{(qi=Lr.length)&&(ol||queueMicrotask)(du)}}function uu(e,t,r,n,o,s,a,i,c,u,p){var _,d,f,v,g,y,b=n.__k||Bi,P=t.length;for(c=uh(r,t,b,c,P),_=0;_<P;_++)(f=r.__k[_])!=null&&(d=~f.__i&&b[f.__i]||Ui,f.__i=_,y=dl(e,f,d,o,s,a,i,c,u,p),v=f.__e,(d.ref!=f.ref||8&d.__u)&&(d.ref&&ul(d.ref,null,f,d),f.ref&&p.push(f.ref,f.__c||v,f)),g=g||v,4&f.__u?(c=pu(f,c,e,!d.__v),d.__e&&(d.__e=null)):typeof f.type=="function"&&y!==void 0?c=y:v&&(c=v.nextSibling),f.__u&=-21);return r.__e=g,c}function uh(e,t,r,n,o){var s,a,i,c,u,p,_,d,f,v=r.length,g=v,y=0,b=0,P=e.__k=Array(o);for(s=0;s<o;s++)(a=t[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a!="object"||a.constructor===String?a=P[s]=ho(null,a):zi(a)?a=P[s]=ho(ve,{children:a}):a.constructor===yo&&a.__b?a=P[s]=ho(a.type,a.props,a.key,a.ref,a.__v):P[s]=a,c=s+y,a.__=e,a.__b=e.__b+1,i=null,~(u=a.__i=ph(a,r,c,g))&&(g--,(i=r[u])&&(i.__u|=2)),i&&i.__v?(a.__u|=16,u==c-1?y--:u==c+1?y++:u!=c&&(u>c?y--:y++,b=1)):(~u||(o>v?y--:o<v&&y++),typeof a.type!="function"&&(a.__u|=4))):P[s]=null;if(b){for(p=[],_=[],s=0;s<o;s++)if((a=P[s])&&16&a.__u){for(y=0,d=p.length;y<d;)p[f=y+d>>1]<a.__i?y=f+1:d=f;p[y]=a.__i,_[s]=y+1}for(y=p.length;s--;)_[s]&&(_[s]==y?y--:P[s].__u|=4)}if(g)for(s=0;s<v;s++)!(i=r[s])||2&i.__u||(i.__e==n&&(n=Nr(i)),pl(i,i));return n}function pu(e,t,r,n){var o,s,a,i;if(typeof e.type=="function"){if(e.props.__P)return t;if(o=e.__k)for(s=0;s<o.length;s++)o[s]&&(o[s].__=e,t=pu(o[s],t,r,!1));return t}for(t&&!t.parentNode&&(t=Nr(e))&&!t.parentNode&&(t=null),a=e.__e,i=t;i&&i.nodeType==8;)i=i.nextSibling;for(a!=i&&(!n&&r.moveBefore&&a.parentNode?r.moveBefore(a,t):r.insertBefore(a,t||null)),t=a;(t=t&&t.nextSibling)&&t.nodeType==8&&!t.data.startsWith("$s"););return t}function cl(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(zi(e)?e.some(function(r){cl(r,t)}):t.push(e)),t}function ph(e,t,r,n){var o,s=e.key,a=e.type,i=t[r],c=i&&!(2&i.__u);if(i===null&&s==null||c&&s==i.key&&a==i.type)return r;if(n>(c?1:0)){for(o=r-1;o>=0;o--)if((i=t[o])&&!(2&i.__u)&&s==i.key&&a==i.type)return o;for(o=r+1;o<t.length;o++)if((i=t[o])&&!(2&i.__u)&&s==i.key&&a==i.type)return o}return-1}function iu(e,t,r){r==null&&(r=""),t[0]=="-"?e.setProperty(t,r):e[t]=r}function Oi(e,t,r,n,o){var s,a;if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||iu(e.style,t);if(r)for(t in r)n&&r[t]==n[t]||iu(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")typeof r!="function"&&(r=null),typeof n!="function"&&(n=null),(e.__e||(e.__e={}))[t]=r,r&&n||(a=il[t]||(il[t]=_h(t)),(e.__a||(e.__a={}))[t]=sl,s=t!=(t=t.replace(lu,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),r?e.addEventListener(t,a,s):e.removeEventListener(t,a,s));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]=r??"")}catch{}if(typeof r=="function")return;r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r)}}function _h(e){return function(t){var r=this.__e;if(r){if(r=r[e],t[$i]==null)t[$i]=sl++;else if(t[$i]<this.__a[e])return;return r(xe.event?xe.event(t):t)}}}function dl(e,t,r,n,o,s,a,i,c,u){var p,_,d,f,v,g,y,b,P,w,x,k,h,m,S,A,I,R,C=t.type;if(t.constructor!==yo)return null;128&r.__u&&(c=32&r.__u,p=r.__c.__z)&&(t.__u|=c,_=s=[],p.nodeType==8?i=Di(p,s):s.push(p),i=s[0]||i),(p=xe.__b)&&p(t);e:if(typeof C=="function"){d=a.length;try{if(b=t.props,P=(p=C.prototype)&&p.render,w=(p=C.contextType)&&n[p.__c],x=p?w?w.props.value:p.__:n,(f=r.__c)?(t.__c=f,2&f.__g&&(f.__g|=1)):(P?t.__c=f=new C(b,x):(t.__c=f=new Xt(b,x),f.constructor=C,f.render=mh),w&&w.sub(f),f.state||(f.state={}),f.__n=n,f.__g|=8,f.__h=[],f.__k=[]),P&&(f.__s||(f.__s=f.state),C.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=on({},f.__s)),on(f.__s,C.getDerivedStateFromProps(b,f.__s)))),v=f.props,g=f.state,f.__v=t,r.__c){if(b!==v&&P&&!C.getDerivedStateFromProps&&f.componentWillReceiveProps&&f.componentWillReceiveProps(b,x),t.__v==r.__v&&!(8&f.__g)||!(4&f.__g)&&f.shouldComponentUpdate&&f.shouldComponentUpdate(b,f.__s,x)===!1){t.__v!=r.__v&&(f.props=b,f.state=f.__s,f.__g&=-9),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(M){M&&(M.__=t)}),Bi.push.apply(f.__h,f.__k),f.__k=[],f.__h.length&&a.push(f),i=Nr(r);break e}f.componentWillUpdate&&f.componentWillUpdate(b,f.__s,x),P&&f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,g,y)})}else P&&!C.getDerivedStateFromProps&&f.componentWillMount&&f.componentWillMount(),P&&f.componentDidMount&&f.__h.push(f.componentDidMount);f.context=x,f.props=b,f.__P=e,f.__g&=-5,k=xe.__r,h=P?25:0;do f.__g&=-9,k&&k(t),p=f.render(f.props,f.state=f.__s,f.context);while(8&f.__g&&++h<25);P&&(Bi.push.apply(f.__h,f.__k),f.__k=[]),f.state=f.__s,f.getChildContext&&(n=on({},n,f.getChildContext())),P&&r.__c&&f.getSnapshotBeforeUpdate&&(y=f.getSnapshotBeforeUpdate(v,g)),m=p&&p.type===ve&&p.key==null?p.props.children:p,b.__P&&(p=i,o=(e=b.__P).namespaceURI,c=s=null,r.props&&r.props.__P!=e&&(r.__k.some(function(M){M&&pl(M,M)}),r.__k=null),i=r.__k?Nr(r,0):null),i=uu(e,zi(m)?m:[m],t,r,n,o,s,a,i,c,u),b.__P&&(t.__e=null,i=p),t.__u&=-161,_&&_.some(nn),f.__h.length&&a.push(f),1&f.__g&&(f.__g&=-4)}catch(M){if(a.length=d,t.__v=null,c||s)if(M&&M.then){if(t.__u|=128|c,s){for(~(I=s.indexOf(i||void 0))||(I=s.length);(R=s[I-1])&&R.nodeType==8;)I--;for(;I<s.length;I++)if(R=s[I])if(s[I]=null,S){if(R==A)break}else{if(R.nodeType!=8)break;R.data.startsWith("$s")&&(A=Di(S=R))}}if(!S){for(;i&&i.nodeType==8&&i.nextSibling;)i=i.nextSibling;S=i}(p=Di(S=t.__c.__z||(t.__c.__z=S)))?(t.__e=S,i=p):t.__e=i,i=i&&i.nextSibling}else s&&s.some(nn);else t.__e=r.__e;t.__k||(t.__k=r.__k||[]),M&&M.then||_u(t),xe.__e(M,t,r)}}else i=t.__e=fh(r.__e,t,r,n,o,s,a,c,u,e);return(p=xe.diffed)&&p(t),i}function Di(e,t){if(e&&e.nodeType==8&&e.data.startsWith("$s"))for(var r=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith("$s"))r++;else if(e.data.startsWith("/$s")&&!--r)return e}t&&t.push(e)}}function _u(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(_u))}function fu(e,t,r){for(var n=0;n<r.length;)ul(r[n++],r[n++],r[n++]);xe.__c&&xe.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){xe.__e(s,o.__v)}})}function fh(e,t,r,n,o,s,a,i,c,u){var p,_,d,f,v,g,y,b,P=r.props||Ui,w=t.props,x=t.type;if(x=="svg"?o="http://www.w3.org/2000/svg":x=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),s){for(p=0;p<s.length;p++)if((v=s[p])&&(x?v.localName==x:v.nodeType==3)){e=v,s[p]=null;break}}if(!e){if(b=u.ownerDocument||document,!x)return b.createTextNode(w);e=b.createElementNS(o,x,w.is?w:u),i&&(xe.__m&&xe.__m(t,s),i=!1),s=null}if(x){if(u=x=="template"&&e.content||e,s=x=="textarea"&&w.defaultValue!=null?null:s&&ll.call(u.childNodes),!i&&s)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 w||p=="value"&&"defaultValue"in w||p=="checked"&&"defaultChecked"in w||Oi(e,p,null,v,o);for(p in w)v=w[p],p=="children"?f=v:p=="dangerouslySetInnerHTML"?_=v:p=="value"?g=v:p=="checked"?y=v:i&&typeof v!="function"||P[p]===v||Oi(e,p,v,P[p],o);_?(i||d&&(_.__html==d.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[]):(d&&(e.textContent=""),(x=="foreignObject"||o=="http://www.w3.org/1998/Math/MathML"&&ch.test(x))&&(o="http://www.w3.org/1999/xhtml"),uu(u,zi(f)?f:[f],t,r,n,o,s,a,s?s[0]:r.__k&&Nr(r,0),i,c),s&&s.some(nn)),i&&x!="textarea"||(p="value",x=="progress"&&g==null?e.removeAttribute(p):g==null||g===e[p]&&(x!="progress"||g)||Oi(e,p,g,P[p],o),p="checked",y!=null&&y!=e[p]&&Oi(e,p,y,P[p],o))}else P===w||i&&e.data==w||(e.data=w);return e}function ul(e,t,r,n){try{typeof e=="function"?t?t.__x=e(t)||1:n&&(n=n.__c||n.__e)&&(t=n.__x)&&(n.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(o){xe.__e(o,r)}}function pl(e,t,r){var n,o,s,a;if(xe.unmount&&xe.unmount(e),!(n=e.ref)||n.current&&n.current!=e.__e||ul(n,null,t,e),n=e.__c){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){xe.__e(i,t)}n.__P=n.__n=null}if(n=e.__k)for(a=0;a<n.length;a++)n[a]&&pl(n[a],t,typeof e.type!="function"||r&&!e.props.__P);!r&&(n=e.__c)&&(n=n.__z)&&(o=Di(n,s=[]))&&(n==e.__e&&s.some(nn),nn(o),nn(n)),r||nn(e.__e),e.__e=e.__c=e.__=null}function mh(e,t,r){return this.constructor(e,r)}function lr(e,t){var r,n,o,s;xe.__&&xe.__(e,t),t.nodeType==9&&(t=t.documentElement),n=(r=e&&32&e.__u)?null:t.__k,t.__k=ho(ve,{children:[e]}),o=[],s=[],dl(t,t.__k,n||Ui,Ui,t.namespaceURI,n?null:t.firstChild?ll.call(t.childNodes):null,o,n?n.__e:t.firstChild,r,s),fu(o,t.__k,s),t.__k.props.children=null}xe={__e:function(e,t,r,n){for(var o,s,a;t=t.__;)if((o=t.__c)&&!(1&o.__g)){o.__g|=4;try{if((a=(s=o.constructor)&&s.getDerivedStateFromError)&&o.setState(s.getDerivedStateFromError(e)),o.componentDidCatch&&(o.componentDidCatch(e,n||{}),a=1),a&&8&o.__g)return void(o.__g|=2)}catch(i){e=i}}throw qi=0,e}},au=0,al=function(e){return e!=null&&e.constructor===yo},Xt.prototype.setState=function(e,t){var r=this.__s;r&&r!=this.state||(r=this.__s=on({},this.state)),typeof e=="function"&&(e=e(on({},r),this.props)),e&&(on(r,e),this.__v&&(t&&this.__k.push(t),ou(this)))},Xt.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),ou(this))},Xt.prototype.render=ve,Lr=[],qi=0,su=function(e,t){return e.__v.__b-t.__v.__b},$i=Symbol(),lu=/(PointerCapture)$|Capture$/i,sl=0,il={},lh=0;function Gt(){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,gh(t.subarray(6)),t[6]=(t[6]??0)&15|112,t[8]=(t[8]??0)&63|128;let r=Array.from(t,n=>n.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function gh(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 $r=te.scope("persistence");function Dr(e,t=Ti,r){let n=r?`${e}.${r}`:e,o=`${D.cssPrefix}.${n}.storageVersion`,s=t.get(o)??void 0,a=s?`.v${s}`:"",i=`${D.cssPrefix}.${n}${a}`,c=`${D.cssPrefix}${a}.visitorId`,u=`${D.cssPrefix}${a}.lastUserSub`,p=`${i}.conversationId`,_=`${i}.userPrefs`,d=`${i}.panelOpen`,f=`${i}.panelSize`,v=`${i}.calloutDismissed`,g=`${i}.sidebarCollapsed`,y=`${i}.activeModule`,b=`${i}.seenNewsId`,P=`${i}.historyCount`,w=`${i}.loginReturn`,x=`${i}.loginPromptDismissedIn`,k={getVisitorId(){let h=t.get(c);if(h)return h;let m=Gt();return t.set(c,m),m},loadLastUserSub(){return t.get(u)??void 0},saveLastUserSub(h){t.set(u,h)},loadConversationId(){return t.get(p)??void 0},saveConversationId(h){$r.trace("saveConversationId",{id:h,scope:n}),h?t.set(p,h):t.remove(p)},loadDraft(h){return t.get(`${i}.draft.${h}`)??""},saveDraft(h,m){let S=`${i}.draft.${h}`;m?t.set(S,m):t.remove(S)},loadMessageQueue(h){let m=t.get(`${i}.messageQueue.${h}`);if(!m)return[];try{let S=JSON.parse(m);return!Array.isArray(S)||!S.every(vh)?[]:S}catch(S){return $r.warn("loadMessageQueue parse failed",{error:S}),[]}},saveMessageQueue(h,m){let S=`${i}.messageQueue.${h}`;if(m.length===0){t.remove(S);return}try{t.set(S,JSON.stringify(m))}catch(A){$r.warn("saveMessageQueue serialise failed",{error:A})}},loadUserPrefs(){let h=t.get(_);if(!h)return{};try{return _l(JSON.parse(h))}catch(m){return $r.warn("loadUserPrefs parse failed",{error:m}),{}}},saveUserPrefs(h){try{t.set(_,JSON.stringify(h))}catch(m){$r.warn("saveUserPrefs serialise failed",{error:m})}},patchUserPrefs(h){let m=k.loadUserPrefs();k.saveUserPrefs({...m,...h})},loadPanelOpen(){let h=t.get(d);return h==="1"?!0:h==="0"?!1:null},savePanelOpen(h){t.set(d,h?"1":"0")},loadPanelSize(){let h=t.get(f);return h==="normal"||h==="expanded"||h==="fullscreen"?h:null},savePanelSize(h){t.set(f,h)},loadCalloutDismissed(h){if(!h)return!1;let m=t.get(v);return!!m&&m===h},saveCalloutDismissed(h){h?t.set(v,h):t.remove(v)},loadSidebarCollapsed(){let h=t.get(g);return h==="1"?!0:h==="0"?!1:null},saveSidebarCollapsed(h){t.set(g,h?"1":"0")},loadActiveModule(){return t.get(y)||null},saveActiveModule(h){t.set(y,h)},loadSeenNewsId(){return t.get(b)||null},saveSeenNewsId(h){t.set(b,h)},loadHistoryCount(){let h=t.get(P);if(!h)return null;let m=Number.parseInt(h,10);return Number.isFinite(m)&&m>=0?m:null},saveHistoryCount(h){t.set(P,String(h))},rememberStorageVersion(h){h&&h!==t.get(o)&&($r.debug("rememberStorageVersion (force-reset on next load)",{version:h}),t.set(o,h))},saveLoginReturn(h){Jr.set(w,JSON.stringify(h))},takeLoginReturn(){let h=Jr.get(w);if(h){Jr.remove(w);try{let m=JSON.parse(h);return Hi(m)&&typeof m.conversationId=="string"&&m.conversationId&&typeof m.draft=="string"?{conversationId:m.conversationId,draft:m.draft}:void 0}catch(m){$r.warn("takeLoginReturn parse failed",{error:m});return}}},loadLoginPromptDismissedIn(){return Jr.get(x)??void 0},dismissLoginPromptIn(h){Jr.set(x,h)},clearConversation(){t.remove(p)},reset(){let h=t.get(p);h&&(t.remove(`${i}.draft.${h}`),t.remove(`${i}.messageQueue.${h}`));for(let m of[w,x])Jr.remove(m);for(let m of[c,u,p,_,f,v,g,y,b,P])t.remove(m);$r.info("reset: forgot the visitor",{scope:n})}};return k}function Hi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vh(e){return Hi(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.text=="string"}function _l(e){if(!Hi(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),Hi(e.widgetSize)&&typeof e.widgetSize.width=="number"&&typeof e.widgetSize.height=="number"&&(t.widgetSize={width:e.widgetSize.width,height:e.widgetSize.height}),t}var On="6.5.0";var hh="1",mu=60,yh=2e3,fl={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 bh(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Ph(){return location.origin+location.pathname}function xh(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function gu(e,t){let r=Math.random(),n=0,o=0,s=new Set;function a(_,d){let{tracking:f,publicKey:v,aiAgentDeploymentId:g,mode:y,themeMode:b}=t.getOptions();if(!f.enabled||bh()||r>=f.sampleRate)return;let P=performance.now();if(P-n>6e4&&(n=P,o=0),++o>mu)return;let w=new URLSearchParams;w.set("v",hh),w.set("_ev",On),w.set("e",_),f.token&&w.set("tk",f.token),v&&w.set("pk",v),g&&w.set("dep",g),w.set("vid",t.getVisitorId());let x=t.getConversationId();x&&w.set("cid",x),w.set("url",Ph());let k=xh();k&&w.set("ref",k),w.set("sw",String(screen.width)),w.set("sh",String(screen.height)),w.set("vw",String(innerWidth)),w.set("vh",String(innerHeight)),w.set("dpr",String(devicePixelRatio)),w.set("lang",navigator.language);try{w.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(w.set("m",y),w.set("th",b),d)for(let[A,I]of Object.entries(d))I!==void 0&&w.set(A,String(I));w.set("ts",String(Date.now()));let h=`${f.endpoint}?${w}`;if(h.length>yh)return;let m=new Image(1,1);s.add(m);function S(){return s.delete(m)}m.addEventListener("load",S,{once:!0}),m.addEventListener("error",S,{once:!0}),m.src=h}let i=[];function c(_,d){if(i&&_!=="handshake"){i.length<mu&&i.push([_,d]);return}let f=i??[];i=void 0;for(let[v,g]of f)a(v,g);a(_,d)}function u(_,d){return fl[_]?.(d)}let p=Object.keys(fl).filter(_=>Object.hasOwn(fl,_)).map(_=>e.on(_,d=>c(_,u(_,d))));return()=>{for(let _ of p)_();s.clear()}}var vu=`.__P__-generative-ui{display:grid;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{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}.__P__-generative-ui-cell{display:flex;flex-direction:column;align-self: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:is([data-columns="2"],[data-columns="3"],[data-columns="4"]){grid-template-columns:repeat(2,minmax(0,1fr))}.__P__-generative-ui-grid:is([data-columns="2"],[data-columns="3"],[data-columns="4"])>.__P__-generative-ui-cell:is([data-span="2"],[data-span="3"],[data-span="4"]){grid-column:span 2}}@container __P__-generative-ui-grid (min-width: 752px){.__P__-generative-ui-grid:is([data-columns="3"],[data-columns="4"]){grid-template-columns:repeat(3,minmax(0,1fr))}.__P__-generative-ui-grid:is([data-columns="3"],[data-columns="4"])>.__P__-generative-ui-cell:is([data-span="3"],[data-span="4"]){grid-column:span 3}}@container __P__-generative-ui-grid (min-width: 1008px){.__P__-generative-ui-grid[data-columns="4"]{grid-template-columns:repeat(4,minmax(0,1fr))}.__P__-generative-ui-grid[data-columns="4"]>.__P__-generative-ui-cell[data-span="4"]{grid-column:span 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{font-size:1.6em;font-weight:700}.__P__-generative-ui-table{overflow-x:auto}.__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-chart{display:block;width:100%;color:var(--__P__-accent)}.__P__-generative-ui-axis{stroke:var(--__P__-border)}.__P__-generative-ui-data{display:flex;flex-wrap:wrap;gap:var(--__P__-space-2);font-size:.85em}.__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-carousel>[role=listitem]{display:flex;flex:0 0 min(250px,80%);scroll-snap-align:start;min-width:0}.__P__-generative-ui-carousel>[role=listitem]>section{flex:1}.__P__-generative-ui-product{overflow:hidden}.__P__-generative-ui>.__P__-generative-ui-product{max-width:320px}.__P__-generative-ui-footer{display:flex;flex-direction:column;gap:var(--__P__-space-1);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{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-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-product>.__P__-generative-ui-heading{justify-content:flex-start}.__P__-generative-ui-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.__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[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 dd{margin:0}.__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}
2
+ `;var hu=`: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}}
3
+ `;var yu=`.__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-reason{margin:0;color:var(--__P__-fg-muted)}.__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{display:flex;flex-direction:column;gap:var(--__P__-space-2);width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__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{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-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-system{min-width:0;overflow:hidden;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);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{display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px var(--__P__-space-2);margin:0;font-size:var(--__P__-text-xs);line-height:1.5}.__P__-toolui-fields>div{display:contents}.__P__-toolui-fields dt{color:var(--__P__-fg-muted)}.__P__-toolui-fields dd{margin:0;min-width:0;overflow:hidden;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-fields-full{max-height:240px;overflow:auto;overscroll-behavior:contain}.__P__-toolui-fields-full dd{overflow:visible;font-family:inherit;white-space:pre-wrap;overflow-wrap:anywhere}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
4
+ `;var bu=`*,*: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}
5
+ `;var Pu=`: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}}
6
+ `;var Ih="helpai",Ah="#5B5BD6",Rh="#FFFFFF",Eh="12px",Mh="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",gl=[Pu,bu,yu,vu,hu].join(`
7
+ `).replace(/__P__/g,Ih).replaceAll("__BRAND_ACCENT_TEXT__",Rh).replaceAll("__BRAND_ACCENT__",Ah).replaceAll("__BRAND_RADIUS__",Eh).replaceAll("__BRAND_FONT__",Mh);var Su=["data-theme","data-color-scheme","data-mode","data-bs-theme"];function xu(e){if(e){if(e.classList.contains("dark"))return"dark";if(e.classList.contains("light"))return"light";for(let t of Su){let r=e.getAttribute(t);if(r==="dark"||r==="light")return r}}}function Fi(e=document){let t=xu(e.documentElement)??xu(e.body);if(t)return t;let r=getComputedStyle(e.documentElement).colorScheme.trim();return r==="dark"||r==="light"?r:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function wu(e,t=document){let r=Fi(t);e(r);function n(){let i=Fi(t);i!==r&&(r=i,e(i))}let o=new MutationObserver(n),s={attributes:!0,attributeFilter:["class","style",...Su]};o.observe(t.documentElement,s),t.body&&o.observe(t.body,s);let a=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):void 0;return a?.addEventListener("change",n),()=>{o.disconnect(),a?.removeEventListener("change",n)}}var Lh=te.scope("mount"),ku=new WeakMap,Nh={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 vl(e,t){let r=t==="flow"?e.style.height:"";e.style.cssText=Nh[t],r&&(e.style.height=r)}function $n(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function ji(e={}){let t=e.position??"flow";Lh.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let r=`${D.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(r)&&customElements.define(r,class extends HTMLElement{});let n;e.existingHost?n=e.existingHost:(n=document.createElement(r),(e.target??document.body).appendChild(n)),n.setAttribute("data-brand",D.id),vl(n,t);let o=n.shadowRoot??n.attachShadow({mode:"open"});for(let i of["keydown","keypress","keyup"])o.addEventListener(i,Oh);let s=n.ownerDocument;if(!$h(o,s)){let i=s.createElement("style");i.textContent=gl,o.appendChild(i)}let a=document.createElement("div");return a.className=`${D.cssPrefix}-app`,o.appendChild(a),{appRoot:a,destroy:()=>n.remove(),hostElement:n,shadowRoot:o}}function Oh(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 $h(e,t){if(!("adoptedStyleSheets"in e))return!1;let r=t.defaultView;if(!r||typeof r.CSSStyleSheet!="function")return!1;let n=ku.get(t);if(!n)try{n=new r.CSSStyleSheet,n.replaceSync(gl),ku.set(t,n)}catch{return!1}try{return e.adoptedStyleSheets=[n],!0}catch{return!1}}function Dh(e,t){let r=D.cssPrefix;t.accent&&e.style.setProperty(`--${r}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${r}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${r}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${r}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${r}-conversation-max`,t.contentMaxWidth)}function qh(e,t){e.dataset.theme=t==="host"?Fi():t}function Uh(e,t){let r=D.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${r}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${r}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${r}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${r}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${r}-panel-inset`,t.inset)}function Bh(e,t){e.dataset.position=t}function Vi(e,t){e.dataset.mode=t}function Cu(e,t){qh(e,t.themeMode),Dh(e,t.themeOverrides),Bh(e,t.position),Uh(e,t.size)}var an,dt,hl,Tu,yl=Object.is,Po=0,$u=[],bl=[],ct=xe,Iu=ct.__b,Au=ct.__r,Ru=ct.diffed,Eu=ct.__c,Mu=ct.unmount,Lu=ct.__;function xo(e,t){ct.__h&&ct.__h(dt,e,Po||t),Po=0;var r=dt.__H||(dt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function U(e){return Po=1,Du(qu,e)}function Du(e,t,r){var n=xo(an++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):qu(void 0,t),function(s){var a=(n.__N||n.__)[0],i=n.t(a,s);yl(a,i)||(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=dt,!dt.__f)){dt.__f=!0;var o=dt.shouldComponentUpdate;dt.shouldComponentUpdate=function(s,a,i){var c=this.__H;if(!c)return!0;var u=!1,p=this.props!=s;if(c.__.some(function(d){d.__N&&(u=!0,yl(d.__[0],d.__N[0])||(p=!0))}),o){var _=o.call(this,s,a,i);return u?_||p:_}return!u||p}}return n.__}function H(e,t){var r=xo(an++,3);!ct.__s&&xl(r.__H,t)&&(r.__P=!0,r.__=e,r.u=t,dt.__H.__h.push(r))}function St(e,t){var r=xo(an++,4);!ct.__s&&xl(r.__H,t)&&(r.__P=!1,r.__=e,r.u=t,dt.__h.push(r))}function B(e){return Po=5,ke(function(){return{current:e}},[])}function ke(e,t){var r=xo(an++,7);return xl(r.__H,t)&&(r.__=e(),r.__H=t),r.__}function F(e,t){return Po=8,ke(function(){return e},t)}function So(){var e=xo(an++,11);if(!e.__){for(var t=dt.__v;!t.__m&&t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function zh(){var e;do{for(;e=bl.shift();)try{bo(e)}catch(r){ct.__e(r,{__:(e=e.__P)&&e.__v})}for(;e=$u.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(bo),t.__h.some(Pl),t.__h=[]}catch(r){t.__h=[],ct.__e(r,e.__v)}}}while(bl.length)}ct.__b=function(e){dt=null,Iu&&Iu(e)},ct.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Lu&&Lu(e,t)},ct.__r=function(e){Au&&Au(e),an=0;var t=(dt=e.__c).__H;t&&(hl==dt?dt.__h=[]:(t.__h.some(bo),t.__h.some(Pl),an=0),t.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})),hl=dt},ct.diffed=function(e){Ru&&Ru(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Ou($u.push(t)),t.__H.__.some(function(r){r.u&&(r.__H=r.u)})),hl=dt=null},ct.__c=function(e,t){t.some(function(r){try{r.__h.some(bo),r.__h=r.__h.filter(function(n){return!n.__||Pl(n)})}catch(n){r.__h=[function(){throw n}]}}),Eu&&Eu(e,t)},ct.unmount=function(e){Mu&&Mu(e);var t,r,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{if(o.__P&&o.__c){if(r===void 0){for(r=e.__;r&&(!r.__c||!r.__c.__P);)r=r.__;r=r&&r.__c}o.__P=r,Ou(bl.push(o))}else bo(o)}catch(s){t=s}}),n.__H=void 0,t&&ct.__e(t,n.__v))};var Nu=typeof requestAnimationFrame=="function";function Hh(e){var t,r=function(){clearTimeout(n),Nu&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Nu&&(t=requestAnimationFrame(r))}function Ou(e){e!=1&&Tu==ct.requestAnimationFrame||((Tu=ct.requestAnimationFrame)||Hh)(zh)}function bo(e){var t=dt,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),dt=t}function Pl(e){var t=dt;e.__c=e.__(),dt=t}function xl(e,t){return!e||e.length!=t.length||t.some(function(r,n){return!yl(r,e[n])})}function qu(e,t){return typeof t=="function"?t(e):t}var Fh=Symbol.for("preact-signals");function Qi(){if(hr>1)hr--;else{var e,t=!1;for((function(){var o=Gi;for(Gi=void 0;o!==void 0;){var s=o.S;if(s.v===o.v)for(var a=s.t;a!==void 0;a=a.x)a.i===o.i&&(a.i=s.i);o=o.o}})();ko!==void 0;){var r=ko;for(ko=void 0,Wi++;r!==void 0;){var n=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&Bu(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(Wi=0,hr--,t)throw e}}function Zt(e){if(hr>0)return e();Sl=++jh,hr++;try{return e()}finally{Qi()}}var wo,Ke=void 0;function Co(e){var t=Ke,r=wo;Ke=void 0,wo=void 0;try{return e()}finally{Ke=t,wo=r}}var ko=void 0,hr=0,Wi=0,jh=0,Sl=0,Gi=void 0,Ki=0;function Uu(e){if(Ke!==void 0){var t=e.n;if(t===void 0||t.t!==Ke)return t={i:0,S:e,p:Ke.s,n:void 0,t:Ke,e:void 0,x:void 0,r:t},Ke.s!==void 0&&(Ke.s.n=t),Ke.s=t,e.n=t,32&Ke.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=Ke.s,t.n=void 0,Ke.s.n=t,Ke.s=t),t}}function wt(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}wt.prototype.brand=Fh;wt.prototype.h=function(){return!0};wt.prototype.S=function(e){var t=this,r=this.t;r!==e&&e.e===void 0&&(e.x=r,this.t=e,r!==void 0?r.e=e:Co(function(){var n;(n=t.W)==null||n.call(t)}))};wt.prototype.U=function(e){var t=this;if(this.t!==void 0){var r=e.e,n=e.x;r!==void 0&&(r.x=n,e.e=void 0),n!==void 0&&(n.e=r,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Co(function(){var o;(o=t.Z)==null||o.call(t)}))}};wt.prototype.subscribe=function(e){var t=this;return nr(function(){var r=t.value;Co(function(){return e(r)})},{name:"sub"})};wt.prototype.valueOf=function(){return this.value};wt.prototype.toString=function(){return this.value+""};wt.prototype.toJSON=function(){return this.value};wt.prototype.peek=function(){var e=this;return Co(function(){return e.value})};Object.defineProperty(wt.prototype,"value",{get:function(){var e=Uu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Wi>100)throw new Error("Cycle detected");(function(r){hr!==0&&Wi===0&&r.l!==Sl&&(r.l=Sl,Gi={S:r,v:r.v,i:r.i,o:Gi})})(this),this.v=e,this.i++,Ki++,hr++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Qi()}}}});function ae(e,t){return new wt(e,t)}function Bu(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 zu(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Hu(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function sn(e,t){wt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Ki-1,this.f=4}sn.prototype=new wt;sn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ki))return!0;if(this.g=Ki,this.f|=1,this.i>0&&!Bu(this))return this.f&=-2,!0;var e=Ke;try{zu(this),Ke=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Ke=e,Hu(this),this.f&=-2,!0};sn.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)}wt.prototype.S.call(this,e)};sn.prototype.U=function(e){if(this.t!==void 0&&(wt.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)}};sn.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(sn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Uu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ut(e,t){return new sn(e,t)}function Fu(e){var t=e.j;if(e.j=void 0,typeof t=="function"){hr++;var r=Ke;Ke=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,wl(e),n}finally{Ke=r,Qi()}}}function wl(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Fu(e)}function Vh(e){if(Ke!==this)throw new Error("Out-of-order effect");Hu(this),Ke=e,this.f&=-2;try{8&this.f&&wl(this)}finally{Qi()}}function Dn(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,wo&&wo.push(this)}Dn.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()}};Dn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Fu(this),zu(this),hr++;var e=Ke;return Ke=this,Vh.bind(this,e)};Dn.prototype.N=function(){2&this.f||(this.f|=2,this.u=ko,ko=this)};Dn.prototype.d=function(){this.f|=8,1&this.f||wl(this)};Dn.prototype.dispose=function(){this.d()};function nr(e,t){var r=new Dn(e,t);try{r.c()}catch(o){throw r.d(),o}var n=r.d.bind(r);return n[Symbol.dispose]=n,n}var ju,Io,Yi,Wh=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Vu=[];nr(function(){ju=this.N})();function qn(e,t){xe[e]=t.bind(null,xe[e]||function(){})}function To(e){if(Yi){var t=Yi;Yi=void 0,t()}Yi=e&&e.S()}function Wu(e){var t=this,r=e.data,n=$t(r);n.name="ReactiveDom",n.value=r;var o=ke(function(){for(var i=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=ut(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),p=ut(function(){return!Array.isArray(u.value)&&!al(u.value)}),_=nr(function(){if(this.N=Gu,p.value){var f=u.value;i.__v&&i.__v.__e&&i.__v.__e.nodeType===3&&(i.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){_(),d.call(this)},[p,u]},[]),s=o[0],a=o[1];return s.value?a.peek():a.value}Wu.displayName="ReactiveTextNode";Object.defineProperties(wt.prototype,{constructor:{configurable:!0,value:Or(ve,null).constructor},type:{configurable:!0,value:Wu},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});qn("__b",function(e,t){if(To(),Io=void 0,typeof t.type=="string"){var r,n=t.props;for(var o in n)if(o!=="children"){var s=n[o];s instanceof wt&&(r||(t.__np=r={}),r[o]=s,n[o]=s.peek())}}e(t)});qn("__r",function(e,t){if(e(t),t.type!==ve){To();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=(function(o,s){var a;return nr(function(){a=this},{name:s}),a.c=o,a})((function(o){return function(){var s;Wh&&((s=this.y)==null||s.call(this)),o.__$f|=1,o.setState({})}})(n),typeof t.type=="function"?t.type.displayName||t.type.name:""))),Io=n,To(r)}});qn("__e",function(e,t,r,n){To(),Io=void 0,e(t,r,n)});qn("diffed",function(e,t){To(),Io=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,o=t.props,s=r.U;if(s)for(var a in s){var i=s[a];i===void 0||n&&a in n||(i.d(),s[a]=void 0)}if(n){s||(s={},r.U=s);for(var c in n){var u=s[c],p=n[c];u===void 0?(u=Gh(r,c,p,o),s[c]=u):u.o(p,o)}}}e(t)});function Gh(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,s=ae(r);return{o:function(a,i){s.value=a,n=i},d:nr(function(){this.N=Gu;var a=s.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a!=null&&(a!==!1||t[4]==="-")?e.setAttribute(t,a):e.removeAttribute(t))})}}qn("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var s=n[o];s&&s.d()}}}var a=t.__np;if(a){var i=t.props;for(var c in a)i[c]=a[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)});qn("__h",function(e,t,r,n){n<3&&(t.__$f|=2),e(t,r,n)});Xt.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var r=this.__$u,n=r&&r.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var s=2&this.__$f;if(!(n||s||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};function $t(e,t){return ke(function(){return ae(e,t)},[])}function It(e,t){var r=B(e);return r.current=e,Io.__$f|=4,ke(function(){return ut(function(){return r.current()},t)},[])}var Kh=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Qh(){Zt(function(){for(var e;e=Vu.shift();)ju.call(e)})}function Gu(){Vu.push(this)===1&&(xe.requestAnimationFrame||Kh)(Qh)}var Yh="x-public-key",Jh="x-ai-agent-deployment-id";function Ku(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");return{headers(){let t={[Jh]:e.aiAgentDeploymentId};return e.publicKey&&(t[e.publicKeyHeader??Yh]=e.publicKey),t}}}function Ji(e,t){let r=[],n;for(let o of e){let s=new URLSearchParams(o);s.has(t)?n??(n=s.get(t)??""):r.push(o)}return{value:n,rest:r}}function Qu(e){let t=new URL(e),r=D.cssPrefix,n=`${D.cssPrefix}-ask`,o=t.search.slice(1).split("&").filter(Boolean),s=t.hash.slice(1).split("&").filter(Boolean),a=Ji(o,r),i=Ji(a.rest,n),c=Ji(s,r),u=Ji(c.rest,n),p=a.value??c.value,_=(i.value??u.value)?.trim()||void 0;if(!(p===void 0&&_===void 0))return t.search=i.rest.join("&"),t.hash=u.rest.join("&"),{target:p===void 0?void 0:Li(p),..._?{ask:_}:{},url:t.toString()}}var Yu=te.scope("feedback:audio"),Xi=class{constructor(){ee(this,"ctx",null);ee(this,"master",null);ee(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(r){Yu.warn("AudioContext init failed",{err:r})}}setVolume(t){if(!this.master||!this.ctx)return;let r=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(r,this.ctx.currentTime,.01)}playTone(t){let r=this.ctx,n=this.master;if(!r||!n||r.state!=="running")return;let o=r.currentTime,s=t.noteMs/1e3;t.notes.forEach((a,i)=>{let c=r.createOscillator();c.type=t.type,c.frequency.value=a;let u=r.createGain(),p=o+i*s;u.gain.setValueAtTime(1e-4,p),u.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),u.gain.exponentialRampToValueAtTime(1e-4,p+s),c.connect(u).connect(n),c.start(p),c.stop(p+s+.01)})}async playUrl(t){let r=this.ctx,n=this.master;if(!r||!n||r.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let s=r.createBufferSource();s.buffer=o,s.connect(n),s.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 r=this.buffers.get(t);if(r)return r instanceof Promise,r;let n=this.ctx,o=fetch(t).then(s=>s.ok?s.arrayBuffer():Promise.reject(new Error(`fetch ${s.status}`))).then(s=>n.decodeAudioData(s)).then(s=>(this.buffers.set(t,s),s)).catch(s=>(Yu.warn("audio fetch/decode failed",{url:t,err:s}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var Ju={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Xu={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 qr=null,Zi=0;function Xh(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function Zh(){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=`__${D.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let r="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=r,t.style.cssText=r;for(let n of[e,t])n.addEventListener("click",o=>o.stopPropagation());return document.body.append(e,t),{input:e,label:t}}function Zu(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(Xh())try{navigator.vibrate(e);return}catch{}if(qr??(qr=Zh()),!!qr)try{qr.label.click()}catch{}}}function ep(){Zi++;let e=!1;return()=>{e||(e=!0,Zi=Math.max(0,Zi-1),Zi===0&&qr&&(qr.input.remove(),qr.label.remove(),qr=null))}}var ey=te.scope("feedback"),ty=100,ea=class{constructor(t,r){ee(this,"mutedSig",ae(!1));ee(this,"audio",new Xi);ee(this,"releaseHaptics");ee(this,"sound");ee(this,"haptics");ee(this,"lastPlayed",new Map);ee(this,"reducedMotionMq",null);this.sound=t,this.haptics=r,this.releaseHaptics=ep(),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,r){this.sound=t,this.haptics=r,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 r=this.lastPlayed.get(t);return r===void 0?!1:performance.now()-r<ty}playSound(t){let r=this.sound.events?.[t];if(r===!1)return;if(typeof r=="string"){this.audio.playUrl(r).catch(o=>ey.warn("audio play failed",{err:o,url:r}));return}let n=Xu[t];n&&this.audio.playTone(n)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let r=this.haptics.events?.[t];if(r===!1)return;let n=r===!0||r===void 0?Ju[t]:r;Zu(n)}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 tp(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function kl(e){return tp(e)}function Cl(e){return!(!tp(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function ta(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 np(e,t){let r=encodeURIComponent(t).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return e.replaceAll("{returnTo}",r)}function op(e){let t=e.split(".")[1];if(t)try{let r=atob(t.replace(/-/g,"+").replace(/_/g,"/")),n=JSON.parse(new TextDecoder().decode(Uint8Array.from(r,o=>o.charCodeAt(0))));return typeof n=="object"&&n!==null&&!Array.isArray(n)?Object.fromEntries(Object.entries(n)):void 0}catch{return}}function rp(e,t){let r=e?.[t];return typeof r=="string"&&r.trim()?{[t]:r.trim()}:{}}function ip(e){let t=op(e);return{...rp(t,"name"),...rp(t,"email")}}function ap(e){let t=op(e)?.sub;return typeof t=="string"&&t!==""?t:void 0}function sp(){try{return window.top?.location.href??location.href}catch{return location.href}}function lp(e){try{(window.top??window).location.assign(e)}catch{location.assign(e)}}var ry=Symbol.for("pv"),ny=0;function l(e,t,r,n,o,s){t||(t={});var a,i,c=t;if("ref"in c&&typeof e!="function")for(i in c={},t)i=="ref"?a=t[i]:c[i]=t[i];var u={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:ry,__v:--ny,__i:-1,__u:0};return(o||s)&&(u.__source=o,u.__self=s),xe.vnode&&xe.vnode(u),u}var Un=1,Ao=2,Ro=4,dp=8,up=16;function oy(e){switch(e){case Un:return"href";case Ao:return"src";case Ro:return"class";case dp:return"checked";case up:return"start"}}var iy=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}},ay=iy;var cp=24;function Eo(e){let t=new Uint32Array(cp);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(cp),indent:"",indent_len:0,table_state:0}}function Bn(e){e.pending.length>0&&ot(e,`
8
+ `)}function Me(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 nt(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 Ne(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&nt(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function sy(e,t,r){for(;r<=e.len;){if(e.tokens[r]===t)return r;r+=1}return-1}function ln(e,t){for(e.fence_start=0;e.len>t;)nt(e)}function ra(e,t){let r=0;for(let n=0;n<=e.len&&(t-=e.spaces[n],!(t<0));n+=1)switch(e.tokens[n]){case 9:case 10:case 20:case 25:r=n;break}for(;e.len>r;)nt(e);return t}function Tl(e,t){let r=-1,n=-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]){n=-1;break}n=o}else e.tokens[o]===t&&(r=o);return n===-1?r===-1?(ln(e,e.blockquote_idx),Ne(e,t),!0):(ln(e,r),!1):(ln(e,n),Ne(e,t),!0)}function Il(e,t){Ne(e,25),e.spaces[e.len]=e.indent_len+t,yr(e),e.token=103}function yr(e){e.indent="",e.indent_len=0,e.pending=""}function Al(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 ly(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 cy(e){return Al(e)||ly(e)}function ot(e,t){for(let r of t){if(e.token===101){switch(r){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let o=ra(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],o>0&&ot(e," ".repeat(o))}let n=e.pending+r;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=r;continue;case" ":console.assert(e.pending.length===1),e.pending=r,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=r,e.indent+=" ",e.indent_len+=4;continue;case`
9
+ `:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){nt(e),yr(e),e.pending=r;continue}ln(e,e.blockquote_idx),yr(e),e.blockquote_idx=0,e.fence_start=0,e.pending=r;continue;case"#":switch(r){case"#":if(e.pending.length<6){e.pending=n;continue}break;case" ":ra(e,e.indent_len),Ne(e,ay(e.pending.length)),yr(e);continue}break;case">":{let s=sy(e,20,e.blockquote_idx+1);s===-1?(ln(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,Ne(e,20)):e.blockquote_idx=s,yr(e),e.pending=r;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(r){case e.hr_char:e.hr_chars+=1,e.pending=n;continue;case" ":e.pending=n;continue;case`
10
+ `:if(e.hr_chars<3)break;ra(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),yr(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Tl(e,23),Il(e,2),ot(e,n.slice(2));continue}break;case"`":if(e.pending.length<3){if(r==="`"){e.pending=n,e.fence_start=n.length;continue}e.fence_start=0;break}switch(r){case"`":e.pending.length===e.fence_start?(e.pending=n,e.fence_start=n.length):(Ne(e,2),yr(e),e.fence_start=0,ot(e,n));continue;case`
11
+ `:{ra(e,e.indent_len),Ne(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,Ro,e.pending.slice(e.fence_start)),yr(e),e.token=101;continue}default:e.pending=n;continue}case"+":if(r!==" ")break;Tl(e,23),Il(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(r!==" ")break;Tl(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,up,e.pending.slice(0,-1)),Il(e,e.pending.length+1);continue}else{let s=r.charCodeAt(0);if(s===46||Al(s)){e.pending=n;continue}}break;case"|":ln(e,e.blockquote_idx),Ne(e,27),Ne(e,28),e.pending="",ot(e,r);continue}let o=n;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 s=0;for(;s<4;s+=1)if(e.indent[s]===" "){s=s+1;break}o=e.indent.slice(s)+n,Ne(e,9)}else Ne(e,2);yr(e),ot(e,o);continue;case 27:if(e.table_state===1)switch(r){case"-":case" ":case"|":case":":e.pending=n;continue;case`
12
+ `:e.table_state=2,e.pending="";continue;default:nt(e),e.table_state=0;break}else switch(e.pending){case"|":Ne(e,28),e.pending="",ot(e,r);continue;case`
13
+ `:nt(e),e.pending="",e.table_state=0,ot(e,r);continue}break;case 28:switch(e.pending){case"":break;case"|":Ne(e,29),nt(e),e.pending="",ot(e,r);continue;case`
14
+ `:nt(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",ot(e,r);continue;default:Ne(e,29),ot(e,r);continue}break;case 29:if(e.pending==="|"){Me(e),nt(e),e.pending="",ot(e,r);continue}break;case 9:switch(n){case`
15
15
  `:case`
16
16
  `:case`
17
17
  `:case`
@@ -21,48 +21,50 @@
21
21
  `:case`
22
22
  `:case`
23
23
  `:case`
24
- `:e.pending=n;continue;default:e.pending.length!==0?(Ee(e),at(e),e.pending=r):e.text+=r;continue}case 10:switch(r){case"`":e.pending=n;continue;case`
25
- `:if(n.length===e.fence_start+e.fence_end+1){Ee(e),at(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
26
- `){e.pending=n,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=r,e.fence_end=1;continue;case 11:switch(r){case"`":n.length===e.fence_start+ +(e.pending[0]===" ")?(Ee(e),at(e),e.pending="",e.fence_start=0):e.pending=n;continue;case`
27
- `:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,Ee(e);continue;case" ":e.text+=e.pending,e.pending=r;continue;default:e.text+=n,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(r!=="[")break;e.pending=n;continue;case 1:if(r!==" "&&r!=="x")break;e.pending=n;continue;case 2:if(r!=="]")break;e.pending=n;continue;case 3:if(r!==" ")break;e.renderer.add_token(e.renderer.data,26),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,op,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",it(e,n);continue;case 14:case 15:{let s="*",i=12;if(e.token===15&&(s="_",i=13),s===e.pending){if(Ee(e),s===r){at(e),e.pending="";continue}Ne(e,i),e.pending=r;continue}break}case 12:case 13:{let s="*",i=14;switch(e.token===13&&(s="_",i=15),e.pending){case s:s===r?e.tokens[e.len-1]===i?e.pending=n:(Ee(e),Ne(e,i),e.pending=""):(Ee(e),at(e),e.pending=r);continue;case s+s:let a=e.token;Ee(e),at(e),at(e),s!==r?(Ne(e,a),e.pending=r):e.pending="";continue}break}case 16:if(n==="~~"){Ee(e),at(e),e.pending="";continue}break;case 105:r===`
28
- `?(Ee(e),Ne(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",it(e,r));continue;case 30:if(n==="\\]"||n==="$$"){Ee(e),at(e),e.pending="";continue}break;case 31:if(n==="\\)"||e.pending[0]==="$"){Ee(e),at(e),r===")"?e.pending="":e.pending=r;continue}break;case 102:n==="http://"||n==="https://"?(Ee(e),Ne(e,18),e.pending=n,e.text=n):"http:/"[e.pending.length]===r||"https:/"[e.pending.length]===r?e.pending=n:(e.token=e.tokens[e.len],it(e,r));continue;case 17:case 19:if(e.pending==="]"){Ee(e),r==="("?e.pending=n:(at(e),e.pending=r);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(r===")"){let s=e.token===17?Bn:Ro,i=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,s,i),at(e),e.pending=""}else e.pending+=r;continue}break;case 18:r===" "||r===`
29
- `||r==="\\"?(e.renderer.set_attr(e.renderer.data,Bn,e.pending),Ee(e),at(e),e.pending=r):(e.text+=r,e.pending=n);continue;case 104:if(n.startsWith("<br")){if(n.length===3||r===" "||r==="/"&&(n.length===4||e.pending[e.pending.length-1]===" ")){e.pending=n;continue}if(r===">"){Ee(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),it(e,r);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(r){case"(":Ee(e),Ne(e,31),e.pending="";continue;case"[":e.token=105,e.pending=n;continue;case`
30
- `:e.pending=r;continue;default:let o=r.charCodeAt(0);e.pending="",e.text+=El(o)||o>=65&&o<=90||o>=97&&o<=122?n:r;continue}case`
31
- `:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:Ee(e),cn(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=r;continue;default:Ee(e),e.pending=r,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){Ee(e),e.pending=n,e.token=104;continue}break;case"`":if(e.token===19)break;r==="`"?(e.fence_start+=1,e.pending=n):(e.fence_start+=1,Ee(e),Ne(e,11),e.text=r===" "||r===`
32
- `?"":r,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let o=12,s=14,i=e.pending[0];if(i==="_"&&(o=13,s=15),e.pending.length===1){if(i===r){e.pending=n;continue}if(r!==" "&&r!==`
33
- `){Ee(e),Ne(e,o),e.pending=r;continue}}else{if(i===r){Ee(e),Ne(e,s),Ne(e,o),e.pending="";continue}if(r!==" "&&r!==`
34
- `){Ee(e),Ne(e,s),e.pending=r;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(r==="~"){e.pending=n;continue}}else if(r!==" "&&r!==`
35
- `){Ee(e),Ne(e,16),e.pending=r;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(r==="$"){e.token=105,e.pending=n;continue}else{if(Fh(r.charCodeAt(0)))break;Ee(e),Ne(e,31),e.pending=r;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&r!=="]"){Ee(e),Ne(e,17),e.pending=r;continue}break;case"!":if(e.token!==19&&r==="["){Ee(e),Ne(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&r===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&r==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=r,e.token=102;continue}e.text+=e.pending,e.pending=r}Ee(e)}function ni(e){return{add_token:jh,end_token:Ml,add_text:Ll,set_attr:Nl,data:{nodes:[e,,,,,],index:0}}}function jh(e,t){let r=e.nodes[e.index],n;switch(t){case 1:return;case 20:n=document.createElement("blockquote");break;case 2:n=document.createElement("p");break;case 21:n=document.createElement("br");break;case 22:n=document.createElement("hr");break;case 3:n=document.createElement("h1");break;case 4:n=document.createElement("h2");break;case 5:n=document.createElement("h3");break;case 6:n=document.createElement("h4");break;case 7:n=document.createElement("h5");break;case 8:n=document.createElement("h6");break;case 12:case 13:n=document.createElement("em");break;case 14:case 15:n=document.createElement("strong");break;case 16:n=document.createElement("s");break;case 11:n=document.createElement("code");break;case 18:case 17:n=document.createElement("a");break;case 19:n=document.createElement("img");break;case 23:n=document.createElement("ul");break;case 24:n=document.createElement("ol");break;case 25:n=document.createElement("li");break;case 26:let o=n=document.createElement("input");o.type="checkbox",o.disabled=!0;break;case 9:case 10:r=r.appendChild(document.createElement("pre")),n=document.createElement("code");break;case 27:n=document.createElement("table");break;case 28:switch(r.children.length){case 0:r=r.appendChild(document.createElement("thead"));break;case 1:r=r.appendChild(document.createElement("tbody"));break;default:r=r.children[1]}n=document.createElement("tr");break;case 29:n=document.createElement(r.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:n=document.createElement("equation-block");break;case 31:n=document.createElement("equation-inline");break}e.nodes[++e.index]=r.appendChild(n)}function Ml(e){e.index-=1}function Ll(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Nl(e,t,r){e.nodes[e.index].setAttribute(qh(t),r)}function xr({amount:e,currency:t},r){let n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??2;return new Intl.NumberFormat(r,{style:"currency",currency:t}).format(e/10**n)}function Ol(e,t){let r=new Date(e);return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeZone:e.length===10?"UTC":void 0}).format(r)}function sp(e){let t=Math.min(0,...e.map(o=>o.value)),n=Math.max(0,...e.map(o=>o.value))-t||1;return{baseline:148+t/n*136,barWidth:192/e.length,points:e.map((o,s)=>({x:24+(s+.5)*272/e.length,y:148-(o.value-t)/n*136}))}}function lp(e){let t=new Set(e.map(r=>{let n=r.typeName==="Cell"?r.props.children.length===1?r.props.children[0]:void 0:r;return n?.typeName==="Metric"?"Card":n?.typeName}));return t.size===1&&!t.has(void 0)}function cp({scrollLeft:e,scrollWidth:t,clientWidth:r}){let n=Math.abs(e);return{start:n>1,end:n<t-r-1}}function Lo(e){return/^https:\/\//i.test(e??"")}function $l(e,t){return(e??[]).flatMap(r=>r.url?Lo(r.url)?[{...r,url:r.url,message:void 0}]:[]:t?[{...r,url:void 0,message:r.label}]:[])}function Dl(e,t,r){return`${e}: ${[t,...Object.entries(r??{}).map(([n,o])=>`${n}: ${o}`)].join(", ")}`}function dp(e,t){return t!==void 0&&t.currency===e.currency&&t.amount>e.amount}function up(e,t){let r=e.variants??[],n=(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:r.length?c.values.filter(u=>!r.some(p=>p.available!==!1&&p.options[c.name]===u)):[]})),o=n.filter(c=>c.value===void 0).map(c=>c.name),s=Object.fromEntries(n.flatMap(c=>c.value===void 0?[]:[[c.name,c.value]])),i=o.length?void 0:r.find(c=>n.every(u=>c.options[u.name]===u.value)),a=!o.length&&r.length?i!==void 0&&i.available!==!1:e.available!==!1;return{options:n,missing:o,chosen:s,available:a,price:i?.price??e.price,compareAtPrice:i?.price?i.compareAtPrice:e.compareAtPrice,image:i?.image??e.image,canBuy:!o.length&&a}}var Hn={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"}},required:["Root","Grid","Cell","Carousel","Text","Card","Metric","Table","Chart","Product","Cart","Order"],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"}]}}},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"}]}}},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"}]}},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"}]}}},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"]}}},required:["title","body"],additionalProperties:!1},Metric:{type:"object",properties:{label:{type:"string"},value:{type:"string"},detail:{type:"string"}},required:["label","value","detail"],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"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"number"}},required:["label","value"],additionalProperties:!1}}},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"}},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"}}},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"]}}},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}}}};var pp=No;var Vh={type:"object",properties:{typeName:{const:"Grid"},statementId:{type:"string"},props:{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"}]}}},required:["columns","children"],additionalProperties:!1}},required:["typeName","statementId","props"]},Wh={type:"object",properties:{typeName:{const:"Cell"},statementId:{type:"string"},props:{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"}]}},span:{type:"integer",enum:[1,2,3,4],default:1}},required:["children"],additionalProperties:!1}},required:["typeName","statementId","props"]};function vt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=vt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.typeName===void 0&&(p="typeName")||e.statementId===void 0&&(p="statementId")||e.props===void 0&&(p="props"))return vt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.typeName!==void 0){let _=a;if(e.typeName!=="Text")return vt.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Text"}}],!1;var u=_===a}else var u=!0;if(u){if(e.statementId!==void 0){let _=a;if(typeof e.statementId!="string")return vt.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=_===a}else var u=!0;if(u)if(e.props!==void 0){let _=e.props,d=a;if(a===d)if(_&&typeof _=="object"&&!Array.isArray(_)){let v;if(_.text===void 0&&(v="text"))return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:v}}],!1;{let g=a;for(let P in _)if(P!=="text"){return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:P}}],!1;break}if(g===a&&_.text!==void 0&&typeof _.text!="string")return vt.errors=[{instancePath:t+"/props/text",schemaPath:"#/properties/props/properties/text/type",keyword:"type",params:{type:"string"}}],!1}}else return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=d===a}else var u=!0}}else return vt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return vt.errors=i,a===0}vt.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function tt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=tt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.label===void 0&&(p="label"))return tt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.label!==void 0){let _=a;if(typeof e.label!="string")return tt.errors=[{instancePath:t+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var u=_===a}else var u=!0;if(u){if(e.url!==void 0){let _=a;if(typeof e.url!="string")return tt.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var u=_===a}else var u=!0;if(u)if(e.primary!==void 0){let _=a;if(typeof e.primary!="boolean")return tt.errors=[{instancePath:t+"/primary",schemaPath:"#/properties/primary/type",keyword:"type",params:{type:"boolean"}}],!1;var u=_===a}else var u=!0}}else return tt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return tt.errors=i,a===0}tt.evaluated={props:{label:!0,url:!0,primary:!0},dynamicProps:!1,dynamicItems:!1};function Ke(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=Ke.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.typeName===void 0&&(d="typeName")||e.statementId===void 0&&(d="statementId")||e.props===void 0&&(d="props"))return Ke.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:d}}],!1;if(e.typeName!==void 0){let f=a;if(e.typeName!=="Card")return Ke.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Card"}}],!1;var u=f===a}else var u=!0;if(u){if(e.statementId!==void 0){let f=a;if(typeof e.statementId!="string")return Ke.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=f===a}else var u=!0;if(u)if(e.props!==void 0){let f=e.props,v=a;if(a===v)if(f&&typeof f=="object"&&!Array.isArray(f)){let P;if(f.title===void 0&&(P="title")||f.body===void 0&&(P="body"))return Ke.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:P}}],!1;{let b=a;for(let y in f)if(!(y==="title"||y==="body"||y==="actions")){return Ke.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:y}}],!1;break}if(b===a){if(f.title!==void 0){let y=a;if(typeof f.title!="string")return Ke.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=y===a}else var p=!0;if(p){if(f.body!==void 0){let y=a;if(typeof f.body!="string")return Ke.errors=[{instancePath:t+"/props/body",schemaPath:"#/properties/props/properties/body/type",keyword:"type",params:{type:"string"}}],!1;var p=y===a}else var p=!0;if(p)if(f.actions!==void 0){let y=f.actions,x=a;if(a===x)if(Array.isArray(y)){var _=!0;let k=y.length;for(let h=0;h<k;h++){let m=a;tt(y[h],{instancePath:t+"/props/actions/"+h,parentData:y,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(i=i===null?tt.errors:i.concat(tt.errors),a=i.length);var _=m===a;if(!_)break}}else return Ke.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var p=x===a}else var p=!0}}}}else return Ke.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=v===a}else var u=!0}}else return Ke.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ke.errors=i,a===0}Ke.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function st(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=st.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let _;if(e.typeName===void 0&&(_="typeName")||e.statementId===void 0&&(_="statementId")||e.props===void 0&&(_="props"))return st.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:_}}],!1;if(e.typeName!==void 0){let d=a;if(e.typeName!=="Metric")return st.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Metric"}}],!1;var u=d===a}else var u=!0;if(u){if(e.statementId!==void 0){let d=a;if(typeof e.statementId!="string")return st.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=d===a}else var u=!0;if(u)if(e.props!==void 0){let d=e.props,f=a;if(a===f)if(d&&typeof d=="object"&&!Array.isArray(d)){let g;if(d.label===void 0&&(g="label")||d.value===void 0&&(g="value")||d.detail===void 0&&(g="detail"))return st.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:g}}],!1;{let P=a;for(let b in d)if(!(b==="label"||b==="value"||b==="detail")){return st.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:b}}],!1;break}if(P===a){if(d.label!==void 0){let b=a;if(typeof d.label!="string")return st.errors=[{instancePath:t+"/props/label",schemaPath:"#/properties/props/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var p=b===a}else var p=!0;if(p){if(d.value!==void 0){let b=a;if(typeof d.value!="string")return st.errors=[{instancePath:t+"/props/value",schemaPath:"#/properties/props/properties/value/type",keyword:"type",params:{type:"string"}}],!1;var p=b===a}else var p=!0;if(p)if(d.detail!==void 0){let b=a;if(typeof d.detail!="string")return st.errors=[{instancePath:t+"/props/detail",schemaPath:"#/properties/props/properties/detail/type",keyword:"type",params:{type:"string"}}],!1;var p=b===a}else var p=!0}}}}else return st.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=f===a}else var u=!0}}else return st.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return st.errors=i,a===0}st.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Ge(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=Ge.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return Ge.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=a;if(e.typeName!=="Table")return Ge.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Table"}}],!1;var u=g===a}else var u=!0;if(u){if(e.statementId!==void 0){let g=a;if(typeof e.statementId!="string")return Ge.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===a}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,P=a;if(a===P)if(g&&typeof g=="object"&&!Array.isArray(g)){let y;if(g.title===void 0&&(y="title")||g.columns===void 0&&(y="columns")||g.rows===void 0&&(y="rows"))return Ge.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:y}}],!1;{let x=a;for(let S in g)if(!(S==="title"||S==="columns"||S==="rows")){return Ge.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:S}}],!1;break}if(x===a){if(g.title!==void 0){let S=a;if(typeof g.title!="string")return Ge.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=S===a}else var p=!0;if(p){if(g.columns!==void 0){let S=g.columns,k=a;if(a===k)if(Array.isArray(S)){var _=!0;let m=S.length;for(let w=0;w<m;w++){let A=a;if(typeof S[w]!="string")return Ge.errors=[{instancePath:t+"/props/columns/"+w,schemaPath:"#/properties/props/properties/columns/items/type",keyword:"type",params:{type:"string"}}],!1;var _=A===a;if(!_)break}}else return Ge.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/type",keyword:"type",params:{type:"array"}}],!1;var p=k===a}else var p=!0;if(p)if(g.rows!==void 0){let S=g.rows,k=a;if(a===k)if(Array.isArray(S)){var d=!0;let m=S.length;for(let w=0;w<m;w++){let A=S[w],I=a;if(a===I)if(Array.isArray(A)){var f=!0;let C=A.length;for(let M=0;M<C;M++){let N=a;if(typeof A[M]!="string")return Ge.errors=[{instancePath:t+"/props/rows/"+w+"/"+M,schemaPath:"#/properties/props/properties/rows/items/items/type",keyword:"type",params:{type:"string"}}],!1;var f=N===a;if(!f)break}}else return Ge.errors=[{instancePath:t+"/props/rows/"+w,schemaPath:"#/properties/props/properties/rows/items/type",keyword:"type",params:{type:"array"}}],!1;var d=I===a;if(!d)break}}else return Ge.errors=[{instancePath:t+"/props/rows",schemaPath:"#/properties/props/properties/rows/type",keyword:"type",params:{type:"array"}}],!1;var p=k===a}else var p=!0}}}}else return Ge.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=P===a}else var u=!0}}else return Ge.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ge.errors=i,a===0}Ge.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var Gh={type:"object",properties:{typeName:{const:"Chart"},statementId:{type:"string"},props:{type:"object",properties:{title:{type:"string"},type:{type:"string",enum:["bar","line"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"number"}},required:["label","value"],additionalProperties:!1}}},required:["title","type","data"],additionalProperties:!1}},required:["typeName","statementId","props"]};function De(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=De.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let f;if(e.typeName===void 0&&(f="typeName")||e.statementId===void 0&&(f="statementId")||e.props===void 0&&(f="props"))return De.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:f}}],!1;if(e.typeName!==void 0){let v=a;if(e.typeName!=="Chart")return De.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Chart"}}],!1;var u=v===a}else var u=!0;if(u){if(e.statementId!==void 0){let v=a;if(typeof e.statementId!="string")return De.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=v===a}else var u=!0;if(u)if(e.props!==void 0){let v=e.props,g=a;if(a===g)if(v&&typeof v=="object"&&!Array.isArray(v)){let b;if(v.title===void 0&&(b="title")||v.type===void 0&&(b="type")||v.data===void 0&&(b="data"))return De.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:b}}],!1;{let y=a;for(let x in v)if(!(x==="title"||x==="type"||x==="data")){return De.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x}}],!1;break}if(y===a){if(v.title!==void 0){let x=a;if(typeof v.title!="string")return De.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=x===a}else var p=!0;if(p){if(v.type!==void 0){let x=v.type,S=a;if(typeof x!="string")return De.errors=[{instancePath:t+"/props/type",schemaPath:"#/properties/props/properties/type/type",keyword:"type",params:{type:"string"}}],!1;if(!(x==="bar"||x==="line"))return De.errors=[{instancePath:t+"/props/type",schemaPath:"#/properties/props/properties/type/enum",keyword:"enum",params:{allowedValues:Gh.properties.props.properties.type.enum}}],!1;var p=S===a}else var p=!0;if(p)if(v.data!==void 0){let x=v.data,S=a;if(a===S)if(Array.isArray(x)){var _=!0;let h=x.length;for(let m=0;m<h;m++){let w=x[m],A=a;if(a===A)if(w&&typeof w=="object"&&!Array.isArray(w)){let R;if(w.label===void 0&&(R="label")||w.value===void 0&&(R="value"))return De.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/required",keyword:"required",params:{missingProperty:R}}],!1;{let C=a;for(let M in w)if(!(M==="label"||M==="value")){return De.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:M}}],!1;break}if(C===a){if(w.label!==void 0){let M=a;if(typeof w.label!="string")return De.errors=[{instancePath:t+"/props/data/"+m+"/label",schemaPath:"#/properties/props/properties/data/items/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var d=M===a}else var d=!0;if(d)if(w.value!==void 0){let M=w.value,N=a;if(!(typeof M=="number"&&isFinite(M)))return De.errors=[{instancePath:t+"/props/data/"+m+"/value",schemaPath:"#/properties/props/properties/data/items/properties/value/type",keyword:"type",params:{type:"number"}}],!1;var d=N===a}else var d=!0}}}else return De.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/type",keyword:"type",params:{type:"object"}}],!1;var _=A===a;if(!_)break}}else return De.errors=[{instancePath:t+"/props/data",schemaPath:"#/properties/props/properties/data/type",keyword:"type",params:{type:"array"}}],!1;var p=S===a}else var p=!0}}}}else return De.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=g===a}else var u=!0}}else return De.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return De.errors=i,a===0}De.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var Kh=new RegExp("^[A-Za-z]{3}$","u");function je(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=je.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.amount===void 0&&(p="amount")||e.currency===void 0&&(p="currency"))return je.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.amount!==void 0){let _=e.amount,d=a;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return je.errors=[{instancePath:t+"/amount",schemaPath:"#/properties/amount/type",keyword:"type",params:{type:"integer"}}],!1;var u=d===a}else var u=!0;if(u)if(e.currency!==void 0){let _=e.currency,d=a;if(a===d)if(typeof _=="string"){if(!Kh.test(_))return je.errors=[{instancePath:t+"/currency",schemaPath:"#/properties/currency/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z]{3}$"}}],!1}else return je.errors=[{instancePath:t+"/currency",schemaPath:"#/properties/currency/type",keyword:"type",params:{type:"string"}}],!1;var u=d===a}else var u=!0}else return je.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return je.errors=i,a===0}je.evaluated={props:{amount:!0,currency:!0},dynamicProps:!1,dynamicItems:!1};function Gt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=Gt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e))for(let p in e){let _=a;if(typeof e[p]!="string")return Gt.errors=[{instancePath:t+"/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/type",keyword:"type",params:{type:"string"}}],!1;var u=_===a;if(!u)break}else return Gt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Gt.errors=i,a===0}Gt.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};function de(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=de.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let x;if(e.typeName===void 0&&(x="typeName")||e.statementId===void 0&&(x="statementId")||e.props===void 0&&(x="props"))return de.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:x}}],!1;if(e.typeName!==void 0){let S=a;if(e.typeName!=="Product")return de.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Product"}}],!1;var u=S===a}else var u=!0;if(u){if(e.statementId!==void 0){let S=a;if(typeof e.statementId!="string")return de.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=S===a}else var u=!0;if(u)if(e.props!==void 0){let S=e.props,k=a;if(a===k)if(S&&typeof S=="object"&&!Array.isArray(S)){let m;if(S.product===void 0&&(m="product"))return de.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:m}}],!1;{let w=a;for(let A in S)if(!(A==="product"||A==="actions")){return de.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:A}}],!1;break}if(w===a){if(S.product!==void 0){let A=S.product,I=a;if(a===I)if(A&&typeof A=="object"&&!Array.isArray(A)){let R;if(A.title===void 0&&(R="title")||A.price===void 0&&(R="price"))return de.errors=[{instancePath:t+"/props/product",schemaPath:"#/properties/props/properties/product/required",keyword:"required",params:{missingProperty:R}}],!1;if(A.title!==void 0){let C=a;if(typeof A.title!="string")return de.errors=[{instancePath:t+"/props/product/title",schemaPath:"#/properties/props/properties/product/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=C===a}else var p=!0;if(p){if(A.price!==void 0){let C=a;je(A.price,{instancePath:t+"/props/product/price",parentData:A,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(i=i===null?je.errors:i.concat(je.errors),a=i.length);var p=C===a}else var p=!0;if(p){if(A.id!==void 0){let C=a;if(typeof A.id!="string")return de.errors=[{instancePath:t+"/props/product/id",schemaPath:"#/properties/props/properties/product/properties/id/type",keyword:"type",params:{type:"string"}}],!1;var p=C===a}else var p=!0;if(p){if(A.compareAtPrice!==void 0){let C=a;je(A.compareAtPrice,{instancePath:t+"/props/product/compareAtPrice",parentData:A,parentDataProperty:"compareAtPrice",rootData:o,dynamicAnchors:s})||(i=i===null?je.errors:i.concat(je.errors),a=i.length);var p=C===a}else var p=!0;if(p){if(A.image!==void 0){let C=a;if(typeof A.image!="string")return de.errors=[{instancePath:t+"/props/product/image",schemaPath:"#/properties/props/properties/product/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var p=C===a}else var p=!0;if(p){if(A.url!==void 0){let C=a;if(typeof A.url!="string")return de.errors=[{instancePath:t+"/props/product/url",schemaPath:"#/properties/props/properties/product/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var p=C===a}else var p=!0;if(p){if(A.description!==void 0){let C=a;if(typeof A.description!="string")return de.errors=[{instancePath:t+"/props/product/description",schemaPath:"#/properties/props/properties/product/properties/description/type",keyword:"type",params:{type:"string"}}],!1;var p=C===a}else var p=!0;if(p){if(A.badge!==void 0){let C=a;if(typeof A.badge!="string")return de.errors=[{instancePath:t+"/props/product/badge",schemaPath:"#/properties/props/properties/product/properties/badge/type",keyword:"type",params:{type:"string"}}],!1;var p=C===a}else var p=!0;if(p){if(A.rating!==void 0){let C=A.rating,M=a;if(a===M)if(C&&typeof C=="object"&&!Array.isArray(C)){let j;if(C.value===void 0&&(j="value"))return de.errors=[{instancePath:t+"/props/product/rating",schemaPath:"#/properties/props/properties/product/properties/rating/required",keyword:"required",params:{missingProperty:j}}],!1;if(C.value!==void 0){let G=C.value,z=a;if(!(typeof G=="number"&&isFinite(G)))return de.errors=[{instancePath:t+"/props/product/rating/value",schemaPath:"#/properties/props/properties/product/properties/rating/properties/value/type",keyword:"type",params:{type:"number"}}],!1;var _=z===a}else var _=!0;if(_)if(C.count!==void 0){let G=C.count,z=a;if(!(typeof G=="number"&&!(G%1)&&!isNaN(G)&&isFinite(G)))return de.errors=[{instancePath:t+"/props/product/rating/count",schemaPath:"#/properties/props/properties/product/properties/rating/properties/count/type",keyword:"type",params:{type:"integer"}}],!1;var _=z===a}else var _=!0}else return de.errors=[{instancePath:t+"/props/product/rating",schemaPath:"#/properties/props/properties/product/properties/rating/type",keyword:"type",params:{type:"object"}}],!1;var p=M===a}else var p=!0;if(p){if(A.available!==void 0){let C=a;if(typeof A.available!="boolean")return de.errors=[{instancePath:t+"/props/product/available",schemaPath:"#/properties/props/properties/product/properties/available/type",keyword:"type",params:{type:"boolean"}}],!1;var p=C===a}else var p=!0;if(p){if(A.options!==void 0){let C=A.options,M=a;if(a===M)if(Array.isArray(C)){var d=!0;let j=C.length;for(let G=0;G<j;G++){let z=C[G],le=a;if(a===le)if(z&&typeof z=="object"&&!Array.isArray(z)){let _e;if(z.name===void 0&&(_e="name")||z.values===void 0&&(_e="values"))return de.errors=[{instancePath:t+"/props/product/options/"+G,schemaPath:"#/properties/props/properties/product/properties/options/items/required",keyword:"required",params:{missingProperty:_e}}],!1;if(z.name!==void 0){let ae=a;if(typeof z.name!="string")return de.errors=[{instancePath:t+"/props/product/options/"+G+"/name",schemaPath:"#/properties/props/properties/product/properties/options/items/properties/name/type",keyword:"type",params:{type:"string"}}],!1;var f=ae===a}else var f=!0;if(f)if(z.values!==void 0){let ae=z.values,he=a;if(a===he)if(Array.isArray(ae)){var v=!0;let bt=ae.length;for(let Ve=0;Ve<bt;Ve++){let At=a;if(typeof ae[Ve]!="string")return de.errors=[{instancePath:t+"/props/product/options/"+G+"/values/"+Ve,schemaPath:"#/properties/props/properties/product/properties/options/items/properties/values/items/type",keyword:"type",params:{type:"string"}}],!1;var v=At===a;if(!v)break}}else return de.errors=[{instancePath:t+"/props/product/options/"+G+"/values",schemaPath:"#/properties/props/properties/product/properties/options/items/properties/values/type",keyword:"type",params:{type:"array"}}],!1;var f=he===a}else var f=!0}else return de.errors=[{instancePath:t+"/props/product/options/"+G,schemaPath:"#/properties/props/properties/product/properties/options/items/type",keyword:"type",params:{type:"object"}}],!1;var d=le===a;if(!d)break}}else return de.errors=[{instancePath:t+"/props/product/options",schemaPath:"#/properties/props/properties/product/properties/options/type",keyword:"type",params:{type:"array"}}],!1;var p=M===a}else var p=!0;if(p){if(A.variants!==void 0){let C=A.variants,M=a;if(a===M)if(Array.isArray(C)){var g=!0;let j=C.length;for(let G=0;G<j;G++){let z=C[G],le=a;if(a===le)if(z&&typeof z=="object"&&!Array.isArray(z)){let _e;if(z.options===void 0&&(_e="options"))return de.errors=[{instancePath:t+"/props/product/variants/"+G,schemaPath:"#/properties/props/properties/product/properties/variants/items/required",keyword:"required",params:{missingProperty:_e}}],!1;if(z.options!==void 0){let ae=a;Gt(z.options,{instancePath:t+"/props/product/variants/"+G+"/options",parentData:z,parentDataProperty:"options",rootData:o,dynamicAnchors:s})||(i=i===null?Gt.errors:i.concat(Gt.errors),a=i.length);var P=ae===a}else var P=!0;if(P){if(z.id!==void 0){let ae=a;if(typeof z.id!="string")return de.errors=[{instancePath:t+"/props/product/variants/"+G+"/id",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/id/type",keyword:"type",params:{type:"string"}}],!1;var P=ae===a}else var P=!0;if(P){if(z.price!==void 0){let ae=a;je(z.price,{instancePath:t+"/props/product/variants/"+G+"/price",parentData:z,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(i=i===null?je.errors:i.concat(je.errors),a=i.length);var P=ae===a}else var P=!0;if(P){if(z.compareAtPrice!==void 0){let ae=a;je(z.compareAtPrice,{instancePath:t+"/props/product/variants/"+G+"/compareAtPrice",parentData:z,parentDataProperty:"compareAtPrice",rootData:o,dynamicAnchors:s})||(i=i===null?je.errors:i.concat(je.errors),a=i.length);var P=ae===a}else var P=!0;if(P){if(z.image!==void 0){let ae=a;if(typeof z.image!="string")return de.errors=[{instancePath:t+"/props/product/variants/"+G+"/image",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var P=ae===a}else var P=!0;if(P)if(z.available!==void 0){let ae=a;if(typeof z.available!="boolean")return de.errors=[{instancePath:t+"/props/product/variants/"+G+"/available",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/available/type",keyword:"type",params:{type:"boolean"}}],!1;var P=ae===a}else var P=!0}}}}}else return de.errors=[{instancePath:t+"/props/product/variants/"+G,schemaPath:"#/properties/props/properties/product/properties/variants/items/type",keyword:"type",params:{type:"object"}}],!1;var g=le===a;if(!g)break}}else return de.errors=[{instancePath:t+"/props/product/variants",schemaPath:"#/properties/props/properties/product/properties/variants/type",keyword:"type",params:{type:"array"}}],!1;var p=M===a}else var p=!0;if(p)if(A.selected!==void 0){let C=a;Gt(A.selected,{instancePath:t+"/props/product/selected",parentData:A,parentDataProperty:"selected",rootData:o,dynamicAnchors:s})||(i=i===null?Gt.errors:i.concat(Gt.errors),a=i.length);var p=C===a}else var p=!0}}}}}}}}}}}}else return de.errors=[{instancePath:t+"/props/product",schemaPath:"#/properties/props/properties/product/type",keyword:"type",params:{type:"object"}}],!1;var b=I===a}else var b=!0;if(b)if(S.actions!==void 0){let A=S.actions,I=a;if(a===I)if(Array.isArray(A)){var y=!0;let C=A.length;for(let M=0;M<C;M++){let N=a;tt(A[M],{instancePath:t+"/props/actions/"+M,parentData:A,parentDataProperty:M,rootData:o,dynamicAnchors:s})||(i=i===null?tt.errors:i.concat(tt.errors),a=i.length);var y=N===a;if(!y)break}}else return de.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var b=I===a}else var b=!0}}}else return de.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=k===a}else var u=!0}}else return de.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return de.errors=i,a===0}de.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var Qh={type:"object",properties:{typeName:{const:"Cart"},statementId:{type:"string"},props:{type:"object",properties:{cart:{type:"object",properties:{lines:{type:"array",items:{$ref:"#/$defs/LineItem"}},totals:{type:"array",items:{$ref:"#/$defs/Total"}},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:{$ref:"#/$defs/Action"}}},required:["cart"],additionalProperties:!1}},required:["typeName","statementId","props"]};function Dt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=Dt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let _;if(e.title===void 0&&(_="title")||e.quantity===void 0&&(_="quantity")||e.price===void 0&&(_="price"))return Dt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:_}}],!1;if(e.title!==void 0){let d=a;if(typeof e.title!="string")return Dt.errors=[{instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var u=d===a}else var u=!0;if(u){if(e.quantity!==void 0){let d=e.quantity,f=a;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d)))return Dt.errors=[{instancePath:t+"/quantity",schemaPath:"#/properties/quantity/type",keyword:"type",params:{type:"integer"}}],!1;var u=f===a}else var u=!0;if(u){if(e.price!==void 0){let d=a;je(e.price,{instancePath:t+"/price",parentData:e,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(i=i===null?je.errors:i.concat(je.errors),a=i.length);var u=d===a}else var u=!0;if(u){if(e.image!==void 0){let d=a;if(typeof e.image!="string")return Dt.errors=[{instancePath:t+"/image",schemaPath:"#/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var u=d===a}else var u=!0;if(u){if(e.url!==void 0){let d=a;if(typeof e.url!="string")return Dt.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var u=d===a}else var u=!0;if(u){if(e.options!==void 0){let d=a;Gt(e.options,{instancePath:t+"/options",parentData:e,parentDataProperty:"options",rootData:o,dynamicAnchors:s})||(i=i===null?Gt.errors:i.concat(Gt.errors),a=i.length);var u=d===a}else var u=!0;if(u)if(e.actions!==void 0){let d=e.actions,f=a;if(a===f)if(Array.isArray(d)){var p=!0;let g=d.length;for(let P=0;P<g;P++){let b=a;tt(d[P],{instancePath:t+"/actions/"+P,parentData:d,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(i=i===null?tt.errors:i.concat(tt.errors),a=i.length);var p=b===a;if(!p)break}}else return Dt.errors=[{instancePath:t+"/actions",schemaPath:"#/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var u=f===a}else var u=!0}}}}}}else return Dt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Dt.errors=i,a===0}Dt.evaluated={props:{title:!0,quantity:!0,price:!0,image:!0,url:!0,options:!0,actions:!0},dynamicProps:!1,dynamicItems:!1};function tr(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=tr.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.label===void 0&&(p="label")||e.amount===void 0&&(p="amount"))return tr.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.label!==void 0){let _=a;if(typeof e.label!="string")return tr.errors=[{instancePath:t+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var u=_===a}else var u=!0;if(u)if(e.amount!==void 0){let _=a;je(e.amount,{instancePath:t+"/amount",parentData:e,parentDataProperty:"amount",rootData:o,dynamicAnchors:s})||(i=i===null?je.errors:i.concat(je.errors),a=i.length);var u=_===a}else var u=!0}else return tr.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return tr.errors=i,a===0}tr.evaluated={props:{label:!0,amount:!0},dynamicProps:!1,dynamicItems:!1};function Me(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=Me.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let b;if(e.typeName===void 0&&(b="typeName")||e.statementId===void 0&&(b="statementId")||e.props===void 0&&(b="props"))return Me.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:b}}],!1;if(e.typeName!==void 0){let y=a;if(e.typeName!=="Cart")return Me.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Cart"}}],!1;var u=y===a}else var u=!0;if(u){if(e.statementId!==void 0){let y=a;if(typeof e.statementId!="string")return Me.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=y===a}else var u=!0;if(u)if(e.props!==void 0){let y=e.props,x=a;if(a===x)if(y&&typeof y=="object"&&!Array.isArray(y)){let k;if(y.cart===void 0&&(k="cart"))return Me.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:k}}],!1;{let h=a;for(let m in y)if(!(m==="cart"||m==="actions")){return Me.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m}}],!1;break}if(h===a){if(y.cart!==void 0){let m=y.cart,w=a;if(a===w)if(m&&typeof m=="object"&&!Array.isArray(m)){let A;if(m.lines===void 0&&(A="lines")||m.totals===void 0&&(A="totals"))return Me.errors=[{instancePath:t+"/props/cart",schemaPath:"#/properties/props/properties/cart/required",keyword:"required",params:{missingProperty:A}}],!1;if(m.lines!==void 0){let I=m.lines,R=a;if(a===R)if(Array.isArray(I)){var p=!0;let C=I.length;for(let M=0;M<C;M++){let N=a;Dt(I[M],{instancePath:t+"/props/cart/lines/"+M,parentData:I,parentDataProperty:M,rootData:o,dynamicAnchors:s})||(i=i===null?Dt.errors:i.concat(Dt.errors),a=i.length);var p=N===a;if(!p)break}}else return Me.errors=[{instancePath:t+"/props/cart/lines",schemaPath:"#/properties/props/properties/cart/properties/lines/type",keyword:"type",params:{type:"array"}}],!1;var _=R===a}else var _=!0;if(_){if(m.totals!==void 0){let I=m.totals,R=a;if(a===R)if(Array.isArray(I)){var d=!0;let M=I.length;for(let N=0;N<M;N++){let j=a;tr(I[N],{instancePath:t+"/props/cart/totals/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(i=i===null?tr.errors:i.concat(tr.errors),a=i.length);var d=j===a;if(!d)break}}else return Me.errors=[{instancePath:t+"/props/cart/totals",schemaPath:"#/properties/props/properties/cart/properties/totals/type",keyword:"type",params:{type:"array"}}],!1;var _=R===a}else var _=!0;if(_)if(m.messages!==void 0){let I=m.messages,R=a;if(a===R)if(Array.isArray(I)){var f=!0;let M=I.length;for(let N=0;N<M;N++){let j=I[N],G=a;if(a===G)if(j&&typeof j=="object"&&!Array.isArray(j)){let le;if(j.text===void 0&&(le="text")||j.severity===void 0&&(le="severity"))return Me.errors=[{instancePath:t+"/props/cart/messages/"+N,schemaPath:"#/properties/props/properties/cart/properties/messages/items/required",keyword:"required",params:{missingProperty:le}}],!1;if(j.text!==void 0){let ue=a;if(typeof j.text!="string")return Me.errors=[{instancePath:t+"/props/cart/messages/"+N+"/text",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/text/type",keyword:"type",params:{type:"string"}}],!1;var v=ue===a}else var v=!0;if(v)if(j.severity!==void 0){let ue=j.severity,_e=a;if(typeof ue!="string")return Me.errors=[{instancePath:t+"/props/cart/messages/"+N+"/severity",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/severity/type",keyword:"type",params:{type:"string"}}],!1;if(!(ue==="info"||ue==="warning"||ue==="error"))return Me.errors=[{instancePath:t+"/props/cart/messages/"+N+"/severity",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/severity/enum",keyword:"enum",params:{allowedValues:Qh.properties.props.properties.cart.properties.messages.items.properties.severity.enum}}],!1;var v=_e===a}else var v=!0}else return Me.errors=[{instancePath:t+"/props/cart/messages/"+N,schemaPath:"#/properties/props/properties/cart/properties/messages/items/type",keyword:"type",params:{type:"object"}}],!1;var f=G===a;if(!f)break}}else return Me.errors=[{instancePath:t+"/props/cart/messages",schemaPath:"#/properties/props/properties/cart/properties/messages/type",keyword:"type",params:{type:"array"}}],!1;var _=R===a}else var _=!0}}else return Me.errors=[{instancePath:t+"/props/cart",schemaPath:"#/properties/props/properties/cart/type",keyword:"type",params:{type:"object"}}],!1;var g=w===a}else var g=!0;if(g)if(y.actions!==void 0){let m=y.actions,w=a;if(a===w)if(Array.isArray(m)){var P=!0;let I=m.length;for(let R=0;R<I;R++){let C=a;tt(m[R],{instancePath:t+"/props/actions/"+R,parentData:m,parentDataProperty:R,rootData:o,dynamicAnchors:s})||(i=i===null?tt.errors:i.concat(tt.errors),a=i.length);var P=C===a;if(!P)break}}else return Me.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var g=w===a}else var g=!0}}}else return Me.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=x===a}else var u=!0}}else return Me.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Me.errors=i,a===0}Me.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Ce(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=Ce.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let b;if(e.typeName===void 0&&(b="typeName")||e.statementId===void 0&&(b="statementId")||e.props===void 0&&(b="props"))return Ce.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:b}}],!1;if(e.typeName!==void 0){let y=a;if(e.typeName!=="Order")return Ce.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Order"}}],!1;var u=y===a}else var u=!0;if(u){if(e.statementId!==void 0){let y=a;if(typeof e.statementId!="string")return Ce.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=y===a}else var u=!0;if(u)if(e.props!==void 0){let y=e.props,x=a;if(a===x)if(y&&typeof y=="object"&&!Array.isArray(y)){let k;if(y.order===void 0&&(k="order"))return Ce.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:k}}],!1;{let h=a;for(let m in y)if(!(m==="order"||m==="actions")){return Ce.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m}}],!1;break}if(h===a){if(y.order!==void 0){let m=y.order,w=a;if(a===w)if(m&&typeof m=="object"&&!Array.isArray(m)){let A;if(m.number===void 0&&(A="number")||m.status===void 0&&(A="status")||m.items===void 0&&(A="items")||m.totals===void 0&&(A="totals"))return Ce.errors=[{instancePath:t+"/props/order",schemaPath:"#/properties/props/properties/order/required",keyword:"required",params:{missingProperty:A}}],!1;if(m.number!==void 0){let I=a;if(typeof m.number!="string")return Ce.errors=[{instancePath:t+"/props/order/number",schemaPath:"#/properties/props/properties/order/properties/number/type",keyword:"type",params:{type:"string"}}],!1;var p=I===a}else var p=!0;if(p){if(m.status!==void 0){let I=a;if(typeof m.status!="string")return Ce.errors=[{instancePath:t+"/props/order/status",schemaPath:"#/properties/props/properties/order/properties/status/type",keyword:"type",params:{type:"string"}}],!1;var p=I===a}else var p=!0;if(p){if(m.date!==void 0){let I=a;if(typeof m.date!="string")return Ce.errors=[{instancePath:t+"/props/order/date",schemaPath:"#/properties/props/properties/order/properties/date/type",keyword:"type",params:{type:"string"}}],!1;var p=I===a}else var p=!0;if(p){if(m.items!==void 0){let I=m.items,R=a;if(a===R)if(Array.isArray(I)){var _=!0;let M=I.length;for(let N=0;N<M;N++){let j=a;Dt(I[N],{instancePath:t+"/props/order/items/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(i=i===null?Dt.errors:i.concat(Dt.errors),a=i.length);var _=j===a;if(!_)break}}else return Ce.errors=[{instancePath:t+"/props/order/items",schemaPath:"#/properties/props/properties/order/properties/items/type",keyword:"type",params:{type:"array"}}],!1;var p=R===a}else var p=!0;if(p){if(m.totals!==void 0){let I=m.totals,R=a;if(a===R)if(Array.isArray(I)){var d=!0;let M=I.length;for(let N=0;N<M;N++){let j=a;tr(I[N],{instancePath:t+"/props/order/totals/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(i=i===null?tr.errors:i.concat(tr.errors),a=i.length);var d=j===a;if(!d)break}}else return Ce.errors=[{instancePath:t+"/props/order/totals",schemaPath:"#/properties/props/properties/order/properties/totals/type",keyword:"type",params:{type:"array"}}],!1;var p=R===a}else var p=!0;if(p)if(m.timeline!==void 0){let I=m.timeline,R=a;if(a===R)if(Array.isArray(I)){var f=!0;let M=I.length;for(let N=0;N<M;N++){let j=I[N],G=a;if(a===G)if(j&&typeof j=="object"&&!Array.isArray(j)){let le;if(j.label===void 0&&(le="label")||j.done===void 0&&(le="done"))return Ce.errors=[{instancePath:t+"/props/order/timeline/"+N,schemaPath:"#/properties/props/properties/order/properties/timeline/items/required",keyword:"required",params:{missingProperty:le}}],!1;if(j.label!==void 0){let ue=a;if(typeof j.label!="string")return Ce.errors=[{instancePath:t+"/props/order/timeline/"+N+"/label",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var v=ue===a}else var v=!0;if(v){if(j.done!==void 0){let ue=a;if(typeof j.done!="boolean")return Ce.errors=[{instancePath:t+"/props/order/timeline/"+N+"/done",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/done/type",keyword:"type",params:{type:"boolean"}}],!1;var v=ue===a}else var v=!0;if(v)if(j.date!==void 0){let ue=a;if(typeof j.date!="string")return Ce.errors=[{instancePath:t+"/props/order/timeline/"+N+"/date",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/date/type",keyword:"type",params:{type:"string"}}],!1;var v=ue===a}else var v=!0}}else return Ce.errors=[{instancePath:t+"/props/order/timeline/"+N,schemaPath:"#/properties/props/properties/order/properties/timeline/items/type",keyword:"type",params:{type:"object"}}],!1;var f=G===a;if(!f)break}}else return Ce.errors=[{instancePath:t+"/props/order/timeline",schemaPath:"#/properties/props/properties/order/properties/timeline/type",keyword:"type",params:{type:"array"}}],!1;var p=R===a}else var p=!0}}}}}else return Ce.errors=[{instancePath:t+"/props/order",schemaPath:"#/properties/props/properties/order/type",keyword:"type",params:{type:"object"}}],!1;var g=w===a}else var g=!0;if(g)if(y.actions!==void 0){let m=y.actions,w=a;if(a===w)if(Array.isArray(m)){var P=!0;let I=m.length;for(let R=0;R<I;R++){let C=a;tt(m[R],{instancePath:t+"/props/actions/"+R,parentData:m,parentDataProperty:R,rootData:o,dynamicAnchors:s})||(i=i===null?tt.errors:i.concat(tt.errors),a=i.length);var P=C===a;if(!P)break}}else return Ce.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var g=w===a}else var g=!0}}}else return Ce.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=x===a}else var u=!0}}else return Ce.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ce.errors=i,a===0}Ce.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function gt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=gt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return gt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=a;if(e.typeName!=="Cell")return gt.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Cell"}}],!1;var u=g===a}else var u=!0;if(u){if(e.statementId!==void 0){let g=a;if(typeof e.statementId!="string")return gt.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===a}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,P=a;if(a===P)if(g&&typeof g=="object"&&!Array.isArray(g)){let y;if(g.children===void 0&&(y="children"))return gt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:y}}],!1;{let x=a;for(let S in g)if(!(S==="children"||S==="span")){return gt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:S}}],!1;break}if(x===a){if(g.children!==void 0){let S=g.children,k=a;if(a===k)if(Array.isArray(S)){var p=!0;let h=S.length;for(let m=0;m<h;m++){let w=S[m],A=a,I=a,R=!1,C=a;vt(w,{instancePath:t+"/props/children/"+m,parentData:S,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(i=i===null?vt.errors:i.concat(vt.errors),a=i.length);var d=C===a;if(R=R||d,d){var _={};_.typeName=!0,_.statementId=!0,_.props=!0}let M=a;Ke(w,{instancePath:t+"/props/children/"+m,parentData:S,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(i=i===null?Ke.errors:i.concat(Ke.errors),a=i.length);var d=M===a;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let N=a;st(w,{instancePath:t+"/props/children/"+m,parentData:S,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(i=i===null?st.errors:i.concat(st.errors),a=i.length);var d=N===a;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let j=a;Ge(w,{instancePath:t+"/props/children/"+m,parentData:S,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(i=i===null?Ge.errors:i.concat(Ge.errors),a=i.length);var d=j===a;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let G=a;De(w,{instancePath:t+"/props/children/"+m,parentData:S,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(i=i===null?De.errors:i.concat(De.errors),a=i.length);var d=G===a;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let z=a;de(w,{instancePath:t+"/props/children/"+m,parentData:S,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(i=i===null?de.errors:i.concat(de.errors),a=i.length);var d=z===a;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let le=a;Me(w,{instancePath:t+"/props/children/"+m,parentData:S,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(i=i===null?Me.errors:i.concat(Me.errors),a=i.length);var d=le===a;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let ue=a;Ce(w,{instancePath:t+"/props/children/"+m,parentData:S,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(i=i===null?Ce.errors:i.concat(Ce.errors),a=i.length);var d=ue===a;if(R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0),R)a=I,i!==null&&(I?i.length=I:i=null);else{let ae={instancePath:t+"/props/children/"+m,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return i===null?i=[ae]:i.push(ae),a++,gt.errors=i,!1}var p=A===a;if(!p)break}}else return gt.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1;var f=k===a}else var f=!0;if(f)if(g.span!==void 0){let S=g.span,k=a;if(!(typeof S=="number"&&!(S%1)&&!isNaN(S)&&isFinite(S)))return gt.errors=[{instancePath:t+"/props/span",schemaPath:"#/properties/props/properties/span/type",keyword:"type",params:{type:"integer"}}],!1;if(!(S===1||S===2||S===3||S===4))return gt.errors=[{instancePath:t+"/props/span",schemaPath:"#/properties/props/properties/span/enum",keyword:"enum",params:{allowedValues:Wh.properties.props.properties.span.enum}}],!1;var f=k===a}else var f=!0}}}else return gt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=P===a}else var u=!0}}else return gt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return gt.errors=i,a===0}gt.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Mt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=Mt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return Mt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=a;if(e.typeName!=="Grid")return Mt.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Grid"}}],!1;var u=g===a}else var u=!0;if(u){if(e.statementId!==void 0){let g=a;if(typeof e.statementId!="string")return Mt.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===a}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,P=a;if(a===P)if(g&&typeof g=="object"&&!Array.isArray(g)){let y;if(g.columns===void 0&&(y="columns")||g.children===void 0&&(y="children"))return Mt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:y}}],!1;{let x=a;for(let S in g)if(!(S==="columns"||S==="children")){return Mt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:S}}],!1;break}if(x===a){if(g.columns!==void 0){let S=g.columns,k=a;if(!(typeof S=="number"&&!(S%1)&&!isNaN(S)&&isFinite(S)))return Mt.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/type",keyword:"type",params:{type:"integer"}}],!1;if(!(S===1||S===2||S===3||S===4))return Mt.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/enum",keyword:"enum",params:{allowedValues:Vh.properties.props.properties.columns.enum}}],!1;var p=k===a}else var p=!0;if(p)if(g.children!==void 0){let S=g.children,k=a;if(a===k)if(Array.isArray(S)){var _=!0;let m=S.length;for(let w=0;w<m;w++){let A=S[w],I=a,R=a,C=!1,M=a;gt(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?gt.errors:i.concat(gt.errors),a=i.length);var f=M===a;if(C=C||f,f){var d={};d.typeName=!0,d.statementId=!0,d.props=!0}let N=a;vt(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?vt.errors:i.concat(vt.errors),a=i.length);var f=N===a;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let j=a;Ke(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?Ke.errors:i.concat(Ke.errors),a=i.length);var f=j===a;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let G=a;st(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?st.errors:i.concat(st.errors),a=i.length);var f=G===a;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let z=a;Ge(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?Ge.errors:i.concat(Ge.errors),a=i.length);var f=z===a;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let le=a;De(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?De.errors:i.concat(De.errors),a=i.length);var f=le===a;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let ue=a;de(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?de.errors:i.concat(de.errors),a=i.length);var f=ue===a;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let _e=a;Me(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?Me.errors:i.concat(Me.errors),a=i.length);var f=_e===a;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let ae=a;Ce(A,{instancePath:t+"/props/children/"+w,parentData:S,parentDataProperty:w,rootData:o,dynamicAnchors:s})||(i=i===null?Ce.errors:i.concat(Ce.errors),a=i.length);var f=ae===a;if(C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0),C)a=R,i!==null&&(R?i.length=R:i=null);else{let Je={instancePath:t+"/props/children/"+w,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return i===null?i=[Je]:i.push(Je),a++,Mt.errors=i,!1}var _=I===a;if(!_)break}}else return Mt.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1;var p=k===a}else var p=!0}}}else return Mt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=P===a}else var u=!0}}else return Mt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Mt.errors=i,a===0}Mt.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Ht(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=Ht.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),a===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let f;if(e.typeName===void 0&&(f="typeName")||e.statementId===void 0&&(f="statementId")||e.props===void 0&&(f="props"))return Ht.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:f}}],!1;if(e.typeName!==void 0){let v=a;if(e.typeName!=="Carousel")return Ht.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Carousel"}}],!1;var u=v===a}else var u=!0;if(u){if(e.statementId!==void 0){let v=a;if(typeof e.statementId!="string")return Ht.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=v===a}else var u=!0;if(u)if(e.props!==void 0){let v=e.props,g=a;if(a===g)if(v&&typeof v=="object"&&!Array.isArray(v)){let b;if(v.children===void 0&&(b="children"))return Ht.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:b}}],!1;{let y=a;for(let x in v)if(x!=="children"){return Ht.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x}}],!1;break}if(y===a&&v.children!==void 0){let x=v.children;if(a===a)if(Array.isArray(x)){var p=!0;let k=x.length;for(let h=0;h<k;h++){let m=x[h],w=a,A=a,I=!1,R=a;Ke(m,{instancePath:t+"/props/children/"+h,parentData:x,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(i=i===null?Ke.errors:i.concat(Ke.errors),a=i.length);var d=R===a;if(I=I||d,d){var _={};_.typeName=!0,_.statementId=!0,_.props=!0}let C=a;de(m,{instancePath:t+"/props/children/"+h,parentData:x,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(i=i===null?de.errors:i.concat(de.errors),a=i.length);var d=C===a;if(I=I||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0),I)a=A,i!==null&&(A?i.length=A:i=null);else{let N={instancePath:t+"/props/children/"+h,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return i===null?i=[N]:i.push(N),a++,Ht.errors=i,!1}var p=w===a;if(!p)break}}else return Ht.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1}}}else return Ht.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=g===a}else var u=!0}}else return Ht.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ht.errors=i,a===0}Ht.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function No(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let i=null,a=0,c=No.evaluated;c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0);let u=a,p=!1,_=a;Mt(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?Mt.errors:i.concat(Mt.errors),a=i.length);var m=_===a;if(p=p||m,m){var d={};d.typeName=!0,d.statementId=!0,d.props=!0}let f=a;gt(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?gt.errors:i.concat(gt.errors),a=i.length);var m=f===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let v=a;Ht(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?Ht.errors:i.concat(Ht.errors),a=i.length);var m=v===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let g=a;vt(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?vt.errors:i.concat(vt.errors),a=i.length);var m=g===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let P=a;Ke(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?Ke.errors:i.concat(Ke.errors),a=i.length);var m=P===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let b=a;st(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?st.errors:i.concat(st.errors),a=i.length);var m=b===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let y=a;Ge(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?Ge.errors:i.concat(Ge.errors),a=i.length);var m=y===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let x=a;De(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?De.errors:i.concat(De.errors),a=i.length);var m=x===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let S=a;de(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?de.errors:i.concat(de.errors),a=i.length);var m=S===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let k=a;Me(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?Me.errors:i.concat(Me.errors),a=i.length);var m=k===a;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let h=a;Ce(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(i=i===null?Ce.errors:i.concat(Ce.errors),a=i.length);var m=h===a;if(p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0),p)a=u,i!==null&&(u?i.length=u:i=null);else{let w={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{}};return i===null?i=[w]:i.push(w),a++,No.errors=i,!1}return No.errors=i,c.props=d,a===0}No.evaluated={dynamicProps:!0,dynamicItems:!1};function _p(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 Yh=new Set(["Comp","Ref","StateRef","RuntimeRef","BinOp","UnaryOp","Ternary","Member","Index","Assign","Str","Num","Bool","Null","Arr","Obj","Ph"]);function dn(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Yh.has(e.k)}function Oo(e,t){let r=n=>{switch(t(n),n.k){case"Comp":n.args.forEach(r),Object.values(n.mappedProps??{}).forEach(r);break;case"Arr":n.els.forEach(r);break;case"Obj":n.entries.forEach(([,o])=>r(o));break;case"BinOp":r(n.left),r(n.right);break;case"UnaryOp":r(n.operand);break;case"Ternary":r(n.cond),r(n.then),r(n.else);break;case"Member":r(n.obj);break;case"Index":r(n.obj),r(n.index);break;case"Assign":r(n.value);break}};r(e)}function oi(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(oi)}:typeof e=="object"?{k:"Obj",entries:Object.entries(e).map(([t,r])=>[t,oi(r)])}:{k:"Null"}}function ai(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 r of e.els){let n=ai(r);if(!n)return;t.push(n.v)}return{v:t}}case"Obj":{let t={};for(let[r,n]of e.entries){let o=ai(n);if(!o)return;t[r]=o.v}return{v:t}}default:return}}var ii=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}]]),fp={ActionExpression:!0,OpenUrl:!0,ToAssistant:!0},Hr={Query:"Query",Mutation:"Mutation"};function $o(e){return e?.callDefs??ii}function Do(e){return ii.has(e)}function Fn(e){return e in Hr}var E;(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"})(E||(E={}));var Xh=1,mp=2,gp=3,ql=4,qo=5,Ul=6,si=7,vp=8,Jh=9;function li(e){let t=0,r=()=>e[t]??{t:E.EOF},n=()=>{let d=r();return t++,d},o=d=>{r().t===d&&t++};function s(d){switch(d.t){case E.Question:return Xh;case E.Or:return mp;case E.And:return gp;case E.EqEq:case E.NotEq:return ql;case E.Greater:case E.Less:case E.GreaterEq:case E.LessEq:return qo;case E.Plus:case E.Minus:return Ul;case E.Star:case E.Slash:case E.Percent:return si;case E.Dot:case E.LBrack:return Jh;default:return 0}}function i(d=0){let f=a();for(;s(r())>d;)f=c(f);return f}function a(){let d=r();if(d.t===E.Str)return n(),{k:"Str",v:d.v};if(d.t===E.Num)return n(),{k:"Num",v:d.v};if(d.t===E.True)return n(),{k:"Bool",v:!0};if(d.t===E.False)return n(),{k:"Bool",v:!1};if(d.t===E.Null)return n(),{k:"Null"};if(d.t===E.LBrack)return p();if(d.t===E.LBrace)return _();if(d.t===E.StateVar){let f=d.v;if(n(),r().t===E.Equals){n();let v=i(0);return{k:"Assign",target:f,value:v}}return{k:"StateRef",n:f}}if(d.t===E.Type){let f=d.v;return e[t+1]?.t===E.LParen&&(!Do(f)||f==="Action")?u():(n(),{k:"Ref",n:f})}if(d.t===E.BuiltinCall){if(e[t+1]?.t===E.LParen){let f=u();return f.k==="Comp"&&!Do(f.name)&&(f.fn=!0),f}return n(),{k:"Ref",n:d.v}}if(d.t===E.Ident)return n(),{k:"Ref",n:d.v};if(d.t===E.Not)return n(),{k:"UnaryOp",op:"!",operand:i(vp)};if(d.t===E.Minus)return n(),{k:"UnaryOp",op:"-",operand:i(vp)};if(d.t===E.LParen){n();let f=i(0);return o(E.RParen),f}return n(),{k:"Null"}}function c(d){let f=r();if(f.t===E.Plus)return n(),{k:"BinOp",op:"+",left:d,right:i(Ul)};if(f.t===E.Minus)return n(),{k:"BinOp",op:"-",left:d,right:i(Ul)};if(f.t===E.Star)return n(),{k:"BinOp",op:"*",left:d,right:i(si)};if(f.t===E.Slash)return n(),{k:"BinOp",op:"/",left:d,right:i(si)};if(f.t===E.Percent)return n(),{k:"BinOp",op:"%",left:d,right:i(si)};if(f.t===E.EqEq)return n(),{k:"BinOp",op:"==",left:d,right:i(ql)};if(f.t===E.NotEq)return n(),{k:"BinOp",op:"!=",left:d,right:i(ql)};if(f.t===E.Greater)return n(),{k:"BinOp",op:">",left:d,right:i(qo)};if(f.t===E.Less)return n(),{k:"BinOp",op:"<",left:d,right:i(qo)};if(f.t===E.GreaterEq)return n(),{k:"BinOp",op:">=",left:d,right:i(qo)};if(f.t===E.LessEq)return n(),{k:"BinOp",op:"<=",left:d,right:i(qo)};if(f.t===E.And)return n(),{k:"BinOp",op:"&&",left:d,right:i(gp)};if(f.t===E.Or)return n(),{k:"BinOp",op:"||",left:d,right:i(mp)};if(f.t===E.Question){n();let v=i(0);o(E.Colon);let g=i(0);return{k:"Ternary",cond:d,then:v,else:g}}if(f.t===E.Dot){n();let v=r(),g=v.t===E.Ident||v.t===E.Type||v.t===E.Str||v.t===E.Num?(n(),String(v.v)):v.t===E.StateVar?(n(),v.v.replace(/^\$/,"")):(n(),"?");return{k:"Member",obj:d,field:g}}if(f.t===E.LBrack){n();let v=i(0);return o(E.RBrack),{k:"Index",obj:d,index:v}}return d}function u(){let d=r().v;n(),o(E.LParen);let f=[];for(;r().t!==E.RParen&&r().t!==E.EOF;)f.push(i(0)),r().t===E.Comma&&n();return o(E.RParen),{k:"Comp",name:d,args:f}}function p(){n();let d=[];for(;r().t!==E.RBrack&&r().t!==E.EOF;)d.push(i(0)),r().t===E.Comma&&n();return o(E.RBrack),{k:"Arr",els:d}}function _(){n();let d=[];for(;r().t!==E.RBrace&&r().t!==E.EOF;){let f=r(),v=f.t===E.Ident||f.t===E.Str||f.t===E.Type||f.t===E.Num?(n(),String(f.v)):f.t===E.StateVar?(n(),f.v.replace(/^\$/,"")):(n(),"?");o(E.Colon),d.push([v,i(0)]),r().t===E.Comma&&n()}return o(E.RBrace),{k:"Obj",entries:d}}return i(0)}function ci(e){let t=[],r=0,n=e.length;for(;r<n;){for(;r<n&&(e[r]===" "||e[r]===" "||e[r]==="\r");)r++;if(r>=n)break;let o=e[r];if(o===`
24
+ `:e.pending=n;continue;default:e.pending.length!==0?(Me(e),nt(e),e.pending=r):e.text+=r;continue}case 10:switch(r){case"`":e.pending=n;continue;case`
25
+ `:if(n.length===e.fence_start+e.fence_end+1){Me(e),nt(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
26
+ `){e.pending=n,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=r,e.fence_end=1;continue;case 11:switch(r){case"`":n.length===e.fence_start+ +(e.pending[0]===" ")?(Me(e),nt(e),e.pending="",e.fence_start=0):e.pending=n;continue;case`
27
+ `:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,Me(e);continue;case" ":e.text+=e.pending,e.pending=r;continue;default:e.text+=n,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(r!=="[")break;e.pending=n;continue;case 1:if(r!==" "&&r!=="x")break;e.pending=n;continue;case 2:if(r!=="]")break;e.pending=n;continue;case 3:if(r!==" ")break;e.renderer.add_token(e.renderer.data,26),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,dp,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",ot(e,n);continue;case 14:case 15:{let s="*",a=12;if(e.token===15&&(s="_",a=13),s===e.pending){if(Me(e),s===r){nt(e),e.pending="";continue}Ne(e,a),e.pending=r;continue}break}case 12:case 13:{let s="*",a=14;switch(e.token===13&&(s="_",a=15),e.pending){case s:s===r?e.tokens[e.len-1]===a?e.pending=n:(Me(e),Ne(e,a),e.pending=""):(Me(e),nt(e),e.pending=r);continue;case s+s:let i=e.token;Me(e),nt(e),nt(e),s!==r?(Ne(e,i),e.pending=r):e.pending="";continue}break}case 16:if(n==="~~"){Me(e),nt(e),e.pending="";continue}break;case 105:r===`
28
+ `?(Me(e),Ne(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",ot(e,r));continue;case 30:if(n==="\\]"||n==="$$"){Me(e),nt(e),e.pending="";continue}break;case 31:if(n==="\\)"||e.pending[0]==="$"){Me(e),nt(e),r===")"?e.pending="":e.pending=r;continue}break;case 102:n==="http://"||n==="https://"?(Me(e),Ne(e,18),e.pending=n,e.text=n):"http:/"[e.pending.length]===r||"https:/"[e.pending.length]===r?e.pending=n:(e.token=e.tokens[e.len],ot(e,r));continue;case 17:case 19:if(e.pending==="]"){Me(e),r==="("?e.pending=n:(nt(e),e.pending=r);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(r===")"){let s=e.token===17?Un:Ao,a=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,s,a),nt(e),e.pending=""}else e.pending+=r;continue}break;case 18:r===" "||r===`
29
+ `||r==="\\"?(e.renderer.set_attr(e.renderer.data,Un,e.pending),Me(e),nt(e),e.pending=r):(e.text+=r,e.pending=n);continue;case 104:if(n.startsWith("<br")){if(n.length===3||r===" "||r==="/"&&(n.length===4||e.pending[e.pending.length-1]===" ")){e.pending=n;continue}if(r===">"){Me(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),ot(e,r);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(r){case"(":Me(e),Ne(e,31),e.pending="";continue;case"[":e.token=105,e.pending=n;continue;case`
30
+ `:e.pending=r;continue;default:let o=r.charCodeAt(0);e.pending="",e.text+=Al(o)||o>=65&&o<=90||o>=97&&o<=122?n:r;continue}case`
31
+ `:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:Me(e),ln(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=r;continue;default:Me(e),e.pending=r,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){Me(e),e.pending=n,e.token=104;continue}break;case"`":if(e.token===19)break;r==="`"?(e.fence_start+=1,e.pending=n):(e.fence_start+=1,Me(e),Ne(e,11),e.text=r===" "||r===`
32
+ `?"":r,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let o=12,s=14,a=e.pending[0];if(a==="_"&&(o=13,s=15),e.pending.length===1){if(a===r){e.pending=n;continue}if(r!==" "&&r!==`
33
+ `){Me(e),Ne(e,o),e.pending=r;continue}}else{if(a===r){Me(e),Ne(e,s),Ne(e,o),e.pending="";continue}if(r!==" "&&r!==`
34
+ `){Me(e),Ne(e,s),e.pending=r;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(r==="~"){e.pending=n;continue}}else if(r!==" "&&r!==`
35
+ `){Me(e),Ne(e,16),e.pending=r;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(r==="$"){e.token=105,e.pending=n;continue}else{if(cy(r.charCodeAt(0)))break;Me(e),Ne(e,31),e.pending=r;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&r!=="]"){Me(e),Ne(e,17),e.pending=r;continue}break;case"!":if(e.token!==19&&r==="["){Me(e),Ne(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&r===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&r==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=r,e.token=102;continue}e.text+=e.pending,e.pending=r}Me(e)}function na(e){return{add_token:dy,end_token:Rl,add_text:El,set_attr:Ml,data:{nodes:[e,,,,,],index:0}}}function dy(e,t){let r=e.nodes[e.index],n;switch(t){case 1:return;case 20:n=document.createElement("blockquote");break;case 2:n=document.createElement("p");break;case 21:n=document.createElement("br");break;case 22:n=document.createElement("hr");break;case 3:n=document.createElement("h1");break;case 4:n=document.createElement("h2");break;case 5:n=document.createElement("h3");break;case 6:n=document.createElement("h4");break;case 7:n=document.createElement("h5");break;case 8:n=document.createElement("h6");break;case 12:case 13:n=document.createElement("em");break;case 14:case 15:n=document.createElement("strong");break;case 16:n=document.createElement("s");break;case 11:n=document.createElement("code");break;case 18:case 17:n=document.createElement("a");break;case 19:n=document.createElement("img");break;case 23:n=document.createElement("ul");break;case 24:n=document.createElement("ol");break;case 25:n=document.createElement("li");break;case 26:let o=n=document.createElement("input");o.type="checkbox",o.disabled=!0;break;case 9:case 10:r=r.appendChild(document.createElement("pre")),n=document.createElement("code");break;case 27:n=document.createElement("table");break;case 28:switch(r.children.length){case 0:r=r.appendChild(document.createElement("thead"));break;case 1:r=r.appendChild(document.createElement("tbody"));break;default:r=r.children[1]}n=document.createElement("tr");break;case 29:n=document.createElement(r.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:n=document.createElement("equation-block");break;case 31:n=document.createElement("equation-inline");break}e.nodes[++e.index]=r.appendChild(n)}function Rl(e){e.index-=1}function El(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Ml(e,t,r){e.nodes[e.index].setAttribute(oy(t),r)}function br({amount:e,currency:t},r){let n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??2;return new Intl.NumberFormat(r,{style:"currency",currency:t}).format(e/10**n)}function Ll(e,t){let r=new Date(e);return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeZone:e.length===10?"UTC":void 0}).format(r)}function _p(e){let t=Math.min(0,...e.map(o=>o.value)),n=Math.max(0,...e.map(o=>o.value))-t||1;return{baseline:148+t/n*136,barWidth:192/e.length,points:e.map((o,s)=>({x:24+(s+.5)*272/e.length,y:148-(o.value-t)/n*136}))}}function fp(e){let t=new Set(e.map(r=>{let n=r.typeName==="Cell"?r.props.children.length===1?r.props.children[0]:void 0:r;return n?.typeName==="Metric"?"Card":n?.typeName}));return t.size===1&&!t.has(void 0)}function mp({scrollLeft:e,scrollWidth:t,clientWidth:r}){let n=Math.abs(e);return{start:n>1,end:n<t-r-1}}function Mo(e){return/^https:\/\//i.test(e??"")}function Nl(e,t){return(e??[]).flatMap(r=>r.url?Mo(r.url)?[{...r,url:r.url,message:void 0}]:[]:t?[{...r,url:void 0,message:r.label}]:[])}function Ol(e,t,r){return`${e}: ${[t,...Object.entries(r??{}).map(([n,o])=>`${n}: ${o}`)].join(", ")}`}function gp(e,t){return t!==void 0&&t.currency===e.currency&&t.amount>e.amount}function vp(e,t){let r=e.variants??[],n=(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:r.length?c.values.filter(u=>!r.some(p=>p.available!==!1&&p.options[c.name]===u)):[]})),o=n.filter(c=>c.value===void 0).map(c=>c.name),s=Object.fromEntries(n.flatMap(c=>c.value===void 0?[]:[[c.name,c.value]])),a=o.length?void 0:r.find(c=>n.every(u=>c.options[u.name]===u.value)),i=!o.length&&r.length?a!==void 0&&a.available!==!1:e.available!==!1;return{options:n,missing:o,chosen:s,available:i,price:a?.price??e.price,compareAtPrice:a?.price?a.compareAtPrice:e.compareAtPrice,image:a?.image??e.image,canBuy:!o.length&&i}}var zn={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"}},required:["Root","Grid","Cell","Carousel","Text","Card","Metric","Table","Chart","Product","Cart","Order"],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"}]}}},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"}]}}},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"}]}},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"}]}}},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"]}}},required:["title","body"],additionalProperties:!1},Metric:{type:"object",properties:{label:{type:"string"},value:{type:"string"},detail:{type:"string"}},required:["label","value","detail"],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"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"number"}},required:["label","value"],additionalProperties:!1}}},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"}},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"}}},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"]}}},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}}}};var hp=Lo;var uy={type:"object",properties:{typeName:{const:"Grid"},statementId:{type:"string"},props:{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"}]}}},required:["columns","children"],additionalProperties:!1}},required:["typeName","statementId","props"]},py={type:"object",properties:{typeName:{const:"Cell"},statementId:{type:"string"},props:{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"}]}},span:{type:"integer",enum:[1,2,3,4],default:1}},required:["children"],additionalProperties:!1}},required:["typeName","statementId","props"]};function ht(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=ht.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.typeName===void 0&&(p="typeName")||e.statementId===void 0&&(p="statementId")||e.props===void 0&&(p="props"))return ht.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.typeName!==void 0){let _=i;if(e.typeName!=="Text")return ht.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Text"}}],!1;var u=_===i}else var u=!0;if(u){if(e.statementId!==void 0){let _=i;if(typeof e.statementId!="string")return ht.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i}else var u=!0;if(u)if(e.props!==void 0){let _=e.props,d=i;if(i===d)if(_&&typeof _=="object"&&!Array.isArray(_)){let v;if(_.text===void 0&&(v="text"))return ht.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:v}}],!1;{let g=i;for(let y in _)if(y!=="text"){return ht.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:y}}],!1;break}if(g===i&&_.text!==void 0&&typeof _.text!="string")return ht.errors=[{instancePath:t+"/props/text",schemaPath:"#/properties/props/properties/text/type",keyword:"type",params:{type:"string"}}],!1}}else return ht.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=d===i}else var u=!0}}else return ht.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return ht.errors=a,i===0}ht.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Xe(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Xe.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.label===void 0&&(p="label"))return Xe.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.label!==void 0){let _=i;if(typeof e.label!="string")return Xe.errors=[{instancePath:t+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i}else var u=!0;if(u){if(e.url!==void 0){let _=i;if(typeof e.url!="string")return Xe.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i}else var u=!0;if(u)if(e.primary!==void 0){let _=i;if(typeof e.primary!="boolean")return Xe.errors=[{instancePath:t+"/primary",schemaPath:"#/properties/primary/type",keyword:"type",params:{type:"boolean"}}],!1;var u=_===i}else var u=!0}}else return Xe.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Xe.errors=a,i===0}Xe.evaluated={props:{label:!0,url:!0,primary:!0},dynamicProps:!1,dynamicItems:!1};function We(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=We.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.typeName===void 0&&(d="typeName")||e.statementId===void 0&&(d="statementId")||e.props===void 0&&(d="props"))return We.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:d}}],!1;if(e.typeName!==void 0){let f=i;if(e.typeName!=="Card")return We.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Card"}}],!1;var u=f===i}else var u=!0;if(u){if(e.statementId!==void 0){let f=i;if(typeof e.statementId!="string")return We.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=f===i}else var u=!0;if(u)if(e.props!==void 0){let f=e.props,v=i;if(i===v)if(f&&typeof f=="object"&&!Array.isArray(f)){let y;if(f.title===void 0&&(y="title")||f.body===void 0&&(y="body"))return We.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:y}}],!1;{let b=i;for(let P in f)if(!(P==="title"||P==="body"||P==="actions")){return We.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:P}}],!1;break}if(b===i){if(f.title!==void 0){let P=i;if(typeof f.title!="string")return We.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=P===i}else var p=!0;if(p){if(f.body!==void 0){let P=i;if(typeof f.body!="string")return We.errors=[{instancePath:t+"/props/body",schemaPath:"#/properties/props/properties/body/type",keyword:"type",params:{type:"string"}}],!1;var p=P===i}else var p=!0;if(p)if(f.actions!==void 0){let P=f.actions,w=i;if(i===w)if(Array.isArray(P)){var _=!0;let k=P.length;for(let h=0;h<k;h++){let m=i;Xe(P[h],{instancePath:t+"/props/actions/"+h,parentData:P,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(a=a===null?Xe.errors:a.concat(Xe.errors),i=a.length);var _=m===i;if(!_)break}}else return We.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var p=w===i}else var p=!0}}}}else return We.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=v===i}else var u=!0}}else return We.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return We.errors=a,i===0}We.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function it(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=it.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let _;if(e.typeName===void 0&&(_="typeName")||e.statementId===void 0&&(_="statementId")||e.props===void 0&&(_="props"))return it.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:_}}],!1;if(e.typeName!==void 0){let d=i;if(e.typeName!=="Metric")return it.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Metric"}}],!1;var u=d===i}else var u=!0;if(u){if(e.statementId!==void 0){let d=i;if(typeof e.statementId!="string")return it.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0;if(u)if(e.props!==void 0){let d=e.props,f=i;if(i===f)if(d&&typeof d=="object"&&!Array.isArray(d)){let g;if(d.label===void 0&&(g="label")||d.value===void 0&&(g="value")||d.detail===void 0&&(g="detail"))return it.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:g}}],!1;{let y=i;for(let b in d)if(!(b==="label"||b==="value"||b==="detail")){return it.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:b}}],!1;break}if(y===i){if(d.label!==void 0){let b=i;if(typeof d.label!="string")return it.errors=[{instancePath:t+"/props/label",schemaPath:"#/properties/props/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var p=b===i}else var p=!0;if(p){if(d.value!==void 0){let b=i;if(typeof d.value!="string")return it.errors=[{instancePath:t+"/props/value",schemaPath:"#/properties/props/properties/value/type",keyword:"type",params:{type:"string"}}],!1;var p=b===i}else var p=!0;if(p)if(d.detail!==void 0){let b=i;if(typeof d.detail!="string")return it.errors=[{instancePath:t+"/props/detail",schemaPath:"#/properties/props/properties/detail/type",keyword:"type",params:{type:"string"}}],!1;var p=b===i}else var p=!0}}}}else return it.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=f===i}else var u=!0}}else return it.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return it.errors=a,i===0}it.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Ve(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Ve.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return Ve.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=i;if(e.typeName!=="Table")return Ve.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Table"}}],!1;var u=g===i}else var u=!0;if(u){if(e.statementId!==void 0){let g=i;if(typeof e.statementId!="string")return Ve.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===i}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,y=i;if(i===y)if(g&&typeof g=="object"&&!Array.isArray(g)){let P;if(g.title===void 0&&(P="title")||g.columns===void 0&&(P="columns")||g.rows===void 0&&(P="rows"))return Ve.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:P}}],!1;{let w=i;for(let x in g)if(!(x==="title"||x==="columns"||x==="rows")){return Ve.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x}}],!1;break}if(w===i){if(g.title!==void 0){let x=i;if(typeof g.title!="string")return Ve.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=x===i}else var p=!0;if(p){if(g.columns!==void 0){let x=g.columns,k=i;if(i===k)if(Array.isArray(x)){var _=!0;let m=x.length;for(let S=0;S<m;S++){let A=i;if(typeof x[S]!="string")return Ve.errors=[{instancePath:t+"/props/columns/"+S,schemaPath:"#/properties/props/properties/columns/items/type",keyword:"type",params:{type:"string"}}],!1;var _=A===i;if(!_)break}}else return Ve.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/type",keyword:"type",params:{type:"array"}}],!1;var p=k===i}else var p=!0;if(p)if(g.rows!==void 0){let x=g.rows,k=i;if(i===k)if(Array.isArray(x)){var d=!0;let m=x.length;for(let S=0;S<m;S++){let A=x[S],I=i;if(i===I)if(Array.isArray(A)){var f=!0;let C=A.length;for(let M=0;M<C;M++){let N=i;if(typeof A[M]!="string")return Ve.errors=[{instancePath:t+"/props/rows/"+S+"/"+M,schemaPath:"#/properties/props/properties/rows/items/items/type",keyword:"type",params:{type:"string"}}],!1;var f=N===i;if(!f)break}}else return Ve.errors=[{instancePath:t+"/props/rows/"+S,schemaPath:"#/properties/props/properties/rows/items/type",keyword:"type",params:{type:"array"}}],!1;var d=I===i;if(!d)break}}else return Ve.errors=[{instancePath:t+"/props/rows",schemaPath:"#/properties/props/properties/rows/type",keyword:"type",params:{type:"array"}}],!1;var p=k===i}else var p=!0}}}}else return Ve.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=y===i}else var u=!0}}else return Ve.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ve.errors=a,i===0}Ve.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var _y={type:"object",properties:{typeName:{const:"Chart"},statementId:{type:"string"},props:{type:"object",properties:{title:{type:"string"},type:{type:"string",enum:["bar","line"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"number"}},required:["label","value"],additionalProperties:!1}}},required:["title","type","data"],additionalProperties:!1}},required:["typeName","statementId","props"]};function $e(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=$e.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let f;if(e.typeName===void 0&&(f="typeName")||e.statementId===void 0&&(f="statementId")||e.props===void 0&&(f="props"))return $e.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:f}}],!1;if(e.typeName!==void 0){let v=i;if(e.typeName!=="Chart")return $e.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Chart"}}],!1;var u=v===i}else var u=!0;if(u){if(e.statementId!==void 0){let v=i;if(typeof e.statementId!="string")return $e.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=v===i}else var u=!0;if(u)if(e.props!==void 0){let v=e.props,g=i;if(i===g)if(v&&typeof v=="object"&&!Array.isArray(v)){let b;if(v.title===void 0&&(b="title")||v.type===void 0&&(b="type")||v.data===void 0&&(b="data"))return $e.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:b}}],!1;{let P=i;for(let w in v)if(!(w==="title"||w==="type"||w==="data")){return $e.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:w}}],!1;break}if(P===i){if(v.title!==void 0){let w=i;if(typeof v.title!="string")return $e.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=w===i}else var p=!0;if(p){if(v.type!==void 0){let w=v.type,x=i;if(typeof w!="string")return $e.errors=[{instancePath:t+"/props/type",schemaPath:"#/properties/props/properties/type/type",keyword:"type",params:{type:"string"}}],!1;if(!(w==="bar"||w==="line"))return $e.errors=[{instancePath:t+"/props/type",schemaPath:"#/properties/props/properties/type/enum",keyword:"enum",params:{allowedValues:_y.properties.props.properties.type.enum}}],!1;var p=x===i}else var p=!0;if(p)if(v.data!==void 0){let w=v.data,x=i;if(i===x)if(Array.isArray(w)){var _=!0;let h=w.length;for(let m=0;m<h;m++){let S=w[m],A=i;if(i===A)if(S&&typeof S=="object"&&!Array.isArray(S)){let R;if(S.label===void 0&&(R="label")||S.value===void 0&&(R="value"))return $e.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/required",keyword:"required",params:{missingProperty:R}}],!1;{let C=i;for(let M in S)if(!(M==="label"||M==="value")){return $e.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:M}}],!1;break}if(C===i){if(S.label!==void 0){let M=i;if(typeof S.label!="string")return $e.errors=[{instancePath:t+"/props/data/"+m+"/label",schemaPath:"#/properties/props/properties/data/items/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var d=M===i}else var d=!0;if(d)if(S.value!==void 0){let M=S.value,N=i;if(!(typeof M=="number"&&isFinite(M)))return $e.errors=[{instancePath:t+"/props/data/"+m+"/value",schemaPath:"#/properties/props/properties/data/items/properties/value/type",keyword:"type",params:{type:"number"}}],!1;var d=N===i}else var d=!0}}}else return $e.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/type",keyword:"type",params:{type:"object"}}],!1;var _=A===i;if(!_)break}}else return $e.errors=[{instancePath:t+"/props/data",schemaPath:"#/properties/props/properties/data/type",keyword:"type",params:{type:"array"}}],!1;var p=x===i}else var p=!0}}}}else return $e.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=g===i}else var u=!0}}else return $e.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return $e.errors=a,i===0}$e.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var fy=new RegExp("^[A-Za-z]{3}$","u");function Fe(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Fe.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.amount===void 0&&(p="amount")||e.currency===void 0&&(p="currency"))return Fe.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.amount!==void 0){let _=e.amount,d=i;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return Fe.errors=[{instancePath:t+"/amount",schemaPath:"#/properties/amount/type",keyword:"type",params:{type:"integer"}}],!1;var u=d===i}else var u=!0;if(u)if(e.currency!==void 0){let _=e.currency,d=i;if(i===d)if(typeof _=="string"){if(!fy.test(_))return Fe.errors=[{instancePath:t+"/currency",schemaPath:"#/properties/currency/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z]{3}$"}}],!1}else return Fe.errors=[{instancePath:t+"/currency",schemaPath:"#/properties/currency/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0}else return Fe.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Fe.errors=a,i===0}Fe.evaluated={props:{amount:!0,currency:!0},dynamicProps:!1,dynamicItems:!1};function Kt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Kt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e))for(let p in e){let _=i;if(typeof e[p]!="string")return Kt.errors=[{instancePath:t+"/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i;if(!u)break}else return Kt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Kt.errors=a,i===0}Kt.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};function ue(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=ue.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let w;if(e.typeName===void 0&&(w="typeName")||e.statementId===void 0&&(w="statementId")||e.props===void 0&&(w="props"))return ue.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:w}}],!1;if(e.typeName!==void 0){let x=i;if(e.typeName!=="Product")return ue.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Product"}}],!1;var u=x===i}else var u=!0;if(u){if(e.statementId!==void 0){let x=i;if(typeof e.statementId!="string")return ue.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=x===i}else var u=!0;if(u)if(e.props!==void 0){let x=e.props,k=i;if(i===k)if(x&&typeof x=="object"&&!Array.isArray(x)){let m;if(x.product===void 0&&(m="product"))return ue.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:m}}],!1;{let S=i;for(let A in x)if(!(A==="product"||A==="actions")){return ue.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:A}}],!1;break}if(S===i){if(x.product!==void 0){let A=x.product,I=i;if(i===I)if(A&&typeof A=="object"&&!Array.isArray(A)){let R;if(A.title===void 0&&(R="title")||A.price===void 0&&(R="price"))return ue.errors=[{instancePath:t+"/props/product",schemaPath:"#/properties/props/properties/product/required",keyword:"required",params:{missingProperty:R}}],!1;if(A.title!==void 0){let C=i;if(typeof A.title!="string")return ue.errors=[{instancePath:t+"/props/product/title",schemaPath:"#/properties/props/properties/product/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(A.price!==void 0){let C=i;Fe(A.price,{instancePath:t+"/props/product/price",parentData:A,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var p=C===i}else var p=!0;if(p){if(A.id!==void 0){let C=i;if(typeof A.id!="string")return ue.errors=[{instancePath:t+"/props/product/id",schemaPath:"#/properties/props/properties/product/properties/id/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(A.compareAtPrice!==void 0){let C=i;Fe(A.compareAtPrice,{instancePath:t+"/props/product/compareAtPrice",parentData:A,parentDataProperty:"compareAtPrice",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var p=C===i}else var p=!0;if(p){if(A.image!==void 0){let C=i;if(typeof A.image!="string")return ue.errors=[{instancePath:t+"/props/product/image",schemaPath:"#/properties/props/properties/product/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(A.url!==void 0){let C=i;if(typeof A.url!="string")return ue.errors=[{instancePath:t+"/props/product/url",schemaPath:"#/properties/props/properties/product/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(A.description!==void 0){let C=i;if(typeof A.description!="string")return ue.errors=[{instancePath:t+"/props/product/description",schemaPath:"#/properties/props/properties/product/properties/description/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(A.badge!==void 0){let C=i;if(typeof A.badge!="string")return ue.errors=[{instancePath:t+"/props/product/badge",schemaPath:"#/properties/props/properties/product/properties/badge/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(A.rating!==void 0){let C=A.rating,M=i;if(i===M)if(C&&typeof C=="object"&&!Array.isArray(C)){let j;if(C.value===void 0&&(j="value"))return ue.errors=[{instancePath:t+"/props/product/rating",schemaPath:"#/properties/props/properties/product/properties/rating/required",keyword:"required",params:{missingProperty:j}}],!1;if(C.value!==void 0){let G=C.value,z=i;if(!(typeof G=="number"&&isFinite(G)))return ue.errors=[{instancePath:t+"/props/product/rating/value",schemaPath:"#/properties/props/properties/product/properties/rating/properties/value/type",keyword:"type",params:{type:"number"}}],!1;var _=z===i}else var _=!0;if(_)if(C.count!==void 0){let G=C.count,z=i;if(!(typeof G=="number"&&!(G%1)&&!isNaN(G)&&isFinite(G)))return ue.errors=[{instancePath:t+"/props/product/rating/count",schemaPath:"#/properties/props/properties/product/properties/rating/properties/count/type",keyword:"type",params:{type:"integer"}}],!1;var _=z===i}else var _=!0}else return ue.errors=[{instancePath:t+"/props/product/rating",schemaPath:"#/properties/props/properties/product/properties/rating/type",keyword:"type",params:{type:"object"}}],!1;var p=M===i}else var p=!0;if(p){if(A.available!==void 0){let C=i;if(typeof A.available!="boolean")return ue.errors=[{instancePath:t+"/props/product/available",schemaPath:"#/properties/props/properties/product/properties/available/type",keyword:"type",params:{type:"boolean"}}],!1;var p=C===i}else var p=!0;if(p){if(A.options!==void 0){let C=A.options,M=i;if(i===M)if(Array.isArray(C)){var d=!0;let j=C.length;for(let G=0;G<j;G++){let z=C[G],ce=i;if(i===ce)if(z&&typeof z=="object"&&!Array.isArray(z)){let _e;if(z.name===void 0&&(_e="name")||z.values===void 0&&(_e="values"))return ue.errors=[{instancePath:t+"/props/product/options/"+G,schemaPath:"#/properties/props/properties/product/properties/options/items/required",keyword:"required",params:{missingProperty:_e}}],!1;if(z.name!==void 0){let se=i;if(typeof z.name!="string")return ue.errors=[{instancePath:t+"/props/product/options/"+G+"/name",schemaPath:"#/properties/props/properties/product/properties/options/items/properties/name/type",keyword:"type",params:{type:"string"}}],!1;var f=se===i}else var f=!0;if(f)if(z.values!==void 0){let se=z.values,ge=i;if(i===ge)if(Array.isArray(se)){var v=!0;let st=se.length;for(let Ge=0;Ge<st;Ge++){let At=i;if(typeof se[Ge]!="string")return ue.errors=[{instancePath:t+"/props/product/options/"+G+"/values/"+Ge,schemaPath:"#/properties/props/properties/product/properties/options/items/properties/values/items/type",keyword:"type",params:{type:"string"}}],!1;var v=At===i;if(!v)break}}else return ue.errors=[{instancePath:t+"/props/product/options/"+G+"/values",schemaPath:"#/properties/props/properties/product/properties/options/items/properties/values/type",keyword:"type",params:{type:"array"}}],!1;var f=ge===i}else var f=!0}else return ue.errors=[{instancePath:t+"/props/product/options/"+G,schemaPath:"#/properties/props/properties/product/properties/options/items/type",keyword:"type",params:{type:"object"}}],!1;var d=ce===i;if(!d)break}}else return ue.errors=[{instancePath:t+"/props/product/options",schemaPath:"#/properties/props/properties/product/properties/options/type",keyword:"type",params:{type:"array"}}],!1;var p=M===i}else var p=!0;if(p){if(A.variants!==void 0){let C=A.variants,M=i;if(i===M)if(Array.isArray(C)){var g=!0;let j=C.length;for(let G=0;G<j;G++){let z=C[G],ce=i;if(i===ce)if(z&&typeof z=="object"&&!Array.isArray(z)){let _e;if(z.options===void 0&&(_e="options"))return ue.errors=[{instancePath:t+"/props/product/variants/"+G,schemaPath:"#/properties/props/properties/product/properties/variants/items/required",keyword:"required",params:{missingProperty:_e}}],!1;if(z.options!==void 0){let se=i;Kt(z.options,{instancePath:t+"/props/product/variants/"+G+"/options",parentData:z,parentDataProperty:"options",rootData:o,dynamicAnchors:s})||(a=a===null?Kt.errors:a.concat(Kt.errors),i=a.length);var y=se===i}else var y=!0;if(y){if(z.id!==void 0){let se=i;if(typeof z.id!="string")return ue.errors=[{instancePath:t+"/props/product/variants/"+G+"/id",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/id/type",keyword:"type",params:{type:"string"}}],!1;var y=se===i}else var y=!0;if(y){if(z.price!==void 0){let se=i;Fe(z.price,{instancePath:t+"/props/product/variants/"+G+"/price",parentData:z,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var y=se===i}else var y=!0;if(y){if(z.compareAtPrice!==void 0){let se=i;Fe(z.compareAtPrice,{instancePath:t+"/props/product/variants/"+G+"/compareAtPrice",parentData:z,parentDataProperty:"compareAtPrice",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var y=se===i}else var y=!0;if(y){if(z.image!==void 0){let se=i;if(typeof z.image!="string")return ue.errors=[{instancePath:t+"/props/product/variants/"+G+"/image",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var y=se===i}else var y=!0;if(y)if(z.available!==void 0){let se=i;if(typeof z.available!="boolean")return ue.errors=[{instancePath:t+"/props/product/variants/"+G+"/available",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/available/type",keyword:"type",params:{type:"boolean"}}],!1;var y=se===i}else var y=!0}}}}}else return ue.errors=[{instancePath:t+"/props/product/variants/"+G,schemaPath:"#/properties/props/properties/product/properties/variants/items/type",keyword:"type",params:{type:"object"}}],!1;var g=ce===i;if(!g)break}}else return ue.errors=[{instancePath:t+"/props/product/variants",schemaPath:"#/properties/props/properties/product/properties/variants/type",keyword:"type",params:{type:"array"}}],!1;var p=M===i}else var p=!0;if(p)if(A.selected!==void 0){let C=i;Kt(A.selected,{instancePath:t+"/props/product/selected",parentData:A,parentDataProperty:"selected",rootData:o,dynamicAnchors:s})||(a=a===null?Kt.errors:a.concat(Kt.errors),i=a.length);var p=C===i}else var p=!0}}}}}}}}}}}}else return ue.errors=[{instancePath:t+"/props/product",schemaPath:"#/properties/props/properties/product/type",keyword:"type",params:{type:"object"}}],!1;var b=I===i}else var b=!0;if(b)if(x.actions!==void 0){let A=x.actions,I=i;if(i===I)if(Array.isArray(A)){var P=!0;let C=A.length;for(let M=0;M<C;M++){let N=i;Xe(A[M],{instancePath:t+"/props/actions/"+M,parentData:A,parentDataProperty:M,rootData:o,dynamicAnchors:s})||(a=a===null?Xe.errors:a.concat(Xe.errors),i=a.length);var P=N===i;if(!P)break}}else return ue.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var b=I===i}else var b=!0}}}else return ue.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=k===i}else var u=!0}}else return ue.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return ue.errors=a,i===0}ue.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var my={type:"object",properties:{typeName:{const:"Cart"},statementId:{type:"string"},props:{type:"object",properties:{cart:{type:"object",properties:{lines:{type:"array",items:{$ref:"#/$defs/LineItem"}},totals:{type:"array",items:{$ref:"#/$defs/Total"}},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:{$ref:"#/$defs/Action"}}},required:["cart"],additionalProperties:!1}},required:["typeName","statementId","props"]};function Dt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Dt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let _;if(e.title===void 0&&(_="title")||e.quantity===void 0&&(_="quantity")||e.price===void 0&&(_="price"))return Dt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:_}}],!1;if(e.title!==void 0){let d=i;if(typeof e.title!="string")return Dt.errors=[{instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0;if(u){if(e.quantity!==void 0){let d=e.quantity,f=i;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d)))return Dt.errors=[{instancePath:t+"/quantity",schemaPath:"#/properties/quantity/type",keyword:"type",params:{type:"integer"}}],!1;var u=f===i}else var u=!0;if(u){if(e.price!==void 0){let d=i;Fe(e.price,{instancePath:t+"/price",parentData:e,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var u=d===i}else var u=!0;if(u){if(e.image!==void 0){let d=i;if(typeof e.image!="string")return Dt.errors=[{instancePath:t+"/image",schemaPath:"#/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0;if(u){if(e.url!==void 0){let d=i;if(typeof e.url!="string")return Dt.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0;if(u){if(e.options!==void 0){let d=i;Kt(e.options,{instancePath:t+"/options",parentData:e,parentDataProperty:"options",rootData:o,dynamicAnchors:s})||(a=a===null?Kt.errors:a.concat(Kt.errors),i=a.length);var u=d===i}else var u=!0;if(u)if(e.actions!==void 0){let d=e.actions,f=i;if(i===f)if(Array.isArray(d)){var p=!0;let g=d.length;for(let y=0;y<g;y++){let b=i;Xe(d[y],{instancePath:t+"/actions/"+y,parentData:d,parentDataProperty:y,rootData:o,dynamicAnchors:s})||(a=a===null?Xe.errors:a.concat(Xe.errors),i=a.length);var p=b===i;if(!p)break}}else return Dt.errors=[{instancePath:t+"/actions",schemaPath:"#/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var u=f===i}else var u=!0}}}}}}else return Dt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Dt.errors=a,i===0}Dt.evaluated={props:{title:!0,quantity:!0,price:!0,image:!0,url:!0,options:!0,actions:!0},dynamicProps:!1,dynamicItems:!1};function er(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=er.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.label===void 0&&(p="label")||e.amount===void 0&&(p="amount"))return er.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.label!==void 0){let _=i;if(typeof e.label!="string")return er.errors=[{instancePath:t+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i}else var u=!0;if(u)if(e.amount!==void 0){let _=i;Fe(e.amount,{instancePath:t+"/amount",parentData:e,parentDataProperty:"amount",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var u=_===i}else var u=!0}else return er.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return er.errors=a,i===0}er.evaluated={props:{label:!0,amount:!0},dynamicProps:!1,dynamicItems:!1};function Le(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Le.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let b;if(e.typeName===void 0&&(b="typeName")||e.statementId===void 0&&(b="statementId")||e.props===void 0&&(b="props"))return Le.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:b}}],!1;if(e.typeName!==void 0){let P=i;if(e.typeName!=="Cart")return Le.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Cart"}}],!1;var u=P===i}else var u=!0;if(u){if(e.statementId!==void 0){let P=i;if(typeof e.statementId!="string")return Le.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=P===i}else var u=!0;if(u)if(e.props!==void 0){let P=e.props,w=i;if(i===w)if(P&&typeof P=="object"&&!Array.isArray(P)){let k;if(P.cart===void 0&&(k="cart"))return Le.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:k}}],!1;{let h=i;for(let m in P)if(!(m==="cart"||m==="actions")){return Le.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m}}],!1;break}if(h===i){if(P.cart!==void 0){let m=P.cart,S=i;if(i===S)if(m&&typeof m=="object"&&!Array.isArray(m)){let A;if(m.lines===void 0&&(A="lines")||m.totals===void 0&&(A="totals"))return Le.errors=[{instancePath:t+"/props/cart",schemaPath:"#/properties/props/properties/cart/required",keyword:"required",params:{missingProperty:A}}],!1;if(m.lines!==void 0){let I=m.lines,R=i;if(i===R)if(Array.isArray(I)){var p=!0;let C=I.length;for(let M=0;M<C;M++){let N=i;Dt(I[M],{instancePath:t+"/props/cart/lines/"+M,parentData:I,parentDataProperty:M,rootData:o,dynamicAnchors:s})||(a=a===null?Dt.errors:a.concat(Dt.errors),i=a.length);var p=N===i;if(!p)break}}else return Le.errors=[{instancePath:t+"/props/cart/lines",schemaPath:"#/properties/props/properties/cart/properties/lines/type",keyword:"type",params:{type:"array"}}],!1;var _=R===i}else var _=!0;if(_){if(m.totals!==void 0){let I=m.totals,R=i;if(i===R)if(Array.isArray(I)){var d=!0;let M=I.length;for(let N=0;N<M;N++){let j=i;er(I[N],{instancePath:t+"/props/cart/totals/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(a=a===null?er.errors:a.concat(er.errors),i=a.length);var d=j===i;if(!d)break}}else return Le.errors=[{instancePath:t+"/props/cart/totals",schemaPath:"#/properties/props/properties/cart/properties/totals/type",keyword:"type",params:{type:"array"}}],!1;var _=R===i}else var _=!0;if(_)if(m.messages!==void 0){let I=m.messages,R=i;if(i===R)if(Array.isArray(I)){var f=!0;let M=I.length;for(let N=0;N<M;N++){let j=I[N],G=i;if(i===G)if(j&&typeof j=="object"&&!Array.isArray(j)){let ce;if(j.text===void 0&&(ce="text")||j.severity===void 0&&(ce="severity"))return Le.errors=[{instancePath:t+"/props/cart/messages/"+N,schemaPath:"#/properties/props/properties/cart/properties/messages/items/required",keyword:"required",params:{missingProperty:ce}}],!1;if(j.text!==void 0){let pe=i;if(typeof j.text!="string")return Le.errors=[{instancePath:t+"/props/cart/messages/"+N+"/text",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/text/type",keyword:"type",params:{type:"string"}}],!1;var v=pe===i}else var v=!0;if(v)if(j.severity!==void 0){let pe=j.severity,_e=i;if(typeof pe!="string")return Le.errors=[{instancePath:t+"/props/cart/messages/"+N+"/severity",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/severity/type",keyword:"type",params:{type:"string"}}],!1;if(!(pe==="info"||pe==="warning"||pe==="error"))return Le.errors=[{instancePath:t+"/props/cart/messages/"+N+"/severity",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/severity/enum",keyword:"enum",params:{allowedValues:my.properties.props.properties.cart.properties.messages.items.properties.severity.enum}}],!1;var v=_e===i}else var v=!0}else return Le.errors=[{instancePath:t+"/props/cart/messages/"+N,schemaPath:"#/properties/props/properties/cart/properties/messages/items/type",keyword:"type",params:{type:"object"}}],!1;var f=G===i;if(!f)break}}else return Le.errors=[{instancePath:t+"/props/cart/messages",schemaPath:"#/properties/props/properties/cart/properties/messages/type",keyword:"type",params:{type:"array"}}],!1;var _=R===i}else var _=!0}}else return Le.errors=[{instancePath:t+"/props/cart",schemaPath:"#/properties/props/properties/cart/type",keyword:"type",params:{type:"object"}}],!1;var g=S===i}else var g=!0;if(g)if(P.actions!==void 0){let m=P.actions,S=i;if(i===S)if(Array.isArray(m)){var y=!0;let I=m.length;for(let R=0;R<I;R++){let C=i;Xe(m[R],{instancePath:t+"/props/actions/"+R,parentData:m,parentDataProperty:R,rootData:o,dynamicAnchors:s})||(a=a===null?Xe.errors:a.concat(Xe.errors),i=a.length);var y=C===i;if(!y)break}}else return Le.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var g=S===i}else var g=!0}}}else return Le.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=w===i}else var u=!0}}else return Le.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Le.errors=a,i===0}Le.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Te(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Te.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let b;if(e.typeName===void 0&&(b="typeName")||e.statementId===void 0&&(b="statementId")||e.props===void 0&&(b="props"))return Te.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:b}}],!1;if(e.typeName!==void 0){let P=i;if(e.typeName!=="Order")return Te.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Order"}}],!1;var u=P===i}else var u=!0;if(u){if(e.statementId!==void 0){let P=i;if(typeof e.statementId!="string")return Te.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=P===i}else var u=!0;if(u)if(e.props!==void 0){let P=e.props,w=i;if(i===w)if(P&&typeof P=="object"&&!Array.isArray(P)){let k;if(P.order===void 0&&(k="order"))return Te.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:k}}],!1;{let h=i;for(let m in P)if(!(m==="order"||m==="actions")){return Te.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m}}],!1;break}if(h===i){if(P.order!==void 0){let m=P.order,S=i;if(i===S)if(m&&typeof m=="object"&&!Array.isArray(m)){let A;if(m.number===void 0&&(A="number")||m.status===void 0&&(A="status")||m.items===void 0&&(A="items")||m.totals===void 0&&(A="totals"))return Te.errors=[{instancePath:t+"/props/order",schemaPath:"#/properties/props/properties/order/required",keyword:"required",params:{missingProperty:A}}],!1;if(m.number!==void 0){let I=i;if(typeof m.number!="string")return Te.errors=[{instancePath:t+"/props/order/number",schemaPath:"#/properties/props/properties/order/properties/number/type",keyword:"type",params:{type:"string"}}],!1;var p=I===i}else var p=!0;if(p){if(m.status!==void 0){let I=i;if(typeof m.status!="string")return Te.errors=[{instancePath:t+"/props/order/status",schemaPath:"#/properties/props/properties/order/properties/status/type",keyword:"type",params:{type:"string"}}],!1;var p=I===i}else var p=!0;if(p){if(m.date!==void 0){let I=i;if(typeof m.date!="string")return Te.errors=[{instancePath:t+"/props/order/date",schemaPath:"#/properties/props/properties/order/properties/date/type",keyword:"type",params:{type:"string"}}],!1;var p=I===i}else var p=!0;if(p){if(m.items!==void 0){let I=m.items,R=i;if(i===R)if(Array.isArray(I)){var _=!0;let M=I.length;for(let N=0;N<M;N++){let j=i;Dt(I[N],{instancePath:t+"/props/order/items/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(a=a===null?Dt.errors:a.concat(Dt.errors),i=a.length);var _=j===i;if(!_)break}}else return Te.errors=[{instancePath:t+"/props/order/items",schemaPath:"#/properties/props/properties/order/properties/items/type",keyword:"type",params:{type:"array"}}],!1;var p=R===i}else var p=!0;if(p){if(m.totals!==void 0){let I=m.totals,R=i;if(i===R)if(Array.isArray(I)){var d=!0;let M=I.length;for(let N=0;N<M;N++){let j=i;er(I[N],{instancePath:t+"/props/order/totals/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(a=a===null?er.errors:a.concat(er.errors),i=a.length);var d=j===i;if(!d)break}}else return Te.errors=[{instancePath:t+"/props/order/totals",schemaPath:"#/properties/props/properties/order/properties/totals/type",keyword:"type",params:{type:"array"}}],!1;var p=R===i}else var p=!0;if(p)if(m.timeline!==void 0){let I=m.timeline,R=i;if(i===R)if(Array.isArray(I)){var f=!0;let M=I.length;for(let N=0;N<M;N++){let j=I[N],G=i;if(i===G)if(j&&typeof j=="object"&&!Array.isArray(j)){let ce;if(j.label===void 0&&(ce="label")||j.done===void 0&&(ce="done"))return Te.errors=[{instancePath:t+"/props/order/timeline/"+N,schemaPath:"#/properties/props/properties/order/properties/timeline/items/required",keyword:"required",params:{missingProperty:ce}}],!1;if(j.label!==void 0){let pe=i;if(typeof j.label!="string")return Te.errors=[{instancePath:t+"/props/order/timeline/"+N+"/label",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var v=pe===i}else var v=!0;if(v){if(j.done!==void 0){let pe=i;if(typeof j.done!="boolean")return Te.errors=[{instancePath:t+"/props/order/timeline/"+N+"/done",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/done/type",keyword:"type",params:{type:"boolean"}}],!1;var v=pe===i}else var v=!0;if(v)if(j.date!==void 0){let pe=i;if(typeof j.date!="string")return Te.errors=[{instancePath:t+"/props/order/timeline/"+N+"/date",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/date/type",keyword:"type",params:{type:"string"}}],!1;var v=pe===i}else var v=!0}}else return Te.errors=[{instancePath:t+"/props/order/timeline/"+N,schemaPath:"#/properties/props/properties/order/properties/timeline/items/type",keyword:"type",params:{type:"object"}}],!1;var f=G===i;if(!f)break}}else return Te.errors=[{instancePath:t+"/props/order/timeline",schemaPath:"#/properties/props/properties/order/properties/timeline/type",keyword:"type",params:{type:"array"}}],!1;var p=R===i}else var p=!0}}}}}else return Te.errors=[{instancePath:t+"/props/order",schemaPath:"#/properties/props/properties/order/type",keyword:"type",params:{type:"object"}}],!1;var g=S===i}else var g=!0;if(g)if(P.actions!==void 0){let m=P.actions,S=i;if(i===S)if(Array.isArray(m)){var y=!0;let I=m.length;for(let R=0;R<I;R++){let C=i;Xe(m[R],{instancePath:t+"/props/actions/"+R,parentData:m,parentDataProperty:R,rootData:o,dynamicAnchors:s})||(a=a===null?Xe.errors:a.concat(Xe.errors),i=a.length);var y=C===i;if(!y)break}}else return Te.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var g=S===i}else var g=!0}}}else return Te.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=w===i}else var u=!0}}else return Te.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Te.errors=a,i===0}Te.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function vt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=vt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return vt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=i;if(e.typeName!=="Cell")return vt.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Cell"}}],!1;var u=g===i}else var u=!0;if(u){if(e.statementId!==void 0){let g=i;if(typeof e.statementId!="string")return vt.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===i}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,y=i;if(i===y)if(g&&typeof g=="object"&&!Array.isArray(g)){let P;if(g.children===void 0&&(P="children"))return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:P}}],!1;{let w=i;for(let x in g)if(!(x==="children"||x==="span")){return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x}}],!1;break}if(w===i){if(g.children!==void 0){let x=g.children,k=i;if(i===k)if(Array.isArray(x)){var p=!0;let h=x.length;for(let m=0;m<h;m++){let S=x[m],A=i,I=i,R=!1,C=i;ht(S,{instancePath:t+"/props/children/"+m,parentData:x,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?ht.errors:a.concat(ht.errors),i=a.length);var d=C===i;if(R=R||d,d){var _={};_.typeName=!0,_.statementId=!0,_.props=!0}let M=i;We(S,{instancePath:t+"/props/children/"+m,parentData:x,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?We.errors:a.concat(We.errors),i=a.length);var d=M===i;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let N=i;it(S,{instancePath:t+"/props/children/"+m,parentData:x,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?it.errors:a.concat(it.errors),i=a.length);var d=N===i;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let j=i;Ve(S,{instancePath:t+"/props/children/"+m,parentData:x,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?Ve.errors:a.concat(Ve.errors),i=a.length);var d=j===i;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let G=i;$e(S,{instancePath:t+"/props/children/"+m,parentData:x,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?$e.errors:a.concat($e.errors),i=a.length);var d=G===i;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let z=i;ue(S,{instancePath:t+"/props/children/"+m,parentData:x,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?ue.errors:a.concat(ue.errors),i=a.length);var d=z===i;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let ce=i;Le(S,{instancePath:t+"/props/children/"+m,parentData:x,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?Le.errors:a.concat(Le.errors),i=a.length);var d=ce===i;R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let pe=i;Te(S,{instancePath:t+"/props/children/"+m,parentData:x,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?Te.errors:a.concat(Te.errors),i=a.length);var d=pe===i;if(R=R||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0),R)i=I,a!==null&&(I?a.length=I:a=null);else{let se={instancePath:t+"/props/children/"+m,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return a===null?a=[se]:a.push(se),i++,vt.errors=a,!1}var p=A===i;if(!p)break}}else return vt.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1;var f=k===i}else var f=!0;if(f)if(g.span!==void 0){let x=g.span,k=i;if(!(typeof x=="number"&&!(x%1)&&!isNaN(x)&&isFinite(x)))return vt.errors=[{instancePath:t+"/props/span",schemaPath:"#/properties/props/properties/span/type",keyword:"type",params:{type:"integer"}}],!1;if(!(x===1||x===2||x===3||x===4))return vt.errors=[{instancePath:t+"/props/span",schemaPath:"#/properties/props/properties/span/enum",keyword:"enum",params:{allowedValues:py.properties.props.properties.span.enum}}],!1;var f=k===i}else var f=!0}}}else return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=y===i}else var u=!0}}else return vt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return vt.errors=a,i===0}vt.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Et(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Et.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return Et.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=i;if(e.typeName!=="Grid")return Et.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Grid"}}],!1;var u=g===i}else var u=!0;if(u){if(e.statementId!==void 0){let g=i;if(typeof e.statementId!="string")return Et.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===i}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,y=i;if(i===y)if(g&&typeof g=="object"&&!Array.isArray(g)){let P;if(g.columns===void 0&&(P="columns")||g.children===void 0&&(P="children"))return Et.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:P}}],!1;{let w=i;for(let x in g)if(!(x==="columns"||x==="children")){return Et.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x}}],!1;break}if(w===i){if(g.columns!==void 0){let x=g.columns,k=i;if(!(typeof x=="number"&&!(x%1)&&!isNaN(x)&&isFinite(x)))return Et.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/type",keyword:"type",params:{type:"integer"}}],!1;if(!(x===1||x===2||x===3||x===4))return Et.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/enum",keyword:"enum",params:{allowedValues:uy.properties.props.properties.columns.enum}}],!1;var p=k===i}else var p=!0;if(p)if(g.children!==void 0){let x=g.children,k=i;if(i===k)if(Array.isArray(x)){var _=!0;let m=x.length;for(let S=0;S<m;S++){let A=x[S],I=i,R=i,C=!1,M=i;vt(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?vt.errors:a.concat(vt.errors),i=a.length);var f=M===i;if(C=C||f,f){var d={};d.typeName=!0,d.statementId=!0,d.props=!0}let N=i;ht(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?ht.errors:a.concat(ht.errors),i=a.length);var f=N===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let j=i;We(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?We.errors:a.concat(We.errors),i=a.length);var f=j===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let G=i;it(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?it.errors:a.concat(it.errors),i=a.length);var f=G===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let z=i;Ve(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?Ve.errors:a.concat(Ve.errors),i=a.length);var f=z===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let ce=i;$e(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?$e.errors:a.concat($e.errors),i=a.length);var f=ce===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let pe=i;ue(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?ue.errors:a.concat(ue.errors),i=a.length);var f=pe===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let _e=i;Le(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?Le.errors:a.concat(Le.errors),i=a.length);var f=_e===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let se=i;Te(A,{instancePath:t+"/props/children/"+S,parentData:x,parentDataProperty:S,rootData:o,dynamicAnchors:s})||(a=a===null?Te.errors:a.concat(Te.errors),i=a.length);var f=se===i;if(C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0),C)i=R,a!==null&&(R?a.length=R:a=null);else{let at={instancePath:t+"/props/children/"+S,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return a===null?a=[at]:a.push(at),i++,Et.errors=a,!1}var _=I===i;if(!_)break}}else return Et.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1;var p=k===i}else var p=!0}}}else return Et.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=y===i}else var u=!0}}else return Et.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Et.errors=a,i===0}Et.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Ft(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Ft.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let f;if(e.typeName===void 0&&(f="typeName")||e.statementId===void 0&&(f="statementId")||e.props===void 0&&(f="props"))return Ft.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:f}}],!1;if(e.typeName!==void 0){let v=i;if(e.typeName!=="Carousel")return Ft.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Carousel"}}],!1;var u=v===i}else var u=!0;if(u){if(e.statementId!==void 0){let v=i;if(typeof e.statementId!="string")return Ft.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=v===i}else var u=!0;if(u)if(e.props!==void 0){let v=e.props,g=i;if(i===g)if(v&&typeof v=="object"&&!Array.isArray(v)){let b;if(v.children===void 0&&(b="children"))return Ft.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:b}}],!1;{let P=i;for(let w in v)if(w!=="children"){return Ft.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:w}}],!1;break}if(P===i&&v.children!==void 0){let w=v.children;if(i===i)if(Array.isArray(w)){var p=!0;let k=w.length;for(let h=0;h<k;h++){let m=w[h],S=i,A=i,I=!1,R=i;We(m,{instancePath:t+"/props/children/"+h,parentData:w,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(a=a===null?We.errors:a.concat(We.errors),i=a.length);var d=R===i;if(I=I||d,d){var _={};_.typeName=!0,_.statementId=!0,_.props=!0}let C=i;ue(m,{instancePath:t+"/props/children/"+h,parentData:w,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(a=a===null?ue.errors:a.concat(ue.errors),i=a.length);var d=C===i;if(I=I||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0),I)i=A,a!==null&&(A?a.length=A:a=null);else{let N={instancePath:t+"/props/children/"+h,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return a===null?a=[N]:a.push(N),i++,Ft.errors=a,!1}var p=S===i;if(!p)break}}else return Ft.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1}}}else return Ft.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=g===i}else var u=!0}}else return Ft.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ft.errors=a,i===0}Ft.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Lo(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Lo.evaluated;c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0);let u=i,p=!1,_=i;Et(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Et.errors:a.concat(Et.errors),i=a.length);var m=_===i;if(p=p||m,m){var d={};d.typeName=!0,d.statementId=!0,d.props=!0}let f=i;vt(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?vt.errors:a.concat(vt.errors),i=a.length);var m=f===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let v=i;Ft(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Ft.errors:a.concat(Ft.errors),i=a.length);var m=v===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let g=i;ht(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?ht.errors:a.concat(ht.errors),i=a.length);var m=g===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let y=i;We(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?We.errors:a.concat(We.errors),i=a.length);var m=y===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let b=i;it(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?it.errors:a.concat(it.errors),i=a.length);var m=b===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let P=i;Ve(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Ve.errors:a.concat(Ve.errors),i=a.length);var m=P===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let w=i;$e(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?$e.errors:a.concat($e.errors),i=a.length);var m=w===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let x=i;ue(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?ue.errors:a.concat(ue.errors),i=a.length);var m=x===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let k=i;Le(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Le.errors:a.concat(Le.errors),i=a.length);var m=k===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let h=i;Te(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Te.errors:a.concat(Te.errors),i=a.length);var m=h===i;if(p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0),p)i=u,a!==null&&(u?a.length=u:a=null);else{let S={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{}};return a===null?a=[S]:a.push(S),i++,Lo.errors=a,!1}return Lo.errors=a,c.props=d,i===0}Lo.evaluated={dynamicProps:!0,dynamicItems:!1};function yp(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 gy=new Set(["Comp","Ref","StateRef","RuntimeRef","BinOp","UnaryOp","Ternary","Member","Index","Assign","Str","Num","Bool","Null","Arr","Obj","Ph"]);function cn(e){return!e||typeof e!="object"||Array.isArray(e)?!1:gy.has(e.k)}function No(e,t){let r=n=>{switch(t(n),n.k){case"Comp":n.args.forEach(r),Object.values(n.mappedProps??{}).forEach(r);break;case"Arr":n.els.forEach(r);break;case"Obj":n.entries.forEach(([,o])=>r(o));break;case"BinOp":r(n.left),r(n.right);break;case"UnaryOp":r(n.operand);break;case"Ternary":r(n.cond),r(n.then),r(n.else);break;case"Member":r(n.obj);break;case"Index":r(n.obj),r(n.index);break;case"Assign":r(n.value);break}};r(e)}function oa(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(oa)}:typeof e=="object"?{k:"Obj",entries:Object.entries(e).map(([t,r])=>[t,oa(r)])}:{k:"Null"}}function ia(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 r of e.els){let n=ia(r);if(!n)return;t.push(n.v)}return{v:t}}case"Obj":{let t={};for(let[r,n]of e.entries){let o=ia(n);if(!o)return;t[r]=o.v}return{v:t}}default:return}}var aa=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}]]),bp={ActionExpression:!0,OpenUrl:!0,ToAssistant:!0},Ur={Query:"Query",Mutation:"Mutation"};function Oo(e){return e?.callDefs??aa}function $o(e){return aa.has(e)}function Hn(e){return e in Ur}var E;(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"})(E||(E={}));var vy=1,Pp=2,xp=3,$l=4,Do=5,Dl=6,sa=7,Sp=8,hy=9;function la(e){let t=0,r=()=>e[t]??{t:E.EOF},n=()=>{let d=r();return t++,d},o=d=>{r().t===d&&t++};function s(d){switch(d.t){case E.Question:return vy;case E.Or:return Pp;case E.And:return xp;case E.EqEq:case E.NotEq:return $l;case E.Greater:case E.Less:case E.GreaterEq:case E.LessEq:return Do;case E.Plus:case E.Minus:return Dl;case E.Star:case E.Slash:case E.Percent:return sa;case E.Dot:case E.LBrack:return hy;default:return 0}}function a(d=0){let f=i();for(;s(r())>d;)f=c(f);return f}function i(){let d=r();if(d.t===E.Str)return n(),{k:"Str",v:d.v};if(d.t===E.Num)return n(),{k:"Num",v:d.v};if(d.t===E.True)return n(),{k:"Bool",v:!0};if(d.t===E.False)return n(),{k:"Bool",v:!1};if(d.t===E.Null)return n(),{k:"Null"};if(d.t===E.LBrack)return p();if(d.t===E.LBrace)return _();if(d.t===E.StateVar){let f=d.v;if(n(),r().t===E.Equals){n();let v=a(0);return{k:"Assign",target:f,value:v}}return{k:"StateRef",n:f}}if(d.t===E.Type){let f=d.v;return e[t+1]?.t===E.LParen&&(!$o(f)||f==="Action")?u():(n(),{k:"Ref",n:f})}if(d.t===E.BuiltinCall){if(e[t+1]?.t===E.LParen){let f=u();return f.k==="Comp"&&!$o(f.name)&&(f.fn=!0),f}return n(),{k:"Ref",n:d.v}}if(d.t===E.Ident)return n(),{k:"Ref",n:d.v};if(d.t===E.Not)return n(),{k:"UnaryOp",op:"!",operand:a(Sp)};if(d.t===E.Minus)return n(),{k:"UnaryOp",op:"-",operand:a(Sp)};if(d.t===E.LParen){n();let f=a(0);return o(E.RParen),f}return n(),{k:"Null"}}function c(d){let f=r();if(f.t===E.Plus)return n(),{k:"BinOp",op:"+",left:d,right:a(Dl)};if(f.t===E.Minus)return n(),{k:"BinOp",op:"-",left:d,right:a(Dl)};if(f.t===E.Star)return n(),{k:"BinOp",op:"*",left:d,right:a(sa)};if(f.t===E.Slash)return n(),{k:"BinOp",op:"/",left:d,right:a(sa)};if(f.t===E.Percent)return n(),{k:"BinOp",op:"%",left:d,right:a(sa)};if(f.t===E.EqEq)return n(),{k:"BinOp",op:"==",left:d,right:a($l)};if(f.t===E.NotEq)return n(),{k:"BinOp",op:"!=",left:d,right:a($l)};if(f.t===E.Greater)return n(),{k:"BinOp",op:">",left:d,right:a(Do)};if(f.t===E.Less)return n(),{k:"BinOp",op:"<",left:d,right:a(Do)};if(f.t===E.GreaterEq)return n(),{k:"BinOp",op:">=",left:d,right:a(Do)};if(f.t===E.LessEq)return n(),{k:"BinOp",op:"<=",left:d,right:a(Do)};if(f.t===E.And)return n(),{k:"BinOp",op:"&&",left:d,right:a(xp)};if(f.t===E.Or)return n(),{k:"BinOp",op:"||",left:d,right:a(Pp)};if(f.t===E.Question){n();let v=a(0);o(E.Colon);let g=a(0);return{k:"Ternary",cond:d,then:v,else:g}}if(f.t===E.Dot){n();let v=r(),g=v.t===E.Ident||v.t===E.Type||v.t===E.Str||v.t===E.Num?(n(),String(v.v)):v.t===E.StateVar?(n(),v.v.replace(/^\$/,"")):(n(),"?");return{k:"Member",obj:d,field:g}}if(f.t===E.LBrack){n();let v=a(0);return o(E.RBrack),{k:"Index",obj:d,index:v}}return d}function u(){let d=r().v;n(),o(E.LParen);let f=[];for(;r().t!==E.RParen&&r().t!==E.EOF;)f.push(a(0)),r().t===E.Comma&&n();return o(E.RParen),{k:"Comp",name:d,args:f}}function p(){n();let d=[];for(;r().t!==E.RBrack&&r().t!==E.EOF;)d.push(a(0)),r().t===E.Comma&&n();return o(E.RBrack),{k:"Arr",els:d}}function _(){n();let d=[];for(;r().t!==E.RBrace&&r().t!==E.EOF;){let f=r(),v=f.t===E.Ident||f.t===E.Str||f.t===E.Type||f.t===E.Num?(n(),String(f.v)):f.t===E.StateVar?(n(),f.v.replace(/^\$/,"")):(n(),"?");o(E.Colon),d.push([v,a(0)]),r().t===E.Comma&&n()}return o(E.RBrace),{k:"Obj",entries:d}}return a(0)}function ca(e){let t=[],r=0,n=e.length;for(;r<n;){for(;r<n&&(e[r]===" "||e[r]===" "||e[r]==="\r");)r++;if(r>=n)break;let o=e[r];if(o===`
36
36
  `){t.push({t:E.Newline}),r++;continue}if(o==="("){t.push({t:E.LParen}),r++;continue}if(o===")"){t.push({t:E.RParen}),r++;continue}if(o==="["){t.push({t:E.LBrack}),r++;continue}if(o==="]"){t.push({t:E.RBrack}),r++;continue}if(o==="{"){t.push({t:E.LBrace}),r++;continue}if(o==="}"){t.push({t:E.RBrace}),r++;continue}if(o===","){t.push({t:E.Comma}),r++;continue}if(o===":"){t.push({t:E.Colon}),r++;continue}if(o==="="){r+1<n&&e[r+1]==="="?(t.push({t:E.EqEq}),r+=2):(t.push({t:E.Equals}),r++);continue}if(o==="!"){r+1<n&&e[r+1]==="="?(t.push({t:E.NotEq}),r+=2):(t.push({t:E.Not}),r++);continue}if(o===">"){r+1<n&&e[r+1]==="="?(t.push({t:E.GreaterEq}),r+=2):(t.push({t:E.Greater}),r++);continue}if(o==="<"){r+1<n&&e[r+1]==="="?(t.push({t:E.LessEq}),r+=2):(t.push({t:E.Less}),r++);continue}if(o==="&"){r+1<n&&e[r+1]==="&"?(t.push({t:E.And}),r+=2):(t.push({t:E.And}),r++);continue}if(o==="|"){r+1<n&&e[r+1]==="|"?(t.push({t:E.Or}),r+=2):(t.push({t:E.Or}),r++);continue}if(o==="."){t.push({t:E.Dot}),r++;continue}if(o==="?"){t.push({t:E.Question}),r++;continue}if(o==="+"){t.push({t:E.Plus}),r++;continue}if(o==="*"){t.push({t:E.Star}),r++;continue}if(o==="/"){t.push({t:E.Slash}),r++;continue}if(o==="%"){t.push({t:E.Percent}),r++;continue}if(o==='"'){let c=r;r++;let u=!1;for(;r<n;)if(e[r]==="\\")r+=2;else if(e[r]==='"'){r++,u=!0;break}else r++;let p=e.slice(c,r);try{let _=u?p:p+'"';t.push({t:E.Str,v:JSON.parse(_)})}catch{let _=p.replace(/^"|"$/g,"");t.push({t:E.Str,v:_})}continue}if(o==="'"){r++;let c="",u=!1;for(;r<n;)if(e[r]==="\\"){if(r++,r<n){let p=e[r];p==="'"?c+="'":p==="\\"?c+="\\":p==="n"?c+=`
37
- `:p==="t"?c+=" ":c+=p,r++}}else if(e[r]==="'"){r++,u=!0;break}else c+=e[r],r++;t.push({t:E.Str,v:c});continue}if(o==="-"){let c=t.length>0?t[t.length-1]:null;if(!(!(c!=null&&(c.t===E.Num||c.t===E.Str||c.t===E.Ident||c.t===E.Type||c.t===E.RParen||c.t===E.RBrack||c.t===E.True||c.t===E.False||c.t===E.Null||c.t===E.StateVar||c.t===E.BuiltinCall))&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9")){t.push({t:E.Minus}),r++;continue}}let s=o>="0"&&o<="9",i=o==="-"&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9";if(s||i){let c=r;for(e[r]==="-"&&r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;if(r<n&&e[r]==="."&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9")for(r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;if(r<n&&(e[r]==="e"||e[r]==="E"))for(r++,r<n&&(e[r]==="+"||e[r]==="-")&&r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;t.push({t:E.Num,v:+e.slice(c,r)});continue}if(o==="$"&&r+1<n&&(e[r+1]>="a"&&e[r+1]<="z"||e[r+1]>="A"&&e[r+1]<="Z"||e[r+1]==="_")){let c=r;for(r++;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;t.push({t:E.StateVar,v:e.slice(c,r)});continue}if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o==="_"){let c=r;for(;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;let u=e.slice(c,r);if(u==="true"){t.push({t:E.True});continue}if(u==="false"){t.push({t:E.False});continue}if(u==="null"){t.push({t:E.Null});continue}let p=o>="A"&&o<="Z"?E.Type:E.Ident;t.push({t:p,v:u});continue}if(o==="@"&&r+1<n&&(e[r+1]>="a"&&e[r+1]<="z"||e[r+1]>="A"&&e[r+1]<="Z"||e[r+1]==="_")){r++;let c=r;for(;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;t.push({t:E.BuiltinCall,v:e.slice(c,r)});continue}r++}return t.push({t:E.EOF}),t}function ar(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 hp;(function(e){e.ContinueConversation="continue_conversation",e.OpenUrl="open_url"})(hp||(hp={}));var Zh={},ey=[];function di(e){return Array.isArray(e)?"array":typeof e}function yp(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 Pp(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 ui(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e.default}function Bl(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e,r=yp(t);if(r)return r;let n=Pp(t);return n.enumValues?n.enumValues.map(o=>JSON.stringify(o)).join("|"):n.expectedType?n.expectedType:typeof t.type=="string"?t.type:void 0}function zl(e,t){let r=t.map(n=>{let o=Bl(n.schema),s=n.required?`${n.name}*`:n.name;return o?`${s}: ${o}`:s}).join(", ");return`${e}(${r})`}function ty(e,t){let r=typeof e;return t.enumValues?t.enumValues.includes(e)?null:{expected:`one of [${t.enumValues.map(n=>JSON.stringify(n)).join(", ")}]`,actual:di(e)}:t.expectedType&&t.expectedType!==r?{expected:t.expectedType,actual:di(e)}:null}function ry(e,t,r){switch(r.code){case"type-mismatch":return`field "${t}" expects ${r.expected} but got ${r.actual}`;case"pruned-value":return`field "${t}" lost an unresolved or invalid value`;case"missing-required":return`missing required field "${t}"${r.signature?` \u2014 signature: ${r.signature}`:""}`;case"null-required":return`required field "${t}" cannot be null${r.signature?` \u2014 signature: ${r.signature}`:""}`;case"unknown-component":return`Unknown component "${e}" \u2014 not found in catalog or builtins${r.available?.length?`. Available components: ${r.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 ${r.declared} arg(s), got ${r.got} (${r.got-r.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 r.reason==="not-component"?"root does not evaluate to a component":r.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 rt(e,t,r,n){e.errors.push({code:n.code,component:t,path:r,message:ry(t,r,n),statementId:e.currentStatementId,...n.code==="no-root"&&n.reason==="fallback"&&{severity:"warning"}})}var qt=Symbol("invalid");function pi(e,t){return t!==void 0?t:e?qt:void 0}function ny(e,t,r,n,o){return bp(t)?!1:typeof t.type=="string"||Array.isArray(t.enum)||"const"in t?(rt(o,r,n,{code:"type-mismatch",expected:typeof t.type=="string"?t.type:"a literal value",actual:`component "${e.typeName}"`}),!0):!1}function xp(e){return(e.anyOf??e.oneOf??[e]).map(yp)}function oy(e,t){let r=xp(e);return r.length>0&&r.every(n=>n!==void 0&&t.cat?.has(n))}function ay(e,t,r,n,o){if(typeof e!="object"||Array.isArray(e))return rt(o,r,n,{code:"type-mismatch",expected:"object",actual:di(e)}),qt;let s=e,i,a=t.properties&&typeof t.properties=="object"?t.properties:Zh,c=Array.isArray(t.required)?t.required:ey,u=!1;if(!o.partial)for(let p of c){let _=p in s;if(!_||s[p]==null){let d=ui(a[p]);if(d!==void 0){(i??(i={...s}))[p]=d;continue}rt(o,r,`${n}/${p}`,{code:_?"null-required":"missing-required"}),u=!0}}for(let p of Object.keys(a)){if(!(p in s))continue;let _=a[p],d=Uo(s[p],_,r,`${n}/${p}`,o);if(d===qt&&(d=pi(c.includes(p),ui(_)),d===qt)){u=!0;continue}d!==s[p]&&(i??(i={...s}),d===void 0?delete i[p]:i[p]=d)}return u?qt:i??s}function iy(e,t,r,n,o){if(!Array.isArray(e))return rt(o,r,n,{code:"type-mismatch",expected:"array",actual:di(e)}),qt;let s=t.items;if(!s||typeof s!="object"||Array.isArray(s))return e;let i;for(let a=0;a<e.length;a++){let c=Uo(e[a],s,r,`${n}/${a}`,o);c!==e[a]&&!i&&(i=e.slice(0,a)),i&&c!==qt&&i.push(c)}return i??e}function sy(e,t,r,n,o){let s=Pp(t);if(s.expectedType==null&&s.enumValues==null||s.enumValues&&o.partial)return!1;let i=ty(e,s);return i?(rt(o,r,n,{code:"type-mismatch",...i}),!0):!1}function Uo(e,t,r,n,o){if(!t||typeof t!="object"||Array.isArray(t))return e;let s=t;if(e==null||dn(e))return e;if(ar(e))return ny(e,s,r,n,o)?qt:e;if(bp(s))return oy(s,o)?(rt(o,r,n,{code:"type-mismatch",expected:xp(s).join(" | "),actual:Array.isArray(e)?"array":typeof e=="object"?"plain object":typeof e}),qt):e;let i=s.type;return i==="object"?ay(e,s,r,n,o):i==="array"?iy(e,s,r,n,o):sy(e,s,r,n,o)?qt:e}function _i(e){if(e==null||typeof e!="object")return!1;if(dn(e))return!0;if(Array.isArray(e))return e.some(_i);if(ar(e))return Object.values(e.props).some(_i);let t=e;return Array.isArray(t.steps)?!0:Object.values(t).some(_i)}function Sp(e,t,r){if(t.visited.has(e))return t.unres.push(e),r==="expr"?{k:"Ph",n:e}:null;let n=t.syms.get(e);if(!n)return t.unres.push(e),r==="expr"?{k:"Ph",n:e}:null;if(t.unreached?.delete(e),n.k==="Comp"&&Fn(n.name)){let s=n.name===Hr.Mutation?"mutation":"query";return{k:"RuntimeRef",n:e,refType:s}}t.visited.add(e);let o=t.currentStatementId;t.currentStatementId=e;try{let s=r==="value"?un(n,t):Hl(n,t);return r==="value"&&ar(s)&&(s.statementId=e),s}finally{t.currentStatementId=o,t.visited.delete(e)}}function fi(e,t){return $o(t.cat).has(e)||Fn(e)}function Fl(e,t){let r={};for(let[n,o]of t.entries()){let s=e[n];if(s===void 0)break;r[o.name]=s}return r}function wp(e,t,r,n){let{params:o}=r;t.length>o.length&&rt(n,e,"",{code:"excess-args",declared:o.length,got:t.length});let s=Fl(t,o),i=!1,a=n.errors.length;for(let c of o){let u=s[c.name],p=u?ai(u):{v:void 0};if(!p)continue;if(p.v==null){if(!c.required||c.defaultValue!==void 0)continue;rt(n,e,`/${c.name}`,{code:u?"null-required":"missing-required",signature:zl(e,o)}),i=!0;continue}let _=Uo(p.v,c.schema,e,`/${c.name}`,n);_===qt&&(_=pi(c.required,c.defaultValue)),_===qt?i=!0:_===void 0?delete s[c.name]:_!==p.v&&(s[c.name]=oi(_))}return r.kind==="action"&&n.errors.length>a&&(i=!0),i?null:s}function kp(e,t,r){let n=e.args.map(r),o=$o(t.cat).get(e.name);if(!o||o.lazy)return{...e,args:n};let s=o.builtin?Fl(n,o.params):wp(e.name,n,o,t);return s?{...e,args:n,mappedProps:s}:o.kind==="action"?{k:"Comp",name:"Action",args:[{k:"Arr",els:[]}]}:{k:"Null"}}function jl(e,t,r){let n=t.currentStatementId;t.currentStatementId=r;let o=new Set;for(let s of e)Oo(s,i=>{if(i.k!=="Comp"||o.has(i))return;o.add(i);let a=$o(t.cat).get(i.name);if(!a||a.lazy)return;let c=a.builtin?null:wp(i.name,i.args,a,t);i.mappedProps=c??Fl(i.args,a.params)});t.currentStatementId=n}function Cp(e,t,r){let n=$o(t.cat).get(e.name);if(n?.kind!=="function"||!n.lazy||e.args.length<3)return null;let o=e.args[1],s=o.k==="Ref"?o.n:o.k==="Str"?o.v:null;if(!s)return null;let i=new Set(r);i.add(s);let a=e.args.map((c,u)=>u===1?c:Ut(c,t,i));return{...e,args:a}}function Ut(e,t,r){switch(e.k){case"Ref":return r.has(e.n)?e:Sp(e.n,t,"expr");case"Ph":return e;case"Comp":{if(e.fn&&!fi(e.name,t))return rt(t,e.name,"",{code:"unknown-function"}),{k:"Null"};let n=Cp(e,t,r);if(n)return n;if(fi(e.name,t))return kp(e,t,i=>Ut(i,t,r));let o=e.args.map(i=>Ut(i,t,r)),s=t.cat?.get(e.name);if(s){let i={};for(let a=0;a<s.params.length&&a<o.length;a++)i[s.params[a].name]=o[a];return{...e,args:o,mappedProps:i}}return rt(t,e.name,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),{...e,args:o}}case"Arr":return{...e,els:e.els.map(n=>Ut(n,t,r))};case"Obj":return{...e,entries:e.entries.map(([n,o])=>[n,Ut(o,t,r)])};case"BinOp":return{...e,left:Ut(e.left,t,r),right:Ut(e.right,t,r)};case"UnaryOp":return{...e,operand:Ut(e.operand,t,r)};case"Ternary":return{...e,cond:Ut(e.cond,t,r),then:Ut(e.then,t,r),else:Ut(e.else,t,r)};case"Member":return{...e,obj:Ut(e.obj,t,r)};case"Index":return{...e,obj:Ut(e.obj,t,r),index:Ut(e.index,t,r)};case"Assign":return{...e,value:Ut(e.value,t,r)};default:return e}}function Hl(e,t){return Ut(e,t,new Set)}function un(e,t){switch(e.k){case"Ref":return Sp(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 r=[];for(let n of e.els){if(n.k==="Ph"){t.prunedValues++;continue}let o=un(n,t);if(o===null&&(n.k==="Comp"||n.k==="Ref")){t.prunedValues++;continue}r.push(o)}return r}case"Obj":{let r={};for(let[n,o]of e.entries)r[n]=un(o,t);return r}case"Comp":{let{name:r,args:n}=e;if(e.fn&&!fi(r,t))return rt(t,r,"",{code:"unknown-function"}),null;if(Fn(r))return rt(t,r,"",{code:"inline-reserved"}),null;if(fi(r,t)){let a=Cp(e,t,new Set);return a||kp(e,t,c=>Hl(c,t))}let o=t.cat?.get(r),s={};if(o){let a=!1;for(let u=0;u<o.params.length&&u<n.length;u++){let p=o.params[u],_=t.prunedValues,d=un(n[u],t);if(t.prunedValues>_&&rt(t,r,`/${p.name}`,{code:"pruned-value"}),s[p.name]=d,p.schema===void 0)continue;if(d==null&&p.defaultValue!==void 0){rt(t,r,`/${p.name}`,{code:"type-mismatch",expected:Bl(p.schema)??"a defined value",actual:d===null?"null":"undefined"}),s[p.name]=p.defaultValue,t.prunedValues=_;continue}let f=Uo(d,p.schema,r,`/${p.name}`,t);f===qt&&(f=pi(p.required,p.defaultValue),p.defaultValue!==void 0&&(t.prunedValues=_),f===qt?a=!0:f===void 0&&delete s[p.name]),f!==qt&&f!==void 0&&(s[p.name]=f)}n.length>o.params.length&&rt(t,r,"",{code:"excess-args",declared:o.params.length,got:n.length});let c=o.params.filter(u=>u.required&&(!(u.name in s)||s[u.name]===null));if(c.length){let u=c.filter(p=>p.defaultValue!==void 0?(rt(t,r,`/${p.name}`,{code:p.name in s?"null-required":"missing-required"}),s[p.name]=p.defaultValue,!1):!0);if(u.length){for(let p of u)rt(t,r,`/${p.name}`,{code:p.name in s?"null-required":"missing-required",signature:zl(r,o.params)});return null}}if(a)return null}else return rt(t,r,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),null;let i=Object.values(s).some(a=>_i(a));return{type:"element",typeName:r,props:s,partial:t.partial,hasDynamicProps:i}}default:return _p(e)?Hl(e,t):e}}function Vl(e){let t=[],r=!1,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(n){n=!1;continue}if(a==="\\"&&r){n=!0;continue}if(r){a===r&&(r=!1);continue}if(a==='"'||a==="'"){r=a;continue}a==="("||a==="["||a==="{"?t.push(a):(a===")"&&t[t.length-1]==="("||a==="]"&&t[t.length-1]==="["||a==="}"&&t[t.length-1]==="{")&&t.pop()}if(!(!!r||t.length>0))return{text:e,wasIncomplete:!1};let s=e;r&&(n&&(s+="\\"),s+=r);for(let i=t.length-1;i>=0;i--)s+=t[i]==="("?")":t[i]==="["?"]":"}";return{text:s,wasIncomplete:!0}}function mi(e){let t=[],r=0;for(;r<e.length;){for(;r<e.length&&e[r].t===E.Newline;)r++;if(r>=e.length||e[r].t===E.EOF)break;let n=e[r];if(n.t!==E.Ident&&n.t!==E.Type&&n.t!==E.StateVar){for(;r<e.length&&e[r].t!==E.Newline&&e[r].t!==E.EOF;)r++;continue}let o=n.v,s=n.t;if(r++,r>=e.length||e[r].t!==E.Equals){for(;r<e.length&&e[r].t!==E.Newline&&e[r].t!==E.EOF;)r++;continue}r++;let i=[],a=0,c=0;for(;r<e.length&&e[r].t!==E.EOF;){let u=e[r].t;if(u===E.Newline&&a<=0&&c<=0){let p=r+1;for(;p<e.length&&e[p].t===E.Newline;)p++;let _=p<e.length?e[p].t:E.EOF;if(_===E.Question||_===E.Colon&&c>0){r++;continue}break}if(u===E.Newline){r++;continue}u===E.LParen||u===E.LBrack||u===E.LBrace?a++:(u===E.RParen||u===E.RBrack||u===E.RBrace)&&a>0?a--:u===E.Question&&a===0?c++:u===E.Colon&&a===0&&c>0&&c--,i.push(e[r++])}i.length&&t.push({id:o,idTokenType:s,tokens:i})}return t}function vi(e=!0){return{root:null,meta:{incomplete:e,unresolved:[],orphaned:[],statementCount:0,errors:[]},stateDeclarations:{},queryStatements:[],mutationStatements:[]}}function Ap(e){if(!dn(e))return[];let t=new Set;return Oo(e,r=>{r.k==="StateRef"&&t.add(r.n)}),[...t]}function Gl(e,t){if(t.k==="Comp"&&t.name===Hr.Query){let r=Ap(t.args[1]);return{kind:"query",id:e.id,call:{callee:Hr.Query,args:t.args},expr:t,deps:r.length>0?r:void 0}}return t.k==="Comp"&&t.name===Hr.Mutation?{kind:"mutation",id:e.id,call:{callee:Hr.Mutation,args:t.args},expr:t}:e.idTokenType===E.StateVar?{kind:"state",id:e.id,init:t}:{kind:"value",id:e.id,expr:t}}function ly(e,t,r){let n={},o=[],s=[];for(let i of e)switch(i.kind){case"state":n[i.id]=un(i.init,t);break;case"query":jl(i.call.args,t,i.id),o.push({statementId:i.id,toolAST:i.call.args[0]??null,argsAST:i.call.args[1]??null,defaultsAST:i.call.args[2]??null,refreshAST:i.call.args[3]??null,deps:i.deps,complete:!0});break;case"mutation":jl(i.call.args,t,i.id),s.push({statementId:i.id,toolAST:i.call.args[0]??null,argsAST:i.call.args[1]??null});break}for(let i of e){let a=i.kind==="state"?[i.init]:i.kind==="value"?[i.expr]:i.kind==="query"||i.kind==="mutation"?i.call.args:[];for(let c of a)for(let u of Ap(c))u===r?.name&&r.stmts.has(i)||u in n||(n[u]=null)}return{stateDeclarations:n,queryStatements:o,mutationStatements:s}}var Tp="root";function Ql(e){return e?.k==="Comp"&&!e.fn&&!Do(e.name)&&!Fn(e.name)}function cy(e,t){if(e.has(Tp))return{id:Tp,fallback:!1};for(let r of e.values())if(r.kind==="value"&&Ql(r.expr)&&r.expr.name===t)return{id:r.id,fallback:!0};return null}function dy(e,t){let r=new Set;for(;e?.k==="Ref"&&!r.has(e.n);)r.add(e.n),e=t.get(e.n);return Ql(e)}function uy(e){let t=!1;return Oo(e,r=>{Ql(r)&&(t=!0)}),t}function gi(e,t,r,n,o,s,i){let a=cy(e,s),c=new Map;for(let[k,h]of e)c.set(k,h.kind==="state"?h.init:h.expr);let u=[],p=[],_=new Set;for(let[k,h]of e)k!==a?.id&&(h.kind==="state"||h.kind==="query"||h.kind==="mutation"||_.add(k));let d={syms:c,cat:o,errors:p,unres:u,prunedValues:0,visited:new Set,partial:r,currentStatementId:a?.id,unreached:_},f=null,v,g=a&&c.get(a.id);if(a&&g){let k=un(g,d);ar(k)?(f=k,f.statementId=a.id):dn(k)&&uy(k)&&(v=k)}let{stateDeclarations:P,queryStatements:b,mutationStatements:y}=ly(t,d,i);d.currentStatementId=a?.id;let x=s??"";a?!f&&!v&&!dy(c.get(a.id),c)?rt(d,x,"",{code:"no-root",reason:"not-component"}):a.fallback&&rt(d,x,"",{code:"no-root",reason:f?"fallback":"missing"}):rt(d,x,"",{code:"no-root",reason:"missing"});let S=a?[..._]:[];return{root:f,...v?{rootExpression:v}:{},meta:{incomplete:r,unresolved:u,orphaned:S,statementCount:n,errors:p},stateDeclarations:P,queryStatements:b,mutationStatements:y}}function Ip(e,t){if(e[t]!=='"')return t;let r=t+1;for(;r<e.length;){let n=e[r];if(n==="\\")r+=2;else{if(n==='"')return r+1;r++}}return r}function py(e){let t=[],r=0;for(;r<e.length;){let n=-1;for(;r<e.length;){let a=Ip(e,r);if(a>r){r=a;continue}if(e[r]==="`"&&r+1<e.length&&e[r+1]==="`"&&r+2<e.length&&e[r+2]==="`"){n=r;break}r++}if(n===-1)break;let o=n+3;for(;o<e.length&&e[o]!==`
38
- `;)o++;if(o>=e.length){t.push(e.slice(n+3).replace(/^[^\n]*\n?/,"")),r=e.length;break}o++;let s=-1,i=o;for(;i<e.length;){let a=Ip(e,i);if(a>i){i=a;continue}if(e[i]==="`"&&i+1<e.length&&e[i+1]==="`"&&i+2<e.length&&e[i+2]==="`"){s=i;break}i++}s!==-1?(t.push(e.slice(o,s)),r=s+3):(t.push(e.slice(o)),r=e.length)}if(t.length>0)return t.join(`
37
+ `:p==="t"?c+=" ":c+=p,r++}}else if(e[r]==="'"){r++,u=!0;break}else c+=e[r],r++;t.push({t:E.Str,v:c});continue}if(o==="-"){let c=t.length>0?t[t.length-1]:null;if(!(!(c!=null&&(c.t===E.Num||c.t===E.Str||c.t===E.Ident||c.t===E.Type||c.t===E.RParen||c.t===E.RBrack||c.t===E.True||c.t===E.False||c.t===E.Null||c.t===E.StateVar||c.t===E.BuiltinCall))&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9")){t.push({t:E.Minus}),r++;continue}}let s=o>="0"&&o<="9",a=o==="-"&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9";if(s||a){let c=r;for(e[r]==="-"&&r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;if(r<n&&e[r]==="."&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9")for(r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;if(r<n&&(e[r]==="e"||e[r]==="E"))for(r++,r<n&&(e[r]==="+"||e[r]==="-")&&r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;t.push({t:E.Num,v:+e.slice(c,r)});continue}if(o==="$"&&r+1<n&&(e[r+1]>="a"&&e[r+1]<="z"||e[r+1]>="A"&&e[r+1]<="Z"||e[r+1]==="_")){let c=r;for(r++;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;t.push({t:E.StateVar,v:e.slice(c,r)});continue}if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o==="_"){let c=r;for(;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;let u=e.slice(c,r);if(u==="true"){t.push({t:E.True});continue}if(u==="false"){t.push({t:E.False});continue}if(u==="null"){t.push({t:E.Null});continue}let p=o>="A"&&o<="Z"?E.Type:E.Ident;t.push({t:p,v:u});continue}if(o==="@"&&r+1<n&&(e[r+1]>="a"&&e[r+1]<="z"||e[r+1]>="A"&&e[r+1]<="Z"||e[r+1]==="_")){r++;let c=r;for(;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;t.push({t:E.BuiltinCall,v:e.slice(c,r)});continue}r++}return t.push({t:E.EOF}),t}function or(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 wp;(function(e){e.ContinueConversation="continue_conversation",e.OpenUrl="open_url"})(wp||(wp={}));var yy={},by=[];function da(e){return Array.isArray(e)?"array":typeof e}function kp(e){return typeof e.$ref=="string"?e.$ref.split("/").pop():void 0}function Cp(e){return"$ref"in e||"anyOf"in e||"oneOf"in e||"allOf"in e}function Tp(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 ua(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e.default}function ql(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e,r=kp(t);if(r)return r;let n=Tp(t);return n.enumValues?n.enumValues.map(o=>JSON.stringify(o)).join("|"):n.expectedType?n.expectedType:typeof t.type=="string"?t.type:void 0}function Ul(e,t){let r=t.map(n=>{let o=ql(n.schema),s=n.required?`${n.name}*`:n.name;return o?`${s}: ${o}`:s}).join(", ");return`${e}(${r})`}function Py(e,t){let r=typeof e;return t.enumValues?t.enumValues.includes(e)?null:{expected:`one of [${t.enumValues.map(n=>JSON.stringify(n)).join(", ")}]`,actual:da(e)}:t.expectedType&&t.expectedType!==r?{expected:t.expectedType,actual:da(e)}:null}function xy(e,t,r){switch(r.code){case"type-mismatch":return`field "${t}" expects ${r.expected} but got ${r.actual}`;case"pruned-value":return`field "${t}" lost an unresolved or invalid value`;case"missing-required":return`missing required field "${t}"${r.signature?` \u2014 signature: ${r.signature}`:""}`;case"null-required":return`required field "${t}" cannot be null${r.signature?` \u2014 signature: ${r.signature}`:""}`;case"unknown-component":return`Unknown component "${e}" \u2014 not found in catalog or builtins${r.available?.length?`. Available components: ${r.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 ${r.declared} arg(s), got ${r.got} (${r.got-r.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 r.reason==="not-component"?"root does not evaluate to a component":r.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 Ze(e,t,r,n){e.errors.push({code:n.code,component:t,path:r,message:xy(t,r,n),statementId:e.currentStatementId,...n.code==="no-root"&&n.reason==="fallback"&&{severity:"warning"}})}var qt=Symbol("invalid");function pa(e,t){return t!==void 0?t:e?qt:void 0}function Sy(e,t,r,n,o){return Cp(t)?!1:typeof t.type=="string"||Array.isArray(t.enum)||"const"in t?(Ze(o,r,n,{code:"type-mismatch",expected:typeof t.type=="string"?t.type:"a literal value",actual:`component "${e.typeName}"`}),!0):!1}function Ip(e){return(e.anyOf??e.oneOf??[e]).map(kp)}function wy(e,t){let r=Ip(e);return r.length>0&&r.every(n=>n!==void 0&&t.cat?.has(n))}function ky(e,t,r,n,o){if(typeof e!="object"||Array.isArray(e))return Ze(o,r,n,{code:"type-mismatch",expected:"object",actual:da(e)}),qt;let s=e,a,i=t.properties&&typeof t.properties=="object"?t.properties:yy,c=Array.isArray(t.required)?t.required:by,u=!1;if(!o.partial)for(let p of c){let _=p in s;if(!_||s[p]==null){let d=ua(i[p]);if(d!==void 0){(a??(a={...s}))[p]=d;continue}Ze(o,r,`${n}/${p}`,{code:_?"null-required":"missing-required"}),u=!0}}for(let p of Object.keys(i)){if(!(p in s))continue;let _=i[p],d=qo(s[p],_,r,`${n}/${p}`,o);if(d===qt&&(d=pa(c.includes(p),ua(_)),d===qt)){u=!0;continue}d!==s[p]&&(a??(a={...s}),d===void 0?delete a[p]:a[p]=d)}return u?qt:a??s}function Cy(e,t,r,n,o){if(!Array.isArray(e))return Ze(o,r,n,{code:"type-mismatch",expected:"array",actual:da(e)}),qt;let s=t.items;if(!s||typeof s!="object"||Array.isArray(s))return e;let a;for(let i=0;i<e.length;i++){let c=qo(e[i],s,r,`${n}/${i}`,o);c!==e[i]&&!a&&(a=e.slice(0,i)),a&&c!==qt&&a.push(c)}return a??e}function Ty(e,t,r,n,o){let s=Tp(t);if(s.expectedType==null&&s.enumValues==null||s.enumValues&&o.partial)return!1;let a=Py(e,s);return a?(Ze(o,r,n,{code:"type-mismatch",...a}),!0):!1}function qo(e,t,r,n,o){if(!t||typeof t!="object"||Array.isArray(t))return e;let s=t;if(e==null||cn(e))return e;if(or(e))return Sy(e,s,r,n,o)?qt:e;if(Cp(s))return wy(s,o)?(Ze(o,r,n,{code:"type-mismatch",expected:Ip(s).join(" | "),actual:Array.isArray(e)?"array":typeof e=="object"?"plain object":typeof e}),qt):e;let a=s.type;return a==="object"?ky(e,s,r,n,o):a==="array"?Cy(e,s,r,n,o):Ty(e,s,r,n,o)?qt:e}function _a(e){if(e==null||typeof e!="object")return!1;if(cn(e))return!0;if(Array.isArray(e))return e.some(_a);if(or(e))return Object.values(e.props).some(_a);let t=e;return Array.isArray(t.steps)?!0:Object.values(t).some(_a)}function Ap(e,t,r){if(t.visited.has(e))return t.unres.push(e),r==="expr"?{k:"Ph",n:e}:null;let n=t.syms.get(e);if(!n)return t.unres.push(e),r==="expr"?{k:"Ph",n:e}:null;if(t.unreached?.delete(e),n.k==="Comp"&&Hn(n.name)){let s=n.name===Ur.Mutation?"mutation":"query";return{k:"RuntimeRef",n:e,refType:s}}t.visited.add(e);let o=t.currentStatementId;t.currentStatementId=e;try{let s=r==="value"?dn(n,t):Bl(n,t);return r==="value"&&or(s)&&(s.statementId=e),s}finally{t.currentStatementId=o,t.visited.delete(e)}}function fa(e,t){return Oo(t.cat).has(e)||Hn(e)}function zl(e,t){let r={};for(let[n,o]of t.entries()){let s=e[n];if(s===void 0)break;r[o.name]=s}return r}function Rp(e,t,r,n){let{params:o}=r;t.length>o.length&&Ze(n,e,"",{code:"excess-args",declared:o.length,got:t.length});let s=zl(t,o),a=!1,i=n.errors.length;for(let c of o){let u=s[c.name],p=u?ia(u):{v:void 0};if(!p)continue;if(p.v==null){if(!c.required||c.defaultValue!==void 0)continue;Ze(n,e,`/${c.name}`,{code:u?"null-required":"missing-required",signature:Ul(e,o)}),a=!0;continue}let _=qo(p.v,c.schema,e,`/${c.name}`,n);_===qt&&(_=pa(c.required,c.defaultValue)),_===qt?a=!0:_===void 0?delete s[c.name]:_!==p.v&&(s[c.name]=oa(_))}return r.kind==="action"&&n.errors.length>i&&(a=!0),a?null:s}function Ep(e,t,r){let n=e.args.map(r),o=Oo(t.cat).get(e.name);if(!o||o.lazy)return{...e,args:n};let s=o.builtin?zl(n,o.params):Rp(e.name,n,o,t);return s?{...e,args:n,mappedProps:s}:o.kind==="action"?{k:"Comp",name:"Action",args:[{k:"Arr",els:[]}]}:{k:"Null"}}function Hl(e,t,r){let n=t.currentStatementId;t.currentStatementId=r;let o=new Set;for(let s of e)No(s,a=>{if(a.k!=="Comp"||o.has(a))return;o.add(a);let i=Oo(t.cat).get(a.name);if(!i||i.lazy)return;let c=i.builtin?null:Rp(a.name,a.args,i,t);a.mappedProps=c??zl(a.args,i.params)});t.currentStatementId=n}function Mp(e,t,r){let n=Oo(t.cat).get(e.name);if(n?.kind!=="function"||!n.lazy||e.args.length<3)return null;let o=e.args[1],s=o.k==="Ref"?o.n:o.k==="Str"?o.v:null;if(!s)return null;let a=new Set(r);a.add(s);let i=e.args.map((c,u)=>u===1?c:Ut(c,t,a));return{...e,args:i}}function Ut(e,t,r){switch(e.k){case"Ref":return r.has(e.n)?e:Ap(e.n,t,"expr");case"Ph":return e;case"Comp":{if(e.fn&&!fa(e.name,t))return Ze(t,e.name,"",{code:"unknown-function"}),{k:"Null"};let n=Mp(e,t,r);if(n)return n;if(fa(e.name,t))return Ep(e,t,a=>Ut(a,t,r));let o=e.args.map(a=>Ut(a,t,r)),s=t.cat?.get(e.name);if(s){let a={};for(let i=0;i<s.params.length&&i<o.length;i++)a[s.params[i].name]=o[i];return{...e,args:o,mappedProps:a}}return Ze(t,e.name,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),{...e,args:o}}case"Arr":return{...e,els:e.els.map(n=>Ut(n,t,r))};case"Obj":return{...e,entries:e.entries.map(([n,o])=>[n,Ut(o,t,r)])};case"BinOp":return{...e,left:Ut(e.left,t,r),right:Ut(e.right,t,r)};case"UnaryOp":return{...e,operand:Ut(e.operand,t,r)};case"Ternary":return{...e,cond:Ut(e.cond,t,r),then:Ut(e.then,t,r),else:Ut(e.else,t,r)};case"Member":return{...e,obj:Ut(e.obj,t,r)};case"Index":return{...e,obj:Ut(e.obj,t,r),index:Ut(e.index,t,r)};case"Assign":return{...e,value:Ut(e.value,t,r)};default:return e}}function Bl(e,t){return Ut(e,t,new Set)}function dn(e,t){switch(e.k){case"Ref":return Ap(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 r=[];for(let n of e.els){if(n.k==="Ph"){t.prunedValues++;continue}let o=dn(n,t);if(o===null&&(n.k==="Comp"||n.k==="Ref")){t.prunedValues++;continue}r.push(o)}return r}case"Obj":{let r={};for(let[n,o]of e.entries)r[n]=dn(o,t);return r}case"Comp":{let{name:r,args:n}=e;if(e.fn&&!fa(r,t))return Ze(t,r,"",{code:"unknown-function"}),null;if(Hn(r))return Ze(t,r,"",{code:"inline-reserved"}),null;if(fa(r,t)){let i=Mp(e,t,new Set);return i||Ep(e,t,c=>Bl(c,t))}let o=t.cat?.get(r),s={};if(o){let i=!1;for(let u=0;u<o.params.length&&u<n.length;u++){let p=o.params[u],_=t.prunedValues,d=dn(n[u],t);if(t.prunedValues>_&&Ze(t,r,`/${p.name}`,{code:"pruned-value"}),s[p.name]=d,p.schema===void 0)continue;if(d==null&&p.defaultValue!==void 0){Ze(t,r,`/${p.name}`,{code:"type-mismatch",expected:ql(p.schema)??"a defined value",actual:d===null?"null":"undefined"}),s[p.name]=p.defaultValue,t.prunedValues=_;continue}let f=qo(d,p.schema,r,`/${p.name}`,t);f===qt&&(f=pa(p.required,p.defaultValue),p.defaultValue!==void 0&&(t.prunedValues=_),f===qt?i=!0:f===void 0&&delete s[p.name]),f!==qt&&f!==void 0&&(s[p.name]=f)}n.length>o.params.length&&Ze(t,r,"",{code:"excess-args",declared:o.params.length,got:n.length});let c=o.params.filter(u=>u.required&&(!(u.name in s)||s[u.name]===null));if(c.length){let u=c.filter(p=>p.defaultValue!==void 0?(Ze(t,r,`/${p.name}`,{code:p.name in s?"null-required":"missing-required"}),s[p.name]=p.defaultValue,!1):!0);if(u.length){for(let p of u)Ze(t,r,`/${p.name}`,{code:p.name in s?"null-required":"missing-required",signature:Ul(r,o.params)});return null}}if(i)return null}else return Ze(t,r,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),null;let a=Object.values(s).some(i=>_a(i));return{type:"element",typeName:r,props:s,partial:t.partial,hasDynamicProps:a}}default:return yp(e)?Bl(e,t):e}}function Fl(e){let t=[],r=!1,n=!1;for(let a=0;a<e.length;a++){let i=e[a];if(n){n=!1;continue}if(i==="\\"&&r){n=!0;continue}if(r){i===r&&(r=!1);continue}if(i==='"'||i==="'"){r=i;continue}i==="("||i==="["||i==="{"?t.push(i):(i===")"&&t[t.length-1]==="("||i==="]"&&t[t.length-1]==="["||i==="}"&&t[t.length-1]==="{")&&t.pop()}if(!(!!r||t.length>0))return{text:e,wasIncomplete:!1};let s=e;r&&(n&&(s+="\\"),s+=r);for(let a=t.length-1;a>=0;a--)s+=t[a]==="("?")":t[a]==="["?"]":"}";return{text:s,wasIncomplete:!0}}function ma(e){let t=[],r=0;for(;r<e.length;){for(;r<e.length&&e[r].t===E.Newline;)r++;if(r>=e.length||e[r].t===E.EOF)break;let n=e[r];if(n.t!==E.Ident&&n.t!==E.Type&&n.t!==E.StateVar){for(;r<e.length&&e[r].t!==E.Newline&&e[r].t!==E.EOF;)r++;continue}let o=n.v,s=n.t;if(r++,r>=e.length||e[r].t!==E.Equals){for(;r<e.length&&e[r].t!==E.Newline&&e[r].t!==E.EOF;)r++;continue}r++;let a=[],i=0,c=0;for(;r<e.length&&e[r].t!==E.EOF;){let u=e[r].t;if(u===E.Newline&&i<=0&&c<=0){let p=r+1;for(;p<e.length&&e[p].t===E.Newline;)p++;let _=p<e.length?e[p].t:E.EOF;if(_===E.Question||_===E.Colon&&c>0){r++;continue}break}if(u===E.Newline){r++;continue}u===E.LParen||u===E.LBrack||u===E.LBrace?i++:(u===E.RParen||u===E.RBrack||u===E.RBrace)&&i>0?i--:u===E.Question&&i===0?c++:u===E.Colon&&i===0&&c>0&&c--,a.push(e[r++])}a.length&&t.push({id:o,idTokenType:s,tokens:a})}return t}function va(e=!0){return{root:null,meta:{incomplete:e,unresolved:[],orphaned:[],statementCount:0,errors:[]},stateDeclarations:{},queryStatements:[],mutationStatements:[]}}function Op(e){if(!cn(e))return[];let t=new Set;return No(e,r=>{r.k==="StateRef"&&t.add(r.n)}),[...t]}function Vl(e,t){if(t.k==="Comp"&&t.name===Ur.Query){let r=Op(t.args[1]);return{kind:"query",id:e.id,call:{callee:Ur.Query,args:t.args},expr:t,deps:r.length>0?r:void 0}}return t.k==="Comp"&&t.name===Ur.Mutation?{kind:"mutation",id:e.id,call:{callee:Ur.Mutation,args:t.args},expr:t}:e.idTokenType===E.StateVar?{kind:"state",id:e.id,init:t}:{kind:"value",id:e.id,expr:t}}function Iy(e,t,r){let n={},o=[],s=[];for(let a of e)switch(a.kind){case"state":n[a.id]=dn(a.init,t);break;case"query":Hl(a.call.args,t,a.id),o.push({statementId:a.id,toolAST:a.call.args[0]??null,argsAST:a.call.args[1]??null,defaultsAST:a.call.args[2]??null,refreshAST:a.call.args[3]??null,deps:a.deps,complete:!0});break;case"mutation":Hl(a.call.args,t,a.id),s.push({statementId:a.id,toolAST:a.call.args[0]??null,argsAST:a.call.args[1]??null});break}for(let a of e){let i=a.kind==="state"?[a.init]:a.kind==="value"?[a.expr]:a.kind==="query"||a.kind==="mutation"?a.call.args:[];for(let c of i)for(let u of Op(c))u===r?.name&&r.stmts.has(a)||u in n||(n[u]=null)}return{stateDeclarations:n,queryStatements:o,mutationStatements:s}}var Lp="root";function Gl(e){return e?.k==="Comp"&&!e.fn&&!$o(e.name)&&!Hn(e.name)}function Ay(e,t){if(e.has(Lp))return{id:Lp,fallback:!1};for(let r of e.values())if(r.kind==="value"&&Gl(r.expr)&&r.expr.name===t)return{id:r.id,fallback:!0};return null}function Ry(e,t){let r=new Set;for(;e?.k==="Ref"&&!r.has(e.n);)r.add(e.n),e=t.get(e.n);return Gl(e)}function Ey(e){let t=!1;return No(e,r=>{Gl(r)&&(t=!0)}),t}function ga(e,t,r,n,o,s,a){let i=Ay(e,s),c=new Map;for(let[k,h]of e)c.set(k,h.kind==="state"?h.init:h.expr);let u=[],p=[],_=new Set;for(let[k,h]of e)k!==i?.id&&(h.kind==="state"||h.kind==="query"||h.kind==="mutation"||_.add(k));let d={syms:c,cat:o,errors:p,unres:u,prunedValues:0,visited:new Set,partial:r,currentStatementId:i?.id,unreached:_},f=null,v,g=i&&c.get(i.id);if(i&&g){let k=dn(g,d);or(k)?(f=k,f.statementId=i.id):cn(k)&&Ey(k)&&(v=k)}let{stateDeclarations:y,queryStatements:b,mutationStatements:P}=Iy(t,d,a);d.currentStatementId=i?.id;let w=s??"";i?!f&&!v&&!Ry(c.get(i.id),c)?Ze(d,w,"",{code:"no-root",reason:"not-component"}):i.fallback&&Ze(d,w,"",{code:"no-root",reason:f?"fallback":"missing"}):Ze(d,w,"",{code:"no-root",reason:"missing"});let x=i?[..._]:[];return{root:f,...v?{rootExpression:v}:{},meta:{incomplete:r,unresolved:u,orphaned:x,statementCount:n,errors:p},stateDeclarations:y,queryStatements:b,mutationStatements:P}}function Np(e,t){if(e[t]!=='"')return t;let r=t+1;for(;r<e.length;){let n=e[r];if(n==="\\")r+=2;else{if(n==='"')return r+1;r++}}return r}function My(e){let t=[],r=0;for(;r<e.length;){let n=-1;for(;r<e.length;){let i=Np(e,r);if(i>r){r=i;continue}if(e[r]==="`"&&r+1<e.length&&e[r+1]==="`"&&r+2<e.length&&e[r+2]==="`"){n=r;break}r++}if(n===-1)break;let o=n+3;for(;o<e.length&&e[o]!==`
38
+ `;)o++;if(o>=e.length){t.push(e.slice(n+3).replace(/^[^\n]*\n?/,"")),r=e.length;break}o++;let s=-1,a=o;for(;a<e.length;){let i=Np(e,a);if(i>a){a=i;continue}if(e[a]==="`"&&a+1<e.length&&e[a+1]==="`"&&a+2<e.length&&e[a+2]==="`"){s=a;break}a++}s!==-1?(t.push(e.slice(o,s)),r=s+3):(t.push(e.slice(o)),r=e.length)}if(t.length>0)return t.join(`
39
39
  `);if(e.startsWith("```")){let n=3;for(;n<e.length&&e[n]!==`
40
- `;)n++;let o=n<e.length?n+1:3,s=e.slice(o),i=s.lastIndexOf("```");return i!==-1?s.slice(0,i):s}return e}function _y(e){let t=!1;return e.split(`
40
+ `;)n++;let o=n<e.length?n+1:3,s=e.slice(o),a=s.lastIndexOf("```");return a!==-1?s.slice(0,a):s}return e}function Ly(e){let t=!1;return e.split(`
41
41
  `).map(r=>{for(let n=0;n<r.length;n++){let o=r[n];if(t){if(o==="\\"&&n+1<r.length){n++;continue}o===t&&(t=!1);continue}if(o==='"'||o==="'"){t=o;continue}if(o==="/"&&r[n+1]==="/"||o==="#")return r.substring(0,n).trimEnd()}return r}).join(`
42
- `)}function Rp(e){return _y(py(e.trim())).trim()}function Ep(e,t,r){let n=Rp(e);if(!n)return vi();let{text:o,wasIncomplete:s}=Vl(n),i=mi(ci(o));if(!i.length)return vi(s);let a=new Map;for(let u of i){let p=li(u.tokens),_=Gl(u,p);a.set(u.id,_)}let c=[...a.values()];return gi(a,c,s,a.size,t,r)}function Mp(e,t){let r="",n="",o=0,s=new Map,i=0;function a(d){let f=d.trim();if(f)for(let v of mi(ci(f))){let g=li(v.tokens),P=Gl(v,g);s.set(v.id,P),i++}}function c(){let d=Rp(r);d.startsWith(n.slice(0,o))||(o=0,s.clear(),i=0),n=d}function u(){let d=0,f=0,v=!1,g=!1,P=o;for(let b=o;b<n.length;b++){let y=n[b];if(g){g=!1;continue}if(y==="\\"&&v){g=!0;continue}if(v){y===v&&(v=!1);continue}if(y==='"'||y==="'"){v=y;continue}if(y==="("||y==="["||y==="{")d++;else if(y===")"||y==="]"||y==="}")d=Math.max(0,d-1);else if(y==="?"&&d===0)f++;else if(y===":"&&d===0&&f>0)f--;else if(y===`
43
- `&&d<=0&&f<=0){let x=b+1;for(;x<n.length&&(n[x]===" "||n[x]===" "||n[x]==="\r"||n[x]===`
44
- `);)x++;if(x<n.length&&(n[x]==="?"||n[x]===":"&&f>0))continue;let S=n.slice(P,b).trim();S&&a(S),P=b+1,o=b+1}}return P}function p(d=!1){c();let f=u(),v=n.slice(f).trim(),g=d?v:v.replace(/(\d)\.$/,"$1");if(!g)return i===0?vi():gi(s,[...s.values()],!1,i,e,t);let{text:P,wasIncomplete:b}=Vl(g),y=mi(ci(P));if(!y.length)return i===0?vi(b):gi(s,[...s.values()],b,i,e,t);let x=new Map(s),S=new Set;for(let w of y){if(s.has(w.id)&&b)continue;let A=li(w.tokens),I=Gl(w,A);x.set(w.id,I),S.add(I)}let k=d?void 0:/\$\w+$/.exec(r)?.[0],h=k&&g.endsWith(k)&&!new RegExp(`\\${k}(?!\\w)`).test(g.slice(0,-k.length))?k:void 0,m=[...x.values()];return gi(x,m,b,i+y.length,e,t,h?{name:h,stmts:S}:void 0)}function _(){r="",n="",o=0,s.clear(),i=0}return{push(d,f){return r+=d,p(f)},set(d,f){(d.length<r.length||!d.startsWith(r))&&_();let v=d.slice(r.length);return v&&(r+=v),p(f)},getResult:p}}function Kl(e,t){if(!e||typeof e!="object")return e;let r=e.$ref;if(typeof r=="string")return t.has(r)?Kl(t.get(r),t):e;let n=Array.isArray(e)?[...e]:{...e},o=!1;for(let[s,i]of Object.entries(n))n[s]=Kl(i,t),o||(o=n[s]!==i);return o?n:e}function Wl(e,t){let r=e.properties??{},n=e.required??[];return Object.keys(r).map(o=>({name:o,required:n.includes(o),defaultValue:ui(r[o]),schema:t.size?Kl(r[o],t):r[o]}))}function Lp(e){let t=new Map,r=e.properties&&new Set(Object.keys(e.properties)),n=new Map;for(let o of[...Object.keys(fp),...Object.keys(e.actions??{})]){let s=e.$defs?.[o];s&&!r?.has(o)&&n.set(`#/$defs/${o}`,s)}for(let[o,s]of Object.entries(e.$defs??{}))(r?!r.has(o):n.has(`#/$defs/${o}`))||t.set(o,{params:Wl(s,n)});t.callDefs=new Map(ii);for(let[o,s]of Object.entries(e.functions??{}))t.callDefs.set(o,{kind:"function",params:Wl(s.params,n)});for(let[o,s]of Object.entries(e.actions??{}))t.callDefs.set(o,{kind:"action",params:Wl(s.params,n)});return t}var $p=Lp(Hn.schema),fy={parse(e){return Ep(e,$p,Hn.root)}};function Dp(){return Mp($p,Hn.root)}function qp(e,t,r){let n=Up(e,t,r);return!t&&(n.error||n.diagnostics.errors.length>0||n.diagnostics.unresolved.length>0||n.diagnostics.incomplete)&&console.warn("Generative UI diagnostics",{error:n.error,partial:n.partial,diagnostics:n.diagnostics}),n}function Up(e,t,r){let n=t?r?.match(/^\w+(?=\s*=)/gm)?.at(-1):void 0,o=e.root?.props.children,s=new Set,i=e.meta,a=e.meta.errors.some(g=>g.severity!=="warning"&&!(g.component==="Grid"&&g.path==="/columns"||g.component==="Cell"&&g.path==="/span"));function c(g,P,b){i===e.meta&&(i={...e.meta,errors:[...e.meta.errors]}),i.errors.push({code:"type-mismatch",component:g.typeName,path:P,message:b,statementId:g.statementId}),a=!0}function u(g,P,b){if(!ar(g)||typeof g.statementId!="string"||s.has(g.statementId)){c(P,`/children/${b}`,"Child must be a valid, uniquely named component");return}if(g.typeName==="Root"||(g.typeName==="Grid"||g.typeName==="Carousel")&&P.typeName!=="Root"||g.typeName==="Cell"&&P.typeName==="Cell"||P.typeName==="Carousel"&&g.typeName!=="Card"&&g.typeName!=="Product"){c(P,`/children/${b}`,"Component is not allowed at this nesting level");return}if(s.add(g.statementId),(g.typeName==="Product"||g.typeName==="Cart"||g.typeName==="Order")&&g.statementId===n||(g.typeName==="Chart"||g.typeName==="Table")&&e.meta.errors.some(w=>w.statementId===g.statementId&&w.severity!=="warning"))return;let y=(g.typeName==="Grid"||g.typeName==="Cell"||g.typeName==="Carousel")&&Array.isArray(g.props.children)?g.props.children.flatMap((w,A)=>{let I=u(w,g,A);return I?[I]:[]}):void 0,x=!1;function S(w){return Object.fromEntries(Object.entries(w).flatMap(([A,I])=>I==null?[]:[[A,k(I)]]))}function k(w){return Array.isArray(w)?(w.some(A=>A==null)&&(x=!0),w.flatMap(A=>A==null?[]:[k(A)])):typeof w=="object"&&w!==null&&!ar(w)?S(w):w}let h=S(g.props);if(x&&(g.typeName==="Chart"||g.typeName==="Table")){c(g,"","A list item is missing");return}x&&(a=!0);let m={...g,props:{...h,...y&&{children:y}}};if(!pp(m)){c(g,"","Component does not match the catalog");return}if(m.typeName==="Table"&&m.props.rows.some(w=>w.length!==m.props.columns.length)){c(g,"/rows","Every table row must contain one value per column");return}if(y?.length!==0&&!((m.typeName==="Chart"||m.typeName==="Table")&&(t||e.meta.incomplete)))return m}let p=e.root,_=p&&Array.isArray(o)?o.flatMap((g,P)=>{if(ar(g)&&g.typeName==="Cell")return c(p,`/children/${P}`,"Cell must be inside a Grid"),[];let b=u(g,p,P);return b&&b.typeName!=="Cell"?[b]:[]}):[],d=p?.hasDynamicProps===!0||e.queryStatements.length>0||e.mutationStatements.length>0||Object.keys(e.stateDeclarations).length>0||e.meta.errors.some(g=>g.code==="unknown-function"||g.code==="inline-reserved");d&&p&&c(p,"","Executable content is not supported by the static catalog"),p&&p.typeName!==Hn.root&&c(p,"","The block must use the catalog root component");let f=d||p!==null&&p.typeName!==Hn.root||!t&&(!Array.isArray(o)||_.length===0),v=!t&&!f&&(a||e.meta.incomplete);return{elements:f?[]:_,error:f,partial:v,diagnostics:i}}function Bp(e,t){return Up(fy.parse(e),!1).elements.flatMap(n=>zp(n,t)).join(`
42
+ `)}function $p(e){return Ly(My(e.trim())).trim()}function Dp(e,t,r){let n=$p(e);if(!n)return va();let{text:o,wasIncomplete:s}=Fl(n),a=ma(ca(o));if(!a.length)return va(s);let i=new Map;for(let u of a){let p=la(u.tokens),_=Vl(u,p);i.set(u.id,_)}let c=[...i.values()];return ga(i,c,s,i.size,t,r)}function qp(e,t){let r="",n="",o=0,s=new Map,a=0;function i(d){let f=d.trim();if(f)for(let v of ma(ca(f))){let g=la(v.tokens),y=Vl(v,g);s.set(v.id,y),a++}}function c(){let d=$p(r);d.startsWith(n.slice(0,o))||(o=0,s.clear(),a=0),n=d}function u(){let d=0,f=0,v=!1,g=!1,y=o;for(let b=o;b<n.length;b++){let P=n[b];if(g){g=!1;continue}if(P==="\\"&&v){g=!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===`
43
+ `&&d<=0&&f<=0){let w=b+1;for(;w<n.length&&(n[w]===" "||n[w]===" "||n[w]==="\r"||n[w]===`
44
+ `);)w++;if(w<n.length&&(n[w]==="?"||n[w]===":"&&f>0))continue;let x=n.slice(y,b).trim();x&&i(x),y=b+1,o=b+1}}return y}function p(d=!1){c();let f=u(),v=n.slice(f).trim(),g=d?v:v.replace(/(\d)\.$/,"$1");if(!g)return a===0?va():ga(s,[...s.values()],!1,a,e,t);let{text:y,wasIncomplete:b}=Fl(g),P=ma(ca(y));if(!P.length)return a===0?va(b):ga(s,[...s.values()],b,a,e,t);let w=new Map(s),x=new Set;for(let S of P){if(s.has(S.id)&&b)continue;let A=la(S.tokens),I=Vl(S,A);w.set(S.id,I),x.add(I)}let k=d?void 0:/\$\w+$/.exec(r)?.[0],h=k&&g.endsWith(k)&&!new RegExp(`\\${k}(?!\\w)`).test(g.slice(0,-k.length))?k:void 0,m=[...w.values()];return ga(w,m,b,a+P.length,e,t,h?{name:h,stmts:x}:void 0)}function _(){r="",n="",o=0,s.clear(),a=0}return{push(d,f){return r+=d,p(f)},set(d,f){(d.length<r.length||!d.startsWith(r))&&_();let v=d.slice(r.length);return v&&(r+=v),p(f)},getResult:p}}function Wl(e,t){if(!e||typeof e!="object")return e;let r=e.$ref;if(typeof r=="string")return t.has(r)?Wl(t.get(r),t):e;let n=Array.isArray(e)?[...e]:{...e},o=!1;for(let[s,a]of Object.entries(n))n[s]=Wl(a,t),o||(o=n[s]!==a);return o?n:e}function jl(e,t){let r=e.properties??{},n=e.required??[];return Object.keys(r).map(o=>({name:o,required:n.includes(o),defaultValue:ua(r[o]),schema:t.size?Wl(r[o],t):r[o]}))}function Up(e){let t=new Map,r=e.properties&&new Set(Object.keys(e.properties)),n=new Map;for(let o of[...Object.keys(bp),...Object.keys(e.actions??{})]){let s=e.$defs?.[o];s&&!r?.has(o)&&n.set(`#/$defs/${o}`,s)}for(let[o,s]of Object.entries(e.$defs??{}))(r?!r.has(o):n.has(`#/$defs/${o}`))||t.set(o,{params:jl(s,n)});t.callDefs=new Map(aa);for(let[o,s]of Object.entries(e.functions??{}))t.callDefs.set(o,{kind:"function",params:jl(s.params,n)});for(let[o,s]of Object.entries(e.actions??{}))t.callDefs.set(o,{kind:"action",params:jl(s.params,n)});return t}var Hp=Up(zn.schema),Ny={parse(e){return Dp(e,Hp,zn.root)}};function Fp(){return qp(Hp,zn.root)}function jp(e,t,r){let n=Vp(e,t,r);return!t&&(n.error||n.diagnostics.errors.length>0||n.diagnostics.unresolved.length>0||n.diagnostics.incomplete)&&console.warn("Generative UI diagnostics",{error:n.error,partial:n.partial,diagnostics:n.diagnostics}),n}function Vp(e,t,r){let n=t?r?.match(/^\w+(?=\s*=)/gm)?.at(-1):void 0,o=e.root?.props.children,s=new Set,a=e.meta,i=e.meta.errors.some(g=>g.severity!=="warning"&&!(g.component==="Grid"&&g.path==="/columns"||g.component==="Cell"&&g.path==="/span"));function c(g,y,b){a===e.meta&&(a={...e.meta,errors:[...e.meta.errors]}),a.errors.push({code:"type-mismatch",component:g.typeName,path:y,message:b,statementId:g.statementId}),i=!0}function u(g,y,b){if(!or(g)||typeof g.statementId!="string"||s.has(g.statementId)){c(y,`/children/${b}`,"Child must be a valid, uniquely named component");return}if(g.typeName==="Root"||(g.typeName==="Grid"||g.typeName==="Carousel")&&y.typeName!=="Root"||g.typeName==="Cell"&&y.typeName==="Cell"||y.typeName==="Carousel"&&g.typeName!=="Card"&&g.typeName!=="Product"){c(y,`/children/${b}`,"Component is not allowed at this nesting level");return}if(s.add(g.statementId),(g.typeName==="Product"||g.typeName==="Cart"||g.typeName==="Order")&&g.statementId===n||(g.typeName==="Chart"||g.typeName==="Table")&&e.meta.errors.some(S=>S.statementId===g.statementId&&S.severity!=="warning"))return;let P=(g.typeName==="Grid"||g.typeName==="Cell"||g.typeName==="Carousel")&&Array.isArray(g.props.children)?g.props.children.flatMap((S,A)=>{let I=u(S,g,A);return I?[I]:[]}):void 0,w=!1;function x(S){return Object.fromEntries(Object.entries(S).flatMap(([A,I])=>I==null?[]:[[A,k(I)]]))}function k(S){return Array.isArray(S)?(S.some(A=>A==null)&&(w=!0),S.flatMap(A=>A==null?[]:[k(A)])):typeof S=="object"&&S!==null&&!or(S)?x(S):S}let h=x(g.props);if(w&&(g.typeName==="Chart"||g.typeName==="Table")){c(g,"","A list item is missing");return}w&&(i=!0);let m={...g,props:{...h,...P&&{children:P}}};if(!hp(m)){c(g,"","Component does not match the catalog");return}if(m.typeName==="Table"&&m.props.rows.some(S=>S.length!==m.props.columns.length)){c(g,"/rows","Every table row must contain one value per column");return}if(P?.length!==0&&!((m.typeName==="Chart"||m.typeName==="Table")&&(t||e.meta.incomplete)))return m}let p=e.root,_=p&&Array.isArray(o)?o.flatMap((g,y)=>{if(or(g)&&g.typeName==="Cell")return c(p,`/children/${y}`,"Cell must be inside a Grid"),[];let b=u(g,p,y);return b&&b.typeName!=="Cell"?[b]:[]}):[],d=p?.hasDynamicProps===!0||e.queryStatements.length>0||e.mutationStatements.length>0||Object.keys(e.stateDeclarations).length>0||e.meta.errors.some(g=>g.code==="unknown-function"||g.code==="inline-reserved");d&&p&&c(p,"","Executable content is not supported by the static catalog"),p&&p.typeName!==zn.root&&c(p,"","The block must use the catalog root component");let f=d||p!==null&&p.typeName!==zn.root||!t&&(!Array.isArray(o)||_.length===0),v=!t&&!f&&(i||e.meta.incomplete);return{elements:f?[]:_,error:f,partial:v,diagnostics:a}}function Wp(e,t){return Vp(Ny.parse(e),!1).elements.flatMap(n=>Gp(n,t)).join(`
45
45
 
46
- `)}function zp(e,t){switch(e.typeName){case"Grid":case"Cell":case"Carousel":return e.props.children.flatMap(r=>zp(r,t));case"Text":return[e.props.text];case"Card":return[`${e.props.title}
46
+ `)}function Gp(e,t){switch(e.typeName){case"Grid":case"Cell":case"Carousel":return e.props.children.flatMap(r=>Gp(r,t));case"Text":return[e.props.text];case"Card":return[`${e.props.title}
47
47
  ${e.props.body}`];case"Metric":return[[e.props.label,e.props.value,e.props.detail].filter(Boolean).join(`
48
48
  `)];case"Table":return[[e.props.title,e.props.columns.join(" "),...e.props.rows.map(r=>r.join(" "))].join(`
49
49
  `)];case"Chart":return[[e.props.title,...e.props.data.map(r=>`${r.label}: ${r.value}`)].join(`
50
- `)];case"Product":return[[e.props.product.title,xr(e.props.product.price,t),e.props.product.description].filter(Boolean).join(`
51
- `)];case"Cart":return[[...e.props.cart.lines.map(r=>Np(r,t)),...e.props.cart.totals.map(r=>Op(r,t))].join(`
52
- `)];case"Order":return[[`${e.props.order.number} \xB7 ${e.props.order.status}`,...e.props.order.items.map(r=>Np(r,t)),...e.props.order.totals.map(r=>Op(r,t))].join(`
53
- `)]}}function Np(e,t){return`${[e.title,...Object.values(e.options??{})].join(", ")} \xD7 ${e.quantity}: ${xr(e.price,t)}`}function Op(e,t){return`${e.label}: ${xr(e.amount,t)}`}function jp(e,{cssPrefix:t,strings:r,locale:n,onAction:o}){let s=[],i=se(!1),a;return{...ni(e),set_attr(c,u,p){if(u!==Eo||p!=="openui"||c.index!==1)return Nl(c,u,p);let _=document.createElement("div");c.nodes[c.index]?.parentElement?.replaceWith(_),a={textSig:se(""),doneSig:se(!1)},s.push(_),cr(l(gy,{cssPrefix:t,textSig:a.textSig,doneSig:a.doneSig,replyDoneSig:i,strings:r,locale:n,onAction:o}),_)},add_text(c,u){a?a.textSig.value=a.textSig.peek()+u:Ll(c,u)},end_token(c){a&&(a.doneSig.value=!0,a=void 0),Ml(c)},finish(){a&&(a.doneSig.value=!0),i.value=!0},dispose(){for(let c of s)cr(null,c);s.length=0,a=void 0}}}function gy({textSig:e,doneSig:t,replyDoneSig:r,cssPrefix:n,strings:o,locale:s,onAction:i}){let a=ve(()=>{let u=Dp(),p=[];return Se(()=>{let _=qp(u.set(e.value,t.value),!t.value,e.value);return!t.value&&p.length>0&&(_.error||_.elements.length===0)?{..._,error:!1,elements:p}:(p=_.elements,_)})},[e,t]),c={cssPrefix:n,strings:o,locale:s,onAction:i,busy:!r.value};return a.value.error?l("div",{role:"alert",children:o.visualError}):l("div",{class:`${n}-generative-ui`,"aria-busy":!t.value,children:[a.value.elements.map(u=>l(hi,{element:u,context:c},u.statementId)),a.value.partial&&l("p",{role:"status",children:o.visualPartial}),a.value.elements.length===0&&!t.value?l("span",{role:"status",children:o.visualPreparing}):null]})}function hi({element:e,context:t}){let{cssPrefix:r}=t;if(e.typeName==="Grid")return l("div",{class:`${r}-generative-ui-grid-container`,children:l("div",{class:`${r}-generative-ui-grid`,"data-columns":e.props.columns,"data-equal-heights":lp(e.props.children)||void 0,children:e.props.children.map(n=>l("div",{class:`${r}-generative-ui-cell`,"data-span":n.typeName==="Cell"?n.props.span??1:1,children:n.typeName==="Cell"?n.props.children.map(o=>l(hi,{element:o,context:t},o.statementId)):l(hi,{element:n,context:t})},n.statementId))})});switch(e.typeName){case"Carousel":return l("div",{role:"list",class:`${r}-generative-ui-carousel`,children:e.props.children.map(n=>l("div",{role:"listitem",children:l(hi,{element:n,context:t})},n.statementId))});case"Text":return l("p",{children:e.props.text});case"Card":return l("section",{children:[l("strong",{children:e.props.title}),l("p",{children:e.props.body}),l(Bo,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Product":return l(vy,{...e.props,context:t});case"Cart":return l("section",{children:[e.props.cart.messages?.map(n=>l("p",{role:n.severity==="info"?"status":"alert",class:`${r}-generative-ui-notice`,"data-severity":n.severity,children:n.text},n.text)),e.props.cart.lines.length?l(Hp,{lines:e.props.cart.lines,context:t}):l("p",{class:`${r}-generative-ui-muted`,children:t.strings.visualCartEmpty}),e.props.cart.lines.length>0&&l(Fp,{totals:e.props.cart.totals,context:t}),l(Bo,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Order":return l("section",{children:[l("div",{class:`${r}-generative-ui-heading`,children:[l("strong",{children:e.props.order.number}),l("span",{class:`${r}-generative-ui-pill`,children:e.props.order.status})]}),e.props.order.date&&l("p",{class:`${r}-generative-ui-muted`,children:Ol(e.props.order.date,t.locale)}),e.props.order.timeline?.length?l("ol",{class:`${r}-generative-ui-timeline`,children:e.props.order.timeline.map(n=>l("li",{"data-done":n.done,children:[l("span",{children:n.label}),n.date&&l("span",{class:`${r}-generative-ui-muted`,children:Ol(n.date,t.locale)})]},n.label))}):null,l(Hp,{lines:e.props.order.items,context:t}),l(Fp,{totals:e.props.order.totals,context:t}),l(Bo,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Metric":return l("section",{children:[l("strong",{children:e.props.label}),l("span",{class:`${r}-generative-ui-metric`,children:e.props.value}),e.props.detail&&l("p",{children:e.props.detail})]});case"Table":return l("section",{children:l("div",{class:`${r}-generative-ui-table`,children:l("table",{children:[l("caption",{children:e.props.title}),l("thead",{children:l("tr",{children:e.props.columns.map((n,o)=>l("th",{scope:"col",children:n},o))})}),l("tbody",{children:e.props.rows.map((n,o)=>l("tr",{children:n.map((s,i)=>l("td",{children:s},i))},o))})]})})});case"Chart":return l(yy,{element:e,cssPrefix:r})}}function vy({product:e,actions:t,context:r}){let{cssPrefix:n,strings:o}=r,[s,i]=U({}),a=up(e,s),c=$l(t,r.onAction!==void 0).some(u=>u.message!==void 0);return l("section",{class:`${n}-generative-ui-product`,children:[a.image&&l(Vp,{src:a.image,href:e.url,class:`${n}-generative-ui-photo`},a.image),(e.badge||!a.available)&&l("div",{class:`${n}-generative-ui-heading`,children:[e.badge&&l("span",{class:`${n}-generative-ui-pill`,children:e.badge}),!a.available&&l("span",{class:`${n}-generative-ui-pill`,children:o.visualSoldOut})]}),l("strong",{class:`${n}-generative-ui-title`,children:l(Wp,{title:e.title,url:e.url})}),e.rating&&l("span",{class:`${n}-generative-ui-muted`,children:[l("span",{"aria-hidden":"true",class:`${n}-generative-ui-star`,children:["\u2605"," "]}),e.rating.value,e.rating.count!==void 0&&` (${e.rating.count})`]}),l(hy,{price:a.price,compareAtPrice:a.compareAtPrice,context:r}),e.description&&l("p",{class:`${n}-generative-ui-description`,children:e.description}),a.options.map(u=>l("fieldset",{class:`${n}-generative-ui-option`,children:[l("legend",{children:u.name}),l(by,{children:u.values.map(p=>l("button",{type:"button","aria-pressed":u.value===p,disabled:u.unavailable.includes(p),onClick:()=>i({...s,[u.name]:p}),children:p},p))})]},u.name)),l("div",{class:`${n}-generative-ui-footer`,children:[l(Bo,{actions:t,context:r,disabled:r.busy||!a.canBuy,getMessage:u=>Dl(u,e.title,a.chosen)}),c&&l("p",{class:`${n}-generative-ui-hint`,children:a.missing.length>0&&`${o.visualChoose} ${a.missing.join(", ")}`})]})]})}function Hp({lines:e,context:t}){let{cssPrefix:r,strings:n}=t;return e.length?l("ul",{class:`${r}-generative-ui-lines`,children:e.map((o,s)=>l("li",{children:[o.image&&l(Vp,{src:o.image,class:`${r}-generative-ui-thumb`},o.image),l("div",{children:[l("div",{class:`${r}-generative-ui-line-head`,children:[l("span",{children:l(Wp,{title:o.title,url:o.url})}),l("strong",{children:xr(o.price,t.locale)})]}),l("span",{class:`${r}-generative-ui-muted`,children:[...Object.entries(o.options??{}).map(([i,a])=>`${i}: ${a}`),`${n.visualQuantity} ${o.quantity}`].join(" \xB7 ")}),l(Bo,{actions:o.actions,context:t,disabled:t.busy,small:!0,getMessage:i=>Dl(i,o.title,o.options)})]})]},s))}):null}function Bo({actions:e,context:t,disabled:r,small:n,getMessage:o}){let s=$l(e,t.onAction!==void 0);return s.length?l("div",{class:`${t.cssPrefix}-generative-ui-actions`,"data-small":n,children:s.map(i=>{if(i.message===void 0)return l("a",{href:i.url,target:"_blank",rel:"noopener noreferrer","data-primary":i.primary,children:i.label},i.label);let a=i.message;return l("button",{type:"button",disabled:r,"data-primary":i.primary,onClick:()=>t.onAction?.(o?.(a)??a),children:i.label},i.label)})}):null}function Vp({src:e,href:t,class:r}){let[n,o]=U(!1);if(n||!Lo(e))return null;let s=l("img",{src:e,alt:"",loading:"lazy",referrerpolicy:"no-referrer",onError:()=>o(!0)});return Lo(t)?l("a",{href:t,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,"aria-hidden":"true",class:r,children:s}):l("span",{class:r,children:s})}function Wp({title:e,url:t}){return Lo(t)?l("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:e}):l(ge,{children:e})}function hy({price:e,compareAtPrice:t,context:{cssPrefix:r,locale:n}}){return l("span",{class:`${r}-generative-ui-price`,children:[l("strong",{children:xr(e,n)}),t&&dp(e,t)&&l("s",{children:xr(t,n)})]})}function Fp({totals:e,context:{cssPrefix:t,locale:r}}){return e.length?l("dl",{class:`${t}-generative-ui-totals`,children:e.map(n=>l("div",{children:[l("dt",{children:n.label}),l("dd",{children:xr(n.amount,r)})]},n.label))}):null}function yy({element:e,cssPrefix:t}){let{baseline:r,barWidth:n,points:o}=sp(e.props.data);return l("section",{children:[l("strong",{children:e.props.title}),l("svg",{class:`${t}-generative-ui-chart`,viewBox:"0 0 320 168",role:"img","aria-label":`${e.props.title}. ${e.props.data.map(s=>`${s.label}: ${s.value}`).join(", ")}`,children:[l("line",{class:`${t}-generative-ui-axis`,x1:24,x2:296,y1:r,y2:r}),e.props.type==="line"&&l("polyline",{points:o.map(s=>`${s.x},${s.y}`).join(" "),fill:"none",stroke:"currentColor","stroke-width":3}),o.map((s,i)=>e.props.type==="bar"?l("rect",{x:s.x-n/2,y:Math.min(s.y,r),width:n,height:Math.abs(s.y-r),fill:"currentColor"},i):l("circle",{cx:s.x,cy:s.y,r:3,fill:"currentColor"},i))]}),l("div",{class:`${t}-generative-ui-data`,children:e.props.data.map((s,i)=>l("span",{children:[s.label,": ",s.value]},i))})]})}function yi(e,t){if(!e.includes("```openui"))return e;let r="",n=0,o=0,s=0,i=0,a;function c(p){a?.language==="openui"&&(r+=e.slice(n,a.start)+Bp(a.source,t)+(e[p-1]===`
50
+ `)];case"Product":return[[e.props.product.title,br(e.props.product.price,t),e.props.product.description].filter(Boolean).join(`
51
+ `)];case"Cart":return[[...e.props.cart.lines.map(r=>Bp(r,t)),...e.props.cart.totals.map(r=>zp(r,t))].join(`
52
+ `)];case"Order":return[[`${e.props.order.number} \xB7 ${e.props.order.status}`,...e.props.order.items.map(r=>Bp(r,t)),...e.props.order.totals.map(r=>zp(r,t))].join(`
53
+ `)]}}function Bp(e,t){return`${[e.title,...Object.values(e.options??{})].join(", ")} \xD7 ${e.quantity}: ${br(e.price,t)}`}function zp(e,t){return`${e.label}: ${br(e.amount,t)}`}function Yp(e,{cssPrefix:t,strings:r,locale:n,onAction:o}){let s=[],a=ae(!1),i;return{...na(e),set_attr(c,u,p){if(u!==Ro||p!=="openui"||c.index!==1)return Ml(c,u,p);let _=document.createElement("div");c.nodes[c.index]?.parentElement?.replaceWith(_),i={textSig:ae(""),doneSig:ae(!1)},s.push(_),lr(l(Kl,{cssPrefix:t,textSig:i.textSig,doneSig:i.doneSig,replyDoneSig:a,strings:r,locale:n,onAction:o}),_)},add_text(c,u){i?i.textSig.value=i.textSig.peek()+u:El(c,u)},end_token(c){i&&(i.doneSig.value=!0,i=void 0),Rl(c)},finish(){i&&(i.doneSig.value=!0),a.value=!0},dispose(){for(let c of s)lr(null,c);s.length=0,i=void 0}}}function Kl({textSig:e,doneSig:t,replyDoneSig:r,cssPrefix:n,strings:o,locale:s,onAction:a}){let i=ke(()=>{let u=Fp(),p=[];return ut(()=>{let _=jp(u.set(e.value,t.value),!t.value,e.value);return!t.value&&p.length>0&&(_.error||_.elements.length===0)?{..._,error:!1,elements:p}:(p=_.elements,_)})},[e,t]),c={cssPrefix:n,strings:o,locale:s,onAction:a,busy:!r.value};return i.value.error?l("div",{role:"alert",children:o.visualError}):l("div",{class:`${n}-generative-ui`,"aria-busy":!t.value,children:[i.value.elements.map(u=>l(ha,{element:u,context:c},u.statementId)),i.value.partial&&l("p",{role:"status",children:o.visualPartial}),i.value.elements.length===0&&!t.value?l("span",{role:"status",children:o.visualPreparing}):null]})}function ha({element:e,context:t}){let{cssPrefix:r}=t;if(e.typeName==="Grid")return l("div",{class:`${r}-generative-ui-grid-container`,children:l("div",{class:`${r}-generative-ui-grid`,"data-columns":e.props.columns,"data-equal-heights":fp(e.props.children)||void 0,children:e.props.children.map(n=>l("div",{class:`${r}-generative-ui-cell`,"data-span":n.typeName==="Cell"?n.props.span??1:1,children:n.typeName==="Cell"?n.props.children.map(o=>l(ha,{element:o,context:t},o.statementId)):l(ha,{element:n,context:t})},n.statementId))})});switch(e.typeName){case"Carousel":return l("div",{role:"list",class:`${r}-generative-ui-carousel`,children:e.props.children.map(n=>l("div",{role:"listitem",children:l(ha,{element:n,context:t})},n.statementId))});case"Text":return l("p",{children:e.props.text});case"Card":return l("section",{children:[l("strong",{children:e.props.title}),l("p",{children:e.props.body}),l(Uo,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Product":return l($y,{...e.props,context:t});case"Cart":return l("section",{children:[e.props.cart.messages?.map(n=>l("p",{role:n.severity==="info"?"status":"alert",class:`${r}-generative-ui-notice`,"data-severity":n.severity,children:n.text},n.text)),e.props.cart.lines.length?l(Kp,{lines:e.props.cart.lines,context:t}):l("p",{class:`${r}-generative-ui-muted`,children:t.strings.visualCartEmpty}),e.props.cart.lines.length>0&&l(Qp,{totals:e.props.cart.totals,context:t}),l(Uo,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Order":return l("section",{children:[l("div",{class:`${r}-generative-ui-heading`,children:[l("strong",{children:e.props.order.number}),l("span",{class:`${r}-generative-ui-pill`,children:e.props.order.status})]}),e.props.order.date&&l("p",{class:`${r}-generative-ui-muted`,children:Ll(e.props.order.date,t.locale)}),e.props.order.timeline?.length?l("ol",{class:`${r}-generative-ui-timeline`,children:e.props.order.timeline.map(n=>l("li",{"data-done":n.done,children:[l("span",{children:n.label}),n.date&&l("span",{class:`${r}-generative-ui-muted`,children:Ll(n.date,t.locale)})]},n.label))}):null,l(Kp,{lines:e.props.order.items,context:t}),l(Qp,{totals:e.props.order.totals,context:t}),l(Uo,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Metric":return l("section",{children:[l("strong",{children:e.props.label}),l("span",{class:`${r}-generative-ui-metric`,children:e.props.value}),e.props.detail&&l("p",{children:e.props.detail})]});case"Table":return l("section",{children:l("div",{class:`${r}-generative-ui-table`,children:l("table",{children:[l("caption",{children:e.props.title}),l("thead",{children:l("tr",{children:e.props.columns.map((n,o)=>l("th",{scope:"col",children:n},o))})}),l("tbody",{children:e.props.rows.map((n,o)=>l("tr",{children:n.map((s,a)=>l("td",{children:s},a))},o))})]})})});case"Chart":return l(qy,{element:e,cssPrefix:r})}}function $y({product:e,actions:t,context:r}){let{cssPrefix:n,strings:o}=r,[s,a]=U({}),i=vp(e,s),c=Nl(t,r.onAction!==void 0).some(u=>u.message!==void 0);return l("section",{class:`${n}-generative-ui-product`,children:[i.image&&l(Jp,{src:i.image,href:e.url,class:`${n}-generative-ui-photo`},i.image),(e.badge||!i.available)&&l("div",{class:`${n}-generative-ui-heading`,children:[e.badge&&l("span",{class:`${n}-generative-ui-pill`,children:e.badge}),!i.available&&l("span",{class:`${n}-generative-ui-pill`,children:o.visualSoldOut})]}),l("strong",{class:`${n}-generative-ui-title`,children:l(Xp,{title:e.title,url:e.url})}),e.rating&&l("span",{class:`${n}-generative-ui-muted`,children:[l("span",{"aria-hidden":"true",class:`${n}-generative-ui-star`,children:["\u2605"," "]}),e.rating.value,e.rating.count!==void 0&&` (${e.rating.count})`]}),l(Dy,{price:i.price,compareAtPrice:i.compareAtPrice,context:r}),e.description&&l("p",{class:`${n}-generative-ui-description`,children:e.description}),i.options.map(u=>l("fieldset",{class:`${n}-generative-ui-option`,children:[l("legend",{children:u.name}),l(Uy,{children:u.values.map(p=>l("button",{type:"button","aria-pressed":u.value===p,disabled:u.unavailable.includes(p),onClick:()=>a({...s,[u.name]:p}),children:p},p))})]},u.name)),l("div",{class:`${n}-generative-ui-footer`,children:[l(Uo,{actions:t,context:r,disabled:r.busy||!i.canBuy,getMessage:u=>Ol(u,e.title,i.chosen)}),c&&l("p",{class:`${n}-generative-ui-hint`,children:i.missing.length>0&&`${o.visualChoose} ${i.missing.join(", ")}`})]})]})}function Kp({lines:e,context:t}){let{cssPrefix:r,strings:n}=t;return e.length?l("ul",{class:`${r}-generative-ui-lines`,children:e.map((o,s)=>l("li",{children:[o.image&&l(Jp,{src:o.image,class:`${r}-generative-ui-thumb`},o.image),l("div",{children:[l("div",{class:`${r}-generative-ui-line-head`,children:[l("span",{children:l(Xp,{title:o.title,url:o.url})}),l("strong",{children:br(o.price,t.locale)})]}),l("span",{class:`${r}-generative-ui-muted`,children:[...Object.entries(o.options??{}).map(([a,i])=>`${a}: ${i}`),`${n.visualQuantity} ${o.quantity}`].join(" \xB7 ")}),l(Uo,{actions:o.actions,context:t,disabled:t.busy,small:!0,getMessage:a=>Ol(a,o.title,o.options)})]})]},s))}):null}function Uo({actions:e,context:t,disabled:r,small:n,getMessage:o}){let s=Nl(e,t.onAction!==void 0);return s.length?l("div",{class:`${t.cssPrefix}-generative-ui-actions`,"data-small":n,children:s.map(a=>{if(a.message===void 0)return l("a",{href:a.url,target:"_blank",rel:"noopener noreferrer","data-primary":a.primary,children:a.label},a.label);let i=a.message;return l("button",{type:"button",disabled:r,"data-primary":a.primary,onClick:()=>t.onAction?.(o?.(i)??i),children:a.label},a.label)})}):null}function Jp({src:e,href:t,class:r}){let[n,o]=U(!1);if(n||!Mo(e))return null;let s=l("img",{src:e,alt:"",loading:"lazy",referrerpolicy:"no-referrer",onError:()=>o(!0)});return Mo(t)?l("a",{href:t,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,"aria-hidden":"true",class:r,children:s}):l("span",{class:r,children:s})}function Xp({title:e,url:t}){return Mo(t)?l("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:e}):l(ve,{children:e})}function Dy({price:e,compareAtPrice:t,context:{cssPrefix:r,locale:n}}){return l("span",{class:`${r}-generative-ui-price`,children:[l("strong",{children:br(e,n)}),t&&gp(e,t)&&l("s",{children:br(t,n)})]})}function Qp({totals:e,context:{cssPrefix:t,locale:r}}){return e.length?l("dl",{class:`${t}-generative-ui-totals`,children:e.map(n=>l("div",{children:[l("dt",{children:n.label}),l("dd",{children:br(n.amount,r)})]},n.label))}):null}function qy({element:e,cssPrefix:t}){let{baseline:r,barWidth:n,points:o}=_p(e.props.data);return l("section",{children:[l("strong",{children:e.props.title}),l("svg",{class:`${t}-generative-ui-chart`,viewBox:"0 0 320 168",role:"img","aria-label":`${e.props.title}. ${e.props.data.map(s=>`${s.label}: ${s.value}`).join(", ")}`,children:[l("line",{class:`${t}-generative-ui-axis`,x1:24,x2:296,y1:r,y2:r}),e.props.type==="line"&&l("polyline",{points:o.map(s=>`${s.x},${s.y}`).join(" "),fill:"none",stroke:"currentColor","stroke-width":3}),o.map((s,a)=>e.props.type==="bar"?l("rect",{x:s.x-n/2,y:Math.min(s.y,r),width:n,height:Math.abs(s.y-r),fill:"currentColor"},a):l("circle",{cx:s.x,cy:s.y,r:3,fill:"currentColor"},a))]}),l("div",{class:`${t}-generative-ui-data`,children:e.props.data.map((s,a)=>l("span",{children:[s.label,": ",s.value]},a))})]})}function ya(e,t){if(!e.includes("```openui"))return e;let r="",n=0,o=0,s=0,a=0,i;function c(p){i?.language==="openui"&&(r+=e.slice(n,i.start)+Wp(i.source,t)+(e[p-1]===`
54
54
  `?`
55
- `:""),n=p),a=void 0}let u=Mo({data:void 0,add_token(p,_){i+=1,_===10&&i===1&&(a={start:s,source:"",language:""})},set_attr(p,_,d){a&&_===Eo&&(a.language=d)},add_text(p,_){a&&(a.source+=_)},end_token(){a&&c(Math.min(o+1,e.length)),i-=1}});for(;o<e.length;o++)it(u,e.charAt(o)),e[o]===`
56
- `&&(s=o+1);return zn(u),a&&c(e.length),r+e.slice(n)}function by({children:e}){let t=B(null),[r,n]=U({start:!1,end:!1});return H(()=>{let o=t.current;if(!o)return;function s(){if(!o)return;let a=cp(o);n(c=>c.start===a.start&&c.end===a.end?c:a)}s(),o.addEventListener("scroll",s,{passive:!0});let i=typeof ResizeObserver>"u"?void 0:new ResizeObserver(s);return i?.observe(o),()=>{o.removeEventListener("scroll",s),i?.disconnect()}},[]),l("div",{ref:t,"data-cut-start":r.start||void 0,"data-cut-end":r.end||void 0,children:e})}function Yl(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Py(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Gp(e){return e.startsWith("tool-")?e.slice(5):e}var kt={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"},Xl="context";function bi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pi(e){if(!bi(e))return;let t=e,r=t.controlMode,n=t.controlRevision;if(!(r!=="ai-agent"&&r!=="awaiting-operator"&&r!=="operator"||typeof n!="number"||!Number.isSafeInteger(n)||n<0))return{controlMode:r,controlRevision:n,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 Kp(e){if(!bi(e))return;let t=e.status,r=e.postFinishSequence;if(!(t!=="compacting"&&t!=="ready"||typeof r!="number"||!Number.isSafeInteger(r)||r<0))return{status:t,postFinishSequence:r}}function xi(e){let t=bi(e)?e.suggestions:void 0;if(!Array.isArray(t))return[];let r=[];for(let n of t){if(!bi(n))continue;let{id:o,label:s,text:i}=n;typeof s!="string"||!s||r.push({id:typeof o=="string"&&o?o:`s${r.length}`,label:s,text:typeof i=="string"&&i?i:s})}return r}function Jl(e){let r={messages:e.messages.map(n=>({id:n.serverMessageId??n.id,parts:Sy(n),role:n.role})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(r.visitorId=e.visitorId),e.userPrefs&&(r.userPrefs=e.userPrefs),e.clientTools?.length&&(r.clientTools=e.clientTools),r}function xy(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function Sy(e){let t=[];for(let r of e.parts)if(r.kind==="step-start"&&t.push({type:"step-start"}),r.kind==="reasoning"&&r.text&&t.push({type:"reasoning",text:r.text,state:r.done?"done":"streaming"}),r.kind==="text"&&r.text&&t.push({text:r.text,type:"text"}),r.kind==="file"&&r.url&&t.push({mediaType:r.mediaType,type:"file",url:r.url,filename:r.filename,fileId:r.fileId,fileSize:r.fileSize}),r.kind==="tool"&&xy(r)){let n=r.dynamic?{type:"dynamic-tool",toolName:r.toolName,toolCallId:r.toolCallId,state:r.state}:{type:Py(r.toolName),toolCallId:r.toolCallId,state:r.state};r.input!==void 0&&(n.input=r.input),r.output!==void 0&&(n.output=r.output),r.error!==void 0&&(n.errorText=r.error),r.approval?.approved!==void 0&&(n.approval=r.approval),r.toolMetadata&&(n.toolMetadata=r.toolMetadata),t.push(n)}for(let r of e.attachments??[])r.url&&t.push({type:"file",url:r.url,mediaType:r.mediaType,filename:r.name,fileId:r.id,fileSize:r.size});return t}function ec(e,t,r=Wt()){let n=e?[{kind:"text",id:"t0",textSig:se(e),doneSig:se(!0)}]:[];return{id:r,role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:se(n)}}function dr(){return{id:Wt(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:se([])}}function tc(e){let t=Wt();return wy({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function wy(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:se(e.parts.map(Ry))}}function ky(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status==="streaming"?"streaming":"complete"}function rc(e){let t=new Set,r=e.parts.map((o,s)=>o.type==="text"?{kind:"text",id:`${e.id}-t${s}`,textSig:se(o.text),doneSig:se(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${s}`,textSig:se(o.text),doneSig:se(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${s}`}: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:Gp(o.type),title:o.title,dynamic:o.type==="dynamic-tool"?!0:void 0,toolMetadata:o.toolMetadata,inputPartialSig:se(""),inputSig:se(o.input),outputSig:se(o.output),errorSig:se(o.errorText),stateSig:se(o.state),approvalSig:se(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),n=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:n?.type==="data-suggestions"?xi(n.data):void 0,serverMessageId:e.id,createdAt:Date.parse(e.createdAt),status:ky(e),canceled:e.status==="canceled",feedback:e.feedback??null,stepTimings:Si(e.metadata?.steps),partsSig:se(r)}}function Si(e){if(!(!e?.length||!e.every(t=>Qp(t.durationMs))))return e.map(({durationMs:t,reasoningMs:r})=>({durationMs:Number(t),...Qp(r)?{reasoningMs:r}:{}}))}function Qp(e){return typeof e=="number"&&Number.isFinite(e)}function Cy(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 Ty(e){return e.role==="assistant"&&e.status==="streaming"&&Cy(e)}function Fr(e){let t=e.length-1;return e.filter((r,n)=>n===t||!Ty(r)).map(rc)}function Yp(e,t){let r=!t&&e.at(-1)?.role==="assistant"?-2:-1,n=e.at(r);return!n||n.ephemeral?[]:[n]}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(Ey)}}function Ye(e){let t="";for(let r of e.partsSig.value)r.kind==="text"&&(t+=r.textSig.value);return t}function wi(e,t,r,n,o=t.createdAt){let s=e.find(u=>u.role==="user"&&!u.ephemeral);function i(u,p){return(u.role==="assistant"?yi(Ye(u)):Ye(u)).replace(/\s+/g," ").trim().slice(0,p)}let a=s?i(s,80):"",c=i(t,120);return{conversationId:r,title:a||n,lastMessageAt:new Date(o).toISOString(),preview:c||void 0}}function ir(e){return Ye(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function oc(e){return Ye(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function ac(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}function jn(e){return e.kind==="tool"}function Xp(e){return e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"}function zo(e){let t=e.partsSig.value,r=t.findLastIndex(n=>n.kind==="tool");return t.slice(r+1).some(Xp)}function fn(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(jn);return t.length>0&&t.every(r=>ac(r.stateSig.value))}function mn(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!zo(e)}function ki(e,t){return!e.partsSig.value.slice(t+1).some(r=>r.kind==="step-start"||Xp(r))}function Ci(e){return e.partsSig.value.some(t=>jn(t)&&!ac(t.stateSig.value))}function Jp(e,t){if(t.length===0)return e;let r=new Set;for(let i of e)r.add(i.id),i.serverMessageId&&r.add(i.serverMessageId);let n=t.filter(i=>{let a=[i.id,i.serverMessageId].filter(c=>c!==void 0);return a.some(c=>r.has(c))?!1:(a.forEach(c=>r.add(c)),!0)});if(n.length===0)return e;let o=e.findIndex(i=>!i.ephemeral),s=o<0?e.length:o;return[...e.slice(0,s),...n,...e.slice(s)]}function pn(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 Zp(e,t,r,n){if(!ic(e))return;if(t.length===0){let i=Math.max(...n.values());return r.find(a=>a.role==="assistant"&&n.get(a.serverMessageId??a.id)===i&&Ye(a).length>=Ye(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let s=n.get(o.serverMessageId??o.id);if(s!==void 0)return r.find(i=>i.role==="assistant"&&n.get(i.serverMessageId??i.id)===s+1&&Ye(i).length>=Ye(e).length)}function ic(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function Iy(e,t){let r=new Map(t.partsSig.value.filter(jn).filter(s=>ac(s.stateSig.value)).map(s=>[s.toolCallId,s]));if(r.size===0)return;let n=!1,o=e.partsSig.value.map(s=>{if(!jn(s))return s;let i=r.get(s.toolCallId);if(!i)return s;let a=s.approvalSig.value,c=i.approvalSig.value,u=a===void 0||a.approved===void 0&&c?.approved!==void 0?i.approvalSig:s.approvalSig,p=s.inputSig.value===void 0?i.inputSig:s.inputSig,_=s.toolName==="tool"?i.toolName:s.toolName,d=s.dynamic??i.dynamic,f=s.toolMetadata??i.toolMetadata;return u===s.approvalSig&&p===s.inputSig&&_===s.toolName&&d===s.dynamic&&f===s.toolMetadata?s:(n=!0,{...s,toolName:_,dynamic:d,toolMetadata:f,inputSig:p,approvalSig:u})});n&&(e.partsSig.value=o)}function e_(e){let t=e.flatMap(r=>r.role==="assistant"&&r.status!=="streaming"?Yl(r.startedAt)??[]:[]);return new Set(e.filter(r=>r.role==="user"&&t.some(n=>n>=(Yl(r.createdAt)??1/0))).map(r=>r.id))}function sc(e,t){let r=t.filter(_=>!_.ephemeral&&(_.status==="streaming"||_.status==="pending"||_.status==="error"||_.retryAction!==void 0||(_.attachments?.length??0)>0||ir(_))),n=new Map;for(let _ of r)n.set(_.id,_),_.serverMessageId!==void 0&&n.set(_.serverMessageId,_);let o=new Set,s=[],i=e.map(_=>{let d=(_.serverMessageId!==void 0?n.get(_.serverMessageId):void 0)??n.get(_.id);return d===void 0?(s.push(_),_):(o.add(d),d.role!==_.role?_:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?pn(d,_):d.status!=="streaming"&&Ye(d).startsWith(Ye(_))?(_.createdAt!==void 0&&(d.createdAt=_.createdAt),Iy(d,_),_.stepTimings&&(d.stepTimings=_.stepTimings),d.suggestions??(d.suggestions=_.suggestions),d.feedback===void 0&&(d.feedback=_.feedback),_.canceled&&(d.canceled=!0),d):pn(d,_))}),a=r.filter(_=>!o.has(_)),c=a.findLast(ic),u=new Map;e.forEach((_,d)=>{u.set(_.id,d),_.serverMessageId!==void 0&&u.set(_.serverMessageId,d)});let p=Zp(c,c?r.slice(0,r.indexOf(c)):[],s,u);if(c&&p){let _=i.indexOf(p);_>=0&&(i[_]=pn(c,p)),a=a.filter(d=>d!==c)}return[...i,...a]}function Ho(e,t){let r=new Map(t.flatMap(_=>_.serverMessageId===void 0?[]:[[_.serverMessageId,_]])),n=new Map;t.forEach((_,d)=>{n.set(_.id,d),_.serverMessageId!==void 0&&n.set(_.serverMessageId,d)});let o=new Set(e.flatMap(_=>[_.serverMessageId,_.id].filter(d=>d!==void 0))),s=!1,i=e.map(_=>{let d=r.get(_.serverMessageId??_.id);if(d===void 0||d.role!==_.role)return _;if(_.role==="user"&&_.serverMessageId===void 0)return s=!0,pn(_,d);if(_.serverMessageId===void 0)return _;d.createdAt!==void 0&&_.createdAt!==d.createdAt&&(_.createdAt=d.createdAt,s=!0);let f=Ye(d),v=Ye(_),g=d.status!=="streaming"&&f.length>=v.length&&Zl(_,d);if(f.length>v.length||f===v&&d.partsSig.value.length>_.partsSig.value.length||g)return s=!0,pn(_,d);if((d.stepTimings?.length??0)>(_.stepTimings?.length??0)&&(_.stepTimings=d.stepTimings,s=!0),_.status==="streaming"&&d.status!=="streaming"&&Ay(_,d)){if(_.continuationStreaming&&Ci(d))return _;if(!Zl(d,_))return s=!0,pn(_,d)}return _}),a=[...r].filter(([_])=>!o.has(_)).map(([,_])=>_),c=i.findLastIndex(ic),u=i[c],p=Zp(u,i.slice(0,c),a,n);if(u!==void 0&&p!==void 0&&Ye(p).length>=Ye(u).length&&(pn(u,p),i[c]=p,a.splice(a.indexOf(p),1),s=!0),a.length===0)return{messages:s?i:e,changed:s};for(let _ of a){let d=n.get(_.serverMessageId??_.id),f=!1,v=i.findIndex(g=>{let P=n.get(g.serverMessageId??g.id);return d===void 0?!1:P===void 0?f:P>d?!0:(f=!0,!1)});v===-1?i.push(_):i.splice(v,0,_)}return{messages:i,changed:!0}}function t_(e,t){if(e.role!==t.role)return!1;let r=Ye(t),n=Ye(e);return r.length>n.length||t.partsSig.value.length>e.partsSig.value.length||Zl(e,t)}function Ay(e,t){let r=e.partsSig.value,n=t.partsSig.value;return r.length!==n.length?!1:r.every((o,s)=>{let i=n[s];switch(o.kind){case"text":return i?.kind==="text"&&i.textSig.value===o.textSig.value;case"reasoning":return i?.kind==="reasoning"&&i.textSig.value===o.textSig.value;case"step-start":return i?.kind==="step-start";case"tool":return i?.kind==="tool"&&i.toolCallId===o.toolCallId&&Ti(i.toolName,o.toolName);case"file":return i?.kind==="file"&&i.url===o.url&&i.mediaType===o.mediaType;case"source":return i?.kind==="source"&&i.sourceId===o.sourceId&&i.url===o.url&&i.title===o.title&&i.filename===o.filename&&i.mediaType===o.mediaType;default:return o}})}function Ti(e,t){let r=e.startsWith("tool:")?e.slice(5):e,n=t.startsWith("tool:")?t.slice(5):t;return r===n}var Vn={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function Zl(e,t){let r=new Map(e.partsSig.value.filter(jn).map(n=>[n.toolCallId,n]));return t.partsSig.value.filter(jn).some(n=>{let o=r.get(n.toolCallId);if(!o||Vn[n.stateSig.value]>Vn[o.stateSig.value])return!0;let s=n.approvalSig.value?.approved;return s!==void 0&&s!==o.approvalSig.value?.approved})}function _n(e){return e.role==="assistant"&&e.status!=="streaming"&&e.canceled!==!0&&!ir(e)}function Ii(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"&&!_n(t))return;let r=e.indexOf(t);for(let n=r-1;n>=0;n--){let o=e[n];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function r_(e,t){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!oc(e)&&!t}function n_(e,t){return e.operatorRoutedTurn?_n(e)?"drop":"complete-operator-routed":t||_n(e)?"error":"complete"}function Ry(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:se(e.text),doneSig:se(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,inputPartialSig:se(e.inputPartial),inputSig:se(e.input),outputSig:se(e.output),errorSig:se(e.error),stateSig:se(e.state),approvalSig:se(e.approval)}:e}function Ey(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 My(e){let t=new TextEncoder().encode(e),r="";for(let n of t)r+=String.fromCharCode(n);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function o_(e){return e&&Object.keys(e).length>0?e:void 0}function lc(e,t,r=[]){let n=o_(e),o=o_(t),s=Date.now();for(let i=r.length;;i-=1){let a=r.slice(r.length-i).map(({name:p,data:_,at:d})=>({name:p,data:_,secondsAgo:Math.round((s-d)/1e3)})),c=a.length>0?{...o,recentEvents:a}:o;if(!n&&!c)return;let u=My(JSON.stringify({...n&&{user:n},...c&&{page:c}}));if(u.length<=8192||i===0)return u}}var qe=class extends Error{constructor(r,n,o,s,i,a){super(r);ee(this,"code",n);ee(this,"status",o);ee(this,"cause",s);ee(this,"retryAfterSeconds",i);ee(this,"errorCode",a);this.name="StreamError"}};var a_=te.scope("parser");async function*i_(e,t,r){if(!e.ok){let n=await e.text().catch(()=>"");throw new qe(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of Ly(e,t)){let o=Ny(n,r);if(o==="done")return;o&&(yield o)}}async function*Ly(e,t){if(!e.body)throw new qe("response has no body","no-body");let r=e.body.pipeThrough(new TextDecoderStream).getReader(),n="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:o,value:s}=await r.read();if(o){let a=n.trim();a&&(yield a);return}n+=s;let i;for(;(i=n.indexOf(`
55
+ `:""),n=p),i=void 0}let u=Eo({data:void 0,add_token(p,_){a+=1,_===10&&a===1&&(i={start:s,source:"",language:""})},set_attr(p,_,d){i&&_===Ro&&(i.language=d)},add_text(p,_){i&&(i.source+=_)},end_token(){i&&c(Math.min(o+1,e.length)),a-=1}});for(;o<e.length;o++)ot(u,e.charAt(o)),e[o]===`
56
+ `&&(s=o+1);return Bn(u),i&&c(e.length),r+e.slice(n)}function Uy({children:e}){let t=B(null),[r,n]=U({start:!1,end:!1});return H(()=>{let o=t.current;if(!o)return;function s(){if(!o)return;let i=mp(o);n(c=>c.start===i.start&&c.end===i.end?c:i)}s(),o.addEventListener("scroll",s,{passive:!0});let a=typeof ResizeObserver>"u"?void 0:new ResizeObserver(s);return a?.observe(o),()=>{o.removeEventListener("scroll",s),a?.disconnect()}},[]),l("div",{ref:t,"data-cut-start":r.start||void 0,"data-cut-end":r.end||void 0,children:e})}function Ql(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function By(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Zp(e){return e.startsWith("tool-")?e.slice(5):e}var kt={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 ba(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pa(e){if(!ba(e))return;let t=e,r=t.controlMode,n=t.controlRevision;if(!(r!=="ai-agent"&&r!=="awaiting-operator"&&r!=="operator"||typeof n!="number"||!Number.isSafeInteger(n)||n<0))return{controlMode:r,controlRevision:n,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 e_(e){if(!ba(e))return;let t=e.status,r=e.postFinishSequence;if(!(t!=="compacting"&&t!=="ready"||typeof r!="number"||!Number.isSafeInteger(r)||r<0))return{status:t,postFinishSequence:r}}function xa(e){let t=ba(e)?e.suggestions:void 0;if(!Array.isArray(t))return[];let r=[];for(let n of t){if(!ba(n))continue;let{id:o,label:s,text:a}=n;typeof s!="string"||!s||r.push({id:typeof o=="string"&&o?o:`s${r.length}`,label:s,text:typeof a=="string"&&a?a:s})}return r}function Jl(e){let r={messages:e.messages.map(n=>({id:n.serverMessageId??n.id,parts:Hy(n),role:n.role})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(r.visitorId=e.visitorId),e.userPrefs&&(r.userPrefs=e.userPrefs),e.clientTools?.length&&(r.clientTools=e.clientTools),r}function zy(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 r of e.parts)if(r.kind==="step-start"&&t.push({type:"step-start"}),r.kind==="reasoning"&&r.text&&t.push({type:"reasoning",text:r.text,state:r.done?"done":"streaming"}),r.kind==="text"&&r.text&&t.push({text:r.text,type:"text"}),r.kind==="file"&&r.url&&t.push({mediaType:r.mediaType,type:"file",url:r.url,filename:r.filename,fileId:r.fileId,fileSize:r.fileSize}),r.kind==="tool"&&zy(r)){let n=r.dynamic?{type:"dynamic-tool",toolName:r.toolName,toolCallId:r.toolCallId,state:r.state}:{type:By(r.toolName),toolCallId:r.toolCallId,state:r.state};r.input!==void 0&&(n.input=r.input),r.output!==void 0&&(n.output=r.output),r.error!==void 0&&(n.errorText=r.error),r.approval?.approved!==void 0&&(n.approval=r.approval),r.toolMetadata&&(n.toolMetadata=r.toolMetadata),t.push(n)}for(let r of e.attachments??[])r.url&&t.push({type:"file",url:r.url,mediaType:r.mediaType,filename:r.name,fileId:r.id,fileSize:r.size});return t}function Zl(e,t,r=Gt()){let n=e?[{kind:"text",id:"t0",textSig:ae(e),doneSig:ae(!0)}]:[];return{id:r,role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:ae(n)}}function cr(){return{id:Gt(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:ae([])}}function ec(e){let t=Gt();return Fy({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function Fy(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:ae(e.parts.map(Qy))}}function jy(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status==="streaming"?"streaming":"complete"}function tc(e){let t=new Set,r=e.parts.map((o,s)=>o.type==="text"?{kind:"text",id:`${e.id}-t${s}`,textSig:ae(o.text),doneSig:ae(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${s}`,textSig:ae(o.text),doneSig:ae(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${s}`}: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:Zp(o.type),title:o.title,dynamic:o.type==="dynamic-tool"?!0:void 0,toolMetadata:o.toolMetadata,inputPartialSig:ae(""),inputSig:ae(o.input),outputSig:ae(o.output),errorSig:ae(o.errorText),stateSig:ae(o.state),approvalSig:ae(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),n=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:n?.type==="data-suggestions"?xa(n.data):void 0,serverMessageId:e.id,createdAt:Date.parse(e.createdAt),status:jy(e),canceled:e.status==="canceled",feedback:e.feedback??null,stepTimings:Sa(e.metadata?.steps),partsSig:ae(r)}}function Sa(e){if(!(!e?.length||!e.every(t=>t_(t.durationMs))))return e.map(({durationMs:t,reasoningMs:r})=>({durationMs:Number(t),...t_(r)?{reasoningMs:r}:{}}))}function t_(e){return typeof e=="number"&&Number.isFinite(e)}function Vy(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 Wy(e){return e.role==="assistant"&&e.status==="streaming"&&Vy(e)}function Br(e){let t=e.length-1;return e.filter((r,n)=>n===t||!Wy(r)).map(tc)}function r_(e,t){let r=!t&&e.at(-1)?.role==="assistant"?-2:-1,n=e.at(r);return!n||n.ephemeral?[]:[n]}function rc(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(Yy)}}function Qe(e){let t="";for(let r of e.partsSig.value)r.kind==="text"&&(t+=r.textSig.value);return t}function wa(e,t,r,n,o=t.createdAt){let s=e.find(u=>u.role==="user"&&!u.ephemeral);function a(u,p){return(u.role==="assistant"?ya(Qe(u)):Qe(u)).replace(/\s+/g," ").trim().slice(0,p)}let i=s?a(s,80):"",c=a(t,120);return{conversationId:r,title:i||n,lastMessageAt:new Date(o).toISOString(),preview:c||void 0}}function ir(e){return Qe(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function nc(e){return Qe(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 Fn(e){return e.kind==="tool"}function n_(e){return e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"}function Bo(e){let t=e.partsSig.value,r=t.findLastIndex(n=>n.kind==="tool");return t.slice(r+1).some(n_)}function _n(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(Fn);return t.length>0&&t.every(r=>oc(r.stateSig.value))}function fn(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!Bo(e)}function zo(e,t){return!e.partsSig.value.slice(t+1).some(r=>r.kind==="step-start"||n_(r))}function ka(e){return e.partsSig.value.some(t=>Fn(t)&&!oc(t.stateSig.value))}function o_(e,t){if(t.length===0)return e;let r=new Set;for(let a of e)r.add(a.id),a.serverMessageId&&r.add(a.serverMessageId);let n=t.filter(a=>{let i=[a.id,a.serverMessageId].filter(c=>c!==void 0);return i.some(c=>r.has(c))?!1:(i.forEach(c=>r.add(c)),!0)});if(n.length===0)return e;let o=e.findIndex(a=>!a.ephemeral),s=o<0?e.length:o;return[...e.slice(0,s),...n,...e.slice(s)]}function un(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 i_(e,t,r,n){if(!ic(e))return;if(t.length===0){let a=Math.max(...n.values());return r.find(i=>i.role==="assistant"&&n.get(i.serverMessageId??i.id)===a&&Qe(i).length>=Qe(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let s=n.get(o.serverMessageId??o.id);if(s!==void 0)return r.find(a=>a.role==="assistant"&&n.get(a.serverMessageId??a.id)===s+1&&Qe(a).length>=Qe(e).length)}function ic(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function Gy(e,t){let r=new Map(t.partsSig.value.filter(Fn).filter(s=>oc(s.stateSig.value)).map(s=>[s.toolCallId,s]));if(r.size===0)return;let n=!1,o=e.partsSig.value.map(s=>{if(!Fn(s))return s;let a=r.get(s.toolCallId);if(!a)return s;let i=s.approvalSig.value,c=a.approvalSig.value,u=i===void 0||i.approved===void 0&&c?.approved!==void 0?a.approvalSig:s.approvalSig,p=s.inputSig.value===void 0?a.inputSig:s.inputSig,_=s.toolName==="tool"?a.toolName:s.toolName,d=s.dynamic??a.dynamic,f=s.toolMetadata??a.toolMetadata;return u===s.approvalSig&&p===s.inputSig&&_===s.toolName&&d===s.dynamic&&f===s.toolMetadata?s:(n=!0,{...s,toolName:_,dynamic:d,toolMetadata:f,inputSig:p,approvalSig:u})});n&&(e.partsSig.value=o)}function a_(e){let t=e.flatMap(r=>r.role==="assistant"&&r.status!=="streaming"?Ql(r.startedAt)??[]:[]);return new Set(e.filter(r=>r.role==="user"&&t.some(n=>n>=(Ql(r.createdAt)??1/0))).map(r=>r.id))}function ac(e,t){let r=t.filter(_=>!_.ephemeral&&(_.status==="streaming"||_.status==="pending"||_.status==="error"||_.retryAction!==void 0||(_.attachments?.length??0)>0||ir(_))),n=new Map;for(let _ of r)n.set(_.id,_),_.serverMessageId!==void 0&&n.set(_.serverMessageId,_);let o=new Set,s=[],a=e.map(_=>{let d=(_.serverMessageId!==void 0?n.get(_.serverMessageId):void 0)??n.get(_.id);return d===void 0?(s.push(_),_):(o.add(d),d.role!==_.role?_:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?un(d,_):d.status!=="streaming"&&Qe(d).startsWith(Qe(_))?(_.createdAt!==void 0&&(d.createdAt=_.createdAt),Gy(d,_),_.stepTimings&&(d.stepTimings=_.stepTimings),d.suggestions??(d.suggestions=_.suggestions),d.feedback===void 0&&(d.feedback=_.feedback),_.canceled&&(d.canceled=!0),d):un(d,_))}),i=r.filter(_=>!o.has(_)),c=i.findLast(ic),u=new Map;e.forEach((_,d)=>{u.set(_.id,d),_.serverMessageId!==void 0&&u.set(_.serverMessageId,d)});let p=i_(c,c?r.slice(0,r.indexOf(c)):[],s,u);if(c&&p){let _=a.indexOf(p);_>=0&&(a[_]=un(c,p)),i=i.filter(d=>d!==c)}return[...a,...i]}function Ho(e,t){let r=new Map(t.flatMap(_=>_.serverMessageId===void 0?[]:[[_.serverMessageId,_]])),n=new Map;t.forEach((_,d)=>{n.set(_.id,d),_.serverMessageId!==void 0&&n.set(_.serverMessageId,d)});let o=new Set(e.flatMap(_=>[_.serverMessageId,_.id].filter(d=>d!==void 0))),s=!1,a=e.map(_=>{let d=r.get(_.serverMessageId??_.id);if(d===void 0||d.role!==_.role)return _;if(_.role==="user"&&_.serverMessageId===void 0)return s=!0,un(_,d);if(_.serverMessageId===void 0)return _;d.createdAt!==void 0&&_.createdAt!==d.createdAt&&(_.createdAt=d.createdAt,s=!0);let f=Qe(d),v=Qe(_),g=d.status!=="streaming"&&f.length>=v.length&&Xl(_,d);if(f.length>v.length||f===v&&d.partsSig.value.length>_.partsSig.value.length||g)return s=!0,un(_,d);if((d.stepTimings?.length??0)>(_.stepTimings?.length??0)&&(_.stepTimings=d.stepTimings,s=!0),_.status==="streaming"&&d.status!=="streaming"&&Ky(_,d)){if(_.continuationStreaming&&ka(d))return _;if(!Xl(d,_))return s=!0,un(_,d)}return _}),i=[...r].filter(([_])=>!o.has(_)).map(([,_])=>_),c=a.findLastIndex(ic),u=a[c],p=i_(u,a.slice(0,c),i,n);if(u!==void 0&&p!==void 0&&Qe(p).length>=Qe(u).length&&(un(u,p),a[c]=p,i.splice(i.indexOf(p),1),s=!0),i.length===0)return{messages:s?a:e,changed:s};for(let _ of i){let d=n.get(_.serverMessageId??_.id),f=!1,v=a.findIndex(g=>{let y=n.get(g.serverMessageId??g.id);return d===void 0?!1:y===void 0?f:y>d?!0:(f=!0,!1)});v===-1?a.push(_):a.splice(v,0,_)}return{messages:a,changed:!0}}function s_(e,t){if(e.role!==t.role)return!1;let r=Qe(t),n=Qe(e);return r.length>n.length||t.partsSig.value.length>e.partsSig.value.length||Xl(e,t)}function Ky(e,t){let r=e.partsSig.value,n=t.partsSig.value;return r.length!==n.length?!1:r.every((o,s)=>{let a=n[s];switch(o.kind){case"text":return a?.kind==="text"&&a.textSig.value===o.textSig.value;case"reasoning":return a?.kind==="reasoning"&&a.textSig.value===o.textSig.value;case"step-start":return a?.kind==="step-start";case"tool":return a?.kind==="tool"&&a.toolCallId===o.toolCallId&&Ca(a.toolName,o.toolName);case"file":return a?.kind==="file"&&a.url===o.url&&a.mediaType===o.mediaType;case"source":return a?.kind==="source"&&a.sourceId===o.sourceId&&a.url===o.url&&a.title===o.title&&a.filename===o.filename&&a.mediaType===o.mediaType;default:return o}})}function Ca(e,t){let r=e.startsWith("tool:")?e.slice(5):e,n=t.startsWith("tool:")?t.slice(5):t;return r===n}var jn={"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 r=new Map(e.partsSig.value.filter(Fn).map(n=>[n.toolCallId,n]));return t.partsSig.value.filter(Fn).some(n=>{let o=r.get(n.toolCallId);if(!o||jn[n.stateSig.value]>jn[o.stateSig.value])return!0;let s=n.approvalSig.value?.approved;return s!==void 0&&s!==o.approvalSig.value?.approved})}function pn(e){return e.role==="assistant"&&e.status!=="streaming"&&e.canceled!==!0&&!ir(e)}function Ta(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"&&!pn(t))return;let r=e.indexOf(t);for(let n=r-1;n>=0;n--){let o=e[n];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function l_(e,t){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!nc(e)&&!t}function c_(e,t){return e.operatorRoutedTurn?pn(e)?"drop":"complete-operator-routed":t||pn(e)?"error":"complete"}function Qy(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:ae(e.text),doneSig:ae(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,inputPartialSig:ae(e.inputPartial),inputSig:ae(e.input),outputSig:ae(e.output),errorSig:ae(e.error),stateSig:ae(e.state),approvalSig:ae(e.approval)}:e}function Yy(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 Jy(e){let t=new TextEncoder().encode(e),r="";for(let n of t)r+=String.fromCharCode(n);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function d_(e){return e&&Object.keys(e).length>0?e:void 0}function sc(e,t,r=[]){let n=d_(e),o=d_(t),s=Date.now();for(let a=r.length;;a-=1){let i=r.slice(r.length-a).map(({name:p,data:_,at:d})=>({name:p,data:_,secondsAgo:Math.round((s-d)/1e3)})),c=i.length>0?{...o,recentEvents:i}:o;if(!n&&!c)return;let u=Jy(JSON.stringify({...n&&{user:n},...c&&{page:c}}));if(u.length<=8192||a===0)return u}}var De=class extends Error{constructor(r,n,o,s,a,i){super(r);ee(this,"code",n);ee(this,"status",o);ee(this,"cause",s);ee(this,"retryAfterSeconds",a);ee(this,"errorCode",i);this.name="StreamError"}};var u_=te.scope("parser");async function*p_(e,t,r){if(!e.ok){let n=await e.text().catch(()=>"");throw new De(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of Xy(e,t)){let o=Zy(n,r);if(o==="done")return;o&&(yield o)}}async function*Xy(e,t){if(!e.body)throw new De("response has no body","no-body");let r=e.body.pipeThrough(new TextDecoderStream).getReader(),n="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:o,value:s}=await r.read();if(o){let i=n.trim();i&&(yield i);return}n+=s;let a;for(;(a=n.indexOf(`
57
57
 
58
- `))!==-1;){let a=n.slice(0,i);n=n.slice(i+2),yield a}}}finally{r.releaseLock()}}function Ny(e,t){let r="",n;for(let o of e.split(`
58
+ `))!==-1;){let i=n.slice(0,a);n=n.slice(a+2),yield i}}}finally{r.releaseLock()}}function Zy(e,t){let r="",n;for(let o of e.split(`
59
59
  `))if(o!==""){if(o.startsWith(":")){t?.(o.slice(1).trim());continue}if(o.startsWith("data:")){let s=o.slice(5).replace(/^ /,"");r=r?`${r}
60
- ${s}`:s;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(r==="[DONE]")return"done";if(!r)return null;try{let o=JSON.parse(r);if(!Oy(o))throw new TypeError("unrecognized chunk");return a_.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){throw a_.trace("frame parse failed",{errorType:o instanceof Error?o.name:typeof o,payloadLength:r.length}),new qe("invalid SSE frame","network",void 0,o)}}function Oy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof Reflect.get(e,"type")=="string"}var $y=new Set([101,204,205,304]);function Dy(e){let t=new Headers;for(let r of e.trim().split(/[\r\n]+/)){let n=r.indexOf(":");n>0&&t.append(r.slice(0,n).trim(),r.slice(n+1).trim())}return t}function s_(e){return async function(r,n){let o=new Request(r,n),s=await o.blob();return new Promise((i,a)=>{if(o.signal.aborted){a(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",()=>{i(new Response($y.has(c.status)?null:c.response,{status:c.status,statusText:c.statusText,headers:Dy(c.getAllResponseHeaders())}))}),c.addEventListener("error",()=>a(new TypeError("Failed to fetch"))),c.addEventListener("abort",()=>a(o.signal.reason)),o.signal.addEventListener("abort",()=>c.abort(),{once:!0}),c.send(s)})}}var nt=te.scope("transport"),qy="x-user-token",Uy="x-continue-link";async function cc(e){try{let t=await e.clone().json();if(typeof t!="object"||t===null)return{};let r=Reflect.get(t,"error");return{error:typeof r=="string"?r:void 0,loginUrl:ti(Reflect.get(t,"login")).url}}catch{return{}}}var l_=6e4,By=1e4,dc=50,g_=new WeakMap;function Wn(e){return g_.get(e)}function Fo(e,t){return g_.set(e,t),e}function c_(e){return Math.max(e?.upsertRevision??0,e?.read?.revision??0)}function zy(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 wr(e,t,r=!0){switch(t.type){case"snapshot":{let n=new Map(e.map(i=>[i.conversationId,i])),o=e.filter(i=>(Wn(i)?.activityRevision??0)>t.requestedRevision).toSorted((i,a)=>(Wn(a)?.activityRevision??0)-(Wn(i)?.activityRevision??0)),s=new Set(o.map(i=>i.conversationId));return[...o,...t.result.conversations.filter(i=>!s.has(i.conversationId)).map(i=>{let a=n.get(i.conversationId);if(!a)return i;let c=Wn(a);return(c?.upsertRevision??0)>t.requestedRevision?a:c?.read&&!a.hasUnread&&c.read.lastMessageAt===i.lastMessageAt?Fo({...i,hasUnread:!1},{upsertRevision:0,read:c.read}):i})]}case"read":{let n=e.findIndex(c=>c.conversationId===t.conversationId&&(t.lastMessageAt===void 0||c.lastMessageAt===t.lastMessageAt)),o=e[n];if(!o)return e;let s=Wn(o);if(c_(s)>t.revision)return e;let i=t.lastMessageAt??o.lastMessageAt,a={upsertRevision:s?.upsertRevision??0,...s?.activityRevision===void 0?{}:{activityRevision:s.activityRevision},read:{revision:t.revision,...i?{lastMessageAt:i}:{}}};return o.hasUnread?e.map((c,u)=>u===n?Fo({...c,hasUnread:!1},a):c):(Fo(o,a),e)}case"upsert":{let n=e.findIndex(u=>u.conversationId===t.conversation.conversationId);if(n<0&&!r)return e;let o=e[n],s=o?Wn(o):void 0;if(c_(s)>t.revision)return e;let i=t.activity?t.revision:s?.activityRevision,a={upsertRevision:t.revision,...i===void 0?{}:{activityRevision:i},...!t.conversation.hasUnread&&s?.read?{read:s.read}:{}},c=o?{...o,...t.conversation,title:o.title}:{...t.conversation};return o&&zy(o,c)?(Fo(o,a),e):(Fo(c,a),t.activity?[c,...e.filter(u=>u.conversationId!==c.conversationId)]:o?e.map((u,p)=>p===n?c:u):[...e,c])}default:return t}}var d_=3,Hy=400,Fy=3e4,jy=6e4,Vy=1e4,Wy=6e4,Gy=15e3,Ky=1024*1024,u_=new Set([408,425,429,500,502,503,504]);function p_(e){return Hy*2**e+Math.floor(Math.random()*250)}function Qy(e){return Wy+Math.ceil(e/Ky)*Gy}function Yy(e){let t=e.get("retry-after");if(!t)return null;let r=Number(t),n=Number.isFinite(r)?r*1e3:Date.parse(t)-Date.now();return Number.isFinite(n)&&n>=0?Math.min(n,3e4):null}var jo=class{constructor(t){ee(this,"ttlMs",t);ee(this,"map",new Map)}getOrFetch(t,r){let n=this.map.get(t);if(n&&performance.now()-n.at<this.ttlMs)return n.result;let o={at:performance.now(),result:r().then(s=>(o.value=s,s)).catch(s=>{throw this.map.get(t)===o&&this.map.delete(t),s})};return this.map.set(t,o),o.result}peek(t){let r=this.map.get(t);if(r?.value!==void 0&&performance.now()-r.at<this.ttlMs)return r.value}update(t){for(let r of this.map.values()){if(r.value!==void 0){let n=t(r.value);r.value=n,r.result=Promise.resolve(n);continue}r.result=r.result.then(n=>{let o=t(n);return r.value=o,o})}}delete(t){this.map.delete(t)}};function __(e,t){let{translations:r,defaultLocale:n,...o}=Jr(e,t);return o}var Ai=class{constructor(t){ee(this,"opts",t);ee(this,"conversationListeners",new Set);ee(this,"conversationRevision",0);ee(this,"visitorId");ee(this,"conversationId");ee(this,"userContext");ee(this,"pageContext");ee(this,"locale");ee(this,"userTokenSource");ee(this,"userToken");ee(this,"userTokenRequest");ee(this,"conversationsCache",new jo(By));ee(this,"contentCache",new jo(l_));ee(this,"contentCollectionsCache",new jo(l_))}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?ep(this.userToken):void 0}reportLogin(t){this.opts.onLoginState?.(t==="loggedIn"&&this.userToken?{status:t,...Zu(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,r){this.userContext=t,this.pageContext=r}setLocale(t){this.locale=t}primeIdentity(t,r){t&&(this.visitorId=t),r&&(this.conversationId=r)}envelope(){let t={_ev:$n};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let r=lc(this.userContext,this.pageContext);return r&&(t[Xl]=r),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[r,n]of Object.entries(this.envelope()))t.append(r,n);return t}withEnvelopeQuery(t){let r=new URL(this.url(t));for(let[n,o]of Object.entries(this.envelope()))r.searchParams.has(n)||r.searchParams.set(n,o);return r.toString()}async handshake(t){nt.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let r=Sr("handshake",await this.postJson(kt.handshake,t,"handshake"),m_),n=r.loginStatus==="expired"&&await this.refreshUserToken()?Sr("handshake",await this.postJson(kt.handshake,t,"handshake"),m_):r;return this.reportLogin(n.loginStatus??(this.userToken?"loggedIn":"anonymous")),nt.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),this.visitorId=n.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t,r,n){nt.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let o=new FormData;o.append("file",t,t.name);let s=Sr("upload",await this.postForm(this.uploadPath,o,"upload",r,Qy(t.size),n),Zy);return nt.debug("uploadFile \u2190",{id:s.id,url:s.url}),s}async transcribe(t,r="audio/webm"){nt.debug("transcribe \u2192",{size:t.size,mimeType:r});let n=new FormData;n.append("audio",t,`voice.${Xy(r)}`),n.append("mimeType",r);let o=Sr("transcribe",await this.postForm(this.transcribePath,n,"transcribe"),eb);return nt.debug("transcribe \u2190",{textLen:o.text.length}),o}subscribeConversationChanges(t){return this.conversationListeners.add(t),()=>this.conversationListeners.delete(t)}publishConversation(t,r=!1){let n={type:"upsert",conversation:t,revision:++this.conversationRevision,...r?{activity:!0}:{}};this.conversationsCache.update(o=>{let s=o.pagination.page===1,i=o.conversations.some(_=>_.conversationId===t.conversationId),a=wr(o.conversations,n,s&&r),c=s&&a.length>o.pagination.limit?a.slice(0,o.pagination.limit):a;if(!s||!r||i||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(n)}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={},r=!1){if((t.page??1)>1)return this.fetchConversations(t);let n=this.localeCacheKey(t),o=this.conversationRevision;r&&this.conversationsCache.delete(n);let s=this.conversationsCache.getOrFetch(n,()=>this.fetchConversations(t));return r?s.then(i=>{let a={type:"snapshot",result:i,requestedRevision:o};for(let c of this.conversationListeners)c(a);return i}):s}async fetchConversations(t){let r=new URL(this.url(kt.listConversations));return t.visitorId&&r.searchParams.set("visitorId",t.visitorId),t.page&&r.searchParams.set("page",String(t.page)),t.limit&&r.searchParams.set("limit",String(t.limit)),t.ids?.length&&r.searchParams.set("ids",t.ids.join(",")),Sr("listConversations",await this.getJson(r.toString(),"listConversations"),tb)}async loadConversation(t,{ids:r=[],beforeId:n,beforeCreatedAt:o}={}){let s=new URL(this.url(kt.listMessages));s.searchParams.set("conversationId",t),s.searchParams.set("limit",String(dc)),r.length>0&&s.searchParams.set("ids",r.join(",")),n&&s.searchParams.set("beforeId",n),o&&s.searchParams.set("beforeCreatedAt",o);let i=Sr("loadConversation",await this.getJson(s.toString(),"loadConversation"),rb);return{...i,messages:i.messages.toReversed()}}async markRead(t,r){if(!this.visitorId||!t)return;let n={type:"read",conversationId:t,...r===void 0?{}:{lastMessageAt:r},revision:++this.conversationRevision};this.conversationsCache.update(o=>{let s=wr(o.conversations,n);return s===o.conversations?o:{...o,conversations:s}});for(let o of this.conversationListeners)o(n);try{await this.postJson(kt.markRead,{conversationId:t},"markRead",!0)}catch(o){nt.debug("markRead failed (non-fatal)",{err:o})}}async requestOperator(){if(!(!this.visitorId||!this.conversationId))try{return f_("requestOperator",await this.postJson(kt.requestOperator,{},"requestOperator"))}catch(t){nt.debug("requestOperator failed (non-fatal)",{err:t});return}}async emailTranscript(t){return Sr("emailTranscript",await this.postJson(kt.emailTranscript,{email:t},"emailTranscript"),nb)}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId))try{return f_("cancelOperatorRequest",await this.postJson(kt.cancelOperatorRequest,{},"cancelOperatorRequest"))}catch(t){nt.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(r=>({...r,items:r.items.map(n=>__(n,this.locale))}))}async fetchContent(t){let r=new URL(this.dataUrl(kt.content));for(let[o,s]of Object.entries(t))s!==void 0&&r.searchParams.set(o,Array.isArray(s)?s.join(","):String(s));let n=Sr("listContent",await this.getJson(r.toString(),"listContent"),ob);return{...n,items:n.items??[]}}async setContentVote(t){try{await this.postJson(this.dataUrl(kt.contentVoteSet),t,"setContentVote")}catch{}}listContentCollections(t){return this.contentCollectionsCache.getOrFetch(t.join(","),()=>this.fetchContentCollections(t)).then(r=>({items:r.items.map(n=>__(n,this.locale))}))}async fetchContentCollections(t){let r=new URL(this.dataUrl(kt.contentCollections));return t.length&&r.searchParams.set("ids",t.join(",")),{items:Sr("listContentCollections",await this.getJson(r.toString(),"listContentCollections"),ab).items??[]}}async saveUserPrefs(t){await this.postJson(kt.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){nt.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(kt.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(r){nt.debug("submitFeedback failed (non-fatal)",{err:r})}}async sendTurn(t,r={}){nt.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});let n=JSON.stringify({...this.withEnvelope(t),[Xl]:lc(this.userContext,this.pageContext,this.opts.recentHostEvents)}),o=r.keepalive===!0&&new Blob([n]).size<jy;try{return await this.runWithAbort(async s=>{let i=await this.withFreshUserToken(()=>this.fetchImpl(this.url(kt.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.headersFor(this.url(kt.streamMessage))},body:n,keepalive:o,signal:s}));if(i.status!==202)throw new qe(`sendTurn failed: expected 202, received ${i.status}`,"server",i.status,void 0,ib(i),(await cc(i)).error);let a;try{a=await i.json()}catch(c){throw s?.aborted?c:new qe("sendTurn failed: invalid acknowledgement","server",i.status,c)}if(!Jy(a))throw new qe("sendTurn failed: invalid acknowledgement","server",i.status);return a},void 0,Fy)}catch(s){throw s instanceof qe?s:new qe("sendTurn failed: network error","network",void 0,s)}}cancelTurn(t,r){!this.visitorId||!t||!r||(nt.debug("cancel stream",{conversationId:t,runId:r,visitorId:this.visitorId}),this.fetchImpl(this.url(kt.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(kt.cancelStream))},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:r})),keepalive:!0}).catch(n=>nt.debug("cancel POST failed (non-fatal)",{err:n})))}async connectResumeStream(t){let r=new AbortController;function n(){return r.abort(t.signal.reason)}t.signal.aborted?n():t.signal.addEventListener("abort",n,{once:!0});let o=setTimeout(()=>r.abort(),Vy);function s(){clearTimeout(o),t.signal.removeEventListener("abort",n)}let i;try{i=await this.withFreshUserToken(()=>this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",cache:"no-store",headers:{accept:"text/event-stream",...this.headersFor(this.resumeUrl())},signal:r.signal}))}catch(c){return s(),t.signal.aborted||nt.debug("resume-stream fetch failed \u2014 reconnecting",{err:c}),"held"}if(!i.ok)return s(),i.status===409||u_.has(i.status)?(nt.debug("resume-stream \u2192 transient response; reconnecting",{status:i.status}),"held"):(nt.debug("resume-stream \u2192 endpoint unavailable",{status:i.status}),"unavailable");if(!i.body)return s(),nt.debug("resume-stream \u2192 bodyless response; stopping",{status:i.status}),"unavailable";if(!(i.headers.get("content-type")??"").includes("text/event-stream"))return s(),nt.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";let a=!1;try{for await(let{chunk:c}of i_(i,r.signal,u=>{a||u!=="connected"||(a=!0,clearTimeout(o),t.onConnected())})){if(t.signal.aborted)return"held";t.onChunk(c)}}catch(c){if(t.signal.aborted)return"held";nt.debug("resume-stream segment dropped \u2014 reconnecting",{err:c})}finally{s()}return"held"}resumeUrl(){return this.withEnvelopeQuery(kt.streamResume)}async postJson(t,r,n,o=!1){let s=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(r)),...o?{keepalive:!0}:{}}],n);return this.assertOk(s,n)}async postForm(t,r,n,o,s,i){let a=i?s_(i):this.fetchImpl;return this.runWithAbort(async c=>{let u=await this.withFreshUserToken(()=>a(this.url(t),{method:"POST",credentials:"omit",headers:this.headersFor(this.url(t)),body:this.appendEnvelope(r),signal:c}));return this.assertOk(u,n)},o,s)}async runWithAbort(t,r,n){if(!r&&n===void 0)return t();let o=new AbortController;function s(){return o.abort(r?.reason)}r?.aborted?s():r?.addEventListener("abort",s,{once:!0});let i=n===void 0?void 0:setTimeout(()=>o.abort(),n);try{return await t(o.signal)}finally{i!==void 0&&clearTimeout(i),r?.removeEventListener("abort",s)}}async getJson(t,r){let n=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.headersFor(this.url(t))}}],r);return this.assertOk(n,r)}async fetchWithRetry(t,r){for(let n=0;;n++){let o;try{o=await this.withFreshUserToken(()=>this.fetchImpl(...t()))}catch(i){if(n>=d_)throw new qe(`${r} failed: network error`,"network",void 0,i);nt.debug("request network error \u2014 retrying",{label:r,attempt:n}),await rn(p_(n));continue}if(o.ok||!u_.has(o.status)||n>=d_)return o;let s=Yy(o.headers)??p_(n);nt.debug("request retryable status \u2014 retrying",{label:r,status:o.status,attempt:n,wait:s}),await rn(s)}}async assertOk(t,r){if(!t.ok)throw new qe(`${r} failed: ${t.status}`,"server",t.status,void 0,void 0,(await cc(t)).error);return await t.json()}fetchUserToken(){let t=this.userTokenSource;if(typeof t!="function")return Promise.resolve();let r=Promise.resolve().then(t).then(n=>{this.userTokenSource===t&&(this.userToken=n||void 0)},n=>{nt.warn("userToken function failed",{err:n}),this.userTokenSource===t&&(this.userToken=void 0)});return this.userTokenRequest=r,r}headersFor(t){let r=!/^https?:\/\//i.test(t)||t.startsWith(`${this.opts.agentApiBaseUrl}/`);return{...this.opts.auth.headers(),...r&&this.userToken?{[qy]:this.userToken}:{},...r&&this.opts.continueLink?{[Uy]:this.opts.continueLink}:{}}}async withFreshUserToken(t){this.userTokenRequest&&await this.userTokenRequest;let r=await t();if(r.status!==401)return r;let n=await cc(r);if(n.error==="USER_TOKEN_REQUIRED")return this.opts.onLoginState?.({status:"required",loginUrl:n.loginUrl}),r;if(!this.userToken)return r;if(!await this.refreshUserToken())return this.reportLogin("expired"),r;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 Xy(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 Jy(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),r=Reflect.get(e,"conversationId"),n=Reflect.get(e,"runId");return t==="accepted"&&typeof r=="string"&&r.length>0&&(n===void 0||typeof n=="string"&&n.length>0)}function Ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Sr(e,t,r){if(!r(t))throw new qe(`${e} failed: invalid response body`,"server");return t}function f_(e,t){let r=Pi(Ft(t)?t.controlState:void 0);if(!r)throw new qe(`${e} failed: invalid response body`,"server");return r}function m_(e){return!(!Ft(e)||typeof e.visitorId!="string"||typeof e.conversationId!="string"||e.welcome!==void 0&&(!Ft(e.welcome)||e.welcome.messages!==void 0&&!Array.isArray(e.welcome.messages)))}function Zy(e){return Ft(e)&&typeof e.id=="string"&&typeof e.url=="string"&&typeof e.originalName=="string"&&typeof e.mimeType=="string"&&typeof e.fileSize=="number"}function eb(e){return Ft(e)&&typeof e.text=="string"}function v_(e){return Ft(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 tb(e){return Ft(e)&&Array.isArray(e.conversations)&&e.conversations.every(Ft)&&v_(e.pagination)}function rb(e){return Ft(e)&&typeof e.conversationId=="string"&&Array.isArray(e.messages)&&e.messages.every(Ft)}function nb(e){return Ft(e)&&typeof e.status=="string"&&typeof e.to=="string"}function ob(e){return Ft(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(Ft))&&(e.pagination===void 0||v_(e.pagination))}function ab(e){return Ft(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(Ft))}function ib(e){let t=Number(e.headers.get("retry-after"));return Number.isInteger(t)&&t>0?t:void 0}function Gn(e,t,r){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"?r==="fullscreen":!0}}function Ri(e,t,r){return Gn("close",e,t)?r.includes("close"):!1}function h_(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}function Kn(e,t,r,n){let o={role:r,text:n};e.emit("message",o),t.onMessage?.(o)}function y_(e){return Object.fromEntries(e.map(t=>[t,[]]))}function uc(e,t,r){return e.includes(t)?t:e.includes(r)?r:e[0]??""}function b_(e,t,r){let n=[...new Set(t)],o=uc(n,e,""),s=se({activeTab:o,stacks:y_(n)});return{sig:s,reconcile(i,a){let c=[...new Set(i)],u=s.value,p=uc(c,u.activeTab,a),_=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]);n=c,!d&&(s.value={activeTab:p,stacks:_},p!==u.activeTab&&p&&r?.(p))},switchTab(i){!(i in s.value.stacks)||s.value.activeTab===i||(s.value={...s.value,activeTab:i},r?.(i))},open(i,a){let c=s.value;i in c.stacks&&(s.value={activeTab:i,stacks:{...c.stacks,[i]:a?[a]:[]}},c.activeTab!==i&&r?.(i))},push(i){let a=s.value,c=a.stacks[a.activeTab]??[];s.value={...a,stacks:{...a.stacks,[a.activeTab]:[...c,i]}}},pop(){let i=s.value,a=i.stacks[i.activeTab]??[];a.length!==0&&(s.value={...i,stacks:{...i.stacks,[i.activeTab]:a.slice(0,-1)}})},reset(i){s.value={activeTab:uc(n,i,""),stacks:y_(n)}}}}function P_(e){return e.stacks[e.activeTab]??[]}function x_(e){return P_(e).at(-1)}function S_(e){return P_(e).length===0}function Vo(e){/^(https?:)?\//i.test(e)&&window.open(e,"_blank","noopener,noreferrer")}function Ei(e,t,r){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?r?t==="fullscreen"?"fullscreen":e:"closed":r?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var sb=900,lb=640;function pc(e,t,r){if(e==="standalone"||e==="page")return"fullscreen";let n=t.initialSize;return n==="expanded"||n==="fullscreen"||n==="normal"?n:r>0&&r<lb?"fullscreen":r>=(t.autoSizeBreakpoint??sb)?"expanded":"normal"}function Wo(e,t,r,n=null){let s=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(r??!e.startMinimized),a=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&n?n:pc(e.mode,e.size,t);return{panelOpen:s,panelSize:a}}function Qn(){return typeof window>"u"?0:window.innerWidth}var oe={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Mi=`${q.cssPrefix}-icon-dir`;function _c(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})})}function Bt(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M18 6 6 18M6 6l12 12"})})}function w_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M12 5v14M5 12h14"})})}function k_(){return l("svg",{...oe,class:Mi,"aria-hidden":"true",children:[l("path",{d:"m22 2-7 20-4-9-9-4Z"}),l("path",{d:"M22 2 11 13"})]})}function C_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function T_(){return l("svg",{...oe,class:Mi,"aria-hidden":"true",children:l("path",{d:"M3 20V4l18 8-18 8Z"})})}function Li(){return l("svg",{...oe,class:Mi,"aria-hidden":"true",children:l("path",{d:"m9 18 6-6-6-6"})})}function kr(){return l("svg",{...oe,"aria-hidden":"true",children:l("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Ni(){return l("svg",{...oe,"aria-hidden":"true",children:l("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 I_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),l("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]})}function Cr(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"8",r:"4.5"}),l("path",{d:"M4.5 20.5a7.5 7.5 0 0 1 15 0"})]})}function A_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})})}function R_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})})}function E_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})})}function M_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})})}function L_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M14 3h7v7M21 3l-9 9"}),l("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function N_(){return l("svg",{...oe,"aria-hidden":"true",viewBox:"0 0 10 10",children:l("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})})}function O_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),l("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),l("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]})}function $_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})})}function D_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})})}function q_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),l("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]})}function Yn(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M20 6 9 17l-5-5"})})}function U_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M3 3v6h6"}),l("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),l("path",{d:"M12 7v5l3 2"})]})}function B_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M2 12h20"}),l("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 Go(){return l("svg",{...oe,class:Mi,"aria-hidden":"true",children:l("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}function z_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M12 20h9"}),l("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function Oi(){return l("svg",{...oe,"aria-hidden":"true",children:[l("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),l("path",{d:"m3 7 9 6 9-6"})]})}function sr(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"m6 9 6 6 6-6"})})}function $i(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),l("path",{d:"M14 2v6h6"})]})}function cb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),l("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]})}function fc(){return l("svg",{...oe,"aria-hidden":"true",children:l("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 Ko(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),l("path",{d:"M12 17h.01"})]})}function db(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"m15 4 3 3-9 9-3-3z"}),l("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]})}function ub(){return l("svg",{...oe,"aria-hidden":"true",children:[l("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),l("path",{d:"M12 8V4"}),l("circle",{cx:"12",cy:"3",r:"1"}),l("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]})}function pb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),l("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),l("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),l("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]})}function _b(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("circle",{cx:"12",cy:"12",r:"4"}),l("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 mc(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"11",cy:"11",r:"7"}),l("path",{d:"m21 21-4.3-4.3"})]})}function H_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})}function F_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M3 9.5 12 3l9 6.5"}),l("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]})}function Di(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"m3 11 15-5v12L3 13z"}),l("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),l("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),l("path",{d:"M21 10a3 3 0 0 1 0 4"})]})}function Qo(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),l("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]})}function j_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"4"}),l("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 V_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}function W_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"M12 3v18"}),l("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}function fb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),l("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),l("path",{d:"m20 20-4.4-4.4"})]})}function mb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("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"}),l("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]})}function gb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M4 18h16"}),l("path",{d:"M5 18a7 7 0 0 1 14 0"}),l("path",{d:"M12 8V6"}),l("path",{d:"M10 6h4"})]})}function vb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),l("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),l("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),l("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 G_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),l("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]})}function K_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),l("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 Q_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),l("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 qi(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"3.5"}),l("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 Y_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"M12 7v5l3 2"})]})}function Tr(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})}function gn(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m15 9-6 6M9 9l6 6"})]})}function X_(){return l("svg",{...oe,"aria-hidden":"true",children:l("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 Xn(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M12 8v4M12 16h.01"})]})}var J_={chat:_c,message:fc,bubbles:Qo,spark:cb,wand:db,bot:ub,help:Ko,lifebuoy:_b,headset:pb,search:fb,sparkles:mb,concierge:gb,wave:vb};var W=q.cssPrefix,D={launcher:`${W}-launcher`,callout:`${W}-callout`,calloutDismiss:`${W}-callout-dismiss`,panel:`${W}-panel`,panelHeader:`${W}-panel-header`,resizeGrip:`${W}-resize-grip`,scrollToBottom:`${W}-scroll-to-bottom`,loadPreviousMessages:`${W}-load-previous-messages`,actionHistory:`${W}-action-history`,actionClose:`${W}-action-close`,emailTranscriptSheet:`${W}-email-transcript-sheet`,emailTranscriptEmail:`${W}-email-transcript-email`,emailTranscriptSend:`${W}-email-transcript-send`,langSegment:`${W}-lang-segment`,composer:`${W}-composer`,composerInput:`${W}-composer-input`,composerCount:`${W}-composer-count`,composerSend:`${W}-composer-send`,composerStop:`${W}-composer-stop`,compactionStatus:`${W}-compaction-status`,messageQueue:`${W}-message-queue`,queuedMessage:`${W}-queued-message`,queuedMessageRemove:`${W}-queued-message-remove`,composerAttach:`${W}-composer-attach`,composerFileInput:`${W}-composer-file-input`,composerVoice:`${W}-composer-voice`,attachmentChip:`${W}-attachment-chip`,attachmentRemove:`${W}-attachment-remove`,attachmentRetry:`${W}-attachment-retry`,suggestion:`${W}-suggestion`,messageBubble:`${W}-message`,messageRetry:`${W}-message-retry`,messageFile:`${W}-message-file`,messageFeedback:`${W}-message-feedback`,feedbackUp:`${W}-feedback-up`,feedbackDown:`${W}-feedback-down`,messageCopy:`${W}-message-copy`,historyItem:`${W}-history-item`,historyLoadMore:`${W}-history-load-more`,sidebar:`${W}-sidebar`,sidebarToggle:`${W}-sidebar-toggle`,sidebarNewConversation:`${W}-sidebar-new-conversation`,messengerHome:`${W}-messenger-home`,panelNotice:`${W}-panel-notice`,tab:`${W}-tab`,tabBadge:`${W}-tab-badge`,homeView:`${W}-home-view`,homeGreeting:`${W}-home-greeting`,homeBrand:`${W}-home-brand`,backHeader:`${W}-back-header`,contentView:`${W}-content-view`,contentScroll:`${W}-content-scroll`,homeSearch:`${W}-home-search`,helpSearch:`${W}-help-search`,homeRecent:`${W}-home-recent`,homeAsk:`${W}-home-ask`,homeWhatsNew:`${W}-home-whats-new`,homeContentRow:`${W}-home-content-row`,helpArticle:`${W}-help-article`,newsItem:`${W}-news-item`,newsMore:`${W}-news-more`,formField:`${W}-form-field`,toolAskQuestions:`${W}-tool-ask-questions`,toolInputSubmit:`${W}-tool-input-submit`,toolInputSkip:`${W}-tool-input-skip`,toolApproval:`${W}-tool-approval`,toolApprovalFields:`${W}-tool-approval-fields`,toolApprove:`${W}-tool-approve`,toolReject:`${W}-tool-reject`,toolEdit:`${W}-tool-edit`,toolDecision:`${W}-tool-decision`,typingDots:`${W}-typing-dots`,reasoning:`${W}-reasoning`,replyStopped:`${W}-reply-stopped`,toolAskSummary:`${W}-ask-questions-summary`,toolAskOptions:`${W}-ask-questions-options-toggle`,toolCall:`${W}-tool-call`,toolSteps:`${W}-tool-steps`,toolStep:`${W}-tool-step`,source:`${W}-source`,operatorRequest:`${W}-operator-request`,chatNotice:`${W}-chat-notice`,operatorBanner:`${W}-operator-banner`,cancelOperatorRequest:`${W}-cancel-operator-request`,loginBar:`${W}-login-bar`,loginBarAction:`${W}-login-bar-action`,loginBarHide:`${W}-login-bar-hide`,loginGate:`${W}-login-gate`,loginGateAction:`${W}-login-gate-action`,loginGateGuest:`${W}-login-gate-guest`,loggedIn:`${W}-logged-in`};function Ct(e,t){return`${e}-${t}`}var Ui=q.cssPrefix;function Z_({buttonRef:e,onToggle:t,launcher:r,strings:n,leaving:o,edgeTab:s}){let i=r.variant==="circle"?"":hb(r,n);return l("button",{ref:e,type:"button",class:`${Ui}-fab`,part:"launcher","data-variant":r.variant,"data-size":r.size,"data-edge-tab":s?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":D.launcher,onClick:t,"aria-label":n.launcherOpen,children:[yb(r.icon),i?l("span",{class:`${Ui}-fab-label`,children:i}):null]})}function hb(e,t){return e.label?mt(t,e.label):e.personaName?t.launcherAsk.replace("{name}",mt(t,e.personaName)):""}function yb(e){let t=J_[e];return t?l(t,{}):l(bb,{source:e})}function bb({source:e}){return l("span",{ref:t=>{t&&Pb(t,e)},"aria-hidden":"true"})}function Pb(e,t){if(e.dataset.svgMounted!==t)try{let n=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;n.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(n,!0)),e.dataset.svgMounted=t)}catch{}}function ef({callout:e,launcherPosition:t,strings:r,closeLabel:n,onDismiss:o}){let[s,i]=U(!1),a=B(null),[c,u]=U(!0);return St(()=>{let p=a.current?.parentElement;if(!p)return;let _=()=>u(window.innerWidth-p.getBoundingClientRect().width>=xb);return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)}),H(()=>{let p=setTimeout(()=>i(!0),e.delayMs);return()=>clearTimeout(p)},[e.delayMs]),H(()=>{if(!s||e.autoDismissMs<=0)return;let p=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(p)},[s,e.autoDismissMs,o]),s?l("div",{ref:a,class:`${Ui}-callout`,role:"status","data-shape":e.shape,"data-position":Sb(e.position,t,c),"data-animated":e.animated?"true":void 0,"data-testid":D.callout,children:[l("span",{children:mt(r,e.text)}),l("button",{type:"button",class:`${Ui}-callout-close`,onClick:o,"aria-label":n,title:n,"data-testid":D.calloutDismiss,children:l(Bt,{})})]}):null}var xb=200;function Sb(e,t,r=!0){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"||e==="auto"&&!r?o?"top":"bottom":n?"left":"right"}var wb='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Jn(e){function t(r){if(r.key!=="Tab")return;let n=[...e.querySelectorAll(wb)].filter(c=>c.offsetParent!==null||c===document.activeElement);if(n.length===0){r.preventDefault();return}let o=n[0],s=n[n.length-1];if(!o||!s)return;let i=e.getRootNode(),a=i instanceof ShadowRoot?i.activeElement:null;r.shiftKey&&a===o?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),o.focus())}return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var jr=q.cssPrefix;function Bi({title:e,actions:t}){return l("header",{class:`${jr}-back-header`,part:"header","data-variant":"title",children:[l("span",{class:`${jr}-back-spacer`,"aria-hidden":"true"}),l("h1",{class:`${jr}-back-title`,children:e}),t??l("span",{class:`${jr}-back-spacer`,"aria-hidden":"true"})]})}function tf({title:e,backLabel:t,onBack:r,actions:n,testid:o}){return l("header",{class:`${jr}-back-header`,part:"header","data-testid":o,children:[l("button",{type:"button",class:`${jr}-icon-btn`,onClick:r,"aria-label":t,title:t,children:l(Go,{})}),l("h1",{class:`${jr}-back-title`,children:e}),n??l("span",{class:`${jr}-back-spacer`,"aria-hidden":"true"})]})}function Yo({textSig:e,doneSig:t,generativeUi:r=!1,strings:n=Pa,onCardAction:o}){let s=B(null),i=B(null);return St(()=>{let a=s.current;if(!a)return;a.classList.add(`${q.cssPrefix}-md`);let c=i.current,u={generativeUi:r,strings:n,onCardAction:o},p=()=>{i.current?.renderer?.dispose();let g=document.createElement("div"),P=r?jp(g,{cssPrefix:q.cssPrefix,strings:n,onAction:o}):void 0,b=Mo($b(Bb(P??ni(g)))),y=e.value,x=y.length;if(!t.value)for(;x>0&&y[x-1]==="_";)x--;let S=gc(y.slice(0,x));return S&&it(b,S),t.value&&(zn(b),P?.finish()),a.replaceChildren(g),{settings:u,container:g,parser:b,renderer:P,lastLen:x,lastText:y.slice(0,x)}},_=c&&c.settings.generativeUi===r&&c.settings.strings===n&&c.settings.onCardAction===o&&e.value.startsWith(c.lastText)?c:p();i.current=_;let d=or(()=>{let g=e.value,P=t.value;if(g.length<_.lastLen){_=p(),i.current=_;return}let b=g.length;if(!P)for(;b>_.lastLen&&g[b-1]==="_";)b--;let y=Math.max(_.lastLen-1,0),x=gc(g.slice(y,b)).slice(_.lastLen-y);x&&it(_.parser,x),_.lastLen=b,_.lastText=g.slice(0,b),P&&(zn(_.parser),_.renderer?.finish())}),f=new MutationObserver(()=>rf(a));f.observe(a,{childList:!0,subtree:!0}),rf(a);function v(g){let P=g.target instanceof Element?g.target.closest("a"):null;if(!P||!(P instanceof HTMLAnchorElement))return;let b=P.getAttribute("href")??"";!b||b.startsWith("#")||(g.preventDefault(),window.open(b,"_blank","noopener,noreferrer"))}return a.addEventListener("click",v),()=>{d(),f.disconnect(),a.removeEventListener("click",v)}},[e,t,r,n,o]),H(()=>()=>{i.current?.renderer?.dispose(),i.current=null},[]),l("div",{ref:s})}function Hi({text:e}){let t=ve(()=>se(e),[e]),r=ve(()=>se(!0),[]);return l(Yo,{textSig:t,doneSig:r})}var zi="\uE000",Ob=/([\p{L}\p{N}])(_+)(?=[\p{L}\p{N}])/gu;function gc(e){return e.replace(Ob,(t,r,n)=>r+zi.repeat(n.length))}function $b(e){return{...e,add_text:(t,r)=>e.add_text(t,r.replaceAll(zi,"_")),set_attr:(t,r,n)=>e.set_attr(t,r,n.replaceAll(zi,"_"))}}var Db=/<(\/?)(?:(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 of(e){let t=0,r="";return e.replace(Db,(n,o,s,i,a,c,u,p)=>{if(o===void 0)return t?c+(p?.split(`
60
+ ${s}`:s;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(r==="[DONE]")return"done";if(!r)return null;try{let o=JSON.parse(r);if(!eb(o))throw new TypeError("unrecognized chunk");return u_.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){throw u_.trace("frame parse failed",{errorType:o instanceof Error?o.name:typeof o,payloadLength:r.length}),new De("invalid SSE frame","network",void 0,o)}}function eb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof Reflect.get(e,"type")=="string"}var tb=new Set([101,204,205,304]);function rb(e){let t=new Headers;for(let r of e.trim().split(/[\r\n]+/)){let n=r.indexOf(":");n>0&&t.append(r.slice(0,n).trim(),r.slice(n+1).trim())}return t}function __(e){return async function(r,n){let o=new Request(r,n),s=await o.blob();return new Promise((a,i)=>{if(o.signal.aborted){i(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",()=>{a(new Response(tb.has(c.status)?null:c.response,{status:c.status,statusText:c.statusText,headers:rb(c.getAllResponseHeaders())}))}),c.addEventListener("error",()=>i(new TypeError("Failed to fetch"))),c.addEventListener("abort",()=>i(o.signal.reason)),o.signal.addEventListener("abort",()=>c.abort(),{once:!0}),c.send(s)})}}var et=te.scope("transport"),nb="x-user-token",ob="x-continue-link";async function lc(e){try{let t=await e.clone().json();if(typeof t!="object"||t===null)return{};let r=Reflect.get(t,"error");return{error:typeof r=="string"?r:void 0,loginUrl:ta(Reflect.get(t,"login")).url}}catch{return{}}}var f_=6e4,ib=1e4,cc=50,x_=new WeakMap;function Vn(e){return x_.get(e)}function Fo(e,t){return x_.set(e,t),e}function m_(e){return Math.max(e?.upsertRevision??0,e?.read?.revision??0)}function ab(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 xr(e,t,r=!0){switch(t.type){case"snapshot":{let n=new Map(e.map(a=>[a.conversationId,a])),o=e.filter(a=>(Vn(a)?.activityRevision??0)>t.requestedRevision).toSorted((a,i)=>(Vn(i)?.activityRevision??0)-(Vn(a)?.activityRevision??0)),s=new Set(o.map(a=>a.conversationId));return[...o,...t.result.conversations.filter(a=>!s.has(a.conversationId)).map(a=>{let i=n.get(a.conversationId);if(!i)return a;let c=Vn(i);return(c?.upsertRevision??0)>t.requestedRevision?i:c?.read&&!i.hasUnread&&c.read.lastMessageAt===a.lastMessageAt?Fo({...a,hasUnread:!1},{upsertRevision:0,read:c.read}):a})]}case"read":{let n=e.findIndex(c=>c.conversationId===t.conversationId&&(t.lastMessageAt===void 0||c.lastMessageAt===t.lastMessageAt)),o=e[n];if(!o)return e;let s=Vn(o);if(m_(s)>t.revision)return e;let a=t.lastMessageAt??o.lastMessageAt,i={upsertRevision:s?.upsertRevision??0,...s?.activityRevision===void 0?{}:{activityRevision:s.activityRevision},read:{revision:t.revision,...a?{lastMessageAt:a}:{}}};return o.hasUnread?e.map((c,u)=>u===n?Fo({...c,hasUnread:!1},i):c):(Fo(o,i),e)}case"upsert":{let n=e.findIndex(u=>u.conversationId===t.conversation.conversationId);if(n<0&&!r)return e;let o=e[n],s=o?Vn(o):void 0;if(m_(s)>t.revision)return e;let a=t.activity?t.revision:s?.activityRevision,i={upsertRevision:t.revision,...a===void 0?{}:{activityRevision:a},...!t.conversation.hasUnread&&s?.read?{read:s.read}:{}},c=o?{...o,...t.conversation,title:o.title}:{...t.conversation};return o&&ab(o,c)?(Fo(o,i),e):(Fo(c,i),t.activity?[c,...e.filter(u=>u.conversationId!==c.conversationId)]:o?e.map((u,p)=>p===n?c:u):[...e,c])}default:return t}}var g_=3,sb=400,lb=3e4,cb=6e4,db=1e4,ub=6e4,pb=15e3,_b=1024*1024,v_=new Set([408,425,429,500,502,503,504]);function h_(e){return sb*2**e+Math.floor(Math.random()*250)}function fb(e){return ub+Math.ceil(e/_b)*pb}function mb(e){let t=e.get("retry-after");if(!t)return null;let r=Number(t),n=Number.isFinite(r)?r*1e3:Date.parse(t)-Date.now();return Number.isFinite(n)&&n>=0?Math.min(n,3e4):null}var jo=class{constructor(t){ee(this,"ttlMs",t);ee(this,"map",new Map)}getOrFetch(t,r){let n=this.map.get(t);if(n&&performance.now()-n.at<this.ttlMs)return n.result;let o={at:performance.now(),result:r().then(s=>(o.value=s,s)).catch(s=>{throw this.map.get(t)===o&&this.map.delete(t),s})};return this.map.set(t,o),o.result}peek(t){let r=this.map.get(t);if(r?.value!==void 0&&performance.now()-r.at<this.ttlMs)return r.value}update(t){for(let r of this.map.values()){if(r.value!==void 0){let n=t(r.value);r.value=n,r.result=Promise.resolve(n);continue}r.result=r.result.then(n=>{let o=t(n);return r.value=o,o})}}delete(t){this.map.delete(t)}};function y_(e,t){let{translations:r,defaultLocale:n,...o}=Yr(e,t);return o}var Ia=class{constructor(t){ee(this,"opts",t);ee(this,"conversationListeners",new Set);ee(this,"conversationRevision",0);ee(this,"visitorId");ee(this,"conversationId");ee(this,"userContext");ee(this,"pageContext");ee(this,"locale");ee(this,"userTokenSource");ee(this,"userToken");ee(this,"userTokenRequest");ee(this,"conversationsCache",new jo(ib));ee(this,"contentCache",new jo(f_));ee(this,"contentCollectionsCache",new jo(f_))}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?ap(this.userToken):void 0}reportLogin(t){this.opts.onLoginState?.(t==="loggedIn"&&this.userToken?{status:t,...ip(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,r){this.userContext=t,this.pageContext=r}setLocale(t){this.locale=t}primeIdentity(t,r){t&&(this.visitorId=t),r&&(this.conversationId=r)}envelope(){let t={_ev:On};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let r=sc(this.userContext,this.pageContext);return r&&(t[Yl]=r),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[r,n]of Object.entries(this.envelope()))t.append(r,n);return t}withEnvelopeQuery(t){let r=new URL(this.url(t));for(let[n,o]of Object.entries(this.envelope()))r.searchParams.has(n)||r.searchParams.set(n,o);return r.toString()}async handshake(t){et.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let r=Pr("handshake",await this.postJson(kt.handshake,t,"handshake"),P_),n=r.loginStatus==="expired"&&await this.refreshUserToken()?Pr("handshake",await this.postJson(kt.handshake,t,"handshake"),P_):r;return this.reportLogin(n.loginStatus??(this.userToken?"loggedIn":"anonymous")),et.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),this.visitorId=n.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t,r,n){et.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let o=new FormData;o.append("file",t,t.name);let s=Pr("upload",await this.postForm(this.uploadPath,o,"upload",r,fb(t.size),n),hb);return et.debug("uploadFile \u2190",{id:s.id,url:s.url}),s}async transcribe(t,r="audio/webm"){et.debug("transcribe \u2192",{size:t.size,mimeType:r});let n=new FormData;n.append("audio",t,`voice.${gb(r)}`),n.append("mimeType",r);let o=Pr("transcribe",await this.postForm(this.transcribePath,n,"transcribe"),yb);return et.debug("transcribe \u2190",{textLen:o.text.length}),o}subscribeConversationChanges(t){return this.conversationListeners.add(t),()=>this.conversationListeners.delete(t)}publishConversation(t,r=!1){let n={type:"upsert",conversation:t,revision:++this.conversationRevision,...r?{activity:!0}:{}};this.conversationsCache.update(o=>{let s=o.pagination.page===1,a=o.conversations.some(_=>_.conversationId===t.conversationId),i=xr(o.conversations,n,s&&r),c=s&&i.length>o.pagination.limit?i.slice(0,o.pagination.limit):i;if(!s||!r||a||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(n)}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={},r=!1){if((t.page??1)>1)return this.fetchConversations(t);let n=this.localeCacheKey(t),o=this.conversationRevision;r&&this.conversationsCache.delete(n);let s=this.conversationsCache.getOrFetch(n,()=>this.fetchConversations(t));return r?s.then(a=>{let i={type:"snapshot",result:a,requestedRevision:o};for(let c of this.conversationListeners)c(i);return a}):s}async fetchConversations(t){let r=new URL(this.url(kt.listConversations));return t.visitorId&&r.searchParams.set("visitorId",t.visitorId),t.page&&r.searchParams.set("page",String(t.page)),t.limit&&r.searchParams.set("limit",String(t.limit)),t.ids?.length&&r.searchParams.set("ids",t.ids.join(",")),Pr("listConversations",await this.getJson(r.toString(),"listConversations"),bb)}async loadConversation(t,{ids:r=[],beforeId:n,beforeCreatedAt:o}={}){let s=new URL(this.url(kt.listMessages));s.searchParams.set("conversationId",t),s.searchParams.set("limit",String(cc)),r.length>0&&s.searchParams.set("ids",r.join(",")),n&&s.searchParams.set("beforeId",n),o&&s.searchParams.set("beforeCreatedAt",o);let a=Pr("loadConversation",await this.getJson(s.toString(),"loadConversation"),Pb);return{...a,messages:a.messages.toReversed()}}async markRead(t,r){if(!this.visitorId||!t)return;let n={type:"read",conversationId:t,...r===void 0?{}:{lastMessageAt:r},revision:++this.conversationRevision};this.conversationsCache.update(o=>{let s=xr(o.conversations,n);return s===o.conversations?o:{...o,conversations:s}});for(let o of this.conversationListeners)o(n);try{await this.postJson(kt.markRead,{conversationId:t},"markRead",!0)}catch(o){et.debug("markRead failed (non-fatal)",{err:o})}}async requestOperator(){if(!(!this.visitorId||!this.conversationId))try{return b_("requestOperator",await this.postJson(kt.requestOperator,{},"requestOperator"))}catch(t){et.debug("requestOperator failed (non-fatal)",{err:t});return}}async emailTranscript(t){return Pr("emailTranscript",await this.postJson(kt.emailTranscript,{email:t},"emailTranscript"),xb)}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId))try{return b_("cancelOperatorRequest",await this.postJson(kt.cancelOperatorRequest,{},"cancelOperatorRequest"))}catch(t){et.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(r=>({...r,items:r.items.map(n=>y_(n,this.locale))}))}async fetchContent(t){let r=new URL(this.dataUrl(kt.content));for(let[o,s]of Object.entries(t))s!==void 0&&r.searchParams.set(o,Array.isArray(s)?s.join(","):String(s));let n=Pr("listContent",await this.getJson(r.toString(),"listContent"),Sb);return{...n,items:n.items??[]}}async setContentVote(t){try{await this.postJson(this.dataUrl(kt.contentVoteSet),t,"setContentVote")}catch{}}listContentCollections(t){return this.contentCollectionsCache.getOrFetch(t.join(","),()=>this.fetchContentCollections(t)).then(r=>({items:r.items.map(n=>y_(n,this.locale))}))}async fetchContentCollections(t){let r=new URL(this.dataUrl(kt.contentCollections));return t.length&&r.searchParams.set("ids",t.join(",")),{items:Pr("listContentCollections",await this.getJson(r.toString(),"listContentCollections"),wb).items??[]}}async saveUserPrefs(t){await this.postJson(kt.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){et.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(kt.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(r){et.debug("submitFeedback failed (non-fatal)",{err:r})}}async sendTurn(t,r={}){et.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});let n=JSON.stringify({...this.withEnvelope(t),[Yl]:sc(this.userContext,this.pageContext,this.opts.recentHostEvents)}),o=r.keepalive===!0&&new Blob([n]).size<cb;try{return await this.runWithAbort(async s=>{let a=await this.withFreshUserToken(()=>this.fetchImpl(this.url(kt.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.headersFor(this.url(kt.streamMessage))},body:n,keepalive:o,signal:s}));if(a.status!==202)throw new De(`sendTurn failed: expected 202, received ${a.status}`,"server",a.status,void 0,kb(a),(await lc(a)).error);let i;try{i=await a.json()}catch(c){throw s?.aborted?c:new De("sendTurn failed: invalid acknowledgement","server",a.status,c)}if(!vb(i))throw new De("sendTurn failed: invalid acknowledgement","server",a.status);return i},void 0,lb)}catch(s){throw s instanceof De?s:new De("sendTurn failed: network error","network",void 0,s)}}cancelTurn(t,r){!this.visitorId||!t||!r||(et.debug("cancel stream",{conversationId:t,runId:r,visitorId:this.visitorId}),this.fetchImpl(this.url(kt.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(kt.cancelStream))},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:r})),keepalive:!0}).catch(n=>et.debug("cancel POST failed (non-fatal)",{err:n})))}async connectResumeStream(t){let r=new AbortController;function n(){return r.abort(t.signal.reason)}t.signal.aborted?n():t.signal.addEventListener("abort",n,{once:!0});let o=setTimeout(()=>r.abort(),db);function s(){clearTimeout(o),t.signal.removeEventListener("abort",n)}let a;try{a=await this.withFreshUserToken(()=>this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",cache:"no-store",headers:{accept:"text/event-stream",...this.headersFor(this.resumeUrl())},signal:r.signal}))}catch(c){return s(),t.signal.aborted||et.debug("resume-stream fetch failed \u2014 reconnecting",{err:c}),"held"}if(!a.ok)return s(),a.status===409||v_.has(a.status)?(et.debug("resume-stream \u2192 transient response; reconnecting",{status:a.status}),"held"):(et.debug("resume-stream \u2192 endpoint unavailable",{status:a.status}),"unavailable");if(!a.body)return s(),et.debug("resume-stream \u2192 bodyless response; stopping",{status:a.status}),"unavailable";if(!(a.headers.get("content-type")??"").includes("text/event-stream"))return s(),et.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";let i=!1;try{for await(let{chunk:c}of p_(a,r.signal,u=>{i||u!=="connected"||(i=!0,clearTimeout(o),t.onConnected())})){if(t.signal.aborted)return"held";t.onChunk(c)}}catch(c){if(t.signal.aborted)return"held";et.debug("resume-stream segment dropped \u2014 reconnecting",{err:c})}finally{s()}return"held"}resumeUrl(){return this.withEnvelopeQuery(kt.streamResume)}async postJson(t,r,n,o=!1){let s=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(r)),...o?{keepalive:!0}:{}}],n);return this.assertOk(s,n)}async postForm(t,r,n,o,s,a){let i=a?__(a):this.fetchImpl;return this.runWithAbort(async c=>{let u=await this.withFreshUserToken(()=>i(this.url(t),{method:"POST",credentials:"omit",headers:this.headersFor(this.url(t)),body:this.appendEnvelope(r),signal:c}));return this.assertOk(u,n)},o,s)}async runWithAbort(t,r,n){if(!r&&n===void 0)return t();let o=new AbortController;function s(){return o.abort(r?.reason)}r?.aborted?s():r?.addEventListener("abort",s,{once:!0});let a=n===void 0?void 0:setTimeout(()=>o.abort(),n);try{return await t(o.signal)}finally{a!==void 0&&clearTimeout(a),r?.removeEventListener("abort",s)}}async getJson(t,r){let n=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.headersFor(this.url(t))}}],r);return this.assertOk(n,r)}async fetchWithRetry(t,r){for(let n=0;;n++){let o;try{o=await this.withFreshUserToken(()=>this.fetchImpl(...t()))}catch(a){if(n>=g_)throw new De(`${r} failed: network error`,"network",void 0,a);et.debug("request network error \u2014 retrying",{label:r,attempt:n}),await en(h_(n));continue}if(o.ok||!v_.has(o.status)||n>=g_)return o;let s=mb(o.headers)??h_(n);et.debug("request retryable status \u2014 retrying",{label:r,status:o.status,attempt:n,wait:s}),await en(s)}}async assertOk(t,r){if(!t.ok)throw new De(`${r} 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 r=Promise.resolve().then(t).then(n=>{this.userTokenSource===t&&(this.userToken=n||void 0)},n=>{et.warn("userToken function failed",{err:n}),this.userTokenSource===t&&(this.userToken=void 0)});return this.userTokenRequest=r,r}headersFor(t){let r=!/^https?:\/\//i.test(t)||t.startsWith(`${this.opts.agentApiBaseUrl}/`);return{...this.opts.auth.headers(),...r&&this.userToken?{[nb]:this.userToken}:{},...r&&this.opts.continueLink?{[ob]:this.opts.continueLink}:{}}}async withFreshUserToken(t){this.userTokenRequest&&await this.userTokenRequest;let r=await t();if(r.status!==401)return r;let n=await lc(r);if(n.error==="USER_TOKEN_REQUIRED")return this.opts.onLoginState?.({status:"required",loginUrl:n.loginUrl}),r;if(!this.userToken)return r;if(!await this.refreshUserToken())return this.reportLogin("expired"),r;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 gb(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 vb(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),r=Reflect.get(e,"conversationId"),n=Reflect.get(e,"runId");return t==="accepted"&&typeof r=="string"&&r.length>0&&(n===void 0||typeof n=="string"&&n.length>0)}function jt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pr(e,t,r){if(!r(t))throw new De(`${e} failed: invalid response body`,"server");return t}function b_(e,t){let r=Pa(jt(t)?t.controlState:void 0);if(!r)throw new De(`${e} failed: invalid response body`,"server");return r}function P_(e){return!(!jt(e)||typeof e.visitorId!="string"||typeof e.conversationId!="string"||e.welcome!==void 0&&(!jt(e.welcome)||e.welcome.messages!==void 0&&!Array.isArray(e.welcome.messages)))}function hb(e){return jt(e)&&typeof e.id=="string"&&typeof e.url=="string"&&typeof e.originalName=="string"&&typeof e.mimeType=="string"&&typeof e.fileSize=="number"}function yb(e){return jt(e)&&typeof e.text=="string"}function S_(e){return jt(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 bb(e){return jt(e)&&Array.isArray(e.conversations)&&e.conversations.every(jt)&&S_(e.pagination)}function Pb(e){return jt(e)&&typeof e.conversationId=="string"&&Array.isArray(e.messages)&&e.messages.every(jt)}function xb(e){return jt(e)&&typeof e.status=="string"&&typeof e.to=="string"}function Sb(e){return jt(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(jt))&&(e.pagination===void 0||S_(e.pagination))}function wb(e){return jt(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(jt))}function kb(e){let t=Number(e.headers.get("retry-after"));return Number.isInteger(t)&&t>0?t:void 0}function Wn(e,t,r){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"?r==="fullscreen":!0}}function Aa(e,t,r){return Wn("close",e,t)?r.includes("close"):!1}function w_(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}function Gn(e,t,r,n){let o={role:r,text:n};e.emit("message",o),t.onMessage?.(o)}function k_(e){return Object.fromEntries(e.map(t=>[t,[]]))}function dc(e,t,r){return e.includes(t)?t:e.includes(r)?r:e[0]??""}function C_(e,t,r){let n=[...new Set(t)],o=dc(n,e,""),s=ae({activeTab:o,stacks:k_(n)});return{sig:s,reconcile(a,i){let c=[...new Set(a)],u=s.value,p=dc(c,u.activeTab,i),_=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]);n=c,!d&&(s.value={activeTab:p,stacks:_},p!==u.activeTab&&p&&r?.(p))},switchTab(a){!(a in s.value.stacks)||s.value.activeTab===a||(s.value={...s.value,activeTab:a},r?.(a))},open(a,i){let c=s.value;a in c.stacks&&(s.value={activeTab:a,stacks:{...c.stacks,[a]:i?[i]:[]}},c.activeTab!==a&&r?.(a))},push(a){let i=s.value,c=i.stacks[i.activeTab]??[];s.value={...i,stacks:{...i.stacks,[i.activeTab]:[...c,a]}}},pop(){let a=s.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(s.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){s.value={activeTab:dc(n,a,""),stacks:k_(n)}}}}function T_(e){return e.stacks[e.activeTab]??[]}function I_(e){return T_(e).at(-1)}function A_(e){return T_(e).length===0}function Vo(e){/^(https?:)?\//i.test(e)&&window.open(e,"_blank","noopener,noreferrer")}function Ra(e,t,r){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?r?t==="fullscreen"?"fullscreen":e:"closed":r?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var Cb=900,Tb=640;function uc(e,t,r){if(e==="standalone"||e==="page")return"fullscreen";let n=t.initialSize;return n==="expanded"||n==="fullscreen"||n==="normal"?n:r>0&&r<Tb?"fullscreen":r>=(t.autoSizeBreakpoint??Cb)?"expanded":"normal"}function Wo(e,t,r,n=null){let s=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(r??!e.startMinimized),i=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&n?n:uc(e.mode,e.size,t);return{panelOpen:s,panelSize:i}}function Kn(){return typeof window>"u"?0:window.innerWidth}var oe={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Ea=`${D.cssPrefix}-icon-dir`;function pc(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})})}function Bt(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M18 6 6 18M6 6l12 12"})})}function R_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M12 5v14M5 12h14"})})}function E_(){return l("svg",{...oe,class:Ea,"aria-hidden":"true",children:[l("path",{d:"m22 2-7 20-4-9-9-4Z"}),l("path",{d:"M22 2 11 13"})]})}function M_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function L_(){return l("svg",{...oe,class:Ea,"aria-hidden":"true",children:l("path",{d:"M3 20V4l18 8-18 8Z"})})}function Ma(){return l("svg",{...oe,class:Ea,"aria-hidden":"true",children:l("path",{d:"m9 18 6-6-6-6"})})}function zr(){return l("svg",{...oe,"aria-hidden":"true",children:l("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function La(){return l("svg",{...oe,"aria-hidden":"true",children:l("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 N_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),l("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]})}function Sr(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"8",r:"4.5"}),l("path",{d:"M4.5 20.5a7.5 7.5 0 0 1 15 0"})]})}function O_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})})}function $_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})})}function D_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})})}function q_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})})}function U_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M14 3h7v7M21 3l-9 9"}),l("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function B_(){return l("svg",{...oe,"aria-hidden":"true",viewBox:"0 0 10 10",children:l("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})})}function z_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),l("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),l("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]})}function H_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})})}function F_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})})}function j_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),l("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]})}function Qn(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M20 6 9 17l-5-5"})})}function V_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M3 3v6h6"}),l("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),l("path",{d:"M12 7v5l3 2"})]})}function W_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M2 12h20"}),l("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 Go(){return l("svg",{...oe,class:Ea,"aria-hidden":"true",children:l("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}function G_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M12 20h9"}),l("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function Na(){return l("svg",{...oe,"aria-hidden":"true",children:[l("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),l("path",{d:"m3 7 9 6 9-6"})]})}function ar(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"m6 9 6 6 6-6"})})}function Oa(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),l("path",{d:"M14 2v6h6"})]})}function Ib(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),l("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]})}function _c(){return l("svg",{...oe,"aria-hidden":"true",children:l("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 Ko(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),l("path",{d:"M12 17h.01"})]})}function Ab(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"m15 4 3 3-9 9-3-3z"}),l("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]})}function Rb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),l("path",{d:"M12 8V4"}),l("circle",{cx:"12",cy:"3",r:"1"}),l("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]})}function Eb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),l("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),l("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),l("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]})}function Mb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("circle",{cx:"12",cy:"12",r:"4"}),l("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 l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"11",cy:"11",r:"7"}),l("path",{d:"m21 21-4.3-4.3"})]})}function K_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})}function Q_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M3 9.5 12 3l9 6.5"}),l("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]})}function $a(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"m3 11 15-5v12L3 13z"}),l("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),l("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),l("path",{d:"M21 10a3 3 0 0 1 0 4"})]})}function Qo(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),l("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]})}function Y_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"4"}),l("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 J_(){return l("svg",{...oe,"aria-hidden":"true",children:l("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}function X_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"M12 3v18"}),l("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}function Lb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),l("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),l("path",{d:"m20 20-4.4-4.4"})]})}function Nb(){return l("svg",{...oe,"aria-hidden":"true",children:[l("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"}),l("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]})}function Ob(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M4 18h16"}),l("path",{d:"M5 18a7 7 0 0 1 14 0"}),l("path",{d:"M12 8V6"}),l("path",{d:"M10 6h4"})]})}function $b(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),l("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),l("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),l("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 Z_(){return l("svg",{...oe,"aria-hidden":"true",children:[l("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),l("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]})}function ef(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),l("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 tf(){return l("svg",{...oe,"aria-hidden":"true",children:[l("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),l("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 rf(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"3.5"}),l("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 nf(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"M12 7v5l3 2"})]})}function mn(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})}function Yo(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m15 9-6 6M9 9l6 6"})]})}function of(){return l("svg",{...oe,"aria-hidden":"true",children:l("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 Yn(){return l("svg",{...oe,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M12 8v4M12 16h.01"})]})}var af={chat:pc,message:_c,bubbles:Qo,spark:Ib,wand:Ab,bot:Rb,help:Ko,lifebuoy:Mb,headset:Eb,search:Lb,sparkles:Nb,concierge:Ob,wave:$b};var W=D.cssPrefix,q={launcher:`${W}-launcher`,callout:`${W}-callout`,calloutDismiss:`${W}-callout-dismiss`,panel:`${W}-panel`,panelHeader:`${W}-panel-header`,resizeGrip:`${W}-resize-grip`,scrollToBottom:`${W}-scroll-to-bottom`,loadPreviousMessages:`${W}-load-previous-messages`,actionHistory:`${W}-action-history`,actionClose:`${W}-action-close`,emailTranscriptSheet:`${W}-email-transcript-sheet`,emailTranscriptEmail:`${W}-email-transcript-email`,emailTranscriptSend:`${W}-email-transcript-send`,langSegment:`${W}-lang-segment`,composer:`${W}-composer`,composerInput:`${W}-composer-input`,composerCount:`${W}-composer-count`,composerSend:`${W}-composer-send`,composerStop:`${W}-composer-stop`,compactionStatus:`${W}-compaction-status`,messageQueue:`${W}-message-queue`,queuedMessage:`${W}-queued-message`,queuedMessageRemove:`${W}-queued-message-remove`,composerAttach:`${W}-composer-attach`,composerFileInput:`${W}-composer-file-input`,composerVoice:`${W}-composer-voice`,attachmentChip:`${W}-attachment-chip`,attachmentRemove:`${W}-attachment-remove`,attachmentRetry:`${W}-attachment-retry`,suggestion:`${W}-suggestion`,messageBubble:`${W}-message`,messageRetry:`${W}-message-retry`,messageFile:`${W}-message-file`,messageFeedback:`${W}-message-feedback`,feedbackUp:`${W}-feedback-up`,feedbackDown:`${W}-feedback-down`,messageCopy:`${W}-message-copy`,historyItem:`${W}-history-item`,historyLoadMore:`${W}-history-load-more`,sidebar:`${W}-sidebar`,sidebarToggle:`${W}-sidebar-toggle`,sidebarNewConversation:`${W}-sidebar-new-conversation`,messengerHome:`${W}-messenger-home`,panelNotice:`${W}-panel-notice`,tab:`${W}-tab`,tabBadge:`${W}-tab-badge`,homeView:`${W}-home-view`,homeGreeting:`${W}-home-greeting`,homeBrand:`${W}-home-brand`,backHeader:`${W}-back-header`,contentView:`${W}-content-view`,contentScroll:`${W}-content-scroll`,homeSearch:`${W}-home-search`,helpSearch:`${W}-help-search`,homeRecent:`${W}-home-recent`,homeAsk:`${W}-home-ask`,homeWhatsNew:`${W}-home-whats-new`,homeContentRow:`${W}-home-content-row`,helpArticle:`${W}-help-article`,newsItem:`${W}-news-item`,newsMore:`${W}-news-more`,formField:`${W}-form-field`,toolAskQuestions:`${W}-tool-ask-questions`,toolInputSubmit:`${W}-tool-input-submit`,toolInputSkip:`${W}-tool-input-skip`,toolApproval:`${W}-tool-approval`,toolPreview:`${W}-tool-preview`,toolApprove:`${W}-tool-approve`,toolDecline:`${W}-tool-decline`,toolEdit:`${W}-tool-edit`,toolDecision:`${W}-tool-decision`,typingDots:`${W}-typing-dots`,reasoning:`${W}-reasoning`,replyStopped:`${W}-reply-stopped`,toolAskSummary:`${W}-ask-questions-summary`,toolAskOptions:`${W}-ask-questions-options-toggle`,toolSteps:`${W}-tool-steps`,toolStep:`${W}-tool-step`,source:`${W}-source`,operatorRequest:`${W}-operator-request`,chatNotice:`${W}-chat-notice`,operatorBanner:`${W}-operator-banner`,cancelOperatorRequest:`${W}-cancel-operator-request`,loginBar:`${W}-login-bar`,loginBarAction:`${W}-login-bar-action`,loginBarHide:`${W}-login-bar-hide`,loginGate:`${W}-login-gate`,loginGateAction:`${W}-login-gate-action`,loginGateGuest:`${W}-login-gate-guest`,loggedIn:`${W}-logged-in`};function Ct(e,t){return`${e}-${t}`}var Da=D.cssPrefix;function sf({buttonRef:e,onToggle:t,launcher:r,strings:n,leaving:o,edgeTab:s}){let a=r.variant==="circle"?"":Db(r,n);return l("button",{ref:e,type:"button",class:`${Da}-fab`,part:"launcher","data-variant":r.variant,"data-size":r.size,"data-edge-tab":s?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":q.launcher,onClick:t,"aria-label":n.launcherOpen,children:[qb(r.icon),a?l("span",{class:`${Da}-fab-label`,children:a}):null]})}function Db(e,t){return e.label?gt(t,e.label):e.personaName?t.launcherAsk.replace("{name}",gt(t,e.personaName)):""}function qb(e){let t=af[e];return t?l(t,{}):l(Ub,{source:e})}function Ub({source:e}){return l("span",{ref:t=>{t&&Bb(t,e)},"aria-hidden":"true"})}function Bb(e,t){if(e.dataset.svgMounted!==t)try{let n=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;n.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(n,!0)),e.dataset.svgMounted=t)}catch{}}function lf({callout:e,launcherPosition:t,strings:r,closeLabel:n,onDismiss:o}){let[s,a]=U(!1),i=B(null),[c,u]=U(!0);return St(()=>{let p=i.current?.parentElement;if(!p)return;let _=()=>u(window.innerWidth-p.getBoundingClientRect().width>=zb);return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)}),H(()=>{let p=setTimeout(()=>a(!0),e.delayMs);return()=>clearTimeout(p)},[e.delayMs]),H(()=>{if(!s||e.autoDismissMs<=0)return;let p=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(p)},[s,e.autoDismissMs,o]),s?l("div",{ref:i,class:`${Da}-callout`,role:"status","data-shape":e.shape,"data-position":Hb(e.position,t,c),"data-animated":e.animated?"true":void 0,"data-testid":q.callout,children:[l("span",{children:gt(r,e.text)}),l("button",{type:"button",class:`${Da}-callout-close`,onClick:o,"aria-label":n,title:n,"data-testid":q.calloutDismiss,children:l(Bt,{})})]}):null}var zb=200;function Hb(e,t,r=!0){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"||e==="auto"&&!r?o?"top":"bottom":n?"left":"right"}var Fb='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Jn(e){function t(r){if(r.key!=="Tab")return;let n=[...e.querySelectorAll(Fb)].filter(c=>c.offsetParent!==null||c===document.activeElement);if(n.length===0){r.preventDefault();return}let o=n[0],s=n[n.length-1];if(!o||!s)return;let a=e.getRootNode(),i=a instanceof ShadowRoot?a.activeElement:null;r.shiftKey&&i===o?(r.preventDefault(),s.focus()):!r.shiftKey&&i===s&&(r.preventDefault(),o.focus())}return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var Hr=D.cssPrefix;function qa({title:e,actions:t}){return l("header",{class:`${Hr}-back-header`,part:"header","data-variant":"title",children:[l("span",{class:`${Hr}-back-spacer`,"aria-hidden":"true"}),l("h1",{class:`${Hr}-back-title`,children:e}),t??l("span",{class:`${Hr}-back-spacer`,"aria-hidden":"true"})]})}function cf({title:e,backLabel:t,onBack:r,actions:n,testid:o}){return l("header",{class:`${Hr}-back-header`,part:"header","data-testid":o,children:[l("button",{type:"button",class:`${Hr}-icon-btn`,onClick:r,"aria-label":t,title:t,children:l(Go,{})}),l("h1",{class:`${Hr}-back-title`,children:e}),n??l("span",{class:`${Hr}-back-spacer`,"aria-hidden":"true"})]})}function Jo({textSig:e,doneSig:t,generativeUi:r=!1,strings:n=Pi,onCardAction:o}){let s=B(null),a=B(null);return St(()=>{let i=s.current;if(!i)return;i.classList.add(`${D.cssPrefix}-md`);let c=a.current,u={generativeUi:r,strings:n,onCardAction:o},p=()=>{a.current?.renderer?.dispose();let g=document.createElement("div"),y=r?Yp(g,{cssPrefix:D.cssPrefix,strings:n,onAction:o}):void 0,b=Eo(tP(iP(y??na(g)))),P=e.value,w=P.length;if(!t.value)for(;w>0&&P[w-1]==="_";)w--;let x=mc(P.slice(0,w));return x&&ot(b,x),t.value&&(Bn(b),y?.finish()),i.replaceChildren(g),{settings:u,container:g,parser:b,renderer:y,lastLen:w,lastText:P.slice(0,w)}},_=c&&c.settings.generativeUi===r&&c.settings.strings===n&&c.settings.onCardAction===o&&e.value.startsWith(c.lastText)?c:p();a.current=_;let d=nr(()=>{let g=e.value,y=t.value;if(g.length<_.lastLen){_=p(),a.current=_;return}let b=g.length;if(!y)for(;b>_.lastLen&&g[b-1]==="_";)b--;let P=Math.max(_.lastLen-1,0),w=mc(g.slice(P,b)).slice(_.lastLen-P);w&&ot(_.parser,w),_.lastLen=b,_.lastText=g.slice(0,b),y&&(Bn(_.parser),_.renderer?.finish())}),f=new MutationObserver(()=>df(i));f.observe(i,{childList:!0,subtree:!0}),df(i);function v(g){let y=g.target instanceof Element?g.target.closest("a"):null;if(!y||!(y instanceof HTMLAnchorElement))return;let b=y.getAttribute("href")??"";!b||b.startsWith("#")||(g.preventDefault(),window.open(b,"_blank","noopener,noreferrer"))}return i.addEventListener("click",v),()=>{d(),f.disconnect(),i.removeEventListener("click",v)}},[e,t,r,n,o]),H(()=>()=>{a.current?.renderer?.dispose(),a.current=null},[]),l("div",{ref:s})}function Ba({text:e}){let t=ke(()=>ae(e),[e]),r=ke(()=>ae(!0),[]);return l(Jo,{textSig:t,doneSig:r})}var Ua="\uE000",eP=/([\p{L}\p{N}])(_+)(?=[\p{L}\p{N}])/gu;function mc(e){return e.replace(eP,(t,r,n)=>r+Ua.repeat(n.length))}function tP(e){return{...e,add_text:(t,r)=>e.add_text(t,r.replaceAll(Ua,"_")),set_attr:(t,r,n)=>e.set_attr(t,r,n.replaceAll(Ua,"_"))}}var rP=/<(\/?)(?:(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 pf(e){let t=0,r="";return e.replace(rP,(n,o,s,a,i,c,u,p)=>{if(o===void 0)return t?c+(p?.split(`
61
61
  ${u}`).join(`
62
62
  `)??r):n;if(o)return t--,s&&(r=r.slice(2)),s?`
63
- ${r}`:"";a||(t++,s&&(r+="> "));let _={};i.replace(/(\w+)=(["'])(.*?)\2/g,(v,g,P,b)=>_[g]=b);let d=_.href??_.src,f=_.title??_.path??_.query??_.body??_.header??_.name??d;return(s?"> ":"")+(f?`**${d?`[${f}](${d})`:f}**${_.type?` \`${_.type}\``:""}
64
- ${r}`:"")})}var qb=new Set(["http:","https:","mailto:","tel:"]),Ub=new Set(["http:","https:"]);function Bb(e){let t=document.createElement("a");return{...e,set_attr:(r,n,o)=>{if(n!==Bn&&n!==Ro||(t.href=o,(n===Bn?qb:Ub).has(t.protocol)))return e.set_attr(r,n,o);let s=n===Ro?r.nodes[r.index]:void 0;s?.replaceWith(...s.childNodes)}}}function rf(e){for(let t of e.querySelectorAll("a")){let r=t.getAttribute("href")??"";!r||r.startsWith("#")||(t.target="_blank",t.rel="noopener noreferrer")}}var nf=new Set([11,12,13,14,15,16,17,18,19,31]);function Fi(e){let t="",r=[],n=Mo({data:void 0,add_token:(o,s)=>{r.push(s),nf.has(s)||(t+=" ")},end_token:()=>{let o=r.pop();o!==void 0&&!nf.has(o)&&(t+=" ")},add_text:(o,s)=>{t+=s},set_attr:()=>{}});return it(n,gc(e)),zn(n),t.replaceAll(zi,"_").replace(/\s+/g," ").trim()}var af=q.cssPrefix;function jt({tone:e="info",message:t,onRetry:r,strings:n}){return l("div",{class:`${af}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[l("span",{children:t}),r?l("button",{type:"button",class:`${af}-module-retry`,onClick:r,children:n.errorRetry}):null]})}var Vr=q.cssPrefix,zb=te.scope("content"),Hb=5e3;function sf({id:e,title:t,transport:r,strings:n,bus:o,onBack:s,actions:i}){let[a,c]=U(null),[u,p]=U(!1),[_,d]=U(!1),[f,v]=U(0),[g,P]=U(null),b=F(()=>{d(!1),c(null),v(k=>k+1)},[]);H(()=>{let k=!1,h=r.listContentCollections([]).catch(()=>{});return Promise.all([r.listContent({ids:[e],limit:1}),h]).then(([m,w])=>{if(k)return;let A=m.items[0];A?(c(A),p(w?.items.find(I=>I.id===A.contentCollectionId)?.settings?.voteAccess==="portal"),o.emit("contentOpen",{contentId:e,contentCollectionId:A.contentCollectionId})):d(!0)}).catch(m=>{k||(zb.warn("listContent (reader) failed",{err:m}),d(!0))}),()=>{k=!0}},[r,e,f,o]),H(()=>{if(!a)return;let k=setTimeout(()=>o.emit("contentRead",{contentId:e}),Hb);return()=>clearTimeout(k)},[a,e,o]);let y=F(k=>{let m=(k.target instanceof HTMLElement?k.target.closest("a"):null)?.getAttribute("href")??"";m&&!m.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function x(k){P(e),r.setContentVote({contentId:e,value:k})}function S(){return _?l(jt,{tone:"error",message:n.errorGeneric,onRetry:b,strings:n}):a===null?l(jt,{message:n.contentLoading,strings:n}):l("article",{class:`${Vr}-content`,"data-testid":D.contentView,onClick:y,children:[a.image?l("img",{class:`${Vr}-content-hero`,src:a.image,alt:"",loading:"lazy"}):null,a.description?l("p",{class:`${Vr}-content-subtitle`,children:a.description}):null,l(Hi,{text:of(a.content??"")}),u?l("div",{class:`${Vr}-content-vote`,"aria-live":"polite",children:g===e?n.feedbackThanks:l(ge,{children:[l("span",{children:n.contentHelpful}),l("button",{type:"button",class:`${Vr}-module-retry`,onClick:()=>x(1),children:n.confirmYes}),l("button",{type:"button",class:`${Vr}-module-retry`,onClick:()=>x(0),children:n.confirmNo})]})}):null]})}return l("div",{class:`${Vr}-module`,children:[l(tf,{title:a?.title||t||n.moduleBack,backLabel:n.moduleBack,onBack:s,actions:i,testid:D.backHeader}),l("div",{class:`${Vr}-module-scroll`,"data-testid":D.contentScroll,children:S()})]})}function lf({itemCount:e,initialFocusIndex:t}){let[r,n]=U(!1),o=B(null),s=B(null),[i,a]=U(-1),c=F(()=>{n(!1),a(-1),o.current?.focus()},[]),u=F(()=>n(d=>!d),[]);H(()=>{if(!r)return;function d(f){let v=s.current,g=o.current;if(!v||!g)return;let P=f.composedPath();P.includes(v)||P.includes(g)||(n(!1),a(-1))}return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[r]),H(()=>{if(!r||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;a(f)},[r,e,t]),H(()=>{if(!r||i<0)return;s.current?.querySelectorAll("[role='menuitem']")?.[i]?.focus()},[r,i]);let p=F(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n(!0))},[]),_=F(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),d.stopPropagation(),c();return;case"ArrowDown":d.preventDefault(),a(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),a(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),a(0);return;case"End":d.preventDefault(),a(e-1)}},[e,c]);return{open:r,focusIndex:i,triggerRef:o,menuRef:s,toggle:u,close:c,onTriggerKey:p,onMenuKey:_}}function cf({items:e,triggerLabel:t}){let r=q.cssPrefix,n=lf({itemCount:e.length});function o(a){a.disabled||(a.onSelect?.(),a.keepOpen||n.close())}function s(a,c){return a.onSelectValue?.(c)}function i(a,c){let u=c.segments;if(!u?.length)return;let p=Math.max(0,u.findIndex(f=>f.value===c.value)),_=-1;if(a.key==="ArrowRight"||a.key==="Enter"||a.key===" ")_=(p+1)%u.length;else if(a.key==="ArrowLeft")_=(p-1+u.length)%u.length;else return;let d=u[_];d&&(a.preventDefault(),a.stopPropagation(),s(c,d.value))}return l("div",{class:`${r}-menu-wrap`,children:[l("button",{ref:n.triggerRef,type:"button",class:`${r}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":n.open,title:t,onClick:n.toggle,onKeyDown:n.onTriggerKey,children:l(O_,{})}),n.open?l("div",{ref:n.menuRef,class:`${r}-menu`,role:"menu","aria-label":t,onKeyDown:n.onMenuKey,tabIndex:-1,children:e.map(a=>a.segments?l("div",{role:"menuitem",class:`${r}-menu-item ${r}-menu-item-segmented`,"aria-label":a.label,tabIndex:-1,onKeyDown:c=>i(c,a),children:[a.icon?l("span",{class:`${r}-menu-icon`,children:a.icon}):null,l("span",{class:`${r}-menu-label`,children:a.label}),l("span",{class:`${r}-segmented`,role:"group","aria-label":a.label,children:a.segments.map(c=>{let u=c.value===a.value;return l("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${r}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${D.langSegment}-${c.value}`,onClick:()=>s(a,c.value),children:c.label},c.value)})})]},a.id):l("button",{type:"button",role:"menuitem",class:`${r}-menu-item`,"aria-pressed":a.type==="switch"?a.on:void 0,disabled:a.disabled,onClick:()=>o(a),children:[a.icon?l("span",{class:`${r}-menu-icon`,children:a.icon}):null,l("span",{class:`${r}-menu-label`,children:a.label}),a.type==="switch"&&a.on?l("span",{class:`${r}-menu-check`,"aria-hidden":"true",children:l(Yn,{})}):null]},a.id))}):null]})}var vc=q.cssPrefix;function Fb(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 jb={normal:"large",large:"small",small:"normal"};function Vb(e){return e==="light"?l(j_,{}):e==="dark"?l(V_,{}):l(W_,{})}function Wb(e,t){let r=e.split("-")[0];return(t.some(o=>o!==e&&o.split("-")[0]===r)?e:r??e).toUpperCase()}function Gb(e,t){let r;try{r=new URL(e,window.location.href)}catch{return}if(!(r.protocol!=="http:"&&r.protocol!=="https:"))return t.conversationId&&r.searchParams.set("chat",t.conversationId),r.searchParams.set("widgetId",t.widgetId),t.publicKey&&r.searchParams.set("public_key",t.publicKey),r.searchParams.set("ai_agent_deployment_id",t.aiAgentDeploymentId),r.href}function ur({panelProps:e,variant:t,onEmailTranscript:r,onLogIn:n}){let{options:o,panelSize:s,feedback:i,onClose:a,onClear:c,onExpand:u,onFullscreen:p,onSoundToggle:_}=e,{onToggleHistory:d,onLocaleChange:f,onThemeChange:v,onTextSizeChange:g}=e,P=o.strings,b=o.mode,y=t==="chat",x=It(()=>i.mutedSig.value).value,S=new Set(o.actions);function k(z){return S.has(z)}let h=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches;function m(z){return h?!1:Gn(z,b,s)}let w=o.themeMode,A={auto:P.themeAuto,light:P.themeLight,dark:P.themeDark},I=o.textSize,R={small:P.textSizeSmall,normal:P.textSizeNormal,large:P.textSizeLarge},C=[];if(y&&k("clear")&&C.push({id:"clear",icon:l(z_,{}),label:P.newConversation,onSelect:c}),y&&r&&C.push({id:"emailTranscript",icon:l(Oi,{}),label:P.emailTranscript,onSelect:r}),y&&n&&C.push({id:"logIn",icon:l(Cr,{}),label:P.loginAction,onSelect:n}),k("expand")&&m("expand")){let z=s==="expanded";C.push({id:"expand",icon:z?l(R_,{}):l(A_,{}),label:z?P.collapse:P.expand,type:"switch",on:z,onSelect:u})}if(k("fullscreen")&&m("fullscreen")){let z=s==="fullscreen";C.push({id:"fullscreen",icon:z?l(M_,{}):l(E_,{}),label:z?P.exitFullscreen:P.fullscreen,type:"switch",on:z,onSelect:p})}let M=o.popOutUrl,N=o.aiAgentDeploymentId;k("popOut")&&M&&N&&Gn("popOut",b,s)&&C.push({id:"popOut",icon:l(L_,{}),label:P.popOut,onSelect:()=>{let z=Gb(M,{conversationId:e.conversationId,widgetId:o.widgetId,publicKey:o.publicKey,aiAgentDeploymentId:N});z&&window.open(z,"_blank","noopener,noreferrer")}}),y&&k("sound")&&C.push({id:"sound",icon:x?l(D_,{}):l($_,{}),label:x?P.soundOff:P.soundOn,type:"switch",on:!x,onSelect:_}),k("theme")&&w!=="host"&&C.push({id:"theme",icon:Vb(w),label:`${P.theme}: ${A[w]}`,onSelect:()=>v(Fb(w)),keepOpen:!0}),k("textSize")&&C.push({id:"textSize",icon:l(q_,{}),label:`${P.textSize}: ${R[I]}`,onSelect:()=>g(jb[I]),keepOpen:!0}),k("language")&&o.availableLocales.length>1&&C.push({id:"language",icon:l(B_,{}),label:P.language,segments:o.availableLocales.map(z=>({value:z,label:Wb(z,o.availableLocales),lang:z})),value:o.locale,onSelectValue:f});let j=!!a&&Ri(b,s,o.actions),G=y&&k("history");return l("div",{class:`${vc}-header-actions`,children:[G?l("button",{type:"button",class:`${vc}-icon-btn`,onClick:d,"aria-label":P.history,title:P.history,"data-testid":D.actionHistory,children:l(U_,{})}):null,C.length>0?l(cf,{items:C,triggerLabel:P.moreActions}):null,j?l("button",{type:"button",class:`${vc}-icon-btn`,onClick:a,"aria-label":P.close,title:P.close,"data-testid":D.actionClose,children:l(Bt,{})}):null]})}var df={Icon:Qo};function Ir(e,t){return e instanceof qe?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 Zn=q.cssPrefix;function uf({placeholder:e,onActivate:t}){return l("button",{type:"button",class:`${Zn}-home-search`,onClick:t,"data-testid":D.homeSearch,children:[l("span",{class:`${Zn}-home-search-text`,children:e}),l("span",{class:`${Zn}-home-search-icon`,"aria-hidden":"true",children:l(mc,{})})]})}function pf({placeholder:e,value:t,onInput:r}){return l("div",{class:`${Zn}-home-search`,"data-input":"true",children:[l("input",{type:"search",class:`${Zn}-home-search-input`,placeholder:e,value:t,maxLength:200,onInput:n=>r(n.currentTarget.value),"data-testid":D.helpSearch}),l("span",{class:`${Zn}-home-search-icon`,"aria-hidden":"true",children:l(mc,{})})]})}var Xo=q.cssPrefix;function ji({title:e,subtitle:t,onClick:r,testid:n}){return l("button",{type:"button",class:`${Xo}-list-row`,onClick:r,"data-testid":n,children:[l("span",{class:`${Xo}-list-row-body`,children:[l("span",{class:`${Xo}-list-row-title`,children:e}),t?l("span",{class:`${Xo}-list-row-sub`,children:t}):null]}),l("span",{class:`${Xo}-list-row-chevron`,"aria-hidden":"true",children:l(Li,{})})]})}var pr=q.cssPrefix,Kb=te.scope("help"),Qb=20,Yb=300;function Xb(e,t,r){let n=new Map(r.map(o=>[o.id,o.title]));return t.map(o=>({id:o,title:n.get(o),rows:e.filter(s=>s.contentCollectionId===o)})).filter(o=>o.rows.length>0)}function _f({transport:e,strings:t,bus:r},n,o){let[s,i]=U(),a=B(void 0),c=n?.join(",");function u(p){if(!n?.length)return;let _={};a.current=_,i(d=>({search:o,items:[],collections:[],...d,pagination:p>1?d?.pagination:void 0,loading:!0,error:void 0})),Promise.all([e.listContent({contentCollectionIds:n,sortBy:"order",page:p,limit:Qb,search:o}),p>1?void 0:e.listContentCollections(n)]).then(([d,f])=>{a.current===_&&(i(v=>({search:o,items:[...p>1?v?.items??[]:[],...d.items],collections:f?.items??v?.collections??[],pagination:d.pagination,loading:!1})),!(p>1)&&(o?r.emit("contentSearch",{queryLength:o.length,hitCount:d.pagination.total}):r.emit("contentView",{section:"help",count:d.items.length})))}).catch(d=>{a.current===_&&(Kb.warn("listContent (help) failed",{err:d,page:p}),i(f=>f&&{...f,loading:!1,error:Ir(d,t)}))})}return H(()=>{if(!n?.length){i(void 0);return}return u(1),()=>{a.current=void 0}},[e,c,o]),[s,()=>!s?.loading&&u((s?.pagination?.page??0)+1)]}function Jb(e){let{strings:t,config:r,nav:n,panelProps:o}=e,s=r.contentCollectionIds,[i,a]=U(""),[c,u]=U(""),p=_f(e,s),_=_f(e,c?s:void 0,c),[d,f]=i.trim()?_:p;H(()=>{let g=setTimeout(()=>u(i.trim()),Yb);return()=>clearTimeout(g)},[i]);function v(){if(!s?.length)return l(jt,{message:t.helpEmpty,strings:t});let g=d?.error?l(jt,{tone:"error",message:d.error,onRetry:f,strings:t}):null;return g&&!d?.pagination?g:!d||!d.pagination&&!d.items.length?l(jt,{message:t.helpLoading,strings:t}):d.items.length?l(ge,{children:[Xb(d.items,s,d.collections).map(P=>l("section",{class:`${pr}-help-group`,children:[P.title?l("h2",{class:`${pr}-help-section-title`,children:P.title}):null,l("div",{class:`${pr}-help-card`,children:P.rows.map(b=>l(ji,{title:b.title,subtitle:b.description,onClick:()=>b.url?Vo(b.url):n.push({kind:"content",id:b.id,title:b.title}),testid:Ct(D.helpArticle,b.id)},b.id))})]},P.id)),g,d.pagination?.hasNext&&!g?l("div",{children:l("div",{class:`${pr}-help-card`,children:l("button",{type:"button",class:`${pr}-list-row ${pr}-help-more`,onClick:f,"aria-busy":d.loading,children:[d.loading?l("span",{class:`${pr}-loading-spinner`,"aria-hidden":"true"}):null,t.helpShowMore]})})}):null]}):l(jt,{message:d.search?t.helpSearchEmpty.replace("{query}",d.search):t.helpEmpty,strings:t})}return l("div",{class:`${pr}-module`,children:[l(Bi,{title:t.helpTitle,actions:l(ur,{panelProps:o,variant:"plain"})}),l("div",{class:`${pr}-module-pad`,children:l(pf,{placeholder:t.helpSearchPlaceholder,value:i,onInput:a})}),l("div",{class:`${pr}-help-list`,children:v()})]})}var ff={Icon:Ko,Root:e=>l(Jb,{...e})};var mf=te.scope("attachments");function Vi(e,t,r){let n=eP(e),o=[],s=[],i=vf(r.accept),a=t.reduce((u,p)=>u+p.size,0),c=t.length;for(let u of n){let p=Zb(u,c,a,r,i);if(p){s.push({file:u,reason:p});continue}o.push(oP(u)),a+=u.size,c+=1}return(o.length||s.length)&&mf.debug("ingest",{accepted:o.length,rejected:s.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:s}}function eo(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 gf(e,t){let r=vf(t);return!e||r.length===0||r.some(n=>n.kind==="ext"||hf(new File([],"",{type:e}),[n]))}function to(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){mf.debug("revokeObjectURL failed",{error:t})}}function Zb(e,t,r,n,o){return t>=n.maxCount?"count":r+e.size>n.maxBytes?"bytes":hf(e,o)?null:"mime"}function eP(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:tP(t)).filter(t=>t!==null):[]}function tP(e){let t=rP(e)?e:null;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function rP(e){return nP(e)&&(e.getAsFile===void 0||typeof e.getAsFile=="function")}function nP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function oP(e){return{file:e,id:Wt(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function vf(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[r="*",n="*"]=t.split("/");return{kind:"mime",type:r,subtype:n}})}function hf(e,t){if(t.length===0)return!0;let[r="*",n="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(s=>s.kind==="ext"?o.endsWith(s.ext):s.type==="image"&&s.subtype==="*"&&/\.(heic|heif|avif|bmp|tif|tiff)$/.test(o)?!0:(s.type==="*"||s.type===r)&&(s.subtype==="*"||s.subtype===n))}var Wr=q.cssPrefix,aP={error:Xn,done:Yn};function yf({attachment:e,upload:t,strings:r,onRemove:n,disabled:o=!1}){let s=/^image\/(jpeg|png|gif|webp|avif|bmp|x-ms-bmp|svg\+xml)$/i.test(e.mediaType),i=Math.round((t?.fraction??0)*100),a=eo(e.size),c=t?.status==="error"||t?.status==="done"?aP[t.status]:void 0;return l("span",{class:`${Wr}-attachment-chip`,"data-upload":t?.status,title:e.name,"data-testid":Ct(D.attachmentChip,e.id),children:[s?l("img",{class:`${Wr}-attachment-thumb`,src:e.previewUrl,alt:""}):l("span",{class:`${Wr}-attachment-thumb`,"aria-hidden":"true",children:l($i,{})}),l("span",{class:`${Wr}-attachment-text`,children:[l("span",{class:`${Wr}-attachment-name`,children:e.name}),l("span",{class:`${Wr}-attachment-meta`,children:[c?l(c,{}):null,t?.status==="uploading"?`${i}% \xB7 ${a}`:a]})]}),l("button",{type:"button",class:`${Wr}-attachment-remove`,onClick:n,disabled:o,"aria-label":r.removeAttachment.replace("{name}",e.name),"data-testid":Ct(D.attachmentRemove,e.id),children:l(Bt,{})}),t?.status==="uploading"?l("span",{class:`${Wr}-attachment-progress`,role:"progressbar","aria-label":e.name,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,children:l("span",{style:{width:`${i}%`}})}):null]})}var bf=new WeakMap;function Wi(e){e.currentTarget&&bf.set(e.currentTarget,e.timeStamp)}function Gi(e){let t=e.currentTarget?bf.get(e.currentTarget):void 0;return e.isComposing||t!==void 0&&e.timeStamp-t<100}var Ki=q.cssPrefix;function Jo({text:e,retryLabel:t,onRetry:r,retryTestId:n}){return l("div",{class:`${Ki}-error`,role:"alert",children:[l("span",{class:`${Ki}-error-icon`,"aria-hidden":"true",children:l(Xn,{})}),l("span",{class:`${Ki}-error-text`,children:e}),r&&t?l("button",{type:"button",class:`${Ki}-error-retry`,onClick:r,"data-testid":n,children:t}):null]})}var hc={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function yc(e,t,r){return e==="disabled"?hc:e==="server"?cP(r):iP(t)}function iP(e){let t=sP();if(!t)return hc;let r=null,n=0;return{isSupported:!0,start(o,s){let i=r,a=++n;r=null,i?.abort();let c=new t;r=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",_=>{if(n!==a||r!==c)return;let d=_,f="",v=!1;for(let g=d.resultIndex;g<d.results.length;g++){let P=d.results[g];P&&(f+=P[0].transcript,P.isFinal&&(v=!0))}o(f,v)});function p(_){u||n!==a||r!==c||(u=!0,r=null,s(_))}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(){r?.stop()},cancel(){n++;let o=r;r=null,o?.abort()}}}function sP(){return window.SpeechRecognition??window.webkitSpeechRecognition}var lP=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function cP(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return hc;let t=0,r=null;function n(i){for(let a of i.stream?.getTracks()??[])a.stop();i.stream=null}function o(){t++;let i=r;r=null,i&&(n(i),i.recorder?.state!=="inactive"&&i.recorder?.stop())}async function s(i){if(i.finishing)return;i.finishing=!0;let a=i.recorder?.mimeType??"audio/webm";n(i);let c=new Blob(i.chunks,{type:a});i.chunks=[];try{let{text:u}=await e(c,a);r===i&&t===i.generation&&u&&i.onText(u,!0)}catch{}finally{r===i&&t===i.generation&&(r=null,i.onEnd(!1))}}return{isSupported:!0,async start(i,a){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:i,onEnd:a,finishing:!1};r=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(r!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let p=dP(),_=new MediaRecorder(u,p?{mimeType:p}:void 0);c.recorder=_,_.addEventListener("dataavailable",d=>{r===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),_.addEventListener("stop",()=>{r===c&&t===c.generation&&s(c)}),_.start()}catch(u){n(c),r===c&&t===c.generation&&(r=null,a(u instanceof DOMException&&u.name==="NotAllowedError"))}},stop(){let i=r;if(i){if(!i.recorder){o();return}i.recorder.state!=="inactive"&&i.recorder.stop()}},cancel(){o()}}}function dP(){for(let e of lP)if(MediaRecorder.isTypeSupported(e))return e}function uP(e,{file:t,reason:r},n){return r==="count"?e.attachmentTooMany.replace("{count}",String(n.maxCount)):r==="bytes"?e.attachmentTooLarge.replace("{name}",t.name).replace("{max}",eo(n.maxBytes)):e.attachmentMimeRejected.replace("{name}",t.name)}var Xe=q.cssPrefix,ro=te.scope("composer"),pP=300;function no(e){return e.reduce((t,r)=>t+r.size,0)}var bc={arrowUp:C_,paperPlane:k_,send:T_,chevron:Li};function Pf(e){return"activeElement"in e}function _P(e){return"host"in e&&"activeElement"in e}function fP(e){return"clipboardData"in e}function xf({options:e,transport:t,feedback:r,bus:n,persistence:o,conversationId:s,maxMessageCharacters:i,isStreaming:a,pageToolRunning:c=!1,isMemoryCompacting:u=!1,canReleaseQueuedMessages:p=!0,queueManualMessages:_=!1,replyAwaitsCard:d=!1,active:f=!0,isPreparing:v=!1,attachmentUploadsSig:g,operatorRequestEnabled:P,canRequestOperator:b=!1,controlMode:y="ai-agent",onRequestOperator:x,onSend:S,onStop:k,apiRef:h}){let m=e.strings,[w,A]=U(()=>o.loadDraft(s)),[I,R]=U([]),[C,M]=U(),[N,j]=U(()=>o.loadMessageQueue(s).map(V=>({id:V.id,text:V.text,attachments:[]}))),G=B(N),z=B(!1),le=B(void 0),[ue,_e]=U(!1),[ae,he]=U(!1),[Je,bt]=U(!1),[Ve,At]=U(!1),Le=B(!1),Ze=B(null),ye=B(null),Oe=B(null),Ue=B(0),Tt=B(s);Tt.current=s;let Rt=B(f);Rt.current=f;let Ie=B(v);Ie.current=v;let ze=Ve||v||!f,Re=a&&y==="ai-agent",Pt=Re||u&&y==="ai-agent",$=y==="ai-agent"&&(Pt||_||N.length>0),L=F(V=>{j(X=>{let Q=V(X);return o.saveMessageQueue(Tt.current,Q.filter(fe=>fe.attachments.length===0).map(({id:fe,text:$e})=>({id:fe,text:$e}))),G.current=Q,Q})},[o]),Y=F(V=>{L(X=>(X.find(Q=>Q.id===V)?.attachments.forEach(to),X.filter(Q=>Q.id!==V)))},[L]),K=F(V=>{A(X=>{let Q=(typeof V=="function"?V(X):V).slice(0,i);return Q===X?X:(o.saveDraft(Tt.current,Q),Q)})},[o,i]),re=e.features.fileUpload,be=e.features.voice,[ce,Pe]=U(()=>yc(be,e.locale,(V,X)=>t.transcribe(V,X))),lt=B(ce);lt.current=ce;let He=B({mode:be,locale:e.locale,transport:t});H(()=>{let V=He.current;V.mode===be&&V.locale===e.locale&&V.transport===t||(He.current={mode:be,locale:e.locale,transport:t},Ue.current++,lt.current.cancel(),Oe.current=null,he(!1),Pe(yc(be,e.locale,(X,Q)=>t.transcribe(X,Q))))},[e.locale,be,t]),St(()=>()=>{Ue.current++,ce.cancel()},[ce]);let pt=F(V=>{let X=Oe.current;if(X===null)return!1;let Q=Math.round(performance.now()-X);return ro[V]("voiceStop",{durationMs:Q}),n.emit("voiceStop",{durationMs:Q}),Oe.current=null,!0},[n]),We=F(()=>{Oe.current!==null&&(ce.stop(),he(!1),pt("info")&&r.play("voiceStop"))},[pt,r,ce]),Lt=F(()=>{Ue.current++,ce.cancel(),he(!1),pt("info")&&r.play("voiceStop")},[pt,r,ce]);H(()=>{(v||!f)&&Lt()},[f,Lt,v]),H(()=>{let V=Ze.current;if(!V)return;let X=V.getRootNode(),Q=Pf(X)?X.activeElement:null;Q&&V.closest(`.${Xe}-panel`)?.contains(Q)||V.focus({preventScroll:!0})},[]),H(()=>{let V=Ze.current;if(!V)return;if(w.length===0){V.style.height="";return}V.style.height="auto";let X=getComputedStyle(V),Q=Number.parseFloat(X.getPropertyValue(`--${Xe}-textarea-base-height`)),fe=Number.parseFloat(X.borderTopWidth)+Number.parseFloat(X.borderBottomWidth),$e=Math.min(V.scrollHeight+fe,Number.parseFloat(X.maxHeight)),Et=Number.parseFloat(X.fontSize)*.7;V.style.height=`${$e<Q+Et?Q:$e}px`},[w]);let Vt=B(I);Vt.current=I,H(()=>()=>{Vt.current.forEach(to);for(let V of G.current)V.attachments.forEach(to)},[]),St(()=>{if(h)return h.current={attachFromDrop:V=>{if(!re||!Rt.current||Le.current||Ie.current)return;let X=Vi(V,Vt.current,e.attachments);M(X.rejected[0]),X.accepted.length!==0&&(ro.info("attach (drop)",{count:X.accepted.length,totalBytes:no(X.accepted)}),n.emit("attach",{count:X.accepted.length,totalBytes:no(X.accepted)}),R(Q=>[...Q,...X.accepted]))},fill:V=>{if(!Rt.current||Le.current||Ie.current)return;K(V);let X=Ze.current;X&&(X.focus({preventScroll:!0}),requestAnimationFrame(()=>X.setSelectionRange(X.value.length,X.value.length)))},acceptQueuedMessage:Y},()=>{h.current&&(h.current=null)}},[h,re,v,e.attachments,Y,K]),H(()=>{let V=Ze.current;if(!V)return;let X=V.closest(`.${Xe}-panel`);if(!X)return;let Q=$e=>{if(!Rt.current||Le.current||Ie.current)return;let Et=$e.clipboardData;if(!Et)return;let _r=$e.target instanceof HTMLElement?$e.target.closest("input, textarea, [contenteditable]:not([contenteditable='false'])"):null;if(_r&&_r!==V)return;if(re){let zt=Vi(Et.items,Vt.current,e.attachments);if(M(zt.rejected[0]),zt.accepted.length>0){$e.preventDefault(),ro.info("attach (paste)",{count:zt.accepted.length,totalBytes:no(zt.accepted)}),n.emit("attach",{count:zt.accepted.length,totalBytes:no(zt.accepted)}),R(bs=>[...bs,...zt.accepted]);return}}if(_r===V)return;let fr=Et.getData("text/plain");fr&&($e.preventDefault(),K(zt=>zt+fr),V.focus())};function fe($e){fP($e)&&Q($e)}return X.addEventListener("paste",fe),()=>X.removeEventListener("paste",fe)},[re,e.attachments,K]);async function Xt(){let V=w.trim();if(!V&&I.length===0||!f||Re||Le.current||v)return;Lt(),Le.current=!0,At(!0);let X=w,Q=I;try{await S(V,Q)&&(M(void 0),K(fe=>fe===X?"":fe),R(fe=>fe!==Q?fe:(Q.forEach(to),Vt.current=[],[])))}finally{Le.current=!1,At(!1),requestAnimationFrame(()=>{let fe=Ze.current;if(!fe||fe.disabled||!Rt.current)return;let $e=fe.getRootNode(),Et=Pf($e)?$e.activeElement:null,_r=Et?.getAttribute("data-testid");if(!(Et&&Et!==fe&&_r!==D.composerSend&&_r!==D.composerStop)){if(_P($e)){let fr=$e.host.ownerDocument;if(!fr.hasFocus())return;let zt=fr.activeElement;if(zt&&zt!==$e.host&&zt!==fr.body)return}fe.focus({preventScroll:!0})}})}}function _t(){let V=w.trim();if(!V&&I.length===0||!f||!$||Le.current||v)return;Lt();let X=I;L(Q=>[...Q,{id:Wt(),text:V,attachments:X}]),Pt||_e(!0),K(""),R(Q=>Q!==X?Q:(Vt.current=[],[])),Ze.current?.focus({preventScroll:!0})}H(()=>{Pt&&(z.current=!1,le.current=void 0,_e(!1))},[Pt]),H(()=>{let V=N[0];if(!V||!p||Pt||z.current||Ve||v||!f)return;let X=d&&!ue?(le.current??(le.current=performance.now()+e.cardAnswerWaitSeconds*1e3))-performance.now():0,Q=setTimeout(()=>{z.current=!0,S(V.text,V.attachments,V.id).then(fe=>{if(fe){Y(V.id);return}z.current=!1})},Math.max(X,pP));return()=>clearTimeout(Q)},[f,p,ue,v,S,e.cardAnswerWaitSeconds,Pt,N,Y,d,Ve]);function xt(V){V.key!=="Enter"||V.shiftKey||Gi(V)||(V.preventDefault(),$&&(w.trim()||I.length>0)?_t():Re?k():Xt())}function Jt(V){if(!(V.target instanceof HTMLInputElement))return;let X=V.target;if(!f||Le.current||v){X.value="";return}let Q=Vi(X.files,I,e.attachments);M(Q.rejected[0]),Q.accepted.length>0&&(ro.info("attach (file picker)",{count:Q.accepted.length,totalBytes:no(Q.accepted)}),n.emit("attach",{count:Q.accepted.length,totalBytes:no(Q.accepted)}),R(fe=>[...fe,...Q.accepted])),X.value=""}function Pn(V){!f||Le.current||v||(ro.info("removeAttachment",{id:V}),n.emit("removeAttachment",{id:V}),M(void 0),R(X=>{let Q=X.find(fe=>fe.id===V);return Q&&to(Q),X.filter(fe=>fe.id!==V)}))}function xn(){if(ae){We();return}if(!f||!ce.isSupported||Le.current||v)return;let V=++Ue.current;Oe.current=performance.now(),ro.info("voiceStart"),n.emit("voiceStart",void 0),bt(!1),he(!0),r.play("voiceStart"),ce.start((X,Q)=>{Ue.current!==V||!Rt.current||Ie.current||Le.current||!Q||K(fe=>`${fe}${X} `)},X=>{Ue.current!==V||!Rt.current||(he(!1),bt(X),pt("debug"))})}let Kr=bc[e.composer.sendButton.icon],Sn=!!(w.trim()||I.length>0),Qr=g?.value,ua=I.some(V=>Qr?.get(V.id)?.status==="uploading"),Yr=I.filter(V=>Qr?.get(V.id)?.status==="error"),wn=Yr.find(V=>Qr?.get(V.id)?.refusal),ys=wn&&(Qr?.get(wn.id)?.refusal==="INVALID_FILE_TYPE"?m.attachmentMimeRejected:m.attachmentUploadFailed).replace("{name}",wn.name),pa=Re||ua||c&&!Sn;return l("div",{class:`${Xe}-composer`,part:"composer","data-testid":D.composer,children:[N.length>0?l("div",{class:`${Xe}-message-queue`,"aria-label":m.queueMessage,"data-testid":D.messageQueue,children:N.map(V=>l("div",{class:`${Xe}-attachment-chip ${Xe}-queued-message`,"data-testid":`${D.queuedMessage}-${V.id}`,children:[l("span",{class:`${Xe}-attachment-name ${Xe}-queued-text`,children:V.text||V.attachments.map(X=>X.name).join(", ")}),l("button",{type:"button",class:`${Xe}-attachment-remove`,onClick:()=>Y(V.id),"aria-label":m.removeQueuedMessage,title:m.removeQueuedMessage,"data-testid":`${D.queuedMessageRemove}-${V.id}`,children:l(Bt,{})})]},V.id))}):null,I.length>0?l("div",{class:`${Xe}-attachments`,children:I.map(V=>l(yf,{attachment:V,upload:Qr?.get(V.id),strings:m,onRemove:()=>Pn(V.id),disabled:ze},V.id))}):null,Yr.length>0&&!ze?l(Jo,{text:ys??m.attachmentUploadFailed.replace("{name}",Yr.map(V=>V.name).join(", ")),retryLabel:m.errorRetry,onRetry:wn?void 0:()=>{Xt()},retryTestId:D.attachmentRetry}):null,C?l("p",{class:`${Xe}-field-error`,role:"alert",children:uP(m,C,e.attachments)}):null,Je?l("p",{class:`${Xe}-field-error`,role:"alert",children:m.micBlocked}):null,i!==void 0&&w.length>=i*.9?l("p",{class:`${Xe}-field-${w.length<i?"hint":"error"}`,"data-testid":D.composerCount,children:`${w.length} / ${i}`}):null,l("div",{class:`${Xe}-composer-row`,children:[l("div",{class:`${Xe}-composer-actions`,children:[re?l("button",{type:"button",class:`${Xe}-icon-btn`,onClick:()=>ye.current?.click(),disabled:ze,"aria-label":m.attach,title:m.attach,"data-testid":D.composerAttach,children:l(Ni,{})}):null,ce.isSupported?l("button",{type:"button",class:`${Xe}-icon-btn`,onClick:xn,disabled:ze,"aria-label":ae?m.micStop:m.micStart,title:ae?m.micStop:m.micStart,"aria-pressed":ae,"data-recording":ae?"true":void 0,"data-testid":D.composerVoice,children:l(I_,{})}):null,P&&y==="ai-agent"&&x?l("button",{type:"button",class:`${Xe}-icon-btn`,onClick:x,disabled:ze||!b,"aria-label":m.talkToOperator,title:m.talkToOperator,"data-testid":D.operatorRequest,children:l(Cr,{})}):null]}),l("textarea",{ref:Ze,name:"message",class:`${Xe}-textarea`,rows:1,value:w,maxLength:i,placeholder:m.composerPlaceholder,onInput:V=>K(V.currentTarget.value),onKeyDown:xt,onCompositionEnd:Wi,disabled:ze,"aria-label":m.composerPlaceholder,"data-testid":D.composerInput}),$&&Sn?l("button",{type:"button",class:`${Xe}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:_t,disabled:ze,"aria-label":m.queueMessage,title:m.queueMessage,"data-testid":D.composerSend,children:l(Kr,{})}):null,pa?l("button",{type:"button",class:`${Xe}-send`,onClick:k,disabled:ze&&!ua,"aria-label":m.stop,"data-testid":D.composerStop,children:l(kr,{})}):null,!pa&&(!$||!Sn)?l("button",{type:"button",class:`${Xe}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{Xt()},disabled:ze||!w.trim()&&I.length===0,"aria-label":m.send,"data-testid":D.composerSend,children:l(Kr,{})}):null]}),l("input",{ref:ye,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Jt,disabled:ze,class:`${Xe}-sr-only`,"data-testid":D.composerFileInput})]})}var Sf=q.cssPrefix;function Qi({onClick:e,children:t,testid:r}){return e?l("button",{type:"button",class:`${Sf}-home-card`,"data-interactive":"true",onClick:e,"data-testid":r,children:t}):l("div",{class:`${Sf}-home-card`,"data-testid":r,children:t})}function Yi(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var rr=q.cssPrefix,mP=te.scope("news"),gP=10;function Pc(e,t){let r=e?new Date(e):void 0;if(!(!r||Number.isNaN(r.getTime())))return new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(r)}function vP({options:e,transport:t,strings:r,config:n,nav:o,bus:s,panelProps:i,latestNews:a}){let c=n.contentCollectionIds,u=c?.join(","),[p,_]=U({items:[],loading:!0}),d=B(void 0);function f(b){if(!c?.length)return;let y={};d.current=y,_(x=>({...x,loading:!0,error:void 0})),t.listContent({contentCollectionIds:c,sortBy:"publishedAt",sortOrder:"desc",page:b,limit:gP}).then(x=>{if(d.current!==y||(_(k=>({items:b>1?[...k.items,...x.items]:x.items,pagination:x.pagination,loading:!1})),b>1))return;s.emit("contentView",{section:"news",count:x.items.length});let S=x.items[0];S&&a.markSeen(S.id)}).catch(x=>{d.current===y&&(mP.warn("listContent (news) failed",{err:x,page:b}),_(S=>({...S,loading:!1,error:Ir(x,r)})))})}function v(){p.loading||f((p.pagination?.page??0)+1)}H(()=>(_({items:[],loading:!0}),f(1),()=>{d.current=void 0}),[t,u]);function g(b){let y=Pc(b.publishedAt,e.locale);return l("button",{type:"button",class:`${rr}-news-card`,onClick:()=>o.push({kind:"content",id:b.id,title:b.title}),"data-testid":Ct(D.newsItem,b.id),children:[b.image?l("img",{class:`${rr}-news-hero`,src:b.image,alt:"",loading:"lazy"}):null,l("span",{class:`${rr}-news-body`,children:[l("span",{class:`${rr}-news-title`,children:b.title}),y||b.tags?.length?l("span",{class:`${rr}-news-meta`,children:[y?l("time",{dateTime:b.publishedAt,children:y}):null,b.tags?.map(x=>l("span",{class:`${rr}-news-tag`,children:x},x))]}):null,b.description?l("span",{class:`${rr}-news-summary`,children:b.description}):null]})]},b.id)}function P(){if(!c?.length)return l(jt,{message:r.newsEmpty,strings:r});let b=p.error?l(jt,{tone:"error",message:p.error,onRetry:v,strings:r}):null;return b&&!p.pagination?b:p.pagination?p.items.length?l("div",{class:`${rr}-news-list`,children:[p.items.map(g),b,p.pagination.hasNext&&!b?l("button",{type:"button",class:`${rr}-news-more`,onClick:v,"aria-busy":p.loading,"data-testid":D.newsMore,children:[p.loading?l("span",{class:`${rr}-loading-spinner`,"aria-hidden":"true"}):null,r.newsShowMore]}):null]}):l(jt,{message:r.newsEmpty,strings:r}):l(jt,{message:r.newsLoading,strings:r})}return l("div",{class:`${rr}-module`,children:[l(Bi,{title:r.newsTitle,actions:l(ur,{panelProps:i,variant:"plain"})}),l("div",{class:`${rr}-module-scroll`,children:P()})]})}var wf={Icon:Di,Root:e=>l(vP,{...e})};var we=q.cssPrefix,kf=te.scope("home");function hP(e){let t=e.options.userContext?.name,r=e.config.greetingText?mt(e.strings,e.config.greetingText):void 0;if(r){let n=t?r.replace("{name}",t):r.replace(/\s*\{name\}\s*/," ").trim(),o=e.strings.homeGreetingLead;return{title:n,subtitle:n.toLowerCase()===o.toLowerCase()?void 0:o}}return t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}function yP(e,t){return t.url?Vo(t.url):e.push({kind:"content",id:t.id,title:t.title})}function bP({options:e,onAsk:t}){let[r,n]=U(""),{sendButton:o}=e.composer,s=bc[o.icon];function i(a){a.preventDefault();let c=r.trim();c&&(n(""),t(c))}return l("form",{class:`${we}-home-search ${we}-home-ask`,"data-input":"true",onSubmit:i,"data-testid":D.homeAsk,children:[l("input",{type:"text",class:`${we}-home-search-input`,placeholder:e.strings.homeAskPlaceholder,"aria-label":e.strings.homeAskPlaceholder,value:r,enterKeyHint:"send",onInput:a=>n(a.currentTarget.value)}),l("button",{type:"submit",class:`${we}-send`,"data-shape":o.shape,"data-variant":o.variant,disabled:!r.trim(),"aria-label":e.strings.send,children:l(s,{})})]})}function Cf(e,t){return wr(e,t,t.type!=="upsert"||t.activity===!0)}function PP(e){let{transport:t,strings:r,config:n,nav:o,bus:s,panelProps:i,latestNews:a}=e,[c,u]=U(null),[p,_]=U([]),d=n.contentCollectionIds?.join(","),f=e.options.modules.list.some(h=>h.layout==="chat");H(()=>{if(n.showRecentConversations===!1)return;let h=!1,m=!0,w=[],A=t.subscribeConversationChanges(I=>{m&&w.push(I),u(R=>Cf(R?[R]:[],I)[0]??null)});return t.listConversations({limit:f?50:1}).then(I=>{if(h)return;let R=w.reduce(Cf,I.conversations);w=[],m=!1,u(R[0]??null)}).catch(I=>{h||(w=[],m=!1,kf.warn("listConversations (home) failed",{err:I}))}),()=>{h=!0,A()}},[t,n.showRecentConversations,f]),H(()=>{if(!n.contentCollectionIds?.length)return;let h=!1;return t.listContent({contentCollectionIds:n.contentCollectionIds,pinned:!0,limit:6}).then(m=>{h||(_(m.items),s.emit("contentView",{section:"home",count:m.items.length}))}).catch(m=>!h&&kf.warn("listContent (home) failed",{err:m})),()=>{h=!0}},[t,d,s]);let v=hP(e),g=n.userAvatars??[],P=n.status,b=P?.text?mt(r,P.text):r.homeStatus,y=P?.url,x=n.contentBlockTitle?mt(r,n.contentBlockTitle):r.homeContentTitle,S=a.item,k=Pc(S?.publishedAt,e.options.locale);return l("div",{class:`${we}-module ${we}-home`,"data-testid":D.homeView,children:l("div",{class:`${we}-home-scroll`,children:[l("div",{class:`${we}-home-hero`,children:[l("div",{class:`${we}-home-hero-top`,children:[n.brandName?l("span",{class:`${we}-home-brand`,"data-testid":D.homeBrand,children:n.brandName}):l("span",{class:`${we}-home-brand-spacer`,"aria-hidden":"true"}),l("div",{class:`${we}-home-hero-actions`,children:[g.length>0?l("div",{class:`${we}-home-avatars`,children:g.map(h=>l("span",{class:`${we}-home-avatar`,title:h.role?`${h.name} \xB7 ${h.role}`:h.name,children:h.avatar?l("img",{src:h.avatar,alt:"",loading:"lazy"}):l("span",{children:Yi(h.name)})},h.name))}):null,l(ur,{panelProps:i,variant:"plain"})]})]}),n.showGreeting!==!1?l(ge,{children:[l("h1",{class:`${we}-home-greeting`,"data-testid":D.homeGreeting,children:v.title}),v.subtitle?l("p",{class:`${we}-home-lead`,children:v.subtitle}):null]}):null]}),l("div",{class:`${we}-home-cards`,children:[f?l(bP,{options:e.options,onAsk:h=>o.startNewConversation(h)}):null,n.showSearchBar!==!1?l(uf,{placeholder:r.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,S?l(Qi,{onClick:()=>{a.markSeen(S.id),o.push({kind:"content",id:S.id,title:S.title})},testid:D.homeWhatsNew,children:l("div",{class:`${we}-home-recent-row`,"data-unread":a.unseen?"true":void 0,children:[l("span",{class:`${we}-home-recent-avatar`,"aria-hidden":"true",children:l(Di,{})}),l("span",{class:`${we}-home-recent-body`,children:[l("span",{class:`${we}-home-recent-title`,children:r.homeWhatsNew}),l("span",{class:`${we}-home-recent-preview`,children:k?`${S.title} \xB7 ${k}`:S.title})]}),a.unseen?l("span",{class:`${we}-home-recent-dot`,role:"img","aria-label":r.newsUnseen}):null]})}):null,c?l(Qi,{onClick:()=>o.selectConversation(c),testid:D.homeRecent,children:l("div",{class:`${we}-home-recent-row`,"data-unread":c.hasUnread?"true":void 0,children:[l("span",{class:`${we}-home-recent-avatar`,"aria-hidden":"true",children:l(Qo,{})}),l("span",{class:`${we}-home-recent-body`,children:[l("span",{class:`${we}-home-recent-title`,children:c.title}),c.preview?l("span",{class:`${we}-home-recent-preview`,children:Fi(c.preview)}):null]}),c.hasUnread?l("span",{class:`${we}-home-recent-dot`,role:"img","aria-label":r.unread}):null]})}):null,P?l(Qi,{onClick:y?()=>Vo(y):void 0,children:l("div",{class:`${we}-home-status`,"data-level":P.level??"operational",children:[l("span",{class:`${we}-home-status-icon`,"aria-hidden":"true",children:l(H_,{})}),l("span",{class:`${we}-home-status-text`,children:b})]})}):null,p.length>0?l("section",{class:`${we}-home-content`,children:[l("div",{class:`${we}-home-content-title`,children:x}),l("div",{class:`${we}-home-content-list`,children:p.map(h=>l(ji,{title:h.title,subtitle:h.description,onClick:()=>yP(o,h),testid:Ct(D.homeContentRow,h.id)},h.id))})]}):null]})]})})}var Tf={Icon:F_,Root:e=>l(PP,{...e})};var Xi={chat:df,home:Tf,help:ff,news:wf};var Zo=q.cssPrefix;function If({modules:e,activeTab:t,strings:r,hasUnread:n,onSelect:o}){return l("nav",{class:`${Zo}-tabbar`,role:"tablist","aria-label":r.panelTitle,children:e.map(s=>{let i=Xi[s.layout].Icon,a=s.id===t,c=s.layout==="chat"&&n;return l("button",{type:"button",role:"tab","aria-selected":a,class:`${Zo}-tab`,onClick:()=>o(s.id),"data-testid":Ct(D.tab,s.id),children:[l("span",{class:`${Zo}-tab-icon`,children:[l(i,{}),c?l("span",{class:`${Zo}-tab-badge`,"data-testid":D.tabBadge,role:"img","aria-label":r.unread}):null]}),l("span",{class:`${Zo}-tab-label`,children:mt(r,s.label)})]},s.id)})})}var ea=q.cssPrefix;function Af({agent:e,strings:t,ticketReference:r,person:n=!1}){let o=e.status??"online",s=mt(t,e.name),i=e.title?mt(t,e.title):null,a=n?l(Cr,{}):l("span",{children:Yi(s)});return l("div",{class:`${ea}-agent`,children:[l("div",{class:`${ea}-agent-avatar`,"data-status":o,children:e.avatar?l("img",{src:e.avatar,alt:""}):a}),l("div",{class:`${ea}-agent-meta`,children:[l("strong",{children:s}),i||r?l("div",{class:`${ea}-agent-sub`,children:[r?l(xP,{reference:r,strings:t}):null,i?l("span",{children:i}):null]}):null]})]})}function xP({reference:e,strings:t}){let[r,n]=U(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})}return l("button",{type:"button",class:`${ea}-agent-ticket`,onClick:o,title:t.copy,"aria-label":r?t.copied:t.copyTicketReference.replace("{reference}",e),children:r?t.copied:e})}var SP=["today","yesterday","lastWeek","older"];function wP(e,t){let r=Date.parse(t);if(!Number.isFinite(r))return"older";let n=Math.round((Rf(e)-Rf(r))/(1440*60*1e3));return n<=0?"today":n===1?"yesterday":n<7?"lastWeek":"older"}function Ef(e,t){let r=new Map;for(let n of t){let o=wP(e,n.lastMessageAt),s=r.get(o);s?s.push(n):r.set(o,[n])}return SP.flatMap(n=>{let o=r.get(n);return o?[{bucket:n,conversations:o}]:[]})}function Rf(e){return new Date(e).setHours(0,0,0,0)}var Mf=te.scope("history"),kP=3,CP=6,TP={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Lf(e,t){let r=t.type!=="upsert"||t.activity===!0;if(t.type==="snapshot"&&t.result.pagination.page===1&&e.pagination.page>1){let o=wr(e.conversations.slice(0,t.result.pagination.limit),t,r);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 s=new Set(o.map(u=>u.conversationId)),i=e.conversations.slice(t.result.pagination.limit).filter(u=>!s.has(u.conversationId)),a=e.pagination.page,c={...t.result.pagination,page:a,hasPrev:a>1,hasNext:a<t.result.pagination.totalPages};return{conversations:[...o,...i],pagination:c}}let n=wr(e.conversations,t,r);return n===e.conversations?e:{...t.type==="snapshot"?t.result:e,conversations:n}}function IP(e,t,r){let n=Date.parse(e);return Number.isFinite(n)?new Date(n).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(r,{hour:"numeric",minute:"2-digit"}).format(n):t-n<10080*60*1e3?new Intl.DateTimeFormat(r,{weekday:"short"}).format(n):new Intl.DateTimeFormat(r,{month:"short",day:"numeric"}).format(n):""}function Ji({transport:e,strings:t,locale:r,persistence:n,onSelect:o,onNewConversation:s}){let i=q.cssPrefix,a=e.peekConversations({limit:50}),[c,u]=U(a?"loaded":"loading"),[p,_]=U(0),[d,f]=U(a),[v,g]=U(!1),P=B(void 0),b=d?.conversations??[],y=d?.pagination;H(()=>{let m=!1,w=!0,A=[],I=e.subscribeConversationChanges(C=>{w&&A.push(C),f(M=>M&&Lf(M,C))});P.current=void 0,g(!1);let R=e.peekConversations({limit:50});return f(R),u(R?"loaded":"loading"),e.listConversations({limit:50}).then(C=>{if(m)return;let M=C;for(let N of A)M=Lf(M,N);A=[],w=!1,f(M),u("loaded"),n.saveHistoryCount(M.conversations.length)}).catch(C=>{m||(A=[],w=!1,Mf.warn("listConversations failed",{err:C}),u({failure:Ir(C,t)}))}),()=>{m=!0,I(),P.current=void 0}},[e,n,r,p]);async function x(){if(P.current||!y?.hasNext)return;let m={};P.current=m,g(!0);try{let w=await e.listConversations({page:y.page+1,limit:y.limit});if(P.current!==m)return;f(A=>{if(!A)return A;let I=new Set(A.conversations.map(M=>M.conversationId)),R=w.conversations.filter(M=>I.has(M.conversationId)?!1:(I.add(M.conversationId),!0)),C={conversations:[...A.conversations,...R],pagination:w.pagination};return n.saveHistoryCount(C.conversations.length),C})}catch(w){if(P.current!==m)return;Mf.warn("listConversations page failed",{err:w,page:y.page+1})}finally{P.current===m&&(P.current=void 0,g(!1))}}let S=s?l("div",{class:`${i}-history-footer`,children:l("button",{type:"button",class:`${i}-history-new`,onClick:s,"data-testid":D.sidebarNewConversation,children:[l(w_,{}),t.newConversation]})}):null;if(c==="loading"){let m=Math.min(n.loadHistoryCount()??kP,CP);return l(ge,{children:[l("div",{class:`${i}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:l("div",{class:`${i}-history-group`,"aria-hidden":"true",children:[l("div",{class:`${i}-history-heading`,children:l("span",{class:`${i}-skeleton ${i}-skeleton-heading`})}),l("div",{class:`${i}-history-card`,children:Array.from({length:Math.max(1,m)},(w,A)=>l("div",{class:`${i}-history-item ${i}-history-item-skeleton`,children:[l("span",{class:`${i}-history-avatar ${i}-skeleton`}),l("span",{class:`${i}-history-body`,children:[l("span",{class:`${i}-history-row`,children:[l("span",{class:`${i}-history-title`,children:l("span",{class:`${i}-skeleton ${i}-skeleton-title`})}),l("span",{class:`${i}-history-time`,children:l("span",{class:`${i}-skeleton ${i}-skeleton-time`})})]}),l("span",{class:`${i}-history-row`,children:l("span",{class:`${i}-history-preview`,children:l("span",{class:`${i}-skeleton ${i}-skeleton-preview`})})})]})]},A))})]})}),S]})}if(typeof c=="object")return l(ge,{children:[l(jt,{tone:"error",message:c.failure,onRetry:()=>_(m=>m+1),strings:t}),S]});if(b.length===0)return l(ge,{children:[l("div",{class:`${i}-history-empty`,children:t.historyEmpty}),S]});let k=Date.now(),h=Ef(k,b);return l(ge,{children:[l("div",{class:`${i}-history`,role:"list",children:[h.map(m=>l("div",{class:`${i}-history-group`,children:[l("div",{class:`${i}-history-heading`,children:t[TP[m.bucket]]}),l("div",{class:`${i}-history-card`,children:m.conversations.map(w=>l("div",{role:"listitem",children:l("button",{type:"button",class:`${i}-history-item`,onClick:()=>o(w),"data-unread":w.hasUnread?"true":void 0,"data-testid":Ct(D.historyItem,w.conversationId),children:[l("span",{class:`${i}-history-avatar`,"aria-hidden":"true",children:l(fc,{})}),l("span",{class:`${i}-history-body`,children:[l("span",{class:`${i}-history-row`,children:[l("span",{class:`${i}-history-title`,children:w.title}),l("span",{class:`${i}-history-time`,children:[w.ticketReference&&`${w.ticketReference} \xB7 `,IP(w.lastMessageAt,k,r)]})]}),l("span",{class:`${i}-history-row`,children:[l("span",{class:`${i}-history-preview`,children:w.preview&&Fi(w.preview)||t.historyContinue}),w.hasUnread?l("span",{class:`${i}-history-dot`,role:"img","aria-label":t.unread}):null]})]})]})},w.conversationId))})]},m.bucket)),y?.hasNext?l("div",{class:`${i}-history-more`,children:l("button",{type:"button",onClick:x,disabled:v,"aria-busy":v,"data-testid":D.historyLoadMore,children:t.loadMoreConversations})}):null]}),S]})}var Nf=q.cssPrefix;function Of({state:e,strings:t}){return e?l("div",{class:`${Nf}-dropzone`,"data-state":e,role:"status","aria-live":"polite",children:[l("span",{class:`${Nf}-dropzone-icon`,"aria-hidden":"true",children:e==="reject"?l(Xn,{}):l(Ni,{})}),e==="reject"?t.dropZoneRejected:t.dropZone]}):null}var xc=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,}$`),AP=/^[+]?[\d\s().-]{6,}$/;function RP(e,t,r){let n=Array.isArray(t)?t.join(""):t?.trim()??"";if(!n)return e.required?r.formRequired:void 0;if(e.type==="email"&&!xc.test(n))return r.formInvalidEmail;if(e.type==="tel"&&!AP.test(n))return r.formInvalidTel;if(e.type==="number"&&!Number.isFinite(Number(n)))return r.formInvalidNumber}function $f(e,t,r){return Object.fromEntries(e.flatMap(n=>{let o=RP(n,t[n.name],r);return o?[[n.name,o]]:[]}))}var ht=q.cssPrefix;function Df(e){return e.tokenEmail||e.userContext?.email?.trim()}function EP(e,t){let r=e instanceof qe?e.status:void 0;return r===400?t.formInvalidEmail:r===409?t.emailTranscriptAlreadySent:r===422?t.emailTranscriptNotDelivered:r===429?t.emailTranscriptLimited:t.emailTranscriptFailed}function MP(e){return"host"in e&&"activeElement"in e}function qf({transport:e,strings:t,knownEmail:r,onClose:n}){let[o,s]=U(r??""),[i,a]=U(!1),[c,u]=U({status:"idle"}),p=B(null),_=wo(),d=`${_}-title`,f=`${_}-error`,v=c.status==="sending",g=c.status==="sent";St(()=>{let y=p.current;if(!y)return;let x=y.getRootNode(),S=MP(x)?x.activeElement:null,k=Jn(y);return()=>{k(),S instanceof HTMLElement&&S.isConnected&&S.focus({preventScroll:!0})}},[]),St(()=>{p.current?.querySelector("[data-autofocus]")?.focus({preventScroll:!0})},[g]);async function P(y){if(y.preventDefault(),v)return;let x=o.trim();if(!xc.test(x)){a(!0),p.current?.querySelector("input")?.focus();return}a(!1),u({status:"sending"});let S=await e.emailTranscript(x).then(k=>({status:"sent",to:k.to}),k=>({status:"failed",message:EP(k,t)}));u(S)}function b(y){y.key==="Tab"&&y.stopPropagation(),y.key==="Escape"&&(y.stopPropagation(),n())}return l("div",{class:`${ht}-transcript-layer`,children:[l("div",{class:`${ht}-transcript-backdrop`,"aria-hidden":"true",onClick:n}),l("section",{ref:p,class:`${ht}-transcript-sheet`,role:"dialog","aria-modal":"true","aria-labelledby":d,onKeyDown:b,"data-testid":D.emailTranscriptSheet,children:[l("header",{class:`${ht}-transcript-sheet-head`,children:[l("span",{class:`${ht}-transcript-sheet-icon`,children:l(Oi,{})}),l("h2",{id:d,class:`${ht}-transcript-sheet-title`,children:t.emailTranscript}),l("button",{type:"button",class:`${ht}-icon-btn`,onClick:n,"aria-label":t.emailTranscriptCancel,title:t.emailTranscriptCancel,children:l(Bt,{})})]}),c.status==="sent"?l(ge,{children:[l("p",{class:`${ht}-transcript-sheet-text ${ht}-transcript-sheet-sent`,role:"status",children:[l(Tr,{}),l("span",{children:t.emailTranscriptSent.replace("{email}",c.to)})]}),l("button",{type:"button",class:`${ht}-form-submit ${ht}-transcript-sheet-action`,onClick:n,"data-autofocus":!0,children:t.emailTranscriptDone})]}):l("form",{class:`${ht}-transcript-sheet-form`,onSubmit:y=>{P(y)},noValidate:!0,children:[l("p",{class:`${ht}-transcript-sheet-text`,children:t.emailTranscriptPrompt}),l("label",{class:`${ht}-field`,"data-invalid":i?"true":void 0,children:[l("span",{class:`${ht}-field-label`,children:t.emailTranscriptEmailLabel}),l("input",{class:`${ht}-field-input`,type:"email",name:"email",autocomplete:"email",inputMode:"email",autocapitalize:"off",spellcheck:!1,value:o,readOnly:v,"aria-invalid":i,"aria-describedby":i?f:void 0,onInput:y=>{s(y.currentTarget.value),a(!1)},"data-autofocus":!0,"data-testid":D.emailTranscriptEmail}),i?l("span",{id:f,class:`${ht}-field-error`,role:"alert",children:t.formInvalidEmail}):null]}),l("button",{type:"submit",class:`${ht}-form-submit ${ht}-transcript-sheet-action`,disabled:v,"aria-busy":v,"data-testid":D.emailTranscriptSend,children:v?t.emailTranscriptSending:t.emailTranscriptSend}),c.status==="failed"?l("p",{class:`${ht}-field-error`,role:"alert",children:c.message}):null]})]})]})}var Uf=Object.assign;function OP(e,t){for(var r in e)if(r!="__source"&&e[r]!==t[r])return!0;for(var n in t)if(n!="__source"&&!(n in e))return!0;return!1}var $P=/^(-|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 Hf(e,t){function r(o){var s=this.props.ref;return s!=o.ref&&s&&(typeof s=="function"?s(null):s.current=null),t?!t(this.props,o)||s!=o.ref:OP(this.props,o)}function n(o){return this.shouldComponentUpdate=r,qr(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.type=e,n}var DP=Symbol.for("react.element"),qP=/^(?: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]/,UP=/[A-Z0-9]/g,BP=typeof document<"u";var zP=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 Bf=xe.event;xe.event=function(e){return Bf&&(e=Bf(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var HP={configurable:!0,get:function(){return this.class}},zf=xe.vnode;xe.vnode=function(e){if(typeof e.type=="string")(function(n){var o=n.props,s=n.type,i={},a=s.indexOf("-")==-1;for(var c in o){var u=o[c];if(!(c=="value"&&"defaultValue"in o&&u==null||BP&&c=="children"&&s=="noscript"||c=="class"||c=="className")){if(c=="style"&&u&&u.constructor==Object){var p=void 0;for(var _ in u)typeof u[_]!="number"||$P.test(_)||(p||(p=u=Uf({},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"||s!="input"&&s!="textarea"||zP(o.type)?d=="onfocus"?c="onfocusin":d=="onblur"&&(c="onfocusout"):d=c="oninput",d=="oninput"&&i[c=d]&&(c="oninputCapture")}else a&&qP.test(c)?c=c.replace(UP,"-$&").toLowerCase():u===null&&(u=void 0);i[c]=u}}if(s=="select"){var f=i.defaultValue!=null?i.defaultValue:i.multiple&&Array.isArray(i.value)?i.value:null;f!=null&&(i.value=ul(o.children).forEach(function(v){v.props.selected=i.multiple?f.indexOf(v.props.value)!=-1:f==v.props.value}))}o.class&&!o.className?(i.class=o.class,Object.defineProperty(i,"className",HP)):o.className&&(i.class=i.className=o.className),n.props=i})(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=Uf({},e.props);for(var r in e.type.defaultProps)t[r]===void 0&&(t[r]=e.type.defaultProps[r]);e.props=t}e.ref&&!("ref"in e.props)&&Object.defineProperty(e.props,"ref",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=DP,zf&&zf(e)};var Zi=q.cssPrefix;function Ff({messageId:e,initial:t,strings:r,onFeedback:n}){let[o,s]=U(t);H(()=>s(t),[e,t]);function i(a){let c=o===a?null:a;s(c),n(e,c)}return l("div",{class:`${Zi}-feedback`,role:"group","data-testid":D.messageFeedback,children:[l("button",{type:"button",class:`${Zi}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":r.feedbackUp,title:r.feedbackUp,onClick:()=>i("up"),"data-testid":D.feedbackUp,children:l(K_,{})}),l("button",{type:"button",class:`${Zi}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":r.feedbackDown,title:r.feedbackDown,onClick:()=>i("down"),"data-testid":D.feedbackDown,children:l(Q_,{})}),l("span",{class:`${Zi}-sr-only`,role:"status","aria-live":"polite",children:o?r.feedbackThanks:""})]})}var Kt=q.cssPrefix;function es(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 oo(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,""),r=t.indexOf("__"),n=t.slice(r+2);return r>0&&n?`${es(t.slice(0,r))} \xB7 ${es(n)}`:es(t)}function ta(e){if(e.title)return e.title;let t=e.toolName.indexOf("__"),r=e.toolName.slice(t+2);return t>0&&r?es(r):oo(e)}function ts(e,t){if(t?.replacedByMessageId)return{terminal:!1,responded:!1,decided:!1};let r=e==="output-available"||e==="output-error"||e==="output-denied",n=e==="approval-responded"||t?.approved!==void 0;return{terminal:r,responded:n,decided:r||n}}function kc({status:e,icon:t,label:r}){return l("span",{class:`${Kt}-toolui-badge ${Kt}-toolui-status`,"data-status":e,children:[l("span",{class:`${Kt}-toolui-status-icon`,children:t}),r]})}function FP(e,t){return t?.replacedByMessageId?"superseded":e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function ra(e,t,r={}){return r.submitted?"responded":r.incomplete?"incomplete":WP(FP(e,t),r.superseded,r.live??!0,r.stopped??!1)}function jP({status:e}){return e==="stopped"?l(kr,{}):e==="denied"||e==="error"||e==="superseded"||e==="incomplete"?l(gn,{}):e==="completed"||e==="responded"?l(Tr,{}):l(Y_,{})}function VP(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;case"incomplete":return t.statusIncomplete;case"stopped":return t.statusStopped;default:return t.statusRunning}}function WP(e,t,r,n){return t&&(e==="awaiting"||e==="running")?"superseded":n&&(e==="running"||e==="responded")?"stopped":!r&&e==="running"?"error":e}function GP({state:e,approval:t,strings:r,superseded:n,live:o=!0,submitted:s=!1,incomplete:i=!1,stopped:a=!1}){let c=ra(e,t,{superseded:n,live:o,submitted:s,incomplete:i,stopped:a}),u=t?.isAutomatic&&t.approved!==void 0&&(c==="completed"||c==="responded"||c==="denied")?t.approved?r.statusAutoApproved:r.statusAutoDeclined:void 0;return l(kc,{status:c,icon:l(jP,{status:c}),label:u??VP(c,r)})}function KP({name:e,state:t,approval:r,strings:n,superseded:o,live:s,submitted:i,incomplete:a,stopped:c}){return l(ge,{children:[l("span",{class:`${Kt}-toolui-name-pill`,children:[l(qi,{}),l("span",{class:`${Kt}-toolui-name-text`,children:e})]}),l(GP,{state:t,approval:r,strings:n,superseded:o,live:s,submitted:i,incomplete:a,stopped:c}),l("span",{class:`${Kt}-toolui-chevron`,children:l(sr,{})})]})}function rs({part:e,strings:t,testid:r,superseded:n,live:o,submitted:s,incomplete:i,stopped:a,open:c}){let u=ve(()=>Se(()=>e.inputSig.value),[e]),p=ve(()=>Se(()=>e.outputSig.value),[e]),_=ve(()=>Se(()=>e.errorSig.value),[e]),d=ve(()=>Se(()=>e.stateSig.value),[e]),f=ve(()=>Se(()=>e.approvalSig.value),[e]),v=ve(()=>Se(()=>nr(e.toolMetadata)&&Na(e.errorSig.value)),[e]),g=i===!0||v.value;return l("details",{class:`${Kt}-toolui ${Kt}-toolui-collapsible`,"data-testid":r,open:c||void 0,children:[l("summary",{class:`${Kt}-toolui-head`,children:l(KP,{name:oo(e),state:d.value,approval:f.value,strings:t,superseded:n,live:o,submitted:s,incomplete:g,stopped:a})}),l(vn,{label:t.toolParameters,value:u.value}),p.value!==void 0?l(vn,{label:t.toolResult,value:p.value}):null,_.value&&!g?l(vn,{label:t.statusError,value:_.value,error:!0}):null]})}function vn({label:e,value:t,error:r}){let n=r?void 0:QP(Sc(t)),o=r?typeof t=="string"?t:"":wc(Sc(t));return!n&&!o?null:l("div",{class:`${Kt}-toolui-section`,children:[l("span",{class:`${Kt}-toolui-label`,children:e}),n?l("dl",{class:`${Kt}-toolui-fields ${Kt}-toolui-fields-full`,children:n.map(({key:s,value:i})=>l("div",{children:[l("dt",{children:s}),l("dd",{children:i})]},s))}):l("pre",{class:`${Kt}-toolui-code`,"data-error":r?"true":void 0,children:o})]})}function QP(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=Object.entries(e).filter(([,r])=>r!=null&&r!=="");if(!(t.length===0||t.some(([,r])=>typeof r=="object")))return t.map(([r,n])=>({key:r,value:String(n)}))}function ns(e){return!!wc(e.inputSig.value)||!!e.errorSig.value||!!wc(Sc(e.outputSig.value))}function Sc(e){return YP(e)&&e.storage==="tool-result-ref"&&"summary"in e?e.summary:e}function YP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wc(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}function jf(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function Vf(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function XP(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function Wf(e){let{streaming:t,reasoningVisible:r,emptyReply:n,hidden:o}=e,s=e.responseMode==="buffered"&&t,i=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:s,reasoningVisible:r,working:i,showStreamDots:XP({streaming:t,bufferedHold:s,reasoningVisible:r,working:i}),emptyReply:n,hidden:o}}function Gf(e,t){let r=e.stateSig.value,n=e.approvalSig.value,{terminal:o,responded:s,decided:i}=ts(r,n),a=t.continuationStreaming===!0&&!i,c=t.superseded&&!i&&!a;return{pill:ra(r,n,{superseded:c,live:t.live,submitted:a,incomplete:nr(e.toolMetadata)&&Na(e.errorSig.value),stopped:t.stopped}),state:r,terminal:o,decided:i||a,showApproveReject:!i&&!t.superseded&&!a,showAnswered:s&&!o&&!c,showSubmitted:a,showEdit:s&&t.active&&!o,skipped:c,answeredApproved:n?.approved}}var ao=q.cssPrefix;function Kf({part:e,strings:t}){let r=e.title||e.filename||e.url||t.sources;return e.url?l("a",{class:`${ao}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":D.source,children:[l("span",{class:`${ao}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),l("span",{class:`${ao}-source-label`,children:r})]}):l("span",{class:`${ao}-source`,"data-testid":D.source,children:[l("span",{class:`${ao}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),l("span",{class:`${ao}-source-label`,children:r})]})}var Qt=q.cssPrefix,JP=4;function Qf(e){return typeof e=="string"?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):""}function Yf(e){if(!e||typeof e!="object"||Array.isArray(e))return Qf(e);let[t,...r]=Object.values(e).map(Qf).filter(Boolean);return t===void 0?"":r.length>0?`${t} (${r.join(", ")})`:t}function ZP(e){return!e||typeof e!="object"||Array.isArray(e)?[]:Object.entries(e).flatMap(([t,r])=>{let n=Array.isArray(r)?r.map(Yf).filter(Boolean).join(", "):Yf(r);return n?[{key:t,value:n}]:[]}).slice(0,JP)}function Xf({part:e,strings:t,active:r,superseded:n=!1,continuationStreaming:o=!1,stopped:s=!1,onDecision:i,onEdit:a}){let c=ve(()=>Se(()=>e.approvalSig.value),[e]),u=ve(()=>Se(()=>Gf(e,{active:r,superseded:n,continuationStreaming:o,stopped:s})),[e,r,n,o,s]).value,{terminal:p,showApproveReject:_,showAnswered:d,showSubmitted:f,showEdit:v,skipped:g}=u,P=u.answeredApproved,b=e.toolCallId,y=ZP(e.inputSig.value),x=l(ge,{children:[l("p",{class:`${Qt}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",oo(e))}),y.length>0?l("dl",{class:`${Qt}-toolui-fields`,"data-testid":D.toolApprovalFields,children:y.map(({key:k,value:h})=>l("div",{children:[l("dt",{children:k}),l("dd",{title:h,children:h})]},k))}):null]});f?x=l("p",{class:`${Qt}-toolui-subtle`,children:t.approvalSubmitting}):d&&P!==!1?x=l(ge,{children:[l("p",{class:`${Qt}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",P?t.approve:t.reject),c.value?.reason?` \u2014 ${c.value.reason}`:""]}),v?l("p",{class:`${Qt}-toolui-subtle`,children:t.approvalEditHint}):null,v?null:l("p",{class:`${Qt}-toolui-subtle`,children:t.approvalSubmitting})]}):d&&(x=l(ge,{}));let S=_||f||v||d&&P!==!1;return l("div",{class:`${Qt}-toolui-group`,"data-testid":u.decided?D.toolDecision:D.toolApproval,children:[l(rs,{part:e,strings:t,superseded:g,submitted:f,stopped:s,open:_}),g||p||!S?null:l("div",{class:`${Qt}-toolui ${Qt}-toolui-body`,children:[x,_?l("div",{class:`${Qt}-toolui-actions`,children:[l("button",{type:"button",class:`${Qt}-form-skip`,disabled:!r,onClick:()=>i(b,!1),"data-testid":D.toolReject,children:t.reject}),l("button",{type:"button",class:`${Qt}-form-submit`,disabled:!r,onClick:()=>i(b,!0),"data-testid":D.toolApprove,children:t.approve})]}):null,v?l("div",{class:`${Qt}-toolui-actions`,children:l("button",{type:"button",class:`${Qt}-form-skip`,onClick:()=>a(b),"data-testid":D.toolEdit,children:t.edit})}):null]})]})}var ex=["text","email","phone","number","date","single-select","multi-select","boolean"];function Jf(e){return e!==null&&typeof e=="object"}function Zf(e,t){let r=Jf(e)?e:{},o=(Array.isArray(r.questions)?r.questions:[]).map((s,i)=>tx(s,i,t)).filter(s=>s!==null);return{intro:os(r.intro),questions:o}}function tx(e,t,r){if(!Jf(e))return null;let n=ex.find(o=>o===e.type)??"text";return{key:os(e.key)??`q${t+1}`,question:os(e.question)??r,type:n,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:os(e.helpText)}}function rx(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 Cc(e,t,r){return e.questions.map(n=>{let o=rx(n.type),s=n.type==="boolean"?[{value:"yes",label:t},{value:"no",label:r}]:(n.options??[]).map(i=>({value:i,label:i}));return{name:n.key,label:n.question,type:o,required:n.required??!1,options:s.length>0?s:void 0,validationHint:n.helpText}})}function os(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var yt=q.cssPrefix;function Tc({fields:e,strings:t,submitLabel:r,onSubmit:n,skipLabel:o,onSkip:s,footerHint:i,submitOnEnter:a,disabled:c,initialValues:u,hideActions:p,fieldTypeLabels:_,rootTestId:d,submitTestId:f,skipTestId:v}){let[g,P]=U(()=>u??{}),[b,y]=U({}),[x,S]=U({});function k(I){x[I]&&S(R=>({...R,[I]:""}))}function h(I,R){P(C=>({...C,[I]:R})),k(I)}function m(I,R){y(C=>({...C,[I]:R})),k(I)}function w(I){if(I.preventDefault(),c)return;let R=ix(e,g,b),C=$f(e,R,t);if(Object.keys(C).length>0){S(C);return}n(R)}function A(I){!a||I.key!=="Enter"||I.shiftKey||Gi(I)||!I.target||!("tagName"in I.target)||I.target.tagName!=="TEXTAREA"||w(I)}return l("form",{class:`${yt}-form`,onSubmit:w,onKeyDown:A,onCompositionEnd:Wi,"data-testid":d,noValidate:!0,children:[e.map(I=>l(nx,{field:I,value:g[I.name],otherText:b[I.name]??"",error:x[I.name],disabled:c,typeLabel:_?.[I.name],strings:t,onChange:R=>h(I.name,R),onOtherChange:R=>m(I.name,R)},I.name)),p?null:l("div",{class:`${yt}-form-actions`,children:[i?l("span",{class:`${yt}-form-hint`,children:i}):null,o&&s?l("button",{type:"button",class:`${yt}-form-skip`,onClick:s,disabled:c,"data-testid":v,children:o}):null,l("button",{type:"submit",class:`${yt}-form-submit`,disabled:c,"data-testid":f,children:r})]})]})}function nx({field:e,value:t,otherText:r,error:n,disabled:o,typeLabel:s,strings:i,onChange:a,onOtherChange:c}){let u=Ct(D.formField,e.name),p=wo(),_=ox({field:e,value:t,otherText:r,disabled:o,strings:i,onChange:a,onOtherChange:c,fieldTid:u,labelId:p}),d=e.type==="radio"||e.type==="multiselect"?"div":"label";return l(d,{class:`${yt}-field`,"data-field":e.name,"data-invalid":n?"true":void 0,children:[l("span",{class:`${yt}-field-head`,children:[l("span",{class:`${yt}-field-label`,id:p,children:[e.label,e.required?l("span",{class:`${yt}-field-req`,"aria-hidden":"true",children:" *"}):null]}),s?l("span",{class:`${yt}-field-type`,children:s}):null]}),_,e.validationHint&&!n?l("span",{class:`${yt}-field-hint`,children:e.validationHint}):null,n?l("span",{class:`${yt}-field-error`,role:"alert",children:n}):null]})}function ox(e){let{field:t,value:r,otherText:n,disabled:o,strings:s,onChange:i,onOtherChange:a,fieldTid:c,labelId:u}=e,p=typeof r=="string"?r:"";switch(t.type){case"textarea":return l("textarea",{class:`${yt}-field-input`,rows:3,value:p,disabled:o,onInput:d=>i(d.currentTarget.value),"data-testid":c});case"radio":return l("div",{class:`${yt}-field-choices`,role:"radiogroup","aria-labelledby":u,"data-testid":c,children:(t.options??[]).map(d=>l("label",{class:`${yt}-choice`,children:[l("input",{type:"radio",name:`${yt}-${t.name}`,checked:p===d.value,disabled:o,onChange:()=>i(d.value)}),l("span",{children:d.label})]},d.value))});case"multiselect":{let f=function(v,g){return i(g?[...d,v]:d.filter(P=>P!==v))};var _=f;let d=Array.isArray(r)?r:[];return l("div",{class:`${yt}-field-choices`,role:"group","aria-labelledby":u,"data-testid":c,children:[(t.options??[]).map(v=>l("label",{class:`${yt}-choice`,children:[l("input",{type:"checkbox",checked:d.includes(v.value),disabled:o,onChange:g=>f(v.value,g.currentTarget.checked)}),l("span",{children:v.label})]},v.value)),(t.options??[]).length===0?l("textarea",{class:`${yt}-field-input`,rows:2,value:n,placeholder:s.formOtherPlaceholder,disabled:o,onInput:v=>a(v.currentTarget.value)}):null]})}default:return l("input",{...ax(t.type),class:`${yt}-field-input`,value:p,disabled:o,onInput:d=>i(d.currentTarget.value),"data-testid":c})}}function ax(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 ix(e,t,r){let n={...t};for(let o of e){let s=r[o.name]?.trim();if(o.type==="multiselect"&&s){let i=s.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),a=t[o.name];n[o.name]=[...Array.isArray(a)?a:[],...i]}}return n}var ut=q.cssPrefix;function sx({skipped:e,submitted:t,strings:r}){return e?{status:"superseded",statusLabel:r.inputSkipped}:t?{status:"responded",statusLabel:r.statusResponded}:{status:"completed",statusLabel:r.inputAnswered}}var lx={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function tm(e,t){let r={};for(let n of e)r[n.key]=t[lx[n.type]];return r}function rm({part:e,strings:t,active:r,superseded:n=!1,continuationStreaming:o=!1,onDecision:s,onEdit:i}){let a=ve(()=>Se(()=>e.stateSig.value),[e]).value,c=ve(()=>Se(()=>e.approvalSig.value),[e]).value,u=ve(()=>Se(()=>Zf(e.inputSig.value,t.askFallbackQuestion)),[e,t]).value,{terminal:p,decided:_}=ts(a,c),d=_&&c?.approved===!0,f=o&&!_,v=!_&&!n&&!f,g=!v&&!d&&!f,P=d&&r&&!p,b=u.questions,[y,x]=U(null),k=y??(v||d||f),[h,m]=U(!1),w=b.length>1?_c:Ko,A=v?t.inputRequired:t.inputBadge,I=f?l("p",{class:`${ut}-toolui-subtle`,children:t.approvalSubmitting}):v?l(cx,{req:u,strings:t,active:r,resolve:(M,N)=>s(e.toolCallId,N,M)}):h?l(Tc,{fields:Cc(u,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:tm(b,t),initialValues:d?fx(b,c?.reason):void 0}):l(dx,{questions:b,answers:d?_x(c?.reason):{},strings:t}),{status:R,statusLabel:C}=sx({skipped:g,submitted:f,strings:t});return l("details",{class:`${ut}-toolui ${ut}-toolui-collapsible${n?` ${ut}-toolui-stale`:""}`,open:k,onToggle:M=>{let N=M.currentTarget.open;N!==k&&x(N)},"data-testid":v?D.toolAskQuestions:D.toolDecision,children:[l("summary",{class:`${ut}-toolui-head`,children:[l("span",{class:`${ut}-toolui-q-pill`,children:[l(w,{}),A]}),l("span",{class:`${ut}-toolui-head-end`,children:[v?null:l(kc,{status:R,icon:g?l(gn,{}):l(Tr,{}),label:C}),l("span",{class:`${ut}-toolui-chevron`,children:l(sr,{})})]})]}),l("div",{class:`${ut}-toolui-collapse-body`,children:[u.intro?l("div",{class:`${ut}-toolui-desc`,children:u.intro}):null,I,v||f?null:l("div",{class:`${ut}-toolui-footer`,children:[l("button",{type:"button",class:`${ut}-toolui-options-toggle`,onClick:()=>m(M=>!M),"data-testid":D.toolAskOptions,children:[l("span",{class:`${ut}-toolui-options-chevron${h?` ${ut}-open`:""}`,children:l(sr,{})}),h?t.hideOptions:t.showOptions]}),P?l("button",{type:"button",class:`${ut}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":D.toolEdit,children:t.edit}):null]})]})]})}function cx({req:e,strings:t,active:r,resolve:n}){let o=Cc(e,t.confirmYes,t.confirmNo),s=e.questions.length===1&&e.questions[0]?.type==="text";return l(Tc,{fields:o,strings:t,disabled:!r,submitLabel:t.inputSubmit,footerHint:s?t.inputSubmitHint:void 0,onSubmit:i=>n(px(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:s,fieldTypeLabels:tm(e.questions,t),submitTestId:D.toolInputSubmit,skipTestId:D.toolInputSkip})}function dx({questions:e,answers:t,strings:r}){return l("div",{class:`${ut}-toolui-summary`,"data-testid":D.toolAskSummary,children:e.map(n=>l("div",{class:`${ut}-field`,children:[l("span",{class:`${ut}-field-head`,children:l("span",{class:`${ut}-field-label`,children:[n.question,n.required?l("span",{class:`${ut}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),l("p",{class:`${ut}-toolui-answer`,children:ux(n,t[n.key],r)||"\u2014"})]},n.key))})}function ux(e,t,r){return e.type!=="boolean"?t??"":t==="yes"?r.confirmYes:t==="no"?r.confirmNo:t??""}function px(e,t){let r=e.flatMap(n=>{let o=t[n.key],s=typeof o=="string"?o.trim():o;return s?.length?[{key:n.key,value:s}]:[]});return JSON.stringify({answers:r})}function nm(e){if(!e)return{};let t=(()=>{try{return JSON.parse(e)}catch{return}})(),r=em(t)?t.answers:void 0;if(!Array.isArray(r))return{};let n={};for(let o of r)if(em(o)){let{key:s,value:i}=o;if(typeof s!="string")continue;typeof i=="string"?n[s]=i:Array.isArray(i)&&(n[s]=i.filter(a=>typeof a=="string"))}return n}function em(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _x(e){let t=nm(e),r={};for(let[n,o]of Object.entries(t))r[n]=Array.isArray(o)?o.join(", "):o;return r}function fx(e,t){let r=nm(t),n={};for(let o of e){let s=r[o.key];s!==void 0&&(o.type==="multi-select"?n[o.key]=Array.isArray(s)?s:[s]:n[o.key]=Array.isArray(s)?s[0]??"":s)}return n}function Ic({part:e,strings:t,live:r,superseded:n,stopped:o=!1}){let s=nr(e.toolMetadata);if(!ve(()=>Se(()=>ns(e)),[e]).value&&!s)return null;let a=e.outputSig.value===void 0&&!e.errorSig.value;return l(rs,{part:e,strings:t,testid:D.toolCall,live:r||s&&!n,incomplete:s&&n&&a,stopped:o})}var pe=q.cssPrefix;function is(e){if(e.kind!=="tool")return!1;let t=e.stateSig.value;return t!=="approval-requested"&&t!=="approval-responded"&&!e.toolMetadata?.card&&!nr(e.toolMetadata)}function om(e,t){let r=[];for(let[n,o]of e.entries()){let s=r.at(-1);if(o.kind==="reasoning"&&t.showReasoning||is(o)&&ns(o)){s?.kind==="steps"?(s.parts.push(o),s.indices.push(n)):r.push({kind:"steps",parts:[o],indices:[n]});continue}o.kind==="step-start"||o.kind==="reasoning"||o.kind==="source"&&!t.showSources||is(o)||r.push({kind:"part",part:o,index:n})}return r}function mx(e){if(!(!e||typeof e!="object"))return Object.values(e).find(t=>typeof t=="string"&&t.trim().length>0)?.trim()}function gx(e,t){let r=[...new Set(t)];if(!(!e||r.length===0||r.some(n=>n<0||n>=e.length)))return r.reduce((n,o)=>n+(e[o]?.durationMs??0),0)}function am(e){let t=[];for(let r of e)t.push((t.at(-1)??-1)+(r.kind==="step-start"?1:0));return t}function vx(e,t){return e.streaming?t.thinking:e.reasoningMs===void 0?t.thought:t.thoughtFor.replace("{time}",im(e.reasoningMs))}function im(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 hx(e){return e.split(`
65
- `).map(t=>t.trim()).findLast(t=>/^\*\*[^*].*\*\*$/.test(t))?.slice(2,-2).trim()}function yx(e,t){return e?.kind==="tool"?`${ta(e)}\u2026`:(e&&hx(e.textSig.value))??t.thinking}function bx(e,t){let r=e.map(a=>a.kind==="tool"?{kind:"tool",part:a,name:oo(a),summary:mx(a.inputSig.value),status:ra(a.stateSig.value,a.approvalSig.value,{live:t.live,stopped:t.stopped})}:{kind:"thought",part:a}),n=r.flatMap(a=>a.kind==="tool"?[a]:[]),o=new Map;for(let a of n)o.set(ta(a.part),(o.get(ta(a.part))??0)+1);let s=n.some(a=>a.status==="stopped"),[i]=n;return{tools:[...o].map(([a,c])=>({name:a,count:c})),...n.length===1&&i?{single:{name:ta(i.part),...i.summary?{summary:i.summary}:{}}}:{},failed:n.filter(a=>a.status==="error").length,approved:n.filter(a=>as(a.part)===!0).length,declined:n.filter(a=>as(a.part)===!1).length,notRun:n.filter(a=>(a.status==="denied"||a.status==="superseded")&&as(a.part)===void 0).length,...t.stopped&&s?{stopped:{finished:n.filter(a=>a.status!=="stopped").length}}:{},rows:r}}function sm({parts:e,steps:t=[],stepTimings:r,timed:n=!0,strings:o,live:s,running:i,stopped:a=!1,runStartedAt:c}){let[u,p]=U(!1),[_,d]=U(!1),f=bx(e,{live:s,stopped:a}),v=e.at(-1),g=ve(()=>Se(()=>yx(v,o)),[v,o]).value,P=n?gx(r,t):void 0;function b(){p(!u),d(!0)}return l("div",{class:`${pe}-steps`,"data-testid":D.toolSteps,"data-running":i?"true":void 0,"data-stopped":f.stopped?"true":void 0,children:[l("button",{type:"button",class:`${pe}-steps-head`,"aria-expanded":u,onClick:b,children:[l("span",{class:`${pe}-steps-icon`,"aria-hidden":"true",children:l(xx,{running:i,stopped:f.stopped!==void 0})}),l("span",{class:`${pe}-steps-label`,children:i?l("span",{class:`${pe}-steps-live`,children:g}):l(wx,{view:f,strings:o})}),!i&&f.failed>0?l("span",{class:`${pe}-steps-failed`,children:o.toolStepsFailed.replace("{count}",String(f.failed))}):null,!i&&f.approved>0?l(Ac,{approved:!0,children:o.toolStepsApproved.replace("{count}",String(f.approved))}):null,!i&&f.declined>0?l(Ac,{approved:!1,children:o.toolStepsDeclined.replace("{count}",String(f.declined))}):null,!i&&f.notRun>0?l("span",{class:`${pe}-steps-denied`,children:o.toolStepsNotRun.replace("{count}",String(f.notRun))}):null,i&&c?l(Px,{since:c}):null,!i&&P!==void 0?l("span",{class:`${pe}-steps-time`,children:im(P)}):null,l("span",{class:`${pe}-steps-chevron`,"data-open":u?"true":void 0,children:l(sr,{})})]}),l("span",{class:`${pe}-sr-only`,role:"status",children:i?g:""}),l("div",{class:`${pe}-steps-body`,"data-open":u?"true":void 0,inert:!u,children:l("div",{class:`${pe}-steps-body-inner`,children:_?l("ol",{class:`${pe}-steps-list`,children:f.rows.map((y,x)=>y.kind==="tool"?l(kx,{row:y,strings:o},y.part.toolCallId):l(Rc,{part:y.part,current:i&&x===f.rows.length-1,reasoningMs:r?.[t[x]??-1]?.reasoningMs,strings:o},`${y.part.id}#${x}`))}):null})})]})}function Px({since:e}){let[t,r]=U(()=>Date.now());H(()=>{let o=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(o)},[]);let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));return l("span",{class:`${pe}-steps-time`,children:n<60?`${n} s`:`${Math.floor(n/60)} m ${n%60} s`})}function xx({running:e,stopped:t}){return e?l("span",{class:`${pe}-loading-spinner`}):t?l(kr,{}):l(qi,{})}function Sx(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace("{count}",String(e))}function wx({view:e,strings:t}){return e.stopped?l(ge,{children:Sx(e.stopped.finished,t)}):e.single?l(ge,{children:[e.single.name,e.single.summary?l(ge,{children:[l("span",{class:`${pe}-steps-sep`,"aria-hidden":"true",children:"\xB7"}),l("span",{class:`${pe}-steps-summary`,children:e.single.summary})]}):null]}):l(ge,{children:e.tools.map(({name:r,count:n},o)=>l("span",{class:`${pe}-steps-name`,children:[o>0?l("span",{class:`${pe}-steps-sep`,"aria-hidden":"true",children:"\xB7"}):null,r,n>1?l("span",{class:`${pe}-steps-count`,children:["\xD7",n]}):null]},r))})}function kx({row:e,strings:t}){let[r,n]=U(!1),{part:o,name:s,summary:i,status:a}=e,c=o.approvalSig.value,u=as(o);return l("li",{class:`${pe}-steps-row`,"data-testid":D.toolStep,"data-status":a,children:[l("span",{class:`${pe}-steps-row-icon`,"aria-hidden":"true",children:l(Tx,{status:a})}),l("div",{class:`${pe}-steps-row-main`,children:[l("button",{type:"button",class:`${pe}-steps-row-head`,"aria-expanded":r,onClick:()=>n(!r),children:[l("span",{class:`${pe}-steps-row-label`,children:[l("span",{class:`${pe}-steps-row-name`,children:s}),i?l("span",{class:`${pe}-steps-row-summary`,children:i}):null]}),a==="error"?l("span",{class:`${pe}-steps-failed`,children:t.statusError}):null,a==="denied"&&u===void 0?l("span",{class:`${pe}-steps-denied`,children:t.statusDenied}):null,c&&u!==void 0?l(Ac,{approved:u,children:Cx(c,t)}):null,a==="stopped"?l("span",{class:`${pe}-steps-denied`,children:t.statusStopped}):null,a==="superseded"?l("span",{class:`${pe}-steps-denied`,children:t.statusSuperseded}):null,l("span",{class:`${pe}-steps-chevron`,"data-open":r?"true":void 0,children:l(sr,{})})]}),r?l("div",{class:`${pe}-steps-row-body`,children:[c?.isAutomatic&&c.reason?l("p",{class:`${pe}-steps-row-reason`,children:c.reason}):null,l(vn,{label:t.toolParameters,value:o.inputSig.value}),o.outputSig.value!==void 0?l(vn,{label:t.toolResult,value:o.outputSig.value}):null,o.errorSig.value?l(vn,{label:t.statusError,value:o.errorSig.value,error:!0}):null]}):null]})]})}function Ac({approved:e,children:t}){return l("span",{class:`${pe}-steps-decision`,"data-approved":e?"true":"false",children:[e?l(Tr,{}):l(gn,{}),t]})}function as(e){let t=e.approvalSig.value;return t?.replacedByMessageId?void 0:t?.approved}function Cx(e,t){return e.isAutomatic?e.approved?t.statusAutoApproved:t.statusAutoDeclined:e.approved?t.statusApproved:t.statusDeclined}function Tx({status:e}){return e==="running"?l("span",{class:`${pe}-loading-spinner`}):e==="stopped"?l(kr,{}):e==="error"||e==="denied"||e==="superseded"?l(gn,{}):l(Tr,{})}function Rc({part:e,current:t,reasoningMs:r,strings:n,standalone:o=!1}){let[s,i]=U(!1),a=ve(()=>Se(()=>e.textSig.value.trim()===""),[e]).value,c=l("span",{class:t?`${pe}-steps-thought-label ${pe}-steps-live`:`${pe}-steps-thought-label`,children:vx({streaming:t,reasoningMs:r},n)});return l(o?"div":"li",{class:`${pe}-steps-row ${pe}-steps-thought`,"data-status":"thought","data-testid":o?D.reasoning:void 0,children:[l("span",{class:`${pe}-steps-row-icon`,"aria-hidden":"true",children:l(X_,{})}),l("div",{class:`${pe}-steps-row-main`,children:[a?c:l("button",{type:"button",class:`${pe}-steps-row-head`,"aria-expanded":s,onClick:()=>i(!s),children:[c,l("span",{class:`${pe}-steps-chevron`,"data-open":s?"true":void 0,children:l(sr,{})})]}),s&&!a?l("div",{class:`${pe}-steps-thought-text ${pe}-reasoning-body`,children:l(Yo,{textSig:e.textSig,doneSig:e.doneSig})}):null]})]})}var ot=q.cssPrefix,lm=Hf(Ix);function Ix({message:e,status:t,createdAt:r,strings:n,locale:o,responseMode:s,showReasoning:i,showToolCalls:a,showSources:c,interactive:u=!1,superseded:p=!1,tool:_,onRetry:d,enableMessageFeedback:f=!1,onFeedback:v,reconnecting:g=!1,clientToolRunning:P=!1,onCardAction:b}){let x=[...ve(()=>Se(()=>e.partsSig.value),[e]).value];for(let ye of e.attachments??[])!ye.url||x.some(Oe=>Oe.kind==="file"&&Oe.url===ye.url)||x.push({kind:"file",url:ye.url,mediaType:ye.mediaType,filename:ye.name,fileId:ye.id,fileSize:ye.size});let S=ve(()=>Se(()=>_n(e)),[e,t,e.canceled]),k=ve(()=>Se(()=>jf(e)),[e]),h=ve(()=>Se(()=>i&&Vf(e)),[e,i]),m=ve(()=>Se(()=>r_(e,h.value)),[e,h,t,e.canceled]),w=ve(()=>Se(()=>!oc(e)),[e]),A=t==="streaming",I=e.role==="assistant"&&P,R=e.role==="assistant"&&(A||I),C=A||I,M=Wf({streaming:R,responseMode:s,reasoningVisible:h.value,hasAnswerText:k.value,emptyReply:S.value,hidden:m.value}),{bufferedHold:N,showStreamDots:j}=M;if(M.hidden)return null;let G=Rx(r,o),z=e.role==="assistant"||e.role==="operator",le=f&&!!v&&!!e.serverMessageId&&z&&!C&&t!=="error"&&!S.value,ue=C?"":x.filter(ye=>ye.kind==="text").map(ye=>e.role==="assistant"?yi(ye.textSig.peek()):ye.textSig.peek()).join(`
63
+ ${r}`:"";i||(t++,s&&(r+="> "));let _={};a.replace(/(\w+)=(["'])(.*?)\2/g,(v,g,y,b)=>_[g]=b);let d=_.href??_.src,f=_.title??_.path??_.query??_.body??_.header??_.name??d;return(s?"> ":"")+(f?`**${d?`[${f}](${d})`:f}**${_.type?` \`${_.type}\``:""}
64
+ ${r}`:"")})}var nP=new Set(["http:","https:","mailto:","tel:"]),oP=new Set(["http:","https:"]);function iP(e){let t=document.createElement("a");return{...e,set_attr:(r,n,o)=>{if(n!==Un&&n!==Ao||(t.href=o,(n===Un?nP:oP).has(t.protocol)))return e.set_attr(r,n,o);let s=n===Ao?r.nodes[r.index]:void 0;s?.replaceWith(...s.childNodes)}}}function df(e){for(let t of e.querySelectorAll("a")){let r=t.getAttribute("href")??"";!r||r.startsWith("#")||(t.target="_blank",t.rel="noopener noreferrer")}}var uf=new Set([11,12,13,14,15,16,17,18,19,31]);function za(e){let t="",r=[],n=Eo({data:void 0,add_token:(o,s)=>{r.push(s),uf.has(s)||(t+=" ")},end_token:()=>{let o=r.pop();o!==void 0&&!uf.has(o)&&(t+=" ")},add_text:(o,s)=>{t+=s},set_attr:()=>{}});return ot(n,mc(e)),Bn(n),t.replaceAll(Ua,"_").replace(/\s+/g," ").trim()}var _f=D.cssPrefix;function Vt({tone:e="info",message:t,onRetry:r,strings:n}){return l("div",{class:`${_f}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[l("span",{children:t}),r?l("button",{type:"button",class:`${_f}-module-retry`,onClick:r,children:n.errorRetry}):null]})}var Fr=D.cssPrefix,aP=te.scope("content"),sP=5e3;function ff({id:e,title:t,transport:r,strings:n,bus:o,onBack:s,actions:a}){let[i,c]=U(null),[u,p]=U(!1),[_,d]=U(!1),[f,v]=U(0),[g,y]=U(null),b=F(()=>{d(!1),c(null),v(k=>k+1)},[]);H(()=>{let k=!1,h=r.listContentCollections([]).catch(()=>{});return Promise.all([r.listContent({ids:[e],limit:1}),h]).then(([m,S])=>{if(k)return;let A=m.items[0];A?(c(A),p(S?.items.find(I=>I.id===A.contentCollectionId)?.settings?.voteAccess==="portal"),o.emit("contentOpen",{contentId:e,contentCollectionId:A.contentCollectionId})):d(!0)}).catch(m=>{k||(aP.warn("listContent (reader) failed",{err:m}),d(!0))}),()=>{k=!0}},[r,e,f,o]),H(()=>{if(!i)return;let k=setTimeout(()=>o.emit("contentRead",{contentId:e}),sP);return()=>clearTimeout(k)},[i,e,o]);let P=F(k=>{let m=(k.target instanceof HTMLElement?k.target.closest("a"):null)?.getAttribute("href")??"";m&&!m.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function w(k){y(e),r.setContentVote({contentId:e,value:k})}function x(){return _?l(Vt,{tone:"error",message:n.errorGeneric,onRetry:b,strings:n}):i===null?l(Vt,{message:n.contentLoading,strings:n}):l("article",{class:`${Fr}-content`,"data-testid":q.contentView,onClick:P,children:[i.image?l("img",{class:`${Fr}-content-hero`,src:i.image,alt:"",loading:"lazy"}):null,i.description?l("p",{class:`${Fr}-content-subtitle`,children:i.description}):null,l(Ba,{text:pf(i.content??"")}),u?l("div",{class:`${Fr}-content-vote`,"aria-live":"polite",children:g===e?n.feedbackThanks:l(ve,{children:[l("span",{children:n.contentHelpful}),l("button",{type:"button",class:`${Fr}-module-retry`,onClick:()=>w(1),children:n.confirmYes}),l("button",{type:"button",class:`${Fr}-module-retry`,onClick:()=>w(0),children:n.confirmNo})]})}):null]})}return l("div",{class:`${Fr}-module`,children:[l(cf,{title:i?.title||t||n.moduleBack,backLabel:n.moduleBack,onBack:s,actions:a,testid:q.backHeader}),l("div",{class:`${Fr}-module-scroll`,"data-testid":q.contentScroll,children:x()})]})}function mf({itemCount:e,initialFocusIndex:t}){let[r,n]=U(!1),o=B(null),s=B(null),[a,i]=U(-1),c=F(()=>{n(!1),i(-1),o.current?.focus()},[]),u=F(()=>n(d=>!d),[]);H(()=>{if(!r)return;function d(f){let v=s.current,g=o.current;if(!v||!g)return;let y=f.composedPath();y.includes(v)||y.includes(g)||(n(!1),i(-1))}return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[r]),H(()=>{if(!r||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;i(f)},[r,e,t]),H(()=>{if(!r||a<0)return;s.current?.querySelectorAll("[role='menuitem']")?.[a]?.focus()},[r,a]);let p=F(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n(!0))},[]),_=F(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),d.stopPropagation(),c();return;case"ArrowDown":d.preventDefault(),i(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),i(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),i(0);return;case"End":d.preventDefault(),i(e-1)}},[e,c]);return{open:r,focusIndex:a,triggerRef:o,menuRef:s,toggle:u,close:c,onTriggerKey:p,onMenuKey:_}}function gf({items:e,triggerLabel:t}){let r=D.cssPrefix,n=mf({itemCount:e.length});function o(i){i.disabled||(i.onSelect?.(),i.keepOpen||n.close())}function s(i,c){return i.onSelectValue?.(c)}function a(i,c){let u=c.segments;if(!u?.length)return;let p=Math.max(0,u.findIndex(f=>f.value===c.value)),_=-1;if(i.key==="ArrowRight"||i.key==="Enter"||i.key===" ")_=(p+1)%u.length;else if(i.key==="ArrowLeft")_=(p-1+u.length)%u.length;else return;let d=u[_];d&&(i.preventDefault(),i.stopPropagation(),s(c,d.value))}return l("div",{class:`${r}-menu-wrap`,children:[l("button",{ref:n.triggerRef,type:"button",class:`${r}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":n.open,title:t,onClick:n.toggle,onKeyDown:n.onTriggerKey,children:l(z_,{})}),n.open?l("div",{ref:n.menuRef,class:`${r}-menu`,role:"menu","aria-label":t,onKeyDown:n.onMenuKey,tabIndex:-1,children:e.map(i=>i.segments?l("div",{role:"menuitem",class:`${r}-menu-item ${r}-menu-item-segmented`,"aria-label":i.label,tabIndex:-1,onKeyDown:c=>a(c,i),children:[i.icon?l("span",{class:`${r}-menu-icon`,children:i.icon}):null,l("span",{class:`${r}-menu-label`,children:i.label}),l("span",{class:`${r}-segmented`,role:"group","aria-label":i.label,children:i.segments.map(c=>{let u=c.value===i.value;return l("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${r}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${q.langSegment}-${c.value}`,onClick:()=>s(i,c.value),children:c.label},c.value)})})]},i.id):l("button",{type:"button",role:"menuitem",class:`${r}-menu-item`,"aria-pressed":i.type==="switch"?i.on:void 0,disabled:i.disabled,onClick:()=>o(i),children:[i.icon?l("span",{class:`${r}-menu-icon`,children:i.icon}):null,l("span",{class:`${r}-menu-label`,children:i.label}),i.type==="switch"&&i.on?l("span",{class:`${r}-menu-check`,"aria-hidden":"true",children:l(Qn,{})}):null]},i.id))}):null]})}var gc=D.cssPrefix;function lP(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 cP={normal:"large",large:"small",small:"normal"};function dP(e){return e==="light"?l(Y_,{}):e==="dark"?l(J_,{}):l(X_,{})}function uP(e,t){let r=e.split("-")[0];return(t.some(o=>o!==e&&o.split("-")[0]===r)?e:r??e).toUpperCase()}function pP(e,t){let r;try{r=new URL(e,window.location.href)}catch{return}if(!(r.protocol!=="http:"&&r.protocol!=="https:"))return t.conversationId&&r.searchParams.set("chat",t.conversationId),r.searchParams.set("widgetId",t.widgetId),t.publicKey&&r.searchParams.set("public_key",t.publicKey),r.searchParams.set("ai_agent_deployment_id",t.aiAgentDeploymentId),r.href}function dr({panelProps:e,variant:t,onEmailTranscript:r,onLogIn:n}){let{options:o,panelSize:s,feedback:a,onClose:i,onClear:c,onExpand:u,onFullscreen:p,onSoundToggle:_}=e,{onToggleHistory:d,onLocaleChange:f,onThemeChange:v,onTextSizeChange:g}=e,y=o.strings,b=o.mode,P=t==="chat",w=It(()=>a.mutedSig.value).value,x=new Set(o.actions);function k(z){return x.has(z)}let h=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches;function m(z){return h?!1:Wn(z,b,s)}let S=o.themeMode,A={auto:y.themeAuto,light:y.themeLight,dark:y.themeDark},I=o.textSize,R={small:y.textSizeSmall,normal:y.textSizeNormal,large:y.textSizeLarge},C=[];if(P&&k("clear")&&C.push({id:"clear",icon:l(G_,{}),label:y.newConversation,onSelect:c}),P&&r&&C.push({id:"emailTranscript",icon:l(Na,{}),label:y.emailTranscript,onSelect:r}),P&&n&&C.push({id:"logIn",icon:l(Sr,{}),label:y.loginAction,onSelect:n}),k("expand")&&m("expand")){let z=s==="expanded";C.push({id:"expand",icon:z?l($_,{}):l(O_,{}),label:z?y.collapse:y.expand,type:"switch",on:z,onSelect:u})}if(k("fullscreen")&&m("fullscreen")){let z=s==="fullscreen";C.push({id:"fullscreen",icon:z?l(q_,{}):l(D_,{}),label:z?y.exitFullscreen:y.fullscreen,type:"switch",on:z,onSelect:p})}let M=o.popOutUrl,N=o.aiAgentDeploymentId;k("popOut")&&M&&N&&Wn("popOut",b,s)&&C.push({id:"popOut",icon:l(U_,{}),label:y.popOut,onSelect:()=>{let z=pP(M,{conversationId:e.conversationId,widgetId:o.widgetId,publicKey:o.publicKey,aiAgentDeploymentId:N});z&&window.open(z,"_blank","noopener,noreferrer")}}),P&&k("sound")&&C.push({id:"sound",icon:w?l(F_,{}):l(H_,{}),label:w?y.soundOff:y.soundOn,type:"switch",on:!w,onSelect:_}),k("theme")&&S!=="host"&&C.push({id:"theme",icon:dP(S),label:`${y.theme}: ${A[S]}`,onSelect:()=>v(lP(S)),keepOpen:!0}),k("textSize")&&C.push({id:"textSize",icon:l(j_,{}),label:`${y.textSize}: ${R[I]}`,onSelect:()=>g(cP[I]),keepOpen:!0}),k("language")&&o.availableLocales.length>1&&C.push({id:"language",icon:l(W_,{}),label:y.language,segments:o.availableLocales.map(z=>({value:z,label:uP(z,o.availableLocales),lang:z})),value:o.locale,onSelectValue:f});let j=!!i&&Aa(b,s,o.actions),G=P&&k("history");return l("div",{class:`${gc}-header-actions`,children:[G?l("button",{type:"button",class:`${gc}-icon-btn`,onClick:d,"aria-label":y.history,title:y.history,"data-testid":q.actionHistory,children:l(V_,{})}):null,C.length>0?l(gf,{items:C,triggerLabel:y.moreActions}):null,j?l("button",{type:"button",class:`${gc}-icon-btn`,onClick:i,"aria-label":y.close,title:y.close,"data-testid":q.actionClose,children:l(Bt,{})}):null]})}var vf={Icon:Qo};function wr(e,t){return e instanceof De?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 Xn=D.cssPrefix;function hf({placeholder:e,onActivate:t}){return l("button",{type:"button",class:`${Xn}-home-search`,onClick:t,"data-testid":q.homeSearch,children:[l("span",{class:`${Xn}-home-search-text`,children:e}),l("span",{class:`${Xn}-home-search-icon`,"aria-hidden":"true",children:l(fc,{})})]})}function yf({placeholder:e,value:t,onInput:r}){return l("div",{class:`${Xn}-home-search`,"data-input":"true",children:[l("input",{type:"search",class:`${Xn}-home-search-input`,placeholder:e,value:t,maxLength:200,onInput:n=>r(n.currentTarget.value),"data-testid":q.helpSearch}),l("span",{class:`${Xn}-home-search-icon`,"aria-hidden":"true",children:l(fc,{})})]})}var Xo=D.cssPrefix;function Ha({title:e,subtitle:t,onClick:r,testid:n}){return l("button",{type:"button",class:`${Xo}-list-row`,onClick:r,"data-testid":n,children:[l("span",{class:`${Xo}-list-row-body`,children:[l("span",{class:`${Xo}-list-row-title`,children:e}),t?l("span",{class:`${Xo}-list-row-sub`,children:t}):null]}),l("span",{class:`${Xo}-list-row-chevron`,"aria-hidden":"true",children:l(Ma,{})})]})}var ur=D.cssPrefix,_P=te.scope("help"),fP=20,mP=300;function gP(e,t,r){let n=new Map(r.map(o=>[o.id,o.title]));return t.map(o=>({id:o,title:n.get(o),rows:e.filter(s=>s.contentCollectionId===o)})).filter(o=>o.rows.length>0)}function bf({transport:e,strings:t,bus:r},n,o){let[s,a]=U(),i=B(void 0),c=n?.join(",");function u(p){if(!n?.length)return;let _={};i.current=_,a(d=>({search:o,items:[],collections:[],...d,pagination:p>1?d?.pagination:void 0,loading:!0,error:void 0})),Promise.all([e.listContent({contentCollectionIds:n,sortBy:"order",page:p,limit:fP,search:o}),p>1?void 0:e.listContentCollections(n)]).then(([d,f])=>{i.current===_&&(a(v=>({search:o,items:[...p>1?v?.items??[]:[],...d.items],collections:f?.items??v?.collections??[],pagination:d.pagination,loading:!1})),!(p>1)&&(o?r.emit("contentSearch",{queryLength:o.length,hitCount:d.pagination.total}):r.emit("contentView",{section:"help",count:d.items.length})))}).catch(d=>{i.current===_&&(_P.warn("listContent (help) failed",{err:d,page:p}),a(f=>f&&{...f,loading:!1,error:wr(d,t)}))})}return H(()=>{if(!n?.length){a(void 0);return}return u(1),()=>{i.current=void 0}},[e,c,o]),[s,()=>!s?.loading&&u((s?.pagination?.page??0)+1)]}function vP(e){let{strings:t,config:r,nav:n,panelProps:o}=e,s=r.contentCollectionIds,[a,i]=U(""),[c,u]=U(""),p=bf(e,s),_=bf(e,c?s:void 0,c),[d,f]=a.trim()?_:p;H(()=>{let g=setTimeout(()=>u(a.trim()),mP);return()=>clearTimeout(g)},[a]);function v(){if(!s?.length)return l(Vt,{message:t.helpEmpty,strings:t});let g=d?.error?l(Vt,{tone:"error",message:d.error,onRetry:f,strings:t}):null;return g&&!d?.pagination?g:!d||!d.pagination&&!d.items.length?l(Vt,{message:t.helpLoading,strings:t}):d.items.length?l(ve,{children:[gP(d.items,s,d.collections).map(y=>l("section",{class:`${ur}-help-group`,children:[y.title?l("h2",{class:`${ur}-help-section-title`,children:y.title}):null,l("div",{class:`${ur}-help-card`,children:y.rows.map(b=>l(Ha,{title:b.title,subtitle:b.description,onClick:()=>b.url?Vo(b.url):n.push({kind:"content",id:b.id,title:b.title}),testid:Ct(q.helpArticle,b.id)},b.id))})]},y.id)),g,d.pagination?.hasNext&&!g?l("div",{children:l("div",{class:`${ur}-help-card`,children:l("button",{type:"button",class:`${ur}-list-row ${ur}-help-more`,onClick:f,"aria-busy":d.loading,children:[d.loading?l("span",{class:`${ur}-loading-spinner`,"aria-hidden":"true"}):null,t.helpShowMore]})})}):null]}):l(Vt,{message:d.search?t.helpSearchEmpty.replace("{query}",d.search):t.helpEmpty,strings:t})}return l("div",{class:`${ur}-module`,children:[l(qa,{title:t.helpTitle,actions:l(dr,{panelProps:o,variant:"plain"})}),l("div",{class:`${ur}-module-pad`,children:l(yf,{placeholder:t.helpSearchPlaceholder,value:a,onInput:i})}),l("div",{class:`${ur}-help-list`,children:v()})]})}var Pf={Icon:Ko,Root:e=>l(vP,{...e})};var xf=te.scope("attachments");function Fa(e,t,r){let n=yP(e),o=[],s=[],a=wf(r.accept),i=t.reduce((u,p)=>u+p.size,0),c=t.length;for(let u of n){let p=hP(u,c,i,r,a);if(p){s.push({file:u,reason:p});continue}o.push(SP(u)),i+=u.size,c+=1}return(o.length||s.length)&&xf.debug("ingest",{accepted:o.length,rejected:s.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:s}}function Zn(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 Sf(e,t){let r=wf(t);return!e||r.length===0||r.some(n=>n.kind==="ext"||kf(new File([],"",{type:e}),[n]))}function eo(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){xf.debug("revokeObjectURL failed",{error:t})}}function hP(e,t,r,n,o){return t>=n.maxCount?"count":r+e.size>n.maxBytes?"bytes":kf(e,o)?null:"mime"}function yP(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:bP(t)).filter(t=>t!==null):[]}function bP(e){let t=PP(e)?e:null;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function PP(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 SP(e){return{file:e,id:Gt(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function wf(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[r="*",n="*"]=t.split("/");return{kind:"mime",type:r,subtype:n}})}function kf(e,t){if(t.length===0)return!0;let[r="*",n="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(s=>s.kind==="ext"?o.endsWith(s.ext):s.type==="image"&&s.subtype==="*"&&/\.(heic|heif|avif|bmp|tif|tiff)$/.test(o)?!0:(s.type==="*"||s.type===r)&&(s.subtype==="*"||s.subtype===n))}var jr=D.cssPrefix,wP={error:Yn,done:Qn};function Cf({attachment:e,upload:t,strings:r,onRemove:n,disabled:o=!1}){let s=/^image\/(jpeg|png|gif|webp|avif|bmp|x-ms-bmp|svg\+xml)$/i.test(e.mediaType),a=Math.round((t?.fraction??0)*100),i=Zn(e.size),c=t?.status==="error"||t?.status==="done"?wP[t.status]:void 0;return l("span",{class:`${jr}-attachment-chip`,"data-upload":t?.status,title:e.name,"data-testid":Ct(q.attachmentChip,e.id),children:[s?l("img",{class:`${jr}-attachment-thumb`,src:e.previewUrl,alt:""}):l("span",{class:`${jr}-attachment-thumb`,"aria-hidden":"true",children:l(Oa,{})}),l("span",{class:`${jr}-attachment-text`,children:[l("span",{class:`${jr}-attachment-name`,children:e.name}),l("span",{class:`${jr}-attachment-meta`,children:[c?l(c,{}):null,t?.status==="uploading"?`${a}% \xB7 ${i}`:i]})]}),l("button",{type:"button",class:`${jr}-attachment-remove`,onClick:n,disabled:o,"aria-label":r.removeAttachment.replace("{name}",e.name),"data-testid":Ct(q.attachmentRemove,e.id),children:l(Bt,{})}),t?.status==="uploading"?l("span",{class:`${jr}-attachment-progress`,role:"progressbar","aria-label":e.name,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:l("span",{style:{width:`${a}%`}})}):null]})}var Tf=new WeakMap;function ja(e){e.currentTarget&&Tf.set(e.currentTarget,e.timeStamp)}function Va(e){let t=e.currentTarget?Tf.get(e.currentTarget):void 0;return e.isComposing||t!==void 0&&e.timeStamp-t<100}var Wa=D.cssPrefix;function Zo({text:e,retryLabel:t,onRetry:r,retryTestId:n}){return l("div",{class:`${Wa}-error`,role:"alert",children:[l("span",{class:`${Wa}-error-icon`,"aria-hidden":"true",children:l(Yn,{})}),l("span",{class:`${Wa}-error-text`,children:e}),r&&t?l("button",{type:"button",class:`${Wa}-error-retry`,onClick:r,"data-testid":n,children:t}):null]})}var vc={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function hc(e,t,r){return e==="disabled"?vc:e==="server"?IP(r):kP(t)}function kP(e){let t=CP();if(!t)return vc;let r=null,n=0;return{isSupported:!0,start(o,s){let a=r,i=++n;r=null,a?.abort();let c=new t;r=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",_=>{if(n!==i||r!==c)return;let d=_,f="",v=!1;for(let g=d.resultIndex;g<d.results.length;g++){let y=d.results[g];y&&(f+=y[0].transcript,y.isFinal&&(v=!0))}o(f,v)});function p(_){u||n!==i||r!==c||(u=!0,r=null,s(_))}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(){r?.stop()},cancel(){n++;let o=r;r=null,o?.abort()}}}function CP(){return window.SpeechRecognition??window.webkitSpeechRecognition}var TP=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function IP(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return vc;let t=0,r=null;function n(a){for(let i of a.stream?.getTracks()??[])i.stop();a.stream=null}function o(){t++;let a=r;r=null,a&&(n(a),a.recorder?.state!=="inactive"&&a.recorder?.stop())}async function s(a){if(a.finishing)return;a.finishing=!0;let i=a.recorder?.mimeType??"audio/webm";n(a);let c=new Blob(a.chunks,{type:i});a.chunks=[];try{let{text:u}=await e(c,i);r===a&&t===a.generation&&u&&a.onText(u,!0)}catch{}finally{r===a&&t===a.generation&&(r=null,a.onEnd(!1))}}return{isSupported:!0,async start(a,i){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:a,onEnd:i,finishing:!1};r=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(r!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let p=AP(),_=new MediaRecorder(u,p?{mimeType:p}:void 0);c.recorder=_,_.addEventListener("dataavailable",d=>{r===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),_.addEventListener("stop",()=>{r===c&&t===c.generation&&s(c)}),_.start()}catch(u){n(c),r===c&&t===c.generation&&(r=null,i(u instanceof DOMException&&u.name==="NotAllowedError"))}},stop(){let a=r;if(a){if(!a.recorder){o();return}a.recorder.state!=="inactive"&&a.recorder.stop()}},cancel(){o()}}}function AP(){for(let e of TP)if(MediaRecorder.isTypeSupported(e))return e}function RP(e,{file:t,reason:r},n){return r==="count"?e.attachmentTooMany.replace("{count}",String(n.maxCount)):r==="bytes"?e.attachmentTooLarge.replace("{name}",t.name).replace("{max}",Zn(n.maxBytes)):e.attachmentMimeRejected.replace("{name}",t.name)}var Ye=D.cssPrefix,to=te.scope("composer"),EP=300;function ro(e){return e.reduce((t,r)=>t+r.size,0)}var yc={arrowUp:M_,paperPlane:E_,send:L_,chevron:Ma};function If(e){return"activeElement"in e}function MP(e){return"host"in e&&"activeElement"in e}function LP(e){return"clipboardData"in e}function Af({options:e,transport:t,feedback:r,bus:n,persistence:o,conversationId:s,maxMessageCharacters:a,isStreaming:i,pageToolRunning:c=!1,isMemoryCompacting:u=!1,canReleaseQueuedMessages:p=!0,queueManualMessages:_=!1,replyAwaitsCard:d=!1,active:f=!0,isPreparing:v=!1,attachmentUploadsSig:g,operatorRequestEnabled:y,canRequestOperator:b=!1,controlMode:P="ai-agent",onRequestOperator:w,onSend:x,onStop:k,apiRef:h}){let m=e.strings,[S,A]=U(()=>o.loadDraft(s)),[I,R]=U([]),[C,M]=U(),[N,j]=U(()=>o.loadMessageQueue(s).map(V=>({id:V.id,text:V.text,attachments:[]}))),G=B(N),z=B(!1),ce=B(void 0),[pe,_e]=U(!1),[se,ge]=U(!1),[at,st]=U(!1),[Ge,At]=U(!1),Ee=B(!1),rt=B(null),Mt=B(null),Tt=B(null),ie=B(0),Se=B(s);Se.current=s;let Ue=B(f);Ue.current=f;let be=B(v);be.current=v;let Be=Ge||v||!f,Re=i&&P==="ai-agent",Pt=Re||u&&P==="ai-agent",$=P==="ai-agent"&&(Pt||_||N.length>0),L=F(V=>{j(J=>{let Q=V(J);return o.saveMessageQueue(Se.current,Q.filter(fe=>fe.attachments.length===0).map(({id:fe,text:Oe})=>({id:fe,text:Oe}))),G.current=Q,Q})},[o]),Y=F(V=>{L(J=>(J.find(Q=>Q.id===V)?.attachments.forEach(eo),J.filter(Q=>Q.id!==V)))},[L]),K=F(V=>{A(J=>{let Q=(typeof V=="function"?V(J):V).slice(0,a);return Q===J?J:(o.saveDraft(Se.current,Q),Q)})},[o,a]),re=e.features.fileUpload,ye=e.features.voice,[de,Pe]=U(()=>hc(ye,e.locale,(V,J)=>t.transcribe(V,J))),lt=B(de);lt.current=de;let ze=B({mode:ye,locale:e.locale,transport:t});H(()=>{let V=ze.current;V.mode===ye&&V.locale===e.locale&&V.transport===t||(ze.current={mode:ye,locale:e.locale,transport:t},ie.current++,lt.current.cancel(),Tt.current=null,ge(!1),Pe(hc(ye,e.locale,(J,Q)=>t.transcribe(J,Q))))},[e.locale,ye,t]),St(()=>()=>{ie.current++,de.cancel()},[de]);let _t=F(V=>{let J=Tt.current;if(J===null)return!1;let Q=Math.round(performance.now()-J);return to[V]("voiceStop",{durationMs:Q}),n.emit("voiceStop",{durationMs:Q}),Tt.current=null,!0},[n]),je=F(()=>{Tt.current!==null&&(de.stop(),ge(!1),_t("info")&&r.play("voiceStop"))},[_t,r,de]),Lt=F(()=>{ie.current++,de.cancel(),ge(!1),_t("info")&&r.play("voiceStop")},[_t,r,de]);H(()=>{(v||!f)&&Lt()},[f,Lt,v]),H(()=>{let V=rt.current;if(!V)return;let J=V.getRootNode(),Q=If(J)?J.activeElement:null;Q&&V.closest(`.${Ye}-panel`)?.contains(Q)||V.focus({preventScroll:!0})},[]),H(()=>{let V=rt.current;if(!V)return;if(S.length===0){V.style.height="";return}V.style.height="auto";let J=getComputedStyle(V),Q=Number.parseFloat(J.getPropertyValue(`--${Ye}-textarea-base-height`)),fe=Number.parseFloat(J.borderTopWidth)+Number.parseFloat(J.borderBottomWidth),Oe=Math.min(V.scrollHeight+fe,Number.parseFloat(J.maxHeight)),Rt=Number.parseFloat(J.fontSize)*.7;V.style.height=`${Oe<Q+Rt?Q:Oe}px`},[S]);let Wt=B(I);Wt.current=I,H(()=>()=>{Wt.current.forEach(eo);for(let V of G.current)V.attachments.forEach(eo)},[]),St(()=>{if(h)return h.current={attachFromDrop:V=>{if(!re||!Ue.current||Ee.current||be.current)return;let J=Fa(V,Wt.current,e.attachments);M(J.rejected[0]),J.accepted.length!==0&&(to.info("attach (drop)",{count:J.accepted.length,totalBytes:ro(J.accepted)}),n.emit("attach",{count:J.accepted.length,totalBytes:ro(J.accepted)}),R(Q=>[...Q,...J.accepted]))},fill:V=>{if(!Ue.current||Ee.current||be.current)return;K(V);let J=rt.current;J&&(J.focus({preventScroll:!0}),requestAnimationFrame(()=>J.setSelectionRange(J.value.length,J.value.length)))},acceptQueuedMessage:Y},()=>{h.current&&(h.current=null)}},[h,re,v,e.attachments,Y,K]),H(()=>{let V=rt.current;if(!V)return;let J=V.closest(`.${Ye}-panel`);if(!J)return;let Q=Oe=>{if(!Ue.current||Ee.current||be.current)return;let Rt=Oe.clipboardData;if(!Rt)return;let pr=Oe.target instanceof HTMLElement?Oe.target.closest("input, textarea, [contenteditable]:not([contenteditable='false'])"):null;if(pr&&pr!==V)return;if(re){let Ht=Fa(Rt.items,Wt.current,e.attachments);if(M(Ht.rejected[0]),Ht.accepted.length>0){Oe.preventDefault(),to.info("attach (paste)",{count:Ht.accepted.length,totalBytes:ro(Ht.accepted)}),n.emit("attach",{count:Ht.accepted.length,totalBytes:ro(Ht.accepted)}),R(ms=>[...ms,...Ht.accepted]);return}}if(pr===V)return;let _r=Rt.getData("text/plain");_r&&(Oe.preventDefault(),K(Ht=>Ht+_r),V.focus())};function fe(Oe){LP(Oe)&&Q(Oe)}return J.addEventListener("paste",fe),()=>J.removeEventListener("paste",fe)},[re,e.attachments,K]);async function Yt(){let V=S.trim();if(!V&&I.length===0||!f||Re||Ee.current||v)return;Lt(),Ee.current=!0,At(!0);let J=S,Q=I;try{await x(V,Q)&&(M(void 0),K(fe=>fe===J?"":fe),R(fe=>fe!==Q?fe:(Q.forEach(eo),Wt.current=[],[])))}finally{Ee.current=!1,At(!1),requestAnimationFrame(()=>{let fe=rt.current;if(!fe||fe.disabled||!Ue.current)return;let Oe=fe.getRootNode(),Rt=If(Oe)?Oe.activeElement:null,pr=Rt?.getAttribute("data-testid");if(!(Rt&&Rt!==fe&&pr!==q.composerSend&&pr!==q.composerStop)){if(MP(Oe)){let _r=Oe.host.ownerDocument;if(!_r.hasFocus())return;let Ht=_r.activeElement;if(Ht&&Ht!==Oe.host&&Ht!==_r.body)return}fe.focus({preventScroll:!0})}})}}function ft(){let V=S.trim();if(!V&&I.length===0||!f||!$||Ee.current||v)return;Lt();let J=I;L(Q=>[...Q,{id:Gt(),text:V,attachments:J}]),Pt||_e(!0),K(""),R(Q=>Q!==J?Q:(Wt.current=[],[])),rt.current?.focus({preventScroll:!0})}H(()=>{Pt&&(z.current=!1,ce.current=void 0,_e(!1))},[Pt]),H(()=>{let V=N[0];if(!V||!p||Pt||z.current||Ge||v||!f)return;let J=d&&!pe?(ce.current??(ce.current=performance.now()+e.cardAnswerWaitSeconds*1e3))-performance.now():0,Q=setTimeout(()=>{z.current=!0,x(V.text,V.attachments,V.id).then(fe=>{if(fe){Y(V.id);return}z.current=!1})},Math.max(J,EP));return()=>clearTimeout(Q)},[f,p,pe,v,x,e.cardAnswerWaitSeconds,Pt,N,Y,d,Ge]);function xt(V){V.key!=="Enter"||V.shiftKey||Va(V)||(V.preventDefault(),$&&(S.trim()||I.length>0)?ft():Re?k():Yt())}function Jt(V){if(!(V.target instanceof HTMLInputElement))return;let J=V.target;if(!f||Ee.current||v){J.value="";return}let Q=Fa(J.files,I,e.attachments);M(Q.rejected[0]),Q.accepted.length>0&&(to.info("attach (file picker)",{count:Q.accepted.length,totalBytes:ro(Q.accepted)}),n.emit("attach",{count:Q.accepted.length,totalBytes:ro(Q.accepted)}),R(fe=>[...fe,...Q.accepted])),J.value=""}function yn(V){!f||Ee.current||v||(to.info("removeAttachment",{id:V}),n.emit("removeAttachment",{id:V}),M(void 0),R(J=>{let Q=J.find(fe=>fe.id===V);return Q&&eo(Q),J.filter(fe=>fe.id!==V)}))}function bn(){if(se){je();return}if(!f||!de.isSupported||Ee.current||v)return;let V=++ie.current;Tt.current=performance.now(),to.info("voiceStart"),n.emit("voiceStart",void 0),st(!1),ge(!0),r.play("voiceStart"),de.start((J,Q)=>{ie.current!==V||!Ue.current||be.current||Ee.current||!Q||K(fe=>`${fe}${J} `)},J=>{ie.current!==V||!Ue.current||(ge(!1),st(J),_t("debug"))})}let Wr=yc[e.composer.sendButton.icon],Pn=!!(S.trim()||I.length>0),Gr=g?.value,ui=I.some(V=>Gr?.get(V.id)?.status==="uploading"),Kr=I.filter(V=>Gr?.get(V.id)?.status==="error"),xn=Kr.find(V=>Gr?.get(V.id)?.refusal),fs=xn&&(Gr?.get(xn.id)?.refusal==="INVALID_FILE_TYPE"?m.attachmentMimeRejected:m.attachmentUploadFailed).replace("{name}",xn.name),pi=Re||ui||c&&!Pn;return l("div",{class:`${Ye}-composer`,part:"composer","data-testid":q.composer,children:[N.length>0?l("div",{class:`${Ye}-message-queue`,"aria-label":m.queueMessage,"data-testid":q.messageQueue,children:N.map(V=>l("div",{class:`${Ye}-attachment-chip ${Ye}-queued-message`,"data-testid":`${q.queuedMessage}-${V.id}`,children:[l("span",{class:`${Ye}-attachment-name ${Ye}-queued-text`,children:V.text||V.attachments.map(J=>J.name).join(", ")}),l("button",{type:"button",class:`${Ye}-attachment-remove`,onClick:()=>Y(V.id),"aria-label":m.removeQueuedMessage,title:m.removeQueuedMessage,"data-testid":`${q.queuedMessageRemove}-${V.id}`,children:l(Bt,{})})]},V.id))}):null,I.length>0?l("div",{class:`${Ye}-attachments`,children:I.map(V=>l(Cf,{attachment:V,upload:Gr?.get(V.id),strings:m,onRemove:()=>yn(V.id),disabled:Be},V.id))}):null,Kr.length>0&&!Be?l(Zo,{text:fs??m.attachmentUploadFailed.replace("{name}",Kr.map(V=>V.name).join(", ")),retryLabel:m.errorRetry,onRetry:xn?void 0:()=>{Yt()},retryTestId:q.attachmentRetry}):null,C?l("p",{class:`${Ye}-field-error`,role:"alert",children:RP(m,C,e.attachments)}):null,at?l("p",{class:`${Ye}-field-error`,role:"alert",children:m.micBlocked}):null,a!==void 0&&S.length>=a*.9?l("p",{class:`${Ye}-field-${S.length<a?"hint":"error"}`,"data-testid":q.composerCount,children:`${S.length} / ${a}`}):null,l("div",{class:`${Ye}-composer-row`,children:[l("div",{class:`${Ye}-composer-actions`,children:[re?l("button",{type:"button",class:`${Ye}-icon-btn`,onClick:()=>Mt.current?.click(),disabled:Be,"aria-label":m.attach,title:m.attach,"data-testid":q.composerAttach,children:l(La,{})}):null,de.isSupported?l("button",{type:"button",class:`${Ye}-icon-btn`,onClick:bn,disabled:Be,"aria-label":se?m.micStop:m.micStart,title:se?m.micStop:m.micStart,"aria-pressed":se,"data-recording":se?"true":void 0,"data-testid":q.composerVoice,children:l(N_,{})}):null,y&&P==="ai-agent"&&w?l("button",{type:"button",class:`${Ye}-icon-btn`,onClick:w,disabled:Be||!b,"aria-label":m.talkToOperator,title:m.talkToOperator,"data-testid":q.operatorRequest,children:l(Sr,{})}):null]}),l("textarea",{ref:rt,name:"message",class:`${Ye}-textarea`,rows:1,value:S,maxLength:a,placeholder:m.composerPlaceholder,onInput:V=>K(V.currentTarget.value),onKeyDown:xt,onCompositionEnd:ja,disabled:Be,"aria-label":m.composerPlaceholder,"data-testid":q.composerInput}),$&&Pn?l("button",{type:"button",class:`${Ye}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:ft,disabled:Be,"aria-label":m.queueMessage,title:m.queueMessage,"data-testid":q.composerSend,children:l(Wr,{})}):null,pi?l("button",{type:"button",class:`${Ye}-send`,onClick:k,disabled:Be&&!ui,"aria-label":m.stop,"data-testid":q.composerStop,children:l(zr,{})}):null,!pi&&(!$||!Pn)?l("button",{type:"button",class:`${Ye}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{Yt()},disabled:Be||!S.trim()&&I.length===0,"aria-label":m.send,"data-testid":q.composerSend,children:l(Wr,{})}):null]}),l("input",{ref:Mt,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Jt,disabled:Be,class:`${Ye}-sr-only`,"data-testid":q.composerFileInput})]})}var Rf=D.cssPrefix;function Ga({onClick:e,children:t,testid:r}){return e?l("button",{type:"button",class:`${Rf}-home-card`,"data-interactive":"true",onClick:e,"data-testid":r,children:t}):l("div",{class:`${Rf}-home-card`,"data-testid":r,children:t})}function Ka(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var tr=D.cssPrefix,NP=te.scope("news"),OP=10;function bc(e,t){let r=e?new Date(e):void 0;if(!(!r||Number.isNaN(r.getTime())))return new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(r)}function $P({options:e,transport:t,strings:r,config:n,nav:o,bus:s,panelProps:a,latestNews:i}){let c=n.contentCollectionIds,u=c?.join(","),[p,_]=U({items:[],loading:!0}),d=B(void 0);function f(b){if(!c?.length)return;let P={};d.current=P,_(w=>({...w,loading:!0,error:void 0})),t.listContent({contentCollectionIds:c,sortBy:"publishedAt",sortOrder:"desc",page:b,limit:OP}).then(w=>{if(d.current!==P||(_(k=>({items:b>1?[...k.items,...w.items]:w.items,pagination:w.pagination,loading:!1})),b>1))return;s.emit("contentView",{section:"news",count:w.items.length});let x=w.items[0];x&&i.markSeen(x.id)}).catch(w=>{d.current===P&&(NP.warn("listContent (news) failed",{err:w,page:b}),_(x=>({...x,loading:!1,error:wr(w,r)})))})}function v(){p.loading||f((p.pagination?.page??0)+1)}H(()=>(_({items:[],loading:!0}),f(1),()=>{d.current=void 0}),[t,u]);function g(b){let P=bc(b.publishedAt,e.locale);return l("button",{type:"button",class:`${tr}-news-card`,onClick:()=>o.push({kind:"content",id:b.id,title:b.title}),"data-testid":Ct(q.newsItem,b.id),children:[b.image?l("img",{class:`${tr}-news-hero`,src:b.image,alt:"",loading:"lazy"}):null,l("span",{class:`${tr}-news-body`,children:[l("span",{class:`${tr}-news-title`,children:b.title}),P||b.tags?.length?l("span",{class:`${tr}-news-meta`,children:[P?l("time",{dateTime:b.publishedAt,children:P}):null,b.tags?.map(w=>l("span",{class:`${tr}-news-tag`,children:w},w))]}):null,b.description?l("span",{class:`${tr}-news-summary`,children:b.description}):null]})]},b.id)}function y(){if(!c?.length)return l(Vt,{message:r.newsEmpty,strings:r});let b=p.error?l(Vt,{tone:"error",message:p.error,onRetry:v,strings:r}):null;return b&&!p.pagination?b:p.pagination?p.items.length?l("div",{class:`${tr}-news-list`,children:[p.items.map(g),b,p.pagination.hasNext&&!b?l("button",{type:"button",class:`${tr}-news-more`,onClick:v,"aria-busy":p.loading,"data-testid":q.newsMore,children:[p.loading?l("span",{class:`${tr}-loading-spinner`,"aria-hidden":"true"}):null,r.newsShowMore]}):null]}):l(Vt,{message:r.newsEmpty,strings:r}):l(Vt,{message:r.newsLoading,strings:r})}return l("div",{class:`${tr}-module`,children:[l(qa,{title:r.newsTitle,actions:l(dr,{panelProps:a,variant:"plain"})}),l("div",{class:`${tr}-module-scroll`,children:y()})]})}var Ef={Icon:$a,Root:e=>l($P,{...e})};var we=D.cssPrefix,Mf=te.scope("home");function DP(e){let t=e.options.userContext?.name,r=e.config.greetingText?gt(e.strings,e.config.greetingText):void 0;if(r){let n=t?r.replace("{name}",t):r.replace(/\s*\{name\}\s*/," ").trim(),o=e.strings.homeGreetingLead;return{title:n,subtitle:n.toLowerCase()===o.toLowerCase()?void 0:o}}return t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}function qP(e,t){return t.url?Vo(t.url):e.push({kind:"content",id:t.id,title:t.title})}function UP({options:e,onAsk:t}){let[r,n]=U(""),{sendButton:o}=e.composer,s=yc[o.icon];function a(i){i.preventDefault();let c=r.trim();c&&(n(""),t(c))}return l("form",{class:`${we}-home-search ${we}-home-ask`,"data-input":"true",onSubmit:a,"data-testid":q.homeAsk,children:[l("input",{type:"text",class:`${we}-home-search-input`,placeholder:e.strings.homeAskPlaceholder,"aria-label":e.strings.homeAskPlaceholder,value:r,enterKeyHint:"send",onInput:i=>n(i.currentTarget.value)}),l("button",{type:"submit",class:`${we}-send`,"data-shape":o.shape,"data-variant":o.variant,disabled:!r.trim(),"aria-label":e.strings.send,children:l(s,{})})]})}function Lf(e,t){return xr(e,t,t.type!=="upsert"||t.activity===!0)}function BP(e){let{transport:t,strings:r,config:n,nav:o,bus:s,panelProps:a,latestNews:i}=e,[c,u]=U(null),[p,_]=U([]),d=n.contentCollectionIds?.join(","),f=e.options.modules.list.some(h=>h.layout==="chat");H(()=>{if(n.showRecentConversations===!1)return;let h=!1,m=!0,S=[],A=t.subscribeConversationChanges(I=>{m&&S.push(I),u(R=>Lf(R?[R]:[],I)[0]??null)});return t.listConversations({limit:f?50:1}).then(I=>{if(h)return;let R=S.reduce(Lf,I.conversations);S=[],m=!1,u(R[0]??null)}).catch(I=>{h||(S=[],m=!1,Mf.warn("listConversations (home) failed",{err:I}))}),()=>{h=!0,A()}},[t,n.showRecentConversations,f]),H(()=>{if(!n.contentCollectionIds?.length)return;let h=!1;return t.listContent({contentCollectionIds:n.contentCollectionIds,pinned:!0,limit:6}).then(m=>{h||(_(m.items),s.emit("contentView",{section:"home",count:m.items.length}))}).catch(m=>!h&&Mf.warn("listContent (home) failed",{err:m})),()=>{h=!0}},[t,d,s]);let v=DP(e),g=n.userAvatars??[],y=n.status,b=y?.text?gt(r,y.text):r.homeStatus,P=y?.url,w=n.contentBlockTitle?gt(r,n.contentBlockTitle):r.homeContentTitle,x=i.item,k=bc(x?.publishedAt,e.options.locale);return l("div",{class:`${we}-module ${we}-home`,"data-testid":q.homeView,children:l("div",{class:`${we}-home-scroll`,children:[l("div",{class:`${we}-home-hero`,children:[l("div",{class:`${we}-home-hero-top`,children:[n.brandName?l("span",{class:`${we}-home-brand`,"data-testid":q.homeBrand,children:n.brandName}):l("span",{class:`${we}-home-brand-spacer`,"aria-hidden":"true"}),l("div",{class:`${we}-home-hero-actions`,children:[g.length>0?l("div",{class:`${we}-home-avatars`,children:g.map(h=>l("span",{class:`${we}-home-avatar`,title:h.role?`${h.name} \xB7 ${h.role}`:h.name,children:h.avatar?l("img",{src:h.avatar,alt:"",loading:"lazy"}):l("span",{children:Ka(h.name)})},h.name))}):null,l(dr,{panelProps:a,variant:"plain"})]})]}),n.showGreeting!==!1?l(ve,{children:[l("h1",{class:`${we}-home-greeting`,"data-testid":q.homeGreeting,children:v.title}),v.subtitle?l("p",{class:`${we}-home-lead`,children:v.subtitle}):null]}):null]}),l("div",{class:`${we}-home-cards`,children:[f?l(UP,{options:e.options,onAsk:h=>o.startNewConversation(h)}):null,n.showSearchBar!==!1?l(hf,{placeholder:r.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,x?l(Ga,{onClick:()=>{i.markSeen(x.id),o.push({kind:"content",id:x.id,title:x.title})},testid:q.homeWhatsNew,children:l("div",{class:`${we}-home-recent-row`,"data-unread":i.unseen?"true":void 0,children:[l("span",{class:`${we}-home-recent-avatar`,"aria-hidden":"true",children:l($a,{})}),l("span",{class:`${we}-home-recent-body`,children:[l("span",{class:`${we}-home-recent-title`,children:r.homeWhatsNew}),l("span",{class:`${we}-home-recent-preview`,children:k?`${x.title} \xB7 ${k}`:x.title})]}),i.unseen?l("span",{class:`${we}-home-recent-dot`,role:"img","aria-label":r.newsUnseen}):null]})}):null,c?l(Ga,{onClick:()=>o.selectConversation(c),testid:q.homeRecent,children:l("div",{class:`${we}-home-recent-row`,"data-unread":c.hasUnread?"true":void 0,children:[l("span",{class:`${we}-home-recent-avatar`,"aria-hidden":"true",children:l(Qo,{})}),l("span",{class:`${we}-home-recent-body`,children:[l("span",{class:`${we}-home-recent-title`,children:c.title}),c.preview?l("span",{class:`${we}-home-recent-preview`,children:za(c.preview)}):null]}),c.hasUnread?l("span",{class:`${we}-home-recent-dot`,role:"img","aria-label":r.unread}):null]})}):null,y?l(Ga,{onClick:P?()=>Vo(P):void 0,children:l("div",{class:`${we}-home-status`,"data-level":y.level??"operational",children:[l("span",{class:`${we}-home-status-icon`,"aria-hidden":"true",children:l(K_,{})}),l("span",{class:`${we}-home-status-text`,children:b})]})}):null,p.length>0?l("section",{class:`${we}-home-content`,children:[l("div",{class:`${we}-home-content-title`,children:w}),l("div",{class:`${we}-home-content-list`,children:p.map(h=>l(Ha,{title:h.title,subtitle:h.description,onClick:()=>qP(o,h),testid:Ct(q.homeContentRow,h.id)},h.id))})]}):null]})]})})}var Nf={Icon:Q_,Root:e=>l(BP,{...e})};var Qa={chat:vf,home:Nf,help:Pf,news:Ef};var ei=D.cssPrefix;function Of({modules:e,activeTab:t,strings:r,hasUnread:n,onSelect:o}){return l("nav",{class:`${ei}-tabbar`,role:"tablist","aria-label":r.panelTitle,children:e.map(s=>{let a=Qa[s.layout].Icon,i=s.id===t,c=s.layout==="chat"&&n;return l("button",{type:"button",role:"tab","aria-selected":i,class:`${ei}-tab`,onClick:()=>o(s.id),"data-testid":Ct(q.tab,s.id),children:[l("span",{class:`${ei}-tab-icon`,children:[l(a,{}),c?l("span",{class:`${ei}-tab-badge`,"data-testid":q.tabBadge,role:"img","aria-label":r.unread}):null]}),l("span",{class:`${ei}-tab-label`,children:gt(r,s.label)})]},s.id)})})}var ti=D.cssPrefix;function $f({agent:e,strings:t,ticketReference:r,person:n=!1}){let o=e.status??"online",s=gt(t,e.name),a=e.title?gt(t,e.title):null,i=n?l(Sr,{}):l("span",{children:Ka(s)});return l("div",{class:`${ti}-agent`,children:[l("div",{class:`${ti}-agent-avatar`,"data-status":o,children:e.avatar?l("img",{src:e.avatar,alt:""}):i}),l("div",{class:`${ti}-agent-meta`,children:[l("strong",{children:s}),a||r?l("div",{class:`${ti}-agent-sub`,children:[r?l(zP,{reference:r,strings:t}):null,a?l("span",{children:a}):null]}):null]})]})}function zP({reference:e,strings:t}){let[r,n]=U(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})}return l("button",{type:"button",class:`${ti}-agent-ticket`,onClick:o,title:t.copy,"aria-label":r?t.copied:t.copyTicketReference.replace("{reference}",e),children:r?t.copied:e})}var HP=["today","yesterday","lastWeek","older"];function FP(e,t){let r=Date.parse(t);if(!Number.isFinite(r))return"older";let n=Math.round((Df(e)-Df(r))/(1440*60*1e3));return n<=0?"today":n===1?"yesterday":n<7?"lastWeek":"older"}function qf(e,t){let r=new Map;for(let n of t){let o=FP(e,n.lastMessageAt),s=r.get(o);s?s.push(n):r.set(o,[n])}return HP.flatMap(n=>{let o=r.get(n);return o?[{bucket:n,conversations:o}]:[]})}function Df(e){return new Date(e).setHours(0,0,0,0)}var Uf=te.scope("history"),jP=3,VP=6,WP={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Bf(e,t){let r=t.type!=="upsert"||t.activity===!0;if(t.type==="snapshot"&&t.result.pagination.page===1&&e.pagination.page>1){let o=xr(e.conversations.slice(0,t.result.pagination.limit),t,r);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 s=new Set(o.map(u=>u.conversationId)),a=e.conversations.slice(t.result.pagination.limit).filter(u=>!s.has(u.conversationId)),i=e.pagination.page,c={...t.result.pagination,page:i,hasPrev:i>1,hasNext:i<t.result.pagination.totalPages};return{conversations:[...o,...a],pagination:c}}let n=xr(e.conversations,t,r);return n===e.conversations?e:{...t.type==="snapshot"?t.result:e,conversations:n}}function GP(e,t,r){let n=Date.parse(e);return Number.isFinite(n)?new Date(n).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(r,{hour:"numeric",minute:"2-digit"}).format(n):t-n<10080*60*1e3?new Intl.DateTimeFormat(r,{weekday:"short"}).format(n):new Intl.DateTimeFormat(r,{month:"short",day:"numeric"}).format(n):""}function Ya({transport:e,strings:t,locale:r,persistence:n,onSelect:o,onNewConversation:s}){let a=D.cssPrefix,i=e.peekConversations({limit:50}),[c,u]=U(i?"loaded":"loading"),[p,_]=U(0),[d,f]=U(i),[v,g]=U(!1),y=B(void 0),b=d?.conversations??[],P=d?.pagination;H(()=>{let m=!1,S=!0,A=[],I=e.subscribeConversationChanges(C=>{S&&A.push(C),f(M=>M&&Bf(M,C))});y.current=void 0,g(!1);let R=e.peekConversations({limit:50});return f(R),u(R?"loaded":"loading"),e.listConversations({limit:50}).then(C=>{if(m)return;let M=C;for(let N of A)M=Bf(M,N);A=[],S=!1,f(M),u("loaded"),n.saveHistoryCount(M.conversations.length)}).catch(C=>{m||(A=[],S=!1,Uf.warn("listConversations failed",{err:C}),u({failure:wr(C,t)}))}),()=>{m=!0,I(),y.current=void 0}},[e,n,r,p]);async function w(){if(y.current||!P?.hasNext)return;let m={};y.current=m,g(!0);try{let S=await e.listConversations({page:P.page+1,limit:P.limit});if(y.current!==m)return;f(A=>{if(!A)return A;let I=new Set(A.conversations.map(M=>M.conversationId)),R=S.conversations.filter(M=>I.has(M.conversationId)?!1:(I.add(M.conversationId),!0)),C={conversations:[...A.conversations,...R],pagination:S.pagination};return n.saveHistoryCount(C.conversations.length),C})}catch(S){if(y.current!==m)return;Uf.warn("listConversations page failed",{err:S,page:P.page+1})}finally{y.current===m&&(y.current=void 0,g(!1))}}let x=s?l("div",{class:`${a}-history-footer`,children:l("button",{type:"button",class:`${a}-history-new`,onClick:s,"data-testid":q.sidebarNewConversation,children:[l(R_,{}),t.newConversation]})}):null;if(c==="loading"){let m=Math.min(n.loadHistoryCount()??jP,VP);return l(ve,{children:[l("div",{class:`${a}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:l("div",{class:`${a}-history-group`,"aria-hidden":"true",children:[l("div",{class:`${a}-history-heading`,children:l("span",{class:`${a}-skeleton ${a}-skeleton-heading`})}),l("div",{class:`${a}-history-card`,children:Array.from({length:Math.max(1,m)},(S,A)=>l("div",{class:`${a}-history-item ${a}-history-item-skeleton`,children:[l("span",{class:`${a}-history-avatar ${a}-skeleton`}),l("span",{class:`${a}-history-body`,children:[l("span",{class:`${a}-history-row`,children:[l("span",{class:`${a}-history-title`,children:l("span",{class:`${a}-skeleton ${a}-skeleton-title`})}),l("span",{class:`${a}-history-time`,children:l("span",{class:`${a}-skeleton ${a}-skeleton-time`})})]}),l("span",{class:`${a}-history-row`,children:l("span",{class:`${a}-history-preview`,children:l("span",{class:`${a}-skeleton ${a}-skeleton-preview`})})})]})]},A))})]})}),x]})}if(typeof c=="object")return l(ve,{children:[l(Vt,{tone:"error",message:c.failure,onRetry:()=>_(m=>m+1),strings:t}),x]});if(b.length===0)return l(ve,{children:[l("div",{class:`${a}-history-empty`,children:t.historyEmpty}),x]});let k=Date.now(),h=qf(k,b);return l(ve,{children:[l("div",{class:`${a}-history`,role:"list",children:[h.map(m=>l("div",{class:`${a}-history-group`,children:[l("div",{class:`${a}-history-heading`,children:t[WP[m.bucket]]}),l("div",{class:`${a}-history-card`,children:m.conversations.map(S=>l("div",{role:"listitem",children:l("button",{type:"button",class:`${a}-history-item`,onClick:()=>o(S),"data-unread":S.hasUnread?"true":void 0,"data-testid":Ct(q.historyItem,S.conversationId),children:[l("span",{class:`${a}-history-avatar`,"aria-hidden":"true",children:l(_c,{})}),l("span",{class:`${a}-history-body`,children:[l("span",{class:`${a}-history-row`,children:[l("span",{class:`${a}-history-title`,children:S.title}),l("span",{class:`${a}-history-time`,children:[S.ticketReference&&`${S.ticketReference} \xB7 `,GP(S.lastMessageAt,k,r)]})]}),l("span",{class:`${a}-history-row`,children:[l("span",{class:`${a}-history-preview`,children:S.preview&&za(S.preview)||t.historyContinue}),S.hasUnread?l("span",{class:`${a}-history-dot`,role:"img","aria-label":t.unread}):null]})]})]})},S.conversationId))})]},m.bucket)),P?.hasNext?l("div",{class:`${a}-history-more`,children:l("button",{type:"button",onClick:w,disabled:v,"aria-busy":v,"data-testid":q.historyLoadMore,children:t.loadMoreConversations})}):null]}),x]})}var zf=D.cssPrefix;function Hf({state:e,strings:t}){return e?l("div",{class:`${zf}-dropzone`,"data-state":e,role:"status","aria-live":"polite",children:[l("span",{class:`${zf}-dropzone-icon`,"aria-hidden":"true",children:e==="reject"?l(Yn,{}):l(La,{})}),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,}$`),KP=/^[+]?[\d\s().-]{6,}$/;function QP(e,t,r){let n=Array.isArray(t)?t.join(""):t?.trim()??"";if(!n)return e.required?r.formRequired:void 0;if(e.type==="email"&&!Pc.test(n))return r.formInvalidEmail;if(e.type==="tel"&&!KP.test(n))return r.formInvalidTel;if(e.type==="number"&&!Number.isFinite(Number(n)))return r.formInvalidNumber}function Ff(e,t,r){return Object.fromEntries(e.flatMap(n=>{let o=QP(n,t[n.name],r);return o?[[n.name,o]]:[]}))}var yt=D.cssPrefix;function jf(e){return e.tokenEmail||e.userContext?.email?.trim()}function YP(e,t){let r=e instanceof De?e.status:void 0;return r===400?t.formInvalidEmail:r===409?t.emailTranscriptAlreadySent:r===422?t.emailTranscriptNotDelivered:r===429?t.emailTranscriptLimited:t.emailTranscriptFailed}function JP(e){return"host"in e&&"activeElement"in e}function Vf({transport:e,strings:t,knownEmail:r,onClose:n}){let[o,s]=U(r??""),[a,i]=U(!1),[c,u]=U({status:"idle"}),p=B(null),_=So(),d=`${_}-title`,f=`${_}-error`,v=c.status==="sending",g=c.status==="sent";St(()=>{let P=p.current;if(!P)return;let w=P.getRootNode(),x=JP(w)?w.activeElement:null,k=Jn(P);return()=>{k(),x instanceof HTMLElement&&x.isConnected&&x.focus({preventScroll:!0})}},[]),St(()=>{p.current?.querySelector("[data-autofocus]")?.focus({preventScroll:!0})},[g]);async function y(P){if(P.preventDefault(),v)return;let w=o.trim();if(!Pc.test(w)){i(!0),p.current?.querySelector("input")?.focus();return}i(!1),u({status:"sending"});let x=await e.emailTranscript(w).then(k=>({status:"sent",to:k.to}),k=>({status:"failed",message:YP(k,t)}));u(x)}function b(P){P.key==="Tab"&&P.stopPropagation(),P.key==="Escape"&&(P.stopPropagation(),n())}return l("div",{class:`${yt}-transcript-layer`,children:[l("div",{class:`${yt}-transcript-backdrop`,"aria-hidden":"true",onClick:n}),l("section",{ref:p,class:`${yt}-transcript-sheet`,role:"dialog","aria-modal":"true","aria-labelledby":d,onKeyDown:b,"data-testid":q.emailTranscriptSheet,children:[l("header",{class:`${yt}-transcript-sheet-head`,children:[l("span",{class:`${yt}-transcript-sheet-icon`,children:l(Na,{})}),l("h2",{id:d,class:`${yt}-transcript-sheet-title`,children:t.emailTranscript}),l("button",{type:"button",class:`${yt}-icon-btn`,onClick:n,"aria-label":t.emailTranscriptCancel,title:t.emailTranscriptCancel,children:l(Bt,{})})]}),c.status==="sent"?l(ve,{children:[l("p",{class:`${yt}-transcript-sheet-text ${yt}-transcript-sheet-sent`,role:"status",children:[l(mn,{}),l("span",{children:t.emailTranscriptSent.replace("{email}",c.to)})]}),l("button",{type:"button",class:`${yt}-form-submit ${yt}-transcript-sheet-action`,onClick:n,"data-autofocus":!0,children:t.emailTranscriptDone})]}):l("form",{class:`${yt}-transcript-sheet-form`,onSubmit:P=>{y(P)},noValidate:!0,children:[l("p",{class:`${yt}-transcript-sheet-text`,children:t.emailTranscriptPrompt}),l("label",{class:`${yt}-field`,"data-invalid":a?"true":void 0,children:[l("span",{class:`${yt}-field-label`,children:t.emailTranscriptEmailLabel}),l("input",{class:`${yt}-field-input`,type:"email",name:"email",autocomplete:"email",inputMode:"email",autocapitalize:"off",spellcheck:!1,value:o,readOnly:v,"aria-invalid":a,"aria-describedby":a?f:void 0,onInput:P=>{s(P.currentTarget.value),i(!1)},"data-autofocus":!0,"data-testid":q.emailTranscriptEmail}),a?l("span",{id:f,class:`${yt}-field-error`,role:"alert",children:t.formInvalidEmail}):null]}),l("button",{type:"submit",class:`${yt}-form-submit ${yt}-transcript-sheet-action`,disabled:v,"aria-busy":v,"data-testid":q.emailTranscriptSend,children:v?t.emailTranscriptSending:t.emailTranscriptSend}),c.status==="failed"?l("p",{class:`${yt}-field-error`,role:"alert",children:c.message}):null]})]})]})}var Wf=Object.assign;function ex(e,t){for(var r in e)if(r!="__source"&&e[r]!==t[r])return!0;for(var n in t)if(n!="__source"&&!(n in e))return!0;return!1}var tx=/^(-|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 Qf(e,t){function r(o){var s=this.props.ref;return s!=o.ref&&s&&(typeof s=="function"?s(null):s.current=null),t?!t(this.props,o)||s!=o.ref:ex(this.props,o)}function n(o){return this.shouldComponentUpdate=r,Or(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.type=e,n}var rx=Symbol.for("react.element"),nx=/^(?: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,ix=typeof document<"u";var ax=function(e){return/fil|che|rad/.test(e)};Xt.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Xt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Gf=xe.event;xe.event=function(e){return Gf&&(e=Gf(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var sx={configurable:!0,get:function(){return this.class}},Kf=xe.vnode;xe.vnode=function(e){if(typeof e.type=="string")(function(n){var o=n.props,s=n.type,a={},i=s.indexOf("-")==-1;for(var c in o){var u=o[c];if(!(c=="value"&&"defaultValue"in o&&u==null||ix&&c=="children"&&s=="noscript"||c=="class"||c=="className")){if(c=="style"&&u&&u.constructor==Object){var p=void 0;for(var _ in u)typeof u[_]!="number"||tx.test(_)||(p||(p=u=Wf({},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"||s!="input"&&s!="textarea"||ax(o.type)?d=="onfocus"?c="onfocusin":d=="onblur"&&(c="onfocusout"):d=c="oninput",d=="oninput"&&a[c=d]&&(c="oninputCapture")}else i&&nx.test(c)?c=c.replace(ox,"-$&").toLowerCase():u===null&&(u=void 0);a[c]=u}}if(s=="select"){var f=a.defaultValue!=null?a.defaultValue:a.multiple&&Array.isArray(a.value)?a.value:null;f!=null&&(a.value=cl(o.children).forEach(function(v){v.props.selected=a.multiple?f.indexOf(v.props.value)!=-1:f==v.props.value}))}o.class&&!o.className?(a.class=o.class,Object.defineProperty(a,"className",sx)):o.className&&(a.class=a.className=o.className),n.props=a})(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=Wf({},e.props);for(var r in e.type.defaultProps)t[r]===void 0&&(t[r]=e.type.defaultProps[r]);e.props=t}e.ref&&!("ref"in e.props)&&Object.defineProperty(e.props,"ref",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=rx,Kf&&Kf(e)};var Ja=D.cssPrefix;function Yf({messageId:e,initial:t,strings:r,onFeedback:n}){let[o,s]=U(t);H(()=>s(t),[e,t]);function a(i){let c=o===i?null:i;s(c),n(e,c)}return l("div",{class:`${Ja}-feedback`,role:"group","data-testid":q.messageFeedback,children:[l("button",{type:"button",class:`${Ja}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":r.feedbackUp,title:r.feedbackUp,onClick:()=>a("up"),"data-testid":q.feedbackUp,children:l(ef,{})}),l("button",{type:"button",class:`${Ja}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":r.feedbackDown,title:r.feedbackDown,onClick:()=>a("down"),"data-testid":q.feedbackDown,children:l(tf,{})}),l("span",{class:`${Ja}-sr-only`,role:"status","aria-live":"polite",children:o?r.feedbackThanks:""})]})}function Jf(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function Xf(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function lx(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function Zf(e){let{streaming:t,reasoningVisible:r,emptyReply:n,hidden:o}=e,s=e.responseMode==="buffered"&&t,a=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:s,reasoningVisible:r,working:a,showStreamDots:lx({streaming:t,bufferedHold:s,reasoningVisible:r,working:a}),emptyReply:n,hidden:o}}var no=D.cssPrefix;function em({part:e,strings:t}){let r=e.title||e.filename||e.url||t.sources;return e.url?l("a",{class:`${no}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":q.source,children:[l("span",{class:`${no}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),l("span",{class:`${no}-source-label`,children:r})]}):l("span",{class:`${no}-source`,"data-testid":q.source,children:[l("span",{class:`${no}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),l("span",{class:`${no}-source-label`,children:r})]})}var rr=D.cssPrefix;function tm(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 rm(e,t){if(t?.replacedByMessageId)return{terminal:!1,responded:!1,decided:!1};let r=e==="output-available"||e==="output-error"||e==="output-denied",n=e==="approval-responded"||t?.approved!==void 0;return{terminal:r,responded:n,decided:r||n}}function Xa({status:e,label:t,icon:r}){return l("span",{class:`${rr}-toolui-badge ${rr}-toolui-status`,"data-status":e,children:[l("span",{class:`${rr}-toolui-status-icon`,children:r??l(Sc,{status:e})}),t]})}function Sc({status:e}){return e==="running"?l("span",{class:`${rr}-loading-spinner`}):e==="stopped"?l(zr,{}):e==="waiting"||e==="submitted"?l(nf,{}):e==="failed"||e==="declined"||e==="replaced"?l(Yo,{}):l(mn,{})}function Za(e){return e==="approved"||e==="declined"||e==="done"}function ri({decision:e}){return l("span",{class:`${rr}-steps-decision`,"data-approved":e.approved?"true":"false",children:[e.approved?l(mn,{}):l(Yo,{}),e.label]})}function es({view:e,strings:t,compact:r=!1}){let n=e.raw;return l(ve,{children:[e.reason?l("p",{class:`${rr}-steps-row-reason`,children:e.reason}):null,e.fields.length>0?l(cx,{fields:e.fields,full:!r}):null,n?.input?l(xc,{label:t.stepInput,text:n.input}):null,n?.output?l(xc,{label:t.toolResult,text:n.output}):null,n?.error?l(xc,{label:t.statusError,text:n.error,error:!0}):null]})}function cx({fields:e,full:t=!1}){return l("dl",{class:t?`${rr}-toolui-fields ${rr}-toolui-fields-full`:`${rr}-toolui-fields`,children:e.map(({label:r,value:n},o)=>l("div",{children:[l("dt",{children:r}),l("dd",{title:t?void 0:n,children:n})]},`${r}#${o}`))})}function xc({label:e,text:t,error:r=!1}){return l("div",{class:`${rr}-toolui-section`,children:[l("span",{class:`${rr}-toolui-label`,children:e}),l("pre",{class:`${rr}-toolui-code`,"data-error":r?"true":void 0,children:t})]})}var zt=D.cssPrefix;function nm({part:e,view:t,strings:r,locale:n,canAct:o,onDecision:s,onEdit:a,preview:i}){let c=t.approval,u=t.status==="waiting"||t.status==="submitted"||t.status==="approved",p=e.toolCallId;return l("details",{class:`${zt}-toolui ${zt}-toolui-collapsible`,open:u||c?.buttons==="change"||void 0,"data-testid":t.status==="waiting"?q.toolApproval:q.toolDecision,"data-status":t.status,children:[l("summary",{class:`${zt}-toolui-head`,children:[l("span",{class:`${zt}-toolui-prompt`,children:u&&c?c.ask:t.name}),t.system?l("span",{class:`${zt}-toolui-system`,children:t.system}):null,l("span",{class:`${zt}-toolui-head-end`,children:[t.decision?l(ri,{decision:t.decision}):null,t.statusLabel&&!(t.decision&&Za(t.status))?l(Xa,{status:t.status,label:t.statusLabel}):null,l("span",{class:`${zt}-toolui-chevron`,children:l(ar,{})})]})]}),l("div",{class:`${zt}-toolui-collapse-body`,children:[u&&i&&rn(e.toolMetadata)?l(ux,{toolName:e.toolName,input:e.inputSig.value,preview:i,strings:r,locale:n}):null,l(es,{view:t,strings:r,compact:u}),c?.note?l("p",{class:`${zt}-toolui-subtle`,children:c.note}):null,c?.buttons==="decide"?l("div",{class:`${zt}-toolui-actions`,children:[l("button",{type:"button",class:`${zt}-form-skip`,disabled:!o,onClick:()=>s(p,!1),"data-testid":q.toolDecline,children:r.decline}),l("button",{type:"button",class:`${zt}-form-submit`,disabled:!o,onClick:()=>s(p,!0),"data-testid":q.toolApprove,children:r.approve})]}):null,c?.buttons==="change"?l("div",{class:`${zt}-toolui-actions`,children:l("button",{type:"button",class:`${zt}-form-skip`,onClick:()=>a(p),"data-testid":q.toolEdit,children:r.changeAnswer})}):null]})]})}function dx(e){if(!(typeof e!="object"||e===null)&&"totals"in e)return"number"in e&&"items"in e?`root = Root([preview])
65
+ preview = Order(${JSON.stringify(e)})`:"lines"in e?`root = Root([preview])
66
+ preview = Cart(${JSON.stringify(e)})`:void 0}function ux({toolName:e,input:t,preview:r,strings:n,locale:o}){let[s,a]=U();H(()=>{let c=!0;return r(e,t).then(u=>{c&&a(dx(u))}),()=>{c=!1}},[e,t,r]);let i=ke(()=>s?{textSig:ae(s),doneSig:ae(!0),replyDoneSig:ae(!0)}:void 0,[s]);return i?l("div",{class:`${zt}-toolui-preview`,"data-testid":q.toolPreview,children:l(Kl,{cssPrefix:zt,textSig:i.textSig,doneSig:i.doneSig,replyDoneSig:i.replyDoneSig,strings:n,locale:o})}):null}var px=["text","email","phone","number","date","single-select","multi-select","boolean"];function om(e){return e!==null&&typeof e=="object"}function im(e,t){let r=om(e)?e:{},o=(Array.isArray(r.questions)?r.questions:[]).map((s,a)=>_x(s,a,t)).filter(s=>s!==null);return{intro:ts(r.intro),questions:o}}function _x(e,t,r){if(!om(e))return null;let n=px.find(o=>o===e.type)??"text";return{key:ts(e.key)??`q${t+1}`,question:ts(e.question)??r,type:n,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:ts(e.helpText)}}function fx(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 wc(e,t,r){return e.questions.map(n=>{let o=fx(n.type),s=n.type==="boolean"?[{value:"yes",label:t},{value:"no",label:r}]:(n.options??[]).map(a=>({value:a,label:a}));return{name:n.key,label:n.question,type:o,required:n.required??!1,options:s.length>0?s:void 0,validationHint:n.helpText}})}function ts(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var bt=D.cssPrefix;function kc({fields:e,strings:t,submitLabel:r,onSubmit:n,skipLabel:o,onSkip:s,footerHint:a,submitOnEnter:i,disabled:c,initialValues:u,hideActions:p,fieldTypeLabels:_,rootTestId:d,submitTestId:f,skipTestId:v}){let[g,y]=U(()=>u??{}),[b,P]=U({}),[w,x]=U({});function k(I){w[I]&&x(R=>({...R,[I]:""}))}function h(I,R){y(C=>({...C,[I]:R})),k(I)}function m(I,R){P(C=>({...C,[I]:R})),k(I)}function S(I){if(I.preventDefault(),c)return;let R=hx(e,g,b),C=Ff(e,R,t);if(Object.keys(C).length>0){x(C);return}n(R)}function A(I){!i||I.key!=="Enter"||I.shiftKey||Va(I)||!I.target||!("tagName"in I.target)||I.target.tagName!=="TEXTAREA"||S(I)}return l("form",{class:`${bt}-form`,onSubmit:S,onKeyDown:A,onCompositionEnd:ja,"data-testid":d,noValidate:!0,children:[e.map(I=>l(mx,{field:I,value:g[I.name],otherText:b[I.name]??"",error:w[I.name],disabled:c,typeLabel:_?.[I.name],strings:t,onChange:R=>h(I.name,R),onOtherChange:R=>m(I.name,R)},I.name)),p?null:l("div",{class:`${bt}-form-actions`,children:[a?l("span",{class:`${bt}-form-hint`,children:a}):null,o&&s?l("button",{type:"button",class:`${bt}-form-skip`,onClick:s,disabled:c,"data-testid":v,children:o}):null,l("button",{type:"submit",class:`${bt}-form-submit`,disabled:c,"data-testid":f,children:r})]})]})}function mx({field:e,value:t,otherText:r,error:n,disabled:o,typeLabel:s,strings:a,onChange:i,onOtherChange:c}){let u=Ct(q.formField,e.name),p=So(),_=gx({field:e,value:t,otherText:r,disabled:o,strings:a,onChange:i,onOtherChange:c,fieldTid:u,labelId:p}),d=e.type==="radio"||e.type==="multiselect"?"div":"label";return l(d,{class:`${bt}-field`,"data-field":e.name,"data-invalid":n?"true":void 0,children:[l("span",{class:`${bt}-field-head`,children:[l("span",{class:`${bt}-field-label`,id:p,children:[e.label,e.required?l("span",{class:`${bt}-field-req`,"aria-hidden":"true",children:" *"}):null]}),s?l("span",{class:`${bt}-field-type`,children:s}):null]}),_,e.validationHint&&!n?l("span",{class:`${bt}-field-hint`,children:e.validationHint}):null,n?l("span",{class:`${bt}-field-error`,role:"alert",children:n}):null]})}function gx(e){let{field:t,value:r,otherText:n,disabled:o,strings:s,onChange:a,onOtherChange:i,fieldTid:c,labelId:u}=e,p=typeof r=="string"?r:"";switch(t.type){case"textarea":return l("textarea",{class:`${bt}-field-input`,rows:3,value:p,disabled:o,onInput:d=>a(d.currentTarget.value),"data-testid":c});case"radio":return l("div",{class:`${bt}-field-choices`,role:"radiogroup","aria-labelledby":u,"data-testid":c,children:(t.options??[]).map(d=>l("label",{class:`${bt}-choice`,children:[l("input",{type:"radio",name:`${bt}-${t.name}`,checked:p===d.value,disabled:o,onChange:()=>a(d.value)}),l("span",{children:d.label})]},d.value))});case"multiselect":{let f=function(v,g){return a(g?[...d,v]:d.filter(y=>y!==v))};var _=f;let d=Array.isArray(r)?r:[];return l("div",{class:`${bt}-field-choices`,role:"group","aria-labelledby":u,"data-testid":c,children:[(t.options??[]).map(v=>l("label",{class:`${bt}-choice`,children:[l("input",{type:"checkbox",checked:d.includes(v.value),disabled:o,onChange:g=>f(v.value,g.currentTarget.checked)}),l("span",{children:v.label})]},v.value)),(t.options??[]).length===0?l("textarea",{class:`${bt}-field-input`,rows:2,value:n,placeholder:s.formOtherPlaceholder,disabled:o,onInput:v=>i(v.currentTarget.value)}):null]})}default:return l("input",{...vx(t.type),class:`${bt}-field-input`,value:p,disabled:o,onInput:d=>a(d.currentTarget.value),"data-testid":c})}}function vx(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 hx(e,t,r){let n={...t};for(let o of e){let s=r[o.name]?.trim();if(o.type==="multiselect"&&s){let a=s.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),i=t[o.name];n[o.name]=[...Array.isArray(i)?i:[],...a]}}return n}var pt=D.cssPrefix;function yx({skipped:e,submitted:t,strings:r}){return e?{status:"replaced",statusLabel:r.inputSkipped}:t?{status:"submitted",statusLabel:r.stepWorkingOnIt}:{status:"done",statusLabel:r.inputAnswered}}var bx={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function sm(e,t){let r={};for(let n of e)r[n.key]=t[bx[n.type]];return r}function lm({part:e,strings:t,active:r,superseded:n=!1,continuationStreaming:o=!1,onDecision:s,onEdit:a}){let i=ke(()=>ut(()=>e.stateSig.value),[e]).value,c=ke(()=>ut(()=>e.approvalSig.value),[e]).value,u=ke(()=>ut(()=>im(e.inputSig.value,t.askFallbackQuestion)),[e,t]).value,{terminal:p,decided:_}=rm(i,c),d=_&&c?.approved===!0,f=o&&!_,v=!_&&!n&&!f,g=!v&&!d&&!f,y=d&&r&&!p,b=u.questions,[P,w]=U(null),k=P??(v||d||f),[h,m]=U(!1),S=b.length>1?pc:Ko,A=v?t.inputRequired:t.inputBadge,I=f?l("p",{class:`${pt}-toolui-subtle`,children:t.stepWorkingOnIt}):v?l(Px,{req:u,strings:t,active:r,resolve:(M,N)=>s(e.toolCallId,N,M)}):h?l(kc,{fields:wc(u,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:sm(b,t),initialValues:d?Cx(b,c?.reason):void 0}):l(xx,{questions:b,answers:d?kx(c?.reason):{},strings:t}),{status:R,statusLabel:C}=yx({skipped:g,submitted:f,strings:t});return l("details",{class:`${pt}-toolui ${pt}-toolui-collapsible${n?` ${pt}-toolui-stale`:""}`,open:k,onToggle:M=>{let N=M.currentTarget.open;N!==k&&w(N)},"data-testid":v?q.toolAskQuestions:q.toolDecision,children:[l("summary",{class:`${pt}-toolui-head`,children:[l("span",{class:`${pt}-toolui-q-pill`,children:[l(S,{}),A]}),l("span",{class:`${pt}-toolui-head-end`,children:[v?null:l(Xa,{status:R,icon:g?l(Yo,{}):l(mn,{}),label:C}),l("span",{class:`${pt}-toolui-chevron`,children:l(ar,{})})]})]}),l("div",{class:`${pt}-toolui-collapse-body`,children:[u.intro?l("div",{class:`${pt}-toolui-desc`,children:u.intro}):null,I,v||f?null:l("div",{class:`${pt}-toolui-footer`,children:[l("button",{type:"button",class:`${pt}-toolui-options-toggle`,onClick:()=>m(M=>!M),"data-testid":q.toolAskOptions,children:[l("span",{class:`${pt}-toolui-options-chevron${h?` ${pt}-open`:""}`,children:l(ar,{})}),h?t.hideOptions:t.showOptions]}),y?l("button",{type:"button",class:`${pt}-form-skip`,onClick:()=>a(e.toolCallId),"data-testid":q.toolEdit,children:t.edit}):null]})]})]})}function Px({req:e,strings:t,active:r,resolve:n}){let o=wc(e,t.confirmYes,t.confirmNo),s=e.questions.length===1&&e.questions[0]?.type==="text";return l(kc,{fields:o,strings:t,disabled:!r,submitLabel:t.inputSubmit,footerHint:s?t.inputSubmitHint:void 0,onSubmit:a=>n(wx(e.questions,a),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:s,fieldTypeLabels:sm(e.questions,t),submitTestId:q.toolInputSubmit,skipTestId:q.toolInputSkip})}function xx({questions:e,answers:t,strings:r}){return l("div",{class:`${pt}-toolui-summary`,"data-testid":q.toolAskSummary,children:e.map(n=>l("div",{class:`${pt}-field`,children:[l("span",{class:`${pt}-field-head`,children:l("span",{class:`${pt}-field-label`,children:[n.question,n.required?l("span",{class:`${pt}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),l("p",{class:`${pt}-toolui-answer`,children:Sx(n,t[n.key],r)||"\u2014"})]},n.key))})}function Sx(e,t,r){return e.type!=="boolean"?t??"":t==="yes"?r.confirmYes:t==="no"?r.confirmNo:t??""}function wx(e,t){let r=e.flatMap(n=>{let o=t[n.key],s=typeof o=="string"?o.trim():o;return s?.length?[{key:n.key,value:s}]:[]});return JSON.stringify({answers:r})}function cm(e){if(!e)return{};let t=(()=>{try{return JSON.parse(e)}catch{return}})(),r=am(t)?t.answers:void 0;if(!Array.isArray(r))return{};let n={};for(let o of r)if(am(o)){let{key:s,value:a}=o;if(typeof s!="string")continue;typeof a=="string"?n[s]=a:Array.isArray(a)&&(n[s]=a.filter(i=>typeof i=="string"))}return n}function am(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kx(e){let t=cm(e),r={};for(let[n,o]of Object.entries(t))r[n]=Array.isArray(o)?o.join(", "):o;return r}function Cx(e,t){let r=cm(t),n={};for(let o of e){let s=r[o.key];s!==void 0&&(o.type==="multi-select"?n[o.key]=Array.isArray(s)?s:[s]:n[o.key]=Array.isArray(s)?s[0]??"":s)}return n}var he=D.cssPrefix;function dm(e,t){let r=[];for(let[n,o]of e.entries()){let s=r.at(-1),a=o.kind==="tool"?t.viewOf(o):void 0,i=Tx(o,a,t.showReasoning);if(i){s?.kind==="steps"?(s.rows.push(i),s.indices.push(n)):r.push({kind:"steps",rows:[i],indices:[n]});continue}o.kind==="step-start"||o.kind==="reasoning"||o.kind==="source"&&!t.showSources||a?.placement==="hidden"||r.push({kind:"part",part:o,index:n})}return r}function Tx(e,t,r){return e.kind==="reasoning"?r?{kind:"thought",part:e}:void 0:e.kind==="tool"&&t?.placement==="step"?{kind:"tool",part:e,view:t}:void 0}function Ix(e,t){let r=[...new Set(t)];if(!(!e||r.length===0||r.some(n=>n<0||n>=e.length)))return r.reduce((n,o)=>n+(e[o]?.durationMs??0),0)}function um(e){let t=[];for(let r of e)t.push((t.at(-1)??-1)+(r.kind==="step-start"?1:0));return t}function Ax(e,t){return e.streaming?t.thinking:e.reasoningMs===void 0?t.thought:t.thoughtFor.replace("{time}",pm(e.reasoningMs))}function pm(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 Rx(e){return e.split(`
67
+ `).map(t=>t.trim()).findLast(t=>/^\*\*[^*].*\*\*$/.test(t))?.slice(2,-2).trim()}function Ex(e,t){return e?.kind==="tool"?`${e.view.name}\u2026`:(e&&Rx(e.part.textSig.value))??t.thinking}function _m({rows:e,steps:t=[],stepTimings:r,timed:n=!0,strings:o,running:s,runStartedAt:a}){let[i,c]=U(!1),[u,p]=U(!1),_=fd(e.flatMap(y=>y.kind==="tool"?[y.view]:[])),d=e.at(-1),f=ke(()=>ut(()=>Ex(d,o)),[d,o]).value,v=n?Ix(r,t):void 0;function g(){c(!i),p(!0)}return l("div",{class:`${he}-steps`,"data-testid":q.toolSteps,"data-running":s?"true":void 0,"data-stopped":_.stopped?"true":void 0,children:[l("button",{type:"button",class:`${he}-steps-head`,"aria-expanded":i,onClick:g,children:[l("span",{class:`${he}-steps-icon`,"aria-hidden":"true",children:l(Lx,{running:s,stopped:_.stopped!==void 0})}),l("span",{class:`${he}-steps-label`,children:s?l("span",{class:`${he}-steps-live`,children:f}):l(Nx,{line:_,strings:o})}),!s&&_.failed>0?l("span",{class:`${he}-steps-failed`,children:o.toolStepsFailed.replace("{count}",String(_.failed))}):null,s?null:_.marks.map(y=>l(ri,{decision:y},y.label)),s&&a?l(Mx,{since:a}):null,!s&&v!==void 0?l("span",{class:`${he}-steps-time`,children:pm(v)}):null,l("span",{class:`${he}-steps-chevron`,"data-open":i?"true":void 0,children:l(ar,{})})]}),l("span",{class:`${he}-sr-only`,role:"status",children:s?f:""}),l("div",{class:`${he}-steps-body`,"data-open":i?"true":void 0,inert:!i,children:l("div",{class:`${he}-steps-body-inner`,children:u?l("ol",{class:`${he}-steps-list`,children:e.map((y,b)=>y.kind==="tool"?l($x,{view:y.view,strings:o},y.part.toolCallId):l(Cc,{part:y.part,current:s&&b===e.length-1,reasoningMs:r?.[t[b]??-1]?.reasoningMs,strings:o},`${y.part.id}#${b}`))}):null})})]})}function Mx({since:e}){let[t,r]=U(()=>Date.now());H(()=>{let o=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(o)},[]);let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));return l("span",{class:`${he}-steps-time`,children:n<60?`${n} s`:`${Math.floor(n/60)} m ${n%60} s`})}function Lx({running:e,stopped:t}){return e?l("span",{class:`${he}-loading-spinner`}):t?l(zr,{}):l(rf,{})}function Nx({line:e,strings:t}){return e.stopped?l(ve,{children:md(e.stopped.finished,t)}):e.single?l(ve,{children:[e.single.name,e.single.summary?l(ve,{children:[l("span",{class:`${he}-steps-sep`,"aria-hidden":"true",children:"\xB7"}),l("span",{class:`${he}-steps-summary`,children:e.single.summary})]}):null,e.single.outcome?l("span",{class:`${he}-steps-denied`,children:e.single.outcome}):null]}):l(ve,{children:e.tools.map(({name:r,count:n},o)=>l("span",{class:`${he}-steps-name`,children:[o>0?l("span",{class:`${he}-steps-sep`,"aria-hidden":"true",children:"\xB7"}):null,r,n>1?l("span",{class:`${he}-steps-count`,children:["\xD7",n]}):null]},r))})}function Ox({view:e}){let t=e.statusLabel&&e.status!=="running"&&!(e.decision&&Za(e.status))?l("span",{class:e.status==="failed"?`${he}-steps-failed`:`${he}-steps-denied`,children:e.statusLabel}):null;return l(ve,{children:[e.decision?l(ri,{decision:e.decision}):null,t]})}function $x({view:e,strings:t}){let[r,n]=U(!1);return l("li",{class:`${he}-steps-row`,"data-testid":q.toolStep,"data-status":e.status,children:[l("span",{class:`${he}-steps-row-icon`,"aria-hidden":"true",children:l(Sc,{status:e.status})}),l("div",{class:`${he}-steps-row-main`,children:[l("button",{type:"button",class:`${he}-steps-row-head`,"aria-expanded":r,onClick:()=>n(!r),children:[l("span",{class:`${he}-steps-row-label`,children:[l("span",{class:`${he}-steps-row-name`,children:e.name}),e.system?l("span",{class:`${he}-steps-row-system`,children:e.system}):null,e.summary?l("span",{class:`${he}-steps-row-summary`,children:e.summary}):null]}),l(Ox,{view:e}),l("span",{class:`${he}-steps-chevron`,"data-open":r?"true":void 0,children:l(ar,{})})]}),r?l("div",{class:`${he}-steps-row-body`,children:l(es,{view:e,strings:t})}):null]})]})}function Cc({part:e,current:t,reasoningMs:r,strings:n,standalone:o=!1}){let[s,a]=U(!1),i=ke(()=>ut(()=>e.textSig.value.trim()===""),[e]).value,c=l("span",{class:t?`${he}-steps-thought-label ${he}-steps-live`:`${he}-steps-thought-label`,children:Ax({streaming:t,reasoningMs:r},n)});return l(o?"div":"li",{class:`${he}-steps-row ${he}-steps-thought`,"data-status":"thought","data-testid":o?q.reasoning:void 0,children:[l("span",{class:`${he}-steps-row-icon`,"aria-hidden":"true",children:l(of,{})}),l("div",{class:`${he}-steps-row-main`,children:[i?c:l("button",{type:"button",class:`${he}-steps-row-head`,"aria-expanded":s,onClick:()=>a(!s),children:[c,l("span",{class:`${he}-steps-chevron`,"data-open":s?"true":void 0,children:l(ar,{})})]}),s&&!i?l("div",{class:`${he}-steps-thought-text ${he}-reasoning-body`,children:l(Jo,{textSig:e.textSig,doneSig:e.doneSig})}):null]})]})}var tt=D.cssPrefix,fm=Qf(Dx);function Dx({message:e,status:t,createdAt:r,strings:n,locale:o,responseMode:s,showReasoning:a,stepDisplay:i,showSources:c,interactive:u=!1,superseded:p=!1,tool:_,onRetry:d,enableMessageFeedback:f=!1,onFeedback:v,reconnecting:g=!1,clientToolRunning:y=!1,onCardAction:b}){let w=[...ke(()=>ut(()=>e.partsSig.value),[e]).value];for(let ie of e.attachments??[])!ie.url||w.some(Se=>Se.kind==="file"&&Se.url===ie.url)||w.push({kind:"file",url:ie.url,mediaType:ie.mediaType,filename:ie.name,fileId:ie.id,fileSize:ie.size});let x=ke(()=>ut(()=>pn(e)),[e,t,e.canceled]),k=ke(()=>ut(()=>Jf(e)),[e]),h=ke(()=>ut(()=>a&&Xf(e)),[e,a]),m=ke(()=>ut(()=>l_(e,h.value)),[e,h,t,e.canceled]),S=ke(()=>ut(()=>!nc(e)),[e]),A=t==="streaming",I=e.role==="assistant"&&y,R=e.role==="assistant"&&(A||I),C=A||I,M=Zf({streaming:R,responseMode:s,reasoningVisible:h.value,hasAnswerText:k.value,emptyReply:x.value,hidden:m.value}),{bufferedHold:N,showStreamDots:j}=M;if(M.hidden)return null;let G=Ux(r,o),z=e.role==="assistant"||e.role==="operator",ce=f&&!!v&&!!e.serverMessageId&&z&&!C&&t!=="error"&&!x.value,pe=C?"":w.filter(ie=>ie.kind==="text").map(ie=>e.role==="assistant"?ya(ie.textSig.peek()):ie.textSig.peek()).join(`
66
68
 
67
- `).trim(),_e=!C&&t!=="error"&&!S.value&&ue.length>0,ae=a?om(x,{showReasoning:i,showSources:c}):x.map((ye,Oe)=>({kind:"part",part:ye,index:Oe})),he=am(x),Je=e.canceled===!0||t==="error",bt=e.canceled===!0&&!A&&w.value&&h.value,Ve=ae.at(-1),At=Ve?.kind==="steps"?Ve.indices.at(-1):Ve?.index;function Le(ye,Oe){return l(Ex,{part:ye,generativeUi:e.role==="assistant",onCardAction:b,live:R,current:R&&Oe===At,reasoningMs:e.stepTimings?.[he[Oe]??-1]?.reasoningMs,strings:n,showReasoning:i,showToolCalls:a,showSources:c,interactive:u&&t==="complete"&&(ye.kind!=="tool"||ki(e,Oe)),superseded:p,continuationStreaming:e.continuationStreaming===!0,stopped:Je,tool:_},`${Ox(ye)}#${Oe}`)}let Ze=le||_e;return l("div",{class:`${ot}-bubble-row`,"data-role":e.role,"aria-busy":R?"true":void 0,"data-testid":Ct(D.messageBubble,e.serverMessageId??e.id),children:l("div",{class:`${ot}-bubble-col`,children:[l("div",{class:`${ot}-bubble`,children:[e.role==="operator"&&e.operatorInitials?l("span",{class:`${ot}-bubble-author`,children:e.operatorInitials}):null,l("div",{class:`${ot}-bubble-body`,children:[N?l(Dx,{label:n.loading}):ae.flatMap((ye,Oe)=>ye.kind==="part"?[Le(ye.part,ye.index)]:ye.parts.some(Ue=>Ue.kind==="tool")?[l(sm,{parts:ye.parts,steps:ye.indices.map(Ue=>he[Ue]??-1),stepTimings:e.stepTimings,timed:!Je,strings:n,live:R,running:R&&Oe===ae.length-1,stopped:Je&&Oe===ae.length-1,runStartedAt:e.runStartedAt},`steps#${ye.indices[0]}`)]:ye.parts.map((Ue,Tt)=>Le(Ue,ye.indices[Tt]??Tt))),bt?l("div",{class:`${ot}-steps-row`,"data-status":"stopped","data-testid":D.replyStopped,children:[l("span",{class:`${ot}-steps-row-icon`,"aria-hidden":"true",children:l(kr,{})}),l("div",{class:`${ot}-steps-row-main`,children:l("span",{class:`${ot}-steps-stopped-label`,children:n.statusStopped})})]}):null,j&&!g?l($x,{}):null,t==="error"||S.value?l(Jo,{text:Nx(e,t,n),retryLabel:n.errorRetry,onRetry:d?()=>d(e):void 0,retryTestId:D.messageRetry}):null,g&&R?l(Jo,{text:n.errorReconnecting,retryTestId:D.messageRetry}):null]})]}),G||Ze?l("div",{class:`${ot}-bubble-meta`,children:[G?l("time",{class:`${ot}-bubble-time`,dateTime:G.iso,title:G.full,children:G.short}):null,Ze?l("div",{class:`${ot}-bubble-actions`,children:[le&&e.serverMessageId?l(Ff,{messageId:e.serverMessageId,initial:e.feedback??null,strings:n,onFeedback:v}):null,_e?l(Ax,{text:ue,strings:n}):null]}):null]}):null]})})}function Ax({text:e,strings:t}){let[r,n]=U(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})}let s=r?t.copied:t.copy;return l("button",{type:"button",class:`${ot}-msg-action`,"data-active":r?"true":void 0,"aria-label":s,title:s,onClick:o,"data-testid":D.messageCopy,children:r?l(Yn,{}):l(G_,{})})}function Rx(e,t){if(typeof e!="number"||!Number.isFinite(e))return null;try{let r=new Date(e);return{short:r.toLocaleTimeString(t,{hour:"numeric",minute:"2-digit"}),full:r.toLocaleString(t,{dateStyle:"full",timeStyle:"short"}),iso:r.toISOString()}}catch{return null}}function Ex({part:e,generativeUi:t,onCardAction:r,live:n,current:o,reasoningMs:s,strings:i,showReasoning:a,showToolCalls:c,showSources:u,interactive:p,superseded:_,continuationStreaming:d,stopped:f,tool:v}){switch(e.kind){case"step-start":return null;case"text":return l(Yo,{textSig:e.textSig,doneSig:e.doneSig,generativeUi:t,strings:i,onCardAction:r});case"reasoning":return a?l(Rc,{part:e,current:o,reasoningMs:s,strings:i,standalone:!0}):null;case"tool":return l(Lx,{part:e,strings:i,showToolCalls:c,interactive:p,superseded:_,continuationStreaming:d,live:n,stopped:f,tool:v});case"file":return l(Mx,{part:e,strings:i});case"source":return u?l(Kf,{part:e,strings:i}):null}}function Mx({part:e,strings:t}){let r=e.filename??t.file;if(e.mediaType.startsWith("image/"))return l("a",{class:`${ot}-file-image`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:r,"data-testid":D.messageFile,children:l("img",{src:e.url,alt:r,loading:"lazy"})});let n=(r.includes(".")?r.split(".").pop():e.mediaType.split("/").pop())?.toUpperCase(),o=e.fileSize===void 0?void 0:eo(e.fileSize);return l("a",{class:`${ot}-file-chip`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:r,"data-testid":D.messageFile,children:[l("span",{class:`${ot}-file-chip-icon`,"aria-hidden":"true",children:l($i,{})}),l("span",{class:`${ot}-file-chip-text`,children:[l("span",{class:`${ot}-file-chip-name`,children:r}),l("span",{class:`${ot}-file-chip-meta`,children:[n,o].filter(Boolean).join(" \xB7 ")})]})]})}function Lx({part:e,strings:t,showToolCalls:r,interactive:n,superseded:o,continuationStreaming:s,live:i,stopped:a,tool:c}){let u=ve(()=>Se(()=>e.approvalSig.value),[e]),p=ve(()=>Se(()=>!is(e)||e.approvalSig.value?.approved!==void 0&&!e.approvalSig.value.replacedByMessageId),[e]);return!r&&!p.value?null:c?.humanInLoop&&u.value?.isAutomatic?l(Ic,{part:e,strings:t,live:i,superseded:o,stopped:a}):c?.humanInLoop&&u.value?e.toolMetadata?.card==="questions"?l(rm,{part:e,strings:t,active:n,superseded:o,continuationStreaming:s,onDecision:c.onDecision,onEdit:c.onEdit}):l(Xf,{part:e,strings:t,active:n,superseded:o,continuationStreaming:s,stopped:a,onDecision:c.onDecision,onEdit:c.onEdit}):r?l(Ic,{part:e,strings:t,live:i,superseded:o,stopped:a}):null}function Nx(e,t,r){return e.errorText?e.errorText:t==="error"&&e.role==="assistant"?r.errorServer:r.errorGeneric}function Ox(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 $x(){return l("span",{class:`${ot}-typing`,"data-testid":D.typingDots,"aria-hidden":"true",children:[l("span",{}),l("span",{}),l("span",{})]})}function Dx({label:e}){return l("span",{class:`${ot}-loading`,role:"status",children:[l("span",{class:`${ot}-loading-spinner`,"aria-hidden":"true"}),l("span",{class:`${ot}-loading-label`,children:e})]})}var Ar=q.cssPrefix,ss=120,qx=350;function cm({messagesSig:e,reconnectingSig:t,pageToolRunning:r,strings:n,notice:o,locale:s,responseMode:i,showReasoning:a,showToolCalls:c,showSources:u,enableMessageFeedback:p,onFeedback:_,loading:d,onLoadPreviousMessages:f,idle:v,controlMode:g="ai-agent",tool:P,onRetry:b,onCardAction:y}){let x=B(null),S=It(()=>e.value),k=Ux(s),[h,m]=U(!1),[w,A]=U(!1),I=B(!1),R=B(!1),[C,M]=U(),N=B(!1),j=B(!1),G=B(!1),z=B(0);function le(){return G.current||performance.now()-z.current<qx}let ue=B(0);function _e($){let L=$.scrollHeight-$.clientHeight>1;$.dataset.fadeTop=L&&$.scrollTop>1?"true":"false",$.dataset.fadeBottom=L&&$.scrollHeight-$.scrollTop-$.clientHeight>1?"true":"false"}function ae($){return m($.scrollHeight-$.scrollTop-$.clientHeight>ss*2)}function he($){ue.current=performance.now(),$.scrollTop=$.scrollHeight,_e($)}function Je($,L){he($);let Y=L,K=0;function re(){j.current||le()||(he($),--Y>0&&(K=requestAnimationFrame(re)))}return L>0&&(K=requestAnimationFrame(re)),()=>cancelAnimationFrame(K)}function bt($,L){let Y,K,re,be=-1;function ce(){Y.disconnect(),K.disconnect(),clearTimeout(re)}function Pe(){if(j.current||le()||be>=0&&$.scrollTop<be-4)return ce();he($),be=$.scrollTop}return Y=new ResizeObserver(Pe),K=new MutationObserver(Pe),Pe(),Y.observe($),K.observe($,{childList:!0,subtree:!0,characterData:!0}),re=setTimeout(ce,L),ce}let Ve=S.value[0]?.id;St(()=>{let $=x.current;if($&&S.value.length!==0&&!R.current&&(N.current=!0,!!S.value.some(L=>L.role==="user")))return bt($,300)},[Ve]);let At=B(0);H(()=>{let $=x.current,L=S.value,Y=At.current;if(At.current=L.length,!$||!N.current||R.current)return;if(L.slice(Y).some(re=>re.role==="user"))return j.current=!1,Je($,3);if(!L.some(re=>re.role==="user")||j.current||le())return;$.scrollHeight-$.scrollTop-$.clientHeight<ss&&he($)},[S.value.length]);let Le=B(null);H(()=>{let $=x.current,L=S.value.at(-1),Y=Le.current;if(Le.current=L?{id:L.id,streaming:L.status==="streaming"}:null,!!$&&N.current&&!(!L||L.id!==Y?.id||Y.streaming||L.status!=="streaming"))return j.current=!1,Je($,3)},[S.value]),H(()=>{let $=x.current;if(!$)return;let L=S.value.at(-1);if(!L||L.status!=="streaming"&&!S.value.some(re=>re.role==="user"))return;let Y=()=>{if(j.current||le())return;$.scrollHeight-$.scrollTop-$.clientHeight<ss*2&&he($)};if(L.status!=="streaming")return bt($,300);Y();let K=new MutationObserver(Y);return K.observe($,{childList:!0,subtree:!0,characterData:!0}),()=>K.disconnect()},[S.value]),H(()=>{let $=x.current;if(!$)return;let L=()=>{ae($),_e($),performance.now()-ue.current>150&&(j.current=$.scrollHeight-$.scrollTop-$.clientHeight>8)};function Y(){j.current=!0}function K(He){He.deltaY<0&&Y()}let re=0;function be(He){re=He.touches[0]?.clientY??0,G.current=!0}function ce(He){(He.touches[0]?.clientY??0)>re+4&&Y()}function Pe(){G.current=!1,z.current=performance.now()}function lt(){G.current=!0}return $.addEventListener("scroll",L,{passive:!0}),$.addEventListener("wheel",K,{passive:!0}),$.addEventListener("touchstart",be,{passive:!0}),$.addEventListener("touchmove",ce,{passive:!0}),$.addEventListener("touchend",Pe,{passive:!0}),$.addEventListener("touchcancel",Pe,{passive:!0}),$.addEventListener("pointerdown",lt,{passive:!0}),window.addEventListener("pointerup",Pe,{passive:!0}),window.addEventListener("pointercancel",Pe,{passive:!0}),ae($),()=>{$.removeEventListener("scroll",L),$.removeEventListener("wheel",K),$.removeEventListener("touchstart",be),$.removeEventListener("touchmove",ce),$.removeEventListener("touchend",Pe),$.removeEventListener("touchcancel",Pe),$.removeEventListener("pointerdown",lt),window.removeEventListener("pointerup",Pe),window.removeEventListener("pointercancel",Pe)}},[]),H(()=>{let $=x.current;if(!$)return;let L=$.clientHeight,Y=new ResizeObserver(()=>{if($.clientHeight===L)return;let K=$.scrollHeight-$.scrollTop-L<=ss;L=$.clientHeight,!(!K||R.current)&&S.value.some(re=>re.role==="user")&&(j.current=!1,he($))});return Y.observe($),()=>Y.disconnect()},[]);function Ze(){let $=x.current;$&&(j.current=!1,he($))}let ye=S.value.filter($=>!$.ephemeral),Oe=ye[0],Ue=Oe?.serverMessageId??Oe?.id,Tt=!!(f&&ye.length>=dc&&Ue!==C);async function Rt(){if(!f||I.current)return;let $=x.current,L=$?.scrollHeight??0,Y=$?.scrollTop??0;I.current=!0,R.current=!0,A(!0);try{let K=await f();K===!1&&Ue&&M(Ue),K&&$&&(await new Promise(re=>requestAnimationFrame(()=>requestAnimationFrame(()=>re()))),$.scrollTop=Y+$.scrollHeight-L,_e($),ae($))}finally{R.current=!1,I.current=!1,A(!1)}}let Ie=[],ze="",Re=S.value.at(-1)?.id,Yt=t?.value===!0,Pt=r===!0;for(let $ of S.value){if($.role==="assistant"&&$.id!==Re&&_n($))continue;let L=Bx($.createdAt);L&&L!==ze&&(Ie.push(l("div",{class:`${Ar}-date-divider`,children:l("span",{class:`${Ar}-date-pill`,title:zx($.createdAt,k),children:Hx($.createdAt,n,k)})},`day:${L}`)),ze=L);let K=$.retryAction!==void 0||$.role==="assistant"&&$.id===Re?Ii(S.value,$):void 0,re=K!==void 0&&(K.kind!=="continue-assistant"||g==="ai-agent");Ie.push(l(lm,{message:$,status:$.status,createdAt:$.createdAt,strings:n,locale:k,responseMode:i,showReasoning:a,showToolCalls:c,showSources:u,interactive:!!v&&g==="ai-agent"&&$.id===Re,superseded:$.id!==Re,tool:P,onRetry:v&&re&&($.role==="user"||$.id===Re)?b:void 0,enableMessageFeedback:p,onFeedback:_,reconnecting:Yt&&$.id===Re,clientToolRunning:Pt&&$.id===Re&&$.role==="assistant",onCardAction:y},$.id))}return l("div",{class:`${Ar}-list-wrap`,children:[l("div",{ref:x,class:`${Ar}-list ${Ar}-list--fade`,part:"messages",role:"log","aria-live":"polite","aria-relevant":"additions text",children:[d&&S.value.length===0?l("div",{class:`${Ar}-list-loading`,role:"status",children:n.conversationLoading}):null,o&&!Tt?l("div",{class:`${Ar}-chat-notice`,role:"note","data-testid":D.chatNotice,children:l(Hi,{text:o})}):null,Tt?l("div",{class:`${Ar}-load-previous`,children:l("button",{type:"button",onClick:Rt,disabled:w,"aria-busy":w,"data-testid":D.loadPreviousMessages,children:n.loadPreviousMessages})}):null,Ie]}),h?l("button",{type:"button",class:`${Ar}-jump`,onClick:Ze,"aria-label":n.scrollToBottom,title:n.scrollToBottom,"data-testid":D.scrollToBottom,children:l(sr,{})}):null]})}function Ux(e){try{return Intl.getCanonicalLocales(e)[0]}catch{return}}function Bx(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function zx(e,t){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(t,{dateStyle:"full"})}catch{return""}}function Hx(e,t,r){let n=new Date(e);function o(i){return new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime()}let s=Math.round((o(new Date)-o(n))/864e5);return s<=0?t.dateToday:s===1?t.dateYesterday:s<7?n.toLocaleDateString(r,{weekday:"long"}):n.toLocaleDateString(r,{month:"long",day:"numeric",year:"numeric"})}var Fx=16,jx=64;function ls({panelEl:e,resize:t,position:r,edge:n,initialSize:o,onSizeChange:s,onResizeStart:i,strings:a}){let c=q.cssPrefix,u=B(null),[p,_]=U(null),d=o?.width,f=o?.height;if(H(()=>{if(!e)return;let C=e.style;C.setProperty(`--${c}-resize-min-w`,t.minWidth??"320px"),C.setProperty(`--${c}-resize-min-h`,t.minHeight??"400px"),t.maxWidth&&C.setProperty(`--${c}-resize-max-w`,t.maxWidth),t.maxHeight&&C.setProperty(`--${c}-resize-max-h`,t.maxHeight),d!==void 0&&f!==void 0&&(C.setProperty(`--${c}-widget-w`,`${d}px`),C.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=r.startsWith("top-"),g=r.endsWith("-right"),P=g?-1:1,b=v?1:-1,y=`${c}-resize-grip--${n?"edge":`${v?"bottom":"top"}-${g?"left":"right"}`}`;function x(C){C.setAttribute("data-resizing",""),i?.()}function S(C,M,N){C.style.setProperty(`--${c}-widget-w`,`${M}px`),n||C.style.setProperty(`--${c}-widget-h`,`${N}px`)}function k(C){let M=C.getBoundingClientRect(),N={width:Math.round(M.width),height:Math.round(M.height)};C.style.setProperty(`--${c}-widget-w`,`${N.width}px`),n||C.style.setProperty(`--${c}-widget-h`,`${N.height}px`),_(Math.round(N.width/window.innerWidth*100)),s(N)}function h(C){if(!e)return;let M=e.getBoundingClientRect();u.current={pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,startW:M.width,startH:M.height,moved:!1},C.currentTarget.setPointerCapture(C.pointerId),C.preventDefault()}function m(C){let M=u.current;if(!M||C.pointerId!==M.pointerId||!e)return;let N=(C.clientX-M.startX)*P,j=n?0:(C.clientY-M.startY)*b;!M.moved&&N===0&&j===0||(M.moved||x(e),M.moved=!0,S(e,M.startW+N,M.startH+j))}function w(C){let M=u.current;!M||C.pointerId!==M.pointerId||!e||(C.currentTarget.releasePointerCapture(C.pointerId),u.current=null,M.moved&&(e.removeAttribute("data-resizing"),k(e)))}function A(C){return C==="ArrowLeft"?[-1,0]:C==="ArrowRight"?[1,0]:n?null:C==="ArrowUp"?[0,-1]:C==="ArrowDown"?[0,1]:null}function I(C){let M=A(C.key);if(!M||!e)return;C.preventDefault();let N=C.shiftKey?jx:Fx;C.repeat||x(e);let j=e.getBoundingClientRect();S(e,j.width+M[0]*N*P,j.height+M[1]*N*b)}function R(C){!A(C.key)||!e||(e.removeAttribute("data-resizing"),k(e))}return l("div",{class:`${c}-resize-grip ${y}`,role:"separator","aria-orientation":"vertical","aria-label":a.resizeHandle,"aria-valuenow":p??void 0,tabIndex:0,title:a.resizeHandle,onPointerDown:h,onPointerMove:m,onPointerUp:w,onPointerCancel:w,onKeyDown:I,onKeyUp:R,"data-testid":D.resizeGrip,children:n?null:l(N_,{})})}var dm=q.cssPrefix;function um({suggestions:e,strings:t,onPick:r,disabled:n=!1}){let o=B(null),[s,i]=U({start:!1,end:!1});return H(()=>{let a=o.current;if(!a)return;function c(){if(!a)return;let p=Math.abs(a.scrollLeft),_=p>1,d=p<a.scrollWidth-a.clientWidth-1;i(f=>f.start===_&&f.end===d?f:{start:_,end:d})}c(),a.addEventListener("scroll",c,{passive:!0});let u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(c);return u?.observe(a),()=>{a.removeEventListener("scroll",c),u?.disconnect()}},[e]),e.length===0?null:l("div",{ref:o,class:`${dm}-suggestions`,role:"group","aria-label":t.suggestedReplies,"data-cut-start":s.start?"true":void 0,"data-cut-end":s.end?"true":void 0,children:e.map((a,c)=>l("button",{type:"button",class:`${dm}-suggestion`,onClick:()=>r(a),disabled:n,"data-testid":Ct(D.suggestion,c),children:a.label},a.id))})}var hn=q.cssPrefix,Vx=`.${hn}-header, .${hn}-back-header, .${hn}-home-hero`,Wx='button, a, input, textarea, select, [role="tab"], [contenteditable]',pm=56;function cs(e,t){H(()=>{if(!t||!e)return;function r(c){return Number.parseFloat(c)||0}function n(c,u){return Math.min(u,Math.max(-u,c))}let o=null,s=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(Vx)||u.closest(Wx))return;let p=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:r(e.style.getPropertyValue(`--${hn}-modal-dx`)),dy:r(e.style.getPropertyValue(`--${hn}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-pm,maxY:(window.innerHeight+p.height)/2-pm},e.dataset.dragging="true",c.preventDefault()},i=c=>{if(!o||c.pointerId!==o.id)return;let u=n(o.dx+c.clientX-o.x,o.maxX),p=n(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${hn}-modal-dx`,`${u}px`),e.style.setProperty(`--${hn}-modal-dy`,`${p}px`)},a=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",s),window.addEventListener("pointermove",i),window.addEventListener("pointerup",a),window.addEventListener("pointercancel",a),()=>{e.removeEventListener("pointerdown",s),window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a)}},[e,t])}function ds({containerRef:e,onDrop:t,accept:r,disabled:n=!1}){let[o,s]=U();return H(()=>{if(n){s(void 0);return}let i=e.current;if(!i)return;let a=0;function c(d){a+=1,d.dataTransfer?.types.includes("Files")&&(d.preventDefault(),s([...d.dataTransfer.items].every(f=>f.kind!=="file"||gf(f.type,r))?"accept":"reject"))}function u(){a-=1,!(a>0)&&(a=0,s(void 0))}function p(d){d.dataTransfer?.types.includes("Files")&&d.preventDefault()}function _(d){a=0,s(void 0),d.dataTransfer&&(d.preventDefault(),t(d.dataTransfer.items))}return i.addEventListener("dragenter",c),i.addEventListener("dragleave",u),i.addEventListener("dragover",p),i.addEventListener("drop",_),()=>{i.removeEventListener("dragenter",c),i.removeEventListener("dragleave",u),i.removeEventListener("dragover",p),i.removeEventListener("drop",_)}},[r,e,n,t]),n?void 0:o}var ke=q.cssPrefix;function _m(e){let{options:t,onClose:r}=e,n=t.strings,o=B(null);H(()=>{let u=o.current;if(!u||!r)return;let p=Jn(u);function _(d){d.key==="Escape"&&r?.()}return u.addEventListener("keydown",_),()=>{p(),u.removeEventListener("keydown",_)}},[r]);let s=e.composerApiRef,i=e.composerActive&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,a=F(u=>{i&&s.current?.attachFromDrop(u)},[s,i]),c=ds({containerRef:o,onDrop:a,accept:e.options.attachments.accept,disabled:!i});return cs(o.current,t.mode==="modal"),l("div",{ref:o,class:`${ke}-panel`,part:"panel",role:"dialog","aria-modal":"false","aria-label":n.panelTitle,style:{position:"relative"},"data-testid":D.panel,children:[l(Ec,{...e,containerEl:o.current,dragOver:c}),l(Mc,{poweredBy:e.options.poweredBy,strings:e.options.strings})]})}function Ec(e){let{options:t,transport:r,feedback:n,bus:o,persistence:s,conversationId:i,composerKey:a,panelSize:c,view:u,isStreaming:p,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,sendPreparing:g,attachmentUploadsSig:P,controlMode:b,assignedOperator:y,operatorAvailable:x,operatorRequestEnabled:S,onRequestOperator:k,onCancelOperatorRequest:h,loadingMessages:m,onLoadPreviousMessages:w,messagesSig:A,reconnectingSig:I,agent:R,ticketReference:C,login:M,onStartAsGuest:N,suggestions:j,initialWidgetSize:G,onClose:z,onBack:le,onExpand:ue,onToggleHistory:_e,onSelectHistoryConversation:ae,onNewConversation:he,onWidgetSizeChange:Je,onSend:bt,onStop:Ve,onSuggestion:At,tool:Le,onRetry:Ze,onMessageFeedback:ye,onCardAction:Oe,containerEl:Ue,dragOver:Tt,composerApiRef:Rt}=e,Ie=t.strings,ze=b==="operator"?y:void 0,Re=ze?{name:ze.name??ze.initials,avatar:ze.avatar,title:Ie.operatorBadgeTitle,status:"online"}:R,Yt=t.header.showNotice?mt(Ie,t.header.notice||"chatNotice"):void 0,Pt=It(()=>A.value.some(ce=>!ce.ephemeral&&ce.role!=="system")).value,$=It(()=>A.value.length>0).value,[L,Y]=U(),K=L===i,re=t.features.emailTranscript&&Pt?()=>Y(i):void 0,be=M.gate?l(Zx,{login:{...M,gate:M.gate},alone:!$,onStartAsGuest:N,strings:Ie}):l(ge,{children:[b&&b!=="ai-agent"?l(Kx,{controlMode:b,operatorName:y?.name??y?.initials,operatorAvailable:x,onCancelOperatorRequest:h,strings:Ie}):null,_&&b==="ai-agent"?l("div",{class:`${ke}-loading ${ke}-compaction-status`,role:"status","data-testid":D.compactionStatus,children:[l("span",{class:`${ke}-loading-spinner`,"aria-hidden":"true"}),Ie.compactingContext]}):null,!p&&!_&&b==="ai-agent"&&l(um,{suggestions:j,strings:Ie,onPick:At,disabled:g}),l(xf,{options:t,transport:r,feedback:n,bus:o,persistence:s,conversationId:i,maxMessageCharacters:e.maxMessageCharacters,isStreaming:p,pageToolRunning:e.pageToolRunning,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,active:e.composerActive&&u==="chat",isPreparing:g,attachmentUploadsSig:P,operatorRequestEnabled:S,canRequestOperator:Pt,controlMode:b,onRequestOperator:k,onSend:bt,onStop:Ve,apiRef:Rt},a)]});return l(ge,{children:[u==="history"?l(Gx,{strings:Ie,onBack:_e,onClose:z,showClose:Ri(t.mode,c,t.actions)}):l("header",{class:`${ke}-header`,part:"header","data-variant":t.header.variant,"data-testid":D.panelHeader,children:[le?l("button",{type:"button",class:`${ke}-icon-btn`,onClick:le,"aria-label":Ie.moduleBack,title:Ie.moduleBack,children:l(Go,{})}):null,Re?l(Af,{agent:Re,strings:Ie,ticketReference:C,person:!!ze}):l("h1",{children:Ie.panelTitle}),l(ur,{panelProps:M.gate?{...e,options:{...t,actions:t.actions.filter(ce=>ce!=="history")}}:e,variant:"chat",onEmailTranscript:re,onLogIn:M.menuLogIn})]}),u==="history"?l(Ji,{transport:r,strings:Ie,locale:t.locale,persistence:s,onSelect:ae,onNewConversation:he}):l(ge,{children:[l(Of,{state:Tt,strings:Ie}),M.strip?l(Xx,{strip:M.strip,onLogIn:M.onLogIn,onHide:M.onHidePrompt,strings:Ie}):null,M.gate&&!$?null:l(cm,{messagesSig:A,reconnectingSig:I,pageToolRunning:e.pageToolRunning,strings:Ie,notice:Yt,locale:t.locale,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:ye,loading:m,onLoadPreviousMessages:w,idle:!p&&!g,controlMode:b,tool:Le,onRetry:Ze,onCardAction:Oe}),be,l(Yx,{disclaimer:t.composerDisclaimer}),K?l(qf,{transport:r,strings:Ie,knownEmail:Df({tokenEmail:M.email,userContext:t.userContext}),onClose:()=>Y(void 0)}):null]}),t.size.resize?.enabled?l(ls,{panelEl:Ue,resize:t.size.resize,position:t.position,edge:t.mode==="drawer",initialSize:G,onSizeChange:Je,onResizeStart:t.mode==="floating"&&c==="expanded"?ue:void 0,strings:Ie}):null]})}function Gx({strings:e,onBack:t,onClose:r,showClose:n}){return l("header",{class:`${ke}-header`,part:"header",children:[l("button",{type:"button",class:`${ke}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:l(Go,{})}),l("h1",{children:e.historyTitle}),n?l("button",{type:"button",class:`${ke}-icon-btn`,onClick:r,"aria-label":e.close,title:e.close,children:l(Bt,{})}):null]})}function Kx({controlMode:e,operatorName:t,operatorAvailable:r,onCancelOperatorRequest:n,strings:o}){let[s,i]=U(!1),a=Qx(e,t,r,o);function c(){n&&(i(!0),n().finally(()=>i(!1)))}return l("div",{class:`${ke}-operator-banner`,"data-mode":e,"data-available":r===!1?"false":void 0,"data-testid":D.operatorBanner,children:[l("span",{class:`${ke}-operator-pulse`,"aria-hidden":"true"}),l("span",{class:`${ke}-operator-label`,role:"status",children:a}),e==="awaiting-operator"&&n?l("button",{type:"button",class:`${ke}-icon-btn ${ke}-operator-dismiss`,onClick:c,disabled:s,"aria-label":o.cancelOperatorRequest,title:o.cancelOperatorRequest,"data-testid":D.cancelOperatorRequest,children:l(Bt,{})}):null]})}function Qx(e,t,r,n){return e==="operator"?n.chattingWithOperator.replace("{operator}",t??""):r===!1?n.noOperatorAvailable:n.connectingOperator}function Yx({disclaimer:e}){return e?l("div",{class:`${ke}-composer-footer`,children:l("div",{class:`${ke}-disclaimer`,children:e})}):null}function Xx({strip:e,onLogIn:t,onHide:r,strings:n}){let o=e.kind==="user";return l("div",{class:`${ke}-login-bar`,"data-kind":e.kind,role:o?"status":"note","data-testid":o?D.loggedIn:D.loginBar,children:[l("span",{class:`${ke}-login-bar-icon`,"aria-hidden":"true",children:l(Cr,{})}),o?l("span",{class:`${ke}-login-bar-text`,children:e.who?n.loggedInAs.replace("{name}",e.who):n.loggedIn}):l(ge,{children:[l("span",{class:`${ke}-login-bar-text`,children:n.loginPrompt}),l("button",{type:"button",class:`${ke}-login-bar-action`,onClick:t,"data-testid":D.loginBarAction,children:n.loginAction}),l("button",{type:"button",class:`${ke}-icon-btn ${ke}-login-bar-hide`,onClick:r,"aria-label":n.dismissLoginPrompt,title:n.dismissLoginPrompt,"data-testid":D.loginBarHide,children:l(Bt,{})})]})]})}function Jx(e,t){return e.gate==="required"?t.loginRequired:e.canStartAsGuest?t.loginExpiredGuest:t.loginExpired}function Zx({login:e,alone:t,onStartAsGuest:r,strings:n}){return l("div",{class:`${ke}-login-gate`,"data-gate":e.gate,"data-alone":t?"":void 0,"data-testid":D.loginGate,children:[l("span",{class:`${ke}-login-gate-icon`,"aria-hidden":"true",children:l(Cr,{})}),l("p",{class:`${ke}-login-gate-title`,role:"status",children:Jx(e,n)}),e.canLogIn||e.canStartAsGuest?l("div",{class:`${ke}-form-actions ${ke}-login-gate-actions`,children:[e.canStartAsGuest?l("button",{type:"button",class:`${ke}-form-skip`,onClick:r,"data-testid":D.loginGateGuest,children:n.startAsGuest}):null,e.canLogIn?l("button",{type:"button",class:`${ke}-form-submit`,onClick:e.onLogIn,"data-testid":D.loginGateAction,children:n.loginAction}):null]}):null]})}function Mc({poweredBy:e,strings:t}){return e?l("div",{class:`${ke}-poweredby-bar`,children:l(eS,{logoUrl:e.logoUrl,text:e.text??t.poweredBy.replace("{name}",q.displayName),href:e.href})}):null}function eS({logoUrl:e,text:t,href:r}){let n=l(ge,{children:[e?l("img",{class:`${ke}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?l("span",{children:t}):null]});return r?l("a",{class:`${ke}-poweredby`,href:r,target:"_blank",rel:"noopener noreferrer",children:n}):l("span",{class:`${ke}-poweredby`,children:n})}var us=q.cssPrefix;function fm({panelProps:e,enabledModules:t,nav:r,bus:n,hasUnread:o,latestNews:s,onSelectConversation:i,onStartNewConversation:a,onSetPanelSize:c}){let u=e.options,p=u.strings,_=B(null),d=B(new Set);H(()=>{let N=_.current;if(!N||!e.onClose)return;let j=Jn(N);function G(z){z.key==="Escape"&&e.onClose?.()}return N.addEventListener("keydown",G),()=>{j(),N.removeEventListener("keydown",G)}},[e.onClose]);let f=It(()=>r.sig.value).value,v=x_(f),g=u.modules.byId[f.activeTab],P=e.composerActive&&g?.layout==="chat"&&v===void 0,b=e.composerApiRef,y=P&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,x=F(N=>{y&&b.current?.attachFromDrop(N)},[b,y]),S=ds({containerRef:_,onDrop:x,accept:e.options.attachments.accept,disabled:!y});cs(_.current,u.mode==="modal");let k=v?.kind==="content",h=t.length>1&&S_(f),m=B(null);H(()=>{if(k&&m.current===null)m.current=e.panelSize,e.panelSize==="normal"&&c("expanded");else if(!k&&m.current!==null){let N=m.current;m.current=null,c(N)}},[k]);let w={push:N=>r.push(N),pop:()=>r.pop(),switchTab:N=>r.switchTab(N),switchToLayout:N=>{let j=t.find(G=>G.layout===N);j&&r.switchTab(j.id)},selectConversation:i,startNewConversation:a};function A(N){return{options:u,transport:e.transport,strings:p,config:N,nav:w,bus:n,panelProps:e,latestNews:s}}let I=l(ur,{panelProps:e,variant:"plain"});g&&d.current.add(g.id);let R=t.filter(N=>d.current.has(N.id));function C(N){if(N.layout==="chat")return l(Ec,{...e,composerActive:P,containerEl:_.current,dragOver:S});let j=Xi[N.layout].Root;return j?l(j,{...A(N)}):null}function M(){return v?.kind==="content"?l(sf,{id:v.id,title:v.title,transport:e.transport,strings:p,bus:n,onBack:()=>r.pop(),actions:I}):null}return l("div",{ref:_,class:`${us}-panel ${us}-messenger`,part:"panel",role:"dialog","aria-modal":"false","aria-label":p.panelTitle,style:{position:"relative"},"data-testid":D.messengerHome,children:[l("div",{class:`${us}-messenger-body`,children:[R.map(N=>l("div",{class:`${us}-messenger-pane`,hidden:k||N.id!==g?.id,children:C(N)},N.id)),M()]}),h?l(If,{modules:t,activeTab:f.activeTab,strings:p,hasUnread:o,onSelect:N=>r.switchTab(N)}):null,l(Mc,{poweredBy:u.poweredBy,strings:u.strings}),u.size.resize?.enabled&&!(g?.layout==="chat"&&!v)?l(ls,{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 mm(e){let t=q.cssPrefix,{site:r,blocks:n,strings:o,collapsed:s}=e,i=n?.navigation??[],a=n?.linkCards??[],c=s?o.expandSidebar:o.collapseSidebar;return l("aside",{class:`${t}-sidebar`,"data-collapsed":s?"true":"false","data-testid":D.sidebar,children:[l("div",{class:`${t}-sidebar-header`,children:[l(tS,{site:r}),l("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":s?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":D.sidebarToggle,children:l(rS,{collapsed:s})})]}),s?null:l(ge,{children:[i.length>0?l("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:l(nS,{items:i})}):null,a.length>0?l("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:l(oS,{items:a})}):null,e.showConversations?l("div",{class:`${t}-sidebar-conversations`,children:l(Ji,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function tS({site:e}){let t=q.cssPrefix;if(e?.logo?.url){let r=e.logo.alt??e.title??"Logo";return l("picture",{children:[e.logoDark?.url?l("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,l("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:r})]})}return l("div",{class:`${t}-sidebar-title`,children:e?.title??q.name})}function rS({collapsed:e}){return l("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?l("polyline",{points:"9 6 15 12 9 18"}):l("polyline",{points:"15 6 9 12 15 18"})})}function nS({items:e}){let t=q.cssPrefix;return l("ul",{class:`${t}-sidebar-nav`,children:e.map(r=>l("li",{children:l("a",{class:`${t}-sidebar-nav-item`,href:r.href,target:r.href?"_blank":void 0,rel:r.href?"noreferrer":void 0,children:[r.icon?l("span",{class:`${t}-sidebar-nav-icon`,"data-icon":r.icon}):null,l("span",{class:`${t}-sidebar-nav-label`,children:r.label})]})},r.id??r.label))})}function oS({items:e}){let t=q.cssPrefix;return l("div",{class:`${t}-sidebar-cards`,children:e.map(r=>l("a",{class:`${t}-sidebar-card`,href:r.href,target:r.href?"_blank":void 0,rel:r.href?"noreferrer":void 0,children:[l("div",{class:`${t}-sidebar-card-label`,children:r.label}),r.description?l("div",{class:`${t}-sidebar-card-desc`,children:r.description}):null]},r.id??r.label))})}var gm=q.cssPrefix;function vm(e){return l("main",{class:`${gm}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[l(mm,{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}),l("section",{class:`${gm}-page-chat`,"aria-label":e.strings.panelTitle,children:e.children})]})}var na=q.cssPrefix;function Lc({strings:e,text:t,onClose:r}){return l("div",{class:`${na}-panel ${na}-panel-notice`,part:"panel",role:"dialog","aria-label":e.panelTitle,"data-testid":D.panelNotice,children:[r?l("button",{type:"button",class:`${na}-icon-btn ${na}-panel-notice-close`,onClick:r,"aria-label":e.close,title:e.close,children:l(Bt,{})}):null,l("p",{class:`${na}-panel-notice-text`,children:t})]})}var oa=te.scope("hitl");function aa(e){return e.kind==="tool"&&nr(e.toolMetadata)&&(e.stateSig.value==="input-available"||e.stateSig.value==="approval-responded"&&e.approvalSig.value?.approved===!0)}function hm(e,t){t.errorSig.value=al(t.toolCallId),t.stateSig.value="output-error",e.partsSig.value=[...e.partsSig.value]}function ym(e,t){let r=e.slice(0,e.indexOf(t)).findLast(n=>n.role==="user");return r!==void 0&&Ot.sentHere(r.id)}function bm(e){let{streaming:t,controlModeSig:r,messagesSig:n,sendAiTurn:o,bus:s,humanInLoop:i,tools:a}=e,c=B(t);c.current=t;let u=B(a);u.current=a;let p=B(new Map),_=It(()=>{let x=n.value,S=x.at(-1);return r.value!=="ai-agent"||S?.role!=="assistant"||S.status!=="complete"?!1:S.partsSig.value.some(k=>aa(k)&&Ot.get(k.toolCallId)?.state!=="stopped")&&ym(x,S)}).value,d=F((x,S,k)=>{if(c.current||r.value!=="ai-agent")return!1;let h=n.value.at(-1),m=h?.partsSig.value.findIndex(I=>I.kind==="tool"&&I.toolCallId===x)??-1,w=h?.partsSig.value[m];if(!h||w?.kind!=="tool")return oa.warn("decideTool: tool part not found",{toolCallId:x}),!1;if(h.status!=="complete"||!ki(h,m)||!S(w))return!1;if(k(w),h.partsSig.value=[...h.partsSig.value],!fn(h)||h.partsSig.value.some(aa))return!0;h.status="streaming",h.retryAction={kind:"continue-assistant",messageId:h.serverMessageId??h.id},h.awaitingContinuation=!0,n.value=[...n.value];let A=h.partsSig.value.flatMap(I=>I.kind==="tool"?[I.toolCallId]:[]);return o({continueExisting:!0}).then(I=>I&&Ot.clear(A)),!0},[r,n,o]),f=F((x,S)=>{let{toolCallId:k,toolName:h}=S;p.current.has(k)||(p.current.set(k,x),Yd({toolCallId:k,toolName:h,input:S.inputSig.value,optionTools:u.current??[],onSettled:(m,w)=>{oa.info("toolResult",{toolCallId:k,status:m}),s.emit("toolResult",{toolCallId:k,name:ho(h),status:m,durationMs:w})}}).then(m=>{p.current.delete(k)&&d(k,aa,w=>{m.state==="output-available"?w.outputSig.value=m.output:w.errorSig.value=m.errorText,w.stateSig.value=m.state})}))},[s,d]),v=F(()=>{let x=n.value;for(let[h,m]of p.current){let w=x.findIndex(A=>A.id===m);w<0||w===x.length-1||(p.current.delete(h),Xd(h))}let S=x.at(-1);if(c.current||S?.role!=="assistant"||S.status!=="complete")return;let k=S.partsSig.value.filter(aa);if(!(k.length===0||!ym(x,S)))for(let h of k)Ot.get(h.toolCallId)?.state==="stopped"?hm(S,h):f(S.id,h)},[n,f]);H(()=>v(),[t,v]),H(()=>n.subscribe(()=>v()),[n,v]);let g=F((x,S,k)=>{let h=!1,m;if(!d(x,I=>I.stateSig.value==="approval-requested",I=>{nr(I.toolMetadata)&&(m=I),h=I.toolMetadata?.card==="questions";let R=I.approvalSig.value?.id??x;I.approvalSig.value={id:R,approved:S,reason:k},I.stateSig.value="approval-responded"}))return;let A=n.value.at(-1);if(m&&S&&A&&f(A.id,m),m&&!S&&s.emit("toolResult",{toolCallId:x,name:ho(m.toolName),status:"declined",durationMs:0}),h){oa.info("toolResult",{toolCallId:x}),s.emit("toolResult",{toolCallId:x});return}oa.info("toolDecision",{toolCallId:x,approved:S}),s.emit("toolDecision",{toolCallId:x,approved:S})},[s,d,n,f]),P=F(x=>{d(x,S=>S.stateSig.value==="approval-responded"&&S.approvalSig.value?.approved!==void 0&&!aa(S),S=>{let k=S.approvalSig.value?.id??x;S.approvalSig.value={id:k},S.stateSig.value="approval-requested"})},[d]),b=ve(()=>({humanInLoop:i,onDecision:g,onEdit:P}),[i,g,P]),y=F(()=>{let x=n.value.at(-1);for(let S of p.current.keys()){let k=x?.partsSig.value.find(h=>h.kind==="tool"&&h.toolCallId===S);x&&k?hm(x,k):al(S),oa.info("toolResult",{toolCallId:S,status:"stopped"}),s.emit("toolResult",{toolCallId:S,name:k?ho(k.toolName):void 0,status:"stopped",durationMs:0})}p.current.clear()},[s,n]);return{toolInteraction:b,pageToolsRunning:_,stopPageTools:y}}var aS=te.scope("latest-news");function Pm({transport:e,options:t,persistence:r,enabled:n}){let o=t.modules.list.find(_=>_.layout==="news")?.contentCollectionIds,s=o?.join(","),[i,a]=U(),[c,u]=U(()=>r.loadSeenNewsId());H(()=>{if(!n||!o?.length)return;let _=!1;return e.listContent({contentCollectionIds:o,sortBy:"publishedAt",sortOrder:"desc",limit:1}).then(d=>{_||a(d.items[0])}).catch(d=>aS.debug("listContent (latest news) failed (non-fatal)",{err:d})),()=>{_=!0}},[e,n,s]);let p=F(_=>{r.saveSeenNewsId(_),u(_)},[r]);return{item:i,unseen:i!==void 0&&i.id!==c,markSeen:p}}function xm({callout:e,persistence:t}){let r=e?.text??"",n=e?.persistent??!0,[o,s]=U(()=>n?!1:t.loadCalloutDismissed(r));H(()=>{s(n?!1:t.loadCalloutDismissed(r))},[r,n,t]);let i=F(()=>{s(!0),n||t.saveCalloutDismissed(r)},[t,r,n]);return{dismissed:o,dismissCallout:i}}var iS=te.scope("login");function sS(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 lS(e,t,r){if(e.status==="loggedIn")return t.hideUser?void 0:{kind:"user",who:e.name??e.email};if(!(e.status!=="anonymous"||!t.url||t.hidePrompt||r))return{kind:"prompt"}}function Sm(e){let{state:t,deployment:r,bus:n,persistence:o,conversationIdSig:s}=e,[i,a]=U(()=>o.loadLoginPromptDismissedIn()),c=It(()=>s.value).value,u=i!==void 0&&i===c,p=(t.status==="required"?t.loginUrl:void 0)??r.url,_=sS(t,r.required),d=F(()=>{let g=tp(),P=n.listensTo("loginRequested");if(iS.info("loginRequested",{pageLogsIn:P}),n.emit("loginRequested",{returnTo:g}),P||!p)return;let b=s.value;b&&o.saveLoginReturn({conversationId:b,draft:o.loadDraft(b)}),o.savePanelOpen(!1),rp(Xu(p,g))},[n,s,p,o]),f=F(()=>{let g=s.value;g&&(o.dismissLoginPromptIn(g),a(g))},[s,o]),v=!!p||n.listensTo("loginRequested");return{strip:lS(t,r,!!_||u),gate:_,canStartAsGuest:_==="expired"&&!r.required,email:t.status==="loggedIn"?t.email:void 0,canLogIn:v,onLogIn:d,menuLogIn:t.status==="anonymous"&&!_&&v?d:void 0,onHidePrompt:f}}function wm(e){let{transport:t,conversationIdSig:r}=e,n=$t("ai-agent"),o=$t(void 0),s=$t(void 0),i=B(void 0),a=F(_=>{let d=_.controlRevision,f=i.current;if(f&&f.conversationId===r.value&&d<f.revision)return;i.current={conversationId:r.value,revision:d},n.value=_.controlMode;let v=_.assignedOperatorInitials;o.value=v?{initials:v,name:_.assignedOperatorName,avatar:_.assignedOperatorAvatar}:void 0,_.controlMode!=="awaiting-operator"?s.value=void 0:_.operatorAvailable!==void 0&&(s.value=_.operatorAvailable)},[r,n,o,s]),c=F(_=>{if(_.type!=="data-control-state")return;let d=Pi(_.data);d&&a(d)},[a]),u=F(async()=>{let _=r.value,d=await t.requestOperator();d&&r.value===_&&a(d)},[t,r,a]),p=F(async()=>{let _=r.value,d=await t.cancelOperatorRequest();d&&r.value===_&&a(d)},[t,r,a]);return{controlModeSig:n,assignedOperatorSig:o,operatorAvailableSig:s,applyControlState:a,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:p}}var ps=q.cssPrefix,km=`--${ps}-visual-viewport-height`,Cm=`--${ps}-visual-viewport-top`;function Tm(e){let{hostElement:t,mode:r,panelSize:n,isOpen:o,surfaceReady:s,onClose:i}=e;St(()=>{Va(t,Ei(r,n,o))},[t,o,n,r]),St(()=>{if(!o||!s)return;let a=t.ownerDocument.defaultView,c=a?.visualViewport,u=t.shadowRoot?.querySelector(`.${ps}-anchor`);if(!a||!c||!u)return;let p=()=>{u.style.setProperty(km,`${c.height}px`),u.style.setProperty(Cm,`${c.offsetTop}px`)},_=0,d=()=>{a.cancelAnimationFrame(_),_=a.requestAnimationFrame(()=>{_=a.requestAnimationFrame(p)})};return p(),c.addEventListener("resize",d),c.addEventListener("scroll",d),()=>{a.cancelAnimationFrame(_),c.removeEventListener("resize",d),c.removeEventListener("scroll",d),u.style.removeProperty(km),u.style.removeProperty(Cm)}},[t,o,s]),H(()=>{if(r!=="modal"||!o)return;function a(c){c.composedPath().some(p=>p instanceof HTMLElement&&p.classList.contains(`${ps}-panel`))||i()}return t.addEventListener("click",a),()=>t.removeEventListener("click",a)},[t,o,r,i]),H(()=>{if(r!=="drawer"||!o)return;function a(c){c.key==="Escape"&&!c.composedPath().includes(t)&&i()}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,o,r,i])}var Nc=te.scope("reducer"),_s=class{constructor(t,r){ee(this,"messagesSig",t);ee(this,"onReconcileNeeded",r);ee(this,"active",null);ee(this,"openTextParts",new Map);ee(this,"partSeq",0);ee(this,"replay",null);ee(this,"turnChunks",[]);ee(this,"turnRow",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,r){let n=dr();n.id=t.id;let o=yn(t)||mn(t)&&(t.status!=="streaming"||fn(t)),s=t.status==="streaming"&&fn(t)&&zo(t);this.replay={baseline:t,shadow:n,chunks:[r],probeContinuation:o,continuationTailReplay:s,liveCatchUp:t.status==="streaming"&&!o},this.attach(n),this.apply(r)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let r=t.shadow.serverMessageId??t.baseline.serverMessageId,n=this.messagesSig.value,o=n.at(-1),s=o===t.baseline||o?.id===t.baseline.id||r!==void 0&&o?.serverMessageId===r?o:n.find(a=>a===t.baseline)??n.find(a=>a.id===t.baseline.id||r!==void 0&&a.serverMessageId===r);if(!s)return this.detach(),null;if(s===t.baseline)return t;let i=t.baseline;return t.baseline=s,Im(i,s),t.liveCatchUp&&yn(t.shadow)&&(s.status==="streaming"||mn(s))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=yn(s)||mn(s)&&(s.status!=="streaming"||fn(s)),t.continuationTailReplay=s.status==="streaming"&&fn(s)&&zo(s),t.liveCatchUp=s.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let r=t.serverMessageId,n=this.messagesSig.value,o=n.at(-1),s=o===t||o?.id===t.id||r!==void 0&&o?.serverMessageId===r?o:n.find(a=>a===t)??n.find(a=>a.id===t.id||r!==void 0&&a.serverMessageId===r);if(!s)return this.detach(),null;if(s===t)return t;Im(t,s);let i=yn(t)&&mn(s);return s.status!=="streaming"&&!i?(this.detach(),null):(this.replayTurn(),this.replay?this.replay.shadow:this.active)}replayTurn(){let[t,...r]=this.turnChunks;if(t?.type!=="start")return;let n=this.messagesSig.value.find(o=>o.serverMessageId===t.messageId);if(!(n===void 0||n===this.turnRow)){this.detach();for(let o of[t,...r])this.applyResume(o)}}promoteReplay(t){let{baseline:r,shadow:n}=t;return er(()=>{r.role=n.role,r.serverMessageId=n.serverMessageId,r.operatorInitials=n.operatorInitials,r.status=n.status,n.canceled&&(r.canceled=!0),r.finishReason=n.finishReason,r.errorText=n.errorText,r.suggestions=n.suggestions??r.suggestions,r.runStartedAt=n.runStartedAt??r.runStartedAt,r.stepTimings=n.stepTimings??r.stepTimings,r.partsSig.value=n.partsSig.value,this.messagesSig.value=[...this.messagesSig.value]}),this.replay=null,this.active=r,r}promoteContinuation(t){let{baseline:r,chunks:n}=t,o=Ci(r);return this.replay=null,er(()=>{r.partsSig.value=r.partsSig.value.slice(0,cS(r,n)+1),r.awaitingContinuation=!1,r.status="streaming",r.finishReason=void 0,r.errorText=void 0,r.suggestions=void 0,this.attach(r);for(let s of n)this.apply(s);r.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),r}settleOwnedContinuation(t,r){let{baseline:n}=t,o=Ci(n);return this.replay=null,er(()=>{n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n),this.apply(r),n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}applyResume(t){t.type==="start"&&(this.turnChunks=[]);let r=this.applyTurnChunk(t);return this.turnChunks.push(t),this.turnRow=r??this.replay?.baseline??this.active??this.turnRow,r}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 s=t.messageId,i=s!==void 0?this.messagesSig.value.find(p=>p.serverMessageId===s||p.id===s):void 0;if(i!==void 0)return t.messageMetadata?.senderRole==="visitor"&&i.role==="user"&&(i.status==="pending"||i.status==="error")&&(i.serverMessageId=s,i.status="complete",i.errorText=void 0,i.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(i,t),null;let a=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(a===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!ir(c))return this.attach(c),this.apply(t),null;let u=dr();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let n=this.refreshReplayBaseline();if(!n)return null;n.chunks.push(t),t.type==="data-control-state"&&(n.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:s,probeContinuation:i,continuationTailReplay:a,liveCatchUp:c}=n,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(i){if(!pS(o,s,t)){if(u){if(o.status==="streaming"&&o.awaitingContinuation!==!0){let d=this.settleOwnedContinuation(n,t);return this.detach(),d}gS(o,s)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id})),this.detach()}return null}let _=yn(o)&&u?this.settleOwnedContinuation(n,t):this.promoteContinuation(n);return u?(_.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:_.serverMessageId??_.id}):_.continuationStreaming=!1),this.detach(),_):null}if(a&&uS(o,s)){let _=this.promoteContinuation(n);return u?(this.detach(),_):null}if(!c)return u&&this.detach(),null;if(u&&!ir(o)&&ir(s)){let _=this.promoteReplay(n);return this.detach(),_}if(!dS(o,s))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}),this.detach()),null;let p=this.promoteReplay(n);return u?(this.detach(),p):null}let r=this.refreshActive();if(!r)return null;if(this.replay)return this.applyTurnChunk(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let n=r;return n.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:n.serverMessageId??n.id}):n.continuationStreaming=!1),this.detach(),n}return null}ensureTextPart(t,r,n){let o=`${r}:${n}`,s=this.openTextParts.get(o);if(s)return s;let i={kind:r,id:`${n}#${this.partSeq++}`,textSig:se(""),doneSig:se(!1)};return this.openTextParts.set(o,i),ia(t,i),i}apply(t){let r=this.active;if(r)switch(t.type){case"start":{t.messageId&&(r.serverMessageId=t.messageId);let n=t.messageMetadata;n?.runStartedAt&&(r.runStartedAt=n.runStartedAt),n?.senderRole==="operator"?(r.role="operator",n.operatorInitials&&(r.operatorInitials=n.operatorInitials)):n?.senderRole==="visitor"&&(r.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":ia(r,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"message-metadata":r.stepTimings=Si(t.messageMetadata?.steps)??r.stepTimings;return;case"finish":Nc.debug("finish",{reason:t.finishReason}),r.stepTimings=Si(t.messageMetadata?.steps)??r.stepTimings,r.status="complete",r.retryAction=void 0,t.finishReason&&(r.finishReason=t.finishReason),this.bumpDone(r);return;case"error":Nc.warn("stream error chunk",{errorText:t.errorText}),r.status="error",r.errorText=void 0,this.bumpDone(r);return;case"abort":Nc.debug("stream abort chunk (canceled)"),r.status="complete",r.canceled=!0,r.retryAction=void 0,this.bumpDone(r);return;case"text-start":this.ensureTextPart(r,"text",t.id);return;case"text-delta":{let n=this.ensureTextPart(r,"text",t.id);n.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(r,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(r,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let n=this.ensureTextPart(r,"reasoning",t.id);n.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(r,"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":vS(r,t);return;case"file":ia(r,{kind:"file",url:t.url,mediaType:t.mediaType,filename:t.filename,fileId:t.fileId,fileSize:t.fileSize});return;case"source-url":Am(r,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Am(r,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":r.suggestions=xi(t.data);return;case"data-control-state":r.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;case"data-memory-compaction-state":return;default:{let n=t}}}bumpDone(t){er(()=>{t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])})}};function yn(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function Im(e,t){e.canceled&&(t.canceled=!0),!(!yn(e)||t.status!=="streaming"&&!mn(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function cS(e,t){let r=e.partsSig.value,n=t.findIndex(a=>a.type==="start-step"),o=new Set(t.slice(0,n<0?t.length:n).flatMap(a=>"toolCallId"in a&&a.type.startsWith("tool-output")?[a.toolCallId]:[])),s=r.findLastIndex(a=>a.kind==="tool"&&(a.stateSig.value==="approval-requested"||a.stateSig.value==="approval-responded"||o.has(a.toolCallId)));if(s>=0)return s;let i=new Set(t.flatMap(a=>a.type==="tool-input-start"||a.type==="tool-input-available"?[a.toolCallId]:[]));return r.some(a=>a.kind==="tool"&&i.has(a.toolCallId))?-1:r.findLastIndex(a=>a.kind==="tool")}function dS(e,t){let r=e.partsSig.value,n=t.partsSig.value;return e.role!==t.role||n.length<r.length?!1:r.every((o,s)=>Rm(o,n[s]))}function uS(e,t){let r=e.partsSig.value,n=r.findLastIndex(a=>a.kind==="tool"),o=new Set(r.slice(0,n+1).flatMap(a=>a.kind==="tool"?[a.toolCallId]:[])),s=t.partsSig.value.filter(a=>a.kind!=="tool"||!o.has(a.toolCallId)),i=r.slice(n+1);return s.length<i.length?!1:i.every((a,c)=>Rm(a,s[c]))}function Rm(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||!Ti(t.toolName,e.toolName)||Vn[t.stateSig.value]<Vn[e.stateSig.value])return!1;let r=e.approvalSig.value?.approved;return r===void 0||t.approvalSig.value?.approved===r}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 pS(e,t,r){return _S(e,r)||!fS(e,t)?!0:r.type!=="finish"&&r.type!=="error"&&r.type!=="abort"?!1:zo(t)||e.awaitingContinuation===!0&&r.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(n=>n.kind==="step-start")}function _S(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let r=e.partsSig.value.find(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId);return r!==void 0&&Vn[r.stateSig.value]<4}function fS(e,t){let r=t.partsSig.value;if(r.length===0)return!0;let n=e.partsSig.value;return n.some((o,s)=>r.every((i,a)=>mS(n[s+a],i)))}function mS(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"||Ti(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 gS(e,t){if(yn(e)||!mn(e))return!1;let r=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&r.has(o.toolCallId))}function Gr(e,t,r={}){let n=e.partsSig.value.find(s=>s.kind==="tool"&&s.toolCallId===t);if(n)return r.dynamic&&(n.dynamic=!0),n.toolMetadata??(n.toolMetadata=r.toolMetadata),n.title??(n.title=r.title),n;let o={kind:"tool",toolCallId:t,toolName:r.toolName??"tool",title:r.title,dynamic:r.dynamic?!0:void 0,toolMetadata:r.toolMetadata,inputPartialSig:se(""),inputSig:se(void 0),outputSig:se(void 0),errorSig:se(void 0),stateSig:se("input-streaming"),approvalSig:se(void 0)};return ia(e,o),o}function ia(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Am(e,t){e.partsSig.value.some(r=>r.kind==="source"&&r.sourceId===t.sourceId)||ia(e,t)}function vS(e,t){switch(t.type){case"tool-input-start":Gr(e,t.toolCallId,t);return;case"tool-input-delta":{let r=Gr(e,t.toolCallId);r.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let r=Gr(e,t.toolCallId,t);r.inputSig.value=t.input,r.stateSig.value="input-available";return}case"tool-input-error":{let r=Gr(e,t.toolCallId,t);r.inputSig.value=t.input,r.errorSig.value=t.errorText,r.stateSig.value="output-error";return}case"tool-approval-request":{let r=Gr(e,t.toolCallId,t);if(t.isAutomatic){r.approvalSig.value={id:t.approvalId,isAutomatic:!0};return}r.approvalSig.value={id:t.approvalId},r.stateSig.value="approval-requested";return}case"tool-approval-response":{let r=e.partsSig.value.find(n=>n.kind==="tool"&&n.approvalSig.value?.id===t.approvalId);r?.approvalSig.value&&(r.approvalSig.value={...r.approvalSig.value,approved:t.approved,reason:t.reason});return}case"tool-output-available":{let r=Gr(e,t.toolCallId,t);r.outputSig.value=t.output,r.stateSig.value="output-available";return}case"tool-output-error":{let r=Gr(e,t.toolCallId,t);r.errorSig.value=t.errorText,r.stateSig.value="output-error";return}case"tool-output-denied":{let r=Gr(e,t.toolCallId);r.stateSig.value="output-denied";return}default:return}}async function Em(e){let t=1e3,r=!1,n=!1,o=!1;function s(){o||e.signal.aborted||(o=!0,e.onInitialBoundaryReady())}for(;!e.signal.aborted;){let i,a="held";try{a=await e.connect(()=>{if(e.signal.aborted)return;i=e.now();let c=r||n;r=!0,n=!1,o?c&&e.backfill():s()})}catch{}if(e.signal.aborted||(!r&&i===void 0&&(n=!0,s()),a==="unavailable"))return;e.onDropped?.(),i!==void 0&&e.now()-i>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var hS=120;function Mm(e){let{activated:t,conversationReady:r,paused:n,conversationIdSig:o,messagesSig:s,optionsRef:i,transport:a,visitorId:c,adoptControlStateChunk:u,adoptMemoryCompactionStateChunk:p,settleSuggestions:_,recordConversationReply:d,transcriptRecoverySig:f,beginConversationTranscript:v,commitConversationTranscript:g,runCancellation:P,feedback:b,bus:y,loadInitialThread:x,shouldReconcileOnConnect:S,reconnectingSig:k}=e,h=B(0);H(()=>{if(!t||!r||n||!o.value)return;let m=o.value,w=new AbortController,A=L=>{},I=new _s(s,L=>A(L));a.primeIdentity(c,m);let R=!1,C=!1,M,N=!1,j,G=0,z,le,ue=Date.now(),_e,ae=!1,he=!1,Je=!1,bt;function Ve(L,Y){if(!ir(L))return;let K=s.value.findLast(be=>!be.ephemeral),re=L.serverMessageId??L.id;if(!(K&&(K.serverMessageId??K.id)!==re)){if(_e&&ae&&!s.value.some(be=>be.role==="user"&&!be.ephemeral)){bt={replyId:re,activityAt:Y};return}return wi(s.value,L,m,i.current.strings.newConversation,Y)}}function At(L,Y,K){let re=Ve(L,K);if(!re)return;let ce=`${L.serverMessageId??L.id}:${Y}:${re.preview??""}`;ce!==le&&(le=ce,a.publishConversation({...re,hasUnread:!0},!0))}let Le;function Ze(){Le&&(clearTimeout(Le.timer),Le=void 0)}function ye(){let L=Le;if(!L)return;clearTimeout(L.timer),Le=void 0;let Y=s.value.find(K=>(K.serverMessageId??K.id)===L.replyId);Y?.role!=="assistant"&&Y?.role!=="operator"||At(Y,L.generation,L.activityAt)}function Oe(L,Y,K){Ze(),Le={replyId:L.serverMessageId??L.id,generation:Y,activityAt:K,timer:setTimeout(ye,hS)}}function Ue(L,Y,K=Date.now(),re=!0){Ze();let be=Ve(L,K);if(!be)return;let Pe=`${L.serverMessageId??L.id}:${Y}`;Pe!==z&&(z=Pe,d(be),re&&_e&&!ae&&(he=!0))}function Tt(L,Y){(L||!P.localSendRef.current)&&P.settle(Y)}function Rt(L,Y=[],K=!1,re,be=G,ce=Date.now(),Pe=!0){let lt=i.current;if(L.canceled){Ue(L,be,ce,Pe),Tt(K,re);return}let He=!0,pt=L.status==="error";switch(n_(L,pt)){case"drop":s.value=s.value.filter(We=>We!==L),He=!1;break;case"complete-operator-routed":L.status="complete",K&&(b.play("messageReceived"),Kn(y,lt,"assistant",Ye(L)));break;case"error":{if(L.status="error",K){b.play("error");let We=new Error(pt?"stream error chunk":"empty reply");y.emit("error",We),lt.onError?.(We)}break}case"complete":L.status="complete",K&&(b.play("messageReceived"),Kn(y,lt,"assistant",Ye(L))),_(L,Y);break}He&&Ue(L,be,ce,Pe),Tt(K,re)}function Ie(L){if(w.signal.aborted||o.value!==m)return;if(u(L),p?.(L),L.type==="start"){let _t=function(xt){return xt.role==="assistant"&&xt.retryAction?.kind==="resend-user"&&xt.retryAction.messageId===Xt};var We=_t;ye();let Lt=L.messageId===void 0?void 0:s.value.find(xt=>xt.serverMessageId===L.messageId||xt.id===L.messageId);N=Lt!==void 0&&Lt.status!=="streaming";let Vt=j?.senderRole==="visitor"?j.messageId:void 0;j={messageId:L.messageId,senderRole:L.messageMetadata?.senderRole},G+=1,ue=Date.now(),le=void 0,R=L.messageMetadata?.senderRole===void 0,C=!1,M=R?L.messageMetadata?.runId:void 0;let Xt=R?L.messageMetadata?.senderMessageId:void 0;if(Xt&&s.value.some(_t)&&(s.value=s.value.filter(xt=>!_t(xt))),R){let xt=L.messageId!==void 0&&s.value.some(Kr=>Kr.serverMessageId===L.messageId||Kr.id===L.messageId),Jt=s.value.at(-1),Pn=L.messageId!==void 0&&(Jt?.serverMessageId===L.messageId||Jt?.id===L.messageId),xn=P.localSendRef.current&&(!xt||Pn)&&Jt?.role==="assistant"&&Jt.status==="streaming"&&(Pn||Jt.serverMessageId===void 0&&Jt.partsSig.value.length===0);C=P.captureStart(m,L,xn,Vt)}}let Y=R&&(L.type==="finish"||L.type==="error"||L.type==="abort"),K=Y?M:void 0,re=Y&&(C||P.ownsLocalRun(K)),be=G,ce=N;Y&&(R=!1,C=!1,M=void 0);let Pe=I.applyResume(L),lt=j?.messageId,He=lt===void 0?void 0:s.value.find(Lt=>Lt.serverMessageId===lt||Lt.id===lt);N&&j?.senderRole!=="visitor"&&(Pe!==null||He?.status==="streaming")&&(N=!1,ce=!1);let pt=!N&&(He?.role==="assistant"||He?.role==="operator");if(L.type==="text-delta"&&pt&&Oe(He,G,ue),L.type==="text-end"&&(Ze(),pt&&At(He,G,ue)),!Pe){Y&&(re||!P.localSendRef.current)&&P.settle(K);return}if(Pe.role==="operator"){ce||(b.play("messageReceived"),Kn(y,i.current,"operator",Ye(Pe))),Ue(Pe,be,ue),N=!1,Y&&(re||!P.localSendRef.current)&&P.settle(K);return}Pe.role==="assistant"&&(Rt(Pe,[],re,K,be,ue),N=!1)}async function ze(L){let Y=G,K=await a.loadConversation(m,L?{ids:[L]}:void 0).catch(()=>null);if(w.signal.aborted||o.value!==m||!K)return!1;K.controlState&&u({type:"data-control-state",data:K.controlState});let re=s.value.at(-1),be=Y===G&&(L===void 0||re!==void 0&&(re.serverMessageId===L||re.id===L));if(K.messages.length===0)return!0;let ce=s.value,Pe=L===void 0?ce.at(-1):ce.find(_t=>_t.serverMessageId===L||_t.id===L),lt=Ho(ce,Fr(K.messages)),He=e_(K.messages),pt=lt.messages.filter(_t=>!(_t.role==="assistant"&&_t.retryAction?.kind==="resend-user"&&He.has(_t.retryAction.messageId)));if(!lt.changed&&pt.length===lt.messages.length)return!0;s.value=pt;let We=L===void 0?pt.at(-1):pt.find(_t=>_t.serverMessageId===L||_t.id===L),Lt=Pe!==void 0&&We!==void 0&&(Pe.id===We.id||Pe.serverMessageId!==void 0&&Pe.serverMessageId===We.serverMessageId),Vt=We!==void 0&&We.status!=="streaming"&&(!Lt||Pe?.status==="streaming"),Xt=Lt&&Pe?.status==="streaming"?Date.now():We?.createdAt;return be&&Vt&&We.role==="assistant"?Rt(We,We.suggestions??[],P.localSendRef.current,void 0,Y,Xt,!1):be&&Vt&&We.role==="operator"?Ue(We,Y,Xt,!1):be&&We?.role==="assistant"&&We.status!=="streaming"&&_(We,We.suggestions??[]),!0}let Re=new Set;A=({messageId:L})=>{if(Re.has(L)||!s.value.some(K=>K.serverMessageId===L||K.id===L))return;Re.add(L);function Y(){return Re.delete(L)}ze(L).then(Y,Y)};function Yt(){let L=bt;bt=void 0;let Y=L&&s.value.find(re=>(re.serverMessageId??re.id)===L.replyId),K=Y&&Ve(Y,L.activityAt);K&&d(K)}function Pt(L=!1){if(w.signal.aborted||o.value!==m){he=!1;return}if(_e){he=!0;return}let Y=L?x(m):void 0,K=Y??(!L||S()?ze():void 0);if(!K)return;v(m),_e=K,ae=Y!==void 0;function re(be=!1){if(_e===K){if(_e=void 0,I.replayTurn(),he){he=!1,Pt();return}Yt(),be&&g(m)}}K.then(re,()=>re(!1))}let $=f.subscribe(L=>{L<=h.current||(h.current=L,Je&&Pt())});return Em({signal:w.signal,now:()=>performance.now(),sleep:L=>rn(L,w.signal),connect:L=>a.connectResumeStream({signal:w.signal,onChunk:Ie,onConnected:()=>{k.value=!1,L()}}),onDropped:()=>{k.value=!0},onInitialBoundaryReady:()=>{Je=!0,Pt(!0)},backfill:()=>Pt()}),()=>{w.abort(),k.value=!1,Ze(),$(),I.detach()}},[t,r,n,o,o.value,c,a,u,p,_,d,f,v,g,P,s,y,b,x,S,k])}var yS=32;function Lm(e){let{transport:t,setStreaming:r}=e,n=B(void 0),o=B(void 0),s=B(!1),i=B(void 0),a=B(!1),c=B(new Map),u=B(new Set),p=F((k,h)=>{let m=`${k}:${h}`;i.current!==m&&(i.current=m,t.cancelTurn(k,h))},[t]),_=F(k=>{n.current=void 0,o.current=k,s.current=!1,i.current=void 0,a.current=!0,r(!0)},[r]),d=F((k,h)=>{c.current.set(k,{messageId:h})},[]),f=F(k=>{if(k!==void 0){u.current.add(k);let h=u.current.values().next().value;u.current.size>yS&&h!==void 0&&u.current.delete(h)}k!==void 0&&n.current?.runId!==k||(n.current=void 0,o.current=void 0,s.current=!1,a.current=!1,r(!1))},[r]),v=F((k,h)=>o.current!==k?h.runId&&n.current?.runId===h.runId?(n.current={conversationId:h.conversationId,runId:h.runId},s.current&&p(h.conversationId,h.runId),!0):!1:(o.current=void 0,h.runId?(n.current={conversationId:h.conversationId,runId:h.runId},r(!0),s.current&&p(h.conversationId,h.runId),!0):(f(),!0)),[p,r,f]),g=F((k,h)=>{let m=c.current.get(k);return m?(c.current.delete(k),!h.runId||u.current.has(h.runId)?!0:m.runId!==void 0?(m.runId!==h.runId||n.current?.runId===h.runId&&(n.current={conversationId:h.conversationId,runId:h.runId},s.current&&p(h.conversationId,h.runId)),!0):(a.current||o.current||(n.current={conversationId:h.conversationId,runId:h.runId},o.current=void 0,s.current=!1,i.current=void 0,a.current=!0,r(!0)),!0)):!1},[p,r]),P=F(k=>o.current!==k?!1:(f(),!0),[f]),b=F(k=>{let h=c.current.get(k);return h?(c.current.delete(k),h.runId===void 0):!1},[]),y=F((k,h,m,w)=>{let A=h.messageMetadata?.runId;if(h.messageMetadata?.senderRole!==void 0||typeof A!="string"||!A||u.current.has(A))return!1;if(n.current?.runId===A)return a.current;if(a.current)return n.current||!m?!1:(o.current=void 0,n.current={conversationId:k,runId:A},r(!0),s.current&&p(k,A),!0);let R=[...c.current.values()].filter(C=>C.runId===void 0).find(C=>C.messageId===w);return R?(R.runId=A,n.current={conversationId:k,runId:A},o.current=void 0,s.current=!1,i.current=void 0,a.current=!0,r(!0),!0):(o.current=void 0,n.current={conversationId:k,runId:A},r(!0),s.current&&p(k,A),a.current)},[p,r]),x=F(k=>typeof k=="string"&&n.current?.runId===k&&a.current,[]),S=F(()=>{let k=n.current;if(k)return s.current=!0,p(k.conversationId,k.runId),!0;let h=o.current;return h?(s.current=!0,h.then(m=>{m.runId&&p(m.conversationId,m.runId)}).catch(()=>{}),!0):!1},[p]);return ve(()=>({localSendRef:a,begin:_,beginRouted:d,acceptAck:v,acceptRoutedAck:g,reject:P,rejectRouted:b,captureStart:y,ownsLocalRun:x,settle:f,stop:S}),[v,g,_,d,y,x,P,b,f,S])}var bS=te.scope("send");function $m(e,t,r,n,o){e.publishConversation({...wi(t,r,n,o),hasUnread:!1},!0)}function Dm(e,t){return e.id===t.id||(e.serverMessageId??e.id)===(t.serverMessageId??t.id)}function qm(e){return e.findLast(t=>!t.ephemeral&&t.role!=="system"&&(t.role==="user"||t.status!=="streaming"||ir(t)))}function sa(e,t,r,n,o){let s=qm(t);s?.role!=="user"||!Dm(s,r)||$m(e,t,s,n,o)}function Nm(e){return e instanceof qe&&e.status===404&&e.errorCode==="CONVERSATION_NOT_FOUND"}function Om(e){return!(e instanceof qe)||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 Um(e){let{transport:t,messagesSig:r,conversationIdSig:n,options:o,bus:s,feedback:i,persistence:a,visitorId:c,adoptConversationId:u,applyControlState:p,setTicket:_,settleSuggestions:d,runCancellation:f,onConversationNotFound:v}=e,g=F(()=>{let y=n.value??Wt();return n.value||(n.value=y,a.saveConversationId(y)),y},[n,a]),P=F(async({continueExisting:y,turn:x,movedFromConversation:S=!1})=>{let k=g(),h=r.value.at(-1),m=x?[x]:Yp(r.value,y),w=m[0];w?.role==="user"&&Ot.markSent(w.id);let A=m.map(nc),I=a.loadUserPrefs(),R=La(o.tools).then(C=>t.sendTurn(Jl({messages:A,conversationId:k,visitorId:c,userPrefs:I,clientTools:ol(C)}),{keepalive:y}));f.begin(R);try{let C=await R;if(n.value!==k||!f.acceptAck(R,C))return!1;if(u(C.conversationId),_({conversationId:C.conversationId,reference:C.ticketReference}),C.runId&&w?.role==="user"&&sa(t,r.value,w,C.conversationId,o.strings.newConversation),!C.runId){let M=await t.loadConversation(C.conversationId).catch(()=>null);if(n.value!==C.conversationId)return!0;if(M){M.controlState&&p(M.controlState);let N=Fr(M.messages),{messages:j,changed:G}=Ho(r.value,N);G&&(r.value=j);let z=N.findLast(_e=>!_e.ephemeral&&_e.role!=="system"),le=qm(r.value);le&&z&&Dm(le,z)&&$m(t,r.value,le,C.conversationId,o.strings.newConversation);let ue=h?r.value.find(_e=>_e.id===h.id&&_e.role==="assistant"&&_e.status!=="streaming"):void 0;ue&&d(ue,ue.suggestions??[]),!y&&h?.role==="assistant"&&r.value.includes(h)&&h.serverMessageId===void 0&&!ir(h)&&(r.value=r.value.filter(_e=>_e!==h))}else h?.role==="assistant"&&r.value.includes(h)&&(h.status="error",h.errorText=o.strings.errorGeneric,y?h.retryAction={kind:"continue-assistant",messageId:h.serverMessageId??h.id}:h.retryAction=w?.role==="user"?{kind:"resend-user",messageId:w.id}:null,r.value=[...r.value])}return!0}catch(C){if(n.value!==k)return!1;if(!f.reject(R))return w?.role==="user"&&sa(t,r.value,w,k,o.strings.newConversation),!0;if(!y&&!S&&w?.role==="user"&&Nm(C))return v(w);if(!y&&w?.role==="user"&&C instanceof qe&&C.status===401){let G=h?.role==="assistant"&&h.serverMessageId===void 0?h:void 0;return r.value=r.value.filter(z=>z!==w&&z!==G),a.saveDraft(k,Ye(w)),!1}let M=Ir(C,o.strings),N=Om(C),j=x?.role==="assistant"?x:r.value.at(-1);if(y&&j?.role==="assistant"&&C instanceof qe&&C.status===409){let G=j.serverMessageId??j.id,z=await t.loadConversation(k,{ids:[G]}).catch(()=>null);if(n.value!==k)return!1;if(z){z.controlState&&p(z.controlState);let le=Fr(z.messages),ue=le.find(_e=>(_e.serverMessageId??_e.id)===G);if(ue&&t_(j,ue)){let{messages:_e,changed:ae}=Ho(r.value,le),he=_e.find(Je=>(Je.serverMessageId??Je.id)===G);if(ae&&he&&he!==j)return he.awaitingContinuation=!1,he.continuationStreaming=void 0,he.retryAction=null,r.value=_e,he.status!=="streaming"&&d(he,he.suggestions??[]),!0}}if(!r.value.includes(j)||j.status!=="streaming")return!1;j.continuationStreaming=!0}if(y&&j?.role==="assistant")j.status="error",j.errorText=M,j.retryAction=N?{kind:"continue-assistant",messageId:j.serverMessageId??j.id}:null,r.value=[...r.value];else if(h?.role==="assistant"&&r.value.includes(h)){h.status="error",h.errorText=M;let G=m[0];h.retryAction=N&&G?.role==="user"?{kind:"resend-user",messageId:G.id}:null,r.value=[...r.value]}else{let G=dr();G.status="error",G.errorText=M;let z=m[0];G.retryAction=N&&z?.role==="user"?{kind:"resend-user",messageId:z.id}:null,r.value=[...r.value,G]}return i.play("error"),s.emit("error",C),o.onError?.(C),!1}},[t,r,o,s,i,a,c,u,p,_,d,g,f,v]),b=F(async y=>{let x=g();y.status="pending",y.errorText=void 0,y.retryAction=void 0,r.value.includes(y)&&(r.value=[...r.value]),Ot.markSent(y.id);let S=[nc(y)],k=a.loadUserPrefs(),h=La(o.tools).then(m=>t.sendTurn(Jl({messages:S,conversationId:x,visitorId:c,userPrefs:k,clientTools:ol(m)})));f.beginRouted(h,y.id);try{let m=await h;return n.value!==x?(f.rejectRouted(h),!1):f.acceptRoutedAck(h,m)?(u(m.conversationId),_({conversationId:m.conversationId,reference:m.ticketReference}),sa(t,r.value,y,m.conversationId,o.strings.newConversation),y.status==="pending"&&(y.status="complete",r.value.includes(y)&&(r.value=[...r.value])),!0):!1}catch(m){let w=f.rejectRouted(h);if(n.value!==x)return!1;if(!w)return sa(t,r.value,y,x,o.strings.newConversation),y.status==="pending"&&(y.status="complete",r.value.includes(y)&&(r.value=[...r.value])),!0;if(y.status!=="pending")return sa(t,r.value,y,x,o.strings.newConversation),!0;if(Nm(m))return v(y);bS.debug("operator-routed send failed",{error:m});let A=m instanceof Error?m:new Error(String(m));return y.status="error",y.errorText=Ir(m,o.strings),y.retryAction=Om(m)?{kind:"resend-user",messageId:y.id}:null,r.value.includes(y)&&(r.value=[...r.value]),i.play("error"),s.emit("error",A),o.onError?.(A),!1}},[t,r,o,s,i,a,c,u,_,g,f,v]);return{sendAiTurn:P,sendRoutedTurn:b}}var PS=te.scope("unread");function Bm(e){let{transport:t,options:r,conversationIdSig:n,isConversationVisibleRef:o,activated:s,conversationReady:i}=e,a=$t(!1),c=$t(0),u=$t(0),p=B([]),_=B(void 0),d=B(!1),f=B(!1),v=F(()=>{let m=n.value,w=o.current()&&_.current===m?m:void 0,A=p.current.filter(I=>I.hasUnread&&I.conversationId!==w).length;c.value=A,a.value=A>0},[n,a,c,o]),g=F(m=>{let w=n.value,A=p.current.find(M=>M.conversationId===w),I=wr(p.current,m),R=I.find(M=>M.conversationId===w),C=m.type==="snapshot"&&w!==void 0&&R?.hasUnread===!0&&_.current===w&&A!==void 0&&A.lastMessageAt!==R.lastMessageAt;C&&(_.current=void 0),p.current=I,v(),C&&(u.value+=1)},[n,v,u]),P=F(()=>{if(v(),!o.current())return;let m=n.value;if(!m||_.current!==m)return;let w=p.current.find(A=>A.conversationId===m);w?.hasUnread&&t.markRead(m,w.lastMessageAt)},[n,o,v,t]),b=F(m=>{n.value===m&&(_.current=void 0,v())},[n,v]),y=F(m=>{n.value===m&&(_.current=m,P())},[n,P]),x=F(m=>_.current===m,[]),S=F((m=!1)=>{if(!r.history.enabled||!r.modules.list.some(A=>A.layout==="chat"))return;function w(A){if(d.current){A&&(f.current=!0);return}d.current=!0,t.listConversations({limit:50},A).then(I=>{A||g({type:"snapshot",result:I,requestedRevision:0}),P()}).catch(I=>PS.debug("refreshUnread failed (non-fatal)",{err:I})).finally(()=>{d.current=!1,f.current&&(f.current=!1,w(!0))})}w(m)},[g,P,r.history.enabled,r.modules,t]),k=F(m=>{let w=m.conversationId,A=o.current()&&n.value===w&&_.current===w,I=p.current.find(C=>C.conversationId===w),R=A&&(I?.lastMessageAt!==m.lastMessageAt||I.hasUnread);t.publishConversation({...m,hasUnread:!A},!0),R&&t.markRead(w,m.lastMessageAt)},[n,o,t]);H(()=>t.subscribeConversationChanges(g),[g,t]);let h=B(!1);return H(()=>{!s||!i||h.current||(h.current=!0,S())},[s,i,S]),H(()=>{if(!s)return;function m(){document.visibilityState==="visible"&&(P(),S(!0))}return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[s,P,S]),{hasUnreadSig:a,unreadCountSig:c,transcriptRecoverySig:u,markVisibleConversationRead:P,beginConversationTranscript:b,commitConversationTranscript:y,isConversationTranscriptCommitted:x,recordConversationReply:k,refreshUnread:S}}var la=te.scope("settings");function zm(e){let{options:t,persistence:r,transport:n,feedback:o,hostElement:s,bus:i}=e,a=r.loadUserPrefs(),[c,u]=U(()=>a.locale??t.locale),[p,_]=U(a.themeMode),d=fo(t.themeMode,p),[f,v]=U(()=>a.textSize??t.textSize),g=F(k=>{r.patchUserPrefs(k),n.saveUserPrefs(r.loadUserPrefs()).catch(h=>la.warn("saveUserPrefs failed",{err:h}))},[r,n]);H(()=>{a.soundMuted!==void 0&&o.setMuted(a.soundMuted)},[]),H(()=>{if(d!=="host"){s.dataset.theme=d;return}return hu(k=>{s.dataset.theme=k})},[s,d,t]),H(()=>{s.dataset.textSize=f},[s,f,t]),H(()=>{let k=!0;return o.mutedSig.subscribe(h=>{if(k){k=!1;return}g({soundMuted:h})})},[o,g]);let P=Ln(c,t.availableLocales,t.defaultLocale);H(()=>{n.setLocale(P)},[n,P]),H(()=>{s.dir=Sa(P)?"rtl":"ltr"},[s,P]),H(()=>{P!==c&&u(P)},[P,c]);let b=F(k=>{la.info("localeChange",{locale:k}),u(k),g({locale:k}),i.emit("localeChange",k)},[g,i]),y=F(k=>{la.info("themeChange",{mode:k}),_(k),s.dataset.theme=k,g({themeMode:k}),i.emit("themeChange",k)},[s,g,i]),x=F(k=>{la.info("textSizeChange",{size:k}),v(k),s.dataset.textSize=k,g({textSize:k}),i.emit("textSizeChange",k)},[s,g,i]),S=F(()=>{o.toggleMuted();let k=o.mutedSig.value;la.info("soundToggle",{muted:k}),i.emit("soundToggle",{muted:k})},[o,i]);return{activeLocale:c,activeThemeMode:d,activeTextSize:f,setActiveLocale:u,setActiveThemeMode:_,setActiveTextSize:v,patchAndSync:g,handleLocaleChange:b,handleThemeChange:y,handleTextSizeChange:x,handleSoundToggle:S}}var Te=te.scope("app"),ca=q.cssPrefix,xS={home:"home",chats:"chat",help:"help",news:"news"};function Fm({options:e,hostElement:t,bus:r,recentHostEvents:n,loginRevision:o=0,onPersonChanged:s,onStartAsGuest:i}){let a=e.aiAgentDeploymentId;if(!a)throw new Error("aiAgentDeploymentId is required");let[c]=U(()=>Br(e.widgetId,e.storage,e.aiAgentDeploymentId)),[u,p]=U(()=>c.getVisitorId()),_=c.loadUserPrefs(),d=$t(c.loadConversationId()),f=B(d.value!==void 0),v=$t(d.value??""),g=$t([]),P=$t(!1),[b,y]=U(!1),x=B(void 0);function S(){let T=e.modules.list,O=new Set(T.map(ne=>ne.id)),J=c.loadActiveModule();return J&&O.has(J)?J:T[0]?.id??""}function k(){return e.modules.list.find(T=>T.layout==="chat")?.id}function h(){let T=k();return T?e.modules.list.length===1?!0:w.sig.value.activeTab===T:!1}let m=B(void 0);if(!m.current){let T=e.modules.list.map(J=>J.id),O=c.loadActiveModule()??T[0]??"";m.current=b_(O,O?[...T,O]:T,J=>c.saveActiveModule(J))}let w=m.current,A=It(()=>w.sig.value.activeTab).value,I=It(()=>d.value).value,[R,C]=U(!1),[M,N]=U(!1),j=e.mode==="standalone"||e.mode==="inline",G=B(Wo(e,Qn(),c.loadPanelOpen(),c.loadPanelSize())),[z,le]=U(G.current.panelOpen),[ue,_e]=U(G.current.panelOpen),ae=B(void 0),he=B(void 0),Je=B(!1),bt=B(void 0),Ve=B(e.strings),At=B(void 0);H(()=>{z&&_e(!0)},[z]);let Le=B(!1),[Ze,ye]=U(!1),Oe=B(null),Ue=B(!1),{dismissed:Tt,dismissCallout:Rt}=xm({callout:e.launcher.callout,persistence:c}),Ie=e.launcher.callout?.persistent??!0,ze=F(()=>{Te.info("calloutDismiss"),r.emit("calloutDismiss",void 0),Rt()},[r,Rt]),[Re,Yt]=U(G.current.panelSize),Pt=B(!1),[$,L]=U("chat"),Y=B(()=>!1);Y.current=()=>z&&$==="chat"&&!document.hidden&&h();let[K,re]=U(!1),be=B(K);be.current=K;let ce=B(null),[Pe,lt]=U(!1),He=$t(new Map),pt=F((T,O)=>{let J=new Map(He.value);O?J.set(T,O):J.delete(T),He.value=J},[He]),[We,Lt]=U(null),[Vt,Xt]=U(),[_t,xt]=U([]),Jt=B(e);Jt.current=e;let[Pn,xn]=U(void 0),[Kr,Sn]=U(void 0),[Qr,ua]=U(()=>c.loadSidebarCollapsed()??!1),[Yr,wn]=U({status:"anonymous"}),[ys,pa]=U({}),[V,X]=U(),[Q]=U(()=>new Ai({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Hu({publicKey:e.publicKey,aiAgentDeploymentId:a,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints,recentHostEvents:n,onLoginState:wn,continueLink:e.continueLink})),[fe]=U(()=>new ei(e.sound,e.haptics)),$e=Lm({transport:Q,setStreaming:re}),{activeLocale:Et,activeThemeMode:_r,activeTextSize:fr,setActiveLocale:zt,setActiveThemeMode:bs,setActiveTextSize:Zm,patchAndSync:Bc,handleLocaleChange:eg,handleThemeChange:tg,handleTextSizeChange:rg,handleSoundToggle:ng}=zm({options:e,persistence:c,transport:Q,feedback:fe,hostElement:t,bus:r}),{controlModeSig:lr,assignedOperatorSig:og,operatorAvailableSig:ag,applyControlState:io,adoptControlStateChunk:ig,requestOperator:sg,cancelOperatorRequest:lg}=wm({transport:Q,conversationIdSig:d}),Mr=$t(new Map),cg=F(T=>{if(T.type!=="data-memory-compaction-state")return;let O=d.value;if(!O)return;let J=Kp(T.data);if(!J)return;let ne=Mr.value.get(O);if(ne&&(J.postFinishSequence<ne.postFinishSequence||J.postFinishSequence===ne.postFinishSequence&&(ne.status==="ready"||ne.status===J.status)))return;let me=new Map(Mr.value);me.set(O,J),Mr.value=me},[d,Mr]),{hasUnreadSig:dg,unreadCountSig:zc,transcriptRecoverySig:ug,markVisibleConversationRead:Hc,beginConversationTranscript:Ps,commitConversationTranscript:kn,isConversationTranscriptCommitted:Fc,recordConversationReply:pg,refreshUnread:_g}=Bm({transport:Q,options:e,conversationIdSig:d,isConversationVisibleRef:Y,activated:ue,conversationReady:R}),xs=Sm({state:Yr,deployment:ys,bus:r,persistence:c,conversationIdSig:d}),fg=z&&e.modules.byId[A]?.layout==="home",mg=Pm({transport:Q,options:e,persistence:c,enabled:R&&fg});H(()=>{Hc()},[A,z,$,I,Hc]),H(()=>{fe.update(e.sound,e.haptics)},[fe,e.sound,e.haptics]),H(()=>()=>fe.destroy(),[fe]),H(()=>{Pt.current||!e.size.initialSize||(Pt.current=!0,!c.loadPanelSize()&&Yt(pc(e.mode,e.size,Qn())))},[e.mode,e.size,c]),H(()=>{if(!R||Le.current)return;Le.current=!0;let T=Wo(e,Qn(),c.loadPanelOpen(),c.loadPanelSize());le(T.panelOpen),Yt(T.panelSize)},[R,e,c]);let Cn=B(null);H(()=>{R&&w.reconcile(e.modules.list.map(T=>T.id),S())},[R,e.modules.list,w]);let _a=F(T=>{!T||T.length===0||(g.value=T.map(O=>tc({...O,text:mt(Ve.current,O.text)})))},[g]),so=B(0),mr=B(0),Ss=F(T=>{if(T===d.value)return;let O=d.value;mr.current++,y(!1),O&&(c.saveDraft(T,c.loadDraft(O)),c.saveDraft(O,""),c.saveMessageQueue(T,c.loadMessageQueue(O)),c.saveMessageQueue(O,[])),d.value=T,c.saveConversationId(T),Q.primeIdentity(void 0,T),Te.info("conversation rebound",{previous:O,current:T}),O&&r.emit("conversationRebound",{previous:O,current:T})},[r,d,c,Q]),fa=F(T=>{let O=T.map(me=>me.createdAt).filter(me=>me!==void 0),J=(O.length?Math.min(...O):Date.now())-1;return[...(bt.current?.messages??[]).map(me=>{let Z=tc({...me,text:mt(Ve.current,me.text)});return Z.createdAt=J,Z}),...T]},[]),jc=F(async T=>{let O=mr.current;function J(){return O!==mr.current||d.value!==T}he.current===T&&(he.current=void 0),y(!0);try{let ne=await Q.loadConversation(T);if(J())return!1;let me=Fr(ne.messages),Z=fa(sc(me,g.value));if(g.value=Z,he.current=Z.some(Ae=>Ae.role==="user")?void 0:T,me.length>0||ne.controlState!==void 0){Xt({conversationId:T,reference:ne.ticketReference}),ne.controlState&&io(ne.controlState);let Ae=me.findLast(Be=>Be.role==="assistant"&&!Be.ephemeral);xt(Ae?.suggestions??[])}return!0}catch(ne){return J()||(Te.warn("loadThread failed; keeping conversation active",{err:ne,conversationId:T}),r.emit("error",ne),Jt.current.onError?.(ne)),!1}finally{J()||y(!1)}},[Q,g,d,fa,r]),gg=F(T=>{if(ae.current===T)return ae.current=void 0,jc(T)},[jc]),vg=F(()=>{if(x.current)return Promise.resolve(void 0);let T=d.value,O=g.value.find(ie=>ie.serverMessageId!==void 0),J=O?.serverMessageId,ne=O?new Date(O.createdAt).toISOString():void 0;if(!T||!J||!ne)return Promise.resolve(void 0);let me=mr.current,Z={};return x.current=Z,(async()=>{try{let ie=await Q.loadConversation(T,{beforeId:J,beforeCreatedAt:ne});if(x.current!==Z||mr.current!==me||d.value!==T)return;if(ie.messages.length===0)return!1;let Ae=ie.messages.map(rc),Be=g.value,vr=Jp(Be,Ae);if(vr!==Be){let et=Math.min(...Ae.map(Fe=>Fe.createdAt??1/0));if(Number.isFinite(et))for(let Fe of Be){if(!Fe.ephemeral)break;(Fe.createdAt??1/0)>=et&&(Fe.createdAt=et-1)}g.value=vr}return!0}catch(ie){if(x.current!==Z||mr.current!==me||d.value!==T)return;Te.warn("load previous messages failed",{err:ie,conversationId:T,beforeId:J}),r.emit("error",ie),e.onError?.(ie);return}finally{x.current===Z&&(x.current=void 0)}})()},[r,d,g,e,Q]),Tn=F(async({newConversation:T})=>{let O=++so.current;function J(){return O!==so.current}if(!T){let et=await Q.userSub(),Fe=c.loadLastUserSub();if(J())return;if(Fe&&Fe!==et){s?.();return}et&&c.saveLastUserSub(et)}let ne=d.value,me=T||!ne?Wt():ne;me!==ne&&(mr.current++,y(!1),er(()=>{d.value=me,v.value=me}),c.saveConversationId(me)),Q.primeIdentity(u,me);let Z;try{Z=await Q.handshake({visitorId:u,conversationId:me,userPrefs:c.loadUserPrefs(),locale:Et})}catch(et){if(J())return;r.emit("error",et),e.onError?.(et);let Fe=et instanceof qe&&et.errorCode?wS[et.errorCode]:void 0;if(Fe){Te.warn(`the widget is not shown: ${Fe}`),(j||e.mode==="page")&&N(!0);return}T||C(!0);return}if(J())return;e.continueLink&&Z.visitorId!==u&&p(Z.visitorId),Z.conversationId!==me&&Ss(Z.conversationId),At.current=Z;let ie=Jr(Z,Et);Lt(ie.agent),pa(ti(Z.config?.login));let Ae=Z.config?.maxMessageCharacters;X(typeof Ae=="number"&&Ae>0?Ae:void 0),ie.site&&Tl(ie.site)?xn(ie.site):ie.site&&Te.warn("invalid site config, using fallback",{site:ie.site}),ie.blocks&&Il(ie.blocks)?Sn(ie.blocks):ie.blocks&&Te.warn("invalid blocks config, using fallback",{blocks:ie.blocks});let Be=ml(Z.userPrefs);if(Object.keys(Be).length>0&&!T&&(c.saveUserPrefs(Be),Be.locale&&zt(Be.locale),Be.soundMuted!==void 0&&fe.setMuted(Be.soundMuted),Be.themeMode&&bs(Be.themeMode),Be.textSize&&Zm(Be.textSize)),bt.current=ie.welcome,T||r.emit("handshake",Z),ie.welcome?.suggestions){let et=Ve.current;xt(ie.welcome.suggestions.map(Fe=>({...Fe,label:mt(et,Fe.label),...Fe.text===void 0?{}:{text:mt(et,Fe.text)}})))}let vr=!T&&(Z.conversationId===ne||e.continueLink!==void 0);f.current=vr,vr?Je.current||(ae.current=Z.conversationId):(he.current=Z.conversationId,_a(ie.welcome?.messages),kn(Z.conversationId)),T||C(!0)},[Q,u,c,e,r,d,v,fe,_a,Et,Ss,kn,s]),lo=JSON.stringify(e.userContext??null),hg=JSON.stringify(e.pageContext??null);H(()=>{Q.setContext(e.userContext,SS(e.pageContext))},[Q,lo,hg]);let Vc=B(!1);H(()=>{if(Q.setUserToken(e.userToken),!Vc.current){Vc.current=!0;return}Tn({newConversation:!1}).then(()=>{ue&&_g(!0)})},[Q,e.userToken,o]);let Wc=F((T,O=[])=>xt(T.suggestions??O),[]);H(()=>(Q.primeIdentity(u,d.value),Tn({newConversation:!1}),()=>{so.current++,mr.current++}),[]),H(()=>{!ue||!R||Je.current||(Je.current=!0,ae.current===d.value&&y(!0))},[ue,R]);let Gc=B(lo);H(()=>{!R||Gc.current===lo||(Gc.current=lo,Tn({newConversation:!1}))},[lo,R,Tn]);let Kc=B(async()=>!1),{sendAiTurn:gr,sendRoutedTurn:In}=Um({onConversationNotFound:T=>Kc.current(T),transport:Q,messagesSig:g,conversationIdSig:d,options:e,bus:r,feedback:fe,persistence:c,visitorId:u,adoptConversationId:Ss,applyControlState:io,setTicket:Xt,settleSuggestions:Wc,runCancellation:$e}),{toolInteraction:yg,pageToolsRunning:ws,stopPageTools:Qc}=bm({streaming:K,controlModeSig:lr,messagesSig:g,sendAiTurn:gr,bus:r,humanInLoop:e.features.humanInLoop,tools:e.tools}),bg=F((T,O)=>{let J=g.value.find(ne=>ne.serverMessageId===T);J&&(J.feedback=O),Te.info("messageFeedback",{messageId:T,value:O}),r.emit("messageFeedback",{messageId:T,value:O}),Q.submitFeedback({messageId:T,value:O})},[r,g,Q]),Pg=F(()=>f.current||g.value.some(T=>!T.ephemeral&&T.role==="user"),[g]);Mm({activated:ue,conversationReady:R,paused:Yr.status==="pending"||Yr.status==="expired",conversationIdSig:d,messagesSig:g,optionsRef:Jt,transport:Q,visitorId:u,adoptControlStateChunk:ig,adoptMemoryCompactionStateChunk:cg,settleSuggestions:Wc,recordConversationReply:pg,transcriptRecoverySig:ug,beginConversationTranscript:Ps,commitConversationTranscript:kn,runCancellation:$e,feedback:fe,bus:r,loadInitialThread:gg,shouldReconcileOnConnect:Pg,reconnectingSig:P});let An=F(async(T,O,J)=>{if(ce.current||xs.gate)return!1;let ne=d.value,me=ne?Mr.value.get(ne):void 0,Z=lr.value!=="ai-agent";if(!Z&&me?.status==="compacting"||(Te.info("send",{textLen:T.length,attachments:O.length,streaming:be.current,routedToOperator:Z}),be.current&&!Z))return!1;let ie=new AbortController,Ae={conversationId:ne,controller:ie};ce.current=Ae,lt(!0);try{fe.unlock(),He.value=new Map;let Be=await CS(Q,O,ie.signal,pt,Ms=>{ie.signal.aborted||(Te.warn("upload failed",{err:Ms}),r.emit("error",Ms),e.onError?.(Ms))});if(ie.signal.aborted||d.value!==ne)return!1;let vr=ne?Mr.value.get(ne):void 0,et=lr.value!=="ai-agent";if(!et&&vr?.status==="compacting"||be.current&&!et||!J&&Be.length<O.length||!T&&Be.length===0)return!1;r.emit("send",{text:T,attachmentCount:O.length}),_t.length>0&&xt([]),fe.play("messageSent");let Fe=ec(T,Be,J);return Kn(r,e,"user",T),et?(g.value=[...g.value,Fe],J?await In(Fe):(In(Fe),!0)):(g.value=[...g.value,Fe,dr()],J?await gr({continueExisting:!1}):(gr({continueExisting:!1}),!0))}finally{ce.current===Ae&&(ce.current=null,lt(!1))}},[Q,r,e,_t.length,g,d,Mr,gr,In,lr,He,pt,xs.gate]),ks=B(An);ks.current=An;let Yc=d.value,Xc=(Yc?Mr.value.get(Yc):void 0)?.status==="compacting",ma=lr.value==="ai-agent",xg=It(()=>{let T=g.value.at(-1);return T?.role==="assistant"&&T.partsSig.value.some(O=>O.kind==="tool"&&(O.stateSig.value==="approval-requested"||O.stateSig.value==="approval-responded"))}),Jc=It(()=>g.value.some(T=>T.retryAction?.kind==="resend-user"||T.retryAction?.kind==="continue-assistant"));St(()=>{let T=d.value;return()=>{let O=ce.current;!O||O.conversationId!==T||(ce.current=null,lt(!1),O.controller.abort())}},[d.value]);let Sg=F(()=>{if(ce.current){Te.info("stop uploads"),ce.current.controller.abort();return}if(ws){Te.info("stop page tools"),r.emit("stop",void 0),Qc();return}if(!$e.stop())return;Te.info("stop"),r.emit("stop",void 0);let T=g.value.at(-1);T&&T.role!=="user"&&T.status==="streaming"&&(T.canceled=!0,g.value=[...g.value])},[$e,r,g,ws,Qc]),wg=F(T=>{Te.info("card action",{text:T}),ks.current(T,[])},[]),kg=F(T=>{if(K)return;let O=g.value,J=Ii(O,T);if(J)switch(Te.info("retry",{kind:J.kind,messageId:J.messageId}),J.kind){case"continue-assistant":{if(lr.value!=="ai-agent"||T.role!=="assistant"||(T.serverMessageId??T.id)!==J.messageId)return;T.status="streaming",T.errorText=void 0,T.retryAction=void 0,T.awaitingContinuation=!0,g.value=[...O],gr({continueExisting:!0,turn:T});return}case"resend-user":{let ne=O.find(ie=>ie.role==="user"&&ie.id===J.messageId);if(!ne)return;let me=ie=>{ie&&Cn.current?.acceptQueuedMessage(J.messageId)};if(ne.status="complete",ne.errorText=void 0,ne.retryAction=void 0,lr.value!=="ai-agent"){g.value=T.role==="assistant"?O.filter(ie=>ie!==T):[...O],In(ne).then(me);return}let Z=dr();g.value=T.role==="assistant"?O.map(ie=>ie===T?Z:ie):[...O,Z],gr({continueExisting:!1,turn:ne}).then(me);return}case"repeat-user":{let ne=O.find(Ae=>Ae.role==="user"&&Ae.id===J.messageId);if(!ne)return;let me=ec(Ye(ne),ne.attachments?.map(Ae=>({...Ae}))??[]),Z=new Set(me.attachments?.flatMap(Ae=>Ae.url?[Ae.url]:[])??[]),ie=ne.partsSig.value.flatMap(Ae=>Ae.kind==="file"&&!Z.has(Ae.url)?[{...Ae}]:[]);if(ie.length>0&&(me.partsSig.value=[...me.partsSig.value,...ie]),lr.value!=="ai-agent"){g.value=[...O,me],In(me);return}g.value=[...O,me,dr()],gr({continueExisting:!1,turn:me});return}default:return J}},[K,g,lr,gr,In]),ga=F(()=>{if(h_(e.mode,Re)==="exit-fullscreen"){Te.info("close \u2192 exit-fullscreen",{mode:e.mode}),Yt("normal"),r.emit("fullscreen",!1);return}Te.info("close \u2192 panel closed",{mode:e.mode}),Ue.current=t.contains(t.ownerDocument.activeElement),le(!1),c.savePanelOpen(!1),r.emit("close",void 0),e.onClose?.()},[r,e,c,Re,t]);Tm({hostElement:t,mode:e.mode,panelSize:Re,isOpen:z,surfaceReady:R,onClose:ga}),H(()=>{z||!Ue.current||(Ue.current=!1,Oe.current?.focus())},[z]);let co=F(()=>{Te.info("open",{mode:e.mode}),fe.unlock(),ye(!0),le(!0),c.savePanelOpen(!0),!Tt&&!Ie&&ze(),setTimeout(()=>ye(!1),kS),r.emit("open",void 0),e.onOpen?.()},[r,e,fe,c,Tt,Ie,ze]),va=F(()=>{let T=g.value.some(O=>O.role==="user");if(he.current===d.value&&!T&&d.value){Te.info("clear \u2192 reusing empty conversation",{conversationId:d.value}),g.value.length===0&&_a(bt.current?.messages);return}return Te.info("clear \u2192 new conversation",{wasStreaming:K}),r.emit("clear",void 0),$e.settle(),f.current=!1,ae.current=void 0,he.current=void 0,er(()=>{g.value=[],d.value=void 0,io({controlMode:"ai-agent",controlRevision:0})}),c.clearConversation(),xt([]),Tn({newConversation:!0})},[K,g,d,c,Tn,r,_a,$e,io]);Kc.current=async T=>(Te.info("conversation not found \u2192 new conversation",{messageId:T.id}),await va(),T.status="complete",T.errorText=void 0,T.retryAction=void 0,g.value=[...g.value,T,dr()],gr({continueExisting:!1,turn:T,movedFromConversation:!0}));let ha=F(()=>{let T=va();L("chat");let O=e.modules.list.find(J=>J.layout==="chat")?.id;return O&&w.switchTab(O),T},[va,w,e]),Cg=F(async T=>{await ha(),await ks.current(T,[])||Cn.current?.fill(T)},[ha]),Cs=F(()=>{let T=Re==="expanded"?"normal":"expanded";Te.info("expand",{from:Re,expanded:T==="expanded"}),Yt(T),c.savePanelSize(T),r.emit("expand",T==="expanded")},[r,Re,c]),Ts=F(()=>{let T=Re==="fullscreen"?"normal":"fullscreen";Te.info("fullscreen",{from:Re,fullscreen:T==="fullscreen"}),Yt(T),c.savePanelSize(T),r.emit("fullscreen",T==="fullscreen")},[r,Re,c]),Tg=F(()=>{L(T=>{let O=T==="history"?"chat":"history";return Te.info("toggleHistory",{view:O}),r.emit("toggleHistory",{view:O}),O})},[r]),Ig=F(()=>{ua(T=>{let O=!T;return Te.info("sidebarToggle",{collapsed:O}),c.saveSidebarCollapsed(O),r.emit("sidebarToggle",{collapsed:O}),O})},[c,r]),Ag=F(T=>{Te.info("resize",T),Bc({widgetSize:T}),r.emit("resize",T)},[Bc,r]),Rg=F(async T=>{let O=T.conversationId;if(O===d.value&&Fc(O)){Te.info("selectConversation",{conversationId:O,cached:!0}),r.emit("selectConversation",{conversationId:O}),Q.publishConversation(T),L("chat");let Z=k();Z&&w.switchTab(Z),kn(O);return}let ne=++so.current;mr.current++,y(!1);function me(){return ne!==so.current}Te.info("selectConversation",{conversationId:O,wasStreaming:K}),r.emit("selectConversation",{conversationId:O}),Q.publishConversation(T);try{let Z=await Q.loadConversation(O);if(me())return;$e.settle(),f.current=!0,ae.current=void 0;let ie=Fr(Z.messages),Ae=Z.conversationId!==d.value,Be=Ae?ie:sc(ie,g.value);he.current=Be.some(Fe=>Fe.role==="user")?void 0:Z.conversationId,er(()=>{g.value=fa(Be),Ae&&(v.value=Z.conversationId),d.value=Z.conversationId}),c.saveConversationId(Z.conversationId),Q.primeIdentity(u,Z.conversationId),Xt({conversationId:Z.conversationId,reference:Z.ticketReference}),Z.controlState&&io(Z.controlState);let vr=Be.findLast(Fe=>Fe.role==="assistant"&&!Fe.ephemeral);xt(vr?.suggestions??[]),Ae?Ps(Z.conversationId):kn(Z.conversationId),L("chat");let et=k();et&&w.switchTab(et)}catch(Z){if(me())return;r.emit("error",Z),e.onError?.(Z)}},[Q,g,d,v,r,e,c,fa,K,u,$e,Ps,kn,Fc,w]),ya=B(void 0),ba=F(T=>{let O=e.modules.list.find(ne=>ne.layout===xS[T.to]);if(!O){Te.warn("open: the widget has no such tab",{to:T.to});return}let J=T.id&&(O.layout==="help"||O.layout==="news")?{kind:"content",id:T.id,title:""}:void 0;w.open(O.id,J)},[e.modules,w]),Zc=F(T=>{if(z||co(),T!=null){if(!Ld(T)){Te.warn("open: unknown target",{detail:T});return}R?ba(T):ya.current=T}},[z,co,R,ba]);H(()=>{!R||!ya.current||(ba(ya.current),ya.current=void 0)},[R,ba]);let ed=R&&!b&&(!ma||!Jc.value),[Xr,Is]=U(),td=F(T=>{let O=Nd(T);if(!O){Te.warn("ask: expected { text, send? } with non-empty text",{detail:T});return}z||co(),Is(O)},[z,co]),As=z&&R&&!b,rd=As&&ed&&!Pe&&!(ma&&(K||Xc));H(()=>{if(Xr===void 0||!(Xr.send?rd:As))return;let T=k();if(!T){Te.warn("ask: the widget has no chat"),Is(void 0);return}if($!=="chat"||!h()){L("chat"),w.switchTab(T);return}if(Is(void 0),!Xr.send){Cn.current?.fill(Xr.text);return}An(Xr.text,[]).then(O=>{O||Cn.current?.fill(Xr.text)})},[Xr,As,rd,$,A,e.modules,w,An]),H(()=>{if(e.widgetId!=="default")return;let T=`data-${q.cssPrefix}-`,O=["ask","open","close"].map(ne=>T+ne);function J(ne){let me=ne.composedPath().find(Ae=>Ae instanceof Element&&O.some(Be=>Ae.hasAttribute(Be)));if(!(me instanceof Element))return;ne.preventDefault();let Z=me.getAttribute(`${T}ask`),ie=me.getAttribute(`${T}open`);Z!==null?Nt(t,"ask",yr(Z||(me.textContent??""),{send:me.hasAttribute(`${T}send`)})):ie!==null?Nt(t,"open",Ea(ie)):Nt(t,"close")}return document.addEventListener("click",J),()=>document.removeEventListener("click",J)},[e.widgetId,t]),H(()=>{if(e.widgetId!=="default")return;let T=Fu(location.href);T&&(history.replaceState(history.state,"",T.url),T.ask?Nt(t,"ask",yr(T.ask)):Nt(t,"open",T.target))},[e.widgetId,t]);let nd=B(Nr),od=e.mode==="page"||e.mode==="inline"||e.mode==="standalone";H(()=>or(()=>{let T=d.value,O={open:od||z,ready:R,unread:zc.value,...T?{conversationId:T}:{}},J=nd.current;O.open===J.open&&O.ready===J.ready&&O.unread===J.unread&&O.conversationId===J.conversationId||(nd.current=O,r.emit("state",O),O.unread!==J.unread&&r.emit("unread",O.unread))}),[r,od,z,R,zc,d]);let Rn=B({handleOpenCommand:Zc,handleClose:ga,handleExpand:Cs,handleFullscreen:Ts,handleAskCommand:td});Rn.current={handleOpenCommand:Zc,handleClose:ga,handleExpand:Cs,handleFullscreen:Ts,handleAskCommand:td},St(()=>$d(t,{open:T=>Rn.current.handleOpenCommand(T),close:()=>Rn.current.handleClose(),expand:()=>Rn.current.handleExpand(),fullscreen:()=>Rn.current.handleFullscreen(),ask:T=>Rn.current.handleAskCommand(T)}),[t]);let ft=ve(()=>Gs(e,Et,_r,fr),[e,Et,_r,fr]);Ve.current=ft.strings,H(()=>{let T=At.current;if(!T?.translations?.length)return;let O=Jr(T,Et);Lt(O.agent),O.site&&Tl(O.site)&&xn(O.site),O.blocks&&Il(O.blocks)&&Sn(O.blocks)},[Et]);function Rs(T){Rg(T)}let ad={options:ft,transport:Q,feedback:fe,bus:r,persistence:c,conversationId:d.value??"",composerKey:v.value,composerApiRef:Cn,view:$,isStreaming:K,pageToolRunning:ws,isMemoryCompacting:Xc,canReleaseQueuedMessages:ed,queueManualMessages:ma&&Jc.value,replyAwaitsCard:ma&&xg.value,sendPreparing:Pe,attachmentUploadsSig:He,composerActive:ft.mode==="page"||ft.mode==="inline"||ft.mode==="standalone"||z,controlMode:lr.value,assignedOperator:og.value,operatorAvailable:ag.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:sg,onCancelOperatorRequest:lg,loadingMessages:b,onLoadPreviousMessages:vg,messagesSig:g,reconnectingSig:P,agent:We,ticketReference:Vt?.conversationId===d.value?Vt?.reference:void 0,login:xs,onStartAsGuest:i,maxMessageCharacters:V,suggestions:_t,initialWidgetSize:_.widgetSize??null,onClear:va,onExpand:Cs,onFullscreen:Ts,onSoundToggle:ng,onToggleHistory:Tg,onSelectHistoryConversation:Rs,onNewConversation:ha,onLocaleChange:eg,onThemeChange:tg,onTextSizeChange:rg,onWidgetSizeChange:Ag,onSend:An,onStop:Sg,onSuggestion:T=>{if(ce.current)return;let O=T.text??T.label;Te.info("suggestion",{text:O,autoSend:e.autoSendSuggestions}),r.emit("suggestion",{text:O}),e.autoSendSuggestions?An(O,[]):Cn.current?.fill(O)},tool:yg,onRetry:kg,onMessageFeedback:bg,onCardAction:wg};if(M)return l("div",{class:`${ca}-anchor`,children:l(Lc,{strings:ft.strings,text:ft.strings.chatUnavailable})});if(!R)return null;let uo=ft.modules.list;function Es(T){let O=Gn("close",ft.mode,T)?ga:void 0;return uo.length===0?l(Lc,{strings:ft.strings,text:ft.strings.modulesEmpty,onClose:O}):uo.length===1&&uo[0]?.layout==="chat"?l(_m,{...ad,panelSize:T,onClose:O}):l(fm,{panelProps:{...ad,panelSize:T,onClose:O},enabledModules:uo,nav:w,bus:r,hasUnread:dg.value,latestNews:mg,onSelectConversation:Rs,onStartNewConversation:Cg,onSetPanelSize:Yt})}if(e.mode==="page"){let T=e.history.enabled&&uo.some(O=>O.layout==="chat");return l("div",{class:`${ca}-anchor`,children:l(vm,{site:Pn,blocks:Kr,transport:Q,strings:ft.strings,locale:ft.locale,persistence:c,showConversations:T,onSelectConversation:Rs,onNewConversation:ha,sidebarCollapsed:Qr,onToggleSidebarCollapsed:Ig,children:Es("fullscreen")})})}if(j){let T=e.mode==="standalone"?"fullscreen":Re;return l("div",{class:`${ca}-anchor`,children:Es(T)})}let id=e.mode==="drawer",sd=!(e.mode==="modal")&&!e.launcher.hidden&&(!z||Ze),ld=sd&&!Ze&&!Tt&&!id?ft.launcher.callout:null;return l("div",{class:`${ca}-anchor`,"data-launcher-size":ft.launcher.size,children:[z||ue?l("div",{class:`${ca}-surface`,hidden:!z,children:Es(Re)}):null,sd?l(Z_,{buttonRef:Oe,onToggle:co,launcher:ft.launcher,strings:ft.strings,leaving:Ze,edgeTab:id}):null,ld?l(ef,{callout:ld,launcherPosition:ft.position,strings:ft.strings,closeLabel:ft.strings.close,onDismiss:ze}):null]})}function SS(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var wS={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"},kS=120,Hm=new WeakMap;async function CS(e,t,r,n,o){return(await Promise.all(t.map(async i=>{try{n(i.id,{status:"uploading"});let a=Hm.get(i)??await e.uploadFile(i.file,r,c=>n(i.id,{status:"uploading",fraction:c}));return Hm.set(i,a),n(i.id,{status:"done"}),{id:a.id,name:a.originalName,mediaType:a.mimeType,size:a.fileSize,url:a.url}}catch(a){n(i.id,r.aborted?void 0:{status:"error",refusal:a instanceof qe&&a.status===400?a.errorCode:void 0}),o(a);return}}))).filter(i=>i!==void 0)}var TS=te.scope("error-boundary"),fs=class extends Zt{constructor(){super(...arguments);ee(this,"state",{crashed:!("toSorted"in Array.prototype)})}componentDidCatch(r,n){TS.error("widget render crashed",{error:r,componentStack:n?.componentStack}),this.setState({crashed:!0}),this.props.onError(r,n?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};function ms(e){let{bus:t,host:r,appRoot:n,persistence:o,reportError:s}=e,i=e.initialRaw,a,c,u=Lr(i),p=o.loadUserPrefs().locale??u.locale,_=!0,d=0,f=0,v=qd(t);function g(){let m=a&&Jr({config:a,translations:c},p).config;u=Lr(m?Ks(i,m):i)}function P(){yl(r,Dn(u.mode)),bu(r,{...u,themeMode:fo(u.themeMode,o.loadUserPrefs().themeMode)}),_&&(Va(r,jm(u)),_=!1)}function b(){P(),cr(qr(fs,{onError:s},qr(Fm,{key:d,bus:t,hostElement:r,options:u,recentHostEvents:v,loginRevision:f,onPersonChanged:S,onStartAsGuest:k})),n)}t.on("handshake",m=>{m.config&&(m.config.storageVersion&&o.rememberStorageVersion(m.config.storageVersion),a=m.config,c=m.translations,g(),b())}),t.on("localeChange",m=>{p=m,c?.length&&(g(),b())});let y=du(t,{getOptions:()=>u,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});function x(){let m=o.takeLoginReturn();return m?(o.saveConversationId(m.conversationId),o.saveDraft(m.conversationId,m.draft),o.savePanelOpen(!0),!0):!1}i.userToken&&x();function S(){o.reset(),v.length=0,d+=1,_=!0,g(),b()}function k(){i={...i,userContext:void 0,userToken:void 0},S()}function h(m){"userToken"in m&&m.userToken&&!i.userToken&&x()&&(d+=1),i={...i,...m},g(),b()}return{getOptions:()=>u,getUserOptions:()=>i,render:b,setUserOptions:m=>{i=m,g(),b()},patchUserOptions:h,login:m=>{f+=1,h({userToken:m})},reset:()=>k(),destroy:()=>y()}}function jm(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=Br(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:r,panelSize:n}=Wo(e,Qn(),t.loadPanelOpen(),t.loadPanelSize());return Ei(e.mode,n,r)}var Rr=new Map;function gs(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");e.debug!==void 0&&Mn(e.debug);let t=te.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let r=Lr(e),n=r.widgetId,o=Rr.get(n);o&&(t.debug("destroy existing instance at slot",{widgetId:n}),o.destroy());let s=ja({position:Dn(r.mode),target:e.target??null});s.hostElement.dataset.widgetId=n;let i=new Nn,a=Br(n,r.storage,r.aiAgentDeploymentId);function c(b){i.emit("error",b),u.getOptions().onError?.(b)}let u=ms({bus:i,host:s.hostElement,appRoot:s.appRoot,persistence:a,initialRaw:e,reportError:c}),p=Nr,_=()=>{},d=new Promise(b=>{_=b});i.on("state",b=>{p=b,b.ready&&_()}),u.render();let f=s.hostElement,v=null;function g(b){b.debug!==void 0&&Mn(b.debug),u.patchUserOptions(b)}let P={widgetId:n,open:b=>Nt(f,"open",b),close:()=>Nt(f,"close"),expand:()=>Nt(f,"expand"),ask:(b,y)=>Nt(f,"ask",yr(b,y)),on:(b,y)=>i.on(b,y),update:b=>{t.debug("update",{patch:b}),g(b)},setUserContext:b=>{t.debug("setUserContext",{keys:Object.keys(b)}),g({userContext:{...u.getUserOptions().userContext,...b}})},clearUserContext:()=>{t.debug("clearUserContext"),g({userContext:void 0})},setPageContext:b=>{t.debug("setPageContext",{keys:Object.keys(b)}),g({pageContext:{...u.getUserOptions().pageContext,...b}})},clearPageContext:()=>{t.debug("clearPageContext"),g({pageContext:void 0})},get state(){return p},ready:d,reset:()=>{t.info("reset",{widgetId:n}),u.reset()},login:b=>{t.info("login",{widgetId:n}),u.login(b)},track:(b,y)=>{let x=On(b,y);x&&i.emit("hostEvent",x)},registerTool:nn,setDebug:b=>{Mn(b),t.info("debug level set",{level:po()})},debugLevel:()=>po(),onLog:b=>_o(b),destroy:()=>{t.info("destroy",{widgetId:n}),i.emit("state",Nr),v?.(),u.destroy(),i.clear(),cr(null,s.appRoot),s.destroy(),Rr.get(n)===P&&Rr.delete(n)}};return v=Ed(P,i),Rr.set(n,P),P}function vs(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");let t=e.widgetId??"default",r=Rr.get(t);return r?(r.update(e),r):gs(e)}function Oc(e){if(e!==void 0){Rr.get(e)?.destroy();return}let t=[...Rr.values()];for(let r of t)r.destroy()}function Er(e="default"){return Rr.get(e)??null}function Vm(){return[...Rr.values()]}var Wm=$n;var $c=class extends HTMLElement{constructor(){super(...arguments);ee(this,"bus",new Nn);ee(this,"widgetState",Nr);ee(this,"userToken");ee(this,"pageTools",[]);ee(this,"markReady",()=>{});ee(this,"ready",new Promise(r=>{this.markReady=r}));ee(this,"mountResult",null);ee(this,"runtime",null)}static get observedAttributes(){return Qs}connectedCallback(){if(Object.hasOwn(this,"tools")){let r=Reflect.get(this,"tools");Reflect.deleteProperty(this,"tools"),this.pageTools=Array.isArray(r)?r:[]}this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,cr(null,this.mountResult.appRoot),this.bus.clear(),this.widgetState=Nr)}attributeChangedCallback(){this.isConnected&&this.boot()}open(r){Nt(this,"open",r)}close(){Nt(this,"close")}expand(){Nt(this,"expand")}ask(r,n){Nt(this,"ask",yr(r,n))}get state(){return this.widgetState}reset(){this.userToken=void 0,this.runtime?.reset()}login(r){this.userToken=r,this.runtime?.login(r)}track(r,n){let o=On(r,n);o&&this.bus.emit("hostEvent",o)}get tools(){return this.pageTools}set tools(r){this.pageTools=r,this.runtime?.patchUserOptions({tools:r})}registerTool(r,n){nn(r,n)}on(r,n){return this.bus.on(r,n)}boot(){let r={...Aa(s=>this.getAttribute(s)),...this.userToken?{userToken:this.userToken}:{},tools:this.pageTools};if(!r.aiAgentDeploymentId)throw new Error("ai-agent-deployment-id is required");if(this.runtime){this.runtime.setUserOptions(r);return}let n=Lr(r);this.mountResult??(this.mountResult=ja({existingHost:this,position:Dn(n.mode)}));let o=Br(n.widgetId,n.storage,n.aiAgentDeploymentId);this.bus.on("state",s=>{this.widgetState=s,s.ready&&this.markReady()}),this.runtime=ms({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:r,reportError:s=>this.bus.emit("error",s)}),this.runtime.render()}},Gm=!1;function Dc(){if(Gm||typeof customElements>"u")return;let e=q.tagName;customElements.get(e)||customElements.define(e,$c),Gm=!0}typeof customElements<"u"&&Dc();var Qm=te.scope("iife");function IS(e){return typeof e=="string"||typeof e=="function"}function Ym(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Km(e){return Ym(e)}function AS(e){return Ym(e)}function RS(e){return e===null||typeof e=="function"}var Xm=[];function bn(e){let t=Er();if(t)return e(t);Xm.push(e)}function da(e){let t=Er();if(t)for(let r of Xm.splice(0))r(t);return e}function qc(e){if(document.readyState!=="loading")return e();document.addEventListener("DOMContentLoaded",e,{once:!0})}function hs(){return new Promise(e=>{bn(t=>{t.ready.then(()=>e(t))})})}var Uc={ask:(e,t)=>typeof e=="string"?bn(r=>r.ask(e,yr(e,t))):void 0,close:()=>bn(e=>e.close()),ready:e=>hs().then(t=>typeof e=="function"?e(t):void 0),reset:()=>Er()?.reset(),login:e=>{if(!IS(e))return;let t=Er();return t?t.login(e):hs().then(r=>r.login(e))},destroy:()=>Oc(),expand:()=>bn(e=>e.expand()),track:(e,t)=>{let r=On(e,t);if(!r)return;let n=Er();return n?n.track(r.name,r.data):hs().then(o=>o.track(r.name,r.data))},hook:(e,t,r)=>typeof e=="string"&&typeof t=="string"&&Js(r)?mo(e,t,r):void 0,init:e=>Km(e)?qc(()=>da(vs(e))):void 0,mount:e=>Km(e)?qc(()=>da(gs(e))):void 0,on:(e,t)=>bn(r=>r.on(e,t)),onLog:e=>_o(RS(e)?e:null),registerTool:nn,open:e=>bn(t=>t.open(e)),setDebug:e=>typeof e=="boolean"||typeof e=="number"||typeof e=="string"?Mn(e):void 0,update:e=>AS(e)?bn(t=>t.update(e)):void 0};function ES(e){return Object.hasOwn(Uc,e)}function Jm(e,...t){let r=ES(e)?Uc[e]:void 0;if(!r){Qm.warn("unknown command",{command:e});return}return r(...t)}function MS(){let e=((t,...r)=>Jm(t,...r));e.init=t=>da(vs(t)),e.mount=t=>da(gs(t)),e.destroy=Oc,e.getInstance=Er,e.getAllInstances=Vm,e.version=Wm,e.ready=hs,e.hook=mo,e.debugLevel=()=>po(),e.onLog=_o,e.registerTool=nn;for(let t of["ask","close","expand","login","on","open","reset","setDebug","track","update"])Reflect.set(e,t,Uc[t]);return e}function LS(e){let t=e?.q;if(t)for(let r of t){let n=[...r],[o,...s]=n;if(typeof o=="string")try{Jm(o,...s)}catch(i){Qm.warn("queued command failed",{command:o,error:i})}}}function NS(){let e=[],t=e.push.bind(e);return e.push=(...r)=>(Zs(r),t(...r)),e}function OS(){let e=document.scripts;for(let t=e.length-1;t>=0;t--){let r=e[t];if(r?.src.includes("elements"))return r}return null}function $S(e){return typeof e=="function"}function DS(){if(typeof window>"u"||typeof document>"u")return;let e=Reflect.get(globalThis,q.global),t=$S(e)?e:void 0,r=MS();Reflect.set(globalThis,q.global,r),Dc();let n=`${q.global}Hooks`,o=Reflect.get(globalThis,n);if(Zs(o),Reflect.set(globalThis,n,NS()),LS(t),Er())return;let s=document.currentScript,i=(s instanceof HTMLScriptElement?s:null)??OS(),a=Ys(i?.dataset),c=a.aiAgentDeploymentId;c&&qc(()=>{Er()||da(vs({...a,aiAgentDeploymentId:c}))})}DS();})();
69
+ `).trim(),_e=!C&&t!=="error"&&!x.value&&pe.length>0,se=e.canceled===!0||t==="error",ge=new Map;for(let[ie,Se]of w.entries()){if(Se.kind!=="tool")continue;let Ue=rn(Se.toolMetadata),be=_d(tm(Se),{turn:{live:R||Ue&&!p,cutOff:se,superseded:p,submitted:e.continuationStreaming===!0&&Se.approvalSig.value?.approved===void 0,canAct:u&&t==="complete"&&zo(e,ie),interrupted:Ue&&ru(Se.errorSig.value)},reader:{decides:!0},display:i,strings:n});ge.set(Se.toolCallId,be.placement==="card"&&!_?.humanInLoop?{...be,placement:"hidden"}:be)}function at(ie){let Se=ge.get(ie.toolCallId);if(!Se)throw new Error(`no step view for ${ie.toolCallId}`);return Se}let st=dm(w,{showReasoning:a,showSources:c,viewOf:at}),Ge=um(w),At=e.canceled===!0&&!A&&S.value&&h.value,Ee=st.at(-1),rt=Ee?.kind==="steps"?Ee.indices.at(-1):Ee?.index;function Mt(ie,Se){return l(Bx,{part:ie,generativeUi:e.role==="assistant",onCardAction:b,current:R&&Se===rt,reasoningMs:e.stepTimings?.[Ge[Se]??-1]?.reasoningMs,strings:n,locale:o,showReasoning:a,showSources:c,view:ie.kind==="tool"?ge.get(ie.toolCallId):void 0,canAct:u&&t==="complete"&&(ie.kind!=="tool"||zo(e,Se)),superseded:p,continuationStreaming:e.continuationStreaming===!0,tool:_},`${Fx(ie)}#${Se}`)}let Tt=ce||_e;return l("div",{class:`${tt}-bubble-row`,"data-role":e.role,"aria-busy":R?"true":void 0,"data-testid":Ct(q.messageBubble,e.serverMessageId??e.id),children:l("div",{class:`${tt}-bubble-col`,children:[l("div",{class:`${tt}-bubble`,children:[e.role==="operator"&&e.operatorInitials?l("span",{class:`${tt}-bubble-author`,children:e.operatorInitials}):null,l("div",{class:`${tt}-bubble-body`,children:[N?l(Vx,{label:n.loading}):st.flatMap((ie,Se)=>ie.kind==="part"?[Mt(ie.part,ie.index)]:ie.rows.some(Ue=>Ue.kind==="tool")?[l(_m,{rows:ie.rows,steps:ie.indices.map(Ue=>Ge[Ue]??-1),stepTimings:e.stepTimings,timed:!se,strings:n,running:R&&Se===st.length-1,runStartedAt:e.runStartedAt},`steps#${ie.indices[0]}`)]:ie.rows.map((Ue,be)=>Mt(Ue.part,ie.indices[be]??be))),At?l("div",{class:`${tt}-steps-row`,"data-status":"stopped","data-testid":q.replyStopped,children:[l("span",{class:`${tt}-steps-row-icon`,"aria-hidden":"true",children:l(zr,{})}),l("div",{class:`${tt}-steps-row-main`,children:l("span",{class:`${tt}-steps-stopped-label`,children:n.statusStopped})})]}):null,j&&!g?l(jx,{}):null,t==="error"||x.value?l(Zo,{text:Hx(e,t,n),retryLabel:n.errorRetry,onRetry:d?()=>d(e):void 0,retryTestId:q.messageRetry}):null,g&&R?l(Zo,{text:n.errorReconnecting,retryTestId:q.messageRetry}):null]})]}),G||Tt?l("div",{class:`${tt}-bubble-meta`,children:[G?l("time",{class:`${tt}-bubble-time`,dateTime:G.iso,title:G.full,children:G.short}):null,Tt?l("div",{class:`${tt}-bubble-actions`,children:[ce&&e.serverMessageId?l(Yf,{messageId:e.serverMessageId,initial:e.feedback??null,strings:n,onFeedback:v}):null,_e?l(qx,{text:pe,strings:n}):null]}):null]}):null]})})}function qx({text:e,strings:t}){let[r,n]=U(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})}let s=r?t.copied:t.copy;return l("button",{type:"button",class:`${tt}-msg-action`,"data-active":r?"true":void 0,"aria-label":s,title:s,onClick:o,"data-testid":q.messageCopy,children:r?l(Qn,{}):l(Z_,{})})}function Ux(e,t){if(typeof e!="number"||!Number.isFinite(e))return null;try{let r=new Date(e);return{short:r.toLocaleTimeString(t,{hour:"numeric",minute:"2-digit"}),full:r.toLocaleString(t,{dateStyle:"full",timeStyle:"short"}),iso:r.toISOString()}}catch{return null}}function Bx({part:e,generativeUi:t,onCardAction:r,current:n,reasoningMs:o,strings:s,locale:a,showReasoning:i,showSources:c,view:u,canAct:p,superseded:_,continuationStreaming:d,tool:f}){switch(e.kind){case"step-start":return null;case"text":return l(Jo,{textSig:e.textSig,doneSig:e.doneSig,generativeUi:t,strings:s,onCardAction:r});case"reasoning":return i?l(Cc,{part:e,current:n,reasoningMs:o,strings:s,standalone:!0}):null;case"tool":return u?.placement!=="card"||!f?null:u.card==="questions"?l(lm,{part:e,strings:s,active:p,superseded:_,continuationStreaming:d,onDecision:f.onDecision,onEdit:f.onEdit}):l(nm,{part:e,view:u,strings:s,locale:a,canAct:p,onDecision:f.onDecision,onEdit:f.onEdit,preview:f.preview});case"file":return l(zx,{part:e,strings:s});case"source":return c?l(em,{part:e,strings:s}):null}}function zx({part:e,strings:t}){let r=e.filename??t.file;if(e.mediaType.startsWith("image/"))return l("a",{class:`${tt}-file-image`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:r,"data-testid":q.messageFile,children:l("img",{src:e.url,alt:r,loading:"lazy"})});let n=(r.includes(".")?r.split(".").pop():e.mediaType.split("/").pop())?.toUpperCase(),o=e.fileSize===void 0?void 0:Zn(e.fileSize);return l("a",{class:`${tt}-file-chip`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:r,"data-testid":q.messageFile,children:[l("span",{class:`${tt}-file-chip-icon`,"aria-hidden":"true",children:l(Oa,{})}),l("span",{class:`${tt}-file-chip-text`,children:[l("span",{class:`${tt}-file-chip-name`,children:r}),l("span",{class:`${tt}-file-chip-meta`,children:[n,o].filter(Boolean).join(" \xB7 ")})]})]})}function Hx(e,t,r){return e.errorText?e.errorText:t==="error"&&e.role==="assistant"?r.errorServer:r.errorGeneric}function Fx(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 jx(){return l("span",{class:`${tt}-typing`,"data-testid":q.typingDots,"aria-hidden":"true",children:[l("span",{}),l("span",{}),l("span",{})]})}function Vx({label:e}){return l("span",{class:`${tt}-loading`,role:"status",children:[l("span",{class:`${tt}-loading-spinner`,"aria-hidden":"true"}),l("span",{class:`${tt}-loading-label`,children:e})]})}var kr=D.cssPrefix,rs=120,Wx=350;function mm({messagesSig:e,reconnectingSig:t,pageToolRunning:r,strings:n,notice:o,locale:s,responseMode:a,showReasoning:i,stepDisplay:c,showSources:u,enableMessageFeedback:p,onFeedback:_,loading:d,onLoadPreviousMessages:f,idle:v,controlMode:g="ai-agent",tool:y,onRetry:b,onCardAction:P}){let w=B(null),x=It(()=>e.value),k=Gx(s),[h,m]=U(!1),[S,A]=U(!1),I=B(!1),R=B(!1),[C,M]=U(),N=B(!1),j=B(!1),G=B(!1),z=B(0);function ce(){return G.current||performance.now()-z.current<Wx}let pe=B(0);function _e($){let L=$.scrollHeight-$.clientHeight>1;$.dataset.fadeTop=L&&$.scrollTop>1?"true":"false",$.dataset.fadeBottom=L&&$.scrollHeight-$.scrollTop-$.clientHeight>1?"true":"false"}function se($){return m($.scrollHeight-$.scrollTop-$.clientHeight>rs*2)}function ge($){pe.current=performance.now(),$.scrollTop=$.scrollHeight,_e($)}function at($,L){ge($);let Y=L,K=0;function re(){j.current||ce()||(ge($),--Y>0&&(K=requestAnimationFrame(re)))}return L>0&&(K=requestAnimationFrame(re)),()=>cancelAnimationFrame(K)}function st($,L){let Y,K,re,ye=-1;function de(){Y.disconnect(),K.disconnect(),clearTimeout(re)}function Pe(){if(j.current||ce()||ye>=0&&$.scrollTop<ye-4)return de();ge($),ye=$.scrollTop}return Y=new ResizeObserver(Pe),K=new MutationObserver(Pe),Pe(),Y.observe($),K.observe($,{childList:!0,subtree:!0,characterData:!0}),re=setTimeout(de,L),de}let Ge=x.value[0]?.id;St(()=>{let $=w.current;if($&&x.value.length!==0&&!R.current&&(N.current=!0,!!x.value.some(L=>L.role==="user")))return st($,300)},[Ge]);let At=B(0);H(()=>{let $=w.current,L=x.value,Y=At.current;if(At.current=L.length,!$||!N.current||R.current)return;if(L.slice(Y).some(re=>re.role==="user"))return j.current=!1,at($,3);if(!L.some(re=>re.role==="user")||j.current||ce())return;$.scrollHeight-$.scrollTop-$.clientHeight<rs&&ge($)},[x.value.length]);let Ee=B(null);H(()=>{let $=w.current,L=x.value.at(-1),Y=Ee.current;if(Ee.current=L?{id:L.id,streaming:L.status==="streaming"}:null,!!$&&N.current&&!(!L||L.id!==Y?.id||Y.streaming||L.status!=="streaming"))return j.current=!1,at($,3)},[x.value]),H(()=>{let $=w.current;if(!$)return;let L=x.value.at(-1);if(!L||L.status!=="streaming"&&!x.value.some(re=>re.role==="user"))return;let Y=()=>{if(j.current||ce())return;$.scrollHeight-$.scrollTop-$.clientHeight<rs*2&&ge($)};if(L.status!=="streaming")return st($,300);Y();let K=new MutationObserver(Y);return K.observe($,{childList:!0,subtree:!0,characterData:!0}),()=>K.disconnect()},[x.value]),H(()=>{let $=w.current;if(!$)return;let L=()=>{se($),_e($),performance.now()-pe.current>150&&(j.current=$.scrollHeight-$.scrollTop-$.clientHeight>8)};function Y(){j.current=!0}function K(ze){ze.deltaY<0&&Y()}let re=0;function ye(ze){re=ze.touches[0]?.clientY??0,G.current=!0}function de(ze){(ze.touches[0]?.clientY??0)>re+4&&Y()}function Pe(){G.current=!1,z.current=performance.now()}function lt(){G.current=!0}return $.addEventListener("scroll",L,{passive:!0}),$.addEventListener("wheel",K,{passive:!0}),$.addEventListener("touchstart",ye,{passive:!0}),$.addEventListener("touchmove",de,{passive:!0}),$.addEventListener("touchend",Pe,{passive:!0}),$.addEventListener("touchcancel",Pe,{passive:!0}),$.addEventListener("pointerdown",lt,{passive:!0}),window.addEventListener("pointerup",Pe,{passive:!0}),window.addEventListener("pointercancel",Pe,{passive:!0}),se($),()=>{$.removeEventListener("scroll",L),$.removeEventListener("wheel",K),$.removeEventListener("touchstart",ye),$.removeEventListener("touchmove",de),$.removeEventListener("touchend",Pe),$.removeEventListener("touchcancel",Pe),$.removeEventListener("pointerdown",lt),window.removeEventListener("pointerup",Pe),window.removeEventListener("pointercancel",Pe)}},[]),H(()=>{let $=w.current;if(!$)return;let L=$.clientHeight,Y=new ResizeObserver(()=>{if($.clientHeight===L)return;let K=$.scrollHeight-$.scrollTop-L<=rs;L=$.clientHeight,!(!K||R.current)&&x.value.some(re=>re.role==="user")&&(j.current=!1,ge($))});return Y.observe($),()=>Y.disconnect()},[]);function rt(){let $=w.current;$&&(j.current=!1,ge($))}let Mt=x.value.filter($=>!$.ephemeral),Tt=Mt[0],ie=Tt?.serverMessageId??Tt?.id,Se=!!(f&&Mt.length>=cc&&ie!==C);async function Ue(){if(!f||I.current)return;let $=w.current,L=$?.scrollHeight??0,Y=$?.scrollTop??0;I.current=!0,R.current=!0,A(!0);try{let K=await f();K===!1&&ie&&M(ie),K&&$&&(await new Promise(re=>requestAnimationFrame(()=>requestAnimationFrame(()=>re()))),$.scrollTop=Y+$.scrollHeight-L,_e($),se($))}finally{R.current=!1,I.current=!1,A(!1)}}let be=[],Be="",Re=x.value.at(-1)?.id,Qt=t?.value===!0,Pt=r===!0;for(let $ of x.value){if($.role==="assistant"&&$.id!==Re&&pn($))continue;let L=Kx($.createdAt);L&&L!==Be&&(be.push(l("div",{class:`${kr}-date-divider`,children:l("span",{class:`${kr}-date-pill`,title:Qx($.createdAt,k),children:Yx($.createdAt,n,k)})},`day:${L}`)),Be=L);let K=$.retryAction!==void 0||$.role==="assistant"&&$.id===Re?Ta(x.value,$):void 0,re=K!==void 0&&(K.kind!=="continue-assistant"||g==="ai-agent");be.push(l(fm,{message:$,status:$.status,createdAt:$.createdAt,strings:n,locale:k,responseMode:a,showReasoning:i,stepDisplay:c,showSources:u,interactive:!!v&&g==="ai-agent"&&$.id===Re,superseded:$.id!==Re,tool:y,onRetry:v&&re&&($.role==="user"||$.id===Re)?b:void 0,enableMessageFeedback:p,onFeedback:_,reconnecting:Qt&&$.id===Re,clientToolRunning:Pt&&$.id===Re&&$.role==="assistant",onCardAction:P},$.id))}return l("div",{class:`${kr}-list-wrap`,children:[l("div",{ref:w,class:`${kr}-list ${kr}-list--fade`,part:"messages",role:"log","aria-live":"polite","aria-relevant":"additions text",children:[d&&x.value.length===0?l("div",{class:`${kr}-list-loading`,role:"status",children:n.conversationLoading}):null,o&&!Se?l("div",{class:`${kr}-chat-notice`,role:"note","data-testid":q.chatNotice,children:l(Ba,{text:o})}):null,Se?l("div",{class:`${kr}-load-previous`,children:l("button",{type:"button",onClick:Ue,disabled:S,"aria-busy":S,"data-testid":q.loadPreviousMessages,children:n.loadPreviousMessages})}):null,be]}),h?l("button",{type:"button",class:`${kr}-jump`,onClick:rt,"aria-label":n.scrollToBottom,title:n.scrollToBottom,"data-testid":q.scrollToBottom,children:l(ar,{})}):null]})}function Gx(e){try{return Intl.getCanonicalLocales(e)[0]}catch{return}}function Kx(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Qx(e,t){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(t,{dateStyle:"full"})}catch{return""}}function Yx(e,t,r){let n=new Date(e);function o(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime()}let s=Math.round((o(new Date)-o(n))/864e5);return s<=0?t.dateToday:s===1?t.dateYesterday:s<7?n.toLocaleDateString(r,{weekday:"long"}):n.toLocaleDateString(r,{month:"long",day:"numeric",year:"numeric"})}var Jx=16,Xx=64;function ns({panelEl:e,resize:t,position:r,edge:n,initialSize:o,onSizeChange:s,onResizeStart:a,strings:i}){let c=D.cssPrefix,u=B(null),[p,_]=U(null),d=o?.width,f=o?.height;if(H(()=>{if(!e)return;let C=e.style;C.setProperty(`--${c}-resize-min-w`,t.minWidth??"320px"),C.setProperty(`--${c}-resize-min-h`,t.minHeight??"400px"),t.maxWidth&&C.setProperty(`--${c}-resize-max-w`,t.maxWidth),t.maxHeight&&C.setProperty(`--${c}-resize-max-h`,t.maxHeight),d!==void 0&&f!==void 0&&(C.setProperty(`--${c}-widget-w`,`${d}px`),C.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=r.startsWith("top-"),g=r.endsWith("-right"),y=g?-1:1,b=v?1:-1,P=`${c}-resize-grip--${n?"edge":`${v?"bottom":"top"}-${g?"left":"right"}`}`;function w(C){C.setAttribute("data-resizing",""),a?.()}function x(C,M,N){C.style.setProperty(`--${c}-widget-w`,`${M}px`),n||C.style.setProperty(`--${c}-widget-h`,`${N}px`)}function k(C){let M=C.getBoundingClientRect(),N={width:Math.round(M.width),height:Math.round(M.height)};C.style.setProperty(`--${c}-widget-w`,`${N.width}px`),n||C.style.setProperty(`--${c}-widget-h`,`${N.height}px`),_(Math.round(N.width/window.innerWidth*100)),s(N)}function h(C){if(!e)return;let M=e.getBoundingClientRect();u.current={pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,startW:M.width,startH:M.height,moved:!1},C.currentTarget.setPointerCapture(C.pointerId),C.preventDefault()}function m(C){let M=u.current;if(!M||C.pointerId!==M.pointerId||!e)return;let N=(C.clientX-M.startX)*y,j=n?0:(C.clientY-M.startY)*b;!M.moved&&N===0&&j===0||(M.moved||w(e),M.moved=!0,x(e,M.startW+N,M.startH+j))}function S(C){let M=u.current;!M||C.pointerId!==M.pointerId||!e||(C.currentTarget.releasePointerCapture(C.pointerId),u.current=null,M.moved&&(e.removeAttribute("data-resizing"),k(e)))}function A(C){return C==="ArrowLeft"?[-1,0]:C==="ArrowRight"?[1,0]:n?null:C==="ArrowUp"?[0,-1]:C==="ArrowDown"?[0,1]:null}function I(C){let M=A(C.key);if(!M||!e)return;C.preventDefault();let N=C.shiftKey?Xx:Jx;C.repeat||w(e);let j=e.getBoundingClientRect();x(e,j.width+M[0]*N*y,j.height+M[1]*N*b)}function R(C){!A(C.key)||!e||(e.removeAttribute("data-resizing"),k(e))}return l("div",{class:`${c}-resize-grip ${P}`,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,"aria-valuenow":p??void 0,tabIndex:0,title:i.resizeHandle,onPointerDown:h,onPointerMove:m,onPointerUp:S,onPointerCancel:S,onKeyDown:I,onKeyUp:R,"data-testid":q.resizeGrip,children:n?null:l(B_,{})})}var gm=D.cssPrefix;function vm({suggestions:e,strings:t,onPick:r,disabled:n=!1}){let o=B(null),[s,a]=U({start:!1,end:!1});return H(()=>{let i=o.current;if(!i)return;function c(){if(!i)return;let p=Math.abs(i.scrollLeft),_=p>1,d=p<i.scrollWidth-i.clientWidth-1;a(f=>f.start===_&&f.end===d?f:{start:_,end:d})}c(),i.addEventListener("scroll",c,{passive:!0});let u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(c);return u?.observe(i),()=>{i.removeEventListener("scroll",c),u?.disconnect()}},[e]),e.length===0?null:l("div",{ref:o,class:`${gm}-suggestions`,role:"group","aria-label":t.suggestedReplies,"data-cut-start":s.start?"true":void 0,"data-cut-end":s.end?"true":void 0,children:e.map((i,c)=>l("button",{type:"button",class:`${gm}-suggestion`,onClick:()=>r(i),disabled:n,"data-testid":Ct(q.suggestion,c),children:i.label},i.id))})}var gn=D.cssPrefix,Zx=`.${gn}-header, .${gn}-back-header, .${gn}-home-hero`,eS='button, a, input, textarea, select, [role="tab"], [contenteditable]',hm=56;function os(e,t){H(()=>{if(!t||!e)return;function r(c){return Number.parseFloat(c)||0}function n(c,u){return Math.min(u,Math.max(-u,c))}let o=null,s=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(Zx)||u.closest(eS))return;let p=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:r(e.style.getPropertyValue(`--${gn}-modal-dx`)),dy:r(e.style.getPropertyValue(`--${gn}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-hm,maxY:(window.innerHeight+p.height)/2-hm},e.dataset.dragging="true",c.preventDefault()},a=c=>{if(!o||c.pointerId!==o.id)return;let u=n(o.dx+c.clientX-o.x,o.maxX),p=n(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${gn}-modal-dx`,`${u}px`),e.style.setProperty(`--${gn}-modal-dy`,`${p}px`)},i=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",s),window.addEventListener("pointermove",a),window.addEventListener("pointerup",i),window.addEventListener("pointercancel",i),()=>{e.removeEventListener("pointerdown",s),window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",i)}},[e,t])}function is({containerRef:e,onDrop:t,accept:r,disabled:n=!1}){let[o,s]=U();return H(()=>{if(n){s(void 0);return}let a=e.current;if(!a)return;let i=0;function c(d){i+=1,d.dataTransfer?.types.includes("Files")&&(d.preventDefault(),s([...d.dataTransfer.items].every(f=>f.kind!=="file"||Sf(f.type,r))?"accept":"reject"))}function u(){i-=1,!(i>0)&&(i=0,s(void 0))}function p(d){d.dataTransfer?.types.includes("Files")&&d.preventDefault()}function _(d){i=0,s(void 0),d.dataTransfer&&(d.preventDefault(),t(d.dataTransfer.items))}return a.addEventListener("dragenter",c),a.addEventListener("dragleave",u),a.addEventListener("dragover",p),a.addEventListener("drop",_),()=>{a.removeEventListener("dragenter",c),a.removeEventListener("dragleave",u),a.removeEventListener("dragover",p),a.removeEventListener("drop",_)}},[r,e,n,t]),n?void 0:o}var Ce=D.cssPrefix;function ym(e){let{options:t,onClose:r}=e,n=t.strings,o=B(null);H(()=>{let u=o.current;if(!u||!r)return;let p=Jn(u);function _(d){d.key==="Escape"&&r?.()}return u.addEventListener("keydown",_),()=>{p(),u.removeEventListener("keydown",_)}},[r]);let s=e.composerApiRef,a=e.composerActive&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,i=F(u=>{a&&s.current?.attachFromDrop(u)},[s,a]),c=is({containerRef:o,onDrop:i,accept:e.options.attachments.accept,disabled:!a});return os(o.current,t.mode==="modal"),l("div",{ref:o,class:`${Ce}-panel`,part:"panel",role:"dialog","aria-modal":"false","aria-label":n.panelTitle,style:{position:"relative"},"data-testid":q.panel,children:[l(Tc,{...e,containerEl:o.current,dragOver:c}),l(Ic,{poweredBy:e.options.poweredBy,strings:e.options.strings})]})}function Tc(e){let{options:t,transport:r,feedback:n,bus:o,persistence:s,conversationId:a,composerKey:i,panelSize:c,view:u,isStreaming:p,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,sendPreparing:g,attachmentUploadsSig:y,controlMode:b,assignedOperator:P,operatorAvailable:w,operatorRequestEnabled:x,onRequestOperator:k,onCancelOperatorRequest:h,loadingMessages:m,onLoadPreviousMessages:S,messagesSig:A,reconnectingSig:I,agent:R,ticketReference:C,login:M,onStartAsGuest:N,suggestions:j,initialWidgetSize:G,onClose:z,onBack:ce,onExpand:pe,onToggleHistory:_e,onSelectHistoryConversation:se,onNewConversation:ge,onWidgetSizeChange:at,onSend:st,onStop:Ge,onSuggestion:At,tool:Ee,onRetry:rt,onMessageFeedback:Mt,onCardAction:Tt,containerEl:ie,dragOver:Se,composerApiRef:Ue}=e,be=t.strings,Be=b==="operator"?P:void 0,Re=Be?{name:Be.name??Be.initials,avatar:Be.avatar,title:be.operatorBadgeTitle,status:"online"}:R,Qt=t.header.showNotice?gt(be,t.header.notice||"chatNotice"):void 0,Pt=It(()=>A.value.some(de=>!de.ephemeral&&de.role!=="system")).value,$=It(()=>A.value.length>0).value,[L,Y]=U(),K=L===a,re=t.features.emailTranscript&&Pt?()=>Y(a):void 0,ye=M.gate?l(sS,{login:{...M,gate:M.gate},alone:!$,onStartAsGuest:N,strings:be}):l(ve,{children:[b&&b!=="ai-agent"?l(rS,{controlMode:b,operatorName:P?.name??P?.initials,operatorAvailable:w,onCancelOperatorRequest:h,strings:be}):null,_&&b==="ai-agent"?l("div",{class:`${Ce}-loading ${Ce}-compaction-status`,role:"status","data-testid":q.compactionStatus,children:[l("span",{class:`${Ce}-loading-spinner`,"aria-hidden":"true"}),be.compactingContext]}):null,!p&&!_&&b==="ai-agent"&&l(vm,{suggestions:j,strings:be,onPick:At,disabled:g}),l(Af,{options:t,transport:r,feedback:n,bus:o,persistence:s,conversationId:a,maxMessageCharacters:e.maxMessageCharacters,isStreaming:p,pageToolRunning:e.pageToolRunning,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,active:e.composerActive&&u==="chat",isPreparing:g,attachmentUploadsSig:y,operatorRequestEnabled:x,canRequestOperator:Pt,controlMode:b,onRequestOperator:k,onSend:st,onStop:Ge,apiRef:Ue},i)]});return l(ve,{children:[u==="history"?l(tS,{strings:be,onBack:_e,onClose:z,showClose:Aa(t.mode,c,t.actions)}):l("header",{class:`${Ce}-header`,part:"header","data-variant":t.header.variant,"data-testid":q.panelHeader,children:[ce?l("button",{type:"button",class:`${Ce}-icon-btn`,onClick:ce,"aria-label":be.moduleBack,title:be.moduleBack,children:l(Go,{})}):null,Re?l($f,{agent:Re,strings:be,ticketReference:C,person:!!Be}):l("h1",{children:be.panelTitle}),l(dr,{panelProps:M.gate?{...e,options:{...t,actions:t.actions.filter(de=>de!=="history")}}:e,variant:"chat",onEmailTranscript:re,onLogIn:M.menuLogIn})]}),u==="history"?l(Ya,{transport:r,strings:be,locale:t.locale,persistence:s,onSelect:se,onNewConversation:ge}):l(ve,{children:[l(Hf,{state:Se,strings:be}),M.strip?l(iS,{strip:M.strip,onLogIn:M.onLogIn,onHide:M.onHidePrompt,strings:be}):null,M.gate&&!$?null:l(mm,{messagesSig:A,reconnectingSig:I,pageToolRunning:e.pageToolRunning,strings:be,notice:Qt,locale:t.locale,responseMode:t.responseMode,showReasoning:t.showReasoning,stepDisplay:t.stepDisplay,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Mt,loading:m,onLoadPreviousMessages:S,idle:!p&&!g,controlMode:b,tool:Ee,onRetry:rt,onCardAction:Tt}),ye,l(oS,{disclaimer:t.composerDisclaimer}),K?l(Vf,{transport:r,strings:be,knownEmail:jf({tokenEmail:M.email,userContext:t.userContext}),onClose:()=>Y(void 0)}):null]}),t.size.resize?.enabled?l(ns,{panelEl:ie,resize:t.size.resize,position:t.position,edge:t.mode==="drawer",initialSize:G,onSizeChange:at,onResizeStart:t.mode==="floating"&&c==="expanded"?pe:void 0,strings:be}):null]})}function tS({strings:e,onBack:t,onClose:r,showClose:n}){return l("header",{class:`${Ce}-header`,part:"header",children:[l("button",{type:"button",class:`${Ce}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:l(Go,{})}),l("h1",{children:e.historyTitle}),n?l("button",{type:"button",class:`${Ce}-icon-btn`,onClick:r,"aria-label":e.close,title:e.close,children:l(Bt,{})}):null]})}function rS({controlMode:e,operatorName:t,operatorAvailable:r,onCancelOperatorRequest:n,strings:o}){let[s,a]=U(!1),i=nS(e,t,r,o);function c(){n&&(a(!0),n().finally(()=>a(!1)))}return l("div",{class:`${Ce}-operator-banner`,"data-mode":e,"data-available":r===!1?"false":void 0,"data-testid":q.operatorBanner,children:[l("span",{class:`${Ce}-operator-pulse`,"aria-hidden":"true"}),l("span",{class:`${Ce}-operator-label`,role:"status",children:i}),e==="awaiting-operator"&&n?l("button",{type:"button",class:`${Ce}-icon-btn ${Ce}-operator-dismiss`,onClick:c,disabled:s,"aria-label":o.cancelOperatorRequest,title:o.cancelOperatorRequest,"data-testid":q.cancelOperatorRequest,children:l(Bt,{})}):null]})}function nS(e,t,r,n){return e==="operator"?n.chattingWithOperator.replace("{operator}",t??""):r===!1?n.noOperatorAvailable:n.connectingOperator}function oS({disclaimer:e}){return e?l("div",{class:`${Ce}-composer-footer`,children:l("div",{class:`${Ce}-disclaimer`,children:e})}):null}function iS({strip:e,onLogIn:t,onHide:r,strings:n}){let o=e.kind==="user";return l("div",{class:`${Ce}-login-bar`,"data-kind":e.kind,role:o?"status":"note","data-testid":o?q.loggedIn:q.loginBar,children:[l("span",{class:`${Ce}-login-bar-icon`,"aria-hidden":"true",children:l(Sr,{})}),o?l("span",{class:`${Ce}-login-bar-text`,children:e.who?n.loggedInAs.replace("{name}",e.who):n.loggedIn}):l(ve,{children:[l("span",{class:`${Ce}-login-bar-text`,children:n.loginPrompt}),l("button",{type:"button",class:`${Ce}-login-bar-action`,onClick:t,"data-testid":q.loginBarAction,children:n.loginAction}),l("button",{type:"button",class:`${Ce}-icon-btn ${Ce}-login-bar-hide`,onClick:r,"aria-label":n.dismissLoginPrompt,title:n.dismissLoginPrompt,"data-testid":q.loginBarHide,children:l(Bt,{})})]})]})}function aS(e,t){return e.gate==="required"?t.loginRequired:e.canStartAsGuest?t.loginExpiredGuest:t.loginExpired}function sS({login:e,alone:t,onStartAsGuest:r,strings:n}){return l("div",{class:`${Ce}-login-gate`,"data-gate":e.gate,"data-alone":t?"":void 0,"data-testid":q.loginGate,children:[l("span",{class:`${Ce}-login-gate-icon`,"aria-hidden":"true",children:l(Sr,{})}),l("p",{class:`${Ce}-login-gate-title`,role:"status",children:aS(e,n)}),e.canLogIn||e.canStartAsGuest?l("div",{class:`${Ce}-form-actions ${Ce}-login-gate-actions`,children:[e.canStartAsGuest?l("button",{type:"button",class:`${Ce}-form-skip`,onClick:r,"data-testid":q.loginGateGuest,children:n.startAsGuest}):null,e.canLogIn?l("button",{type:"button",class:`${Ce}-form-submit`,onClick:e.onLogIn,"data-testid":q.loginGateAction,children:n.loginAction}):null]}):null]})}function Ic({poweredBy:e,strings:t}){return e?l("div",{class:`${Ce}-poweredby-bar`,children:l(lS,{logoUrl:e.logoUrl,text:e.text??t.poweredBy.replace("{name}",D.displayName),href:e.href})}):null}function lS({logoUrl:e,text:t,href:r}){let n=l(ve,{children:[e?l("img",{class:`${Ce}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?l("span",{children:t}):null]});return r?l("a",{class:`${Ce}-poweredby`,href:r,target:"_blank",rel:"noopener noreferrer",children:n}):l("span",{class:`${Ce}-poweredby`,children:n})}var as=D.cssPrefix;function bm({panelProps:e,enabledModules:t,nav:r,bus:n,hasUnread:o,latestNews:s,onSelectConversation:a,onStartNewConversation:i,onSetPanelSize:c}){let u=e.options,p=u.strings,_=B(null),d=B(new Set);H(()=>{let N=_.current;if(!N||!e.onClose)return;let j=Jn(N);function G(z){z.key==="Escape"&&e.onClose?.()}return N.addEventListener("keydown",G),()=>{j(),N.removeEventListener("keydown",G)}},[e.onClose]);let f=It(()=>r.sig.value).value,v=I_(f),g=u.modules.byId[f.activeTab],y=e.composerActive&&g?.layout==="chat"&&v===void 0,b=e.composerApiRef,P=y&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,w=F(N=>{P&&b.current?.attachFromDrop(N)},[b,P]),x=is({containerRef:_,onDrop:w,accept:e.options.attachments.accept,disabled:!P});os(_.current,u.mode==="modal");let k=v?.kind==="content",h=t.length>1&&A_(f),m=B(null);H(()=>{if(k&&m.current===null)m.current=e.panelSize,e.panelSize==="normal"&&c("expanded");else if(!k&&m.current!==null){let N=m.current;m.current=null,c(N)}},[k]);let S={push:N=>r.push(N),pop:()=>r.pop(),switchTab:N=>r.switchTab(N),switchToLayout:N=>{let j=t.find(G=>G.layout===N);j&&r.switchTab(j.id)},selectConversation:a,startNewConversation:i};function A(N){return{options:u,transport:e.transport,strings:p,config:N,nav:S,bus:n,panelProps:e,latestNews:s}}let I=l(dr,{panelProps:e,variant:"plain"});g&&d.current.add(g.id);let R=t.filter(N=>d.current.has(N.id));function C(N){if(N.layout==="chat")return l(Tc,{...e,composerActive:y,containerEl:_.current,dragOver:x});let j=Qa[N.layout].Root;return j?l(j,{...A(N)}):null}function M(){return v?.kind==="content"?l(ff,{id:v.id,title:v.title,transport:e.transport,strings:p,bus:n,onBack:()=>r.pop(),actions:I}):null}return l("div",{ref:_,class:`${as}-panel ${as}-messenger`,part:"panel",role:"dialog","aria-modal":"false","aria-label":p.panelTitle,style:{position:"relative"},"data-testid":q.messengerHome,children:[l("div",{class:`${as}-messenger-body`,children:[R.map(N=>l("div",{class:`${as}-messenger-pane`,hidden:k||N.id!==g?.id,children:C(N)},N.id)),M()]}),h?l(Of,{modules:t,activeTab:f.activeTab,strings:p,hasUnread:o,onSelect:N=>r.switchTab(N)}):null,l(Ic,{poweredBy:u.poweredBy,strings:u.strings}),u.size.resize?.enabled&&!(g?.layout==="chat"&&!v)?l(ns,{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 Pm(e){let t=D.cssPrefix,{site:r,blocks:n,strings:o,collapsed:s}=e,a=n?.navigation??[],i=n?.linkCards??[],c=s?o.expandSidebar:o.collapseSidebar;return l("aside",{class:`${t}-sidebar`,"data-collapsed":s?"true":"false","data-testid":q.sidebar,children:[l("div",{class:`${t}-sidebar-header`,children:[l(cS,{site:r}),l("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":s?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":q.sidebarToggle,children:l(dS,{collapsed:s})})]}),s?null:l(ve,{children:[a.length>0?l("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:l(uS,{items:a})}):null,i.length>0?l("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:l(pS,{items:i})}):null,e.showConversations?l("div",{class:`${t}-sidebar-conversations`,children:l(Ya,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function cS({site:e}){let t=D.cssPrefix;if(e?.logo?.url){let r=e.logo.alt??e.title??"Logo";return l("picture",{children:[e.logoDark?.url?l("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,l("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:r})]})}return l("div",{class:`${t}-sidebar-title`,children:e?.title??D.name})}function dS({collapsed:e}){return l("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?l("polyline",{points:"9 6 15 12 9 18"}):l("polyline",{points:"15 6 9 12 15 18"})})}function uS({items:e}){let t=D.cssPrefix;return l("ul",{class:`${t}-sidebar-nav`,children:e.map(r=>l("li",{children:l("a",{class:`${t}-sidebar-nav-item`,href:r.href,target:r.href?"_blank":void 0,rel:r.href?"noreferrer":void 0,children:[r.icon?l("span",{class:`${t}-sidebar-nav-icon`,"data-icon":r.icon}):null,l("span",{class:`${t}-sidebar-nav-label`,children:r.label})]})},r.id??r.label))})}function pS({items:e}){let t=D.cssPrefix;return l("div",{class:`${t}-sidebar-cards`,children:e.map(r=>l("a",{class:`${t}-sidebar-card`,href:r.href,target:r.href?"_blank":void 0,rel:r.href?"noreferrer":void 0,children:[l("div",{class:`${t}-sidebar-card-label`,children:r.label}),r.description?l("div",{class:`${t}-sidebar-card-desc`,children:r.description}):null]},r.id??r.label))})}var xm=D.cssPrefix;function Sm(e){return l("main",{class:`${xm}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[l(Pm,{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}),l("section",{class:`${xm}-page-chat`,"aria-label":e.strings.panelTitle,children:e.children})]})}var ni=D.cssPrefix;function Ac({strings:e,text:t,onClose:r}){return l("div",{class:`${ni}-panel ${ni}-panel-notice`,part:"panel",role:"dialog","aria-label":e.panelTitle,"data-testid":q.panelNotice,children:[r?l("button",{type:"button",class:`${ni}-icon-btn ${ni}-panel-notice-close`,onClick:r,"aria-label":e.close,title:e.close,children:l(Bt,{})}):null,l("p",{class:`${ni}-panel-notice-text`,children:t})]})}var oi=te.scope("hitl");function ii(e){return e.kind==="tool"&&rn(e.toolMetadata)&&(e.stateSig.value==="input-available"||e.stateSig.value==="approval-responded"&&e.approvalSig.value?.approved===!0)}function wm(e,t){t.errorSig.value=nl(t.toolCallId),t.stateSig.value="output-error",e.partsSig.value=[...e.partsSig.value]}function km(e,t){let r=e.slice(0,e.indexOf(t)).findLast(n=>n.role==="user");return r!==void 0&&Ot.sentHere(r.id)}function Cm(e){let{streaming:t,controlModeSig:r,messagesSig:n,sendAiTurn:o,bus:s,humanInLoop:a,tools:i}=e,c=B(t);c.current=t;let u=B(i);u.current=i;let p=B(new Map),_=It(()=>{let w=n.value,x=w.at(-1);return r.value!=="ai-agent"||x?.role!=="assistant"||x.status!=="complete"?!1:x.partsSig.value.some(k=>ii(k)&&Ot.get(k.toolCallId)?.state!=="stopped")&&km(w,x)}).value,d=F((w,x,k)=>{if(c.current||r.value!=="ai-agent")return!1;let h=n.value.at(-1),m=h?.partsSig.value.findIndex(I=>I.kind==="tool"&&I.toolCallId===w)??-1,S=h?.partsSig.value[m];if(!h||S?.kind!=="tool")return oi.warn("decideTool: tool part not found",{toolCallId:w}),!1;if(h.status!=="complete"||!zo(h,m)||!x(S))return!1;if(k(S),h.partsSig.value=[...h.partsSig.value],!_n(h)||h.partsSig.value.some(ii))return!0;h.status="streaming",h.retryAction={kind:"continue-assistant",messageId:h.serverMessageId??h.id},h.awaitingContinuation=!0,n.value=[...n.value];let A=h.partsSig.value.flatMap(I=>I.kind==="tool"?[I.toolCallId]:[]);return o({continueExisting:!0}).then(I=>I&&Ot.clear(A)),!0},[r,n,o]),f=F((w,x)=>{let{toolCallId:k,toolName:h}=x;p.current.has(k)||(p.current.set(k,w),tu({toolCallId:k,toolName:h,input:x.inputSig.value,optionTools:u.current??[],onSettled:(m,S)=>{oi.info("toolResult",{toolCallId:k,status:m}),s.emit("toolResult",{toolCallId:k,name:Nn(h),status:m,durationMs:S})}}).then(m=>{p.current.delete(k)&&d(k,ii,S=>{m.state==="output-available"?S.outputSig.value=m.output:S.errorSig.value=m.errorText,S.stateSig.value=m.state})}))},[s,d]),v=F(()=>{let w=n.value;for(let[h,m]of p.current){let S=w.findIndex(A=>A.id===m);S<0||S===w.length-1||(p.current.delete(h),nu(h))}let x=w.at(-1);if(c.current||x?.role!=="assistant"||x.status!=="complete")return;let k=x.partsSig.value.filter(ii);if(!(k.length===0||!km(w,x)))for(let h of k)Ot.get(h.toolCallId)?.state==="stopped"?wm(x,h):f(x.id,h)},[n,f]);H(()=>v(),[t,v]),H(()=>n.subscribe(()=>v()),[n,v]);let g=F((w,x,k)=>{let h=!1,m;if(!d(w,I=>I.stateSig.value==="approval-requested",I=>{rn(I.toolMetadata)&&(m=I),h=I.toolMetadata?.card==="questions";let R=I.approvalSig.value?.id??w;I.approvalSig.value={id:R,approved:x,reason:k},I.stateSig.value="approval-responded"}))return;let A=n.value.at(-1);if(m&&x&&A&&f(A.id,m),m&&!x&&s.emit("toolResult",{toolCallId:w,name:Nn(m.toolName),status:"declined",durationMs:0}),h){oi.info("toolResult",{toolCallId:w}),s.emit("toolResult",{toolCallId:w});return}oi.info("toolDecision",{toolCallId:w,approved:x}),s.emit("toolDecision",{toolCallId:w,approved:x})},[s,d,n,f]),y=F(w=>{d(w,x=>x.stateSig.value==="approval-responded"&&x.approvalSig.value?.approved!==void 0&&!ii(x),x=>{let k=x.approvalSig.value?.id??w;x.approvalSig.value={id:k},x.stateSig.value="approval-requested"})},[d]),b=ke(()=>({humanInLoop:a,onDecision:g,onEdit:y,preview:(w,x)=>eu({toolName:w,input:x,optionTools:u.current??[]})}),[a,g,y]),P=F(()=>{let w=n.value.at(-1);for(let x of p.current.keys()){let k=w?.partsSig.value.find(h=>h.kind==="tool"&&h.toolCallId===x);w&&k?wm(w,k):nl(x),oi.info("toolResult",{toolCallId:x,status:"stopped"}),s.emit("toolResult",{toolCallId:x,name:k?Nn(k.toolName):void 0,status:"stopped",durationMs:0})}p.current.clear()},[s,n]);return{toolInteraction:b,pageToolsRunning:_,stopPageTools:P}}var _S=te.scope("latest-news");function Tm({transport:e,options:t,persistence:r,enabled:n}){let o=t.modules.list.find(_=>_.layout==="news")?.contentCollectionIds,s=o?.join(","),[a,i]=U(),[c,u]=U(()=>r.loadSeenNewsId());H(()=>{if(!n||!o?.length)return;let _=!1;return e.listContent({contentCollectionIds:o,sortBy:"publishedAt",sortOrder:"desc",limit:1}).then(d=>{_||i(d.items[0])}).catch(d=>_S.debug("listContent (latest news) failed (non-fatal)",{err:d})),()=>{_=!0}},[e,n,s]);let p=F(_=>{r.saveSeenNewsId(_),u(_)},[r]);return{item:a,unseen:a!==void 0&&a.id!==c,markSeen:p}}function Im({callout:e,persistence:t}){let r=e?.text??"",n=e?.persistent??!0,[o,s]=U(()=>n?!1:t.loadCalloutDismissed(r));H(()=>{s(n?!1:t.loadCalloutDismissed(r))},[r,n,t]);let a=F(()=>{s(!0),n||t.saveCalloutDismissed(r)},[t,r,n]);return{dismissed:o,dismissCallout:a}}var fS=te.scope("login");function mS(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 gS(e,t,r){if(e.status==="loggedIn")return t.hideUser?void 0:{kind:"user",who:e.name??e.email};if(!(e.status!=="anonymous"||!t.url||t.hidePrompt||r))return{kind:"prompt"}}function Am(e){let{state:t,deployment:r,bus:n,persistence:o,conversationIdSig:s}=e,[a,i]=U(()=>o.loadLoginPromptDismissedIn()),c=It(()=>s.value).value,u=a!==void 0&&a===c,p=(t.status==="required"?t.loginUrl:void 0)??r.url,_=mS(t,r.required),d=F(()=>{let g=sp(),y=n.listensTo("loginRequested");if(fS.info("loginRequested",{pageLogsIn:y}),n.emit("loginRequested",{returnTo:g}),y||!p)return;let b=s.value;b&&o.saveLoginReturn({conversationId:b,draft:o.loadDraft(b)}),o.savePanelOpen(!1),lp(np(p,g))},[n,s,p,o]),f=F(()=>{let g=s.value;g&&(o.dismissLoginPromptIn(g),i(g))},[s,o]),v=!!p||n.listensTo("loginRequested");return{strip:gS(t,r,!!_||u),gate:_,canStartAsGuest:_==="expired"&&!r.required,email:t.status==="loggedIn"?t.email:void 0,canLogIn:v,onLogIn:d,menuLogIn:t.status==="anonymous"&&!_&&v?d:void 0,onHidePrompt:f}}function Rm(e){let{transport:t,conversationIdSig:r}=e,n=$t("ai-agent"),o=$t(void 0),s=$t(void 0),a=B(void 0),i=F(_=>{let d=_.controlRevision,f=a.current;if(f&&f.conversationId===r.value&&d<f.revision)return;a.current={conversationId:r.value,revision:d},n.value=_.controlMode;let v=_.assignedOperatorInitials;o.value=v?{initials:v,name:_.assignedOperatorName,avatar:_.assignedOperatorAvatar}:void 0,_.controlMode!=="awaiting-operator"?s.value=void 0:_.operatorAvailable!==void 0&&(s.value=_.operatorAvailable)},[r,n,o,s]),c=F(_=>{if(_.type!=="data-control-state")return;let d=Pa(_.data);d&&i(d)},[i]),u=F(async()=>{let _=r.value,d=await t.requestOperator();d&&r.value===_&&i(d)},[t,r,i]),p=F(async()=>{let _=r.value,d=await t.cancelOperatorRequest();d&&r.value===_&&i(d)},[t,r,i]);return{controlModeSig:n,assignedOperatorSig:o,operatorAvailableSig:s,applyControlState:i,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:p}}var ss=D.cssPrefix,Em=`--${ss}-visual-viewport-height`,Mm=`--${ss}-visual-viewport-top`;function Lm(e){let{hostElement:t,mode:r,panelSize:n,isOpen:o,surfaceReady:s,onClose:a}=e;St(()=>{Vi(t,Ra(r,n,o))},[t,o,n,r]),St(()=>{if(!o||!s)return;let i=t.ownerDocument.defaultView,c=i?.visualViewport,u=t.shadowRoot?.querySelector(`.${ss}-anchor`);if(!i||!c||!u)return;let p=()=>{u.style.setProperty(Em,`${c.height}px`),u.style.setProperty(Mm,`${c.offsetTop}px`)},_=0,d=()=>{i.cancelAnimationFrame(_),_=i.requestAnimationFrame(()=>{_=i.requestAnimationFrame(p)})};return p(),c.addEventListener("resize",d),c.addEventListener("scroll",d),()=>{i.cancelAnimationFrame(_),c.removeEventListener("resize",d),c.removeEventListener("scroll",d),u.style.removeProperty(Em),u.style.removeProperty(Mm)}},[t,o,s]),H(()=>{if(r!=="modal"||!o)return;function i(c){c.composedPath().some(p=>p instanceof HTMLElement&&p.classList.contains(`${ss}-panel`))||a()}return t.addEventListener("click",i),()=>t.removeEventListener("click",i)},[t,o,r,a]),H(()=>{if(r!=="drawer"||!o)return;function i(c){c.key==="Escape"&&!c.composedPath().includes(t)&&a()}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t,o,r,a])}var Rc=te.scope("reducer"),ls=class{constructor(t,r){ee(this,"messagesSig",t);ee(this,"onReconcileNeeded",r);ee(this,"active",null);ee(this,"openTextParts",new Map);ee(this,"partSeq",0);ee(this,"replay",null);ee(this,"turnChunks",[]);ee(this,"turnRow",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,r){let n=cr();n.id=t.id;let o=vn(t)||fn(t)&&(t.status!=="streaming"||_n(t)),s=t.status==="streaming"&&_n(t)&&Bo(t);this.replay={baseline:t,shadow:n,chunks:[r],probeContinuation:o,continuationTailReplay:s,liveCatchUp:t.status==="streaming"&&!o},this.attach(n),this.apply(r)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let r=t.shadow.serverMessageId??t.baseline.serverMessageId,n=this.messagesSig.value,o=n.at(-1),s=o===t.baseline||o?.id===t.baseline.id||r!==void 0&&o?.serverMessageId===r?o:n.find(i=>i===t.baseline)??n.find(i=>i.id===t.baseline.id||r!==void 0&&i.serverMessageId===r);if(!s)return this.detach(),null;if(s===t.baseline)return t;let a=t.baseline;return t.baseline=s,Nm(a,s),t.liveCatchUp&&vn(t.shadow)&&(s.status==="streaming"||fn(s))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=vn(s)||fn(s)&&(s.status!=="streaming"||_n(s)),t.continuationTailReplay=s.status==="streaming"&&_n(s)&&Bo(s),t.liveCatchUp=s.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let r=t.serverMessageId,n=this.messagesSig.value,o=n.at(-1),s=o===t||o?.id===t.id||r!==void 0&&o?.serverMessageId===r?o:n.find(i=>i===t)??n.find(i=>i.id===t.id||r!==void 0&&i.serverMessageId===r);if(!s)return this.detach(),null;if(s===t)return t;Nm(t,s);let a=vn(t)&&fn(s);return s.status!=="streaming"&&!a?(this.detach(),null):(this.replayTurn(),this.replay?this.replay.shadow:this.active)}replayTurn(){let[t,...r]=this.turnChunks;if(t?.type!=="start")return;let n=this.messagesSig.value.find(o=>o.serverMessageId===t.messageId);if(!(n===void 0||n===this.turnRow)){this.detach();for(let o of[t,...r])this.applyResume(o)}}promoteReplay(t){let{baseline:r,shadow:n}=t;return Zt(()=>{r.role=n.role,r.serverMessageId=n.serverMessageId,r.operatorInitials=n.operatorInitials,r.status=n.status,n.canceled&&(r.canceled=!0),r.finishReason=n.finishReason,r.errorText=n.errorText,r.suggestions=n.suggestions??r.suggestions,r.runStartedAt=n.runStartedAt??r.runStartedAt,r.stepTimings=n.stepTimings??r.stepTimings,r.partsSig.value=n.partsSig.value,this.messagesSig.value=[...this.messagesSig.value]}),this.replay=null,this.active=r,r}promoteContinuation(t){let{baseline:r,chunks:n}=t,o=ka(r);return this.replay=null,Zt(()=>{r.partsSig.value=r.partsSig.value.slice(0,vS(r,n)+1),r.awaitingContinuation=!1,r.status="streaming",r.finishReason=void 0,r.errorText=void 0,r.suggestions=void 0,this.attach(r);for(let s of n)this.apply(s);r.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),r}settleOwnedContinuation(t,r){let{baseline:n}=t,o=ka(n);return this.replay=null,Zt(()=>{n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n),this.apply(r),n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}applyResume(t){t.type==="start"&&(this.turnChunks=[]);let r=this.applyTurnChunk(t);return this.turnChunks.push(t),this.turnRow=r??this.replay?.baseline??this.active??this.turnRow,r}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 s=t.messageId,a=s!==void 0?this.messagesSig.value.find(p=>p.serverMessageId===s||p.id===s):void 0;if(a!==void 0)return t.messageMetadata?.senderRole==="visitor"&&a.role==="user"&&(a.status==="pending"||a.status==="error")&&(a.serverMessageId=s,a.status="complete",a.errorText=void 0,a.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(a,t),null;let i=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(i===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!ir(c))return this.attach(c),this.apply(t),null;let u=cr();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let n=this.refreshReplayBaseline();if(!n)return null;n.chunks.push(t),t.type==="data-control-state"&&(n.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:s,probeContinuation:a,continuationTailReplay:i,liveCatchUp:c}=n,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(a){if(!bS(o,s,t)){if(u){if(o.status==="streaming"&&o.awaitingContinuation!==!0){let d=this.settleOwnedContinuation(n,t);return this.detach(),d}wS(o,s)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id})),this.detach()}return null}let _=vn(o)&&u?this.settleOwnedContinuation(n,t):this.promoteContinuation(n);return u?(_.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:_.serverMessageId??_.id}):_.continuationStreaming=!1),this.detach(),_):null}if(i&&yS(o,s)){let _=this.promoteContinuation(n);return u?(this.detach(),_):null}if(!c)return u&&this.detach(),null;if(u&&!ir(o)&&ir(s)){let _=this.promoteReplay(n);return this.detach(),_}if(!hS(o,s))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}),this.detach()),null;let p=this.promoteReplay(n);return u?(this.detach(),p):null}let r=this.refreshActive();if(!r)return null;if(this.replay)return this.applyTurnChunk(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let n=r;return n.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:n.serverMessageId??n.id}):n.continuationStreaming=!1),this.detach(),n}return null}ensureTextPart(t,r,n){let o=`${r}:${n}`,s=this.openTextParts.get(o);if(s)return s;let a={kind:r,id:`${n}#${this.partSeq++}`,textSig:ae(""),doneSig:ae(!1)};return this.openTextParts.set(o,a),ai(t,a),a}apply(t){let r=this.active;if(r)switch(t.type){case"start":{t.messageId&&(r.serverMessageId=t.messageId);let n=t.messageMetadata;n?.runStartedAt&&(r.runStartedAt=n.runStartedAt),n?.senderRole==="operator"?(r.role="operator",n.operatorInitials&&(r.operatorInitials=n.operatorInitials)):n?.senderRole==="visitor"&&(r.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":ai(r,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"message-metadata":r.stepTimings=Sa(t.messageMetadata?.steps)??r.stepTimings;return;case"finish":Rc.debug("finish",{reason:t.finishReason}),r.stepTimings=Sa(t.messageMetadata?.steps)??r.stepTimings,r.status="complete",r.retryAction=void 0,t.finishReason&&(r.finishReason=t.finishReason),this.bumpDone(r);return;case"error":Rc.warn("stream error chunk",{errorText:t.errorText}),r.status="error",r.errorText=void 0,this.bumpDone(r);return;case"abort":Rc.debug("stream abort chunk (canceled)"),r.status="complete",r.canceled=!0,r.retryAction=void 0,this.bumpDone(r);return;case"text-start":this.ensureTextPart(r,"text",t.id);return;case"text-delta":{let n=this.ensureTextPart(r,"text",t.id);n.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(r,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(r,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let n=this.ensureTextPart(r,"reasoning",t.id);n.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(r,"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":kS(r,t);return;case"file":ai(r,{kind:"file",url:t.url,mediaType:t.mediaType,filename:t.filename,fileId:t.fileId,fileSize:t.fileSize});return;case"source-url":Om(r,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Om(r,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":r.suggestions=xa(t.data);return;case"data-control-state":r.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;case"data-memory-compaction-state":return;default:{let n=t}}}bumpDone(t){Zt(()=>{t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])})}};function vn(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function Nm(e,t){e.canceled&&(t.canceled=!0),!(!vn(e)||t.status!=="streaming"&&!fn(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 r=e.partsSig.value,n=t.findIndex(i=>i.type==="start-step"),o=new Set(t.slice(0,n<0?t.length:n).flatMap(i=>"toolCallId"in i&&i.type.startsWith("tool-output")?[i.toolCallId]:[])),s=r.findLastIndex(i=>i.kind==="tool"&&(i.stateSig.value==="approval-requested"||i.stateSig.value==="approval-responded"||o.has(i.toolCallId)));if(s>=0)return s;let a=new Set(t.flatMap(i=>i.type==="tool-input-start"||i.type==="tool-input-available"?[i.toolCallId]:[]));return r.some(i=>i.kind==="tool"&&a.has(i.toolCallId))?-1:r.findLastIndex(i=>i.kind==="tool")}function hS(e,t){let r=e.partsSig.value,n=t.partsSig.value;return e.role!==t.role||n.length<r.length?!1:r.every((o,s)=>$m(o,n[s]))}function yS(e,t){let r=e.partsSig.value,n=r.findLastIndex(i=>i.kind==="tool"),o=new Set(r.slice(0,n+1).flatMap(i=>i.kind==="tool"?[i.toolCallId]:[])),s=t.partsSig.value.filter(i=>i.kind!=="tool"||!o.has(i.toolCallId)),a=r.slice(n+1);return s.length<a.length?!1:a.every((i,c)=>$m(i,s[c]))}function $m(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||!Ca(t.toolName,e.toolName)||jn[t.stateSig.value]<jn[e.stateSig.value])return!1;let r=e.approvalSig.value?.approved;return r===void 0||t.approvalSig.value?.approved===r}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 bS(e,t,r){return PS(e,r)||!xS(e,t)?!0:r.type!=="finish"&&r.type!=="error"&&r.type!=="abort"?!1:Bo(t)||e.awaitingContinuation===!0&&r.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(n=>n.kind==="step-start")}function PS(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let r=e.partsSig.value.find(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId);return r!==void 0&&jn[r.stateSig.value]<4}function xS(e,t){let r=t.partsSig.value;if(r.length===0)return!0;let n=e.partsSig.value;return n.some((o,s)=>r.every((a,i)=>SS(n[s+i],a)))}function SS(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"||Ca(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 wS(e,t){if(vn(e)||!fn(e))return!1;let r=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&r.has(o.toolCallId))}function Vr(e,t,r={}){let n=e.partsSig.value.find(s=>s.kind==="tool"&&s.toolCallId===t);if(n)return r.dynamic&&(n.dynamic=!0),n.toolMetadata??(n.toolMetadata=r.toolMetadata),n.title??(n.title=r.title),n;let o={kind:"tool",toolCallId:t,toolName:r.toolName??"tool",title:r.title,dynamic:r.dynamic?!0:void 0,toolMetadata:r.toolMetadata,inputPartialSig:ae(""),inputSig:ae(void 0),outputSig:ae(void 0),errorSig:ae(void 0),stateSig:ae("input-streaming"),approvalSig:ae(void 0)};return ai(e,o),o}function ai(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Om(e,t){e.partsSig.value.some(r=>r.kind==="source"&&r.sourceId===t.sourceId)||ai(e,t)}function kS(e,t){switch(t.type){case"tool-input-start":Vr(e,t.toolCallId,t);return;case"tool-input-delta":{let r=Vr(e,t.toolCallId);r.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let r=Vr(e,t.toolCallId,t);r.inputSig.value=t.input,r.stateSig.value="input-available";return}case"tool-input-error":{let r=Vr(e,t.toolCallId,t);r.inputSig.value=t.input,r.errorSig.value=t.errorText,r.stateSig.value="output-error";return}case"tool-approval-request":{let r=Vr(e,t.toolCallId,t);if(t.isAutomatic){r.approvalSig.value={id:t.approvalId,isAutomatic:!0};return}r.approvalSig.value={id:t.approvalId},r.stateSig.value="approval-requested";return}case"tool-approval-response":{let r=e.partsSig.value.find(n=>n.kind==="tool"&&n.approvalSig.value?.id===t.approvalId);r?.approvalSig.value&&(r.approvalSig.value={...r.approvalSig.value,approved:t.approved,reason:t.reason});return}case"tool-output-available":{let r=Vr(e,t.toolCallId,t);r.outputSig.value=t.output,r.stateSig.value="output-available";return}case"tool-output-error":{let r=Vr(e,t.toolCallId,t);r.errorSig.value=t.errorText,r.stateSig.value="output-error";return}case"tool-output-denied":{let r=Vr(e,t.toolCallId);r.stateSig.value="output-denied";return}default:return}}async function Dm(e){let t=1e3,r=!1,n=!1,o=!1;function s(){o||e.signal.aborted||(o=!0,e.onInitialBoundaryReady())}for(;!e.signal.aborted;){let a,i="held";try{i=await e.connect(()=>{if(e.signal.aborted)return;a=e.now();let c=r||n;r=!0,n=!1,o?c&&e.backfill():s()})}catch{}if(e.signal.aborted||(!r&&a===void 0&&(n=!0,s()),i==="unavailable"))return;e.onDropped?.(),a!==void 0&&e.now()-a>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var CS=120;function qm(e){let{activated:t,conversationReady:r,paused:n,conversationIdSig:o,messagesSig:s,optionsRef:a,transport:i,visitorId:c,adoptControlStateChunk:u,adoptMemoryCompactionStateChunk:p,settleSuggestions:_,recordConversationReply:d,transcriptRecoverySig:f,beginConversationTranscript:v,commitConversationTranscript:g,runCancellation:y,feedback:b,bus:P,loadInitialThread:w,shouldReconcileOnConnect:x,reconnectingSig:k}=e,h=B(0);H(()=>{if(!t||!r||n||!o.value)return;let m=o.value,S=new AbortController,A=L=>{},I=new ls(s,L=>A(L));i.primeIdentity(c,m);let R=!1,C=!1,M,N=!1,j,G=0,z,ce,pe=Date.now(),_e,se=!1,ge=!1,at=!1,st;function Ge(L,Y){if(!ir(L))return;let K=s.value.findLast(ye=>!ye.ephemeral),re=L.serverMessageId??L.id;if(!(K&&(K.serverMessageId??K.id)!==re)){if(_e&&se&&!s.value.some(ye=>ye.role==="user"&&!ye.ephemeral)){st={replyId:re,activityAt:Y};return}return wa(s.value,L,m,a.current.strings.newConversation,Y)}}function At(L,Y,K){let re=Ge(L,K);if(!re)return;let de=`${L.serverMessageId??L.id}:${Y}:${re.preview??""}`;de!==ce&&(ce=de,i.publishConversation({...re,hasUnread:!0},!0))}let Ee;function rt(){Ee&&(clearTimeout(Ee.timer),Ee=void 0)}function Mt(){let L=Ee;if(!L)return;clearTimeout(L.timer),Ee=void 0;let Y=s.value.find(K=>(K.serverMessageId??K.id)===L.replyId);Y?.role!=="assistant"&&Y?.role!=="operator"||At(Y,L.generation,L.activityAt)}function Tt(L,Y,K){rt(),Ee={replyId:L.serverMessageId??L.id,generation:Y,activityAt:K,timer:setTimeout(Mt,CS)}}function ie(L,Y,K=Date.now(),re=!0){rt();let ye=Ge(L,K);if(!ye)return;let Pe=`${L.serverMessageId??L.id}:${Y}`;Pe!==z&&(z=Pe,d(ye),re&&_e&&!se&&(ge=!0))}function Se(L,Y){(L||!y.localSendRef.current)&&y.settle(Y)}function Ue(L,Y=[],K=!1,re,ye=G,de=Date.now(),Pe=!0){let lt=a.current;if(L.canceled){ie(L,ye,de,Pe),Se(K,re);return}let ze=!0,_t=L.status==="error";switch(c_(L,_t)){case"drop":s.value=s.value.filter(je=>je!==L),ze=!1;break;case"complete-operator-routed":L.status="complete",K&&(b.play("messageReceived"),Gn(P,lt,"assistant",Qe(L)));break;case"error":{if(L.status="error",K){b.play("error");let je=new Error(_t?"stream error chunk":"empty reply");P.emit("error",je),lt.onError?.(je)}break}case"complete":L.status="complete",K&&(b.play("messageReceived"),Gn(P,lt,"assistant",Qe(L))),_(L,Y);break}ze&&ie(L,ye,de,Pe),Se(K,re)}function be(L){if(S.signal.aborted||o.value!==m)return;if(u(L),p?.(L),L.type==="start"){let ft=function(xt){return xt.role==="assistant"&&xt.retryAction?.kind==="resend-user"&&xt.retryAction.messageId===Yt};var je=ft;Mt();let Lt=L.messageId===void 0?void 0:s.value.find(xt=>xt.serverMessageId===L.messageId||xt.id===L.messageId);N=Lt!==void 0&&Lt.status!=="streaming";let Wt=j?.senderRole==="visitor"?j.messageId:void 0;j={messageId:L.messageId,senderRole:L.messageMetadata?.senderRole},G+=1,pe=Date.now(),ce=void 0,R=L.messageMetadata?.senderRole===void 0,C=!1,M=R?L.messageMetadata?.runId:void 0;let Yt=R?L.messageMetadata?.senderMessageId:void 0;if(Yt&&s.value.some(ft)&&(s.value=s.value.filter(xt=>!ft(xt))),R){let xt=L.messageId!==void 0&&s.value.some(Wr=>Wr.serverMessageId===L.messageId||Wr.id===L.messageId),Jt=s.value.at(-1),yn=L.messageId!==void 0&&(Jt?.serverMessageId===L.messageId||Jt?.id===L.messageId),bn=y.localSendRef.current&&(!xt||yn)&&Jt?.role==="assistant"&&Jt.status==="streaming"&&(yn||Jt.serverMessageId===void 0&&Jt.partsSig.value.length===0);C=y.captureStart(m,L,bn,Wt)}}let Y=R&&(L.type==="finish"||L.type==="error"||L.type==="abort"),K=Y?M:void 0,re=Y&&(C||y.ownsLocalRun(K)),ye=G,de=N;Y&&(R=!1,C=!1,M=void 0);let Pe=I.applyResume(L),lt=j?.messageId,ze=lt===void 0?void 0:s.value.find(Lt=>Lt.serverMessageId===lt||Lt.id===lt);N&&j?.senderRole!=="visitor"&&(Pe!==null||ze?.status==="streaming")&&(N=!1,de=!1);let _t=!N&&(ze?.role==="assistant"||ze?.role==="operator");if(L.type==="text-delta"&&_t&&Tt(ze,G,pe),L.type==="text-end"&&(rt(),_t&&At(ze,G,pe)),!Pe){Y&&(re||!y.localSendRef.current)&&y.settle(K);return}if(Pe.role==="operator"){de||(b.play("messageReceived"),Gn(P,a.current,"operator",Qe(Pe))),ie(Pe,ye,pe),N=!1,Y&&(re||!y.localSendRef.current)&&y.settle(K);return}Pe.role==="assistant"&&(Ue(Pe,[],re,K,ye,pe),N=!1)}async function Be(L){let Y=G,K=await i.loadConversation(m,L?{ids:[L]}:void 0).catch(()=>null);if(S.signal.aborted||o.value!==m||!K)return!1;K.controlState&&u({type:"data-control-state",data:K.controlState});let re=s.value.at(-1),ye=Y===G&&(L===void 0||re!==void 0&&(re.serverMessageId===L||re.id===L));if(K.messages.length===0)return!0;let de=s.value,Pe=L===void 0?de.at(-1):de.find(ft=>ft.serverMessageId===L||ft.id===L),lt=Ho(de,Br(K.messages)),ze=a_(K.messages),_t=lt.messages.filter(ft=>!(ft.role==="assistant"&&ft.retryAction?.kind==="resend-user"&&ze.has(ft.retryAction.messageId)));if(!lt.changed&&_t.length===lt.messages.length)return!0;s.value=_t;let je=L===void 0?_t.at(-1):_t.find(ft=>ft.serverMessageId===L||ft.id===L),Lt=Pe!==void 0&&je!==void 0&&(Pe.id===je.id||Pe.serverMessageId!==void 0&&Pe.serverMessageId===je.serverMessageId),Wt=je!==void 0&&je.status!=="streaming"&&(!Lt||Pe?.status==="streaming"),Yt=Lt&&Pe?.status==="streaming"?Date.now():je?.createdAt;return ye&&Wt&&je.role==="assistant"?Ue(je,je.suggestions??[],y.localSendRef.current,void 0,Y,Yt,!1):ye&&Wt&&je.role==="operator"?ie(je,Y,Yt,!1):ye&&je?.role==="assistant"&&je.status!=="streaming"&&_(je,je.suggestions??[]),!0}let Re=new Set;A=({messageId:L})=>{if(Re.has(L)||!s.value.some(K=>K.serverMessageId===L||K.id===L))return;Re.add(L);function Y(){return Re.delete(L)}Be(L).then(Y,Y)};function Qt(){let L=st;st=void 0;let Y=L&&s.value.find(re=>(re.serverMessageId??re.id)===L.replyId),K=Y&&Ge(Y,L.activityAt);K&&d(K)}function Pt(L=!1){if(S.signal.aborted||o.value!==m){ge=!1;return}if(_e){ge=!0;return}let Y=L?w(m):void 0,K=Y??(!L||x()?Be():void 0);if(!K)return;v(m),_e=K,se=Y!==void 0;function re(ye=!1){if(_e===K){if(_e=void 0,I.replayTurn(),ge){ge=!1,Pt();return}Qt(),ye&&g(m)}}K.then(re,()=>re(!1))}let $=f.subscribe(L=>{L<=h.current||(h.current=L,at&&Pt())});return Dm({signal:S.signal,now:()=>performance.now(),sleep:L=>en(L,S.signal),connect:L=>i.connectResumeStream({signal:S.signal,onChunk:be,onConnected:()=>{k.value=!1,L()}}),onDropped:()=>{k.value=!0},onInitialBoundaryReady:()=>{at=!0,Pt(!0)},backfill:()=>Pt()}),()=>{S.abort(),k.value=!1,rt(),$(),I.detach()}},[t,r,n,o,o.value,c,i,u,p,_,d,f,v,g,y,s,P,b,w,x,k])}var TS=32;function Um(e){let{transport:t,setStreaming:r}=e,n=B(void 0),o=B(void 0),s=B(!1),a=B(void 0),i=B(!1),c=B(new Map),u=B(new Set),p=F((k,h)=>{let m=`${k}:${h}`;a.current!==m&&(a.current=m,t.cancelTurn(k,h))},[t]),_=F(k=>{n.current=void 0,o.current=k,s.current=!1,a.current=void 0,i.current=!0,r(!0)},[r]),d=F((k,h)=>{c.current.set(k,{messageId:h})},[]),f=F(k=>{if(k!==void 0){u.current.add(k);let h=u.current.values().next().value;u.current.size>TS&&h!==void 0&&u.current.delete(h)}k!==void 0&&n.current?.runId!==k||(n.current=void 0,o.current=void 0,s.current=!1,i.current=!1,r(!1))},[r]),v=F((k,h)=>o.current!==k?h.runId&&n.current?.runId===h.runId?(n.current={conversationId:h.conversationId,runId:h.runId},s.current&&p(h.conversationId,h.runId),!0):!1:(o.current=void 0,h.runId?(n.current={conversationId:h.conversationId,runId:h.runId},r(!0),s.current&&p(h.conversationId,h.runId),!0):(f(),!0)),[p,r,f]),g=F((k,h)=>{let m=c.current.get(k);return m?(c.current.delete(k),!h.runId||u.current.has(h.runId)?!0:m.runId!==void 0?(m.runId!==h.runId||n.current?.runId===h.runId&&(n.current={conversationId:h.conversationId,runId:h.runId},s.current&&p(h.conversationId,h.runId)),!0):(i.current||o.current||(n.current={conversationId:h.conversationId,runId:h.runId},o.current=void 0,s.current=!1,a.current=void 0,i.current=!0,r(!0)),!0)):!1},[p,r]),y=F(k=>o.current!==k?!1:(f(),!0),[f]),b=F(k=>{let h=c.current.get(k);return h?(c.current.delete(k),h.runId===void 0):!1},[]),P=F((k,h,m,S)=>{let A=h.messageMetadata?.runId;if(h.messageMetadata?.senderRole!==void 0||typeof A!="string"||!A||u.current.has(A))return!1;if(n.current?.runId===A)return i.current;if(i.current)return n.current||!m?!1:(o.current=void 0,n.current={conversationId:k,runId:A},r(!0),s.current&&p(k,A),!0);let R=[...c.current.values()].filter(C=>C.runId===void 0).find(C=>C.messageId===S);return R?(R.runId=A,n.current={conversationId:k,runId:A},o.current=void 0,s.current=!1,a.current=void 0,i.current=!0,r(!0),!0):(o.current=void 0,n.current={conversationId:k,runId:A},r(!0),s.current&&p(k,A),i.current)},[p,r]),w=F(k=>typeof k=="string"&&n.current?.runId===k&&i.current,[]),x=F(()=>{let k=n.current;if(k)return s.current=!0,p(k.conversationId,k.runId),!0;let h=o.current;return h?(s.current=!0,h.then(m=>{m.runId&&p(m.conversationId,m.runId)}).catch(()=>{}),!0):!1},[p]);return ke(()=>({localSendRef:i,begin:_,beginRouted:d,acceptAck:v,acceptRoutedAck:g,reject:y,rejectRouted:b,captureStart:P,ownsLocalRun:w,settle:f,stop:x}),[v,g,_,d,P,w,y,b,f,x])}var IS=te.scope("send");function Hm(e,t,r,n,o){e.publishConversation({...wa(t,r,n,o),hasUnread:!1},!0)}function Fm(e,t){return e.id===t.id||(e.serverMessageId??e.id)===(t.serverMessageId??t.id)}function jm(e){return e.findLast(t=>!t.ephemeral&&t.role!=="system"&&(t.role==="user"||t.status!=="streaming"||ir(t)))}function si(e,t,r,n,o){let s=jm(t);s?.role!=="user"||!Fm(s,r)||Hm(e,t,s,n,o)}function Bm(e){return e instanceof De&&e.status===404&&e.errorCode==="CONVERSATION_NOT_FOUND"}function zm(e){return!(e instanceof De)||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 Vm(e){let{transport:t,messagesSig:r,conversationIdSig:n,options:o,bus:s,feedback:a,persistence:i,visitorId:c,adoptConversationId:u,applyControlState:p,setTicket:_,settleSuggestions:d,runCancellation:f,onConversationNotFound:v}=e,g=F(()=>{let P=n.value??Gt();return n.value||(n.value=P,i.saveConversationId(P)),P},[n,i]),y=F(async({continueExisting:P,turn:w,movedFromConversation:x=!1})=>{let k=g(),h=r.value.at(-1),m=w?[w]:r_(r.value,P),S=m[0];S?.role==="user"&&Ot.markSent(S.id);let A=m.map(rc),I=i.loadUserPrefs(),R=vo(o.tools).then(C=>t.sendTurn(Jl({messages:A,conversationId:k,visitorId:c,userPrefs:I,clientTools:rl(C)}),{keepalive:P}));f.begin(R);try{let C=await R;if(n.value!==k||!f.acceptAck(R,C))return!1;if(u(C.conversationId),_({conversationId:C.conversationId,reference:C.ticketReference}),C.runId&&S?.role==="user"&&si(t,r.value,S,C.conversationId,o.strings.newConversation),!C.runId){let M=await t.loadConversation(C.conversationId).catch(()=>null);if(n.value!==C.conversationId)return!0;if(M){M.controlState&&p(M.controlState);let N=Br(M.messages),{messages:j,changed:G}=Ho(r.value,N);G&&(r.value=j);let z=N.findLast(_e=>!_e.ephemeral&&_e.role!=="system"),ce=jm(r.value);ce&&z&&Fm(ce,z)&&Hm(t,r.value,ce,C.conversationId,o.strings.newConversation);let pe=h?r.value.find(_e=>_e.id===h.id&&_e.role==="assistant"&&_e.status!=="streaming"):void 0;pe&&d(pe,pe.suggestions??[]),!P&&h?.role==="assistant"&&r.value.includes(h)&&h.serverMessageId===void 0&&!ir(h)&&(r.value=r.value.filter(_e=>_e!==h))}else h?.role==="assistant"&&r.value.includes(h)&&(h.status="error",h.errorText=o.strings.errorGeneric,P?h.retryAction={kind:"continue-assistant",messageId:h.serverMessageId??h.id}:h.retryAction=S?.role==="user"?{kind:"resend-user",messageId:S.id}:null,r.value=[...r.value])}return!0}catch(C){if(n.value!==k)return!1;if(!f.reject(R))return S?.role==="user"&&si(t,r.value,S,k,o.strings.newConversation),!0;if(!P&&!x&&S?.role==="user"&&Bm(C))return v(S);if(!P&&S?.role==="user"&&C instanceof De&&C.status===401){let G=h?.role==="assistant"&&h.serverMessageId===void 0?h:void 0;return r.value=r.value.filter(z=>z!==S&&z!==G),i.saveDraft(k,Qe(S)),!1}let M=wr(C,o.strings),N=zm(C),j=w?.role==="assistant"?w:r.value.at(-1);if(P&&j?.role==="assistant"&&C instanceof De&&C.status===409){let G=j.serverMessageId??j.id,z=await t.loadConversation(k,{ids:[G]}).catch(()=>null);if(n.value!==k)return!1;if(z){z.controlState&&p(z.controlState);let ce=Br(z.messages),pe=ce.find(_e=>(_e.serverMessageId??_e.id)===G);if(pe&&s_(j,pe)){let{messages:_e,changed:se}=Ho(r.value,ce),ge=_e.find(at=>(at.serverMessageId??at.id)===G);if(se&&ge&&ge!==j)return ge.awaitingContinuation=!1,ge.continuationStreaming=void 0,ge.retryAction=null,r.value=_e,ge.status!=="streaming"&&d(ge,ge.suggestions??[]),!0}}if(!r.value.includes(j)||j.status!=="streaming")return!1;j.continuationStreaming=!0}if(P&&j?.role==="assistant")j.status="error",j.errorText=M,j.retryAction=N?{kind:"continue-assistant",messageId:j.serverMessageId??j.id}:null,r.value=[...r.value];else if(h?.role==="assistant"&&r.value.includes(h)){h.status="error",h.errorText=M;let G=m[0];h.retryAction=N&&G?.role==="user"?{kind:"resend-user",messageId:G.id}:null,r.value=[...r.value]}else{let G=cr();G.status="error",G.errorText=M;let z=m[0];G.retryAction=N&&z?.role==="user"?{kind:"resend-user",messageId:z.id}:null,r.value=[...r.value,G]}return a.play("error"),s.emit("error",C),o.onError?.(C),!1}},[t,r,o,s,a,i,c,u,p,_,d,g,f,v]),b=F(async P=>{let w=g();P.status="pending",P.errorText=void 0,P.retryAction=void 0,r.value.includes(P)&&(r.value=[...r.value]),Ot.markSent(P.id);let x=[rc(P)],k=i.loadUserPrefs(),h=vo(o.tools).then(m=>t.sendTurn(Jl({messages:x,conversationId:w,visitorId:c,userPrefs:k,clientTools:rl(m)})));f.beginRouted(h,P.id);try{let m=await h;return n.value!==w?(f.rejectRouted(h),!1):f.acceptRoutedAck(h,m)?(u(m.conversationId),_({conversationId:m.conversationId,reference:m.ticketReference}),si(t,r.value,P,m.conversationId,o.strings.newConversation),P.status==="pending"&&(P.status="complete",r.value.includes(P)&&(r.value=[...r.value])),!0):!1}catch(m){let S=f.rejectRouted(h);if(n.value!==w)return!1;if(!S)return si(t,r.value,P,w,o.strings.newConversation),P.status==="pending"&&(P.status="complete",r.value.includes(P)&&(r.value=[...r.value])),!0;if(P.status!=="pending")return si(t,r.value,P,w,o.strings.newConversation),!0;if(Bm(m))return v(P);IS.debug("operator-routed send failed",{error:m});let A=m instanceof Error?m:new Error(String(m));return P.status="error",P.errorText=wr(m,o.strings),P.retryAction=zm(m)?{kind:"resend-user",messageId:P.id}:null,r.value.includes(P)&&(r.value=[...r.value]),a.play("error"),s.emit("error",A),o.onError?.(A),!1}},[t,r,o,s,a,i,c,u,_,g,f,v]);return{sendAiTurn:y,sendRoutedTurn:b}}var AS=te.scope("unread");function Wm(e){let{transport:t,options:r,conversationIdSig:n,isConversationVisibleRef:o,activated:s,conversationReady:a}=e,i=$t(!1),c=$t(0),u=$t(0),p=B([]),_=B(void 0),d=B(!1),f=B(!1),v=F(()=>{let m=n.value,S=o.current()&&_.current===m?m:void 0,A=p.current.filter(I=>I.hasUnread&&I.conversationId!==S).length;c.value=A,i.value=A>0},[n,i,c,o]),g=F(m=>{let S=n.value,A=p.current.find(M=>M.conversationId===S),I=xr(p.current,m),R=I.find(M=>M.conversationId===S),C=m.type==="snapshot"&&S!==void 0&&R?.hasUnread===!0&&_.current===S&&A!==void 0&&A.lastMessageAt!==R.lastMessageAt;C&&(_.current=void 0),p.current=I,v(),C&&(u.value+=1)},[n,v,u]),y=F(()=>{if(v(),!o.current())return;let m=n.value;if(!m||_.current!==m)return;let S=p.current.find(A=>A.conversationId===m);S?.hasUnread&&t.markRead(m,S.lastMessageAt)},[n,o,v,t]),b=F(m=>{n.value===m&&(_.current=void 0,v())},[n,v]),P=F(m=>{n.value===m&&(_.current=m,y())},[n,y]),w=F(m=>_.current===m,[]),x=F((m=!1)=>{if(!r.history.enabled||!r.modules.list.some(A=>A.layout==="chat"))return;function S(A){if(d.current){A&&(f.current=!0);return}d.current=!0,t.listConversations({limit:50},A).then(I=>{A||g({type:"snapshot",result:I,requestedRevision:0}),y()}).catch(I=>AS.debug("refreshUnread failed (non-fatal)",{err:I})).finally(()=>{d.current=!1,f.current&&(f.current=!1,S(!0))})}S(m)},[g,y,r.history.enabled,r.modules,t]),k=F(m=>{let S=m.conversationId,A=o.current()&&n.value===S&&_.current===S,I=p.current.find(C=>C.conversationId===S),R=A&&(I?.lastMessageAt!==m.lastMessageAt||I.hasUnread);t.publishConversation({...m,hasUnread:!A},!0),R&&t.markRead(S,m.lastMessageAt)},[n,o,t]);H(()=>t.subscribeConversationChanges(g),[g,t]);let h=B(!1);return H(()=>{!s||!a||h.current||(h.current=!0,x())},[s,a,x]),H(()=>{if(!s)return;function m(){document.visibilityState==="visible"&&(y(),x(!0))}return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[s,y,x]),{hasUnreadSig:i,unreadCountSig:c,transcriptRecoverySig:u,markVisibleConversationRead:y,beginConversationTranscript:b,commitConversationTranscript:P,isConversationTranscriptCommitted:w,recordConversationReply:k,refreshUnread:x}}var li=te.scope("settings");function Gm(e){let{options:t,persistence:r,transport:n,feedback:o,hostElement:s,bus:a}=e,i=r.loadUserPrefs(),[c,u]=U(()=>i.locale??t.locale),[p,_]=U(i.themeMode),d=_o(t.themeMode,p),[f,v]=U(()=>i.textSize??t.textSize),g=F(k=>{r.patchUserPrefs(k),n.saveUserPrefs(r.loadUserPrefs()).catch(h=>li.warn("saveUserPrefs failed",{err:h}))},[r,n]);H(()=>{i.soundMuted!==void 0&&o.setMuted(i.soundMuted)},[]),H(()=>{if(d!=="host"){s.dataset.theme=d;return}return wu(k=>{s.dataset.theme=k})},[s,d,t]),H(()=>{s.dataset.textSize=f},[s,f,t]),H(()=>{let k=!0;return o.mutedSig.subscribe(h=>{if(k){k=!1;return}g({soundMuted:h})})},[o,g]);let y=En(c,t.availableLocales,t.defaultLocale);H(()=>{n.setLocale(y)},[n,y]),H(()=>{s.dir=Si(y)?"rtl":"ltr"},[s,y]),H(()=>{y!==c&&u(y)},[y,c]);let b=F(k=>{li.info("localeChange",{locale:k}),u(k),g({locale:k}),a.emit("localeChange",k)},[g,a]),P=F(k=>{li.info("themeChange",{mode:k}),_(k),s.dataset.theme=k,g({themeMode:k}),a.emit("themeChange",k)},[s,g,a]),w=F(k=>{li.info("textSizeChange",{size:k}),v(k),s.dataset.textSize=k,g({textSize:k}),a.emit("textSizeChange",k)},[s,g,a]),x=F(()=>{o.toggleMuted();let k=o.mutedSig.value;li.info("soundToggle",{muted:k}),a.emit("soundToggle",{muted:k})},[o,a]);return{activeLocale:c,activeThemeMode:d,activeTextSize:f,setActiveLocale:u,setActiveThemeMode:_,setActiveTextSize:v,patchAndSync:g,handleLocaleChange:b,handleThemeChange:P,handleTextSizeChange:w,handleSoundToggle:x}}var Ie=te.scope("app"),ci=D.cssPrefix,RS={home:"home",chats:"chat",help:"help",news:"news"};function Qm({options:e,hostElement:t,bus:r,recentHostEvents:n,loginRevision:o=0,onPersonChanged:s,onStartAsGuest:a}){let i=e.aiAgentDeploymentId;if(!i)throw new Error("aiAgentDeploymentId is required");let[c]=U(()=>Dr(e.widgetId,e.storage,e.aiAgentDeploymentId)),[u,p]=U(()=>c.getVisitorId()),_=c.loadUserPrefs(),d=$t(c.loadConversationId()),f=B(d.value!==void 0),v=$t(d.value??""),g=$t([]),y=$t(!1),[b,P]=U(!1),w=B(void 0);function x(){let T=e.modules.list,O=new Set(T.map(ne=>ne.id)),X=c.loadActiveModule();return X&&O.has(X)?X:T[0]?.id??""}function k(){return e.modules.list.find(T=>T.layout==="chat")?.id}function h(){let T=k();return T?e.modules.list.length===1?!0:S.sig.value.activeTab===T:!1}let m=B(void 0);if(!m.current){let T=e.modules.list.map(X=>X.id),O=c.loadActiveModule()??T[0]??"";m.current=C_(O,O?[...T,O]:T,X=>c.saveActiveModule(X))}let S=m.current,A=It(()=>S.sig.value.activeTab).value,I=It(()=>d.value).value,[R,C]=U(!1),[M,N]=U(!1),j=e.mode==="standalone"||e.mode==="inline",G=B(Wo(e,Kn(),c.loadPanelOpen(),c.loadPanelSize())),[z,ce]=U(G.current.panelOpen),[pe,_e]=U(G.current.panelOpen),se=B(void 0),ge=B(void 0),at=B(!1),st=B(void 0),Ge=B(e.strings),At=B(void 0);H(()=>{z&&_e(!0)},[z]);let Ee=B(!1),[rt,Mt]=U(!1),Tt=B(null),ie=B(!1),{dismissed:Se,dismissCallout:Ue}=Im({callout:e.launcher.callout,persistence:c}),be=e.launcher.callout?.persistent??!0,Be=F(()=>{Ie.info("calloutDismiss"),r.emit("calloutDismiss",void 0),Ue()},[r,Ue]),[Re,Qt]=U(G.current.panelSize),Pt=B(!1),[$,L]=U("chat"),Y=B(()=>!1);Y.current=()=>z&&$==="chat"&&!document.hidden&&h();let[K,re]=U(!1),ye=B(K);ye.current=K;let de=B(null),[Pe,lt]=U(!1),ze=$t(new Map),_t=F((T,O)=>{let X=new Map(ze.value);O?X.set(T,O):X.delete(T),ze.value=X},[ze]),[je,Lt]=U(null),[Wt,Yt]=U(),[ft,xt]=U([]),Jt=B(e);Jt.current=e;let[yn,bn]=U(void 0),[Wr,Pn]=U(void 0),[Gr,ui]=U(()=>c.loadSidebarCollapsed()??!1),[Kr,xn]=U({status:"anonymous"}),[fs,pi]=U({}),[V,J]=U(),[Q]=U(()=>new Ia({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ku({publicKey:e.publicKey,aiAgentDeploymentId:i,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints,recentHostEvents:n,onLoginState:xn,continueLink:e.continueLink})),[fe]=U(()=>new ea(e.sound,e.haptics)),Oe=Um({transport:Q,setStreaming:re}),{activeLocale:Rt,activeThemeMode:pr,activeTextSize:_r,setActiveLocale:Ht,setActiveThemeMode:ms,setActiveTextSize:ig,patchAndSync:$c,handleLocaleChange:ag,handleThemeChange:sg,handleTextSizeChange:lg,handleSoundToggle:cg}=Gm({options:e,persistence:c,transport:Q,feedback:fe,hostElement:t,bus:r}),{controlModeSig:sr,assignedOperatorSig:dg,operatorAvailableSig:ug,applyControlState:oo,adoptControlStateChunk:pg,requestOperator:_g,cancelOperatorRequest:fg}=Rm({transport:Q,conversationIdSig:d}),Ir=$t(new Map),mg=F(T=>{if(T.type!=="data-memory-compaction-state")return;let O=d.value;if(!O)return;let X=e_(T.data);if(!X)return;let ne=Ir.value.get(O);if(ne&&(X.postFinishSequence<ne.postFinishSequence||X.postFinishSequence===ne.postFinishSequence&&(ne.status==="ready"||ne.status===X.status)))return;let me=new Map(Ir.value);me.set(O,X),Ir.value=me},[d,Ir]),{hasUnreadSig:gg,unreadCountSig:Dc,transcriptRecoverySig:vg,markVisibleConversationRead:qc,beginConversationTranscript:gs,commitConversationTranscript:Sn,isConversationTranscriptCommitted:Uc,recordConversationReply:hg,refreshUnread:yg}=Wm({transport:Q,options:e,conversationIdSig:d,isConversationVisibleRef:Y,activated:pe,conversationReady:R}),vs=Am({state:Kr,deployment:fs,bus:r,persistence:c,conversationIdSig:d}),bg=z&&e.modules.byId[A]?.layout==="home",Pg=Tm({transport:Q,options:e,persistence:c,enabled:R&&bg});H(()=>{qc()},[A,z,$,I,qc]),H(()=>{fe.update(e.sound,e.haptics)},[fe,e.sound,e.haptics]),H(()=>()=>fe.destroy(),[fe]),H(()=>{Pt.current||!e.size.initialSize||(Pt.current=!0,!c.loadPanelSize()&&Qt(uc(e.mode,e.size,Kn())))},[e.mode,e.size,c]),H(()=>{if(!R||Ee.current)return;Ee.current=!0;let T=Wo(e,Kn(),c.loadPanelOpen(),c.loadPanelSize());ce(T.panelOpen),Qt(T.panelSize)},[R,e,c]);let wn=B(null);H(()=>{R&&S.reconcile(e.modules.list.map(T=>T.id),x())},[R,e.modules.list,S]);let _i=F(T=>{!T||T.length===0||(g.value=T.map(O=>ec({...O,text:gt(Ge.current,O.text)})))},[g]),io=B(0),fr=B(0),hs=F(T=>{if(T===d.value)return;let O=d.value;fr.current++,P(!1),O&&(c.saveDraft(T,c.loadDraft(O)),c.saveDraft(O,""),c.saveMessageQueue(T,c.loadMessageQueue(O)),c.saveMessageQueue(O,[])),d.value=T,c.saveConversationId(T),Q.primeIdentity(void 0,T),Ie.info("conversation rebound",{previous:O,current:T}),O&&r.emit("conversationRebound",{previous:O,current:T})},[r,d,c,Q]),fi=F(T=>{let O=T.map(me=>me.createdAt).filter(me=>me!==void 0),X=(O.length?Math.min(...O):Date.now())-1;return[...(st.current?.messages??[]).map(me=>{let Z=ec({...me,text:gt(Ge.current,me.text)});return Z.createdAt=X,Z}),...T]},[]),Bc=F(async T=>{let O=fr.current;function X(){return O!==fr.current||d.value!==T}ge.current===T&&(ge.current=void 0),P(!0);try{let ne=await Q.loadConversation(T);if(X())return!1;let me=Br(ne.messages),Z=fi(ac(me,g.value));if(g.value=Z,ge.current=Z.some(Ae=>Ae.role==="user")?void 0:T,me.length>0||ne.controlState!==void 0){Yt({conversationId:T,reference:ne.ticketReference}),ne.controlState&&oo(ne.controlState);let Ae=me.findLast(qe=>qe.role==="assistant"&&!qe.ephemeral);xt(Ae?.suggestions??[])}return!0}catch(ne){return X()||(Ie.warn("loadThread failed; keeping conversation active",{err:ne,conversationId:T}),r.emit("error",ne),Jt.current.onError?.(ne)),!1}finally{X()||P(!1)}},[Q,g,d,fi,r]),xg=F(T=>{if(se.current===T)return se.current=void 0,Bc(T)},[Bc]),Sg=F(()=>{if(w.current)return Promise.resolve(void 0);let T=d.value,O=g.value.find(le=>le.serverMessageId!==void 0),X=O?.serverMessageId,ne=O?new Date(O.createdAt).toISOString():void 0;if(!T||!X||!ne)return Promise.resolve(void 0);let me=fr.current,Z={};return w.current=Z,(async()=>{try{let le=await Q.loadConversation(T,{beforeId:X,beforeCreatedAt:ne});if(w.current!==Z||fr.current!==me||d.value!==T)return;if(le.messages.length===0)return!1;let Ae=le.messages.map(tc),qe=g.value,gr=o_(qe,Ae);if(gr!==qe){let Je=Math.min(...Ae.map(He=>He.createdAt??1/0));if(Number.isFinite(Je))for(let He of qe){if(!He.ephemeral)break;(He.createdAt??1/0)>=Je&&(He.createdAt=Je-1)}g.value=gr}return!0}catch(le){if(w.current!==Z||fr.current!==me||d.value!==T)return;Ie.warn("load previous messages failed",{err:le,conversationId:T,beforeId:X}),r.emit("error",le),e.onError?.(le);return}finally{w.current===Z&&(w.current=void 0)}})()},[r,d,g,e,Q]),kn=F(async({newConversation:T})=>{let O=++io.current;function X(){return O!==io.current}if(!T){let Je=await Q.userSub(),He=c.loadLastUserSub();if(X())return;if(He&&He!==Je){s?.();return}Je&&c.saveLastUserSub(Je)}let ne=d.value,me=T||!ne?Gt():ne;me!==ne&&(fr.current++,P(!1),Zt(()=>{d.value=me,v.value=me}),c.saveConversationId(me)),Q.primeIdentity(u,me);let Z;try{Z=await Q.handshake({visitorId:u,conversationId:me,userPrefs:c.loadUserPrefs(),locale:Rt})}catch(Je){if(X())return;r.emit("error",Je),e.onError?.(Je);let He=Je instanceof De&&Je.errorCode?MS[Je.errorCode]:void 0;if(He){Ie.warn(`the widget is not shown: ${He}`),(j||e.mode==="page")&&N(!0);return}T||C(!0);return}if(X())return;e.continueLink&&Z.visitorId!==u&&p(Z.visitorId),Z.conversationId!==me&&hs(Z.conversationId),At.current=Z;let le=Yr(Z,Rt);Lt(le.agent),pi(ta(Z.config?.login));let Ae=Z.config?.maxMessageCharacters;J(typeof Ae=="number"&&Ae>0?Ae:void 0),le.site&&kl(le.site)?bn(le.site):le.site&&Ie.warn("invalid site config, using fallback",{site:le.site}),le.blocks&&Cl(le.blocks)?Pn(le.blocks):le.blocks&&Ie.warn("invalid blocks config, using fallback",{blocks:le.blocks});let qe=_l(Z.userPrefs);if(Object.keys(qe).length>0&&!T&&(c.saveUserPrefs(qe),qe.locale&&Ht(qe.locale),qe.soundMuted!==void 0&&fe.setMuted(qe.soundMuted),qe.themeMode&&ms(qe.themeMode),qe.textSize&&ig(qe.textSize)),st.current=le.welcome,T||r.emit("handshake",Z),le.welcome?.suggestions){let Je=Ge.current;xt(le.welcome.suggestions.map(He=>({...He,label:gt(Je,He.label),...He.text===void 0?{}:{text:gt(Je,He.text)}})))}let gr=!T&&(Z.conversationId===ne||e.continueLink!==void 0);f.current=gr,gr?at.current||(se.current=Z.conversationId):(ge.current=Z.conversationId,_i(le.welcome?.messages),Sn(Z.conversationId)),T||C(!0)},[Q,u,c,e,r,d,v,fe,_i,Rt,hs,Sn,s]),ao=JSON.stringify(e.userContext??null),wg=JSON.stringify(e.pageContext??null);H(()=>{Q.setContext(e.userContext,ES(e.pageContext))},[Q,ao,wg]);let zc=B(!1);H(()=>{if(Q.setUserToken(e.userToken),!zc.current){zc.current=!0;return}kn({newConversation:!1}).then(()=>{pe&&yg(!0)})},[Q,e.userToken,o]);let Hc=F((T,O=[])=>xt(T.suggestions??O),[]);H(()=>(Q.primeIdentity(u,d.value),kn({newConversation:!1}),()=>{io.current++,fr.current++}),[]),H(()=>{!pe||!R||at.current||(at.current=!0,se.current===d.value&&P(!0))},[pe,R]);let Fc=B(ao);H(()=>{!R||Fc.current===ao||(Fc.current=ao,kn({newConversation:!1}))},[ao,R,kn]);let jc=B(async()=>!1),{sendAiTurn:mr,sendRoutedTurn:Cn}=Vm({onConversationNotFound:T=>jc.current(T),transport:Q,messagesSig:g,conversationIdSig:d,options:e,bus:r,feedback:fe,persistence:c,visitorId:u,adoptConversationId:hs,applyControlState:oo,setTicket:Yt,settleSuggestions:Hc,runCancellation:Oe}),{toolInteraction:kg,pageToolsRunning:ys,stopPageTools:Vc}=Cm({streaming:K,controlModeSig:sr,messagesSig:g,sendAiTurn:mr,bus:r,humanInLoop:e.features.humanInLoop,tools:e.tools}),Cg=F((T,O)=>{let X=g.value.find(ne=>ne.serverMessageId===T);X&&(X.feedback=O),Ie.info("messageFeedback",{messageId:T,value:O}),r.emit("messageFeedback",{messageId:T,value:O}),Q.submitFeedback({messageId:T,value:O})},[r,g,Q]),Tg=F(()=>f.current||g.value.some(T=>!T.ephemeral&&T.role==="user"),[g]);qm({activated:pe,conversationReady:R,paused:Kr.status==="pending"||Kr.status==="expired",conversationIdSig:d,messagesSig:g,optionsRef:Jt,transport:Q,visitorId:u,adoptControlStateChunk:pg,adoptMemoryCompactionStateChunk:mg,settleSuggestions:Hc,recordConversationReply:hg,transcriptRecoverySig:vg,beginConversationTranscript:gs,commitConversationTranscript:Sn,runCancellation:Oe,feedback:fe,bus:r,loadInitialThread:xg,shouldReconcileOnConnect:Tg,reconnectingSig:y});let Tn=F(async(T,O,X)=>{if(de.current||vs.gate)return!1;let ne=d.value,me=ne?Ir.value.get(ne):void 0,Z=sr.value!=="ai-agent";if(!Z&&me?.status==="compacting"||(Ie.info("send",{textLen:T.length,attachments:O.length,streaming:ye.current,routedToOperator:Z}),ye.current&&!Z))return!1;let le=new AbortController,Ae={conversationId:ne,controller:le};de.current=Ae,lt(!0);try{fe.unlock(),ze.value=new Map;let qe=await NS(Q,O,le.signal,_t,Ts=>{le.signal.aborted||(Ie.warn("upload failed",{err:Ts}),r.emit("error",Ts),e.onError?.(Ts))});if(le.signal.aborted||d.value!==ne)return!1;let gr=ne?Ir.value.get(ne):void 0,Je=sr.value!=="ai-agent";if(!Je&&gr?.status==="compacting"||ye.current&&!Je||!X&&qe.length<O.length||!T&&qe.length===0)return!1;r.emit("send",{text:T,attachmentCount:O.length}),ft.length>0&&xt([]),fe.play("messageSent");let He=Zl(T,qe,X);return Gn(r,e,"user",T),Je?(g.value=[...g.value,He],X?await Cn(He):(Cn(He),!0)):(g.value=[...g.value,He,cr()],X?await mr({continueExisting:!1}):(mr({continueExisting:!1}),!0))}finally{de.current===Ae&&(de.current=null,lt(!1))}},[Q,r,e,ft.length,g,d,Ir,mr,Cn,sr,ze,_t,vs.gate]),bs=B(Tn);bs.current=Tn;let Wc=d.value,Gc=(Wc?Ir.value.get(Wc):void 0)?.status==="compacting",mi=sr.value==="ai-agent",Ig=It(()=>{let T=g.value.at(-1);return T?.role==="assistant"&&T.partsSig.value.some(O=>O.kind==="tool"&&(O.stateSig.value==="approval-requested"||O.stateSig.value==="approval-responded"))}),Kc=It(()=>g.value.some(T=>T.retryAction?.kind==="resend-user"||T.retryAction?.kind==="continue-assistant"));St(()=>{let T=d.value;return()=>{let O=de.current;!O||O.conversationId!==T||(de.current=null,lt(!1),O.controller.abort())}},[d.value]);let Ag=F(()=>{if(de.current){Ie.info("stop uploads"),de.current.controller.abort();return}if(ys){Ie.info("stop page tools"),r.emit("stop",void 0),Vc();return}if(!Oe.stop())return;Ie.info("stop"),r.emit("stop",void 0);let T=g.value.at(-1);T&&T.role!=="user"&&T.status==="streaming"&&(T.canceled=!0,g.value=[...g.value])},[Oe,r,g,ys,Vc]),Rg=F(T=>{Ie.info("card action",{text:T}),bs.current(T,[])},[]),Eg=F(T=>{if(K)return;let O=g.value,X=Ta(O,T);if(X)switch(Ie.info("retry",{kind:X.kind,messageId:X.messageId}),X.kind){case"continue-assistant":{if(sr.value!=="ai-agent"||T.role!=="assistant"||(T.serverMessageId??T.id)!==X.messageId)return;T.status="streaming",T.errorText=void 0,T.retryAction=void 0,T.awaitingContinuation=!0,g.value=[...O],mr({continueExisting:!0,turn:T});return}case"resend-user":{let ne=O.find(le=>le.role==="user"&&le.id===X.messageId);if(!ne)return;let me=le=>{le&&wn.current?.acceptQueuedMessage(X.messageId)};if(ne.status="complete",ne.errorText=void 0,ne.retryAction=void 0,sr.value!=="ai-agent"){g.value=T.role==="assistant"?O.filter(le=>le!==T):[...O],Cn(ne).then(me);return}let Z=cr();g.value=T.role==="assistant"?O.map(le=>le===T?Z:le):[...O,Z],mr({continueExisting:!1,turn:ne}).then(me);return}case"repeat-user":{let ne=O.find(Ae=>Ae.role==="user"&&Ae.id===X.messageId);if(!ne)return;let me=Zl(Qe(ne),ne.attachments?.map(Ae=>({...Ae}))??[]),Z=new Set(me.attachments?.flatMap(Ae=>Ae.url?[Ae.url]:[])??[]),le=ne.partsSig.value.flatMap(Ae=>Ae.kind==="file"&&!Z.has(Ae.url)?[{...Ae}]:[]);if(le.length>0&&(me.partsSig.value=[...me.partsSig.value,...le]),sr.value!=="ai-agent"){g.value=[...O,me],Cn(me);return}g.value=[...O,me,cr()],mr({continueExisting:!1,turn:me});return}default:return X}},[K,g,sr,mr,Cn]),gi=F(()=>{if(w_(e.mode,Re)==="exit-fullscreen"){Ie.info("close \u2192 exit-fullscreen",{mode:e.mode}),Qt("normal"),r.emit("fullscreen",!1);return}Ie.info("close \u2192 panel closed",{mode:e.mode}),ie.current=t.contains(t.ownerDocument.activeElement),ce(!1),c.savePanelOpen(!1),r.emit("close",void 0),e.onClose?.()},[r,e,c,Re,t]);Lm({hostElement:t,mode:e.mode,panelSize:Re,isOpen:z,surfaceReady:R,onClose:gi}),H(()=>{z||!ie.current||(ie.current=!1,Tt.current?.focus())},[z]);let so=F(()=>{Ie.info("open",{mode:e.mode}),fe.unlock(),Mt(!0),ce(!0),c.savePanelOpen(!0),!Se&&!be&&Be(),setTimeout(()=>Mt(!1),LS),r.emit("open",void 0),e.onOpen?.()},[r,e,fe,c,Se,be,Be]),vi=F(()=>{let T=g.value.some(O=>O.role==="user");if(ge.current===d.value&&!T&&d.value){Ie.info("clear \u2192 reusing empty conversation",{conversationId:d.value}),g.value.length===0&&_i(st.current?.messages);return}return Ie.info("clear \u2192 new conversation",{wasStreaming:K}),r.emit("clear",void 0),Oe.settle(),f.current=!1,se.current=void 0,ge.current=void 0,Zt(()=>{g.value=[],d.value=void 0,oo({controlMode:"ai-agent",controlRevision:0})}),c.clearConversation(),xt([]),kn({newConversation:!0})},[K,g,d,c,kn,r,_i,Oe,oo]);jc.current=async T=>(Ie.info("conversation not found \u2192 new conversation",{messageId:T.id}),await vi(),T.status="complete",T.errorText=void 0,T.retryAction=void 0,g.value=[...g.value,T,cr()],mr({continueExisting:!1,turn:T,movedFromConversation:!0}));let hi=F(()=>{let T=vi();L("chat");let O=e.modules.list.find(X=>X.layout==="chat")?.id;return O&&S.switchTab(O),T},[vi,S,e]),Mg=F(async T=>{await hi(),await bs.current(T,[])||wn.current?.fill(T)},[hi]),Ps=F(()=>{let T=Re==="expanded"?"normal":"expanded";Ie.info("expand",{from:Re,expanded:T==="expanded"}),Qt(T),c.savePanelSize(T),r.emit("expand",T==="expanded")},[r,Re,c]),xs=F(()=>{let T=Re==="fullscreen"?"normal":"fullscreen";Ie.info("fullscreen",{from:Re,fullscreen:T==="fullscreen"}),Qt(T),c.savePanelSize(T),r.emit("fullscreen",T==="fullscreen")},[r,Re,c]),Lg=F(()=>{L(T=>{let O=T==="history"?"chat":"history";return Ie.info("toggleHistory",{view:O}),r.emit("toggleHistory",{view:O}),O})},[r]),Ng=F(()=>{ui(T=>{let O=!T;return Ie.info("sidebarToggle",{collapsed:O}),c.saveSidebarCollapsed(O),r.emit("sidebarToggle",{collapsed:O}),O})},[c,r]),Og=F(T=>{Ie.info("resize",T),$c({widgetSize:T}),r.emit("resize",T)},[$c,r]),$g=F(async T=>{let O=T.conversationId;if(O===d.value&&Uc(O)){Ie.info("selectConversation",{conversationId:O,cached:!0}),r.emit("selectConversation",{conversationId:O}),Q.publishConversation(T),L("chat");let Z=k();Z&&S.switchTab(Z),Sn(O);return}let ne=++io.current;fr.current++,P(!1);function me(){return ne!==io.current}Ie.info("selectConversation",{conversationId:O,wasStreaming:K}),r.emit("selectConversation",{conversationId:O}),Q.publishConversation(T);try{let Z=await Q.loadConversation(O);if(me())return;Oe.settle(),f.current=!0,se.current=void 0;let le=Br(Z.messages),Ae=Z.conversationId!==d.value,qe=Ae?le:ac(le,g.value);ge.current=qe.some(He=>He.role==="user")?void 0:Z.conversationId,Zt(()=>{g.value=fi(qe),Ae&&(v.value=Z.conversationId),d.value=Z.conversationId}),c.saveConversationId(Z.conversationId),Q.primeIdentity(u,Z.conversationId),Yt({conversationId:Z.conversationId,reference:Z.ticketReference}),Z.controlState&&oo(Z.controlState);let gr=qe.findLast(He=>He.role==="assistant"&&!He.ephemeral);xt(gr?.suggestions??[]),Ae?gs(Z.conversationId):Sn(Z.conversationId),L("chat");let Je=k();Je&&S.switchTab(Je)}catch(Z){if(me())return;r.emit("error",Z),e.onError?.(Z)}},[Q,g,d,v,r,e,c,fi,K,u,Oe,gs,Sn,Uc,S]),yi=B(void 0),bi=F(T=>{let O=e.modules.list.find(ne=>ne.layout===RS[T.to]);if(!O){Ie.warn("open: the widget has no such tab",{to:T.to});return}let X=T.id&&(O.layout==="help"||O.layout==="news")?{kind:"content",id:T.id,title:""}:void 0;S.open(O.id,X)},[e.modules,S]),Qc=F(T=>{if(z||so(),T!=null){if(!qd(T)){Ie.warn("open: unknown target",{detail:T});return}R?bi(T):yi.current=T}},[z,so,R,bi]);H(()=>{!R||!yi.current||(bi(yi.current),yi.current=void 0)},[R,bi]);let Yc=R&&!b&&(!mi||!Kc.value),[Qr,Ss]=U(),Jc=F(T=>{let O=Ud(T);if(!O){Ie.warn("ask: expected { text, send? } with non-empty text",{detail:T});return}z||so(),Ss(O)},[z,so]),ws=z&&R&&!b,Xc=ws&&Yc&&!Pe&&!(mi&&(K||Gc));H(()=>{if(Qr===void 0||!(Qr.send?Xc:ws))return;let T=k();if(!T){Ie.warn("ask: the widget has no chat"),Ss(void 0);return}if($!=="chat"||!h()){L("chat"),S.switchTab(T);return}if(Ss(void 0),!Qr.send){wn.current?.fill(Qr.text);return}Tn(Qr.text,[]).then(O=>{O||wn.current?.fill(Qr.text)})},[Qr,ws,Xc,$,A,e.modules,S,Tn]),H(()=>{if(e.widgetId!=="default")return;let T=`data-${D.cssPrefix}-`,O=["ask","open","close"].map(ne=>T+ne);function X(ne){let me=ne.composedPath().find(Ae=>Ae instanceof Element&&O.some(qe=>Ae.hasAttribute(qe)));if(!(me instanceof Element))return;ne.preventDefault();let Z=me.getAttribute(`${T}ask`),le=me.getAttribute(`${T}open`);Z!==null?Nt(t,"ask",vr(Z||(me.textContent??""),{send:me.hasAttribute(`${T}send`)})):le!==null?Nt(t,"open",Li(le)):Nt(t,"close")}return document.addEventListener("click",X),()=>document.removeEventListener("click",X)},[e.widgetId,t]),H(()=>{if(e.widgetId!=="default")return;let T=Qu(location.href);T&&(history.replaceState(history.state,"",T.url),T.ask?Nt(t,"ask",vr(T.ask)):Nt(t,"open",T.target))},[e.widgetId,t]);let Zc=B(Er),ed=e.mode==="page"||e.mode==="inline"||e.mode==="standalone";H(()=>nr(()=>{let T=d.value,O={open:ed||z,ready:R,unread:Dc.value,...T?{conversationId:T}:{}},X=Zc.current;O.open===X.open&&O.ready===X.ready&&O.unread===X.unread&&O.conversationId===X.conversationId||(Zc.current=O,r.emit("state",O),O.unread!==X.unread&&r.emit("unread",O.unread))}),[r,ed,z,R,Dc,d]);let In=B({handleOpenCommand:Qc,handleClose:gi,handleExpand:Ps,handleFullscreen:xs,handleAskCommand:Jc});In.current={handleOpenCommand:Qc,handleClose:gi,handleExpand:Ps,handleFullscreen:xs,handleAskCommand:Jc},St(()=>zd(t,{open:T=>In.current.handleOpenCommand(T),close:()=>In.current.handleClose(),expand:()=>In.current.handleExpand(),fullscreen:()=>In.current.handleFullscreen(),ask:T=>In.current.handleAskCommand(T)}),[t]);let mt=ke(()=>js(e,Rt,pr,_r),[e,Rt,pr,_r]);Ge.current=mt.strings,H(()=>{let T=At.current;if(!T?.translations?.length)return;let O=Yr(T,Rt);Lt(O.agent),O.site&&kl(O.site)&&bn(O.site),O.blocks&&Cl(O.blocks)&&Pn(O.blocks)},[Rt]);function ks(T){$g(T)}let td={options:mt,transport:Q,feedback:fe,bus:r,persistence:c,conversationId:d.value??"",composerKey:v.value,composerApiRef:wn,view:$,isStreaming:K,pageToolRunning:ys,isMemoryCompacting:Gc,canReleaseQueuedMessages:Yc,queueManualMessages:mi&&Kc.value,replyAwaitsCard:mi&&Ig.value,sendPreparing:Pe,attachmentUploadsSig:ze,composerActive:mt.mode==="page"||mt.mode==="inline"||mt.mode==="standalone"||z,controlMode:sr.value,assignedOperator:dg.value,operatorAvailable:ug.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:_g,onCancelOperatorRequest:fg,loadingMessages:b,onLoadPreviousMessages:Sg,messagesSig:g,reconnectingSig:y,agent:je,ticketReference:Wt?.conversationId===d.value?Wt?.reference:void 0,login:vs,onStartAsGuest:a,maxMessageCharacters:V,suggestions:ft,initialWidgetSize:_.widgetSize??null,onClear:vi,onExpand:Ps,onFullscreen:xs,onSoundToggle:cg,onToggleHistory:Lg,onSelectHistoryConversation:ks,onNewConversation:hi,onLocaleChange:ag,onThemeChange:sg,onTextSizeChange:lg,onWidgetSizeChange:Og,onSend:Tn,onStop:Ag,onSuggestion:T=>{if(de.current)return;let O=T.text??T.label;Ie.info("suggestion",{text:O,autoSend:e.autoSendSuggestions}),r.emit("suggestion",{text:O}),e.autoSendSuggestions?Tn(O,[]):wn.current?.fill(O)},tool:kg,onRetry:Eg,onMessageFeedback:Cg,onCardAction:Rg};if(M)return l("div",{class:`${ci}-anchor`,children:l(Ac,{strings:mt.strings,text:mt.strings.chatUnavailable})});if(!R)return null;let lo=mt.modules.list;function Cs(T){let O=Wn("close",mt.mode,T)?gi:void 0;return lo.length===0?l(Ac,{strings:mt.strings,text:mt.strings.modulesEmpty,onClose:O}):lo.length===1&&lo[0]?.layout==="chat"?l(ym,{...td,panelSize:T,onClose:O}):l(bm,{panelProps:{...td,panelSize:T,onClose:O},enabledModules:lo,nav:S,bus:r,hasUnread:gg.value,latestNews:Pg,onSelectConversation:ks,onStartNewConversation:Mg,onSetPanelSize:Qt})}if(e.mode==="page"){let T=e.history.enabled&&lo.some(O=>O.layout==="chat");return l("div",{class:`${ci}-anchor`,children:l(Sm,{site:yn,blocks:Wr,transport:Q,strings:mt.strings,locale:mt.locale,persistence:c,showConversations:T,onSelectConversation:ks,onNewConversation:hi,sidebarCollapsed:Gr,onToggleSidebarCollapsed:Ng,children:Cs("fullscreen")})})}if(j){let T=e.mode==="standalone"?"fullscreen":Re;return l("div",{class:`${ci}-anchor`,children:Cs(T)})}let rd=e.mode==="drawer",nd=!(e.mode==="modal")&&!e.launcher.hidden&&(!z||rt),od=nd&&!rt&&!Se&&!rd?mt.launcher.callout:null;return l("div",{class:`${ci}-anchor`,"data-launcher-size":mt.launcher.size,children:[z||pe?l("div",{class:`${ci}-surface`,hidden:!z,children:Cs(Re)}):null,nd?l(sf,{buttonRef:Tt,onToggle:so,launcher:mt.launcher,strings:mt.strings,leaving:rt,edgeTab:rd}):null,od?l(lf,{callout:od,launcherPosition:mt.position,strings:mt.strings,closeLabel:mt.strings.close,onDismiss:Be}):null]})}function ES(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var MS={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"},LS=120,Km=new WeakMap;async function NS(e,t,r,n,o){return(await Promise.all(t.map(async a=>{try{n(a.id,{status:"uploading"});let i=Km.get(a)??await e.uploadFile(a.file,r,c=>n(a.id,{status:"uploading",fraction:c}));return Km.set(a,i),n(a.id,{status:"done"}),{id:i.id,name:i.originalName,mediaType:i.mimeType,size:i.fileSize,url:i.url}}catch(i){n(a.id,r.aborted?void 0:{status:"error",refusal:i instanceof De&&i.status===400?i.errorCode:void 0}),o(i);return}}))).filter(a=>a!==void 0)}var OS=te.scope("error-boundary"),cs=class extends Xt{constructor(){super(...arguments);ee(this,"state",{crashed:!("toSorted"in Array.prototype)})}componentDidCatch(r,n){OS.error("widget render crashed",{error:r,componentStack:n?.componentStack}),this.setState({crashed:!0}),this.props.onError(r,n?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};function ds(e){let{bus:t,host:r,appRoot:n,persistence:o,reportError:s}=e,a=e.initialRaw,i,c,u=Ar(a),p=o.loadUserPrefs().locale??u.locale,_=!0,d=0,f=0,v=Fd(t);function g(){let m=i&&Yr({config:i,translations:c},p).config;u=Ar(m?Vs(a,m):a)}function y(){vl(r,$n(u.mode)),Cu(r,{...u,themeMode:_o(u.themeMode,o.loadUserPrefs().themeMode)}),_&&(Vi(r,Ym(u)),_=!1)}function b(){y(),lr(Or(cs,{onError:s},Or(Qm,{key:d,bus:t,hostElement:r,options:u,recentHostEvents:v,loginRevision:f,onPersonChanged:x,onStartAsGuest:k})),n)}t.on("handshake",m=>{m.config&&(m.config.storageVersion&&o.rememberStorageVersion(m.config.storageVersion),i=m.config,c=m.translations,g(),b())}),t.on("localeChange",m=>{p=m,c?.length&&(g(),b())});let P=gu(t,{getOptions:()=>u,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});function w(){let m=o.takeLoginReturn();return m?(o.saveConversationId(m.conversationId),o.saveDraft(m.conversationId,m.draft),o.savePanelOpen(!0),!0):!1}a.userToken&&w();function x(){o.reset(),v.length=0,d+=1,_=!0,g(),b()}function k(){a={...a,userContext:void 0,userToken:void 0},x()}function h(m){"userToken"in m&&m.userToken&&!a.userToken&&w()&&(d+=1),a={...a,...m},g(),b()}return{getOptions:()=>u,getUserOptions:()=>a,render:b,setUserOptions:m=>{a=m,g(),b()},patchUserOptions:h,login:m=>{f+=1,h({userToken:m})},reset:()=>k(),destroy:()=>P()}}function Ym(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=Dr(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:r,panelSize:n}=Wo(e,Kn(),t.loadPanelOpen(),t.loadPanelSize());return Ra(e.mode,n,r)}var Cr=new Map;function us(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");e.debug!==void 0&&Rn(e.debug);let t=te.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let r=Ar(e),n=r.widgetId,o=Cr.get(n);o&&(t.debug("destroy existing instance at slot",{widgetId:n}),o.destroy());let s=ji({position:$n(r.mode),target:e.target??null});s.hostElement.dataset.widgetId=n;let a=new Mn,i=Dr(n,r.storage,r.aiAgentDeploymentId);function c(b){a.emit("error",b),u.getOptions().onError?.(b)}let u=ds({bus:a,host:s.hostElement,appRoot:s.appRoot,persistence:i,initialRaw:e,reportError:c}),p=Er,_=()=>{},d=new Promise(b=>{_=b});a.on("state",b=>{p=b,b.ready&&_()}),u.render();let f=s.hostElement,v=null;function g(b){b.debug!==void 0&&Rn(b.debug),u.patchUserOptions(b)}let y={widgetId:n,open:b=>Nt(f,"open",b),close:()=>Nt(f,"close"),expand:()=>Nt(f,"expand"),ask:(b,P)=>Nt(f,"ask",vr(b,P)),on:(b,P)=>a.on(b,P),update:b=>{t.debug("update",{patch:b}),g(b)},setUserContext:b=>{t.debug("setUserContext",{keys:Object.keys(b)}),g({userContext:{...u.getUserOptions().userContext,...b}})},clearUserContext:()=>{t.debug("clearUserContext"),g({userContext:void 0})},setPageContext:b=>{t.debug("setPageContext",{keys:Object.keys(b)}),g({pageContext:{...u.getUserOptions().pageContext,...b}})},clearPageContext:()=>{t.debug("clearPageContext"),g({pageContext:void 0})},get state(){return p},ready:d,reset:()=>{t.info("reset",{widgetId:n}),u.reset()},login:b=>{t.info("login",{widgetId:n}),u.login(b)},track:(b,P)=>{let w=Ln(b,P);w&&a.emit("hostEvent",w)},registerTool:tn,setDebug:b=>{Rn(b),t.info("debug level set",{level:uo()})},debugLevel:()=>uo(),onLog:b=>po(b),destroy:()=>{t.info("destroy",{widgetId:n}),a.emit("state",Er),v?.(),u.destroy(),a.clear(),lr(null,s.appRoot),s.destroy(),Cr.get(n)===y&&Cr.delete(n)}};return v=$d(y,a),Cr.set(n,y),y}function ps(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");let t=e.widgetId??"default",r=Cr.get(t);return r?(r.update(e),r):us(e)}function Ec(e){if(e!==void 0){Cr.get(e)?.destroy();return}let t=[...Cr.values()];for(let r of t)r.destroy()}function Tr(e="default"){return Cr.get(e)??null}function Jm(){return[...Cr.values()]}var Xm=On;var Mc=class extends HTMLElement{constructor(){super(...arguments);ee(this,"bus",new Mn);ee(this,"widgetState",Er);ee(this,"userToken");ee(this,"pageTools",[]);ee(this,"markReady",()=>{});ee(this,"ready",new Promise(r=>{this.markReady=r}));ee(this,"mountResult",null);ee(this,"runtime",null)}static get observedAttributes(){return Ws}connectedCallback(){if(Object.hasOwn(this,"tools")){let r=Reflect.get(this,"tools");Reflect.deleteProperty(this,"tools"),this.pageTools=Array.isArray(r)?r:[]}this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,lr(null,this.mountResult.appRoot),this.bus.clear(),this.widgetState=Er)}attributeChangedCallback(){this.isConnected&&this.boot()}open(r){Nt(this,"open",r)}close(){Nt(this,"close")}expand(){Nt(this,"expand")}ask(r,n){Nt(this,"ask",vr(r,n))}get state(){return this.widgetState}reset(){this.userToken=void 0,this.runtime?.reset()}login(r){this.userToken=r,this.runtime?.login(r)}track(r,n){let o=Ln(r,n);o&&this.bus.emit("hostEvent",o)}get tools(){return this.pageTools}set tools(r){this.pageTools=r,this.runtime?.patchUserOptions({tools:r})}registerTool(r,n){tn(r,n)}on(r,n){return this.bus.on(r,n)}boot(){let r={...Ei(s=>this.getAttribute(s)),...this.userToken?{userToken:this.userToken}:{},tools:this.pageTools};if(!r.aiAgentDeploymentId)throw new Error("ai-agent-deployment-id is required");if(this.runtime){this.runtime.setUserOptions(r);return}let n=Ar(r);this.mountResult??(this.mountResult=ji({existingHost:this,position:$n(n.mode)}));let o=Dr(n.widgetId,n.storage,n.aiAgentDeploymentId);this.bus.on("state",s=>{this.widgetState=s,s.ready&&this.markReady()}),this.runtime=ds({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:r,reportError:s=>this.bus.emit("error",s)}),this.runtime.render()}},Zm=!1;function Lc(){if(Zm||typeof customElements>"u")return;let e=D.tagName;customElements.get(e)||customElements.define(e,Mc),Zm=!0}typeof customElements<"u"&&Lc();var tg=te.scope("iife");function $S(e){return typeof e=="string"||typeof e=="function"}function rg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function eg(e){return rg(e)}function DS(e){return rg(e)}function qS(e){return e===null||typeof e=="function"}var ng=[];function hn(e){let t=Tr();if(t)return e(t);ng.push(e)}function di(e){let t=Tr();if(t)for(let r of ng.splice(0))r(t);return e}function Nc(e){if(document.readyState!=="loading")return e();document.addEventListener("DOMContentLoaded",e,{once:!0})}function _s(){return new Promise(e=>{hn(t=>{t.ready.then(()=>e(t))})})}var Oc={ask:(e,t)=>typeof e=="string"?hn(r=>r.ask(e,vr(e,t))):void 0,close:()=>hn(e=>e.close()),ready:e=>_s().then(t=>typeof e=="function"?e(t):void 0),reset:()=>Tr()?.reset(),login:e=>{if(!$S(e))return;let t=Tr();return t?t.login(e):_s().then(r=>r.login(e))},destroy:()=>Ec(),expand:()=>hn(e=>e.expand()),track:(e,t)=>{let r=Ln(e,t);if(!r)return;let n=Tr();return n?n.track(r.name,r.data):_s().then(o=>o.track(r.name,r.data))},hook:(e,t,r)=>typeof e=="string"&&typeof t=="string"&&Qs(r)?fo(e,t,r):void 0,init:e=>eg(e)?Nc(()=>di(ps(e))):void 0,mount:e=>eg(e)?Nc(()=>di(us(e))):void 0,on:(e,t)=>hn(r=>r.on(e,t)),onLog:e=>po(qS(e)?e:null),registerTool:tn,open:e=>hn(t=>t.open(e)),setDebug:e=>typeof e=="boolean"||typeof e=="number"||typeof e=="string"?Rn(e):void 0,update:e=>DS(e)?hn(t=>t.update(e)):void 0};function US(e){return Object.hasOwn(Oc,e)}function og(e,...t){let r=US(e)?Oc[e]:void 0;if(!r){tg.warn("unknown command",{command:e});return}return r(...t)}function BS(){let e=((t,...r)=>og(t,...r));e.init=t=>di(ps(t)),e.mount=t=>di(us(t)),e.destroy=Ec,e.getInstance=Tr,e.getAllInstances=Jm,e.version=Xm,e.ready=_s,e.hook=fo,e.debugLevel=()=>uo(),e.onLog=po,e.registerTool=tn;for(let t of["ask","close","expand","login","on","open","reset","setDebug","track","update"])Reflect.set(e,t,Oc[t]);return e}function zS(e){let t=e?.q;if(t)for(let r of t){let n=[...r],[o,...s]=n;if(typeof o=="string")try{og(o,...s)}catch(a){tg.warn("queued command failed",{command:o,error:a})}}}function HS(){let e=[],t=e.push.bind(e);return e.push=(...r)=>(Ys(r),t(...r)),e}function FS(){let e=document.scripts;for(let t=e.length-1;t>=0;t--){let r=e[t];if(r?.src.includes("elements"))return r}return null}function jS(e){return typeof e=="function"}function VS(){if(typeof window>"u"||typeof document>"u")return;let e=Reflect.get(globalThis,D.global),t=jS(e)?e:void 0,r=BS();Reflect.set(globalThis,D.global,r),Lc();let n=`${D.global}Hooks`,o=Reflect.get(globalThis,n);if(Ys(o),Reflect.set(globalThis,n,HS()),zS(t),Tr())return;let s=document.currentScript,a=(s instanceof HTMLScriptElement?s:null)??FS(),i=Gs(a?.dataset),c=i.aiAgentDeploymentId;c&&Nc(()=>{Tr()||di(ps({...i,aiAgentDeploymentId:c}))})}VS();})();
68
70
  //# sourceMappingURL=elements.js.map