@helpai/elements 1.1.2 → 1.1.3
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-web-component.esm.js +21 -21
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +21 -21
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +21 -21
- package/elements.esm.js.map +3 -3
- package/elements.js +21 -21
- package/elements.js.map +3 -3
- package/index.mjs +3 -3
- package/package.json +1 -1
- package/web-component.mjs +4 -4
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var hu=Object.defineProperty;var bu=(e,t,n)=>t in e?hu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ne=(e,t,n)=>bu(e,typeof t!="symbol"?t+"":t,n);var pr,X,pi,$o,It,ci,fi,mi,Oo,lr,In,gi,Fo,No,Do,yu,dr={},ur=[],Pu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,En=Array.isArray;function yt(e,t){for(var n in t)e[n]=t[n];return e}function Bo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Pt(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?pr.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return cr(e,s,r,o,null)}function cr(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++pi,__i:-1,__u:0};return o==null&&X.vnode!=null&&X.vnode(i),i}function de(e){return e.children}function Qe(e,t){this.props=e,this.context=t}function sn(e,t){if(t==null)return e.__?sn(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?sn(e):null}function xu(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=yt({},t);i.__v=t.__v+1,X.vnode&&X.vnode(i),Ho(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??sn(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,Pi(r,i,o),t.__e=t.__=null,i.__e!=n&&vi(i)}}function vi(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),vi(e)}function di(e){(!e.__d&&(e.__d=!0)&&It.push(e)&&!_r.__r++||ci!=X.debounceRendering)&&((ci=X.debounceRendering)||fi)(_r)}function _r(){try{for(var e,t=1;It.length;)It.length>t&&It.sort(mi),e=It.shift(),t=It.length,xu(e)}finally{It.length=_r.__r=0}}function hi(e,t,n,r,o,i,s,l,c,u,_){var p,d,f,m,v,h,x,P=r&&r.__k||ur,b=t.length;for(c=Su(n,t,P,c,b),p=0;p<b;p++)(f=n.__k[p])!=null&&(d=f.__i!=-1&&P[f.__i]||dr,f.__i=p,h=Ho(e,f,d,o,i,s,l,c,u,_),m=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Uo(d.ref,null,f),_.push(f.ref,f.__c||m,f)),v==null&&m!=null&&(v=m),(x=!!(4&f.__u))||d.__k===f.__k?(c=bi(f,c,e,x),x&&d.__e&&(d.__e=null)):typeof f.type=="function"&&h!==void 0?c=h:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=v,c}function Su(e,t,n,r,o){var i,s,l,c,u,_=n.length,p=_,d=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=cr(null,s,null,null,null):En(s)?s=e.__k[i]=cr(de,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=cr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,c=i+d,s.__=e,s.__b=e.__b+1,l=null,(u=s.__i=ku(s,n,c,p))!=-1&&(p--,(l=n[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(o>_?d--:o<_&&d++),typeof s.type!="function"&&(s.__u|=4)):u!=c&&(u==c-1?d--:u==c+1?d++:(u>c?d--:d++,s.__u|=4))):e.__k[i]=null;if(p)for(i=0;i<_;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=sn(l)),Si(l,l));return r}function bi(e,t,n,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=bi(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=sn(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function An(e,t){return t=t||[],e==null||typeof e=="boolean"||(En(e)?e.some(function(n){An(n,t)}):t.push(e)),t}function ku(e,t,n,r){var o,i,s,l=e.key,c=e.type,u=t[n],_=u!=null&&(2&u.__u)==0;if(u===null&&l==null||_&&l==u.key&&c==u.type)return n;if(r>(_?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((u=t[s=o>=0?o--:i++])!=null&&(2&u.__u)==0&&l==u.key&&c==u.type)return s}return-1}function ui(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Pu.test(t)?n:n+"px"}function sr(e,t,n,r,o){var i,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ui(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||ui(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(gi,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n[In]=r[In]:(n[In]=Fo,e.addEventListener(t,i?Do:No,i)):e.removeEventListener(t,i?Do:No,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function _i(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[lr]==null)t[lr]=Fo++;else if(t[lr]<n[In])return;return n(X.event?X.event(t):t)}}}function Ho(e,t,n,r,o,i,s,l,c,u){var _,p,d,f,m,v,h,x,P,b,y,k,w,B,z,q,I=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[l=t.__e=n.__e]),(_=X.__b)&&_(t);e:if(typeof I=="function"){p=s.length;try{if(P=t.props,b=I.prototype&&I.prototype.render,y=(_=I.contextType)&&r[_.__c],k=_?y?y.props.value:_.__:r,n.__c?x=(d=t.__c=n.__c).__=d.__E:(b?t.__c=d=new I(P,k):(t.__c=d=new Qe(P,k),d.constructor=I,d.render=Cu),y&&y.sub(d),d.state||(d.state={}),d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),b&&d.__s==null&&(d.__s=d.state),b&&I.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=yt({},d.__s)),yt(d.__s,I.getDerivedStateFromProps(P,d.__s))),m=d.props,v=d.state,d.__v=t,f)b&&I.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),b&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(b&&I.getDerivedStateFromProps==null&&P!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(P,k),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(P,d.__s,k)===!1){t.__v!=n.__v&&(d.props=P,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t)}),ur.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(P,d.__s,k),b&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(m,v,h)})}if(d.context=k,d.props=P,d.__P=e,d.__e=!1,w=X.__r,B=0,b)d.state=d.__s,d.__d=!1,w&&w(t),_=d.render(d.props,d.state,d.context),ur.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,w&&w(t),_=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++B<25);d.state=d.__s,d.getChildContext!=null&&(r=yt(yt({},r),d.getChildContext())),b&&!f&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(m,v)),z=_!=null&&_.type===de&&_.key==null?xi(_.props.children):_,l=hi(e,En(z)?z:[z],t,n,r,o,i,s,l,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),x&&(d.__E=d.__=null)}catch(U){if(s.length=p,t.__v=null,c||i!=null){if(U.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i!=null&&(i[i.indexOf(l)]=null),t.__e=l}else if(i!=null)for(q=i.length;q--;)Bo(i[q])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),U.then||yi(t),X.__e(U,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=wu(n.__e,t,n,r,o,i,s,c,u);return(_=X.diffed)&&_(t),128&t.__u?void 0:l}function yi(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(yi))}function Pi(e,t,n){for(var r=0;r<n.length;r++)Uo(n[r],n[++r],n[++r]);X.__c&&X.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){X.__e(i,o.__v)}})}function xi(e){return typeof e!="object"||e==null||e.__b>0?e:En(e)?e.map(xi):e.constructor!==void 0?null:yt({},e)}function wu(e,t,n,r,o,i,s,l,c){var u,_,p,d,f,m,v,h=n.props||dr,x=t.props,P=t.type;if(P=="svg"?o="http://www.w3.org/2000/svg":P=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!P&&(P?f.localName==P:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(P==null)return document.createTextNode(x);e=document.createElementNS(o,P,x.is&&x),l&&(X.__m&&X.__m(t,i),l=!1),i=null}if(P==null)h===x||l&&e.data==x||(e.data=x);else{if(i=P=="textarea"&&x.defaultValue!=null?null:i&&pr.call(e.childNodes),!l&&i!=null)for(h={},u=0;u<e.attributes.length;u++)h[(f=e.attributes[u]).name]=f.value;for(u in h)f=h[u],u=="dangerouslySetInnerHTML"?p=f:u=="children"||u in x||u=="value"&&"defaultValue"in x||u=="checked"&&"defaultChecked"in x||sr(e,u,null,f,o);for(u in x)f=x[u],u=="children"?d=f:u=="dangerouslySetInnerHTML"?_=f:u=="value"?m=f:u=="checked"?v=f:l&&typeof f!="function"||h[u]===f||sr(e,u,f,h[u],o);if(_)l||p&&(_.__html==p.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(p&&(e.innerHTML=""),hi(t.type=="template"?e.content:e,En(d)?d:[d],t,n,r,P=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:n.__k&&sn(n,0),l,c),i!=null)for(u=i.length;u--;)Bo(i[u]);l&&P!="textarea"||(u="value",P=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[u]||P=="progress"&&!m||P=="option"&&m!=h[u])&&sr(e,u,m,h[u],o),u="checked",v!=null&&v!=e[u]&&sr(e,u,v,h[u],o))}return e}function Uo(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){X.__e(o,n)}}function Si(e,t,n){var r,o;if(X.unmount&&X.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Uo(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){X.__e(i,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Si(r[o],t,n||typeof e.type!="function");n||Bo(e.__e),e.__c=e.__=e.__e=void 0}function Cu(e,t,n){return this.constructor(e,n)}function Mn(e,t,n){var r,o,i,s;t==document&&(t=document.documentElement),X.__&&X.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],Ho(t,e=(!r&&n||t).__k=Pt(de,null,[e]),o||dr,dr,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?pr.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Pi(i,e,s),e.props.children=null}pr=ur.slice,X={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(l){e=l}throw e}},pi=0,$o=function(e){return e!=null&&e.constructor===void 0},Qe.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=yt({},this.state),typeof e=="function"&&(e=e(yt({},n),this.props)),e&&yt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),di(this))},Qe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),di(this))},Qe.prototype.render=de,It=[],fi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mi=function(e,t){return e.__v.__b-t.__v.__b},_r.__r=0,Oo=Math.random().toString(8),lr="__d"+Oo,In="__a"+Oo,gi=/(PointerCapture)$|Capture$/i,Fo=0,No=_i(!1),Do=_i(!0),yu=0;var C={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 ki={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",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",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",loadMoreConversations:"Load more conversations",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",talkToOperator:"Talk to an operator",connectingOperator:"Connecting you to an operator\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",cancelOperatorRequest:"Keep chatting with the AI",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",reject:"Reject",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Submitted",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},Ru={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",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",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",loadMoreConversations:"Charger plus de conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",talkToOperator:"Parler \xE0 un op\xE9rateur",connectingOperator:"Mise en relation avec un op\xE9rateur\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",cancelOperatorRequest:"Continuer avec l'IA",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",reject:"Refuser",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"Envoy\xE9",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Tu={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",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",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",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",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0645\u0648\u0638\u0641",connectingOperator:"\u062C\u0627\u0631\u064A \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0623\u062D\u062F \u0627\u0644\u0645\u0648\u0638\u0641\u064A\u0646\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},Iu={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",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",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",loadMoreConversations:"Cargar m\xE1s conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",talkToOperator:"Hablar con un operador",connectingOperator:"Conect\xE1ndote con un operador\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",cancelOperatorRequest:"Seguir con la IA",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",reject:"Rechazar",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Enviado",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Eu={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",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",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",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",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",talkToOperator:"\u05D3\u05D1\u05E8 \u05E2\u05DD \u05E0\u05E6\u05D9\u05D2",connectingOperator:"\u05DE\u05D7\u05D1\u05E8 \u05D0\u05D5\u05EA\u05DA \u05DC\u05E0\u05E6\u05D9\u05D2\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E9\u05DC\u05D7",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},Au={en:ki,fr:Ru,ar:Tu,es:Iu,he:Eu};function fr(e,t){let n=wi(e),r=mr(t),o=n==="en"?{}:Au[n]??{},i=r?t[n]??{}:t??{},s=r?t.en??{}:{};return{...ki,...o,...s,...i}}function wi(e){return(e.split("-")[0]??"en").toLowerCase()}var Mu=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function Ci(e){return Mu.has(wi(e))}function Je(e,t){return e[t]??t}function mr(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Ri(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function Ti(e,t){let{translations:n,defaultLocale:r,...o}=e,i=Ri(n,t);return i?{...o,title:i.title??o.title,description:i.description??o.description,content:i.content??o.content}:o}function Ii(e,t){let{translations:n,defaultLocale:r,...o}=e,i=Ri(n,t);if(!i)return o;let s=new Map((i.fields??[]).map(c=>[c.name,c])),l=o.fields.map(c=>{let u=s.get(c.name);if(!u)return c;let _=new Map((u.options??[]).map(p=>[p.value,p]));return{...c,label:u.label??c.label,placeholder:u.placeholder??c.placeholder,validationHint:u.validationHint??c.validationHint,options:c.options?.map(p=>{let d=_.get(p.value);return d?{...p,label:d.label??p.label,description:d.description??p.description}:p})}});return{...o,title:i.title??o.title,description:i.description??o.description,submitLabel:i.submitLabel??o.submitLabel,fields:l}}var zo=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},gr=new zo;var Lu=["off","error","warn","info","debug","trace"],qo=C.cssPrefix,Ou=`${qo}.debug`,Nu=`__${C.global}_DEBUG__`,Du=`${qo}-debug`,Mi=2,Ei=null;function $u(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Du);if(e!==null){let t=Ai(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Ou);if(e){let t=Ai(e);if(t>=0)return t}}catch{}return Reflect.get(window,Nu)?4:2}function Ai(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=Lu.indexOf(e);if(t>=0)return t}return-1}Mi=$u();function Li(e){let t=`[${qo}:${e}]`,n=(r,o,i)=>(s,l)=>{if(!(Mi<r)&&(l===void 0?console[o](t,s):console[o](t,s,l),Ei))try{Ei({level:i,scope:e,message:s,payload:l})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:r=>Li(`${e}:${r}`)}}var ee=Li("core");var Ut=ee.scope("context"),Fu=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),Oi=50,Vo=1024,Bu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Wo(e){return Ni(e,"userContext",!0)}function Go(e){return Ni(e,"pageContext",!1)}function Ni(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){Ut.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let r={},o=0;for(let[i,s]of Object.entries(e)){if(Fu.has(i)){Ut.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(o>=Oi){Ut.warn(`${t} truncated at ${Oi} keys \u2014 dropped "${i}"`);continue}let l=Hu(t,i,s);l!==void 0&&(r[i]=l,o++)}return n&&typeof r.email=="string"&&!Bu.test(r.email)&&(Ut.warn(`dropped malformed ${t}.email "${r.email}"`),delete r.email),Object.keys(r).length>0?r:void 0}function Hu(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){Ut.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let r=n.trim();return r===""?void 0:r.length>Vo?(Ut.warn(`truncated ${e}.${t} to ${Vo} chars`),r.slice(0,Vo)):r}Ut.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var vr={maxBytes:10485760,maxCount:10,accept:"*/*"},Di={voice:"local"},$i={list:[],byTrigger:{}},Ko={enabled:!0,sampleRate:1},hr={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},ln={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Fi={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},jo={enabled:!0,volume:.3,events:void 0},Bi={enabled:!0,events:void 0},Hi=[{label:"tabConversations",layout:"chat"}];function cn(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},r=t.behavior??{},o=t.i18n??{},i=t.feedback??{},s=t.footer??{},l=t.header??{},{themeMode:c,themeOverrides:u}=Uu(t.theme),_=n.mode??"floating",p=zu(o.defaultLocale),d=o.availableLocales??[o.locale??p],f=dn(o.locale??p,d,p),m=(t.baseUrl??C.defaultBaseUrl).replace(/\/$/,""),v=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),h=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:v,dataApiBaseUrl:h,userContext:Wo(t.userContext),pageContext:Go(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:u,mode:_,iframe:n.iframe??!1,responseMode:r.responseMode??"streaming",showReasoning:r.showReasoning??!1,showToolCalls:r.showToolCalls??!1,showSources:r.showSources??!1,enableMessageFeedback:!(r.disableMessageFeedback??!1),autoSendSuggestions:r.autoSendSuggestions??!1,features:{voice:t.features?.voice??Di.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0},forms:Ln(t.forms,f),endpoints:{upload:t.endpoints?.upload??hr.upload,transcribe:t.endpoints?.transcribe??hr.transcribe,submitForm:t.endpoints?.submitForm??hr.submitForm},attachments:{accept:t.composer?.attachments?.accept??vr.accept,maxBytes:t.composer?.attachments?.maxBytes??vr.maxBytes,maxCount:t.composer?.attachments?.maxCount??vr.maxCount},locale:f,defaultLocale:p,availableLocales:d,startMinimized:r.startMinimized??!0,actions:qu(_,l.actions),size:n.size??{},launcher:Ju(t.launcher),sound:Vu(i.sound),haptics:Wu(i.haptics),strings:fr(f,o.strings),stringsOverride:o.strings,composerDisclaimer:s.composerDisclaimer??"",poweredBy:Ku(s.poweredBy),composer:ju(t.composer),modules:Xu(t.modules),tracking:Gu(t.tracking,h),storage:t.storage??gr,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Uu(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function zu(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function dn(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function qu(e,t){return t??Fi[e]}function Vu(e){return{enabled:e?.enabled??jo.enabled,volume:e?.volume??jo.volume,events:e?.events}}function Wu(e){return{enabled:e?.enabled??Bi.enabled,events:e?.events}}function Gu(e,t){let n=e?.sampleRate??Ko.sampleRate;return{enabled:e?.enabled??Ko.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function Ku(e){let n={...{text:`Powered by ${C.displayName}`,href:C.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function ju(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Xu(e){let t=e===void 0?Hi:e,n=new Set,r=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let s=i.contentTags?.filter(Boolean),l=i.id??s?.[0]??i.layout;for(;n.has(l);)l=`${l}-${r.length}`;n.add(l);let c={id:l,label:i.label,layout:i.layout};s&&s.length>0&&(c.contentTags=s),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=!(i.hideGreeting??!1),c.showSearchBar=!(i.hideSearchBar??!1),c.showRecentConversations=!(i.hideRecentConversations??!1),i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),r.push(c)}let o=Object.fromEntries(r.map(i=>[i.id,i]));return{list:r,byId:o}}function Ln(e,t){var i;if(!e?.length)return $i;let n=[],r=new Set;for(let s of e){if(!s?.id||r.has(s.id))continue;let l=Ii(s,t),c=(l.fields??[]).filter(_=>!!(_&&_.name&&_.label&&_.type)),u=(Array.isArray(l.on)?l.on:[l.on]).map(Yu).filter(_=>_!==null);c.length===0||u.length===0||(r.add(l.id),n.push({id:l.id,triggers:u,when:l.when,fields:c,title:l.title,description:l.description,submitLabel:l.submitLabel,skippable:l.skippable??!1,frequency:l.frequency??"once",mirrorToContext:l.mirrorToContext??!0,reopenable:l.reopenable??!0,reviewable:l.reviewable??!0}))}let o={};for(let s of n)for(let l of s.triggers)(o[i=l.kind]??(o[i]=[])).push(s);return{list:n,byTrigger:o}}function Yu(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let r=Number(n);return Number.isFinite(r)&&r>0?{kind:"after-messages",param:r}:null}if(t==="idle"){let r=Number(n);return Number.isFinite(r)&&r>0?{kind:"idle",param:r}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function Ju(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??ln.variant,size:e?.size??ln.size,label:e?.label??ln.label,icon:e?.icon??ln.icon,hidden:e?.hidden??ln.hidden,callout:t}}function Xo(e,t,n,r){let o=dn(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&n===e.themeMode&&r===e.textSize)return e;let i={...e};return o!==e.locale&&(i.locale=o,i.strings=fr(o,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),r!==e.textSize&&(i.textSize=r),i}var Qu=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Yo(e,t){if(!t)return e;let n={...e};for(let i of Qu){let s=t[i];if(s===void 0)continue;let l=e[i];if(i==="theme"){l===void 0&&(n[i]=s);continue}i!=="i18n"&&(n[i]=Ui(s,l))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let r=e.i18n,o=t.i18n;if(r||o){let i=Ui(o??{},r);o?.availableLocales!==void 0&&(i.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(i.defaultLocale=o.defaultLocale);let s=r?.strings,l=o?.strings;(s||l)&&(i.strings=Zu(l,s)),n.i18n=i}return n}function Ui(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return n}function Zu(e,t){if(!e)return t;if(!t)return e;let n=mr(e),r=mr(t);if(!n&&!r)return{...e,...t};let o={},i=n?e:{en:e},s=r?t:{en:t};for(let[l,c]of Object.entries(i))o[l]={...c};for(let[l,c]of Object.entries(s))o[l]={...o[l],...c};return o}var e_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],xt=e=>e!=="false",t_=e=>e.split(",").map(t=>t.trim()).filter(Boolean),qi=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],Vi=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",xt]],Wi=[["width","width"],["height","height"]],Gi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",xt],["show-reasoning","showReasoning",xt],["show-tool-calls","showToolCalls",xt],["show-sources","showSources",xt],["disable-message-feedback","disableMessageFeedback",xt],["auto-send-suggestions","autoSendSuggestions",xt]],Ki=[["locale","locale"]],n_=new Set(e_),r_=e=>t_(e).filter(t=>n_.has(t)),ji=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",xt]],Xi=[["features-disable-file-upload","disableFileUpload",xt],["features-voice","voice",e=>e]],Yi=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Ji=[["user-id","id"],["user-email","email"],["user-name","name"]],Qi=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],o_=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],a_=[qi,Vi,Wi,Gi,Ki,ji,Xi,Yi,Ji,Qi],i_=new Set(["iframe","start-minimized"]),Jo=[...a_.flatMap(e=>e.map(([t])=>t).filter(t=>!i_.has(t))),...o_];function Qo(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,v]of qi){let h=n(f);h!==void 0&&(t[m]=v?v(h):h)}let r=zt(n,Vi),o=zt(n,Wi);(r||o)&&(t.presentation={...r,...o?{size:o}:{}});let i=zt(n,Gi);i&&(t.behavior=i);let s=zt(n,Ki);s&&(t.i18n=s);let l=s_(e,n);l&&(t.launcher=l);let c=zt(n,Xi);c&&(t.features=c);let u=zt(n,Yi);u&&(t.endpoints=u);let _=zi(n,Ji,"user-context");_&&(t.userContext=_);let p=zi(n,Qi,"page-context");p&&(t.pageContext=p);let d=n("actions");return d!==void 0&&(t.header={actions:r_(d)}),t}function zt(e,t){let n={};for(let[r,o,i]of t){let s=e(r);s!==void 0&&(n[o]=i?i(s):s)}return Object.keys(n).length>0?n:null}function zi(e,t,n){let r={};for(let[l,c]of t){let u=e(l);u!==void 0&&(r[c]=u)}let o={},i=e(n);if(i)try{let l=JSON.parse(i);l&&typeof l=="object"&&!Array.isArray(l)&&(o=l)}catch{}let s={...o,...r};return Object.keys(s).length>0?s:null}function s_(e,t){let n=zt(t,ji)??{},r=e("launcher-label");r!==null&&(n.label=r);let o=t("callout-text");if(o){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:o,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}function ot(){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,l_(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function l_(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 qt=ee.scope("persistence");function un(e,t=gr,n){let r=n?`${e}.${n}`:e,o=`${C.cssPrefix}.storageVersion`,i=t.get(o)??void 0,s=i?`.v${i}`:"",l=`${C.cssPrefix}.${r}${s}`,c=`${C.cssPrefix}${s}.visitorId`,u=`${l}.conversationId`,_=`${l}.userPrefs`,p=`${l}.panelOpen`,d=`${l}.panelSize`,f=`${l}.calloutDismissed`,m=`${l}.sidebarCollapsed`,v=`${l}.activeModule`,h=`${l}.historyCount`,x=`${l}.formsDone`,P={getVisitorId(){let b=t.get(c);if(b)return b;let y=ot();return t.set(c,y),y},setVisitorId(b){qt.debug("setVisitorId (rebind)",{id:b,scope:r}),t.set(c,b)},loadConversationId(){return t.get(u)??void 0},saveConversationId(b){qt.trace("saveConversationId",{id:b,scope:r}),b?t.set(u,b):t.remove(u)},loadDraft(b){return t.get(`${l}.draft.${b}`)??""},saveDraft(b,y){let k=`${l}.draft.${b}`;y?t.set(k,y):t.remove(k)},loadUserPrefs(){let b=t.get(_);if(!b)return{};try{let y=JSON.parse(b);return Zi(y)?y:{}}catch(y){return qt.warn("loadUserPrefs parse failed",{error:y}),{}}},saveUserPrefs(b){try{t.set(_,JSON.stringify(b))}catch(y){qt.warn("saveUserPrefs serialise failed",{error:y})}},patchUserPrefs(b){let y=P.loadUserPrefs();P.saveUserPrefs({...y,...b})},loadPanelOpen(){let b=t.get(p);return b==="1"?!0:b==="0"?!1:null},savePanelOpen(b){t.set(p,b?"1":"0")},loadPanelSize(){let b=t.get(d);return b==="normal"||b==="expanded"||b==="fullscreen"?b:null},savePanelSize(b){t.set(d,b)},loadCalloutDismissed(b){if(!b)return!1;let y=t.get(f);return!!y&&y===b},saveCalloutDismissed(b){b?t.set(f,b):t.remove(f)},loadSidebarCollapsed(){let b=t.get(m);return b==="1"?!0:b==="0"?!1:null},saveSidebarCollapsed(b){t.set(m,b?"1":"0")},loadActiveModule(){return t.get(v)||null},saveActiveModule(b){t.set(v,b)},loadHistoryCount(){let b=t.get(h);if(!b)return null;let y=Number.parseInt(b,10);return Number.isFinite(y)&&y>=0?y:null},saveHistoryCount(b){t.set(h,String(b))},loadFormsDone(){let b=t.get(x);if(!b)return{};try{let y=JSON.parse(b);return Zi(y)?y:{}}catch(y){return qt.warn("loadFormsDone parse failed",{error:y}),{}}},saveFormDone(b){try{let y=P.loadFormsDone();y[b]=Date.now(),t.set(x,JSON.stringify(y))}catch(y){qt.warn("saveFormDone serialise failed",{error:y})}},rememberStorageVersion(b){b&&b!==t.get(o)&&(qt.debug("rememberStorageVersion (force-reset on next load)",{version:b}),t.set(o,b))},clearConversation(){t.remove(u)}};return P}function Zi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var es=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-accent-fg: var(--__P__-accent);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-pill-l-min: .3;--__P__-pill-l-max: .46;--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-mode="modal"]),:host([data-mode="drawer"]){--__P__-conversation-max: 100%}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h);--__P__-accent-fg: oklch(from var(--__P__-accent-user) clamp(.3, l, .46) c h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
1
|
+
var hu=Object.defineProperty;var bu=(e,t,n)=>t in e?hu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var te=(e,t,n)=>bu(e,typeof t!="symbol"?t+"":t,n);var pr,Y,pi,$o,It,ci,fi,mi,Oo,lr,In,gi,Fo,No,Do,yu,dr={},ur=[],Pu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,En=Array.isArray;function Pt(e,t){for(var n in t)e[n]=t[n];return e}function Bo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function xt(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?pr.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return cr(e,s,r,o,null)}function cr(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++pi,__i:-1,__u:0};return o==null&&Y.vnode!=null&&Y.vnode(i),i}function ce(e){return e.children}function et(e,t){this.props=e,this.context=t}function sn(e,t){if(t==null)return e.__?sn(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?sn(e):null}function xu(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=Pt({},t);i.__v=t.__v+1,Y.vnode&&Y.vnode(i),Ho(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??sn(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,Pi(r,i,o),t.__e=t.__=null,i.__e!=n&&vi(i)}}function vi(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),vi(e)}function di(e){(!e.__d&&(e.__d=!0)&&It.push(e)&&!_r.__r++||ci!=Y.debounceRendering)&&((ci=Y.debounceRendering)||fi)(_r)}function _r(){try{for(var e,t=1;It.length;)It.length>t&&It.sort(mi),e=It.shift(),t=It.length,xu(e)}finally{It.length=_r.__r=0}}function hi(e,t,n,r,o,i,s,l,c,u,_){var p,d,f,m,b,v,P,x=r&&r.__k||ur,h=t.length;for(c=Su(n,t,x,c,h),p=0;p<h;p++)(f=n.__k[p])!=null&&(d=f.__i!=-1&&x[f.__i]||dr,f.__i=p,v=Ho(e,f,d,o,i,s,l,c,u,_),m=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Uo(d.ref,null,f),_.push(f.ref,f.__c||m,f)),b==null&&m!=null&&(b=m),(P=!!(4&f.__u))||d.__k===f.__k?(c=bi(f,c,e,P),P&&d.__e&&(d.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=b,c}function Su(e,t,n,r,o){var i,s,l,c,u,_=n.length,p=_,d=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=cr(null,s,null,null,null):En(s)?s=e.__k[i]=cr(ce,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=cr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,c=i+d,s.__=e,s.__b=e.__b+1,l=null,(u=s.__i=ku(s,n,c,p))!=-1&&(p--,(l=n[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(o>_?d--:o<_&&d++),typeof s.type!="function"&&(s.__u|=4)):u!=c&&(u==c-1?d--:u==c+1?d++:(u>c?d--:d++,s.__u|=4))):e.__k[i]=null;if(p)for(i=0;i<_;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=sn(l)),Si(l,l));return r}function bi(e,t,n,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=bi(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=sn(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function An(e,t){return t=t||[],e==null||typeof e=="boolean"||(En(e)?e.some(function(n){An(n,t)}):t.push(e)),t}function ku(e,t,n,r){var o,i,s,l=e.key,c=e.type,u=t[n],_=u!=null&&(2&u.__u)==0;if(u===null&&l==null||_&&l==u.key&&c==u.type)return n;if(r>(_?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((u=t[s=o>=0?o--:i++])!=null&&(2&u.__u)==0&&l==u.key&&c==u.type)return s}return-1}function ui(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Pu.test(t)?n:n+"px"}function sr(e,t,n,r,o){var i,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ui(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||ui(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(gi,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n[In]=r[In]:(n[In]=Fo,e.addEventListener(t,i?Do:No,i)):e.removeEventListener(t,i?Do:No,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function _i(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[lr]==null)t[lr]=Fo++;else if(t[lr]<n[In])return;return n(Y.event?Y.event(t):t)}}}function Ho(e,t,n,r,o,i,s,l,c,u){var _,p,d,f,m,b,v,P,x,h,y,k,w,B,W,U,I=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[l=t.__e=n.__e]),(_=Y.__b)&&_(t);e:if(typeof I=="function"){p=s.length;try{if(x=t.props,h=I.prototype&&I.prototype.render,y=(_=I.contextType)&&r[_.__c],k=_?y?y.props.value:_.__:r,n.__c?P=(d=t.__c=n.__c).__=d.__E:(h?t.__c=d=new I(x,k):(t.__c=d=new et(x,k),d.constructor=I,d.render=Cu),y&&y.sub(d),d.state||(d.state={}),d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),h&&d.__s==null&&(d.__s=d.state),h&&I.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Pt({},d.__s)),Pt(d.__s,I.getDerivedStateFromProps(x,d.__s))),m=d.props,b=d.state,d.__v=t,f)h&&I.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),h&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(h&&I.getDerivedStateFromProps==null&&x!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,k),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(x,d.__s,k)===!1){t.__v!=n.__v&&(d.props=x,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(z){z&&(z.__=t)}),ur.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,k),h&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(m,b,v)})}if(d.context=k,d.props=x,d.__P=e,d.__e=!1,w=Y.__r,B=0,h)d.state=d.__s,d.__d=!1,w&&w(t),_=d.render(d.props,d.state,d.context),ur.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,w&&w(t),_=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++B<25);d.state=d.__s,d.getChildContext!=null&&(r=Pt(Pt({},r),d.getChildContext())),h&&!f&&d.getSnapshotBeforeUpdate!=null&&(v=d.getSnapshotBeforeUpdate(m,b)),W=_!=null&&_.type===ce&&_.key==null?xi(_.props.children):_,l=hi(e,En(W)?W:[W],t,n,r,o,i,s,l,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),P&&(d.__E=d.__=null)}catch(z){if(s.length=p,t.__v=null,c||i!=null){if(z.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i!=null&&(i[i.indexOf(l)]=null),t.__e=l}else if(i!=null)for(U=i.length;U--;)Bo(i[U])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),z.then||yi(t),Y.__e(z,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=wu(n.__e,t,n,r,o,i,s,c,u);return(_=Y.diffed)&&_(t),128&t.__u?void 0:l}function yi(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(yi))}function Pi(e,t,n){for(var r=0;r<n.length;r++)Uo(n[r],n[++r],n[++r]);Y.__c&&Y.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){Y.__e(i,o.__v)}})}function xi(e){return typeof e!="object"||e==null||e.__b>0?e:En(e)?e.map(xi):e.constructor!==void 0?null:Pt({},e)}function wu(e,t,n,r,o,i,s,l,c){var u,_,p,d,f,m,b,v=n.props||dr,P=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"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(x==null)return document.createTextNode(P);e=document.createElementNS(o,x,P.is&&P),l&&(Y.__m&&Y.__m(t,i),l=!1),i=null}if(x==null)v===P||l&&e.data==P||(e.data=P);else{if(i=x=="textarea"&&P.defaultValue!=null?null:i&&pr.call(e.childNodes),!l&&i!=null)for(v={},u=0;u<e.attributes.length;u++)v[(f=e.attributes[u]).name]=f.value;for(u in v)f=v[u],u=="dangerouslySetInnerHTML"?p=f:u=="children"||u in P||u=="value"&&"defaultValue"in P||u=="checked"&&"defaultChecked"in P||sr(e,u,null,f,o);for(u in P)f=P[u],u=="children"?d=f:u=="dangerouslySetInnerHTML"?_=f:u=="value"?m=f:u=="checked"?b=f:l&&typeof f!="function"||v[u]===f||sr(e,u,f,v[u],o);if(_)l||p&&(_.__html==p.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(p&&(e.innerHTML=""),hi(t.type=="template"?e.content:e,En(d)?d:[d],t,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:n.__k&&sn(n,0),l,c),i!=null)for(u=i.length;u--;)Bo(i[u]);l&&x!="textarea"||(u="value",x=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[u]||x=="progress"&&!m||x=="option"&&m!=v[u])&&sr(e,u,m,v[u],o),u="checked",b!=null&&b!=e[u]&&sr(e,u,b,v[u],o))}return e}function Uo(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){Y.__e(o,n)}}function Si(e,t,n){var r,o;if(Y.unmount&&Y.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Uo(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){Y.__e(i,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Si(r[o],t,n||typeof e.type!="function");n||Bo(e.__e),e.__c=e.__=e.__e=void 0}function Cu(e,t,n){return this.constructor(e,n)}function Mn(e,t,n){var r,o,i,s;t==document&&(t=document.documentElement),Y.__&&Y.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],Ho(t,e=(!r&&n||t).__k=xt(ce,null,[e]),o||dr,dr,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?pr.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Pi(i,e,s),e.props.children=null}pr=ur.slice,Y={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(l){e=l}throw e}},pi=0,$o=function(e){return e!=null&&e.constructor===void 0},et.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Pt({},this.state),typeof e=="function"&&(e=e(Pt({},n),this.props)),e&&Pt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),di(this))},et.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),di(this))},et.prototype.render=ce,It=[],fi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mi=function(e,t){return e.__v.__b-t.__v.__b},_r.__r=0,Oo=Math.random().toString(8),lr="__d"+Oo,In="__a"+Oo,gi=/(PointerCapture)$|Capture$/i,Fo=0,No=_i(!1),Do=_i(!0),yu=0;var C={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 ki={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",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",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",loadMoreConversations:"Load more conversations",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",talkToOperator:"Talk to an operator",connectingOperator:"Connecting you to an operator\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",cancelOperatorRequest:"Keep chatting with the AI",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",reject:"Reject",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Submitted",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},Ru={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",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",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",loadMoreConversations:"Charger plus de conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",talkToOperator:"Parler \xE0 un op\xE9rateur",connectingOperator:"Mise en relation avec un op\xE9rateur\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",cancelOperatorRequest:"Continuer avec l'IA",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",reject:"Refuser",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"Envoy\xE9",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Tu={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",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",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",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",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0645\u0648\u0638\u0641",connectingOperator:"\u062C\u0627\u0631\u064A \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0623\u062D\u062F \u0627\u0644\u0645\u0648\u0638\u0641\u064A\u0646\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},Iu={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",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",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",loadMoreConversations:"Cargar m\xE1s conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",talkToOperator:"Hablar con un operador",connectingOperator:"Conect\xE1ndote con un operador\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",cancelOperatorRequest:"Seguir con la IA",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",reject:"Rechazar",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Enviado",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Eu={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",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",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",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",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",talkToOperator:"\u05D3\u05D1\u05E8 \u05E2\u05DD \u05E0\u05E6\u05D9\u05D2",connectingOperator:"\u05DE\u05D7\u05D1\u05E8 \u05D0\u05D5\u05EA\u05DA \u05DC\u05E0\u05E6\u05D9\u05D2\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E9\u05DC\u05D7",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},Au={en:ki,fr:Ru,ar:Tu,es:Iu,he:Eu};function fr(e,t){let n=wi(e),r=mr(t),o=n==="en"?{}:Au[n]??{},i=r?t[n]??{}:t??{},s=r?t.en??{}:{};return{...ki,...o,...s,...i}}function wi(e){return(e.split("-")[0]??"en").toLowerCase()}var Mu=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function Ci(e){return Mu.has(wi(e))}function Ze(e,t){return e[t]??t}function mr(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Ri(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function Ti(e,t){let{translations:n,defaultLocale:r,...o}=e,i=Ri(n,t);return i?{...o,title:i.title??o.title,description:i.description??o.description,content:i.content??o.content}:o}function Ii(e,t){let{translations:n,defaultLocale:r,...o}=e,i=Ri(n,t);if(!i)return o;let s=new Map((i.fields??[]).map(c=>[c.name,c])),l=o.fields.map(c=>{let u=s.get(c.name);if(!u)return c;let _=new Map((u.options??[]).map(p=>[p.value,p]));return{...c,label:u.label??c.label,placeholder:u.placeholder??c.placeholder,validationHint:u.validationHint??c.validationHint,options:c.options?.map(p=>{let d=_.get(p.value);return d?{...p,label:d.label??p.label,description:d.description??p.description}:p})}});return{...o,title:i.title??o.title,description:i.description??o.description,submitLabel:i.submitLabel??o.submitLabel,fields:l}}var zo=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},gr=new zo;var Lu=["off","error","warn","info","debug","trace"],qo=C.cssPrefix,Ou=`${qo}.debug`,Nu=`__${C.global}_DEBUG__`,Du=`${qo}-debug`,Mi=2,Ei=null;function $u(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Du);if(e!==null){let t=Ai(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Ou);if(e){let t=Ai(e);if(t>=0)return t}}catch{}return Reflect.get(window,Nu)?4:2}function Ai(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=Lu.indexOf(e);if(t>=0)return t}return-1}Mi=$u();function Li(e){let t=`[${qo}:${e}]`,n=(r,o,i)=>(s,l)=>{if(!(Mi<r)&&(l===void 0?console[o](t,s):console[o](t,s,l),Ei))try{Ei({level:i,scope:e,message:s,payload:l})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:r=>Li(`${e}:${r}`)}}var ee=Li("core");var Ut=ee.scope("context"),Fu=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),Oi=50,Vo=1024,Bu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Wo(e){return Ni(e,"userContext",!0)}function Go(e){return Ni(e,"pageContext",!1)}function Ni(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){Ut.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let r={},o=0;for(let[i,s]of Object.entries(e)){if(Fu.has(i)){Ut.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(o>=Oi){Ut.warn(`${t} truncated at ${Oi} keys \u2014 dropped "${i}"`);continue}let l=Hu(t,i,s);l!==void 0&&(r[i]=l,o++)}return n&&typeof r.email=="string"&&!Bu.test(r.email)&&(Ut.warn(`dropped malformed ${t}.email "${r.email}"`),delete r.email),Object.keys(r).length>0?r:void 0}function Hu(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){Ut.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let r=n.trim();return r===""?void 0:r.length>Vo?(Ut.warn(`truncated ${e}.${t} to ${Vo} chars`),r.slice(0,Vo)):r}Ut.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var vr={maxBytes:10485760,maxCount:10,accept:"*/*"},Di={voice:"local"},$i={list:[],byTrigger:{}},Ko={enabled:!0,sampleRate:1},hr={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},ln={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Fi={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},jo={enabled:!0,volume:.3,events:void 0},Bi={enabled:!0,events:void 0},Hi=[{label:"tabConversations",layout:"chat"}];function cn(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},r=t.behavior??{},o=t.i18n??{},i=t.feedback??{},s=t.footer??{},l=t.header??{},{themeMode:c,themeOverrides:u}=Uu(t.theme),_=n.mode??"floating",p=zu(o.defaultLocale),d=o.availableLocales??[o.locale??p],f=dn(o.locale??p,d,p),m=(t.baseUrl??C.defaultBaseUrl).replace(/\/$/,""),b=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:b,dataApiBaseUrl:v,userContext:Wo(t.userContext),pageContext:Go(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:u,mode:_,iframe:n.iframe??!1,responseMode:r.responseMode??"streaming",showReasoning:r.showReasoning??!1,showToolCalls:r.showToolCalls??!1,showSources:r.showSources??!1,enableMessageFeedback:!(r.disableMessageFeedback??!1),autoSendSuggestions:r.autoSendSuggestions??!1,features:{voice:t.features?.voice??Di.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0},forms:Ln(t.forms,f),endpoints:{upload:t.endpoints?.upload??hr.upload,transcribe:t.endpoints?.transcribe??hr.transcribe,submitForm:t.endpoints?.submitForm??hr.submitForm},attachments:{accept:t.composer?.attachments?.accept??vr.accept,maxBytes:t.composer?.attachments?.maxBytes??vr.maxBytes,maxCount:t.composer?.attachments?.maxCount??vr.maxCount},locale:f,defaultLocale:p,availableLocales:d,startMinimized:r.startMinimized??!0,actions:qu(_,l.actions),size:n.size??{},launcher:Ju(t.launcher),sound:Vu(i.sound),haptics:Wu(i.haptics),strings:fr(f,o.strings),stringsOverride:o.strings,composerDisclaimer:s.composerDisclaimer??"",poweredBy:Ku(s.poweredBy),composer:ju(t.composer),modules:Xu(t.modules),tracking:Gu(t.tracking,v),storage:t.storage??gr,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Uu(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function zu(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function dn(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function qu(e,t){return t??Fi[e]}function Vu(e){return{enabled:e?.enabled??jo.enabled,volume:e?.volume??jo.volume,events:e?.events}}function Wu(e){return{enabled:e?.enabled??Bi.enabled,events:e?.events}}function Gu(e,t){let n=e?.sampleRate??Ko.sampleRate;return{enabled:e?.enabled??Ko.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function Ku(e){let n={...{text:`Powered by ${C.displayName}`,href:C.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function ju(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Xu(e){let t=e===void 0?Hi:e,n=new Set,r=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let s=i.contentTags?.filter(Boolean),l=i.id??s?.[0]??i.layout;for(;n.has(l);)l=`${l}-${r.length}`;n.add(l);let c={id:l,label:i.label,layout:i.layout};s&&s.length>0&&(c.contentTags=s),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=!(i.hideGreeting??!1),c.showSearchBar=!(i.hideSearchBar??!1),c.showRecentConversations=!(i.hideRecentConversations??!1),i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),r.push(c)}let o=Object.fromEntries(r.map(i=>[i.id,i]));return{list:r,byId:o}}function Ln(e,t){var i;if(!e?.length)return $i;let n=[],r=new Set;for(let s of e){if(!s?.id||r.has(s.id))continue;let l=Ii(s,t),c=(l.fields??[]).filter(_=>!!(_&&_.name&&_.label&&_.type)),u=(Array.isArray(l.on)?l.on:[l.on]).map(Yu).filter(_=>_!==null);c.length===0||u.length===0||(r.add(l.id),n.push({id:l.id,triggers:u,when:l.when,fields:c,title:l.title,description:l.description,submitLabel:l.submitLabel,skippable:l.skippable??!1,frequency:l.frequency??"once",mirrorToContext:l.mirrorToContext??!0,reopenable:l.reopenable??!0,reviewable:l.reviewable??!0}))}let o={};for(let s of n)for(let l of s.triggers)(o[i=l.kind]??(o[i]=[])).push(s);return{list:n,byTrigger:o}}function Yu(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let r=Number(n);return Number.isFinite(r)&&r>0?{kind:"after-messages",param:r}:null}if(t==="idle"){let r=Number(n);return Number.isFinite(r)&&r>0?{kind:"idle",param:r}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function Ju(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??ln.variant,size:e?.size??ln.size,label:e?.label??ln.label,icon:e?.icon??ln.icon,hidden:e?.hidden??ln.hidden,callout:t}}function Xo(e,t,n,r){let o=dn(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&n===e.themeMode&&r===e.textSize)return e;let i={...e};return o!==e.locale&&(i.locale=o,i.strings=fr(o,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),r!==e.textSize&&(i.textSize=r),i}var Qu=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Yo(e,t){if(!t)return e;let n={...e};for(let i of Qu){let s=t[i];if(s===void 0)continue;let l=e[i];if(i==="theme"){l===void 0&&(n[i]=s);continue}i!=="i18n"&&(n[i]=Ui(s,l))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let r=e.i18n,o=t.i18n;if(r||o){let i=Ui(o??{},r);o?.availableLocales!==void 0&&(i.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(i.defaultLocale=o.defaultLocale);let s=r?.strings,l=o?.strings;(s||l)&&(i.strings=Zu(l,s)),n.i18n=i}return n}function Ui(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return n}function Zu(e,t){if(!e)return t;if(!t)return e;let n=mr(e),r=mr(t);if(!n&&!r)return{...e,...t};let o={},i=n?e:{en:e},s=r?t:{en:t};for(let[l,c]of Object.entries(i))o[l]={...c};for(let[l,c]of Object.entries(s))o[l]={...o[l],...c};return o}var e_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],St=e=>e!=="false",t_=e=>e.split(",").map(t=>t.trim()).filter(Boolean),qi=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],Vi=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",St]],Wi=[["width","width"],["height","height"]],Gi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",St],["show-reasoning","showReasoning",St],["show-tool-calls","showToolCalls",St],["show-sources","showSources",St],["disable-message-feedback","disableMessageFeedback",St],["auto-send-suggestions","autoSendSuggestions",St]],Ki=[["locale","locale"]],n_=new Set(e_),r_=e=>t_(e).filter(t=>n_.has(t)),ji=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",St]],Xi=[["features-disable-file-upload","disableFileUpload",St],["features-voice","voice",e=>e]],Yi=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Ji=[["user-id","id"],["user-email","email"],["user-name","name"]],Qi=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],o_=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],a_=[qi,Vi,Wi,Gi,Ki,ji,Xi,Yi,Ji,Qi],i_=new Set(["iframe","start-minimized"]),Jo=[...a_.flatMap(e=>e.map(([t])=>t).filter(t=>!i_.has(t))),...o_];function Qo(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,b]of qi){let v=n(f);v!==void 0&&(t[m]=b?b(v):v)}let r=zt(n,Vi),o=zt(n,Wi);(r||o)&&(t.presentation={...r,...o?{size:o}:{}});let i=zt(n,Gi);i&&(t.behavior=i);let s=zt(n,Ki);s&&(t.i18n=s);let l=s_(e,n);l&&(t.launcher=l);let c=zt(n,Xi);c&&(t.features=c);let u=zt(n,Yi);u&&(t.endpoints=u);let _=zi(n,Ji,"user-context");_&&(t.userContext=_);let p=zi(n,Qi,"page-context");p&&(t.pageContext=p);let d=n("actions");return d!==void 0&&(t.header={actions:r_(d)}),t}function zt(e,t){let n={};for(let[r,o,i]of t){let s=e(r);s!==void 0&&(n[o]=i?i(s):s)}return Object.keys(n).length>0?n:null}function zi(e,t,n){let r={};for(let[l,c]of t){let u=e(l);u!==void 0&&(r[c]=u)}let o={},i=e(n);if(i)try{let l=JSON.parse(i);l&&typeof l=="object"&&!Array.isArray(l)&&(o=l)}catch{}let s={...o,...r};return Object.keys(s).length>0?s:null}function s_(e,t){let n=zt(t,ji)??{},r=e("launcher-label");r!==null&&(n.label=r);let o=t("callout-text");if(o){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:o,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}function ot(){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,l_(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function l_(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 qt=ee.scope("persistence");function un(e,t=gr,n){let r=n?`${e}.${n}`:e,o=`${C.cssPrefix}.storageVersion`,i=t.get(o)??void 0,s=i?`.v${i}`:"",l=`${C.cssPrefix}.${r}${s}`,c=`${C.cssPrefix}${s}.visitorId`,u=`${l}.conversationId`,_=`${l}.userPrefs`,p=`${l}.panelOpen`,d=`${l}.panelSize`,f=`${l}.calloutDismissed`,m=`${l}.sidebarCollapsed`,b=`${l}.activeModule`,v=`${l}.historyCount`,P=`${l}.formsDone`,x={getVisitorId(){let h=t.get(c);if(h)return h;let y=ot();return t.set(c,y),y},setVisitorId(h){qt.debug("setVisitorId (rebind)",{id:h,scope:r}),t.set(c,h)},loadConversationId(){return t.get(u)??void 0},saveConversationId(h){qt.trace("saveConversationId",{id:h,scope:r}),h?t.set(u,h):t.remove(u)},loadDraft(h){return t.get(`${l}.draft.${h}`)??""},saveDraft(h,y){let k=`${l}.draft.${h}`;y?t.set(k,y):t.remove(k)},loadUserPrefs(){let h=t.get(_);if(!h)return{};try{let y=JSON.parse(h);return Zi(y)?y:{}}catch(y){return qt.warn("loadUserPrefs parse failed",{error:y}),{}}},saveUserPrefs(h){try{t.set(_,JSON.stringify(h))}catch(y){qt.warn("saveUserPrefs serialise failed",{error:y})}},patchUserPrefs(h){let y=x.loadUserPrefs();x.saveUserPrefs({...y,...h})},loadPanelOpen(){let h=t.get(p);return h==="1"?!0:h==="0"?!1:null},savePanelOpen(h){t.set(p,h?"1":"0")},loadPanelSize(){let h=t.get(d);return h==="normal"||h==="expanded"||h==="fullscreen"?h:null},savePanelSize(h){t.set(d,h)},loadCalloutDismissed(h){if(!h)return!1;let y=t.get(f);return!!y&&y===h},saveCalloutDismissed(h){h?t.set(f,h):t.remove(f)},loadSidebarCollapsed(){let h=t.get(m);return h==="1"?!0:h==="0"?!1:null},saveSidebarCollapsed(h){t.set(m,h?"1":"0")},loadActiveModule(){return t.get(b)||null},saveActiveModule(h){t.set(b,h)},loadHistoryCount(){let h=t.get(v);if(!h)return null;let y=Number.parseInt(h,10);return Number.isFinite(y)&&y>=0?y:null},saveHistoryCount(h){t.set(v,String(h))},loadFormsDone(){let h=t.get(P);if(!h)return{};try{let y=JSON.parse(h);return Zi(y)?y:{}}catch(y){return qt.warn("loadFormsDone parse failed",{error:y}),{}}},saveFormDone(h){try{let y=x.loadFormsDone();y[h]=Date.now(),t.set(P,JSON.stringify(y))}catch(y){qt.warn("saveFormDone serialise failed",{error:y})}},rememberStorageVersion(h){h&&h!==t.get(o)&&(qt.debug("rememberStorageVersion (force-reset on next load)",{version:h}),t.set(o,h))},clearConversation(){t.remove(u)}};return x}function Zi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var es=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-accent-fg: var(--__P__-accent);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-pill-l-min: .3;--__P__-pill-l-max: .46;--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-mode="modal"]),:host([data-mode="drawer"]){--__P__-conversation-max: 100%}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h);--__P__-accent-fg: oklch(from var(--__P__-accent-user) clamp(.3, l, .46) c h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
2
2
|
`;var ts=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent-fg);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
3
3
|
`;var ns=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent-fg);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent-fg);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-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-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent-fg);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent-fg)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-operator-banner{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 var(--__P__-space-3) var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg-elevated),var(--__P__-accent) 6%);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);line-height:1.3;text-align:center}.__P__-operator-pulse{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-cancel-operator-request{flex:0 0 auto;padding:0;border:0;background:none;color:var(--__P__-accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.__P__-cancel-operator-request:hover{opacity:.8}.__P__-cancel-operator-request:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-radius:var(--__P__-radius-sm)}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent-fg)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent-fg);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent-fg);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent-fg)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent;user-select:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=completed]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=responded]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=awaiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=denied]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=error]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=superseded]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
|
|
4
4
|
`;var rs=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
5
|
`;var os=`:host([data-mode="page"]){min-height:0}:host([data-mode="page"]) .__P__-page-shell{display:grid;grid-template-columns:280px 1fr;width:100%;height:100%;min-height:0;background:var(--__P__-bg);color:var(--__P__-fg);transition:grid-template-columns var(--__P__-dur-base) var(--__P__-ease-in-out)}:host([data-mode="page"]) .__P__-page-shell[data-sidebar-collapsed=true]{grid-template-columns:48px 1fr}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}:host([data-mode="page"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-width:0;min-height:0;flex:1 1 0}:host([data-mode="page"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;animation:none}:host([data-mode="page"]) .__P__-sidebar{border-inline-end:1px solid var(--__P__-border);display:flex;flex-direction:column;overflow:hidden;background:var(--__P__-surface)}:host([data-mode="page"]) .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-5);border-bottom:1px solid var(--__P__-border);display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2);min-height:56px;box-sizing:border-box}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-2);justify-content:center}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-logo,:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-title{display:none}:host([data-mode="page"]) .__P__-sidebar-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--__P__-border);border-radius:6px;background:transparent;color:var(--__P__-fg);cursor:pointer;transition:background .12s,border-color .12s}:host([data-mode="page"]) .__P__-sidebar-toggle:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-toggle:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-logo{height:32px;display:block}:host([data-mode="page"]) .__P__-sidebar-title{font-size:var(--__P__-text-md);font-weight:600}:host([data-mode="page"]) .__P__-sidebar-section{padding:var(--__P__-space-3) var(--__P__-space-4);border-bottom:1px solid var(--__P__-border)}:host([data-mode="page"]) .__P__-sidebar-nav{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}:host([data-mode="page"]) .__P__-sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);text-decoration:none;font-size:calc(14px * var(--__P__-text-scale));transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-nav-item:hover{background:var(--__P__-hover)}:host([data-mode="page"]) .__P__-sidebar-nav-item:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}:host([data-mode="page"]) .__P__-sidebar-cards{display:grid;grid-template-columns:1fr;gap:var(--__P__-space-2)}:host([data-mode="page"]) .__P__-sidebar-card{display:block;padding:10px 12px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);text-decoration:none;color:var(--__P__-fg);transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-card:hover{border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-card-label{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}:host([data-mode="page"]) .__P__-sidebar-card-desc{font-size:var(--__P__-text-xs);color:var(--__P__-muted);margin-top:2px}:host([data-mode="page"]) .__P__-sidebar-conversations{flex:1 1 auto;overflow-y:auto;padding:var(--__P__-space-3) var(--__P__-space-4)}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;overflow:hidden}@media(max-width:768px){:host([data-mode="page"]) .__P__-page-shell{grid-template-columns:1fr}:host([data-mode="page"]) .__P__-sidebar{display:none}}
|
|
6
6
|
`;var f_="helpai",m_="#5B5BD6",g_="#FFFFFF",v_="12px",h_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",Zo=[es,ts,ns,rs,os].join(`
|
|
7
|
-
`).replace(/__P__/g,f_).replaceAll("__BRAND_ACCENT_TEXT__",g_).replaceAll("__BRAND_ACCENT__",m_).replaceAll("__BRAND_RADIUS__",v_).replaceAll("__BRAND_FONT__",h_);var b_=ee.scope("mount"),as=new WeakMap,is={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function ss(e,t){e.style.cssText=is[t]}function br(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function ls(e={}){let t=e.position??"flow";b_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${C.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let r;e.existingHost?r=e.existingHost:(r=document.createElement(n),(e.target??document.body).appendChild(r)),r.setAttribute("data-brand",C.id),r.style.cssText=is[t];let o=r.shadowRoot??r.attachShadow({mode:"open"}),i=r.ownerDocument;if(!y_(o,i)){let l=i.createElement("style");l.textContent=Zo,o.appendChild(l)}let s=document.createElement("div");return s.className=`${C.cssPrefix}-app`,o.appendChild(s),{appRoot:s,destroy:()=>r.remove(),hostElement:r,shadowRoot:o}}function y_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=as.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(Zo),as.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function P_(e,t){let n=C.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function x_(e,t){e.dataset.theme=t}function S_(e,t){let n=C.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function k_(e,t){e.dataset.position=t}function yr(e,t){e.dataset.mode=t}function cs(e,t){x_(e,t.themeMode),P_(e,t.themeOverrides),k_(e,t.position),S_(e,t.size)}var _n,Ae,ea,ds,On=0,hs=[],$e=X,us=$e.__b,_s=$e.__r,ps=$e.diffed,fs=$e.__c,ms=$e.unmount,gs=$e.__;function xr(e,t){$e.__h&&$e.__h(Ae,e,On||t),On=0;var n=Ae.__H||(Ae.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function O(e){return On=1,bs(ys,e)}function bs(e,t,n){var r=xr(_n++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ys(void 0,t),function(l){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,l);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=Ae,!Ae.__f)){var o=function(l,c,u){if(!r.__c.__H)return!0;var _=!1,p=r.__c.props!==l;if(r.__c.__H.__.some(function(f){if(f.__N){_=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(p=!0)}}),i){var d=i.call(this,l,c,u);return _?d||p:d}return!_||p};Ae.__f=!0;var i=Ae.shouldComponentUpdate,s=Ae.componentWillUpdate;Ae.componentWillUpdate=function(l,c,u){if(this.__e){var _=i;i=void 0,o(l,c,u),i=_}s&&s.call(this,l,c,u)},Ae.shouldComponentUpdate=o}return r.__N||r.__}function E(e,t){var n=xr(_n++,3);!$e.__s&&na(n.__H,t)&&(n.__=e,n.u=t,Ae.__H.__h.push(n))}function _t(e,t){var n=xr(_n++,4);!$e.__s&&na(n.__H,t)&&(n.__=e,n.u=t,Ae.__h.push(n))}function M(e){return On=5,Q(function(){return{current:e}},[])}function Q(e,t){var n=xr(_n++,7);return na(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function L(e,t){return On=8,Q(function(){return e},t)}function w_(){for(var e;e=hs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Pr),t.__h.some(ta),t.__h=[]}catch(n){t.__h=[],$e.__e(n,e.__v)}}}$e.__b=function(e){Ae=null,us&&us(e)},$e.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),gs&&gs(e,t)},$e.__r=function(e){_s&&_s(e),_n=0;var t=(Ae=e.__c).__H;t&&(ea===Ae?(t.__h=[],Ae.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Pr),t.__h.some(ta),t.__h=[],_n=0)),ea=Ae},$e.diffed=function(e){ps&&ps(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(hs.push(t)!==1&&ds===$e.requestAnimationFrame||((ds=$e.requestAnimationFrame)||C_)(w_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),ea=Ae=null},$e.__c=function(e,t){t.some(function(n){try{n.__h.some(Pr),n.__h=n.__h.filter(function(r){return!r.__||ta(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],$e.__e(r,n.__v)}}),fs&&fs(e,t)},$e.unmount=function(e){ms&&ms(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Pr(r)}catch(o){t=o}}),n.__H=void 0,t&&$e.__e(t,n.__v))};var vs=typeof requestAnimationFrame=="function";function C_(e){var t,n=function(){clearTimeout(r),vs&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);vs&&(t=requestAnimationFrame(n))}function Pr(e){var t=Ae,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Ae=t}function ta(e){var t=Ae;e.__c=e.__(),Ae=t}function na(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function ys(e,t){return typeof t=="function"?t(e):t}var R_=Symbol.for("preact-signals");function Cr(){if(St>1)St--;else{var e,t=!1;for((function(){var o=kr;for(kr=void 0;o!==void 0;){var i=o.S;if(i.v===o.v)for(var s=i.t;s!==void 0;s=s.x)s.i===o.i&&(s.i=i.i);o=o.o}})();Dn!==void 0;){var n=Dn;for(Dn=void 0,Sr++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&xs(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Sr=0,St--,t)throw e}}function it(e){if(St>0)return e();ra=++T_,St++;try{return e()}finally{Cr()}}var Nn,Te=void 0;function $n(e){var t=Te,n=Nn;Te=void 0,Nn=void 0;try{return e()}finally{Te=t,Nn=n}}var Dn=void 0,St=0,Sr=0,T_=0,ra=0,kr=void 0,wr=0;function Ps(e){if(Te!==void 0){var t=e.n;if(t===void 0||t.t!==Te)return t={i:0,S:e,p:Te.s,n:void 0,t:Te,e:void 0,x:void 0,r:t},Te.s!==void 0&&(Te.s.n=t),Te.s=t,e.n=t,32&Te.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=Te.s,t.n=void 0,Te.s.n=t,Te.s=t),t}}function Ve(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}Ve.prototype.brand=R_;Ve.prototype.h=function(){return!0};Ve.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:$n(function(){var r;(r=t.W)==null||r.call(t)}))};Ve.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&$n(function(){var o;(o=t.Z)==null||o.call(t)}))}};Ve.prototype.subscribe=function(e){var t=this;return kt(function(){var n=t.value;$n(function(){return e(n)})},{name:"sub"})};Ve.prototype.valueOf=function(){return this.value};Ve.prototype.toString=function(){return this.value+""};Ve.prototype.toJSON=function(){return this.value};Ve.prototype.peek=function(){var e=this;return $n(function(){return e.value})};Object.defineProperty(Ve.prototype,"value",{get:function(){var e=Ps(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Sr>100)throw new Error("Cycle detected");(function(n){St!==0&&Sr===0&&n.l!==ra&&(n.l=ra,kr={S:n,v:n.v,i:n.i,o:kr})})(this),this.v=e,this.i++,wr++,St++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Cr()}}}});function Y(e,t){return new Ve(e,t)}function xs(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ss(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ks(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Vt(e,t){Ve.call(this,void 0,t),this.x=e,this.s=void 0,this.g=wr-1,this.f=4}Vt.prototype=new Ve;Vt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===wr))return!0;if(this.g=wr,this.f|=1,this.i>0&&!xs(this))return this.f&=-2,!0;var e=Te;try{Ss(this),Te=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Te=e,ks(this),this.f&=-2,!0};Vt.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)}Ve.prototype.S.call(this,e)};Vt.prototype.U=function(e){if(this.t!==void 0&&(Ve.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)}};Vt.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(Vt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ps(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function me(e,t){return new Vt(e,t)}function ws(e){var t=e.m;if(e.m=void 0,typeof t=="function"){St++;var n=Te;Te=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,oa(e),r}finally{Te=n,Cr()}}}function oa(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ws(e)}function I_(e){if(Te!==this)throw new Error("Out-of-order effect");ks(this),Te=e,this.f&=-2,8&this.f&&oa(this),Cr()}function pn(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Nn&&Nn.push(this)}pn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};pn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ws(this),Ss(this),St++;var e=Te;return Te=this,I_.bind(this,e)};pn.prototype.N=function(){2&this.f||(this.f|=2,this.u=Dn,Dn=this)};pn.prototype.d=function(){this.f|=8,1&this.f||oa(this)};pn.prototype.dispose=function(){this.d()};function kt(e,t){var n=new pn(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Cs,Ir,Rr,E_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Rs=[];kt(function(){Cs=this.N})();function fn(e,t){X[e]=t.bind(null,X[e]||function(){})}function Tr(e){if(Rr){var t=Rr;Rr=void 0,t()}Rr=e&&e.S()}function Ts(e){var t=this,n=e.data,r=dt(n);r.value=n;var o=Q(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=me(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),_=me(function(){return!Array.isArray(u.value)&&!$o(u.value)}),p=kt(function(){if(this.N=Is,_.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){p(),d.call(this)},[_,u]},[]),i=o[0],s=o[1];return i.value?s.peek():s.value}Ts.displayName="ReactiveTextNode";Object.defineProperties(Ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ts},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});fn("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof Ve&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)});fn("__r",function(e,t){if(e(t),t.type!==de){Tr();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o,i){var s;return kt(function(){s=this},{name:i}),s.c=o,s})(function(){var o;E_&&((o=n.y)==null||o.call(n)),r.__$f|=1,r.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Ir=r,Tr(n)}});fn("__e",function(e,t,n,r){Tr(),Ir=void 0,e(t,n,r)});fn("diffed",function(e,t){Tr(),Ir=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||r&&s in r||(l.d(),i[s]=void 0)}if(r){i||(i={},n.U=i);for(var c in r){var u=i[c],_=r[c];u===void 0?(u=A_(n,c,_,o),i[c]=u):u.o(_,o)}}}e(t)});function A_(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=Y(n);return{o:function(s,l){i.value=s,r=l},d:kt(function(){this.N=Is;var s=i.value.value;r[t]!==s&&(r[t]=s,o?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}fn("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){var _=u.__$u;_&&(u.__$u=void 0,_.d())}}e(t)});fn("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)});Qe.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function dt(e,t){return Q(function(){return Y(e,t)},[])}function wt(e,t){var n=M(e);return n.current=e,Ir.__$f|=4,Q(function(){return me(function(){return n.current()},t)},[])}var M_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function L_(){it(function(){for(var e;e=Rs.shift();)Cs.call(e)})}function Is(){Rs.push(this)===1&&(X.requestAnimationFrame||M_)(L_)}function Es(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function As(e){return Es(e)}function Ms(e){return!(!Es(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function O_(e){return`${C.cssPrefix}:${e}`}function Ls(e,t){let r=Object.entries(t).map(([o,i])=>{let s=O_(o),l=c=>i(c.detail);return e.addEventListener(s,l),[s,l]});return()=>{for(let[o,i]of r)e.removeEventListener(o,i)}}function Er(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var N_=900,D_=640;function aa(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let r=t.initialSize;return r==="expanded"||r==="fullscreen"||r==="normal"?r:n>0&&n<D_?"fullscreen":n>=(t.autoSizeBreakpoint??N_)?"expanded":"normal"}function Fn(e,t,n,r=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:aa(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function mn(){return typeof window>"u"?0:window.innerWidth}var $_="x-public-key",F_="x-ai-agent-deployment-id";function Os(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[F_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??$_]=e.publicKey),t}}}function Bn(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(i,e),o=()=>i();t?.addEventListener("abort",o,{once:!0});function i(){clearTimeout(r),t?.removeEventListener("abort",o),n()}})}var Ar="1.1.2";var We=class extends Error{constructor(n,r,o,i){super(n);ne(this,"code",r);ne(this,"status",o);ne(this,"cause",i);this.name="StreamError"}};var Ns=ee.scope("parser");async function*Ds(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new We(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of B_(e,t)){let r=H_(n);if(r==="done")return;r&&(yield r)}}async function*B_(e,t){if(!e.body)throw new We("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),r="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:o,value:i}=await n.read();if(o){let l=r.trim();l&&(yield l);return}r+=i;let s;for(;(s=r.indexOf(`
|
|
7
|
+
`).replace(/__P__/g,f_).replaceAll("__BRAND_ACCENT_TEXT__",g_).replaceAll("__BRAND_ACCENT__",m_).replaceAll("__BRAND_RADIUS__",v_).replaceAll("__BRAND_FONT__",h_);var b_=ee.scope("mount"),as=new WeakMap,is={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function ss(e,t){e.style.cssText=is[t]}function br(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function ls(e={}){let t=e.position??"flow";b_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${C.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let r;e.existingHost?r=e.existingHost:(r=document.createElement(n),(e.target??document.body).appendChild(r)),r.setAttribute("data-brand",C.id),r.style.cssText=is[t];let o=r.shadowRoot??r.attachShadow({mode:"open"}),i=r.ownerDocument;if(!y_(o,i)){let l=i.createElement("style");l.textContent=Zo,o.appendChild(l)}let s=document.createElement("div");return s.className=`${C.cssPrefix}-app`,o.appendChild(s),{appRoot:s,destroy:()=>r.remove(),hostElement:r,shadowRoot:o}}function y_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=as.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(Zo),as.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function P_(e,t){let n=C.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function x_(e,t){e.dataset.theme=t}function S_(e,t){let n=C.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function k_(e,t){e.dataset.position=t}function yr(e,t){e.dataset.mode=t}function cs(e,t){x_(e,t.themeMode),P_(e,t.themeOverrides),k_(e,t.position),S_(e,t.size)}var _n,Oe,ea,ds,On=0,hs=[],Fe=Y,us=Fe.__b,_s=Fe.__r,ps=Fe.diffed,fs=Fe.__c,ms=Fe.unmount,gs=Fe.__;function xr(e,t){Fe.__h&&Fe.__h(Oe,e,On||t),On=0;var n=Oe.__H||(Oe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function D(e){return On=1,bs(ys,e)}function bs(e,t,n){var r=xr(_n++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ys(void 0,t),function(l){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,l);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=Oe,!Oe.__f)){var o=function(l,c,u){if(!r.__c.__H)return!0;var _=!1,p=r.__c.props!==l;if(r.__c.__H.__.some(function(f){if(f.__N){_=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(p=!0)}}),i){var d=i.call(this,l,c,u);return _?d||p:d}return!_||p};Oe.__f=!0;var i=Oe.shouldComponentUpdate,s=Oe.componentWillUpdate;Oe.componentWillUpdate=function(l,c,u){if(this.__e){var _=i;i=void 0,o(l,c,u),i=_}s&&s.call(this,l,c,u)},Oe.shouldComponentUpdate=o}return r.__N||r.__}function E(e,t){var n=xr(_n++,3);!Fe.__s&&na(n.__H,t)&&(n.__=e,n.u=t,Oe.__H.__h.push(n))}function pt(e,t){var n=xr(_n++,4);!Fe.__s&&na(n.__H,t)&&(n.__=e,n.u=t,Oe.__h.push(n))}function M(e){return On=5,Z(function(){return{current:e}},[])}function Z(e,t){var n=xr(_n++,7);return na(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(e,t){return On=8,Z(function(){return e},t)}function w_(){for(var e;e=hs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Pr),t.__h.some(ta),t.__h=[]}catch(n){t.__h=[],Fe.__e(n,e.__v)}}}Fe.__b=function(e){Oe=null,us&&us(e)},Fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),gs&&gs(e,t)},Fe.__r=function(e){_s&&_s(e),_n=0;var t=(Oe=e.__c).__H;t&&(ea===Oe?(t.__h=[],Oe.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Pr),t.__h.some(ta),t.__h=[],_n=0)),ea=Oe},Fe.diffed=function(e){ps&&ps(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(hs.push(t)!==1&&ds===Fe.requestAnimationFrame||((ds=Fe.requestAnimationFrame)||C_)(w_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),ea=Oe=null},Fe.__c=function(e,t){t.some(function(n){try{n.__h.some(Pr),n.__h=n.__h.filter(function(r){return!r.__||ta(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Fe.__e(r,n.__v)}}),fs&&fs(e,t)},Fe.unmount=function(e){ms&&ms(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Pr(r)}catch(o){t=o}}),n.__H=void 0,t&&Fe.__e(t,n.__v))};var vs=typeof requestAnimationFrame=="function";function C_(e){var t,n=function(){clearTimeout(r),vs&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);vs&&(t=requestAnimationFrame(n))}function Pr(e){var t=Oe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Oe=t}function ta(e){var t=Oe;e.__c=e.__(),Oe=t}function na(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function ys(e,t){return typeof t=="function"?t(e):t}var R_=Symbol.for("preact-signals");function Cr(){if(kt>1)kt--;else{var e,t=!1;for((function(){var o=kr;for(kr=void 0;o!==void 0;){var i=o.S;if(i.v===o.v)for(var s=i.t;s!==void 0;s=s.x)s.i===o.i&&(s.i=i.i);o=o.o}})();Dn!==void 0;){var n=Dn;for(Dn=void 0,Sr++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&xs(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Sr=0,kt--,t)throw e}}function it(e){if(kt>0)return e();ra=++T_,kt++;try{return e()}finally{Cr()}}var Nn,Re=void 0;function $n(e){var t=Re,n=Nn;Re=void 0,Nn=void 0;try{return e()}finally{Re=t,Nn=n}}var Dn=void 0,kt=0,Sr=0,T_=0,ra=0,kr=void 0,wr=0;function Ps(e){if(Re!==void 0){var t=e.n;if(t===void 0||t.t!==Re)return t={i:0,S:e,p:Re.s,n:void 0,t:Re,e:void 0,x:void 0,r:t},Re.s!==void 0&&(Re.s.n=t),Re.s=t,e.n=t,32&Re.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=Re.s,t.n=void 0,Re.s.n=t,Re.s=t),t}}function Ve(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}Ve.prototype.brand=R_;Ve.prototype.h=function(){return!0};Ve.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:$n(function(){var r;(r=t.W)==null||r.call(t)}))};Ve.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&$n(function(){var o;(o=t.Z)==null||o.call(t)}))}};Ve.prototype.subscribe=function(e){var t=this;return wt(function(){var n=t.value;$n(function(){return e(n)})},{name:"sub"})};Ve.prototype.valueOf=function(){return this.value};Ve.prototype.toString=function(){return this.value+""};Ve.prototype.toJSON=function(){return this.value};Ve.prototype.peek=function(){var e=this;return $n(function(){return e.value})};Object.defineProperty(Ve.prototype,"value",{get:function(){var e=Ps(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Sr>100)throw new Error("Cycle detected");(function(n){kt!==0&&Sr===0&&n.l!==ra&&(n.l=ra,kr={S:n,v:n.v,i:n.i,o:kr})})(this),this.v=e,this.i++,wr++,kt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Cr()}}}});function J(e,t){return new Ve(e,t)}function xs(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ss(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ks(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Vt(e,t){Ve.call(this,void 0,t),this.x=e,this.s=void 0,this.g=wr-1,this.f=4}Vt.prototype=new Ve;Vt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===wr))return!0;if(this.g=wr,this.f|=1,this.i>0&&!xs(this))return this.f&=-2,!0;var e=Re;try{Ss(this),Re=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Re=e,ks(this),this.f&=-2,!0};Vt.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)}Ve.prototype.S.call(this,e)};Vt.prototype.U=function(e){if(this.t!==void 0&&(Ve.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)}};Vt.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(Vt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ps(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function pe(e,t){return new Vt(e,t)}function ws(e){var t=e.m;if(e.m=void 0,typeof t=="function"){kt++;var n=Re;Re=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,oa(e),r}finally{Re=n,Cr()}}}function oa(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ws(e)}function I_(e){if(Re!==this)throw new Error("Out-of-order effect");ks(this),Re=e,this.f&=-2,8&this.f&&oa(this),Cr()}function pn(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Nn&&Nn.push(this)}pn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};pn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ws(this),Ss(this),kt++;var e=Re;return Re=this,I_.bind(this,e)};pn.prototype.N=function(){2&this.f||(this.f|=2,this.u=Dn,Dn=this)};pn.prototype.d=function(){this.f|=8,1&this.f||oa(this)};pn.prototype.dispose=function(){this.d()};function wt(e,t){var n=new pn(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Cs,Ir,Rr,E_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Rs=[];wt(function(){Cs=this.N})();function fn(e,t){Y[e]=t.bind(null,Y[e]||function(){})}function Tr(e){if(Rr){var t=Rr;Rr=void 0,t()}Rr=e&&e.S()}function Ts(e){var t=this,n=e.data,r=dt(n);r.value=n;var o=Z(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=pe(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),_=pe(function(){return!Array.isArray(u.value)&&!$o(u.value)}),p=wt(function(){if(this.N=Is,_.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){p(),d.call(this)},[_,u]},[]),i=o[0],s=o[1];return i.value?s.peek():s.value}Ts.displayName="ReactiveTextNode";Object.defineProperties(Ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ts},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});fn("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof Ve&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)});fn("__r",function(e,t){if(e(t),t.type!==ce){Tr();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o,i){var s;return wt(function(){s=this},{name:i}),s.c=o,s})(function(){var o;E_&&((o=n.y)==null||o.call(n)),r.__$f|=1,r.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Ir=r,Tr(n)}});fn("__e",function(e,t,n,r){Tr(),Ir=void 0,e(t,n,r)});fn("diffed",function(e,t){Tr(),Ir=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||r&&s in r||(l.d(),i[s]=void 0)}if(r){i||(i={},n.U=i);for(var c in r){var u=i[c],_=r[c];u===void 0?(u=A_(n,c,_,o),i[c]=u):u.o(_,o)}}}e(t)});function A_(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=J(n);return{o:function(s,l){i.value=s,r=l},d:wt(function(){this.N=Is;var s=i.value.value;r[t]!==s&&(r[t]=s,o?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}fn("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){var _=u.__$u;_&&(u.__$u=void 0,_.d())}}e(t)});fn("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)});et.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function dt(e,t){return Z(function(){return J(e,t)},[])}function ut(e,t){var n=M(e);return n.current=e,Ir.__$f|=4,Z(function(){return pe(function(){return n.current()},t)},[])}var M_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function L_(){it(function(){for(var e;e=Rs.shift();)Cs.call(e)})}function Is(){Rs.push(this)===1&&(Y.requestAnimationFrame||M_)(L_)}function Es(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function As(e){return Es(e)}function Ms(e){return!(!Es(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function O_(e){return`${C.cssPrefix}:${e}`}function Ls(e,t){let r=Object.entries(t).map(([o,i])=>{let s=O_(o),l=c=>i(c.detail);return e.addEventListener(s,l),[s,l]});return()=>{for(let[o,i]of r)e.removeEventListener(o,i)}}function Er(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var N_=900,D_=640;function aa(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let r=t.initialSize;return r==="expanded"||r==="fullscreen"||r==="normal"?r:n>0&&n<D_?"fullscreen":n>=(t.autoSizeBreakpoint??N_)?"expanded":"normal"}function Fn(e,t,n,r=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:aa(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function mn(){return typeof window>"u"?0:window.innerWidth}var $_="x-public-key",F_="x-ai-agent-deployment-id";function Os(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[F_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??$_]=e.publicKey),t}}}function Bn(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(i,e),o=()=>i();t?.addEventListener("abort",o,{once:!0});function i(){clearTimeout(r),t?.removeEventListener("abort",o),n()}})}var Ar="1.1.3";var We=class extends Error{constructor(n,r,o,i){super(n);te(this,"code",r);te(this,"status",o);te(this,"cause",i);this.name="StreamError"}};var Ns=ee.scope("parser");async function*Ds(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new We(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of B_(e,t)){let r=H_(n);if(r==="done")return;r&&(yield r)}}async function*B_(e,t){if(!e.body)throw new We("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),r="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:o,value:i}=await n.read();if(o){let l=r.trim();l&&(yield l);return}r+=i;let s;for(;(s=r.indexOf(`
|
|
8
8
|
|
|
9
9
|
`))!==-1;){let l=r.slice(0,s);r=r.slice(s+2),yield l}}}finally{n.releaseLock()}}function H_(e){let t="",n;for(let r of e.split(`
|
|
10
10
|
`))if(!(r===""||r.startsWith(":"))){if(r.startsWith("data:")){let o=r.slice(5).replace(/^ /,"");t=t?`${t}
|
|
11
|
-
${o}`:o;continue}r.startsWith("id:")&&(n=r.slice(3).trim())}if(t==="[DONE]")return"done";if(!t)return null;try{let r=JSON.parse(t);return Ns.trace("chunk",{type:r.type,eventId:n}),{chunk:r,eventId:n}}catch(r){throw Ns.trace("frame parse failed",{err:r,payload:t.slice(0,200)}),new We("invalid SSE frame","network",void 0,r)}}function U_(e){let t=new TextEncoder().encode(e),n="";for(let r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var $s=e=>e&&Object.keys(e).length>0?e:void 0;function Fs(e,t){let n=$s(e),r=$s(t);if(!n&&!r)return;let o={};return n&&(o.user=n),r&&(o.page=r),U_(JSON.stringify(o))}function Mr(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function z_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Bs(e){return e.startsWith("tool-")?e.slice(5):e}var Ze={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",cancelOperatorRequest:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Hs="context";function Et(e){let t=e??{},n=t.controlMode;return{controlMode:n==="awaiting_operator"||n==="operator"?n:"ai-agent",controlRevision:typeof t.controlRevision=="number"&&Number.isSafeInteger(t.controlRevision)&&t.controlRevision>=0?t.controlRevision:void 0,assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function Lr(e){let t=e?.suggestions;if(!Array.isArray(t))return[];let n=[];for(let r of t){if(!r||typeof r!="object")continue;let{id:o,label:i,text:s}=r;typeof i!="string"||!i||n.push({id:typeof o=="string"&&o?o:`s${n.length}`,label:i,text:typeof s=="string"&&s?s:i})}return n}function ia(e){let n={messages:e.messages.map(r=>({id:r.serverMessageId??r.id,parts:V_(r),role:r.role,createdAt:r.createdAt!==void 0?new Date(r.createdAt).toISOString():void 0})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs),n}function q_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function V_(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&q_(n)){let r=n.dynamic?{type:"dynamic-tool",toolName:n.toolName,toolCallId:n.toolCallId,state:n.state}:{type:z_(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(r.input=n.input),n.output!==void 0&&(r.output=n.output),n.error!==void 0&&(r.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(r.approval=n.approval),t.push(r)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var ae=ee.scope("transport"),W_=6e4,G_=1e4,la=50,Us=3,K_=400,j_=3e4,X_=1e4,Y_=6e4,J_=15e3,Q_=1024*1024,zs=new Set([408,425,429,500,502,503,504]);function qs(e){return K_*2**e+Math.floor(Math.random()*250)}function Z_(e){return Y_+Math.ceil(e/Q_)*J_}function ep(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),r=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(r)&&r>=0?Math.min(r,3e4):null}var Or=class{constructor(t){ne(this,"ttlMs",t);ne(this,"map",new Map)}getOrFetch(t,n){let r=this.map.get(t);if(r&&Date.now()-r.at<this.ttlMs)return r.result;let o={at:Date.now(),result:n().then(i=>(o.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,o),o.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&Date.now()-n.at<this.ttlMs)return n.value}clear(){this.map.clear()}},Nr=class{constructor(t){ne(this,"opts",t);ne(this,"visitorId");ne(this,"conversationId");ne(this,"userContext");ne(this,"pageContext");ne(this,"locale");ne(this,"conversationsCache",new Or(G_));ne(this,"contentCache",new Or(W_))}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:Ar};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Fs(this.userContext,this.pageContext);return n&&(t[Hs]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,r]of Object.entries(this.envelope()))t.append(n,r);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[r,o]of Object.entries(this.envelope()))n.searchParams.has(r)||n.searchParams.set(r,o);return n.toString()}async handshake(t){ae.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(Ze.handshake,t,"handshake");return ae.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),rp(n)||ae.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t,n){ae.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let r=new FormData;r.append("file",t,t.name);let o=await this.postForm(this.uploadPath,r,"upload",n,Z_(t.size));return ae.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){ae.debug("transcribe \u2192",{size:t.size,mimeType:n});let r=new FormData;r.append("audio",t,`voice.${tp(n)}`),r.append("mimeType",n);let o=await this.postForm(this.transcribePath,r,"transcribe");return ae.debug("transcribe \u2190",{textLen:o.text.length}),o}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={}){return this.conversationsCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchConversations(t))}async fetchConversations(t){let n=new URL(this.url(Ze.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.ids?.length&&n.searchParams.set("ids",t.ids.join(",")),ae.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,page:t.page,limit:t.limit,ids:t.ids});let r=await this.getJson(n.toString(),"listConversations");return ae.debug("listConversations \u2190",{count:r.conversations.length,page:r.pagination.page,hasNext:r.pagination.hasNext}),r}async loadConversation(t,{ids:n=[],beforeId:r}={}){let o=new URL(this.url(Ze.listMessages));o.searchParams.set("conversationId",t),o.searchParams.set("limit",String(la)),o.searchParams.set("sortBy","_id"),o.searchParams.set("sortOrder","desc"),n.length>0&&o.searchParams.set("ids",n.join(",")),r&&o.searchParams.set("beforeId",r),ae.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId,ids:n.length>0?n:void 0,beforeId:r});let i=await this.getJson(o.toString(),"loadConversation"),s=(i.messages??[]).toReversed();return ae.debug("loadConversation \u2190",{conversationId:i.conversationId,canContinue:i.canContinue,messageCount:s.length,hasSuggestions:!!i.suggestions}),{...i,messages:s,canContinue:i.canContinue??!0}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),ae.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(Ze.markRead,{conversationId:t},"markRead")}catch(n){ae.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){ae.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Ze.requestOperator,{},"requestOperator")).controlState}catch(t){ae.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId)){ae.debug("cancelOperatorRequest \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(Ze.cancelOperatorRequest,{},"cancelOperatorRequest")).controlState}catch(t){ae.debug("cancelOperatorRequest failed (non-fatal)",{err:t});return}}}listContent(t={}){return this.contentCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchContent(t))}async fetchContent(t){let n=new URL(this.dataUrl(Ze.content));for(let[i,s]of Object.entries(t))s!==void 0&&n.searchParams.set(i,Array.isArray(s)?s.join(","):String(s));ae.debug("listContent \u2192",t);let r=await this.getJson(n.toString(),"listContent"),o=(r.items??[]).map(i=>Ti(i,this.locale));return ae.debug("listContent \u2190",{count:o.length,total:r.pagination?.total}),{...r,items:o}}async bootstrap(t){let n=new URL(this.dataUrl(Ze.bootstrap));t&&n.searchParams.set("conversationId",t),ae.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let r=await this.getJson(n.toString(),"bootstrap"),o=r.forms??[],i=r.formSubmissions??[];return ae.debug("bootstrap \u2190",{forms:o.length,formSubmissions:i.length}),{forms:o,formSubmissions:i}}async saveUserPrefs(t){ae.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(Ze.updateSettings,{userPrefs:t},"saveUserPrefs");return ae.debug("saveUserPrefs \u2190",{success:n.success}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??Ze.submitForm}async submitForm(t){ae.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){ae.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){ae.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(Ze.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){ae.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(t){this.conversationsCache.clear(),ae.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});try{return await this.runWithAbort(async n=>{let r=await this.fetchImpl(this.url(Ze.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});if(r.status!==202)throw new We(`sendTurn failed: expected 202, received ${r.status}`,"server",r.status);let o;try{o=await r.json()}catch(i){throw n?.aborted?i:new We("sendTurn failed: invalid acknowledgement","server",r.status,i)}if(!np(o))throw new We("sendTurn failed: invalid acknowledgement","server",r.status);return o},void 0,j_)}catch(n){throw n instanceof We?n:new We("sendTurn failed: network error","network",void 0,n)}}cancelTurn(t,n){!this.visitorId||!t||!n||(ae.debug("cancel stream",{conversationId:t,runId:n,visitorId:this.visitorId}),this.fetchImpl(this.url(Ze.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:n})),keepalive:!0}).catch(r=>ae.debug("cancel POST failed (non-fatal)",{err:r})))}async connectResumeStream(t){let n=new AbortController,r=()=>n.abort(t.signal.reason);t.signal.aborted?r():t.signal.addEventListener("abort",r,{once:!0});let o=setTimeout(()=>n.abort(),X_),i=()=>{clearTimeout(o),t.signal.removeEventListener("abort",r)},s;try{s=await this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:n.signal})}catch(l){return i(),t.signal.aborted||ae.debug("resume-stream fetch failed \u2014 reconnecting",{err:l}),"held"}if(clearTimeout(o),!s.ok)return i(),s.status===409||zs.has(s.status)?(ae.debug("resume-stream \u2192 transient response; reconnecting",{status:s.status}),"held"):(ae.debug("resume-stream \u2192 endpoint unavailable",{status:s.status}),"unavailable");if(!s.body)return i(),ae.debug("resume-stream \u2192 bodyless response; stopping",{status:s.status}),"unavailable";if(!(s.headers.get("content-type")??"").includes("text/event-stream"))return i(),ae.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";try{t.onConnected();for await(let{chunk:l}of Ds(s,n.signal)){if(t.signal.aborted)return"held";t.onChunk(l)}}catch(l){if(t.signal.aborted)return"held";ae.debug("resume-stream segment dropped \u2014 reconnecting",{err:l})}finally{i()}return"held"}resumeUrl(){return this.withEnvelopeQuery(Ze.streamResume)}async postJson(t,n,r){let o=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],r);return this.assertOk(o,r)}async postForm(t,n,r,o,i){return this.runWithAbort(async s=>{let l=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n),signal:s});return this.assertOk(l,r)},o,i)}async runWithAbort(t,n,r){if(!n&&r===void 0)return t();let o=new AbortController,i=()=>o.abort(n?.reason);n?.aborted?i():n?.addEventListener("abort",i,{once:!0});let s=r===void 0?void 0:setTimeout(()=>o.abort(),r);try{return await t(o.signal)}finally{s!==void 0&&clearTimeout(s),n?.removeEventListener("abort",i)}}async getJson(t,n){let r=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(r,n)}async fetchWithRetry(t,n){for(let r=0;;r++){let[o,i]=t(),s;try{s=await this.fetchImpl(o,i)}catch(c){if(r>=Us)throw new We(`${n} failed: network error`,"network",void 0,c);ae.debug("request network error \u2014 retrying",{label:n,attempt:r}),await Bn(qs(r));continue}if(s.ok||!zs.has(s.status)||r>=Us)return s;let l=ep(s.headers)??qs(r);ae.debug("request retryable status \u2014 retrying",{label:n,status:s.status,attempt:r,wait:l}),await Bn(l)}}async assertOk(t,n){if(!t.ok)throw new We(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function tp(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function np(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),n=Reflect.get(e,"conversationId"),r=Reflect.get(e,"runId");return t==="accepted"&&typeof n=="string"&&n.length>0&&(r===void 0||typeof r=="string"&&r.length>0)}function rp(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function da(e,t){let n=e?[{kind:"text",id:"t0",textSig:Y(e),doneSig:Y(!0)}]:[];return{id:ot(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:Y(n)}}function Ct(){return{id:ot(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:Y([])}}function Ws(e){let t=ot();return op({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function op(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,feedback:e.feedback,partsSig:Y(e.parts.map(dp))}}var Gs=new Set(["completed","failed","canceled"]);function ap(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status!=null&&!Gs.has(e.status)?"streaming":"complete"}function ua(e){let t=new Set,n=e.parts.map((o,i)=>o.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:Y(o.text),doneSig:Y(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:Y(o.text),doneSig:Y(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType}: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:Bs(o.type),dynamic:o.type==="dynamic-tool"?!0:void 0,inputPartialSig:Y(""),inputSig:Y(o.input),outputSig:Y(o.output),errorSig:Y(o.errorText),stateSig:Y(o.state),approvalSig:Y(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),r=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:r?.type==="data-suggestions"?Lr(r.data):void 0,serverMessageId:e.id,createdAt:Mr(e.createdAt)??Date.now(),status:ap(e),canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:Y(n)}}function ip(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 sp(e){return e.role==="assistant"&&e.status!=null&&!Gs.has(e.status)&&ip(e)}function At(e){let t=e.length-1;return e.filter((n,r)=>r===t||!sp(n)).map(ua)}function Ks(e,t){let n=!t&&e.at(-1)?.role==="assistant"?-2:-1,r=e.at(n);return!r||r.ephemeral?[]:[r]}function _a(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(up)}}function He(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function Mt(e){return He(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function lp(e){return He(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function js(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}var Dr=e=>e.kind==="tool",Xs=e=>e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file";function Hn(e){let t=e.partsSig.value,n=t.findLastIndex(r=>r.kind==="tool");return t.slice(n+1).some(Xs)}function Kt(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(Dr);return t.length>0&&t.every(n=>js(n.stateSig.value))}function jt(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!Hn(e)}function $r(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||Xs(n))}function Fr(e){return e.partsSig.value.some(t=>Dr(t)&&!js(t.stateSig.value))}function Ys(e,t){if(t.length===0)return e;let n=new Set;for(let s of e)n.add(s.id),s.serverMessageId&&n.add(s.serverMessageId);let r=t.filter(s=>{let l=[s.id,s.serverMessageId].filter(c=>c!==void 0);return l.some(c=>n.has(c))?!1:(l.forEach(c=>n.add(c)),!0)});if(r.length===0)return e;let o=e.findIndex(s=>!s.ephemeral),i=o<0?e.length:o;return[...e.slice(0,i),...r,...e.slice(i)]}function Wt(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 Js(e,t,n,r){if(!pa(e))return;if(t.length===0){let s=Math.max(...r.values());return n.find(l=>l.role==="assistant"&&r.get(l.serverMessageId??l.id)===s&&He(l).length>=He(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let i=r.get(o.serverMessageId??o.id);if(i!==void 0)return n.find(s=>s.role==="assistant"&&r.get(s.serverMessageId??s.id)===i+1&&He(s).length>=He(e).length)}function pa(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function Qs(e,t){let n=t.filter(p=>!p.ephemeral&&(p.status==="streaming"||p.status==="pending"||p.status==="error"||p.retryAction!==void 0||(p.attachments?.length??0)>0||Mt(p))),r=new Map;for(let p of n)r.set(p.id,p),p.serverMessageId!==void 0&&r.set(p.serverMessageId,p);let o=new Set,i=[],s=e.map(p=>{let d=(p.serverMessageId!==void 0?r.get(p.serverMessageId):void 0)??r.get(p.id);return d===void 0?(i.push(p),p):(o.add(d),d.role!==p.role?p:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?Wt(d,p):d.status==="streaming"||He(d).length>=He(p).length?(d.suggestions??(d.suggestions=p.suggestions),d.feedback===void 0&&(d.feedback=p.feedback),p.canceled&&(d.canceled=!0),d):Wt(d,p))}),l=n.filter(p=>!o.has(p)),c=l.findLast(pa),u=new Map;e.forEach((p,d)=>{u.set(p.id,d),p.serverMessageId!==void 0&&u.set(p.serverMessageId,d)});let _=Js(c,c?n.slice(0,n.indexOf(c)):[],i,u);if(c&&_){let p=s.indexOf(_);p>=0&&(s[p]=Wt(c,_)),l=l.filter(d=>d!==c)}return[...s,...l]}function Un(e,t){let n=new Map(t.filter(p=>p.serverMessageId!==void 0).map(p=>[p.serverMessageId,p])),r=new Map;t.forEach((p,d)=>{r.set(p.id,d),p.serverMessageId!==void 0&&r.set(p.serverMessageId,d)});let o=new Set(e.flatMap(p=>[p.serverMessageId,p.id].filter(d=>d!==void 0))),i=!1,s=e.map(p=>{let d=n.get(p.serverMessageId??p.id);if(d===void 0||d.role!==p.role)return p;if(p.role==="user"&&p.serverMessageId===void 0)return i=!0,Wt(p,d);if(p.serverMessageId===void 0)return p;let f=He(d),m=He(p),v=d.status!=="streaming"&&f.length>=m.length&&ca(p,d);if(f.length>m.length||f===m&&d.partsSig.value.length>p.partsSig.value.length||v)return i=!0,Wt(p,d);if(p.status==="streaming"&&d.status!=="streaming"&&cp(p,d)){if(p.continuationStreaming&&Fr(d))return p;if(!ca(d,p))return i=!0,Wt(p,d)}return p}),l=[...n.values()].filter(p=>!o.has(p.serverMessageId)),c=s.findLastIndex(pa),u=s[c],_=Js(u,s.slice(0,c),l,r);if(u!==void 0&&_!==void 0&&He(_).length>=He(u).length&&(Wt(u,_),s[c]=_,l.splice(l.indexOf(_),1),i=!0),l.length===0)return{messages:i?s:e,changed:i};for(let p of l){let d=r.get(p.serverMessageId??p.id),f=!1,m=s.findIndex(v=>{let h=r.get(v.serverMessageId??v.id);return d===void 0?!1:h===void 0?f:h>d?!0:(f=!0,!1)});m===-1?s.push(p):s.splice(m,0,p)}return{messages:s,changed:!0}}function Zs(e,t){if(e.role!==t.role)return!1;let n=He(t),r=He(e);return n.length>r.length||t.partsSig.value.length>e.partsSig.value.length||ca(e,t)}function cp(e,t){let n=e.partsSig.value,r=t.partsSig.value;return n.length!==r.length?!1:n.every((o,i)=>{let s=r[i];switch(o.kind){case"text":return s?.kind==="text"&&s.textSig.value===o.textSig.value;case"reasoning":return s?.kind==="reasoning"&&s.textSig.value===o.textSig.value;case"step-start":return s?.kind==="step-start";case"tool":return s?.kind==="tool"&&s.toolCallId===o.toolCallId&&Br(s.toolName,o.toolName);case"file":return s?.kind==="file"&&s.url===o.url&&s.mediaType===o.mediaType;case"source":return s?.kind==="source"&&s.sourceId===o.sourceId&&s.url===o.url&&s.title===o.title&&s.filename===o.filename&&s.mediaType===o.mediaType;default:return o}})}function Br(e,t){let n=e.startsWith("tool:")?e.slice(5):e,r=t.startsWith("tool:")?t.slice(5):t;return n===r}var Vs={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function ca(e,t){let n=new Map(e.partsSig.value.filter(Dr).map(r=>[r.toolCallId,r]));return t.partsSig.value.filter(Dr).some(r=>{let o=n.get(r.toolCallId);if(!o||Vs[r.stateSig.value]>Vs[o.stateSig.value])return!0;let i=r.approvalSig.value?.approved;return i!==void 0&&i!==o.approvalSig.value?.approved})}function Gt(e){return e.role==="assistant"&&e.status!=="streaming"&&!Mt(e)}function Hr(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"&&!Gt(t))return;let n=e.indexOf(t);for(let r=n-1;r>=0;r--){let o=e[r];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function el(e){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!lp(e)}function tl(e,t){return e.operatorRoutedTurn?Gt(e)?"drop":"complete-operator-routed":t||Gt(e)?"error":"complete"}function dp(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:Y(e.text),doneSig:Y(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,dynamic:e.dynamic,inputPartialSig:Y(e.inputPartial),inputSig:Y(e.input),outputSig:Y(e.output),errorSig:Y(e.error),stateSig:Y(e.state),approvalSig:Y(e.approval)}:e}function up(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,dynamic:e.dynamic,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var nl=ee.scope("feedback:audio"),Ur=class{constructor(){ne(this,"ctx",null);ne(this,"master",null);ne(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){nl.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let u=n.createGain(),_=o+l*i;u.gain.setValueAtTime(1e-4,_),u.gain.exponentialRampToValueAtTime(t.peakGain,_+.005),u.gain.exponentialRampToValueAtTime(1e-4,_+i),c.connect(u).connect(r),c.start(_),c.stop(_+i+.01)})}async playUrl(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let i=n.createBufferSource();i.buffer=o,i.connect(r),i.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let r=this.ctx,o=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>r.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(nl.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var rl={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},ol={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 Lt=null,zr=0;function _p(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function pp(){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=`__${C.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function al(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(_p())try{navigator.vibrate(e);return}catch{}if(Lt||(Lt=pp()),!!Lt)try{Lt.label.click()}catch{}}}function il(){zr++;let e=!1;return()=>{e||(e=!0,zr=Math.max(0,zr-1),zr===0&&Lt&&(Lt.input.remove(),Lt.label.remove(),Lt=null))}}var fp=ee.scope("feedback"),mp=100,qr=class{constructor(t,n){ne(this,"mutedSig",Y(!1));ne(this,"audio",new Ur);ne(this,"releaseHaptics");ne(this,"sound");ne(this,"haptics");ne(this,"lastPlayed",new Map);ne(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=il(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<mp}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(o=>fp.warn("audio play failed",{err:o,url:n}));return}let r=ol[t];r&&this.audio.playTone(r)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let r=n===!0||n===void 0?rl[t]:n;al(r)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};var gp=0;function a(e,t,n,r,o,i){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--gp,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return X.vnode&&X.vnode(u),u}var j={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},zn=`${C.cssPrefix}-icon-dir`,fa=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),pt=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})}),sl=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})}),ll=()=>a("svg",{...j,class:zn,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]}),cl=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})}),dl=()=>a("svg",{...j,class:zn,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})}),gn=()=>a("svg",{...j,class:zn,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})}),ul=()=>a("svg",{...j,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),_l=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),pl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),a("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),fl=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),ml=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),gl=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),vl=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),hl=()=>a("svg",{...j,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),bl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),yl=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),Pl=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),xl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),a("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),Sl=()=>a("svg",{...j,class:zn,"aria-hidden":"true",children:a("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Xt=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})}),kl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M3 3v6h6"}),a("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),a("path",{d:"M12 7v5l3 2"})]}),wl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M2 12h20"}),a("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),qn=()=>a("svg",{...j,class:zn,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Cl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M12 20h9"}),a("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Yt=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})}),Rl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),a("path",{d:"M14 2v6h6"})]}),vp=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),a("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),ma=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),Vn=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),a("path",{d:"M12 17h.01"})]}),hp=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"m15 4 3 3-9 9-3-3z"}),a("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),bp=()=>a("svg",{...j,"aria-hidden":"true",children:[a("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),a("path",{d:"M12 8V4"}),a("circle",{cx:"12",cy:"3",r:"1"}),a("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),ga=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),a("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),a("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),a("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),yp=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("circle",{cx:"12",cy:"12",r:"4"}),a("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),va=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]}),Tl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Il=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M3 9.5 12 3l9 6.5"}),a("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),El=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"m3 11 15-5v12L3 13z"}),a("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),a("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),a("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Wn=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),a("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),Al=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"4"}),a("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),Ml=()=>a("svg",{...j,"aria-hidden":"true",children:a("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Ll=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 3v18"}),a("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),Pp=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),a("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),a("path",{d:"m20 20-4.4-4.4"})]}),xp=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),a("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),Sp=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M4 18h16"}),a("path",{d:"M5 18a7 7 0 0 1 14 0"}),a("path",{d:"M12 8V6"}),a("path",{d:"M10 6h4"})]}),kp=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),a("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),Ol=()=>a("svg",{...j,"aria-hidden":"true",children:[a("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),a("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),Nl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),a("path",{d:"M7 10l4-7a2.5 2.5 0 0 1 2.5 2.5V8h5a2 2 0 0 1 2 2.3l-1.2 8A2 2 0 0 1 17.3 20H7"})]}),Dl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),a("path",{d:"M17 14l-4 7a2.5 2.5 0 0 1-2.5-2.5V16h-5a2 2 0 0 1-2-2.3l1.2-8A2 2 0 0 1 6.7 4H17"})]}),$l=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"3.5"}),a("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9l-2.1 2.1M7 17l-2.1 2.1"})]}),Fl=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]}),Vr=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Wr=()=>a("svg",{...j,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]}),Bl={chat:fa,message:ma,bubbles:Wn,spark:vp,wand:hp,bot:bp,help:Vn,lifebuoy:yp,headset:ga,search:Pp,sparkles:xp,concierge:Sp,wave:kp};var D=C.cssPrefix,R={launcher:`${D}-launcher`,callout:`${D}-callout`,calloutDismiss:`${D}-callout-dismiss`,panel:`${D}-panel`,panelHeader:`${D}-panel-header`,resizeGrip:`${D}-resize-grip`,scrollToBottom:`${D}-scroll-to-bottom`,loadPreviousMessages:`${D}-load-previous-messages`,actionHistory:`${D}-action-history`,actionClose:`${D}-action-close`,langSegment:`${D}-lang-segment`,composer:`${D}-composer`,composerInput:`${D}-composer-input`,composerSend:`${D}-composer-send`,composerStop:`${D}-composer-stop`,composerAttach:`${D}-composer-attach`,composerFileInput:`${D}-composer-file-input`,composerVoice:`${D}-composer-voice`,attachmentChip:`${D}-attachment-chip`,attachmentRemove:`${D}-attachment-remove`,suggestion:`${D}-suggestion`,messageBubble:`${D}-message`,messageRetry:`${D}-message-retry`,messageFeedback:`${D}-message-feedback`,feedbackUp:`${D}-feedback-up`,feedbackDown:`${D}-feedback-down`,messageCopy:`${D}-message-copy`,historyPane:`${D}-history-pane`,historyBack:`${D}-history-back`,historyItem:`${D}-history-item`,historyLoadMore:`${D}-history-load-more`,sidebar:`${D}-sidebar`,sidebarToggle:`${D}-sidebar-toggle`,sidebarNewConversation:`${D}-sidebar-new-conversation`,sidebarItem:`${D}-sidebar-item`,messengerHome:`${D}-messenger-home`,modulesEmpty:`${D}-modules-empty`,tab:`${D}-tab`,tabBadge:`${D}-tab-badge`,homeView:`${D}-home-view`,homeGreeting:`${D}-home-greeting`,homeBrand:`${D}-home-brand`,backHeader:`${D}-back-header`,contentView:`${D}-content-view`,contentScroll:`${D}-content-scroll`,homeSearch:`${D}-home-search`,helpSearch:`${D}-help-search`,homeRecent:`${D}-home-recent`,homeContentRow:`${D}-home-content-row`,helpArticle:`${D}-help-article`,newsItem:`${D}-news-item`,formGate:`${D}-form-gate`,formDone:`${D}-form-done`,formDoneToggle:`${D}-form-done-toggle`,formAnswers:`${D}-form-answers`,formFill:`${D}-form-fill`,formSubmit:`${D}-form-submit`,formSkip:`${D}-form-skip`,formField:`${D}-form-field`,toolAskQuestions:`${D}-tool-ask-questions`,toolInputSubmit:`${D}-tool-input-submit`,toolInputSkip:`${D}-tool-input-skip`,toolApproval:`${D}-tool-approval`,toolApprove:`${D}-tool-approve`,toolReject:`${D}-tool-reject`,toolEdit:`${D}-tool-edit`,toolDecision:`${D}-tool-decision`,typingDots:`${D}-typing-dots`,reasoning:`${D}-reasoning`,toolAskSummary:`${D}-ask-questions-summary`,toolAskOptions:`${D}-ask-questions-options-toggle`,toolCall:`${D}-tool-call`,source:`${D}-source`,operatorRequest:`${D}-operator-request`,operatorBanner:`${D}-operator-banner`,cancelOperatorRequest:`${D}-cancel-operator-request`};function Ge(e,t){return`${e}-${t}`}var Gr=C.cssPrefix;function Hl({onToggle:e,launcher:t,strings:n,leaving:r,edgeTab:o}){let i=t.variant!=="circle"&&!!t.label;return a("button",{type:"button",class:`${Gr}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":o?"true":void 0,"data-leaving":r?"true":void 0,"data-testid":R.launcher,onClick:e,"aria-label":n.launcherOpen,children:[wp(t.icon),i?a("span",{class:`${Gr}-fab-label`,children:Je(n,t.label??"")}):null]})}function wp(e){let t=Bl[e];return t?a(t,{}):a(Cp,{source:e})}function Cp({source:e}){return a("span",{ref:t=>{t&&Rp(t,e)},"aria-hidden":"true"})}function Rp(e,t){if(e.dataset.svgMounted!==t)try{let r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;r&&r.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(r,!0)),e.dataset.svgMounted=t)}catch{}}function Ul({callout:e,launcherPosition:t,strings:n,closeLabel:r,onDismiss:o}){let[i,s]=O(!1);return E(()=>{let l=setTimeout(()=>s(!0),e.delayMs);return()=>clearTimeout(l)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let l=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(l)},[i,e.autoDismissMs,o]),i?a("div",{class:`${Gr}-callout`,role:"status","data-shape":e.shape,"data-position":Tp(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":R.callout,children:[a("span",{children:Je(n,e.text)}),a("button",{type:"button",class:`${Gr}-callout-close`,onClick:o,"aria-label":r,title:r,"data-testid":R.calloutDismiss,children:a(pt,{})})]}):null}function Tp(e,t){let n=t.endsWith("-right"),r=t.startsWith("bottom-");return e==="vertical"?r?"top":"bottom":n?"left":"right"}function Kr({panelEl:e,resize:t,position:n,initialSize:r,onSizeChange:o,strings:i}){let s=C.cssPrefix,l=M(null);if(E(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${s}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${s}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${s}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${s}-resize-max-h`,t.maxHeight),r&&(m.setProperty(`--${s}-widget-w`,`${r.width}px`),m.setProperty(`--${s}-widget-h`,`${r.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,s,r]),!e)return null;let c=n.startsWith("top-"),u=n.endsWith("-right"),_=`${s}-resize-grip ${s}-resize-grip--${c?"bottom":"top"}-${u?"left":"right"}`,p=m=>{if(!e)return;let v=m.currentTarget,h=e.getBoundingClientRect();l.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:h.width,startH:h.height,dirX:u?-1:1,dirY:c?1:-1},v.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},d=m=>{let v=l.current;if(!v||m.pointerId!==v.pointerId||!e)return;let h=(m.clientX-v.startX)*v.dirX,x=(m.clientY-v.startY)*v.dirY;e.style.setProperty(`--${s}-widget-w`,`${v.startW+h}px`),e.style.setProperty(`--${s}-widget-h`,`${v.startH+x}px`)},f=m=>{let v=l.current;if(!v||m.pointerId!==v.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let h=e.getBoundingClientRect();o({width:Math.round(h.width),height:Math.round(h.height)}),l.current=null};return a("div",{class:_,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:p,onPointerMove:d,onPointerUp:f,onPointerCancel:f,"data-testid":R.resizeGrip,children:a(hl,{})})}var Jt=C.cssPrefix,Ip=`.${Jt}-header, .${Jt}-back-header, .${Jt}-home-hero`,Ep='button, a, input, textarea, select, [role="tab"], [contenteditable]',zl=56;function jr(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,r=(c,u)=>Math.min(u,Math.max(-u,c)),o=null,i=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(Ip)||u.closest(Ep))return;let _=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Jt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Jt}-modal-dy`)),maxX:(window.innerWidth+_.width)/2-zl,maxY:(window.innerHeight+_.height)/2-zl},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!o||c.pointerId!==o.id)return;let u=r(o.dx+c.clientX-o.x,o.maxX),_=r(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${Jt}-modal-dx`,`${u}px`),e.style.setProperty(`--${Jt}-modal-dy`,`${_}px`)},l=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Gn(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Xr(e,t,n){return Gn("close",e,t)?n.includes("close"):!1}function ql(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Ap='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Yr(e){let t=n=>{if(n.key!=="Tab")return;let r=[...e.querySelectorAll(Ap)].filter(l=>l.offsetParent!==null||l===document.activeElement);if(r.length===0){n.preventDefault();return}let o=r[0],i=r[r.length-1];if(!o||!i)return;let s=e.getRootNode().activeElement;n.shiftKey&&s===o?(n.preventDefault(),i.focus()):!n.shiftKey&&s===i&&(n.preventDefault(),o.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Jr(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var ha=C.cssPrefix;function Vl({agent:e,strings:t}){let n=e.status??"online",r=Je(t,e.name),o=e.title?Je(t,e.title):null;return a("div",{class:`${ha}-agent`,children:[a("div",{class:`${ha}-agent-avatar`,"data-status":n,children:e.avatar?a("img",{src:e.avatar,alt:""}):a("span",{children:Jr(r)})}),a("div",{class:`${ha}-agent-meta`,children:[a("strong",{children:r}),o?a("span",{children:o}):null]})]})}var Wl=ee.scope("attachments");function Qr(e,t,n){let r=Lp(e),o=[],i=[],s=Dp(n.accept),l=t.reduce((u,_)=>u+_.size,0),c=t.length;for(let u of r){let _=Mp(u,c,l,n,s);if(_){i.push({file:u,reason:_});continue}o.push(Np(u)),l+=u.size,c+=1}return(o.length||i.length)&&Wl.debug("ingest",{accepted:o.length,rejected:i.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:i}}function Zr(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Wl.debug("revokeObjectURL failed",{error:t})}}function Mp(e,t,n,r,o){return t>=r.maxCount?"count":n+e.size>r.maxBytes?"bytes":$p(e,o)?null:"mime"}function Lp(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Op(t)).filter(t=>t!==null):[]}function Op(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Np(e){return{file:e,id:ot(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Dp(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",r="*"]=t.split("/");return{kind:"mime",type:n,subtype:r}})}function $p(e,t){if(t.length===0)return!0;let[n="*",r="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?o.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===r))}var Kn=C.cssPrefix;function Gl({attachment:e,onRemove:t,disabled:n=!1}){let r=e.mediaType.startsWith("image/");return a("span",{class:`${Kn}-attachment-chip`,title:e.name,"data-testid":Ge(R.attachmentChip,e.id),children:[r?a("img",{class:`${Kn}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${Kn}-attachment-thumb`,"aria-hidden":"true",children:a(Rl,{})}),a("span",{class:`${Kn}-attachment-name`,children:e.name}),a("button",{type:"button",class:`${Kn}-attachment-remove`,onClick:t,disabled:n,"aria-label":`Remove ${e.name}`,"data-testid":Ge(R.attachmentRemove,e.id),children:a(pt,{})})]})}var ba={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function ya(e,t,n){return e==="disabled"?ba:e==="server"?Up(n):Fp(t)}function Fp(e){let t=Bp();if(!t)return ba;let n=null,r=0;return{isSupported:!0,start(o,i){let s=n,l=++r;n=null,s?.abort();let c=new t;n=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",p=>{if(r!==l||n!==c)return;let d=p,f="",m=!1;for(let v=d.resultIndex;v<d.results.length;v++){let h=d.results[v];h&&(f+=h[0].transcript,h.isFinal&&(m=!0))}o(f,m)});let _=()=>{u||r!==l||n!==c||(u=!0,n=null,i())};c.addEventListener("end",_),c.addEventListener("error",_);try{c.start()}catch{_()}},stop(){n?.stop()},cancel(){r++;let o=n;n=null,o?.abort()}}}function Bp(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Hp=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Up(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ba;let t=0,n=null,r=s=>{for(let l of s.stream?.getTracks()??[])l.stop();s.stream=null},o=()=>{t++;let s=n;n=null,s&&(r(s),s.recorder?.state!=="inactive"&&s.recorder?.stop())},i=async s=>{if(s.finishing)return;s.finishing=!0;let l=s.recorder?.mimeType??"audio/webm";r(s);let c=new Blob(s.chunks,{type:l});s.chunks=[];try{let{text:u}=await e(c,l);n===s&&t===s.generation&&u&&s.onText(u,!0)}catch{}finally{n===s&&t===s.generation&&(n=null,s.onEnd())}};return{isSupported:!0,async start(s,l){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:s,onEnd:l,finishing:!1};n=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(n!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let _=zp(),p=new MediaRecorder(u,_?{mimeType:_}:void 0);c.recorder=p,p.addEventListener("dataavailable",d=>{n===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),p.addEventListener("stop",()=>{n===c&&t===c.generation&&i(c)}),p.start()}catch{r(c),n===c&&t===c.generation&&(n=null,l())}},stop(){let s=n;if(s){if(!s.recorder){o();return}s.recorder.state!=="inactive"&&s.recorder.stop()}},cancel(){o()}}}function zp(){for(let e of Hp)if(MediaRecorder.isTypeSupported(e))return e}var at=C.cssPrefix,vn=ee.scope("composer");function hn(e){return e.reduce((t,n)=>t+n.size,0)}var qp={arrowUp:cl,paperPlane:ll,send:dl,chevron:gn};function Kl(e){return"activeElement"in e}function Vp(e){return"host"in e&&"activeElement"in e}function jl({options:e,transport:t,feedback:n,bus:r,persistence:o,conversationId:i,isStreaming:s,active:l=!0,isPreparing:c=!1,operatorRequestEnabled:u,controlMode:_,onRequestOperator:p,onSend:d,onStop:f,attachApiRef:m}){let v=e.strings,[h,x]=O(()=>o.loadDraft(i)),[P,b]=O([]),[y,k]=O(!1),[w,B]=O(!1),z=M(!1),q=M(null),I=M(null),U=M(null),V=M(0),N=M(i);N.current=i;let Z=M(l);Z.current=l;let le=M(c);le.current=c;let oe=w||c||!l,Le=L(H=>{x(K=>{let te=typeof H=="function"?H(K):H;return te===K?K:(o.saveDraft(N.current,te),te)})},[o]),pe=e.features.fileUpload,_e=e.features.voice,[ye,F]=O(()=>ya(_e,e.locale,(H,K)=>t.transcribe(H,K))),ve=M(ye);ve.current=ye;let ie=M({mode:_e,locale:e.locale,transport:t});E(()=>{let H=ie.current;H.mode===_e&&H.locale===e.locale&&H.transport===t||(ie.current={mode:_e,locale:e.locale,transport:t},V.current++,ve.current.cancel(),U.current=null,k(!1),F(ya(_e,e.locale,(K,te)=>t.transcribe(K,te))))},[e.locale,_e,t]),E(()=>()=>{V.current++,ye.cancel()},[ye]);let Re=L(H=>{let K=U.current;if(K===null)return!1;let te=Date.now()-K;return vn[H]("voiceStop",{durationMs:te}),r.emit("voiceStop",{durationMs:te}),U.current=null,!0},[r]),Oe=L(()=>{U.current!==null&&(ye.stop(),k(!1),Re("info")&&n.play("voiceStop"))},[Re,n,ye]),Se=L(()=>{V.current++,ye.cancel(),k(!1),Re("info")&&n.play("voiceStop")},[Re,n,ye]);E(()=>{(c||!l)&&Se()},[l,Se,c]),E(()=>{let H=q.current;if(!H)return;let K=H.getRootNode(),te=Kl(K)?K.activeElement:null;te&&H.closest(`.${at}-panel`)?.contains(te)||H.focus({preventScroll:!0})},[]),E(()=>{let H=q.current;if(!H)return;if(h.length===0){H.style.height="";return}H.style.height="auto";let K=parseFloat(getComputedStyle(H).fontSize)*.7,te=Math.min(H.scrollHeight,160);H.style.height=`${te<40+K?40:te}px`},[h]);let xe=M(P);xe.current=P,E(()=>()=>xe.current.forEach(Zr),[]),E(()=>{if(m)return m.current={attachFromDrop:H=>{if(!pe||!Z.current||z.current||le.current)return;let K=Qr(H,xe.current,e.attachments);K.accepted.length!==0&&(vn.info("attach (drop)",{count:K.accepted.length,totalBytes:hn(K.accepted)}),r.emit("attach",{count:K.accepted.length,totalBytes:hn(K.accepted)}),b(te=>[...te,...K.accepted]))},fill:H=>{if(!Z.current||z.current||le.current)return;Le(H);let K=q.current;K&&(K.focus({preventScroll:!0}),requestAnimationFrame(()=>K.setSelectionRange(K.value.length,K.value.length)))}},()=>{m.current&&(m.current=null)}},[m,pe,c,e.attachments,Le]),E(()=>{let H=q.current;if(!H)return;let K=H.closest(`.${at}-panel`);if(!K)return;let te=re=>{if(!Z.current||z.current||le.current)return;let rt=re.clipboardData;if(!rt)return;let S=re.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(S&&S!==H)return;if(pe){let ce=Qr(rt.items,xe.current,e.attachments);if(ce.accepted.length>0){re.preventDefault(),vn.info("attach (paste)",{count:ce.accepted.length,totalBytes:hn(ce.accepted)}),r.emit("attach",{count:ce.accepted.length,totalBytes:hn(ce.accepted)}),b(fe=>[...fe,...ce.accepted]);return}}if(S===H)return;let W=rt.getData("text/plain");W&&(re.preventDefault(),Le(ce=>ce+W),H.focus())};return K.addEventListener("paste",te),()=>K.removeEventListener("paste",te)},[pe,e.attachments,Le]);let Ue=async()=>{let H=h.trim();if(!H&&P.length===0||!l||s||z.current||c)return;Se(),z.current=!0,B(!0);let K=h,te=P;try{await d(H,te)&&(Le(re=>re===K?"":re),b(re=>re!==te?re:(te.forEach(Zr),xe.current=[],[])))}finally{z.current=!1,B(!1),requestAnimationFrame(()=>{let re=q.current;if(!re||re.disabled||!Z.current)return;let rt=re.getRootNode(),S=Kl(rt)?rt.activeElement:null,W=S?.getAttribute("data-testid");if(!(S&&S!==re&&W!==R.composerSend&&W!==R.composerStop)){if(Vp(rt)){let ce=rt.host.ownerDocument;if(!ce.hasFocus())return;let fe=ce.activeElement;if(fe&&fe!==rt.host&&fe!==ce.body)return}re.focus({preventScroll:!0})}})}},Pe=H=>{H.key!=="Enter"||H.shiftKey||H.isComposing||(H.preventDefault(),s?f():Ue())},ke=H=>{let K=H.target;if(!l||z.current||c){K.value="";return}let te=Qr(K.files,P,e.attachments);te.accepted.length>0&&(vn.info("attach (file picker)",{count:te.accepted.length,totalBytes:hn(te.accepted)}),r.emit("attach",{count:te.accepted.length,totalBytes:hn(te.accepted)}),b(re=>[...re,...te.accepted])),K.value=""},Ie=H=>{!l||z.current||c||(vn.info("removeAttachment",{id:H}),r.emit("removeAttachment",{id:H}),b(K=>{let te=K.find(re=>re.id===H);return te&&Zr(te),K.filter(re=>re.id!==H)}))},ze=()=>{if(y){Oe();return}if(!l||!ye.isSupported||z.current||c)return;let H=++V.current;U.current=Date.now(),vn.info("voiceStart"),r.emit("voiceStart",void 0),k(!0),n.play("voiceStart"),ye.start((K,te)=>{V.current!==H||!Z.current||le.current||z.current||!te||Le(re=>`${re}${K} `)},()=>{V.current!==H||!Z.current||(k(!1),Re("debug"))})},nt=qp[e.composer.sendButton.icon];return a("div",{class:`${at}-composer`,"data-testid":R.composer,children:[P.length>0?a("div",{class:`${at}-attachments`,children:P.map(H=>a(Gl,{attachment:H,onRemove:()=>Ie(H.id),disabled:oe},H.id))}):null,a("div",{class:`${at}-composer-row`,children:[a("div",{class:`${at}-composer-actions`,children:[pe?a("button",{type:"button",class:`${at}-icon-btn`,onClick:()=>I.current?.click(),disabled:oe,"aria-label":v.attach,"data-testid":R.composerAttach,children:a(_l,{})}):null,ye.isSupported?a("button",{type:"button",class:`${at}-icon-btn`,onClick:ze,disabled:oe,"aria-label":y?v.micStop:v.micStart,"aria-pressed":y,"data-recording":y?"true":void 0,"data-testid":R.composerVoice,children:a(pl,{})}):null,u&&_==="ai-agent"&&p?a("button",{type:"button",class:`${at}-icon-btn`,onClick:p,disabled:oe,"aria-label":v.talkToOperator,title:v.talkToOperator,"data-testid":R.operatorRequest,children:a(ga,{})}):null]}),a("textarea",{ref:q,name:"message",class:`${at}-textarea`,rows:1,value:h,placeholder:v.composerPlaceholder,onInput:H=>Le(H.currentTarget.value),onKeyDown:Pe,disabled:oe,"aria-label":v.composerPlaceholder,"data-testid":R.composerInput}),s?a("button",{type:"button",class:`${at}-send`,onClick:f,disabled:oe,"aria-label":v.stop,"data-testid":R.composerStop,children:a(ul,{})}):a("button",{type:"button",class:`${at}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{Ue()},disabled:oe||!h.trim()&&P.length===0,"aria-label":v.send,"data-testid":R.composerSend,children:a(nt,{})})]}),a("input",{ref:I,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:ke,disabled:oe,class:`${at}-sr-only`,"data-testid":R.composerFileInput})]})}var Wp=C.cssPrefix;function Xl({visible:e,strings:t}){return e?a("div",{class:`${Wp}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function eo({containerRef:e,onDrop:t,disabled:n=!1}){let[r,o]=O(!1);return E(()=>{if(n){o(!1);return}let i=e.current;if(!i)return;let s=0,l=p=>{s+=1,p.dataTransfer?.types.includes("Files")&&(p.preventDefault(),o(!0))},c=()=>{s-=1,!(s>0)&&(s=0,o(!1))},u=p=>{p.dataTransfer?.types.includes("Files")&&p.preventDefault()},_=p=>{s=0,o(!1),p.dataTransfer&&(p.preventDefault(),t(p.dataTransfer.items))};return i.addEventListener("dragenter",l),i.addEventListener("dragleave",c),i.addEventListener("dragover",u),i.addEventListener("drop",_),()=>{i.removeEventListener("dragenter",l),i.removeEventListener("dragleave",c),i.removeEventListener("dragover",u),i.removeEventListener("drop",_)}},[e,n,t]),{visible:n?!1:r}}function Yl({itemCount:e,initialFocusIndex:t}){let[n,r]=O(!1),o=M(null),i=M(null),[s,l]=O(-1),c=L(()=>{r(!1),l(-1),o.current?.focus()},[]),u=L(()=>r(d=>!d),[]);E(()=>{if(!n)return;let d=f=>{let m=i.current,v=o.current;if(!m||!v)return;let h=f.composedPath();h.includes(m)||h.includes(v)||(r(!1),l(-1))};return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[n]),E(()=>{if(!n||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;l(f)},[n,e,t]),E(()=>{if(!n||s<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let _=L(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(!0))},[]),p=L(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),c();return;case"ArrowDown":d.preventDefault(),l(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),l(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),l(0);return;case"End":d.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:o,menuRef:i,toggle:u,close:c,onTriggerKey:_,onMenuKey:p}}function Jl({items:e,triggerLabel:t}){let n=C.cssPrefix,r=Yl({itemCount:e.length}),o=l=>{l.disabled||(l.onSelect?.(),l.keepOpen||r.close())},i=(l,c)=>l.onSelectValue?.(c),s=(l,c)=>{let u=c.segments;if(!u?.length)return;let _=Math.max(0,u.findIndex(d=>d.value===c.value)),p=-1;if(l.key==="ArrowRight"||l.key==="Enter"||l.key===" ")p=(_+1)%u.length;else if(l.key==="ArrowLeft")p=(_-1+u.length)%u.length;else return;l.preventDefault(),l.stopPropagation(),i(c,u[p].value)};return a("div",{class:`${n}-menu-wrap`,children:[a("button",{ref:r.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":r.open,title:t,onClick:r.toggle,onKeyDown:r.onTriggerKey,children:a(bl,{})}),r.open?a("div",{ref:r.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:r.onMenuKey,tabIndex:-1,children:e.map(l=>l.segments?a("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":l.label,tabIndex:-1,onKeyDown:c=>s(c,l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":l.label,children:l.segments.map(c=>{let u=c.value===l.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${n}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${R.langSegment}-${c.value}`,onClick:()=>i(l,c.value),children:c.label},c.value)})})]},l.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":l.type==="switch"?l.on:void 0,disabled:l.disabled,onClick:()=>o(l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),l.type==="switch"&&l.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(Xt,{})}):null]},l.id))}):null]})}var Pa=C.cssPrefix;function Gp(e){let t=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)").matches:!0;return e==="auto"?t?"light":"dark":t?e==="light"?"dark":"auto":e==="dark"?"light":"auto"}var Kp={normal:"large",large:"small",small:"normal"};function jp(e){return e==="light"?a(Al,{}):e==="dark"?a(Ml,{}):a(Ll,{})}function Xp(e){return(e.split("-")[0]??e).toUpperCase()}function ft({panelProps:e,variant:t}){let{options:n,panelSize:r,feedback:o,onClose:i,onClear:s,onExpand:l,onFullscreen:c,onSoundToggle:u}=e,{onToggleHistory:_,onLocaleChange:p,onThemeChange:d,onTextSizeChange:f}=e,m=n.strings,v=n.mode,h=t==="chat",x=wt(()=>o.mutedSig.value).value,P=new Set(n.actions),b=N=>P.has(N),y=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,k=N=>y?!1:Gn(N,v,r),w=n.themeMode,B={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},z=n.textSize,q={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},I=[];if(h&&b("clear")&&I.push({id:"clear",icon:a(Cl,{}),label:m.newConversation,onSelect:s}),b("expand")&&k("expand")){let N=r==="expanded";I.push({id:"expand",icon:N?a(ml,{}):a(fl,{}),label:N?m.collapse:m.expand,type:"switch",on:N,onSelect:l})}if(b("fullscreen")&&k("fullscreen")){let N=r==="fullscreen";I.push({id:"fullscreen",icon:N?a(vl,{}):a(gl,{}),label:N?m.exitFullscreen:m.fullscreen,type:"switch",on:N,onSelect:c})}h&&b("sound")&&I.push({id:"sound",icon:x?a(Pl,{}):a(yl,{}),label:x?m.soundOff:m.soundOn,type:"switch",on:!x,onSelect:u}),b("theme")&&I.push({id:"theme",icon:jp(w),label:`${m.theme}: ${B[w]}`,onSelect:()=>d(Gp(w)),keepOpen:!0}),b("textSize")&&I.push({id:"textSize",icon:a(xl,{}),label:`${m.textSize}: ${q[z]}`,onSelect:()=>f(Kp[z]),keepOpen:!0}),b("language")&&n.availableLocales.length>1&&I.push({id:"language",icon:a(wl,{}),label:m.language,segments:n.availableLocales.map(N=>({value:N,label:Xp(N),lang:N})),value:n.locale,onSelectValue:p});let U=!!i&&Xr(v,r,n.actions),V=h&&b("history");return a("div",{class:`${Pa}-header-actions`,children:[V?a("button",{type:"button",class:`${Pa}-icon-btn`,onClick:_,"aria-label":m.history,title:m.history,"data-testid":R.actionHistory,children:a(kl,{})}):null,I.length>0?a(Jl,{items:I,triggerLabel:m.moreActions}):null,U?a("button",{type:"button",class:`${Pa}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":R.actionClose,children:a(pt,{})}):null]})}var Yp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Jp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Qp=/^[+]?[\d\s().-]{6,}$/;function bn(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>String(t[r]??`{${r}}`))}function Zp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function ef(e,t,n){let r=e.required??!0,o=e.validation;if(e.type==="multiselect"){let s=Zp(t);return r&&s===0?n.formRequired:s===0?void 0:o?.minSelections!=null&&s<o.minSelections?bn(n.formChooseAtLeast,{min:o.minSelections}):o?.maxSelections!=null&&s>o.maxSelections?bn(n.formChooseAtMost,{max:o.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return r?n.formRequired:void 0;switch(e.type){case"email":if(!Yp.test(i))return n.formInvalidEmail;break;case"url":if(!Jp.test(i))return n.formInvalidUrl;break;case"tel":if(!Qp.test(i))return n.formInvalidTel;break;case"number":{let s=Number(i);if(!Number.isFinite(s))return n.formInvalidNumber;if(o?.min!=null&&s<o.min)return bn(n.formNumberTooSmall,{min:o.min});if(o?.max!=null&&s>o.max)return bn(n.formNumberTooLarge,{max:o.max});break}default:break}if(o?.minLength!=null&&i.length<o.minLength)return bn(n.formTooShort,{min:o.minLength});if(o?.maxLength!=null&&i.length>o.maxLength)return bn(n.formTooLong,{max:o.maxLength});if(o?.pattern)try{if(!new RegExp(o.pattern).test(i))return n.formPatternMismatch}catch{}}function Ql(e,t,n){let r={};for(let o of e){let i=ef(o,t[o.name],n);i&&(r[o.name]=i)}return r}function Zl(e){let t={};for(let[n,r]of Object.entries(e)){let o=Array.isArray(r)?r.join(", "):r;o&&o.trim()&&(t[n]=o.trim())}return t}var we=C.cssPrefix,to="__other__";function jn({fields:e,strings:t,submitLabel:n,onSubmit:r,skipLabel:o,onSkip:i,footerHint:s,submitOnEnter:l,disabled:c,initialValues:u,hideActions:_,fieldTypeLabels:p,rootTestId:d,submitTestId:f,skipTestId:m}){let[v,h]=O(()=>({...of(e),...u})),[x,P]=O({}),[b,y]=O({}),k=I=>{b[I]&&y(U=>({...U,[I]:""}))},w=(I,U)=>{h(V=>({...V,[I]:U})),k(I)},B=(I,U)=>{P(V=>({...V,[I]:U})),k(I)},z=I=>{if(I.preventDefault(),c)return;let U=af(e,v,x),V=Ql(e,U,t);if(Object.keys(V).length>0){y(V);return}r(Zl(U))},q=I=>{!l||I.key!=="Enter"||I.shiftKey||I.isComposing||I.target?.tagName==="TEXTAREA"&&z(I)};return a("form",{class:`${we}-form`,onSubmit:z,onKeyDown:q,"data-testid":d,noValidate:!0,children:[e.map(I=>a(tf,{field:I,value:v[I.name],otherText:x[I.name]??"",error:b[I.name],disabled:c,typeLabel:p?.[I.name],strings:t,onChange:U=>w(I.name,U),onOtherChange:U=>B(I.name,U)},I.name)),_?null:a("div",{class:`${we}-form-actions`,children:[s?a("span",{class:`${we}-form-hint`,children:s}):null,o&&i?a("button",{type:"button",class:`${we}-form-skip`,onClick:i,disabled:c,"data-testid":m,children:o}):null,a("button",{type:"submit",class:`${we}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function tf({field:e,value:t,otherText:n,error:r,disabled:o,typeLabel:i,strings:s,onChange:l,onOtherChange:c}){let u=Ge(R.formField,e.name),_=nf({field:e,value:t,otherText:n,disabled:o,strings:s,onChange:l,onOtherChange:c,fieldTid:u});return a("label",{class:`${we}-field`,"data-field":e.name,"data-invalid":r?"true":void 0,children:[a("span",{class:`${we}-field-head`,children:[a("span",{class:`${we}-field-label`,children:[e.label,e.required??!0?a("span",{class:`${we}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${we}-field-type`,children:i}):null]}),_,e.validationHint&&!r?a("span",{class:`${we}-field-hint`,children:e.validationHint}):null,r?a("span",{class:`${we}-field-error`,role:"alert",children:r}):null]})}function nf(e){let{field:t,value:n,otherText:r,disabled:o,strings:i,onChange:s,onOtherChange:l,fieldTid:c}=e,u=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${we}-field-input`,rows:3,value:u,placeholder:t.placeholder,disabled:o,onInput:_=>s(_.target.value),"data-testid":c});case"select":return a("select",{class:`${we}-field-input`,value:u,disabled:o,onChange:_=>s(_.target.value),"data-testid":c,children:[a("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(_=>a("option",{value:_.value,children:_.label??_.value},_.value))]});case"radio":{let _=t.allowOther&&u===to;return a("div",{class:`${we}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(p=>a("label",{class:`${we}-choice`,children:[a("input",{type:"radio",name:`${we}-${t.name}`,checked:u===p.value,disabled:o,onChange:()=>s(p.value)}),a("span",{children:p.label??p.value})]},p.value)),t.allowOther?a("label",{class:`${we}-choice`,children:[a("input",{type:"radio",name:`${we}-${t.name}`,checked:u===to,disabled:o,onChange:()=>s(to)}),a("span",{children:i.formOther})]}):null,_?a("input",{class:`${we}-field-input`,value:r,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:o,onInput:p=>l(p.target.value)}):null]})}case"checkbox":return a("label",{class:`${we}-choice`,children:[a("input",{type:"checkbox",checked:u==="true",disabled:o,onChange:_=>s(_.target.checked?"true":""),"data-testid":c}),a("span",{children:t.placeholder??t.label})]});case"multiselect":{let _=Array.isArray(n)?n:[],p=(d,f)=>s(f?[..._,d]:_.filter(m=>m!==d));return a("div",{class:`${we}-field-choices`,"data-testid":c,children:[(t.options??[]).map(d=>a("label",{class:`${we}-choice`,children:[a("input",{type:"checkbox",checked:_.includes(d.value),disabled:o,onChange:f=>p(d.value,f.target.checked)}),a("span",{children:d.label??d.value})]},d.value)),t.allowOther||(t.options??[]).length===0?a("textarea",{class:`${we}-field-input`,rows:2,value:r,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:o,onInput:d=>l(d.target.value)}):null]})}default:return a("input",{class:`${we}-field-input`,type:rf(t.type),value:u,placeholder:t.placeholder,disabled:o,onInput:_=>s(_.target.value),"data-testid":c})}}function rf(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function of(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(r=>r.trim()).filter(Boolean):n.defaultValue);return t}function af(e,t,n){let r={...t};for(let o of e){let i=n[o.name]?.trim();if(o.type==="radio"&&o.allowOther&&t[o.name]===to)r[o.name]=i??"";else if(o.type==="multiselect"&&i){let s=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),l=Array.isArray(t[o.name])?t[o.name]:[];r[o.name]=[...l,...s]}}return r}var mt=C.cssPrefix;function xa({form:e,strings:t,onSubmit:n,onSkip:r}){return a("div",{class:`${mt}-form-gate`,"data-testid":R.formGate,children:[e.title?a("h3",{class:`${mt}-form-gate-title`,children:e.title}):null,e.description?a("p",{class:`${mt}-form-gate-desc`,children:e.description}):null,a(jn,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?r:void 0,submitTestId:R.formSubmit,skipTestId:R.formSkip})]})}function ec({marker:e,strings:t,onFill:n}){let r=e.outcome==="skipped",o=r?t.formSkipped:t.formSubmitted,i=e.title?a(de,{children:[a("span",{children:e.title}),a("span",{class:`${mt}-sr-only`,children:o})]}):a("span",{children:o}),s=e.form?.reviewable??!1,l=!r&&s&&e.values&&Object.keys(e.values).length>0?e.values:null;if(l){let c=u=>e.form?.fields.find(_=>_.name===u)?.label??u;return a("details",{class:`${mt}-form-done`,"data-outcome":e.outcome,"data-testid":R.formDone,children:[a("summary",{class:`${mt}-form-done-summary`,"data-testid":R.formDoneToggle,children:[a(Xt,{}),i,a(gn,{})]}),a("dl",{class:`${mt}-form-answers`,"data-testid":R.formAnswers,children:Object.entries(l).map(([u,_])=>a("div",{class:`${mt}-form-answer`,children:[a("dt",{children:c(u)}),a("dd",{children:_})]},u))})]})}return a("div",{class:`${mt}-form-done`,"data-outcome":e.outcome,"data-testid":R.formDone,role:"status",children:[r?a(Sl,{}):a(Xt,{}),i,r&&e.form?.reopenable&&n?a("button",{type:"button",class:`${mt}-form-done-fill`,"data-testid":R.formFill,onClick:n,children:t.formFillOut}):null]})}function cf(e,t){for(var n in t)e[n]=t[n];return e}function ka(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function tc(e,t){this.props=e,this.context=t}function cc(e,t){function n(o){var i=this.props.ref;return i!=o.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,o)||i!=o.ref:ka(this.props,o)}function r(o){return this.shouldComponentUpdate=n,Pt(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.__f=r.prototype.isReactComponent=!0,r.type=e,r}(tc.prototype=new Qe).isPureReactComponent=!0,tc.prototype.shouldComponentUpdate=function(e,t){return ka(this.props,e)||ka(this.state,t)};var nc=X.__b;X.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),nc&&nc(e)};var qb=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var df=X.__e;X.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),o.__c(e,t)}df(e,t,n,r)};var rc=X.unmount;function dc(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=cf({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return dc(r,t,n)})),e}function uc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return uc(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Sa(){this.__u=0,this.o=null,this.__b=null}function _c(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function no(){this.i=null,this.l=null}X.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),rc&&rc(e)},(Sa.prototype=new Qe).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=_c(r.__v),i=!1,s=function(){i||r.__z||(i=!0,n.__R=null,o?o(c):c())};n.__R=s;var l=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=uc(u,u.__c.__P,u.__c.__O)}var _;for(r.setState({__a:r.__b=null});_=r.o.pop();)_.__P=l,_.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Sa.prototype.componentWillUnmount=function(){this.o=[]},Sa.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=dc(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&Pt(de,null,e.fallback);return o&&(o.__u&=-33),[Pt(de,null,t.__a?null:e.children),o]};var oc=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(no.prototype=new Qe).__a=function(e){var t=this,n=_c(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),oc(t,e,r)):o()};n?n(i):i()}},no.prototype.render=function(e){this.i=null,this.l=new Map;var t=An(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},no.prototype.componentDidUpdate=no.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){oc(e,n,t)})};var uf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_f=/^(?: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]/,pf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ff=/[A-Z0-9]/g,mf=typeof document<"u",gf=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Qe.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Qe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ac=X.event;X.event=function(e){return ac&&(e=ac(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var pc,vf={configurable:!0,get:function(){return this.class}},ic=X.vnode;X.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")==-1;for(var s in n){var l=n[s];if(!(s==="value"&&"defaultValue"in n&&l==null||mf&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||gf(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":pf.test(s)&&(s=c):c=s="oninput":i&&_f.test(s)?s=s.replace(ff,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=l}}r=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=An(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),o.defaultValue!=null&&(o.value=An(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",vf)):n.className&&(o.class=o.className=n.className),t.props=o})(e),e.$$typeof=uf,ic&&ic(e)};var sc=X.__r;X.__r=function(e){sc&&sc(e),pc=e.__c};var lc=X.diffed;X.diffed=function(e){lc&&lc(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),pc=null};function ro(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var st=C.cssPrefix;function Ca(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function oo(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",r=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:r,decided:n||r}}function Ra({status:e,icon:t,label:n}){return a("span",{class:`${st}-toolui-badge ${st}-toolui-status`,"data-status":e,children:[a("span",{class:`${st}-toolui-status-icon`,children:t}),n]})}function hf(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function Ta(e,t,n={}){return n.submitted?"responded":Pf(hf(e,t),n.superseded,n.live??!0)}function bf({status:e}){return e==="denied"||e==="error"||e==="superseded"?a(Wr,{}):e==="completed"||e==="responded"?a(Vr,{}):a(Fl,{})}function yf(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function Pf(e,t,n){return t&&(e==="awaiting"||e==="running")?"superseded":!n&&e==="running"?"error":e}function xf({state:e,approval:t,strings:n,superseded:r,live:o=!0,submitted:i=!1}){let s=Ta(e,t,{superseded:r,live:o,submitted:i});return a(Ra,{status:s,icon:a(bf,{status:s}),label:yf(s,n)})}function Sf({name:e,state:t,approval:n,strings:r,superseded:o,live:i,submitted:s}){return a(de,{children:[a("span",{class:`${st}-toolui-name-pill`,children:[a($l,{}),a("span",{class:`${st}-toolui-name-text`,children:e})]}),a(xf,{state:t,approval:n,strings:r,superseded:o,live:i,submitted:s}),a("span",{class:`${st}-toolui-chevron`,children:a(Yt,{})})]})}function ao({part:e,strings:t,testid:n,superseded:r,live:o,submitted:i}){let s=Q(()=>me(()=>e.inputSig.value),[e]),l=Q(()=>me(()=>e.outputSig.value),[e]),c=Q(()=>me(()=>e.errorSig.value),[e]),u=Q(()=>me(()=>e.stateSig.value),[e]),_=Q(()=>me(()=>e.approvalSig.value),[e]);return a("details",{class:`${st}-toolui ${st}-toolui-collapsible`,"data-testid":n,children:[a("summary",{class:`${st}-toolui-head`,children:a(Sf,{name:Ca(e.toolName),state:u.value,approval:_.value,strings:t,superseded:r,live:o,submitted:i})}),a(wa,{label:t.toolParameters,value:s.value}),l.value!==void 0?a(wa,{label:t.toolResult,value:l.value}):null,c.value?a(wa,{label:t.statusError,value:c.value,error:!0}):null]})}function wa({label:e,value:t,error:n}){let r=n?String(t??""):io(Ia(t));return r?a("div",{class:`${st}-toolui-section`,children:[a("span",{class:`${st}-toolui-label`,children:e}),a("pre",{class:`${st}-toolui-code`,"data-error":n?"true":void 0,children:r})]}):null}function Ia(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function io(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 fc(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function mc(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function kf(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function gc(e){let{streaming:t,reasoningVisible:n,emptyReply:r,hidden:o}=e,i=e.responseMode==="buffered"&&t,s=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:i,reasoningVisible:n,working:s,showStreamDots:kf({streaming:t,bufferedHold:i,reasoningVisible:n,working:s}),emptyReply:r,hidden:o}}function vc(e,t){let n=e.stateSig.value,r=e.approvalSig.value,{terminal:o,responded:i,decided:s}=oo(n,r),l=t.continuationStreaming===!0&&!s,c=t.superseded&&!s&&!l;return{pill:Ta(n,r,{superseded:c,live:t.live,submitted:l}),state:n,terminal:o,decided:s||l,showApproveReject:!s&&!t.superseded&&!l,showAnswered:i&&!o&&!c,showSubmitted:l,showEdit:i&&t.active&&!o,skipped:c,answeredApproved:r?.approved}}var Ma=1,bc=2,yc=4,Pc=8,xc=16;function wf(e){switch(e){case Ma:return"href";case bc:return"src";case yc:return"class";case Pc:return"checked";case xc:return"start"}}var Cf=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},Rf=Cf;var hc=24;function Oa(e){let t=new Uint32Array(hc);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(hc),indent:"",indent_len:0,table_state:0}}function Sc(e){e.pending.length>0&&Xe(e,`
|
|
12
|
-
`)}function
|
|
13
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){
|
|
14
|
-
`:if(e.hr_chars<3)break;so(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),Rt(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Ea(e,23),Aa(e,2),Xe(e,r.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=r,e.fence_start=r.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=r,e.fence_start=r.length):(
|
|
15
|
-
`:{so(e,e.indent_len),
|
|
16
|
-
`:e.table_state=2,e.pending="";continue;default:
|
|
17
|
-
`:
|
|
18
|
-
`:
|
|
11
|
+
${o}`:o;continue}r.startsWith("id:")&&(n=r.slice(3).trim())}if(t==="[DONE]")return"done";if(!t)return null;try{let r=JSON.parse(t);return Ns.trace("chunk",{type:r.type,eventId:n}),{chunk:r,eventId:n}}catch(r){throw Ns.trace("frame parse failed",{err:r,payload:t.slice(0,200)}),new We("invalid SSE frame","network",void 0,r)}}function U_(e){let t=new TextEncoder().encode(e),n="";for(let r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var $s=e=>e&&Object.keys(e).length>0?e:void 0;function Fs(e,t){let n=$s(e),r=$s(t);if(!n&&!r)return;let o={};return n&&(o.user=n),r&&(o.page=r),U_(JSON.stringify(o))}function Mr(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function z_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Bs(e){return e.startsWith("tool-")?e.slice(5):e}var tt={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",cancelOperatorRequest:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Hs="context";function Et(e){let t=e??{},n=t.controlMode;return{controlMode:n==="awaiting_operator"||n==="operator"?n:"ai-agent",controlRevision:typeof t.controlRevision=="number"&&Number.isSafeInteger(t.controlRevision)&&t.controlRevision>=0?t.controlRevision:void 0,assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function Lr(e){let t=e?.suggestions;if(!Array.isArray(t))return[];let n=[];for(let r of t){if(!r||typeof r!="object")continue;let{id:o,label:i,text:s}=r;typeof i!="string"||!i||n.push({id:typeof o=="string"&&o?o:`s${n.length}`,label:i,text:typeof s=="string"&&s?s:i})}return n}function ia(e){let n={messages:e.messages.map(r=>({id:r.serverMessageId??r.id,parts:V_(r),role:r.role,createdAt:r.createdAt!==void 0?new Date(r.createdAt).toISOString():void 0})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs),n}function q_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function V_(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&q_(n)){let r=n.dynamic?{type:"dynamic-tool",toolName:n.toolName,toolCallId:n.toolCallId,state:n.state}:{type:z_(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(r.input=n.input),n.output!==void 0&&(r.output=n.output),n.error!==void 0&&(r.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(r.approval=n.approval),t.push(r)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var re=ee.scope("transport"),W_=6e4,G_=1e4,la=50,Us=3,K_=400,j_=3e4,X_=1e4,Y_=6e4,J_=15e3,Q_=1024*1024,zs=new Set([408,425,429,500,502,503,504]);function qs(e){return K_*2**e+Math.floor(Math.random()*250)}function Z_(e){return Y_+Math.ceil(e/Q_)*J_}function ep(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),r=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(r)&&r>=0?Math.min(r,3e4):null}var Or=class{constructor(t){te(this,"ttlMs",t);te(this,"map",new Map)}getOrFetch(t,n){let r=this.map.get(t);if(r&&Date.now()-r.at<this.ttlMs)return r.result;let o={at:Date.now(),result:n().then(i=>(o.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,o),o.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&Date.now()-n.at<this.ttlMs)return n.value}clear(){this.map.clear()}},Nr=class{constructor(t){te(this,"opts",t);te(this,"visitorId");te(this,"conversationId");te(this,"userContext");te(this,"pageContext");te(this,"locale");te(this,"conversationsCache",new Or(G_));te(this,"contentCache",new Or(W_))}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:Ar};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Fs(this.userContext,this.pageContext);return n&&(t[Hs]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,r]of Object.entries(this.envelope()))t.append(n,r);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[r,o]of Object.entries(this.envelope()))n.searchParams.has(r)||n.searchParams.set(r,o);return n.toString()}async handshake(t){re.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(tt.handshake,t,"handshake");return re.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),rp(n)||re.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t,n){re.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let r=new FormData;r.append("file",t,t.name);let o=await this.postForm(this.uploadPath,r,"upload",n,Z_(t.size));return re.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){re.debug("transcribe \u2192",{size:t.size,mimeType:n});let r=new FormData;r.append("audio",t,`voice.${tp(n)}`),r.append("mimeType",n);let o=await this.postForm(this.transcribePath,r,"transcribe");return re.debug("transcribe \u2190",{textLen:o.text.length}),o}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={}){return this.conversationsCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchConversations(t))}async fetchConversations(t){let n=new URL(this.url(tt.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.ids?.length&&n.searchParams.set("ids",t.ids.join(",")),re.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,page:t.page,limit:t.limit,ids:t.ids});let r=await this.getJson(n.toString(),"listConversations");return re.debug("listConversations \u2190",{count:r.conversations.length,page:r.pagination.page,hasNext:r.pagination.hasNext}),r}async loadConversation(t,{ids:n=[],beforeId:r}={}){let o=new URL(this.url(tt.listMessages));o.searchParams.set("conversationId",t),o.searchParams.set("limit",String(la)),o.searchParams.set("sortBy","_id"),o.searchParams.set("sortOrder","desc"),n.length>0&&o.searchParams.set("ids",n.join(",")),r&&o.searchParams.set("beforeId",r),re.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId,ids:n.length>0?n:void 0,beforeId:r});let i=await this.getJson(o.toString(),"loadConversation"),s=(i.messages??[]).toReversed();return re.debug("loadConversation \u2190",{conversationId:i.conversationId,canContinue:i.canContinue,messageCount:s.length,hasSuggestions:!!i.suggestions}),{...i,messages:s,canContinue:i.canContinue??!0}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),re.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(tt.markRead,{conversationId:t},"markRead")}catch(n){re.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){re.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(tt.requestOperator,{},"requestOperator")).controlState}catch(t){re.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId)){re.debug("cancelOperatorRequest \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(tt.cancelOperatorRequest,{},"cancelOperatorRequest")).controlState}catch(t){re.debug("cancelOperatorRequest failed (non-fatal)",{err:t});return}}}listContent(t={}){return this.contentCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchContent(t))}async fetchContent(t){let n=new URL(this.dataUrl(tt.content));for(let[i,s]of Object.entries(t))s!==void 0&&n.searchParams.set(i,Array.isArray(s)?s.join(","):String(s));re.debug("listContent \u2192",t);let r=await this.getJson(n.toString(),"listContent"),o=(r.items??[]).map(i=>Ti(i,this.locale));return re.debug("listContent \u2190",{count:o.length,total:r.pagination?.total}),{...r,items:o}}async bootstrap(t){let n=new URL(this.dataUrl(tt.bootstrap));t&&n.searchParams.set("conversationId",t),re.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let r=await this.getJson(n.toString(),"bootstrap"),o=r.forms??[],i=r.formSubmissions??[];return re.debug("bootstrap \u2190",{forms:o.length,formSubmissions:i.length}),{forms:o,formSubmissions:i}}async saveUserPrefs(t){re.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(tt.updateSettings,{userPrefs:t},"saveUserPrefs");return re.debug("saveUserPrefs \u2190",{success:n.success}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??tt.submitForm}async submitForm(t){re.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){re.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){re.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(tt.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){re.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(t){this.conversationsCache.clear(),re.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});try{return await this.runWithAbort(async n=>{let r=await this.fetchImpl(this.url(tt.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});if(r.status!==202)throw new We(`sendTurn failed: expected 202, received ${r.status}`,"server",r.status);let o;try{o=await r.json()}catch(i){throw n?.aborted?i:new We("sendTurn failed: invalid acknowledgement","server",r.status,i)}if(!np(o))throw new We("sendTurn failed: invalid acknowledgement","server",r.status);return o},void 0,j_)}catch(n){throw n instanceof We?n:new We("sendTurn failed: network error","network",void 0,n)}}cancelTurn(t,n){!this.visitorId||!t||!n||(re.debug("cancel stream",{conversationId:t,runId:n,visitorId:this.visitorId}),this.fetchImpl(this.url(tt.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:n})),keepalive:!0}).catch(r=>re.debug("cancel POST failed (non-fatal)",{err:r})))}async connectResumeStream(t){let n=new AbortController,r=()=>n.abort(t.signal.reason);t.signal.aborted?r():t.signal.addEventListener("abort",r,{once:!0});let o=setTimeout(()=>n.abort(),X_),i=()=>{clearTimeout(o),t.signal.removeEventListener("abort",r)},s;try{s=await this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:n.signal})}catch(l){return i(),t.signal.aborted||re.debug("resume-stream fetch failed \u2014 reconnecting",{err:l}),"held"}if(clearTimeout(o),!s.ok)return i(),s.status===409||zs.has(s.status)?(re.debug("resume-stream \u2192 transient response; reconnecting",{status:s.status}),"held"):(re.debug("resume-stream \u2192 endpoint unavailable",{status:s.status}),"unavailable");if(!s.body)return i(),re.debug("resume-stream \u2192 bodyless response; stopping",{status:s.status}),"unavailable";if(!(s.headers.get("content-type")??"").includes("text/event-stream"))return i(),re.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";try{t.onConnected();for await(let{chunk:l}of Ds(s,n.signal)){if(t.signal.aborted)return"held";t.onChunk(l)}}catch(l){if(t.signal.aborted)return"held";re.debug("resume-stream segment dropped \u2014 reconnecting",{err:l})}finally{i()}return"held"}resumeUrl(){return this.withEnvelopeQuery(tt.streamResume)}async postJson(t,n,r){let o=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],r);return this.assertOk(o,r)}async postForm(t,n,r,o,i){return this.runWithAbort(async s=>{let l=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n),signal:s});return this.assertOk(l,r)},o,i)}async runWithAbort(t,n,r){if(!n&&r===void 0)return t();let o=new AbortController,i=()=>o.abort(n?.reason);n?.aborted?i():n?.addEventListener("abort",i,{once:!0});let s=r===void 0?void 0:setTimeout(()=>o.abort(),r);try{return await t(o.signal)}finally{s!==void 0&&clearTimeout(s),n?.removeEventListener("abort",i)}}async getJson(t,n){let r=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(r,n)}async fetchWithRetry(t,n){for(let r=0;;r++){let[o,i]=t(),s;try{s=await this.fetchImpl(o,i)}catch(c){if(r>=Us)throw new We(`${n} failed: network error`,"network",void 0,c);re.debug("request network error \u2014 retrying",{label:n,attempt:r}),await Bn(qs(r));continue}if(s.ok||!zs.has(s.status)||r>=Us)return s;let l=ep(s.headers)??qs(r);re.debug("request retryable status \u2014 retrying",{label:n,status:s.status,attempt:r,wait:l}),await Bn(l)}}async assertOk(t,n){if(!t.ok)throw new We(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function tp(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function np(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),n=Reflect.get(e,"conversationId"),r=Reflect.get(e,"runId");return t==="accepted"&&typeof n=="string"&&n.length>0&&(r===void 0||typeof r=="string"&&r.length>0)}function rp(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function da(e,t){let n=e?[{kind:"text",id:"t0",textSig:J(e),doneSig:J(!0)}]:[];return{id:ot(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:J(n)}}function Ct(){return{id:ot(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:J([])}}function Ws(e){let t=ot();return op({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function op(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,feedback:e.feedback,partsSig:J(e.parts.map(dp))}}var Gs=new Set(["completed","failed","canceled"]);function ap(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status!=null&&!Gs.has(e.status)?"streaming":"complete"}function ua(e){let t=new Set,n=e.parts.map((o,i)=>o.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:J(o.text),doneSig:J(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:J(o.text),doneSig:J(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType}: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:Bs(o.type),dynamic:o.type==="dynamic-tool"?!0:void 0,inputPartialSig:J(""),inputSig:J(o.input),outputSig:J(o.output),errorSig:J(o.errorText),stateSig:J(o.state),approvalSig:J(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),r=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:r?.type==="data-suggestions"?Lr(r.data):void 0,serverMessageId:e.id,createdAt:Mr(e.createdAt)??Date.now(),status:ap(e),canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:J(n)}}function ip(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 sp(e){return e.role==="assistant"&&e.status!=null&&!Gs.has(e.status)&&ip(e)}function At(e){let t=e.length-1;return e.filter((n,r)=>r===t||!sp(n)).map(ua)}function Ks(e,t){let n=!t&&e.at(-1)?.role==="assistant"?-2:-1,r=e.at(n);return!r||r.ephemeral?[]:[r]}function _a(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(up)}}function Ue(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function Mt(e){return Ue(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function lp(e){return Ue(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function js(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}var Dr=e=>e.kind==="tool",Xs=e=>e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file";function Hn(e){let t=e.partsSig.value,n=t.findLastIndex(r=>r.kind==="tool");return t.slice(n+1).some(Xs)}function Kt(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(Dr);return t.length>0&&t.every(n=>js(n.stateSig.value))}function jt(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!Hn(e)}function $r(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||Xs(n))}function Fr(e){return e.partsSig.value.some(t=>Dr(t)&&!js(t.stateSig.value))}function Ys(e,t){if(t.length===0)return e;let n=new Set;for(let s of e)n.add(s.id),s.serverMessageId&&n.add(s.serverMessageId);let r=t.filter(s=>{let l=[s.id,s.serverMessageId].filter(c=>c!==void 0);return l.some(c=>n.has(c))?!1:(l.forEach(c=>n.add(c)),!0)});if(r.length===0)return e;let o=e.findIndex(s=>!s.ephemeral),i=o<0?e.length:o;return[...e.slice(0,i),...r,...e.slice(i)]}function Wt(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 Js(e,t,n,r){if(!pa(e))return;if(t.length===0){let s=Math.max(...r.values());return n.find(l=>l.role==="assistant"&&r.get(l.serverMessageId??l.id)===s&&Ue(l).length>=Ue(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let i=r.get(o.serverMessageId??o.id);if(i!==void 0)return n.find(s=>s.role==="assistant"&&r.get(s.serverMessageId??s.id)===i+1&&Ue(s).length>=Ue(e).length)}function pa(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function Qs(e,t){let n=t.filter(p=>!p.ephemeral&&(p.status==="streaming"||p.status==="pending"||p.status==="error"||p.retryAction!==void 0||(p.attachments?.length??0)>0||Mt(p))),r=new Map;for(let p of n)r.set(p.id,p),p.serverMessageId!==void 0&&r.set(p.serverMessageId,p);let o=new Set,i=[],s=e.map(p=>{let d=(p.serverMessageId!==void 0?r.get(p.serverMessageId):void 0)??r.get(p.id);return d===void 0?(i.push(p),p):(o.add(d),d.role!==p.role?p:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?Wt(d,p):d.status==="streaming"||Ue(d).length>=Ue(p).length?(d.suggestions??(d.suggestions=p.suggestions),d.feedback===void 0&&(d.feedback=p.feedback),p.canceled&&(d.canceled=!0),d):Wt(d,p))}),l=n.filter(p=>!o.has(p)),c=l.findLast(pa),u=new Map;e.forEach((p,d)=>{u.set(p.id,d),p.serverMessageId!==void 0&&u.set(p.serverMessageId,d)});let _=Js(c,c?n.slice(0,n.indexOf(c)):[],i,u);if(c&&_){let p=s.indexOf(_);p>=0&&(s[p]=Wt(c,_)),l=l.filter(d=>d!==c)}return[...s,...l]}function Un(e,t){let n=new Map(t.filter(p=>p.serverMessageId!==void 0).map(p=>[p.serverMessageId,p])),r=new Map;t.forEach((p,d)=>{r.set(p.id,d),p.serverMessageId!==void 0&&r.set(p.serverMessageId,d)});let o=new Set(e.flatMap(p=>[p.serverMessageId,p.id].filter(d=>d!==void 0))),i=!1,s=e.map(p=>{let d=n.get(p.serverMessageId??p.id);if(d===void 0||d.role!==p.role)return p;if(p.role==="user"&&p.serverMessageId===void 0)return i=!0,Wt(p,d);if(p.serverMessageId===void 0)return p;let f=Ue(d),m=Ue(p),b=d.status!=="streaming"&&f.length>=m.length&&ca(p,d);if(f.length>m.length||f===m&&d.partsSig.value.length>p.partsSig.value.length||b)return i=!0,Wt(p,d);if(p.status==="streaming"&&d.status!=="streaming"&&cp(p,d)){if(p.continuationStreaming&&Fr(d))return p;if(!ca(d,p))return i=!0,Wt(p,d)}return p}),l=[...n.values()].filter(p=>!o.has(p.serverMessageId)),c=s.findLastIndex(pa),u=s[c],_=Js(u,s.slice(0,c),l,r);if(u!==void 0&&_!==void 0&&Ue(_).length>=Ue(u).length&&(Wt(u,_),s[c]=_,l.splice(l.indexOf(_),1),i=!0),l.length===0)return{messages:i?s:e,changed:i};for(let p of l){let d=r.get(p.serverMessageId??p.id),f=!1,m=s.findIndex(b=>{let v=r.get(b.serverMessageId??b.id);return d===void 0?!1:v===void 0?f:v>d?!0:(f=!0,!1)});m===-1?s.push(p):s.splice(m,0,p)}return{messages:s,changed:!0}}function Zs(e,t){if(e.role!==t.role)return!1;let n=Ue(t),r=Ue(e);return n.length>r.length||t.partsSig.value.length>e.partsSig.value.length||ca(e,t)}function cp(e,t){let n=e.partsSig.value,r=t.partsSig.value;return n.length!==r.length?!1:n.every((o,i)=>{let s=r[i];switch(o.kind){case"text":return s?.kind==="text"&&s.textSig.value===o.textSig.value;case"reasoning":return s?.kind==="reasoning"&&s.textSig.value===o.textSig.value;case"step-start":return s?.kind==="step-start";case"tool":return s?.kind==="tool"&&s.toolCallId===o.toolCallId&&Br(s.toolName,o.toolName);case"file":return s?.kind==="file"&&s.url===o.url&&s.mediaType===o.mediaType;case"source":return s?.kind==="source"&&s.sourceId===o.sourceId&&s.url===o.url&&s.title===o.title&&s.filename===o.filename&&s.mediaType===o.mediaType;default:return o}})}function Br(e,t){let n=e.startsWith("tool:")?e.slice(5):e,r=t.startsWith("tool:")?t.slice(5):t;return n===r}var Vs={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function ca(e,t){let n=new Map(e.partsSig.value.filter(Dr).map(r=>[r.toolCallId,r]));return t.partsSig.value.filter(Dr).some(r=>{let o=n.get(r.toolCallId);if(!o||Vs[r.stateSig.value]>Vs[o.stateSig.value])return!0;let i=r.approvalSig.value?.approved;return i!==void 0&&i!==o.approvalSig.value?.approved})}function Gt(e){return e.role==="assistant"&&e.status!=="streaming"&&!Mt(e)}function Hr(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"&&!Gt(t))return;let n=e.indexOf(t);for(let r=n-1;r>=0;r--){let o=e[r];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function el(e){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!lp(e)}function tl(e,t){return e.operatorRoutedTurn?Gt(e)?"drop":"complete-operator-routed":t||Gt(e)?"error":"complete"}function dp(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:J(e.text),doneSig:J(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,dynamic:e.dynamic,inputPartialSig:J(e.inputPartial),inputSig:J(e.input),outputSig:J(e.output),errorSig:J(e.error),stateSig:J(e.state),approvalSig:J(e.approval)}:e}function up(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,dynamic:e.dynamic,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var nl=ee.scope("feedback:audio"),Ur=class{constructor(){te(this,"ctx",null);te(this,"master",null);te(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){nl.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let u=n.createGain(),_=o+l*i;u.gain.setValueAtTime(1e-4,_),u.gain.exponentialRampToValueAtTime(t.peakGain,_+.005),u.gain.exponentialRampToValueAtTime(1e-4,_+i),c.connect(u).connect(r),c.start(_),c.stop(_+i+.01)})}async playUrl(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let i=n.createBufferSource();i.buffer=o,i.connect(r),i.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let r=this.ctx,o=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>r.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(nl.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var rl={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},ol={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 Lt=null,zr=0;function _p(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function pp(){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=`__${C.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function al(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(_p())try{navigator.vibrate(e);return}catch{}if(Lt||(Lt=pp()),!!Lt)try{Lt.label.click()}catch{}}}function il(){zr++;let e=!1;return()=>{e||(e=!0,zr=Math.max(0,zr-1),zr===0&&Lt&&(Lt.input.remove(),Lt.label.remove(),Lt=null))}}var fp=ee.scope("feedback"),mp=100,qr=class{constructor(t,n){te(this,"mutedSig",J(!1));te(this,"audio",new Ur);te(this,"releaseHaptics");te(this,"sound");te(this,"haptics");te(this,"lastPlayed",new Map);te(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=il(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<mp}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(o=>fp.warn("audio play failed",{err:o,url:n}));return}let r=ol[t];r&&this.audio.playTone(r)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let r=n===!0||n===void 0?rl[t]:n;al(r)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};var gp=0;function a(e,t,n,r,o,i){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--gp,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return Y.vnode&&Y.vnode(u),u}var K={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},zn=`${C.cssPrefix}-icon-dir`,fa=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),ft=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})}),sl=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})}),ll=()=>a("svg",{...K,class:zn,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]}),cl=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})}),dl=()=>a("svg",{...K,class:zn,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})}),gn=()=>a("svg",{...K,class:zn,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})}),ul=()=>a("svg",{...K,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),_l=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),pl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),a("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),fl=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),ml=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),gl=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),vl=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),hl=()=>a("svg",{...K,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),bl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),yl=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),Pl=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),xl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),a("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),Sl=()=>a("svg",{...K,class:zn,"aria-hidden":"true",children:a("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Xt=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})}),kl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M3 3v6h6"}),a("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),a("path",{d:"M12 7v5l3 2"})]}),wl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M2 12h20"}),a("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),qn=()=>a("svg",{...K,class:zn,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Cl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M12 20h9"}),a("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Yt=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})}),Rl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),a("path",{d:"M14 2v6h6"})]}),vp=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),a("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),ma=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),Vn=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),a("path",{d:"M12 17h.01"})]}),hp=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"m15 4 3 3-9 9-3-3z"}),a("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),bp=()=>a("svg",{...K,"aria-hidden":"true",children:[a("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),a("path",{d:"M12 8V4"}),a("circle",{cx:"12",cy:"3",r:"1"}),a("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),ga=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),a("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),a("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),a("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),yp=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("circle",{cx:"12",cy:"12",r:"4"}),a("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),va=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]}),Tl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Il=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M3 9.5 12 3l9 6.5"}),a("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),El=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"m3 11 15-5v12L3 13z"}),a("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),a("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),a("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Wn=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),a("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),Al=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"4"}),a("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),Ml=()=>a("svg",{...K,"aria-hidden":"true",children:a("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Ll=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 3v18"}),a("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),Pp=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),a("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),a("path",{d:"m20 20-4.4-4.4"})]}),xp=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),a("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),Sp=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M4 18h16"}),a("path",{d:"M5 18a7 7 0 0 1 14 0"}),a("path",{d:"M12 8V6"}),a("path",{d:"M10 6h4"})]}),kp=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),a("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),Ol=()=>a("svg",{...K,"aria-hidden":"true",children:[a("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),a("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),Nl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),a("path",{d:"M7 10l4-7a2.5 2.5 0 0 1 2.5 2.5V8h5a2 2 0 0 1 2 2.3l-1.2 8A2 2 0 0 1 17.3 20H7"})]}),Dl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),a("path",{d:"M17 14l-4 7a2.5 2.5 0 0 1-2.5-2.5V16h-5a2 2 0 0 1-2-2.3l1.2-8A2 2 0 0 1 6.7 4H17"})]}),$l=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"3.5"}),a("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9l-2.1 2.1M7 17l-2.1 2.1"})]}),Fl=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]}),Vr=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Wr=()=>a("svg",{...K,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]}),Bl={chat:fa,message:ma,bubbles:Wn,spark:vp,wand:hp,bot:bp,help:Vn,lifebuoy:yp,headset:ga,search:Pp,sparkles:xp,concierge:Sp,wave:kp};var $=C.cssPrefix,R={launcher:`${$}-launcher`,callout:`${$}-callout`,calloutDismiss:`${$}-callout-dismiss`,panel:`${$}-panel`,panelHeader:`${$}-panel-header`,resizeGrip:`${$}-resize-grip`,scrollToBottom:`${$}-scroll-to-bottom`,loadPreviousMessages:`${$}-load-previous-messages`,actionHistory:`${$}-action-history`,actionClose:`${$}-action-close`,langSegment:`${$}-lang-segment`,composer:`${$}-composer`,composerInput:`${$}-composer-input`,composerSend:`${$}-composer-send`,composerStop:`${$}-composer-stop`,composerAttach:`${$}-composer-attach`,composerFileInput:`${$}-composer-file-input`,composerVoice:`${$}-composer-voice`,attachmentChip:`${$}-attachment-chip`,attachmentRemove:`${$}-attachment-remove`,suggestion:`${$}-suggestion`,messageBubble:`${$}-message`,messageRetry:`${$}-message-retry`,messageFeedback:`${$}-message-feedback`,feedbackUp:`${$}-feedback-up`,feedbackDown:`${$}-feedback-down`,messageCopy:`${$}-message-copy`,historyPane:`${$}-history-pane`,historyBack:`${$}-history-back`,historyItem:`${$}-history-item`,historyLoadMore:`${$}-history-load-more`,sidebar:`${$}-sidebar`,sidebarToggle:`${$}-sidebar-toggle`,sidebarNewConversation:`${$}-sidebar-new-conversation`,sidebarItem:`${$}-sidebar-item`,messengerHome:`${$}-messenger-home`,modulesEmpty:`${$}-modules-empty`,tab:`${$}-tab`,tabBadge:`${$}-tab-badge`,homeView:`${$}-home-view`,homeGreeting:`${$}-home-greeting`,homeBrand:`${$}-home-brand`,backHeader:`${$}-back-header`,contentView:`${$}-content-view`,contentScroll:`${$}-content-scroll`,homeSearch:`${$}-home-search`,helpSearch:`${$}-help-search`,homeRecent:`${$}-home-recent`,homeContentRow:`${$}-home-content-row`,helpArticle:`${$}-help-article`,newsItem:`${$}-news-item`,formGate:`${$}-form-gate`,formDone:`${$}-form-done`,formDoneToggle:`${$}-form-done-toggle`,formAnswers:`${$}-form-answers`,formFill:`${$}-form-fill`,formSubmit:`${$}-form-submit`,formSkip:`${$}-form-skip`,formField:`${$}-form-field`,toolAskQuestions:`${$}-tool-ask-questions`,toolInputSubmit:`${$}-tool-input-submit`,toolInputSkip:`${$}-tool-input-skip`,toolApproval:`${$}-tool-approval`,toolApprove:`${$}-tool-approve`,toolReject:`${$}-tool-reject`,toolEdit:`${$}-tool-edit`,toolDecision:`${$}-tool-decision`,typingDots:`${$}-typing-dots`,reasoning:`${$}-reasoning`,toolAskSummary:`${$}-ask-questions-summary`,toolAskOptions:`${$}-ask-questions-options-toggle`,toolCall:`${$}-tool-call`,source:`${$}-source`,operatorRequest:`${$}-operator-request`,operatorBanner:`${$}-operator-banner`,cancelOperatorRequest:`${$}-cancel-operator-request`};function Ge(e,t){return`${e}-${t}`}var Gr=C.cssPrefix;function Hl({onToggle:e,launcher:t,strings:n,leaving:r,edgeTab:o}){let i=t.variant!=="circle"&&!!t.label;return a("button",{type:"button",class:`${Gr}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":o?"true":void 0,"data-leaving":r?"true":void 0,"data-testid":R.launcher,onClick:e,"aria-label":n.launcherOpen,children:[wp(t.icon),i?a("span",{class:`${Gr}-fab-label`,children:Ze(n,t.label??"")}):null]})}function wp(e){let t=Bl[e];return t?a(t,{}):a(Cp,{source:e})}function Cp({source:e}){return a("span",{ref:t=>{t&&Rp(t,e)},"aria-hidden":"true"})}function Rp(e,t){if(e.dataset.svgMounted!==t)try{let r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;r&&r.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(r,!0)),e.dataset.svgMounted=t)}catch{}}function Ul({callout:e,launcherPosition:t,strings:n,closeLabel:r,onDismiss:o}){let[i,s]=D(!1);return E(()=>{let l=setTimeout(()=>s(!0),e.delayMs);return()=>clearTimeout(l)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let l=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(l)},[i,e.autoDismissMs,o]),i?a("div",{class:`${Gr}-callout`,role:"status","data-shape":e.shape,"data-position":Tp(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":R.callout,children:[a("span",{children:Ze(n,e.text)}),a("button",{type:"button",class:`${Gr}-callout-close`,onClick:o,"aria-label":r,title:r,"data-testid":R.calloutDismiss,children:a(ft,{})})]}):null}function Tp(e,t){let n=t.endsWith("-right"),r=t.startsWith("bottom-");return e==="vertical"?r?"top":"bottom":n?"left":"right"}function Kr({panelEl:e,resize:t,position:n,initialSize:r,onSizeChange:o,strings:i}){let s=C.cssPrefix,l=M(null);if(E(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${s}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${s}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${s}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${s}-resize-max-h`,t.maxHeight),r&&(m.setProperty(`--${s}-widget-w`,`${r.width}px`),m.setProperty(`--${s}-widget-h`,`${r.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,s,r]),!e)return null;let c=n.startsWith("top-"),u=n.endsWith("-right"),_=`${s}-resize-grip ${s}-resize-grip--${c?"bottom":"top"}-${u?"left":"right"}`,p=m=>{if(!e)return;let b=m.currentTarget,v=e.getBoundingClientRect();l.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:u?-1:1,dirY:c?1:-1},b.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},d=m=>{let b=l.current;if(!b||m.pointerId!==b.pointerId||!e)return;let v=(m.clientX-b.startX)*b.dirX,P=(m.clientY-b.startY)*b.dirY;e.style.setProperty(`--${s}-widget-w`,`${b.startW+v}px`),e.style.setProperty(`--${s}-widget-h`,`${b.startH+P}px`)},f=m=>{let b=l.current;if(!b||m.pointerId!==b.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();o({width:Math.round(v.width),height:Math.round(v.height)}),l.current=null};return a("div",{class:_,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:p,onPointerMove:d,onPointerUp:f,onPointerCancel:f,"data-testid":R.resizeGrip,children:a(hl,{})})}var Jt=C.cssPrefix,Ip=`.${Jt}-header, .${Jt}-back-header, .${Jt}-home-hero`,Ep='button, a, input, textarea, select, [role="tab"], [contenteditable]',zl=56;function jr(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,r=(c,u)=>Math.min(u,Math.max(-u,c)),o=null,i=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(Ip)||u.closest(Ep))return;let _=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Jt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Jt}-modal-dy`)),maxX:(window.innerWidth+_.width)/2-zl,maxY:(window.innerHeight+_.height)/2-zl},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!o||c.pointerId!==o.id)return;let u=r(o.dx+c.clientX-o.x,o.maxX),_=r(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${Jt}-modal-dx`,`${u}px`),e.style.setProperty(`--${Jt}-modal-dy`,`${_}px`)},l=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Gn(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Xr(e,t,n){return Gn("close",e,t)?n.includes("close"):!1}function ql(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Ap='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Yr(e){let t=n=>{if(n.key!=="Tab")return;let r=[...e.querySelectorAll(Ap)].filter(l=>l.offsetParent!==null||l===document.activeElement);if(r.length===0){n.preventDefault();return}let o=r[0],i=r[r.length-1];if(!o||!i)return;let s=e.getRootNode().activeElement;n.shiftKey&&s===o?(n.preventDefault(),i.focus()):!n.shiftKey&&s===i&&(n.preventDefault(),o.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Jr(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var ha=C.cssPrefix;function Vl({agent:e,strings:t}){let n=e.status??"online",r=Ze(t,e.name),o=e.title?Ze(t,e.title):null;return a("div",{class:`${ha}-agent`,children:[a("div",{class:`${ha}-agent-avatar`,"data-status":n,children:e.avatar?a("img",{src:e.avatar,alt:""}):a("span",{children:Jr(r)})}),a("div",{class:`${ha}-agent-meta`,children:[a("strong",{children:r}),o?a("span",{children:o}):null]})]})}var Wl=ee.scope("attachments");function Qr(e,t,n){let r=Lp(e),o=[],i=[],s=Dp(n.accept),l=t.reduce((u,_)=>u+_.size,0),c=t.length;for(let u of r){let _=Mp(u,c,l,n,s);if(_){i.push({file:u,reason:_});continue}o.push(Np(u)),l+=u.size,c+=1}return(o.length||i.length)&&Wl.debug("ingest",{accepted:o.length,rejected:i.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:i}}function Zr(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Wl.debug("revokeObjectURL failed",{error:t})}}function Mp(e,t,n,r,o){return t>=r.maxCount?"count":n+e.size>r.maxBytes?"bytes":$p(e,o)?null:"mime"}function Lp(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Op(t)).filter(t=>t!==null):[]}function Op(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Np(e){return{file:e,id:ot(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Dp(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",r="*"]=t.split("/");return{kind:"mime",type:n,subtype:r}})}function $p(e,t){if(t.length===0)return!0;let[n="*",r="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?o.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===r))}var Kn=C.cssPrefix;function Gl({attachment:e,onRemove:t,disabled:n=!1}){let r=e.mediaType.startsWith("image/");return a("span",{class:`${Kn}-attachment-chip`,title:e.name,"data-testid":Ge(R.attachmentChip,e.id),children:[r?a("img",{class:`${Kn}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${Kn}-attachment-thumb`,"aria-hidden":"true",children:a(Rl,{})}),a("span",{class:`${Kn}-attachment-name`,children:e.name}),a("button",{type:"button",class:`${Kn}-attachment-remove`,onClick:t,disabled:n,"aria-label":`Remove ${e.name}`,"data-testid":Ge(R.attachmentRemove,e.id),children:a(ft,{})})]})}var ba={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function ya(e,t,n){return e==="disabled"?ba:e==="server"?Up(n):Fp(t)}function Fp(e){let t=Bp();if(!t)return ba;let n=null,r=0;return{isSupported:!0,start(o,i){let s=n,l=++r;n=null,s?.abort();let c=new t;n=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",p=>{if(r!==l||n!==c)return;let d=p,f="",m=!1;for(let b=d.resultIndex;b<d.results.length;b++){let v=d.results[b];v&&(f+=v[0].transcript,v.isFinal&&(m=!0))}o(f,m)});let _=()=>{u||r!==l||n!==c||(u=!0,n=null,i())};c.addEventListener("end",_),c.addEventListener("error",_);try{c.start()}catch{_()}},stop(){n?.stop()},cancel(){r++;let o=n;n=null,o?.abort()}}}function Bp(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Hp=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Up(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ba;let t=0,n=null,r=s=>{for(let l of s.stream?.getTracks()??[])l.stop();s.stream=null},o=()=>{t++;let s=n;n=null,s&&(r(s),s.recorder?.state!=="inactive"&&s.recorder?.stop())},i=async s=>{if(s.finishing)return;s.finishing=!0;let l=s.recorder?.mimeType??"audio/webm";r(s);let c=new Blob(s.chunks,{type:l});s.chunks=[];try{let{text:u}=await e(c,l);n===s&&t===s.generation&&u&&s.onText(u,!0)}catch{}finally{n===s&&t===s.generation&&(n=null,s.onEnd())}};return{isSupported:!0,async start(s,l){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:s,onEnd:l,finishing:!1};n=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(n!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let _=zp(),p=new MediaRecorder(u,_?{mimeType:_}:void 0);c.recorder=p,p.addEventListener("dataavailable",d=>{n===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),p.addEventListener("stop",()=>{n===c&&t===c.generation&&i(c)}),p.start()}catch{r(c),n===c&&t===c.generation&&(n=null,l())}},stop(){let s=n;if(s){if(!s.recorder){o();return}s.recorder.state!=="inactive"&&s.recorder.stop()}},cancel(){o()}}}function zp(){for(let e of Hp)if(MediaRecorder.isTypeSupported(e))return e}var at=C.cssPrefix,vn=ee.scope("composer");function hn(e){return e.reduce((t,n)=>t+n.size,0)}var qp={arrowUp:cl,paperPlane:ll,send:dl,chevron:gn};function Kl(e){return"activeElement"in e}function Vp(e){return"host"in e&&"activeElement"in e}function jl({options:e,transport:t,feedback:n,bus:r,persistence:o,conversationId:i,isStreaming:s,active:l=!0,isPreparing:c=!1,operatorRequestEnabled:u,canRequestOperator:_=!1,controlMode:p,onRequestOperator:d,onSend:f,onStop:m,attachApiRef:b}){let v=e.strings,[P,x]=D(()=>o.loadDraft(i)),[h,y]=D([]),[k,w]=D(!1),[B,W]=D(!1),U=M(!1),I=M(null),z=M(null),q=M(null),L=M(0),ne=M(i);ne.current=i;let oe=M(l);oe.current=l;let le=M(c);le.current=c;let Ae=B||c||!l,de=O(H=>{x(j=>{let X=typeof H=="function"?H(j):H;return X===j?j:(o.saveDraft(ne.current,X),X)})},[o]),_e=e.features.fileUpload,Me=e.features.voice,[N,ve]=D(()=>ya(Me,e.locale,(H,j)=>t.transcribe(H,j))),ae=M(N);ae.current=N;let De=M({mode:Me,locale:e.locale,transport:t});E(()=>{let H=De.current;H.mode===Me&&H.locale===e.locale&&H.transport===t||(De.current={mode:Me,locale:e.locale,transport:t},L.current++,ae.current.cancel(),q.current=null,w(!1),ve(ya(Me,e.locale,(j,X)=>t.transcribe(j,X))))},[e.locale,Me,t]),E(()=>()=>{L.current++,N.cancel()},[N]);let xe=O(H=>{let j=q.current;if(j===null)return!1;let X=Date.now()-j;return vn[H]("voiceStop",{durationMs:X}),r.emit("voiceStop",{durationMs:X}),q.current=null,!0},[r]),Te=O(()=>{q.current!==null&&(N.stop(),w(!1),xe("info")&&n.play("voiceStop"))},[xe,n,N]),Ce=O(()=>{L.current++,N.cancel(),w(!1),xe("info")&&n.play("voiceStop")},[xe,n,N]);E(()=>{(c||!l)&&Ce()},[l,Ce,c]),E(()=>{let H=I.current;if(!H)return;let j=H.getRootNode(),X=Kl(j)?j.activeElement:null;X&&H.closest(`.${at}-panel`)?.contains(X)||H.focus({preventScroll:!0})},[]),E(()=>{let H=I.current;if(!H)return;if(P.length===0){H.style.height="";return}H.style.height="auto";let j=parseFloat(getComputedStyle(H).fontSize)*.7,X=Math.min(H.scrollHeight,160);H.style.height=`${X<40+j?40:X}px`},[P]);let Le=M(h);Le.current=h,E(()=>()=>Le.current.forEach(Zr),[]),E(()=>{if(b)return b.current={attachFromDrop:H=>{if(!_e||!oe.current||U.current||le.current)return;let j=Qr(H,Le.current,e.attachments);j.accepted.length!==0&&(vn.info("attach (drop)",{count:j.accepted.length,totalBytes:hn(j.accepted)}),r.emit("attach",{count:j.accepted.length,totalBytes:hn(j.accepted)}),y(X=>[...X,...j.accepted]))},fill:H=>{if(!oe.current||U.current||le.current)return;de(H);let j=I.current;j&&(j.focus({preventScroll:!0}),requestAnimationFrame(()=>j.setSelectionRange(j.value.length,j.value.length)))}},()=>{b.current&&(b.current=null)}},[b,_e,c,e.attachments,de]),E(()=>{let H=I.current;if(!H)return;let j=H.closest(`.${at}-panel`);if(!j)return;let X=me=>{if(!oe.current||U.current||le.current)return;let S=me.clipboardData;if(!S)return;let V=me.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(V&&V!==H)return;if(_e){let ie=Qr(S.items,Le.current,e.attachments);if(ie.accepted.length>0){me.preventDefault(),vn.info("attach (paste)",{count:ie.accepted.length,totalBytes:hn(ie.accepted)}),r.emit("attach",{count:ie.accepted.length,totalBytes:hn(ie.accepted)}),y(Pe=>[...Pe,...ie.accepted]);return}}if(V===H)return;let ye=S.getData("text/plain");ye&&(me.preventDefault(),de(ie=>ie+ye),H.focus())};return j.addEventListener("paste",X),()=>j.removeEventListener("paste",X)},[_e,e.attachments,de]);let he=async()=>{let H=P.trim();if(!H&&h.length===0||!l||s||U.current||c)return;Ce(),U.current=!0,W(!0);let j=P,X=h;try{await f(H,X)&&(de(me=>me===j?"":me),y(me=>me!==X?me:(X.forEach(Zr),Le.current=[],[])))}finally{U.current=!1,W(!1),requestAnimationFrame(()=>{let me=I.current;if(!me||me.disabled||!oe.current)return;let S=me.getRootNode(),V=Kl(S)?S.activeElement:null,ye=V?.getAttribute("data-testid");if(!(V&&V!==me&&ye!==R.composerSend&&ye!==R.composerStop)){if(Vp(S)){let ie=S.host.ownerDocument;if(!ie.hasFocus())return;let Pe=ie.activeElement;if(Pe&&Pe!==S.host&&Pe!==ie.body)return}me.focus({preventScroll:!0})}})}},Se=H=>{H.key!=="Enter"||H.shiftKey||H.isComposing||(H.preventDefault(),s?m():he())},Ie=H=>{let j=H.target;if(!l||U.current||c){j.value="";return}let X=Qr(j.files,h,e.attachments);X.accepted.length>0&&(vn.info("attach (file picker)",{count:X.accepted.length,totalBytes:hn(X.accepted)}),r.emit("attach",{count:X.accepted.length,totalBytes:hn(X.accepted)}),y(me=>[...me,...X.accepted])),j.value=""},Je=H=>{!l||U.current||c||(vn.info("removeAttachment",{id:H}),r.emit("removeAttachment",{id:H}),y(j=>{let X=j.find(me=>me.id===H);return X&&Zr(X),j.filter(me=>me.id!==H)}))},Qe=()=>{if(k){Te();return}if(!l||!N.isSupported||U.current||c)return;let H=++L.current;q.current=Date.now(),vn.info("voiceStart"),r.emit("voiceStart",void 0),w(!0),n.play("voiceStart"),N.start((j,X)=>{L.current!==H||!oe.current||le.current||U.current||!X||de(me=>`${me}${j} `)},()=>{L.current!==H||!oe.current||(w(!1),xe("debug"))})},ze=qp[e.composer.sendButton.icon];return a("div",{class:`${at}-composer`,"data-testid":R.composer,children:[h.length>0?a("div",{class:`${at}-attachments`,children:h.map(H=>a(Gl,{attachment:H,onRemove:()=>Je(H.id),disabled:Ae},H.id))}):null,a("div",{class:`${at}-composer-row`,children:[a("div",{class:`${at}-composer-actions`,children:[_e?a("button",{type:"button",class:`${at}-icon-btn`,onClick:()=>z.current?.click(),disabled:Ae,"aria-label":v.attach,"data-testid":R.composerAttach,children:a(_l,{})}):null,N.isSupported?a("button",{type:"button",class:`${at}-icon-btn`,onClick:Qe,disabled:Ae,"aria-label":k?v.micStop:v.micStart,"aria-pressed":k,"data-recording":k?"true":void 0,"data-testid":R.composerVoice,children:a(pl,{})}):null]}),a("textarea",{ref:I,name:"message",class:`${at}-textarea`,rows:1,value:P,placeholder:v.composerPlaceholder,onInput:H=>de(H.currentTarget.value),onKeyDown:Se,disabled:Ae,"aria-label":v.composerPlaceholder,"data-testid":R.composerInput}),s?a("button",{type:"button",class:`${at}-send`,onClick:m,disabled:Ae,"aria-label":v.stop,"data-testid":R.composerStop,children:a(ul,{})}):a("button",{type:"button",class:`${at}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{he()},disabled:Ae||!P.trim()&&h.length===0,"aria-label":v.send,"data-testid":R.composerSend,children:a(ze,{})}),u&&p==="ai-agent"&&d?a("button",{type:"button",class:`${at}-icon-btn`,onClick:d,disabled:Ae||!_,"aria-label":v.talkToOperator,title:v.talkToOperator,"data-testid":R.operatorRequest,children:a(ga,{})}):null]}),a("input",{ref:z,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Ie,disabled:Ae,class:`${at}-sr-only`,"data-testid":R.composerFileInput})]})}var Wp=C.cssPrefix;function Xl({visible:e,strings:t}){return e?a("div",{class:`${Wp}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function eo({containerRef:e,onDrop:t,disabled:n=!1}){let[r,o]=D(!1);return E(()=>{if(n){o(!1);return}let i=e.current;if(!i)return;let s=0,l=p=>{s+=1,p.dataTransfer?.types.includes("Files")&&(p.preventDefault(),o(!0))},c=()=>{s-=1,!(s>0)&&(s=0,o(!1))},u=p=>{p.dataTransfer?.types.includes("Files")&&p.preventDefault()},_=p=>{s=0,o(!1),p.dataTransfer&&(p.preventDefault(),t(p.dataTransfer.items))};return i.addEventListener("dragenter",l),i.addEventListener("dragleave",c),i.addEventListener("dragover",u),i.addEventListener("drop",_),()=>{i.removeEventListener("dragenter",l),i.removeEventListener("dragleave",c),i.removeEventListener("dragover",u),i.removeEventListener("drop",_)}},[e,n,t]),{visible:n?!1:r}}function Yl({itemCount:e,initialFocusIndex:t}){let[n,r]=D(!1),o=M(null),i=M(null),[s,l]=D(-1),c=O(()=>{r(!1),l(-1),o.current?.focus()},[]),u=O(()=>r(d=>!d),[]);E(()=>{if(!n)return;let d=f=>{let m=i.current,b=o.current;if(!m||!b)return;let v=f.composedPath();v.includes(m)||v.includes(b)||(r(!1),l(-1))};return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[n]),E(()=>{if(!n||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;l(f)},[n,e,t]),E(()=>{if(!n||s<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let _=O(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(!0))},[]),p=O(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),c();return;case"ArrowDown":d.preventDefault(),l(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),l(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),l(0);return;case"End":d.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:o,menuRef:i,toggle:u,close:c,onTriggerKey:_,onMenuKey:p}}function Jl({items:e,triggerLabel:t}){let n=C.cssPrefix,r=Yl({itemCount:e.length}),o=l=>{l.disabled||(l.onSelect?.(),l.keepOpen||r.close())},i=(l,c)=>l.onSelectValue?.(c),s=(l,c)=>{let u=c.segments;if(!u?.length)return;let _=Math.max(0,u.findIndex(d=>d.value===c.value)),p=-1;if(l.key==="ArrowRight"||l.key==="Enter"||l.key===" ")p=(_+1)%u.length;else if(l.key==="ArrowLeft")p=(_-1+u.length)%u.length;else return;l.preventDefault(),l.stopPropagation(),i(c,u[p].value)};return a("div",{class:`${n}-menu-wrap`,children:[a("button",{ref:r.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":r.open,title:t,onClick:r.toggle,onKeyDown:r.onTriggerKey,children:a(bl,{})}),r.open?a("div",{ref:r.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:r.onMenuKey,tabIndex:-1,children:e.map(l=>l.segments?a("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":l.label,tabIndex:-1,onKeyDown:c=>s(c,l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":l.label,children:l.segments.map(c=>{let u=c.value===l.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${n}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${R.langSegment}-${c.value}`,onClick:()=>i(l,c.value),children:c.label},c.value)})})]},l.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":l.type==="switch"?l.on:void 0,disabled:l.disabled,onClick:()=>o(l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),l.type==="switch"&&l.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(Xt,{})}):null]},l.id))}):null]})}var Pa=C.cssPrefix;function Gp(e){let t=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)").matches:!0;return e==="auto"?t?"light":"dark":t?e==="light"?"dark":"auto":e==="dark"?"light":"auto"}var Kp={normal:"large",large:"small",small:"normal"};function jp(e){return e==="light"?a(Al,{}):e==="dark"?a(Ml,{}):a(Ll,{})}function Xp(e){return(e.split("-")[0]??e).toUpperCase()}function mt({panelProps:e,variant:t}){let{options:n,panelSize:r,feedback:o,onClose:i,onClear:s,onExpand:l,onFullscreen:c,onSoundToggle:u}=e,{onToggleHistory:_,onLocaleChange:p,onThemeChange:d,onTextSizeChange:f}=e,m=n.strings,b=n.mode,v=t==="chat",P=ut(()=>o.mutedSig.value).value,x=new Set(n.actions),h=L=>x.has(L),y=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,k=L=>y?!1:Gn(L,b,r),w=n.themeMode,B={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},W=n.textSize,U={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},I=[];if(v&&h("clear")&&I.push({id:"clear",icon:a(Cl,{}),label:m.newConversation,onSelect:s}),h("expand")&&k("expand")){let L=r==="expanded";I.push({id:"expand",icon:L?a(ml,{}):a(fl,{}),label:L?m.collapse:m.expand,type:"switch",on:L,onSelect:l})}if(h("fullscreen")&&k("fullscreen")){let L=r==="fullscreen";I.push({id:"fullscreen",icon:L?a(vl,{}):a(gl,{}),label:L?m.exitFullscreen:m.fullscreen,type:"switch",on:L,onSelect:c})}v&&h("sound")&&I.push({id:"sound",icon:P?a(Pl,{}):a(yl,{}),label:P?m.soundOff:m.soundOn,type:"switch",on:!P,onSelect:u}),h("theme")&&I.push({id:"theme",icon:jp(w),label:`${m.theme}: ${B[w]}`,onSelect:()=>d(Gp(w)),keepOpen:!0}),h("textSize")&&I.push({id:"textSize",icon:a(xl,{}),label:`${m.textSize}: ${U[W]}`,onSelect:()=>f(Kp[W]),keepOpen:!0}),h("language")&&n.availableLocales.length>1&&I.push({id:"language",icon:a(wl,{}),label:m.language,segments:n.availableLocales.map(L=>({value:L,label:Xp(L),lang:L})),value:n.locale,onSelectValue:p});let z=!!i&&Xr(b,r,n.actions),q=v&&h("history");return a("div",{class:`${Pa}-header-actions`,children:[q?a("button",{type:"button",class:`${Pa}-icon-btn`,onClick:_,"aria-label":m.history,title:m.history,"data-testid":R.actionHistory,children:a(kl,{})}):null,I.length>0?a(Jl,{items:I,triggerLabel:m.moreActions}):null,z?a("button",{type:"button",class:`${Pa}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":R.actionClose,children:a(ft,{})}):null]})}var Yp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Jp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Qp=/^[+]?[\d\s().-]{6,}$/;function bn(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>String(t[r]??`{${r}}`))}function Zp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function ef(e,t,n){let r=e.required??!0,o=e.validation;if(e.type==="multiselect"){let s=Zp(t);return r&&s===0?n.formRequired:s===0?void 0:o?.minSelections!=null&&s<o.minSelections?bn(n.formChooseAtLeast,{min:o.minSelections}):o?.maxSelections!=null&&s>o.maxSelections?bn(n.formChooseAtMost,{max:o.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return r?n.formRequired:void 0;switch(e.type){case"email":if(!Yp.test(i))return n.formInvalidEmail;break;case"url":if(!Jp.test(i))return n.formInvalidUrl;break;case"tel":if(!Qp.test(i))return n.formInvalidTel;break;case"number":{let s=Number(i);if(!Number.isFinite(s))return n.formInvalidNumber;if(o?.min!=null&&s<o.min)return bn(n.formNumberTooSmall,{min:o.min});if(o?.max!=null&&s>o.max)return bn(n.formNumberTooLarge,{max:o.max});break}default:break}if(o?.minLength!=null&&i.length<o.minLength)return bn(n.formTooShort,{min:o.minLength});if(o?.maxLength!=null&&i.length>o.maxLength)return bn(n.formTooLong,{max:o.maxLength});if(o?.pattern)try{if(!new RegExp(o.pattern).test(i))return n.formPatternMismatch}catch{}}function Ql(e,t,n){let r={};for(let o of e){let i=ef(o,t[o.name],n);i&&(r[o.name]=i)}return r}function Zl(e){let t={};for(let[n,r]of Object.entries(e)){let o=Array.isArray(r)?r.join(", "):r;o&&o.trim()&&(t[n]=o.trim())}return t}var ke=C.cssPrefix,to="__other__";function jn({fields:e,strings:t,submitLabel:n,onSubmit:r,skipLabel:o,onSkip:i,footerHint:s,submitOnEnter:l,disabled:c,initialValues:u,hideActions:_,fieldTypeLabels:p,rootTestId:d,submitTestId:f,skipTestId:m}){let[b,v]=D(()=>({...of(e),...u})),[P,x]=D({}),[h,y]=D({}),k=I=>{h[I]&&y(z=>({...z,[I]:""}))},w=(I,z)=>{v(q=>({...q,[I]:z})),k(I)},B=(I,z)=>{x(q=>({...q,[I]:z})),k(I)},W=I=>{if(I.preventDefault(),c)return;let z=af(e,b,P),q=Ql(e,z,t);if(Object.keys(q).length>0){y(q);return}r(Zl(z))},U=I=>{!l||I.key!=="Enter"||I.shiftKey||I.isComposing||I.target?.tagName==="TEXTAREA"&&W(I)};return a("form",{class:`${ke}-form`,onSubmit:W,onKeyDown:U,"data-testid":d,noValidate:!0,children:[e.map(I=>a(tf,{field:I,value:b[I.name],otherText:P[I.name]??"",error:h[I.name],disabled:c,typeLabel:p?.[I.name],strings:t,onChange:z=>w(I.name,z),onOtherChange:z=>B(I.name,z)},I.name)),_?null:a("div",{class:`${ke}-form-actions`,children:[s?a("span",{class:`${ke}-form-hint`,children:s}):null,o&&i?a("button",{type:"button",class:`${ke}-form-skip`,onClick:i,disabled:c,"data-testid":m,children:o}):null,a("button",{type:"submit",class:`${ke}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function tf({field:e,value:t,otherText:n,error:r,disabled:o,typeLabel:i,strings:s,onChange:l,onOtherChange:c}){let u=Ge(R.formField,e.name),_=nf({field:e,value:t,otherText:n,disabled:o,strings:s,onChange:l,onOtherChange:c,fieldTid:u});return a("label",{class:`${ke}-field`,"data-field":e.name,"data-invalid":r?"true":void 0,children:[a("span",{class:`${ke}-field-head`,children:[a("span",{class:`${ke}-field-label`,children:[e.label,e.required??!0?a("span",{class:`${ke}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${ke}-field-type`,children:i}):null]}),_,e.validationHint&&!r?a("span",{class:`${ke}-field-hint`,children:e.validationHint}):null,r?a("span",{class:`${ke}-field-error`,role:"alert",children:r}):null]})}function nf(e){let{field:t,value:n,otherText:r,disabled:o,strings:i,onChange:s,onOtherChange:l,fieldTid:c}=e,u=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${ke}-field-input`,rows:3,value:u,placeholder:t.placeholder,disabled:o,onInput:_=>s(_.target.value),"data-testid":c});case"select":return a("select",{class:`${ke}-field-input`,value:u,disabled:o,onChange:_=>s(_.target.value),"data-testid":c,children:[a("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(_=>a("option",{value:_.value,children:_.label??_.value},_.value))]});case"radio":{let _=t.allowOther&&u===to;return a("div",{class:`${ke}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(p=>a("label",{class:`${ke}-choice`,children:[a("input",{type:"radio",name:`${ke}-${t.name}`,checked:u===p.value,disabled:o,onChange:()=>s(p.value)}),a("span",{children:p.label??p.value})]},p.value)),t.allowOther?a("label",{class:`${ke}-choice`,children:[a("input",{type:"radio",name:`${ke}-${t.name}`,checked:u===to,disabled:o,onChange:()=>s(to)}),a("span",{children:i.formOther})]}):null,_?a("input",{class:`${ke}-field-input`,value:r,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:o,onInput:p=>l(p.target.value)}):null]})}case"checkbox":return a("label",{class:`${ke}-choice`,children:[a("input",{type:"checkbox",checked:u==="true",disabled:o,onChange:_=>s(_.target.checked?"true":""),"data-testid":c}),a("span",{children:t.placeholder??t.label})]});case"multiselect":{let _=Array.isArray(n)?n:[],p=(d,f)=>s(f?[..._,d]:_.filter(m=>m!==d));return a("div",{class:`${ke}-field-choices`,"data-testid":c,children:[(t.options??[]).map(d=>a("label",{class:`${ke}-choice`,children:[a("input",{type:"checkbox",checked:_.includes(d.value),disabled:o,onChange:f=>p(d.value,f.target.checked)}),a("span",{children:d.label??d.value})]},d.value)),t.allowOther||(t.options??[]).length===0?a("textarea",{class:`${ke}-field-input`,rows:2,value:r,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:o,onInput:d=>l(d.target.value)}):null]})}default:return a("input",{class:`${ke}-field-input`,type:rf(t.type),value:u,placeholder:t.placeholder,disabled:o,onInput:_=>s(_.target.value),"data-testid":c})}}function rf(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function of(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(r=>r.trim()).filter(Boolean):n.defaultValue);return t}function af(e,t,n){let r={...t};for(let o of e){let i=n[o.name]?.trim();if(o.type==="radio"&&o.allowOther&&t[o.name]===to)r[o.name]=i??"";else if(o.type==="multiselect"&&i){let s=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),l=Array.isArray(t[o.name])?t[o.name]:[];r[o.name]=[...l,...s]}}return r}var gt=C.cssPrefix;function xa({form:e,strings:t,onSubmit:n,onSkip:r}){return a("div",{class:`${gt}-form-gate`,"data-testid":R.formGate,children:[e.title?a("h3",{class:`${gt}-form-gate-title`,children:e.title}):null,e.description?a("p",{class:`${gt}-form-gate-desc`,children:e.description}):null,a(jn,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?r:void 0,submitTestId:R.formSubmit,skipTestId:R.formSkip})]})}function ec({marker:e,strings:t,onFill:n}){let r=e.outcome==="skipped",o=r?t.formSkipped:t.formSubmitted,i=e.title?a(ce,{children:[a("span",{children:e.title}),a("span",{class:`${gt}-sr-only`,children:o})]}):a("span",{children:o}),s=e.form?.reviewable??!1,l=!r&&s&&e.values&&Object.keys(e.values).length>0?e.values:null;if(l){let c=u=>e.form?.fields.find(_=>_.name===u)?.label??u;return a("details",{class:`${gt}-form-done`,"data-outcome":e.outcome,"data-testid":R.formDone,children:[a("summary",{class:`${gt}-form-done-summary`,"data-testid":R.formDoneToggle,children:[a(Xt,{}),i,a(gn,{})]}),a("dl",{class:`${gt}-form-answers`,"data-testid":R.formAnswers,children:Object.entries(l).map(([u,_])=>a("div",{class:`${gt}-form-answer`,children:[a("dt",{children:c(u)}),a("dd",{children:_})]},u))})]})}return a("div",{class:`${gt}-form-done`,"data-outcome":e.outcome,"data-testid":R.formDone,role:"status",children:[r?a(Sl,{}):a(Xt,{}),i,r&&e.form?.reopenable&&n?a("button",{type:"button",class:`${gt}-form-done-fill`,"data-testid":R.formFill,onClick:n,children:t.formFillOut}):null]})}function cf(e,t){for(var n in t)e[n]=t[n];return e}function ka(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function tc(e,t){this.props=e,this.context=t}function cc(e,t){function n(o){var i=this.props.ref;return i!=o.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,o)||i!=o.ref:ka(this.props,o)}function r(o){return this.shouldComponentUpdate=n,xt(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.__f=r.prototype.isReactComponent=!0,r.type=e,r}(tc.prototype=new et).isPureReactComponent=!0,tc.prototype.shouldComponentUpdate=function(e,t){return ka(this.props,e)||ka(this.state,t)};var nc=Y.__b;Y.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),nc&&nc(e)};var qb=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var df=Y.__e;Y.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),o.__c(e,t)}df(e,t,n,r)};var rc=Y.unmount;function dc(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=cf({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return dc(r,t,n)})),e}function uc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return uc(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Sa(){this.__u=0,this.o=null,this.__b=null}function _c(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function no(){this.i=null,this.l=null}Y.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),rc&&rc(e)},(Sa.prototype=new et).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=_c(r.__v),i=!1,s=function(){i||r.__z||(i=!0,n.__R=null,o?o(c):c())};n.__R=s;var l=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=uc(u,u.__c.__P,u.__c.__O)}var _;for(r.setState({__a:r.__b=null});_=r.o.pop();)_.__P=l,_.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Sa.prototype.componentWillUnmount=function(){this.o=[]},Sa.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=dc(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&xt(ce,null,e.fallback);return o&&(o.__u&=-33),[xt(ce,null,t.__a?null:e.children),o]};var oc=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(no.prototype=new et).__a=function(e){var t=this,n=_c(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),oc(t,e,r)):o()};n?n(i):i()}},no.prototype.render=function(e){this.i=null,this.l=new Map;var t=An(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},no.prototype.componentDidUpdate=no.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){oc(e,n,t)})};var uf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_f=/^(?: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]/,pf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ff=/[A-Z0-9]/g,mf=typeof document<"u",gf=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};et.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(et.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ac=Y.event;Y.event=function(e){return ac&&(e=ac(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var pc,vf={configurable:!0,get:function(){return this.class}},ic=Y.vnode;Y.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")==-1;for(var s in n){var l=n[s];if(!(s==="value"&&"defaultValue"in n&&l==null||mf&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||gf(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":pf.test(s)&&(s=c):c=s="oninput":i&&_f.test(s)?s=s.replace(ff,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=l}}r=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=An(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),o.defaultValue!=null&&(o.value=An(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",vf)):n.className&&(o.class=o.className=n.className),t.props=o})(e),e.$$typeof=uf,ic&&ic(e)};var sc=Y.__r;Y.__r=function(e){sc&&sc(e),pc=e.__c};var lc=Y.diffed;Y.diffed=function(e){lc&&lc(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),pc=null};function ro(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var st=C.cssPrefix;function Ca(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function oo(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",r=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:r,decided:n||r}}function Ra({status:e,icon:t,label:n}){return a("span",{class:`${st}-toolui-badge ${st}-toolui-status`,"data-status":e,children:[a("span",{class:`${st}-toolui-status-icon`,children:t}),n]})}function hf(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function Ta(e,t,n={}){return n.submitted?"responded":Pf(hf(e,t),n.superseded,n.live??!0)}function bf({status:e}){return e==="denied"||e==="error"||e==="superseded"?a(Wr,{}):e==="completed"||e==="responded"?a(Vr,{}):a(Fl,{})}function yf(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function Pf(e,t,n){return t&&(e==="awaiting"||e==="running")?"superseded":!n&&e==="running"?"error":e}function xf({state:e,approval:t,strings:n,superseded:r,live:o=!0,submitted:i=!1}){let s=Ta(e,t,{superseded:r,live:o,submitted:i});return a(Ra,{status:s,icon:a(bf,{status:s}),label:yf(s,n)})}function Sf({name:e,state:t,approval:n,strings:r,superseded:o,live:i,submitted:s}){return a(ce,{children:[a("span",{class:`${st}-toolui-name-pill`,children:[a($l,{}),a("span",{class:`${st}-toolui-name-text`,children:e})]}),a(xf,{state:t,approval:n,strings:r,superseded:o,live:i,submitted:s}),a("span",{class:`${st}-toolui-chevron`,children:a(Yt,{})})]})}function ao({part:e,strings:t,testid:n,superseded:r,live:o,submitted:i}){let s=Z(()=>pe(()=>e.inputSig.value),[e]),l=Z(()=>pe(()=>e.outputSig.value),[e]),c=Z(()=>pe(()=>e.errorSig.value),[e]),u=Z(()=>pe(()=>e.stateSig.value),[e]),_=Z(()=>pe(()=>e.approvalSig.value),[e]);return a("details",{class:`${st}-toolui ${st}-toolui-collapsible`,"data-testid":n,children:[a("summary",{class:`${st}-toolui-head`,children:a(Sf,{name:Ca(e.toolName),state:u.value,approval:_.value,strings:t,superseded:r,live:o,submitted:i})}),a(wa,{label:t.toolParameters,value:s.value}),l.value!==void 0?a(wa,{label:t.toolResult,value:l.value}):null,c.value?a(wa,{label:t.statusError,value:c.value,error:!0}):null]})}function wa({label:e,value:t,error:n}){let r=n?String(t??""):io(Ia(t));return r?a("div",{class:`${st}-toolui-section`,children:[a("span",{class:`${st}-toolui-label`,children:e}),a("pre",{class:`${st}-toolui-code`,"data-error":n?"true":void 0,children:r})]}):null}function Ia(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function io(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 fc(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function mc(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function kf(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function gc(e){let{streaming:t,reasoningVisible:n,emptyReply:r,hidden:o}=e,i=e.responseMode==="buffered"&&t,s=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:i,reasoningVisible:n,working:s,showStreamDots:kf({streaming:t,bufferedHold:i,reasoningVisible:n,working:s}),emptyReply:r,hidden:o}}function vc(e,t){let n=e.stateSig.value,r=e.approvalSig.value,{terminal:o,responded:i,decided:s}=oo(n,r),l=t.continuationStreaming===!0&&!s,c=t.superseded&&!s&&!l;return{pill:Ta(n,r,{superseded:c,live:t.live,submitted:l}),state:n,terminal:o,decided:s||l,showApproveReject:!s&&!t.superseded&&!l,showAnswered:i&&!o&&!c,showSubmitted:l,showEdit:i&&t.active&&!o,skipped:c,answeredApproved:r?.approved}}var Ma=1,bc=2,yc=4,Pc=8,xc=16;function wf(e){switch(e){case Ma:return"href";case bc:return"src";case yc:return"class";case Pc:return"checked";case xc:return"start"}}var Cf=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},Rf=Cf;var hc=24;function Oa(e){let t=new Uint32Array(hc);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(hc),indent:"",indent_len:0,table_state:0}}function Sc(e){e.pending.length>0&&Xe(e,`
|
|
12
|
+
`)}function fe(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 Ne(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 ge(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&Ne(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function Tf(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Qt(e,t){for(e.fence_start=0;e.len>t;)Ne(e)}function so(e,t){let n=0;for(let r=0;r<=e.len&&(t-=e.spaces[r],!(t<0));r+=1)switch(e.tokens[r]){case 9:case 10:case 20:case 25:n=r;break}for(;e.len>n;)Ne(e);return t}function Ea(e,t){let n=-1,r=-1;for(let o=e.blockquote_idx+1;o<=e.len;o+=1)if(e.tokens[o]===25){if(e.indent_len<e.spaces[o]){r=-1;break}r=o}else e.tokens[o]===t&&(n=o);return r===-1?n===-1?(Qt(e,e.blockquote_idx),ge(e,t),!0):(Qt(e,n),!1):(Qt(e,r),ge(e,t),!0)}function Aa(e,t){ge(e,25),e.spaces[e.len]=e.indent_len+t,Rt(e),e.token=103}function Rt(e){e.indent="",e.indent_len=0,e.pending=""}function La(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 If(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 Ef(e){return La(e)||If(e)}function Xe(e,t){for(let n of t){if(e.token===101){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let o=so(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],o>0&&Xe(e," ".repeat(o))}let r=e.pending+n;switch(e.token){case 21:case 1:case 20:case 24:case 23:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
|
|
13
|
+
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){Ne(e),Rt(e),e.pending=n;continue}Qt(e,e.blockquote_idx),Rt(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=r;continue}break;case" ":so(e,e.indent_len),ge(e,Rf(e.pending.length)),Rt(e);continue}break;case">":{let i=Tf(e,20,e.blockquote_idx+1);i===-1?(Qt(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,ge(e,20)):e.blockquote_idx=i,Rt(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=r;continue;case" ":e.pending=r;continue;case`
|
|
14
|
+
`:if(e.hr_chars<3)break;so(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),Rt(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Ea(e,23),Aa(e,2),Xe(e,r.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=r,e.fence_start=r.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=r,e.fence_start=r.length):(ge(e,2),Rt(e),e.fence_start=0,Xe(e,r));continue;case`
|
|
15
|
+
`:{so(e,e.indent_len),ge(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,yc,e.pending.slice(e.fence_start)),Rt(e),e.token=101;continue}default:e.pending=r;continue}case"+":if(n!==" ")break;Ea(e,23),Aa(e,2);continue;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(e.pending[e.pending.length-1]==="."){if(n!==" ")break;Ea(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,xc,e.pending.slice(0,-1)),Aa(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||La(i)){e.pending=r;continue}}break;case"|":Qt(e,e.blockquote_idx),ge(e,27),ge(e,28),e.pending="",Xe(e,n);continue}let o=r;if(e.token===21)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let i=0;for(;i<4;i+=1)if(e.indent[i]===" "){i=i+1;break}o=e.indent.slice(i)+r,ge(e,9)}else ge(e,2);Rt(e),Xe(e,o);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=r;continue;case`
|
|
16
|
+
`:e.table_state=2,e.pending="";continue;default:Ne(e),e.table_state=0;break}else switch(e.pending){case"|":ge(e,28),e.pending="",Xe(e,n);continue;case`
|
|
17
|
+
`:Ne(e),e.pending="",e.table_state=0,Xe(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":ge(e,29),Ne(e),e.pending="",Xe(e,n);continue;case`
|
|
18
|
+
`:Ne(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Xe(e,n);continue;default:ge(e,29),Xe(e,n);continue}break;case 29:if(e.pending==="|"){fe(e),Ne(e),e.pending="",Xe(e,n);continue}break;case 9:switch(r){case`
|
|
19
19
|
`:case`
|
|
20
20
|
`:case`
|
|
21
21
|
`:case`
|
|
@@ -25,18 +25,18 @@ ${o}`:o;continue}r.startsWith("id:")&&(n=r.slice(3).trim())}if(t==="[DONE]")retu
|
|
|
25
25
|
`:case`
|
|
26
26
|
`:case`
|
|
27
27
|
`:case`
|
|
28
|
-
`:e.pending=r;continue;default:e.pending.length!==0?(
|
|
29
|
-
`:if(r.length===e.fence_start+e.fence_end+1){
|
|
30
|
-
`){e.pending=r,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":r.length===e.fence_start+ +(e.pending[0]===" ")?(
|
|
31
|
-
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,
|
|
32
|
-
`?(
|
|
33
|
-
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,Ma,e.pending),
|
|
28
|
+
`:e.pending=r;continue;default:e.pending.length!==0?(fe(e),Ne(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=r;continue;case`
|
|
29
|
+
`:if(r.length===e.fence_start+e.fence_end+1){fe(e),Ne(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
|
|
30
|
+
`){e.pending=r,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":r.length===e.fence_start+ +(e.pending[0]===" ")?(fe(e),Ne(e),e.pending="",e.fence_start=0):e.pending=r;continue;case`
|
|
31
|
+
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,fe(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=r,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=r;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=r;continue;case 2:if(n!=="]")break;e.pending=r;continue;case 3:if(n!==" ")break;e.renderer.add_token(e.renderer.data,26),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,Pc,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Xe(e,r);continue;case 14:case 15:{let i="*",s=12;if(e.token===15&&(i="_",s=13),i===e.pending){if(fe(e),i===n){Ne(e),e.pending="";continue}ge(e,s),e.pending=n;continue}break}case 12:case 13:{let i="*",s=14;switch(e.token===13&&(i="_",s=15),e.pending){case i:i===n?e.tokens[e.len-1]===s?e.pending=r:(fe(e),ge(e,s),e.pending=""):(fe(e),Ne(e),e.pending=n);continue;case i+i:let l=e.token;fe(e),Ne(e),Ne(e),i!==n?(ge(e,l),e.pending=n):e.pending="";continue}break}case 16:if(r==="~~"){fe(e),Ne(e),e.pending="";continue}break;case 105:n===`
|
|
32
|
+
`?(fe(e),ge(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Xe(e,n));continue;case 30:if(r==="\\]"||r==="$$"){fe(e),Ne(e),e.pending="";continue}break;case 31:if(r==="\\)"||e.pending[0]==="$"){fe(e),Ne(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:r==="http://"||r==="https://"?(fe(e),ge(e,18),e.pending=r,e.text=r):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=r:(e.token=e.tokens[e.len],Xe(e,n));continue;case 17:case 19:if(e.pending==="]"){fe(e),n==="("?e.pending=r:(Ne(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?Ma:bc,s=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,s),Ne(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
|
|
33
|
+
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,Ma,e.pending),fe(e),Ne(e),e.pending=n):(e.text+=n,e.pending=r);continue;case 104:if(r.startsWith("<br")){if(r.length===3||n===" "||n==="/"&&(r.length===4||e.pending[e.pending.length-1]===" ")){e.pending=r;continue}if(n===">"){fe(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),Xe(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":fe(e),ge(e,31),e.pending="";continue;case"[":e.token=105,e.pending=r;continue;case`
|
|
34
34
|
`:e.pending=n;continue;default:let o=n.charCodeAt(0);e.pending="",e.text+=La(o)||o>=65&&o<=90||o>=97&&o<=122?r:n;continue}case`
|
|
35
|
-
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:
|
|
35
|
+
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:fe(e),Qt(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:fe(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){fe(e),e.pending=r,e.token=104;continue}break;case"`":if(e.token===19)break;n==="`"?(e.fence_start+=1,e.pending=r):(e.fence_start+=1,fe(e),ge(e,11),e.text=n===" "||n===`
|
|
36
36
|
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let o=12,i=14,s=e.pending[0];if(s==="_"&&(o=13,i=15),e.pending.length===1){if(s===n){e.pending=r;continue}if(n!==" "&&n!==`
|
|
37
|
-
`){
|
|
38
|
-
`){
|
|
39
|
-
`){ge(e),he(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=r;continue}else{if(Ef(n.charCodeAt(0)))break;ge(e),he(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){ge(e),he(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){ge(e),he(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}ge(e)}function Na(e){return{add_token:Af,end_token:Mf,add_text:Lf,set_attr:Of,data:{nodes:[e,,,,,],index:0}}}function Af(e,t){let n=e.nodes[e.index],r;switch(t){case 1:return;case 20:r=document.createElement("blockquote");break;case 2:r=document.createElement("p");break;case 21:r=document.createElement("br");break;case 22:r=document.createElement("hr");break;case 3:r=document.createElement("h1");break;case 4:r=document.createElement("h2");break;case 5:r=document.createElement("h3");break;case 6:r=document.createElement("h4");break;case 7:r=document.createElement("h5");break;case 8:r=document.createElement("h6");break;case 12:case 13:r=document.createElement("em");break;case 14:case 15:r=document.createElement("strong");break;case 16:r=document.createElement("s");break;case 11:r=document.createElement("code");break;case 18:case 17:r=document.createElement("a");break;case 19:r=document.createElement("img");break;case 23:r=document.createElement("ul");break;case 24:r=document.createElement("ol");break;case 25:r=document.createElement("li");break;case 26:let o=r=document.createElement("input");o.type="checkbox",o.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),r=document.createElement("code");break;case 27:r=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}r=document.createElement("tr");break;case 29:r=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:r=document.createElement("equation-block");break;case 31:r=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(r)}function Mf(e){e.index-=1}function Lf(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Of(e,t,n){e.nodes[e.index].setAttribute(wf(t),n)}function lo({textSig:e,doneSig:t}){let n=M(null);return _t(()=>{let r=n.current;if(!r)return;r.classList.add(`${C.cssPrefix}-md`),r.replaceChildren();let o=Na(r),i=Oa(o),s=0,l=kt(()=>{let _=e.value,p=t.value;_.length<s&&(r.replaceChildren(),o=Na(r),i=Oa(o),s=0);let d=_.slice(s);d&&Xe(i,d),s=_.length,p&&Sc(i)}),c=new MutationObserver(_=>{for(let p of _)for(let d of p.addedNodes){if(!(d instanceof HTMLElement))continue;let f=d.matches?.("a")?[d]:[...d.querySelectorAll?.("a")??[]];for(let m of f)kc(m)}});c.observe(r,{childList:!0,subtree:!0});for(let _ of r.querySelectorAll("a"))kc(_);let u=_=>{let p=_.target?.closest?.("a");if(!p||!(p instanceof HTMLAnchorElement))return;let d=p.getAttribute("href")??"";!d||d.startsWith("#")||(_.preventDefault(),window.open(d,"_blank","noopener,noreferrer"))};return r.addEventListener("click",u),()=>{l(),c.disconnect(),r.removeEventListener("click",u)}},[e,t]),a("div",{ref:n})}function wc({text:e}){let t=Q(()=>Y(e),[e]),n=Q(()=>Y(!0),[]);return a(lo,{textSig:t,doneSig:n})}function kc(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var co=C.cssPrefix;function Cc({messageId:e,initial:t,strings:n,onFeedback:r}){let[o,i]=O(t);E(()=>i(t),[e,t]);let s=l=>{let c=o===l?null:l;i(c),r(e,c)};return a("div",{class:`${co}-feedback`,role:"group","data-testid":R.messageFeedback,children:[a("button",{type:"button",class:`${co}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>s("up"),"data-testid":R.feedbackUp,children:a(Nl,{})}),a("button",{type:"button",class:`${co}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>s("down"),"data-testid":R.feedbackDown,children:a(Dl,{})}),a("span",{class:`${co}-sr-only`,role:"status","aria-live":"polite",children:o?n.feedbackThanks:""})]})}var yn=C.cssPrefix;function Rc({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${yn}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":R.source,children:[a("span",{class:`${yn}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${yn}-source-label`,children:n})]}):a("span",{class:`${yn}-source`,"data-testid":R.source,children:[a("span",{class:`${yn}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${yn}-source-label`,children:n})]})}var tt=C.cssPrefix;function Tc({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,onDecision:i,onEdit:s}){let l=Q(()=>me(()=>e.approvalSig.value),[e]),c=Q(()=>me(()=>vc(e,{active:n,superseded:r,continuationStreaming:o})),[e,n,r,o]).value,{terminal:u,showApproveReject:_,showAnswered:p,showSubmitted:d,showEdit:f,skipped:m}=c,v=Ca(e.toolName),h=c.answeredApproved,x=e.toolCallId,P=a(de,{children:[a("p",{class:`${tt}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",v)}),a("p",{class:`${tt}-toolui-subtle`,children:t.approvalBody})]});d?P=a("p",{class:`${tt}-toolui-subtle`,children:t.approvalSubmitting}):p&&h!==!1?P=a(de,{children:[a("p",{class:`${tt}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",h?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?a("p",{class:`${tt}-toolui-subtle`,children:t.approvalEditHint}):null,f?null:a("p",{class:`${tt}-toolui-subtle`,children:t.approvalSubmitting})]}):p&&(P=a(de,{}));let b=_||d||f||p&&h!==!1;return a("div",{class:`${tt}-toolui-group`,"data-testid":c.decided?R.toolDecision:R.toolApproval,children:[a(ao,{part:e,strings:t,superseded:m,submitted:d}),m||u||!b?null:a("div",{class:`${tt}-toolui ${tt}-toolui-body`,children:[P,_?a("div",{class:`${tt}-toolui-actions`,children:[a("button",{type:"button",class:`${tt}-form-skip`,disabled:!n,onClick:()=>i(x,!1),"data-testid":R.toolReject,children:t.reject}),a("button",{type:"button",class:`${tt}-form-submit`,disabled:!n,onClick:()=>i(x,!0),"data-testid":R.toolApprove,children:t.approve})]}):null,f?a("div",{class:`${tt}-toolui-actions`,children:a("button",{type:"button",class:`${tt}-form-skip`,onClick:()=>s(x),"data-testid":R.toolEdit,children:t.edit})}):null]})]})}var Df=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Ic(e){let t=e&&typeof e=="object"?e:{},r=(Array.isArray(t.questions)?t.questions:[]).map($f).filter(o=>o!==null);return{intro:uo(t.intro),questions:r}}function $f(e,t){if(!e||typeof e!="object")return null;let n=e,r=Df.has(n.type)?n.type:"text";return{key:uo(n.key)??`q${t+1}`,question:uo(n.question)??"Please provide the missing information.",type:r,options:Array.isArray(n.options)?n.options.filter(o=>typeof o=="string"&&o.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:uo(n.helpText)}}function Ff(e){switch(e){case"text":return"textarea";case"phone":return"tel";case"single-select":case"boolean":return"radio";case"multi-select":return"multiselect";default:return e}}function Da(e,t,n){return e.questions.map(r=>{let o=Ff(r.type),i=r.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(r.options??[]).map(s=>({value:s,label:s}));return{name:r.key,label:r.question,type:o,required:r.required??!1,options:i.length>0?i:void 0,validationHint:r.helpText}})}function uo(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var Fe=C.cssPrefix,Bf={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Ec(e,t){let n={};for(let r of e)n[r.key]=t[Bf[r.type]];return n}function Ac({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,onDecision:i,onEdit:s}){let l=Q(()=>me(()=>e.stateSig.value),[e]).value,c=Q(()=>me(()=>e.approvalSig.value),[e]).value,u=Q(()=>me(()=>Ic(e.inputSig.value)),[e]).value,{terminal:_,decided:p}=oo(l,c),d=p&&c?.approved===!0,f=o&&!p,m=!p&&!r&&!f,v=!m&&!d&&!f,h=d&&n&&!_,x=u.questions,[P,b]=O(null),k=P??(m||d||f),[w,B]=O(!1),z=x.length>1?fa:Vn,q=m?t.inputRequired:t.inputBadge,I=f?a("p",{class:`${Fe}-toolui-subtle`,children:t.approvalSubmitting}):m?a(Hf,{req:u,strings:t,active:n,resolve:(N,Z)=>i(e.toolCallId,Z,N)}):w?a(jn,{fields:Da(u,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Ec(x,t),initialValues:d?Wf(x,c?.reason):void 0}):a(Uf,{questions:x,answers:d?Vf(c?.reason):{},strings:t}),U="completed",V=t.inputAnswered;return v?(U="superseded",V=t.inputSkipped):f&&(U="responded",V=t.statusResponded),a("details",{class:`${Fe}-toolui ${Fe}-toolui-collapsible${r?` ${Fe}-toolui-stale`:""}`,open:k,onToggle:N=>{let Z=N.currentTarget.open;Z!==k&&b(Z)},"data-testid":m?R.toolAskQuestions:R.toolDecision,children:[a("summary",{class:`${Fe}-toolui-head`,children:[a("span",{class:`${Fe}-toolui-q-pill`,children:[a(z,{}),q]}),a("span",{class:`${Fe}-toolui-head-end`,children:[m?null:a(Ra,{status:U,icon:v?a(Wr,{}):a(Vr,{}),label:V}),a("span",{class:`${Fe}-toolui-chevron`,children:a(Yt,{})})]})]}),a("div",{class:`${Fe}-toolui-collapse-body`,children:[u.intro?a("div",{class:`${Fe}-toolui-desc`,children:u.intro}):null,I,m||f?null:a("div",{class:`${Fe}-toolui-footer`,children:[a("button",{type:"button",class:`${Fe}-toolui-options-toggle`,onClick:()=>B(N=>!N),"data-testid":R.toolAskOptions,children:[a("span",{class:`${Fe}-toolui-options-chevron${w?` ${Fe}-open`:""}`,children:a(Yt,{})}),w?t.hideOptions:t.showOptions]}),h?a("button",{type:"button",class:`${Fe}-form-skip`,onClick:()=>s(e.toolCallId),"data-testid":R.toolEdit,children:t.edit}):null]})]})]})}function Hf({req:e,strings:t,active:n,resolve:r}){let o=Da(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(jn,{fields:o,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:s=>r(qf(e.questions,s),!0),skipLabel:t.inputSkip,onSkip:()=>r(void 0,!1),submitOnEnter:i,fieldTypeLabels:Ec(e.questions,t),submitTestId:R.toolInputSubmit,skipTestId:R.toolInputSkip})}function Uf({questions:e,answers:t,strings:n}){return a("div",{class:`${Fe}-toolui-summary`,"data-testid":R.toolAskSummary,children:e.map(r=>a("div",{class:`${Fe}-field`,children:[a("span",{class:`${Fe}-field-head`,children:a("span",{class:`${Fe}-field-label`,children:[r.question,r.required?a("span",{class:`${Fe}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${Fe}-toolui-answer`,children:zf(r,t[r.key],n)||"\u2014"})]},r.key))})}function zf(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function qf(e,t){let n=e.flatMap(r=>{let o=t[r.key];if(o==null||o.trim()==="")return[];let i=r.type==="multi-select"?o.split(",").map(s=>s.trim()).filter(Boolean):o;return[{key:r.key,value:i}]});return JSON.stringify({answers:n})}function Mc(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let r={};for(let o of n)if(o&&typeof o=="object"&&"key"in o){let{key:i,value:s}=o;if(typeof i!="string")continue;typeof s=="string"?r[i]=s:Array.isArray(s)&&(r[i]=s.filter(l=>typeof l=="string"))}return r}function Vf(e){let t=Mc(e),n={};for(let[r,o]of Object.entries(t))n[r]=Array.isArray(o)?o.join(", "):o;return n}function Wf(e,t){let n=Mc(t),r={};for(let o of e){let i=n[o.key];i!==void 0&&(o.type==="multi-select"?r[o.key]=Array.isArray(i)?i:[i]:r[o.key]=Array.isArray(i)?i[0]??"":i)}return r}function Lc({part:e,strings:t,live:n}){let r=Q(()=>me(()=>e.inputSig.value),[e]),o=Q(()=>me(()=>e.outputSig.value),[e]),i=Q(()=>me(()=>e.errorSig.value),[e]);return Q(()=>me(()=>!!io(r.value)||!!i.value||!!io(Ia(o.value))),[r,o,i]).value?a(ao,{part:e,strings:t,testid:R.toolCall,live:n}):null}var Ke=C.cssPrefix,Oc=cc(Gf);function Gf({message:e,status:t,strings:n,responseMode:r,showReasoning:o,showToolCalls:i,showSources:s,interactive:l=!1,superseded:c=!1,tool:u,onRetry:_,enableMessageFeedback:p=!1,onFeedback:d}){let m=Q(()=>me(()=>e.partsSig.value),[e]).value,v=Q(()=>me(()=>Gt(e)),[e]),h=Q(()=>me(()=>el(e)),[e]),x=Q(()=>me(()=>fc(e)),[e]),P=Q(()=>me(()=>o&&mc(e)),[e,o]),b=t==="streaming",y=e.role==="assistant"&&b,k=gc({streaming:y,responseMode:r,reasoningVisible:P.value,hasAnswerText:x.value,emptyReply:v.value,hidden:h.value}),{bufferedHold:w,working:B,showStreamDots:z}=k;if(k.hidden)return null;let q=jf(e.createdAt),I=e.role==="assistant"||e.role==="operator",U=p&&!!d&&!!e.serverMessageId&&I&&!b&&t!=="error"&&!v.value,V=b?"":m.filter(le=>le.kind==="text").map(le=>le.textSig.peek()).join(`
|
|
37
|
+
`){fe(e),ge(e,o),e.pending=n;continue}}else{if(s===n){fe(e),ge(e,i),ge(e,o),e.pending="";continue}if(n!==" "&&n!==`
|
|
38
|
+
`){fe(e),ge(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=r;continue}}else if(n!==" "&&n!==`
|
|
39
|
+
`){fe(e),ge(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=r;continue}else{if(Ef(n.charCodeAt(0)))break;fe(e),ge(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){fe(e),ge(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){fe(e),ge(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}fe(e)}function Na(e){return{add_token:Af,end_token:Mf,add_text:Lf,set_attr:Of,data:{nodes:[e,,,,,],index:0}}}function Af(e,t){let n=e.nodes[e.index],r;switch(t){case 1:return;case 20:r=document.createElement("blockquote");break;case 2:r=document.createElement("p");break;case 21:r=document.createElement("br");break;case 22:r=document.createElement("hr");break;case 3:r=document.createElement("h1");break;case 4:r=document.createElement("h2");break;case 5:r=document.createElement("h3");break;case 6:r=document.createElement("h4");break;case 7:r=document.createElement("h5");break;case 8:r=document.createElement("h6");break;case 12:case 13:r=document.createElement("em");break;case 14:case 15:r=document.createElement("strong");break;case 16:r=document.createElement("s");break;case 11:r=document.createElement("code");break;case 18:case 17:r=document.createElement("a");break;case 19:r=document.createElement("img");break;case 23:r=document.createElement("ul");break;case 24:r=document.createElement("ol");break;case 25:r=document.createElement("li");break;case 26:let o=r=document.createElement("input");o.type="checkbox",o.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),r=document.createElement("code");break;case 27:r=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}r=document.createElement("tr");break;case 29:r=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:r=document.createElement("equation-block");break;case 31:r=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(r)}function Mf(e){e.index-=1}function Lf(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Of(e,t,n){e.nodes[e.index].setAttribute(wf(t),n)}function lo({textSig:e,doneSig:t}){let n=M(null);return pt(()=>{let r=n.current;if(!r)return;r.classList.add(`${C.cssPrefix}-md`),r.replaceChildren();let o=Na(r),i=Oa(o),s=0,l=wt(()=>{let _=e.value,p=t.value;_.length<s&&(r.replaceChildren(),o=Na(r),i=Oa(o),s=0);let d=_.slice(s);d&&Xe(i,d),s=_.length,p&&Sc(i)}),c=new MutationObserver(_=>{for(let p of _)for(let d of p.addedNodes){if(!(d instanceof HTMLElement))continue;let f=d.matches?.("a")?[d]:[...d.querySelectorAll?.("a")??[]];for(let m of f)kc(m)}});c.observe(r,{childList:!0,subtree:!0});for(let _ of r.querySelectorAll("a"))kc(_);let u=_=>{let p=_.target?.closest?.("a");if(!p||!(p instanceof HTMLAnchorElement))return;let d=p.getAttribute("href")??"";!d||d.startsWith("#")||(_.preventDefault(),window.open(d,"_blank","noopener,noreferrer"))};return r.addEventListener("click",u),()=>{l(),c.disconnect(),r.removeEventListener("click",u)}},[e,t]),a("div",{ref:n})}function wc({text:e}){let t=Z(()=>J(e),[e]),n=Z(()=>J(!0),[]);return a(lo,{textSig:t,doneSig:n})}function kc(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var co=C.cssPrefix;function Cc({messageId:e,initial:t,strings:n,onFeedback:r}){let[o,i]=D(t);E(()=>i(t),[e,t]);let s=l=>{let c=o===l?null:l;i(c),r(e,c)};return a("div",{class:`${co}-feedback`,role:"group","data-testid":R.messageFeedback,children:[a("button",{type:"button",class:`${co}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>s("up"),"data-testid":R.feedbackUp,children:a(Nl,{})}),a("button",{type:"button",class:`${co}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>s("down"),"data-testid":R.feedbackDown,children:a(Dl,{})}),a("span",{class:`${co}-sr-only`,role:"status","aria-live":"polite",children:o?n.feedbackThanks:""})]})}var yn=C.cssPrefix;function Rc({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${yn}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":R.source,children:[a("span",{class:`${yn}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${yn}-source-label`,children:n})]}):a("span",{class:`${yn}-source`,"data-testid":R.source,children:[a("span",{class:`${yn}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${yn}-source-label`,children:n})]})}var rt=C.cssPrefix;function Tc({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,onDecision:i,onEdit:s}){let l=Z(()=>pe(()=>e.approvalSig.value),[e]),c=Z(()=>pe(()=>vc(e,{active:n,superseded:r,continuationStreaming:o})),[e,n,r,o]).value,{terminal:u,showApproveReject:_,showAnswered:p,showSubmitted:d,showEdit:f,skipped:m}=c,b=Ca(e.toolName),v=c.answeredApproved,P=e.toolCallId,x=a(ce,{children:[a("p",{class:`${rt}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",b)}),a("p",{class:`${rt}-toolui-subtle`,children:t.approvalBody})]});d?x=a("p",{class:`${rt}-toolui-subtle`,children:t.approvalSubmitting}):p&&v!==!1?x=a(ce,{children:[a("p",{class:`${rt}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",v?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?a("p",{class:`${rt}-toolui-subtle`,children:t.approvalEditHint}):null,f?null:a("p",{class:`${rt}-toolui-subtle`,children:t.approvalSubmitting})]}):p&&(x=a(ce,{}));let h=_||d||f||p&&v!==!1;return a("div",{class:`${rt}-toolui-group`,"data-testid":c.decided?R.toolDecision:R.toolApproval,children:[a(ao,{part:e,strings:t,superseded:m,submitted:d}),m||u||!h?null:a("div",{class:`${rt}-toolui ${rt}-toolui-body`,children:[x,_?a("div",{class:`${rt}-toolui-actions`,children:[a("button",{type:"button",class:`${rt}-form-skip`,disabled:!n,onClick:()=>i(P,!1),"data-testid":R.toolReject,children:t.reject}),a("button",{type:"button",class:`${rt}-form-submit`,disabled:!n,onClick:()=>i(P,!0),"data-testid":R.toolApprove,children:t.approve})]}):null,f?a("div",{class:`${rt}-toolui-actions`,children:a("button",{type:"button",class:`${rt}-form-skip`,onClick:()=>s(P),"data-testid":R.toolEdit,children:t.edit})}):null]})]})}var Df=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Ic(e){let t=e&&typeof e=="object"?e:{},r=(Array.isArray(t.questions)?t.questions:[]).map($f).filter(o=>o!==null);return{intro:uo(t.intro),questions:r}}function $f(e,t){if(!e||typeof e!="object")return null;let n=e,r=Df.has(n.type)?n.type:"text";return{key:uo(n.key)??`q${t+1}`,question:uo(n.question)??"Please provide the missing information.",type:r,options:Array.isArray(n.options)?n.options.filter(o=>typeof o=="string"&&o.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:uo(n.helpText)}}function Ff(e){switch(e){case"text":return"textarea";case"phone":return"tel";case"single-select":case"boolean":return"radio";case"multi-select":return"multiselect";default:return e}}function Da(e,t,n){return e.questions.map(r=>{let o=Ff(r.type),i=r.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(r.options??[]).map(s=>({value:s,label:s}));return{name:r.key,label:r.question,type:o,required:r.required??!1,options:i.length>0?i:void 0,validationHint:r.helpText}})}function uo(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var Be=C.cssPrefix,Bf={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Ec(e,t){let n={};for(let r of e)n[r.key]=t[Bf[r.type]];return n}function Ac({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,onDecision:i,onEdit:s}){let l=Z(()=>pe(()=>e.stateSig.value),[e]).value,c=Z(()=>pe(()=>e.approvalSig.value),[e]).value,u=Z(()=>pe(()=>Ic(e.inputSig.value)),[e]).value,{terminal:_,decided:p}=oo(l,c),d=p&&c?.approved===!0,f=o&&!p,m=!p&&!r&&!f,b=!m&&!d&&!f,v=d&&n&&!_,P=u.questions,[x,h]=D(null),k=x??(m||d||f),[w,B]=D(!1),W=P.length>1?fa:Vn,U=m?t.inputRequired:t.inputBadge,I=f?a("p",{class:`${Be}-toolui-subtle`,children:t.approvalSubmitting}):m?a(Hf,{req:u,strings:t,active:n,resolve:(L,ne)=>i(e.toolCallId,ne,L)}):w?a(jn,{fields:Da(u,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Ec(P,t),initialValues:d?Wf(P,c?.reason):void 0}):a(Uf,{questions:P,answers:d?Vf(c?.reason):{},strings:t}),z="completed",q=t.inputAnswered;return b?(z="superseded",q=t.inputSkipped):f&&(z="responded",q=t.statusResponded),a("details",{class:`${Be}-toolui ${Be}-toolui-collapsible${r?` ${Be}-toolui-stale`:""}`,open:k,onToggle:L=>{let ne=L.currentTarget.open;ne!==k&&h(ne)},"data-testid":m?R.toolAskQuestions:R.toolDecision,children:[a("summary",{class:`${Be}-toolui-head`,children:[a("span",{class:`${Be}-toolui-q-pill`,children:[a(W,{}),U]}),a("span",{class:`${Be}-toolui-head-end`,children:[m?null:a(Ra,{status:z,icon:b?a(Wr,{}):a(Vr,{}),label:q}),a("span",{class:`${Be}-toolui-chevron`,children:a(Yt,{})})]})]}),a("div",{class:`${Be}-toolui-collapse-body`,children:[u.intro?a("div",{class:`${Be}-toolui-desc`,children:u.intro}):null,I,m||f?null:a("div",{class:`${Be}-toolui-footer`,children:[a("button",{type:"button",class:`${Be}-toolui-options-toggle`,onClick:()=>B(L=>!L),"data-testid":R.toolAskOptions,children:[a("span",{class:`${Be}-toolui-options-chevron${w?` ${Be}-open`:""}`,children:a(Yt,{})}),w?t.hideOptions:t.showOptions]}),v?a("button",{type:"button",class:`${Be}-form-skip`,onClick:()=>s(e.toolCallId),"data-testid":R.toolEdit,children:t.edit}):null]})]})]})}function Hf({req:e,strings:t,active:n,resolve:r}){let o=Da(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(jn,{fields:o,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:s=>r(qf(e.questions,s),!0),skipLabel:t.inputSkip,onSkip:()=>r(void 0,!1),submitOnEnter:i,fieldTypeLabels:Ec(e.questions,t),submitTestId:R.toolInputSubmit,skipTestId:R.toolInputSkip})}function Uf({questions:e,answers:t,strings:n}){return a("div",{class:`${Be}-toolui-summary`,"data-testid":R.toolAskSummary,children:e.map(r=>a("div",{class:`${Be}-field`,children:[a("span",{class:`${Be}-field-head`,children:a("span",{class:`${Be}-field-label`,children:[r.question,r.required?a("span",{class:`${Be}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${Be}-toolui-answer`,children:zf(r,t[r.key],n)||"\u2014"})]},r.key))})}function zf(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function qf(e,t){let n=e.flatMap(r=>{let o=t[r.key];if(o==null||o.trim()==="")return[];let i=r.type==="multi-select"?o.split(",").map(s=>s.trim()).filter(Boolean):o;return[{key:r.key,value:i}]});return JSON.stringify({answers:n})}function Mc(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let r={};for(let o of n)if(o&&typeof o=="object"&&"key"in o){let{key:i,value:s}=o;if(typeof i!="string")continue;typeof s=="string"?r[i]=s:Array.isArray(s)&&(r[i]=s.filter(l=>typeof l=="string"))}return r}function Vf(e){let t=Mc(e),n={};for(let[r,o]of Object.entries(t))n[r]=Array.isArray(o)?o.join(", "):o;return n}function Wf(e,t){let n=Mc(t),r={};for(let o of e){let i=n[o.key];i!==void 0&&(o.type==="multi-select"?r[o.key]=Array.isArray(i)?i:[i]:r[o.key]=Array.isArray(i)?i[0]??"":i)}return r}function Lc({part:e,strings:t,live:n}){let r=Z(()=>pe(()=>e.inputSig.value),[e]),o=Z(()=>pe(()=>e.outputSig.value),[e]),i=Z(()=>pe(()=>e.errorSig.value),[e]);return Z(()=>pe(()=>!!io(r.value)||!!i.value||!!io(Ia(o.value))),[r,o,i]).value?a(ao,{part:e,strings:t,testid:R.toolCall,live:n}):null}var Ke=C.cssPrefix,Oc=cc(Gf);function Gf({message:e,status:t,strings:n,responseMode:r,showReasoning:o,showToolCalls:i,showSources:s,interactive:l=!1,superseded:c=!1,tool:u,onRetry:_,enableMessageFeedback:p=!1,onFeedback:d}){let m=Z(()=>pe(()=>e.partsSig.value),[e]).value,b=Z(()=>pe(()=>Gt(e)),[e]),v=Z(()=>pe(()=>el(e)),[e]),P=Z(()=>pe(()=>fc(e)),[e]),x=Z(()=>pe(()=>o&&mc(e)),[e,o]),h=t==="streaming",y=e.role==="assistant"&&h,k=gc({streaming:y,responseMode:r,reasoningVisible:x.value,hasAnswerText:P.value,emptyReply:b.value,hidden:v.value}),{bufferedHold:w,working:B,showStreamDots:W}=k;if(k.hidden)return null;let U=jf(e.createdAt),I=e.role==="assistant"||e.role==="operator",z=p&&!!d&&!!e.serverMessageId&&I&&!h&&t!=="error"&&!b.value,q=h?"":m.filter(oe=>oe.kind==="text").map(oe=>oe.textSig.peek()).join(`
|
|
40
40
|
|
|
41
|
-
`).trim(),N=!b&&t!=="error"&&!v.value&&V.length>0,Z=U||N;return a("div",{class:`${Ke}-bubble-row`,"data-role":e.role,"data-testid":Ge(R.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${Ke}-bubble-col`,children:[a("div",{class:`${Ke}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${Ke}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${Ke}-bubble-body`,children:[w?a(em,{label:n.loading}):m.map((le,oe)=>a(Xf,{part:le,active:B,live:y,strings:n,showReasoning:o,showToolCalls:i,showSources:s,interactive:l&&t==="complete"&&(le.kind!=="tool"||$r(e,oe)),superseded:c,continuationStreaming:e.continuationStreaming===!0,tool:u},`${Qf(le)}#${oe}`)),z&&a(Zf,{}),t==="error"||v.value?a("div",{class:`${Ke}-error`,role:"alert",children:[a("span",{children:e.errorText??n.errorGeneric}),_?a("button",{type:"button",class:`${Ke}-error-retry`,onClick:()=>_(e),"data-testid":R.messageRetry,children:n.errorRetry}):null]}):null]})]}),q||Z?a("div",{class:`${Ke}-bubble-meta`,children:[q?a("time",{class:`${Ke}-bubble-time`,dateTime:q.iso,title:q.full,children:q.short}):null,Z?a("div",{class:`${Ke}-bubble-actions`,children:[U&&e.serverMessageId?a(Cc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:n,onFeedback:d}):null,N?a(Kf,{text:V,strings:n}):null]}):null]}):null]})})}function Kf({text:e,strings:t}){let[n,r]=O(!1),o=()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return a("button",{type:"button",class:`${Ke}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:o,"data-testid":R.messageCopy,children:n?a(Xt,{}):a(Ol,{})})}function jf(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function Xf({part:e,active:t,live:n,strings:r,showReasoning:o,showToolCalls:i,showSources:s,interactive:l,superseded:c,continuationStreaming:u,tool:_}){switch(e.kind){case"step-start":return null;case"text":return a(lo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?a(Jf,{part:e,active:t,strings:r}):null;case"tool":return a(Yf,{part:e,strings:r,showToolCalls:i,interactive:l,superseded:c,continuationStreaming:u,live:n,tool:_});case"file":return e.mediaType.startsWith("image/")?a("img",{src:e.url,alt:"",loading:"lazy"}):a("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return s?a(Rc,{part:e,strings:r}):null}}function Yf({part:e,strings:t,showToolCalls:n,interactive:r,superseded:o,continuationStreaming:i,live:s,tool:l}){let c=Q(()=>me(()=>e.approvalSig.value!==void 0),[e]);return l?.humanInLoop&&c.value?ro(e.toolName)?a(Ac,{part:e,strings:t,active:r,superseded:o,continuationStreaming:i,onDecision:l.onDecision,onEdit:l.onEdit}):a(Tc,{part:e,strings:t,active:r,superseded:o,continuationStreaming:i,onDecision:l.onDecision,onEdit:l.onEdit}):n?a(Lc,{part:e,strings:t,live:s}):null}function Jf({part:e,active:t,strings:n}){return a("details",{class:`${Ke}-reasoning`,"data-testid":R.reasoning,open:t,"data-active":t?"true":void 0,children:[a("summary",{class:`${Ke}-reasoning-summary`,children:a("span",{class:`${Ke}-reasoning-label`,children:t?n.thinking:n.thoughts})}),a("div",{class:`${Ke}-reasoning-body`,children:a(lo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Qf(e){switch(e.kind){case"text":case"reasoning":case"step-start":return`${e.kind}:${e.id}`;case"tool":return`tool:${e.toolCallId}`;case"file":return`file:${e.url}`;case"source":return`source:${e.sourceId}`}}function Zf(){return a("span",{class:`${Ke}-typing`,"data-testid":R.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function em({label:e}){return a("span",{class:`${Ke}-loading`,role:"status",children:[a("span",{class:`${Ke}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${Ke}-loading-label`,children:e})]})}var Ot=C.cssPrefix,$a=120,tm=350;function Nc({messagesSig:e,strings:t,responseMode:n,showReasoning:r,showToolCalls:o,showSources:i,enableMessageFeedback:s,onFeedback:l,loading:c,onLoadPreviousMessages:u,idle:_,controlMode:p="ai-agent",tool:d,onRetry:f,form:m,formMarkers:v,onFillForm:h}){let x=M(null),P=wt(()=>e.value),[b,y]=O(!1),[k,w]=O(!1),B=M(!1),z=M(!1),[q,I]=O(),U=M(!1),V=M(!1),N=M(!1),Z=M(0),le=()=>N.current||performance.now()-Z.current<tm,oe=M(0),Le=S=>{let W=S.scrollHeight-S.clientHeight>1;S.dataset.fadeTop=W&&S.scrollTop>1?"true":"false",S.dataset.fadeBottom=W&&S.scrollHeight-S.scrollTop-S.clientHeight>1?"true":"false"},pe=S=>y(S.scrollHeight-S.scrollTop-S.clientHeight>$a*2),_e=S=>{oe.current=performance.now(),S.scrollTop=S.scrollHeight,Le(S)},ye=(S,W)=>{_e(S);let ce=W,fe=0,Ne=()=>{V.current||le()||(_e(S),--ce>0&&(fe=requestAnimationFrame(Ne)))};return W>0&&(fe=requestAnimationFrame(Ne)),()=>cancelAnimationFrame(fe)},F=(S,W)=>{let ce,fe,Ne,gt=-1,ct=()=>{ce.disconnect(),fe.disconnect(),clearTimeout(Ne)},qe=()=>{if(V.current||le()||gt>=0&&S.scrollTop<gt-4)return ct();_e(S),gt=S.scrollTop};return ce=new ResizeObserver(qe),fe=new MutationObserver(qe),qe(),ce.observe(S),fe.observe(S,{childList:!0,subtree:!0,characterData:!0}),Ne=setTimeout(ct,W),ct},ve=P.value[0]?.id;_t(()=>{let S=x.current;if(S&&P.value.length!==0&&!z.current&&(U.current=!0,!!P.value.some(W=>W.role==="user")))return F(S,300)},[ve]);let ie=M(0);E(()=>{let S=x.current,W=P.value,ce=ie.current;if(ie.current=W.length,!S||!U.current||z.current)return;if(W.slice(ce).some(Ne=>Ne.role==="user"))return V.current=!1,ye(S,3);if(!W.some(Ne=>Ne.role==="user")||V.current||le())return;S.scrollHeight-S.scrollTop-S.clientHeight<$a&&_e(S)},[P.value.length]);let Re=M(null);E(()=>{let S=x.current,W=P.value.at(-1),ce=Re.current;if(Re.current=W?{id:W.id,streaming:W.status==="streaming"}:null,!!S&&U.current&&!(!W||W.id!==ce?.id||ce.streaming||W.status!=="streaming"))return V.current=!1,ye(S,3)},[P.value]),E(()=>{let S=x.current;if(!S)return;let W=P.value.at(-1);if(!W||W.status!=="streaming"&&!P.value.some(Ne=>Ne.role==="user"))return;let ce=()=>{if(V.current||le())return;S.scrollHeight-S.scrollTop-S.clientHeight<$a*2&&_e(S)};if(W.status!=="streaming")return F(S,300);ce();let fe=new MutationObserver(ce);return fe.observe(S,{childList:!0,subtree:!0,characterData:!0}),()=>fe.disconnect()},[P.value]);let Oe=m?.form.id,Se=!!m&&(v??[]).some(S=>S.formId===m.form.id);_t(()=>{let S=x.current;!S||!Oe||V.current||P.value.some(W=>W.role==="user")&&(Se?S.querySelector(`[data-testid="${R.formGate}"]`)?.scrollIntoView({block:"nearest"}):_e(S))},[Oe,Se]),E(()=>{let S=x.current;if(!S)return;let W=()=>{pe(S),Le(S),performance.now()-oe.current>150&&(V.current=S.scrollHeight-S.scrollTop-S.clientHeight>8)},ce=()=>{V.current=!0},fe=vt=>{vt.deltaY<0&&ce()},Ne=0,gt=vt=>{Ne=vt.touches[0]?.clientY??0,N.current=!0},ct=vt=>{(vt.touches[0]?.clientY??0)>Ne+4&&ce()},qe=()=>{N.current=!1,Z.current=performance.now()},Ft=()=>{N.current=!0};return S.addEventListener("scroll",W,{passive:!0}),S.addEventListener("wheel",fe,{passive:!0}),S.addEventListener("touchstart",gt,{passive:!0}),S.addEventListener("touchmove",ct,{passive:!0}),S.addEventListener("touchend",qe,{passive:!0}),S.addEventListener("touchcancel",qe,{passive:!0}),S.addEventListener("pointerdown",Ft,{passive:!0}),window.addEventListener("pointerup",qe,{passive:!0}),window.addEventListener("pointercancel",qe,{passive:!0}),pe(S),()=>{S.removeEventListener("scroll",W),S.removeEventListener("wheel",fe),S.removeEventListener("touchstart",gt),S.removeEventListener("touchmove",ct),S.removeEventListener("touchend",qe),S.removeEventListener("touchcancel",qe),S.removeEventListener("pointerdown",Ft),window.removeEventListener("pointerup",qe),window.removeEventListener("pointercancel",qe)}},[]);let xe=()=>{let S=x.current;S&&(V.current=!1,_e(S))},Ue=P.value.filter(S=>!S.ephemeral),Pe=Ue[0],ke=Pe?.serverMessageId??Pe?.id,Ie=!!(u&&Ue.length>=la&&ke!==q),ze=async()=>{if(!u||B.current)return;let S=x.current,W=S?.scrollHeight??0,ce=S?.scrollTop??0;B.current=!0,z.current=!0,w(!0);try{let fe=await u();fe===!1&&ke&&I(ke),fe&&S&&(await new Promise(Ne=>requestAnimationFrame(()=>requestAnimationFrame(()=>Ne()))),S.scrollTop=ce+S.scrollHeight-W,Le(S),pe(S))}finally{z.current=!1,B.current=!1,w(!1)}},nt=[],H="",K=P.value.at(-1)?.id,te=[...v??[]].toSorted((S,W)=>(S.createdAt??1/0)-(W.createdAt??1/0)),re=S=>m&&S.formId===m.form.id?a(xa,{form:m.form,strings:t,onSubmit:m.onSubmit,onSkip:m.onSkip},`gate:${S.formId}`):a(ec,{marker:S,strings:t,onFill:!m&&h?()=>h(S.formId):void 0},S.key),rt=S=>{for(let W=te[0];W?.createdAt!==void 0&&!(S!==void 0&&W.createdAt>S);W=te[0])te.shift(),nt.push(re(W))};for(let S of P.value){if(S.role==="assistant"&&S.id!==K&&Gt(S))continue;rt(S.createdAt);let W=nm(S.createdAt);W&&W!==H&&(nt.push(a("div",{class:`${Ot}-date-divider`,children:a("span",{class:`${Ot}-date-pill`,title:rm(S.createdAt),children:om(S.createdAt,t)})},`day:${W}`)),H=W);let fe=S.retryAction!==void 0||S.role==="assistant"&&S.id===K?Hr(P.value,S):void 0,Ne=fe!==void 0&&(fe.kind!=="continue-assistant"||p==="ai-agent");nt.push(a(Oc,{message:S,status:S.status,strings:t,responseMode:n,showReasoning:r,showToolCalls:o,showSources:i,interactive:!!_&&p==="ai-agent"&&S.id===K,superseded:S.id!==K,tool:d,onRetry:_&&Ne&&(S.role==="user"||S.id===K)?f:void 0,enableMessageFeedback:s,onFeedback:l},S.id))}for(let S of te)nt.push(re(S));return a("div",{class:`${Ot}-list-wrap`,children:[a("div",{ref:x,class:`${Ot}-list ${Ot}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&P.value.length===0?a("div",{class:`${Ot}-list-loading`,role:"status",children:t.conversationLoading}):null,Ie?a("div",{class:`${Ot}-load-previous`,children:a("button",{type:"button",onClick:ze,disabled:k,"aria-busy":k,"data-testid":R.loadPreviousMessages,children:t.loadPreviousMessages})}):null,nt,m&&!Se?a(xa,{form:m.form,strings:t,onSubmit:m.onSubmit,onSkip:m.onSkip}):null]}),b?a("button",{type:"button",class:`${Ot}-jump`,onClick:xe,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":R.scrollToBottom,children:a(Yt,{})}):null]})}function nm(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function rm(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function om(e,t){let n=new Date(e),r=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),o=Math.round((r(new Date)-r(n))/864e5);return o<=0?t.dateToday:o===1?t.dateYesterday:o<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var am=["today","yesterday","lastWeek","older"];function im(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let r=Math.floor((Dc(e)-Dc(n))/(1440*60*1e3));return r<=0?"today":r===1?"yesterday":r<7?"lastWeek":"older"}function $c(e,t){let n=new Map;for(let r of t){let o=im(e,r.lastMessageAt),i=n.get(o);i?i.push(r):n.set(o,[r])}return am.filter(r=>n.has(r)).map(r=>({bucket:r,conversations:n.get(r)}))}function Dc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Fc=ee.scope("history"),sm=3,lm=6,cm={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function dm(e,t,n){let r=Date.parse(e);return Number.isFinite(r)?new Date(r).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(r):t-r<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(r):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(r):""}function _o({transport:e,strings:t,locale:n,persistence:r,visitorId:o,onSelect:i,onNewConversation:s}){let l=C.cssPrefix,c=e.peekConversations({visitorId:o}),[u,_]=O(c?"loaded":"loading"),[p,d]=O(c),[f,m]=O(!1),v=M(),h=p?.conversations??[],x=p?.pagination;E(()=>{let w=!1;v.current=void 0,m(!1);let B=e.peekConversations({visitorId:o});return d(B),_(B?"loaded":"loading"),e.listConversations({visitorId:o}).then(z=>{w||(d(z),_("loaded"),r.saveHistoryCount(z.conversations.length))}).catch(z=>{w||(Fc.warn("listConversations failed",{err:z}),_("error"))}),()=>{w=!0,v.current=void 0}},[e,o,r,n]);let P=async()=>{if(v.current||!x?.hasNext)return;let w={};v.current=w,m(!0);try{let B=await e.listConversations({visitorId:o,page:x.page+1,limit:x.limit});if(v.current!==w)return;let z=new Set(h.map(I=>I.conversationId)),q=[...h,...B.conversations.filter(I=>!z.has(I.conversationId))];d({conversations:q,pagination:B.pagination}),r.saveHistoryCount(q.length)}catch(B){if(v.current!==w)return;Fc.warn("listConversations page failed",{err:B,page:x.page+1})}finally{v.current===w&&(v.current=void 0,m(!1))}},b=s?a("div",{class:`${l}-history-footer`,children:a("button",{type:"button",class:`${l}-history-new`,onClick:s,"data-testid":R.sidebarNewConversation,children:[a(sl,{}),t.newConversation]})}):null;if(u==="loading"){let w=Math.min(r.loadHistoryCount()??sm,lm);return a(de,{children:[a("div",{class:`${l}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:a("div",{class:`${l}-history-group`,"aria-hidden":"true",children:[a("div",{class:`${l}-history-heading`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-heading`})}),a("div",{class:`${l}-history-card`,children:Array.from({length:Math.max(1,w)},(B,z)=>a("div",{class:`${l}-history-item ${l}-history-item-skeleton`,children:[a("span",{class:`${l}-history-avatar ${l}-skeleton`}),a("span",{class:`${l}-history-body`,children:[a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-title`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-title`})}),a("span",{class:`${l}-history-time`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-time`})})]}),a("span",{class:`${l}-history-row`,children:a("span",{class:`${l}-history-preview`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-preview`})})})]})]},z))})]})}),b]})}if(u==="error"||h.length===0)return a(de,{children:[a("div",{class:`${l}-history-empty`,children:t.historyEmpty}),b]});let y=Date.now(),k=$c(y,h);return a(de,{children:[a("div",{class:`${l}-history`,role:"list",children:[k.map(w=>a("div",{class:`${l}-history-group`,children:[a("div",{class:`${l}-history-heading`,children:t[cm[w.bucket]]}),a("div",{class:`${l}-history-card`,children:w.conversations.map(B=>a("button",{type:"button",role:"listitem",class:`${l}-history-item`,onClick:()=>i(B),"data-closed":B.canContinue?void 0:"true","data-unread":B.hasUnread?"true":void 0,"data-testid":Ge(R.historyItem,B.conversationId),children:[a("span",{class:`${l}-history-avatar`,"aria-hidden":"true",children:a(ma,{})}),a("span",{class:`${l}-history-body`,children:[a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-title`,children:B.title}),a("span",{class:`${l}-history-time`,children:dm(B.lastMessageAt,y,n)})]}),a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-preview`,children:B.preview??(B.canContinue?t.historyContinue:t.conversationClosed)}),B.hasUnread?a("span",{class:`${l}-history-dot`}):null]})]})]},B.conversationId))})]},w.bucket)),x?.hasNext?a("div",{class:`${l}-history-more`,children:a("button",{type:"button",onClick:P,disabled:f,"aria-busy":f,"data-testid":R.historyLoadMore,children:t.loadMoreConversations})}):null]}),b]})}var Bc=C.cssPrefix;function Hc({suggestions:e,onPick:t,disabled:n=!1}){return e.length===0?null:a("div",{class:`${Bc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((r,o)=>a("button",{type:"button",class:`${Bc}-suggestion`,onClick:()=>t(r),disabled:n,"data-testid":Ge(R.suggestion,o),children:r.label},r.id))})}var je=C.cssPrefix;function Uc(e){let{options:t,onClose:n}=e,r=t.strings,o=M(null);E(()=>{let u=o.current;if(!u)return;let _=Yr(u),p=d=>{d.key==="Escape"&&n?.()};return u.addEventListener("keydown",p),()=>{_(),u.removeEventListener("keydown",p)}},[n]);let i=e.composerApiRef,s=e.composerActive&&e.view==="chat"&&e.canSend&&!e.activeForm&&!e.sendPreparing&&e.options.features.fileUpload,l=L(u=>{s&&i.current?.attachFromDrop(u)},[i,s]),{visible:c}=eo({containerRef:o,onDrop:l,disabled:!s});return jr(o.current,t.mode==="modal"),a("div",{ref:o,class:`${je}-panel`,role:"dialog","aria-modal":"false","aria-label":r.panelTitle,style:{position:"relative"},"data-testid":R.panel,children:[a(Fa,{...e,containerEl:o.current,dragOver:c,composerAttachApiRef:i}),a(Ba,{poweredBy:e.options.poweredBy})]})}function Fa(e){let{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,composerKey:l,panelSize:c,view:u,canSend:_,isStreaming:p,sendPreparing:d,controlMode:f,assignedOperatorInitials:m,operatorAvailable:v,operatorRequestEnabled:h,onRequestOperator:x,onCancelOperatorRequest:P,loadingMessages:b,onLoadPreviousMessages:y,messagesSig:k,agent:w,suggestions:B,initialWidgetSize:z,visitorId:q,onClose:I,onBack:U,onClear:V,onToggleHistory:N,onSelectHistoryConversation:Z,onNewConversation:le,onWidgetSizeChange:oe,onSend:Le,onStop:pe,onSuggestion:_e,activeForm:ye,formMarkers:F,onFormSubmit:ve,onFormSkip:ie,onFormFill:Re,tool:Oe,onRetry:Se,onMessageFeedback:xe,containerEl:Ue,dragOver:Pe,composerAttachApiRef:ke}=e,Ie=t.strings,ze;return ye?ze=null:_?ze=a(de,{children:[f&&f!=="ai-agent"?a(pm,{controlMode:f,operatorInitials:m,operatorAvailable:v,onCancelOperatorRequest:P,strings:Ie}):null,!p&&f==="ai-agent"&&a(Hc,{suggestions:B,onPick:_e,disabled:d}),a(jl,{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,isStreaming:p,active:e.composerActive&&u==="chat",isPreparing:d,operatorRequestEnabled:h,controlMode:f,onRequestOperator:x,onSend:Le,onStop:pe,attachApiRef:ke},l)]}):ze=a(_m,{label:Ie.conversationClosed,ctaLabel:Ie.startNewConversation,onNewConversation:V}),a(de,{children:[u==="history"?a(um,{strings:Ie,onBack:N,onClose:I,showClose:Xr(t.mode,c,t.actions)}):a("header",{class:`${je}-header`,"data-testid":R.panelHeader,children:[U?a("button",{type:"button",class:`${je}-icon-btn`,onClick:U,"aria-label":Ie.moduleBack,title:Ie.moduleBack,children:a(qn,{})}):null,w?a(Vl,{agent:w,strings:Ie}):a("h1",{children:Ie.panelTitle}),a(ft,{panelProps:e,variant:"chat"})]}),u==="history"?a(_o,{transport:n,strings:Ie,locale:t.locale,persistence:i,visitorId:q,onSelect:nt=>Z(nt.conversationId),onNewConversation:le}):a(de,{children:[a(Xl,{visible:Pe,strings:Ie}),a(Nc,{messagesSig:k,strings:Ie,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:xe,loading:b,onLoadPreviousMessages:y,idle:!p&&!d&&_&&!ye,controlMode:f,tool:Oe,onRetry:Se,form:ye?{form:ye,onSubmit:ve,onSkip:ie}:null,formMarkers:F,onFillForm:Re}),ze,a(mm,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?a(Kr,{panelEl:Ue,resize:t.size.resize,position:t.position,initialSize:z,onSizeChange:oe,strings:Ie}):null]})}function um({strings:e,onBack:t,onClose:n,showClose:r}){return a("header",{class:`${je}-header`,children:[a("button",{type:"button",class:`${je}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(qn,{})}),a("h1",{children:e.historyTitle}),r?a("button",{type:"button",class:`${je}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(pt,{})}):null]})}function _m({label:e,ctaLabel:t,onNewConversation:n}){return a("div",{class:`${je}-readonly-banner`,role:"note",children:[a("span",{class:`${je}-readonly-label`,children:e}),a("button",{type:"button",class:`${je}-readonly-cta`,onClick:n,children:t})]})}function pm({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelOperatorRequest:r,strings:o}){let i=fm(e,t,n,o);return a("div",{class:`${je}-operator-banner`,role:"status","data-mode":e,"data-testid":R.operatorBanner,children:[a("span",{class:`${je}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${je}-operator-label`,children:i}),e==="awaiting_operator"&&r?a("button",{type:"button",class:`${je}-cancel-operator-request`,"data-testid":R.cancelOperatorRequest,onClick:r,children:o.cancelOperatorRequest}):null]})}function fm(e,t,n,r){return e==="operator"?r.chattingWithOperator.replace("{operator}",t??""):n===!1?r.noOperatorAvailable:r.connectingOperator}function mm({disclaimer:e}){return e?a("div",{class:`${je}-composer-footer`,children:a("div",{class:`${je}-disclaimer`,children:e})}):null}function Ba({poweredBy:e}){return e?a("div",{class:`${je}-poweredby-bar`,children:a(gm,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function gm({logoUrl:e,text:t,href:n}){let r=a(de,{children:[e?a("img",{class:`${je}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${je}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:r}):a("span",{class:`${je}-poweredby`,children:r})}function zc(e){let t=M(e);t.current=e;let n=M(null);return n.current??(n.current=vm(t)),n.current}function vm(e){let t=Y(null),n=new Set,r=c=>`${e.current.conversationId()??""}:${c}`,o=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(r(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,u)=>{if(t.value)return;let _=e.current;if(c==="manual"){let p=_.forms.list.find(d=>d.id===u);p&&(t.value={form:p,trigger:"manual"});return}for(let p of _.forms.byTrigger[c]??[]){let d=p.triggers.find(f=>f.kind===c);if(!(!d||!hm(d,_)||o(p)||!bm(p,_))){t.value={form:p,trigger:c};return}}},s=(c,u)=>{let _=t.value;if(!_)return;t.value=null;let{form:p,trigger:d}=_;p.frequency==="conversation"?n.add(r(p.id)):p.frequency!=="always"&&e.current.persistence.saveFormDone(p.id),e.current.onComplete(p,d,c,u)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let u=e.current.forms.list.find(_=>_.id===c.form.id);u&&u!==c.form&&(t.value={form:u,trigger:c.trigger})},complete:c=>s(c,!1),skip:()=>s({},!0)}}function hm(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function bm(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let o=t.userContext()??{};if(n.missingContext.some(i=>o[i]!==void 0&&o[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let r=t.messageCount();return!(n.minMessages!=null&&r<n.minMessages||n.maxMessages!=null&&r>n.maxMessages)}function qc(e){let t=C.cssPrefix,{site:n,blocks:r,strings:o,collapsed:i}=e,s=r?.navigation??[],l=r?.linkCards??[],c=i?o.expandSidebar:o.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":R.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(ym,{site:n}),a("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":R.sidebarToggle,children:a(Pm,{collapsed:i})})]}),i?null:a(de,{children:[s.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(xm,{items:s})}):null,l.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(Sm,{items:l})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(_o,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function ym({site:e}){let t=C.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return a("picture",{children:[e.logoDark?.url?a("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,a("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return a("div",{class:`${t}-sidebar-title`,children:e?.title??C.name})}function Pm({collapsed:e}){return a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?a("polyline",{points:"9 6 15 12 9 18"}):a("polyline",{points:"15 6 9 12 15 18"})})}function xm({items:e}){let t=C.cssPrefix;return a("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>a("li",{children:a("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?a("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,a("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function Sm({items:e}){let t=C.cssPrefix;return a("div",{class:`${t}-sidebar-cards`,children:e.map(n=>a("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[a("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?a("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var Vc=C.cssPrefix;function Wc(e){return a("main",{class:`${Vc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a(qc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),a("section",{class:`${Vc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Gc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Ha(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}function Kc(e,t,n){let r=[...new Set(t)],o=Ha(r,e,""),i=Y({activeTab:o,stacks:Gc(r)});return{sig:i,reconcile(s,l){let c=[...new Set(s)],u=i.value,_=Ha(c,u.activeTab,l),p=Object.fromEntries(c.map(f=>[f,u.stacks[f]??[]])),d=_===u.activeTab&&c.length===Object.keys(u.stacks).length&&c.every(f=>u.stacks[f]===p[f]);r=c,!d&&(i.value={activeTab:_,stacks:p},_!==u.activeTab&&_&&n?.(_))},switchTab(s){!(s in i.value.stacks)||i.value.activeTab===s||(i.value={...i.value,activeTab:s},n?.(s))},push(s){let l=i.value,c=l.stacks[l.activeTab]??[];i.value={...l,stacks:{...l.stacks,[l.activeTab]:[...c,s]}}},pop(){let s=i.value,l=s.stacks[s.activeTab]??[];l.length!==0&&(i.value={...s,stacks:{...s.stacks,[s.activeTab]:l.slice(0,-1)}})},reset(s){i.value={activeTab:Ha(r,s,""),stacks:Gc(r)}}}}var jc=e=>e.stacks[e.activeTab]??[],Xc=e=>jc(e).at(-1),Yc=e=>jc(e).length===0;var Jc={Icon:Wn};var Nt=C.cssPrefix;function po({title:e,actions:t}){return a("header",{class:`${Nt}-back-header`,"data-variant":"title",children:[a("span",{class:`${Nt}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${Nt}-back-title`,children:e}),t??a("span",{class:`${Nt}-back-spacer`,"aria-hidden":"true"})]})}function fo({title:e,backLabel:t,onBack:n,actions:r,testid:o}){return a("header",{class:`${Nt}-back-header`,"data-testid":o,children:[a("button",{type:"button",class:`${Nt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(qn,{})}),a("h1",{class:`${Nt}-back-title`,children:e}),r??a("span",{class:`${Nt}-back-spacer`,"aria-hidden":"true"})]})}function Zt(e,t){return e instanceof We&&e.status===429?t.errorRateLimited:t.errorGeneric}var Pn=C.cssPrefix;function Qc({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${Pn}-home-search`,onClick:t,"data-testid":R.homeSearch,children:[a("span",{class:`${Pn}-home-search-text`,children:e}),a("span",{class:`${Pn}-home-search-icon`,"aria-hidden":"true",children:a(va,{})})]})}function Zc({placeholder:e,value:t,onInput:n}){return a("div",{class:`${Pn}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${Pn}-home-search-input`,placeholder:e,value:t,onInput:r=>n(r.currentTarget.value),"data-testid":R.helpSearch}),a("span",{class:`${Pn}-home-search-icon`,"aria-hidden":"true",children:a(va,{})})]})}var Xn=C.cssPrefix;function mo({title:e,subtitle:t,onClick:n,testid:r}){return a("button",{type:"button",class:`${Xn}-list-row`,onClick:n,"data-testid":r,children:[a("span",{class:`${Xn}-list-row-body`,children:[a("span",{class:`${Xn}-list-row-title`,children:e}),t?a("span",{class:`${Xn}-list-row-sub`,children:t}):null]}),a("span",{class:`${Xn}-list-row-chevron`,"aria-hidden":"true",children:a(gn,{})})]})}var ed=C.cssPrefix;function lt({tone:e="info",message:t,onRetry:n,strings:r}){return a("div",{class:`${ed}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${ed}-module-retry`,onClick:n,children:r.errorRetry}):null]})}var en=C.cssPrefix,km=ee.scope("help"),wm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Cm(e){let t=new Map;for(let n of e){let r=n.categories?.[0]??"";(t.get(r)??t.set(r,[]).get(r)).push(n)}return[...t.entries()]}function td(e,t){let n=t.toLowerCase(),r=n.indexOf(e);if(r!==-1)return 100-Math.min(r,99);let o=0;for(let i of e){if(o=n.indexOf(i,o),o===-1)return 0;o+=1}return 1}function Rm(e,t){let n=t.toLowerCase().trim();return n?e.map(r=>({item:r,score:Math.max(td(n,r.title)*2,td(n,r.description??""))})).filter(r=>r.score>0).toSorted((r,o)=>o.score-r.score).map(r=>r.item):[]}function nd({article:e,nav:t}){return a(mo,{title:e.title,subtitle:e.description,onClick:()=>wm(t,e),testid:Ge(R.helpArticle,e.id)})}function Tm({transport:e,strings:t,config:n,nav:r,bus:o,panelProps:i}){let s=n.contentTags,[l,c]=O("loading"),[u,_]=O(t.errorGeneric),[p,d]=O([]),[f,m]=O(""),[v,h]=O(0);E(()=>{let b=!1;return c("loading"),e.listContent({tags:s,sortBy:"order",limit:100}).then(y=>{if(b)return;let k=y.items??[];d(k),c("loaded"),o.emit("contentView",{section:"help",tags:s?.join(","),count:k.length})}).catch(y=>{b||(km.warn("listContent (help) failed",{err:y}),_(Zt(y,t)),c("error"))}),()=>{b=!0}},[e,s,v,o]);let x=Q(()=>Rm(p,f),[p,f]);E(()=>{let b=f.trim();if(!b)return;let y=setTimeout(()=>o.emit("contentSearch",{queryLength:b.length,hitCount:x.length}),600);return()=>clearTimeout(y)},[f,x,o]);function P(){return f.trim().length>0?x.length===0?a(lt,{message:t.helpSearchEmpty,strings:t}):a("div",{class:`${en}-help-card`,children:x.map(b=>a(nd,{article:b,nav:r},b.id))}):l==="loading"?a(lt,{message:t.helpLoading,strings:t}):l==="error"?a(lt,{tone:"error",message:u,onRetry:()=>h(b=>b+1),strings:t}):p.length===0?a(lt,{message:t.helpEmpty,strings:t}):Cm(p).map(([b,y])=>a("section",{class:`${en}-help-group`,children:[b?a("h2",{class:`${en}-help-section-title`,children:b}):null,a("div",{class:`${en}-help-card`,children:y.map(k=>a(nd,{article:k,nav:r},k.id))})]},b))}return a("div",{class:`${en}-module`,children:[a(po,{title:t.helpTitle,actions:a(ft,{panelProps:i,variant:"plain"})}),a("div",{class:`${en}-module-pad`,children:a(Zc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),a("div",{class:`${en}-help-list`,children:P()})]})}var rd={Icon:Vn,Root:e=>a(Tm,{...e})};var od=C.cssPrefix;function Ua({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${od}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${od}-home-card`,"data-testid":n,children:t})}var Ce=C.cssPrefix,ad=ee.scope("home");function Im(e){let t=e.options.userContext?.name,n=e.config.greetingText?Je(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var Em=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Am(e){let{transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s}=e,[l,c]=O(null),[u,_]=O([]),p=r.contentTags?.join(","),d=e.options.modules.list.some(P=>P.layout==="chat");E(()=>{if(r.showRecentConversations===!1)return;let P=!1;return t.listConversations({limit:d?50:1}).then(b=>!P&&c(b.conversations?.[0]??null)).catch(b=>!P&&ad.warn("listConversations (home) failed",{err:b})),()=>{P=!0}},[t,r.showRecentConversations,d]),E(()=>{if(!r.contentTags?.length)return;let P=!1;return t.listContent({tags:r.contentTags,limit:6}).then(b=>{if(P)return;let y=b.items??[];_(y),i.emit("contentView",{section:"home",tags:p,count:y.length})}).catch(b=>!P&&ad.warn("listContent (home) failed",{err:b})),()=>{P=!0}},[t,p,i]);let f=Im(e),m=r.userAvatars??[],v=r.status,h=v?.text?Je(n,v.text):n.homeStatus,x=r.contentBlockTitle?Je(n,r.contentBlockTitle):n.homeContentTitle;return a("div",{class:`${Ce}-module ${Ce}-home`,"data-testid":R.homeView,children:a("div",{class:`${Ce}-home-scroll`,children:[a("div",{class:`${Ce}-home-hero`,children:[a("div",{class:`${Ce}-home-hero-top`,children:[r.brandName?a("span",{class:`${Ce}-home-brand`,"data-testid":R.homeBrand,children:r.brandName}):a("span",{class:`${Ce}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${Ce}-home-hero-actions`,children:[m.length>0?a("div",{class:`${Ce}-home-avatars`,children:m.map(P=>a("span",{class:`${Ce}-home-avatar`,title:P.role?`${P.name} \xB7 ${P.role}`:P.name,children:P.avatar?a("img",{src:P.avatar,alt:"",loading:"lazy"}):a("span",{children:Jr(P.name)})},P.name))}):null,a(ft,{panelProps:s,variant:"plain"})]})]}),r.showGreeting!==!1?a(de,{children:[a("h1",{class:`${Ce}-home-greeting`,"data-testid":R.homeGreeting,children:f.title}),f.subtitle?a("p",{class:`${Ce}-home-lead`,children:f.subtitle}):null]}):null]}),a("div",{class:`${Ce}-home-cards`,children:[r.showSearchBar!==!1?a(Qc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,l?a(Ua,{onClick:()=>o.selectConversation(l.conversationId),testid:R.homeRecent,children:a("div",{class:`${Ce}-home-recent-row`,"data-unread":l.hasUnread?"true":void 0,children:[a("span",{class:`${Ce}-home-recent-avatar`,"aria-hidden":"true",children:a(Wn,{})}),a("span",{class:`${Ce}-home-recent-body`,children:[a("span",{class:`${Ce}-home-recent-title`,children:l.title}),l.preview?a("span",{class:`${Ce}-home-recent-preview`,children:l.preview}):null]}),l.hasUnread?a("span",{class:`${Ce}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,v?a(Ua,{onClick:v.url?()=>o.push({kind:"iframe",url:v.url,title:h}):void 0,children:a("div",{class:`${Ce}-home-status`,"data-level":v.level??"operational",children:[a("span",{class:`${Ce}-home-status-icon`,"aria-hidden":"true",children:a(Tl,{})}),a("span",{class:`${Ce}-home-status-text`,children:h})]})}):null,u.length>0?a("section",{class:`${Ce}-home-content`,children:[a("div",{class:`${Ce}-home-content-title`,children:x}),a("div",{class:`${Ce}-home-content-list`,children:u.map(P=>a(mo,{title:P.title,subtitle:P.description,onClick:()=>Em(o,P),testid:Ge(R.homeContentRow,P.id)},P.id))})]}):null]})]})})}var id={Icon:Il,Root:e=>a(Am,{...e})};var Dt=C.cssPrefix,Mm=ee.scope("news");function Lm({transport:e,strings:t,config:n,nav:r,bus:o,panelProps:i}){let s=n.contentTags,[l,c]=O("loading"),[u,_]=O(t.errorGeneric),[p,d]=O([]),[f,m]=O(0);E(()=>{let h=!1;return c("loading"),e.listContent({tags:s,sortBy:"publishedAt",sortOrder:"desc"}).then(x=>{if(h)return;let P=x.items??[];d(P),c("loaded"),o.emit("contentView",{section:"news",tags:s?.join(","),count:P.length})}).catch(x=>{h||(Mm.warn("listContent (news) failed",{err:x}),_(Zt(x,t)),c("error"))}),()=>{h=!0}},[e,s,f,o]);function v(){return l==="loading"?a(lt,{message:t.newsLoading,strings:t}):l==="error"?a(lt,{tone:"error",message:u,onRetry:()=>m(h=>h+1),strings:t}):p.length===0?a(lt,{message:t.newsEmpty,strings:t}):a("div",{class:`${Dt}-news-list`,children:p.map(h=>a("button",{type:"button",class:`${Dt}-news-card`,onClick:()=>r.push({kind:"content",id:h.id,title:h.title}),"data-testid":Ge(R.newsItem,h.id),children:[h.image?a("img",{class:`${Dt}-news-hero`,src:h.image,alt:"",loading:"lazy"}):null,a("span",{class:`${Dt}-news-body`,children:[a("span",{class:`${Dt}-news-title`,children:h.title}),h.description?a("span",{class:`${Dt}-news-summary`,children:h.description}):null]})]},h.id))})}return a("div",{class:`${Dt}-module`,children:[a(po,{title:t.newsTitle,actions:a(ft,{panelProps:i,variant:"plain"})}),a("div",{class:`${Dt}-module-scroll`,children:v()})]})}var sd={Icon:El,Root:e=>a(Lm,{...e})};var go={chat:Jc,home:id,help:rd,news:sd};var Yn=C.cssPrefix;function ld({modules:e,activeTab:t,strings:n,hasUnread:r,onSelect:o}){return a("nav",{class:`${Yn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let s=go[i.layout].Icon,l=i.id===t,c=i.layout==="chat"&&r;return a("button",{type:"button",role:"tab","aria-selected":l,class:`${Yn}-tab`,onClick:()=>o(i.id),"data-testid":Ge(R.tab,i.id),children:[a("span",{class:`${Yn}-tab-icon`,"aria-hidden":"true",children:[a(s,{}),c?a("span",{class:`${Yn}-tab-badge`,"data-testid":R.tabBadge,"aria-label":"Unread"}):null]}),a("span",{class:`${Yn}-tab-label`,children:Je(n,i.label)})]},i.id)})})}var cd=C.cssPrefix,Om="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function dd({url:e,title:t,strings:n,onBack:r,actions:o}){return a("div",{class:`${cd}-module`,children:[a(fo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:r,actions:o}),a("iframe",{class:`${cd}-content-frame`,src:e,title:t||"content",sandbox:Om,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Jn=C.cssPrefix,Nm=ee.scope("content"),Dm=5e3;function ud({id:e,title:t,transport:n,strings:r,bus:o,onBack:i,actions:s}){let[l,c]=O(null),[u,_]=O(!1),[p,d]=O(0),f=L(()=>{_(!1),c(null),d(h=>h+1)},[]);E(()=>{let h=!1;return n.listContent({ids:[e],limit:1}).then(x=>{if(h)return;let P=x.items[0];P?(c(P),o.emit("contentOpen",{contentId:e,tags:P.tags?.length?P.tags.join(","):void 0})):_(!0)}).catch(x=>{h||(Nm.warn("listContent (reader) failed",{err:x}),_(!0))}),()=>{h=!0}},[n,e,p,o]),E(()=>{if(!l)return;let h=setTimeout(()=>o.emit("contentRead",{contentId:e}),Dm);return()=>clearTimeout(h)},[l,e,o]);let m=L(h=>{let P=h.target?.closest?.("a")?.getAttribute("href")??"";P&&!P.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function v(){return u?a(lt,{tone:"error",message:r.errorGeneric,onRetry:f,strings:r}):l===null?a(lt,{message:r.contentLoading,strings:r}):a("article",{class:`${Jn}-content`,"data-testid":R.contentView,onClick:m,children:[l.image?a("img",{class:`${Jn}-content-hero`,src:l.image,alt:"",loading:"lazy"}):null,l.description?a("p",{class:`${Jn}-content-subtitle`,children:l.description}):null,a(wc,{text:l.content??""})]})}return a("div",{class:`${Jn}-module`,children:[a(fo,{title:l?.title||t||r.moduleBack,backLabel:r.moduleBack,onBack:i,actions:s,testid:R.backHeader}),a("div",{class:`${Jn}-module-scroll`,"data-testid":R.contentScroll,children:v()})]})}var vo=C.cssPrefix;function _d({panelProps:e,enabledModules:t,nav:n,bus:r,hasUnread:o,onSelectConversation:i,onStartNewConversation:s,onSetPanelSize:l}){let c=e.options,u=c.strings,_=M(null),p=M(new Set);E(()=>{let N=_.current;if(!N)return;let Z=Yr(N),le=oe=>{oe.key==="Escape"&&e.onClose?.()};return N.addEventListener("keydown",le),()=>{Z(),N.removeEventListener("keydown",le)}},[e.onClose]);let d=wt(()=>n.sig.value).value,f=Xc(d),m=c.modules.byId[d.activeTab],v=e.composerActive&&m?.layout==="chat"&&f===void 0,h=e.composerApiRef,x=v&&e.view==="chat"&&e.canSend&&!e.activeForm&&!e.sendPreparing&&e.options.features.fileUpload,P=L(N=>{x&&h.current?.attachFromDrop(N)},[h,x]),{visible:b}=eo({containerRef:_,onDrop:P,disabled:!x});jr(_.current,c.mode==="modal");let y=f?.kind==="iframe"||f?.kind==="content",k=t.length>1&&(Yc(d)||!y),w=M(null);E(()=>{if(y&&w.current===null)w.current=e.panelSize,e.panelSize==="normal"&&l("expanded");else if(!y&&w.current!==null){let N=w.current;w.current=null,l(N)}},[y]);let B={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:N=>{let Z=t.find(le=>le.layout===N);Z&&n.switchTab(Z.id)},selectConversation:i,startNewConversation:s},z=N=>({options:c,transport:e.transport,strings:u,config:N,visitorId:e.visitorId,nav:B,bus:r,panelProps:e}),q=a(ft,{panelProps:e,variant:"plain"});m&&p.current.add(m.id);let I=t.filter(N=>p.current.has(N.id)),U=N=>{if(N.layout==="chat")return a(Fa,{...e,composerActive:v,containerEl:_.current,dragOver:b,composerAttachApiRef:h});let Z=go[N.layout].Root;return Z?a(Z,{...z(N)}):null},V=()=>f?.kind==="iframe"?a(dd,{url:f.url,title:f.title,strings:u,onBack:n.pop,actions:q}):f?.kind==="content"?a(ud,{id:f.id,title:f.title,transport:e.transport,strings:u,bus:r,onBack:n.pop,actions:q}):null;return a("div",{ref:_,class:`${vo}-panel ${vo}-messenger`,role:"dialog","aria-modal":"false","aria-label":u.panelTitle,style:{position:"relative"},"data-testid":R.messengerHome,children:[a("div",{class:`${vo}-messenger-body`,children:[I.map(N=>a("div",{class:`${vo}-messenger-pane`,hidden:y||N.id!==m?.id,children:U(N)},N.id)),V()]}),k?a(ld,{modules:t,activeTab:d.activeTab,strings:u,hasUnread:o,onSelect:n.switchTab}):null,a(Ba,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(m?.layout==="chat"&&!f)?a(Kr,{panelEl:_.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:u}):null]})}var Qn=C.cssPrefix;function pd({strings:e,onClose:t}){return a("div",{class:`${Qn}-panel ${Qn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":R.modulesEmpty,children:[t?a("button",{type:"button",class:`${Qn}-icon-btn ${Qn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:a(pt,{})}):null,a("p",{class:`${Qn}-modules-empty-text`,children:e.modulesEmpty})]})}function xn(e,t,n,r){let o={role:n,text:r};e.emit("message",o),t.onMessage?.(o)}var za=ee.scope("hitl");function fd(e){let{streaming:t,controlModeSig:n,messagesSig:r,sendAiTurn:o,bus:i,humanInLoop:s}=e,l=M(t);l.current=t;let c=L((d,f,m)=>{if(l.current||n.value!=="ai-agent")return!1;let v=r.value.at(-1),h=v?.partsSig.value.findIndex(P=>P.kind==="tool"&&P.toolCallId===d)??-1,x=v?.partsSig.value[h];return!v||x?.kind!=="tool"?(za.warn("decideTool: tool part not found",{toolCallId:d}),!1):v.status!=="complete"||!$r(v,h)||!f(x)?!1:(m(x),v.partsSig.value=[...v.partsSig.value],Kt(v)&&(v.status="streaming",v.retryAction={kind:"continue-assistant",messageId:v.serverMessageId??v.id},v.awaitingContinuation=!0,r.value=[...r.value],o({continueExisting:!0})),!0)},[n,r,o]),u=L((d,f,m)=>{let v=!1;if(c(d,x=>x.stateSig.value==="approval-requested",x=>{v=ro(x.toolName);let P=x.approvalSig.value?.id??d;x.approvalSig.value={id:P,approved:f,reason:m},x.stateSig.value="approval-responded"})){if(v){za.info("toolResult",{toolCallId:d}),i.emit("toolResult",{toolCallId:d});return}za.info("toolDecision",{toolCallId:d,approved:f}),i.emit("toolDecision",{toolCallId:d,approved:f})}},[i,c]),_=L(d=>{c(d,f=>f.stateSig.value==="approval-responded"&&f.approvalSig.value?.approved!==void 0,f=>{let m=f.approvalSig.value?.id??d;f.approvalSig.value={id:m},f.stateSig.value="approval-requested"})},[c]);return{toolInteraction:Q(()=>({humanInLoop:s,onDecision:u,onEdit:_}),[s,u,_])}}function md({callout:e,persistence:t}){let n=e?.text??"",r=e?.persistent??!0,[o,i]=O(()=>r?!1:t.loadCalloutDismissed(n));E(()=>{i(r?!1:t.loadCalloutDismissed(n))},[n,r,t]);let s=L(()=>{i(!0),r||t.saveCalloutDismissed(n)},[t,n,r]);return{dismissed:o,dismissCallout:s}}function gd(e){let{transport:t,conversationIdSig:n}=e,r=dt("ai-agent"),o=dt(void 0),i=dt(void 0),s=M(),l=L(p=>{let d=p.controlRevision??0,f=s.current;f&&f.conversationId===n.value&&d<f.revision||(s.current={conversationId:n.value,revision:d},r.value=p.controlMode,o.value=p.assignedOperatorInitials,p.controlMode!=="awaiting_operator"?i.value=void 0:p.operatorAvailable!==void 0&&(i.value=p.operatorAvailable))},[n,r,o,i]),c=L(p=>{p.type==="data-control-state"&&l(Et(p.data))},[l]),u=L(async()=>{let p=n.value,d=await t.requestOperator();d&&n.value===p&&l(Et(d))},[t,n,l]),_=L(async()=>{let p=n.value,d=await t.cancelOperatorRequest();d&&n.value===p&&l(Et(d))},[t,n,l]);return{controlModeSig:r,assignedOperatorInitialsSig:o,operatorAvailableSig:i,applyControlState:l,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:_}}function vd(e){let{hostElement:t,mode:n,panelSize:r,isOpen:o,setIsOpen:i}=e;_t(()=>{yr(t,Er(n,r,o))},[t,o,r,n]),E(()=>{if(n!=="modal"||!o)return;let s=l=>{l.composedPath().some(u=>u instanceof HTMLElement&&u.classList.contains(`${C.cssPrefix}-panel`))||i(!1)};return t.addEventListener("click",s),()=>t.removeEventListener("click",s)},[t,o,n,i]),E(()=>{if(n!=="drawer"||!o)return;let s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[o,n,i])}var qa=ee.scope("reducer"),ho=class{constructor(t,n){ne(this,"messagesSig",t);ne(this,"onReconcileNeeded",n);ne(this,"active",null);ne(this,"openTextParts",new Map);ne(this,"partSeq",0);ne(this,"replay",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,n){let r=Ct();r.id=t.id;let o=tn(t)||jt(t)&&(t.status!=="streaming"||Kt(t)),i=t.status==="streaming"&&Kt(t)&&Hn(t);this.replay={baseline:t,shadow:r,chunks:[n],probeContinuation:o,continuationTailReplay:i,liveCatchUp:t.status==="streaming"&&!o},this.attach(r),this.apply(n)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let n=t.shadow.serverMessageId??t.baseline.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t.baseline||o?.id===t.baseline.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t.baseline)??r.find(l=>l.id===t.baseline.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t.baseline)return t;let s=t.baseline;return t.baseline=i,hd(s,i),t.liveCatchUp&&tn(t.shadow)&&(i.status==="streaming"||jt(i))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=tn(i)||jt(i)&&(i.status!=="streaming"||Kt(i)),t.continuationTailReplay=i.status==="streaming"&&Kt(i)&&Hn(i),t.liveCatchUp=i.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let n=t.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t||o?.id===t.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t)??r.find(l=>l.id===t.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t)return t;hd(t,i);let s=tn(t)&&jt(i);return i.status!=="streaming"&&!s?(this.detach(),null):(this.replay={baseline:i,shadow:t,chunks:[],probeContinuation:!1,continuationTailReplay:!1,liveCatchUp:!0},t)}promoteReplay(){let{baseline:t,shadow:n}=this.replay;return it(()=>{t.role=n.role,t.serverMessageId=n.serverMessageId,t.operatorInitials=n.operatorInitials,t.status=n.status,n.canceled&&(t.canceled=!0),t.finishReason=n.finishReason,t.errorText=n.errorText,t.suggestions=n.suggestions??t.suggestions,t.partsSig.value=n.partsSig.value,this.messagesSig.value=[...this.messagesSig.value]}),this.replay=null,this.active=t,t}promoteContinuation(t=!1){let{baseline:n,chunks:r}=this.replay,o=Fr(n);return this.replay=null,it(()=>{if(t){let i=n.partsSig.value.findLastIndex(s=>s.kind==="tool");n.partsSig.value=n.partsSig.value.slice(0,i+1)}n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n);for(let i of r)this.apply(i);n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}settleOwnedContinuation(t){let{baseline:n}=this.replay,r=Fr(n);return this.replay=null,it(()=>{n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n),this.apply(t),n.continuationStreaming=r||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}applyResume(t){if(t.type==="start"){let o=(this.replay?.baseline??this.active)?.serverMessageId;o!==void 0&&t.messageId!==void 0&&o!==t.messageId&&this.onReconcileNeeded?.({messageId:o}),this.detach();let i=t.messageId,s=i!==void 0?this.messagesSig.value.find(_=>_.serverMessageId===i||_.id===i):void 0;if(s!==void 0)return t.messageMetadata?.senderRole==="visitor"&&s.role==="user"&&(s.status==="pending"||s.status==="error")&&(s.serverMessageId=i,s.status="complete",s.errorText=void 0,s.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(s,t),null;let l=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(l===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!Mt(c))return this.attach(c),this.apply(t),null;let u=Ct();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let r=this.refreshReplayBaseline();if(!r)return null;r.chunks.push(t),t.type==="data-control-state"&&(r.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:i,probeContinuation:s,continuationTailReplay:l,liveCatchUp:c}=r,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(s){if(!Bm(o,i,t))return u&&(qm(o,i)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id})),this.detach()),null;let p=tn(o)&&u?this.settleOwnedContinuation(t):this.promoteContinuation();return u?(p.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:p.serverMessageId??p.id}):p.continuationStreaming=!1),this.detach(),p):null}if(l&&Fm(o,i)){let p=this.promoteContinuation(!0);return u?(this.detach(),p):null}if(!c)return u&&this.detach(),null;if(u&&!Mt(o)&&Mt(i)){let p=this.promoteReplay();return this.detach(),p}if(!$m(o,i))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}),this.detach()),null;let _=this.promoteReplay();return u?(this.detach(),_):null}let n=this.refreshActive();if(!n)return null;if(this.replay)return this.applyResume(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let r=n;return r.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:r.serverMessageId??r.id}):r.continuationStreaming=!1),this.detach(),r}return null}ensureTextPart(t,n,r){let o=`${n}:${r}`,i=this.openTextParts.get(o);if(i)return i;let s={kind:n,id:`${r}#${this.partSeq++}`,textSig:Y(""),doneSig:Y(!1)};return this.openTextParts.set(o,s),Zn(t,s),s}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let r=t.messageMetadata;r?.senderRole==="operator"?(n.role="operator",r.operatorInitials&&(n.operatorInitials=r.operatorInitials)):r?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":Zn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":qa.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",n.retryAction=void 0,t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":qa.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"abort":qa.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,n.retryAction=void 0,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let r=this.ensureTextPart(n,"text",t.id);r.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let r=this.ensureTextPart(n,"reasoning",t.id);r.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-input-error":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":Vm(n,t);return;case"file":Zn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":bd(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":bd(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":n.suggestions=Lr(t.data);return;case"data-control-state":n.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;default:{let r=t}}}bumpDone(t){it(()=>{t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])})}},Va={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function tn(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function hd(e,t){e.canceled&&(t.canceled=!0),!(!tn(e)||t.status!=="streaming"&&!jt(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function $m(e,t){let n=e.partsSig.value,r=t.partsSig.value;return e.role!==t.role||r.length<n.length?!1:n.every((o,i)=>yd(o,r[i]))}function Fm(e,t){let n=e.partsSig.value,r=n.findLastIndex(l=>l.kind==="tool"),o=new Set(n.slice(0,r+1).flatMap(l=>l.kind==="tool"?[l.toolCallId]:[])),i=t.partsSig.value.filter(l=>l.kind!=="tool"||!o.has(l.toolCallId)),s=n.slice(r+1);return i.length<s.length?!1:s.every((l,c)=>yd(l,i[c]))}function yd(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||!Br(t.toolName,e.toolName)||Va[t.stateSig.value]<Va[e.stateSig.value])return!1;let n=e.approvalSig.value?.approved;return n===void 0||t.approvalSig.value?.approved===n}case"file":return t?.kind==="file"&&t.url===e.url&&t.mediaType===e.mediaType;case"source":return t?.kind==="source"&&t.sourceId===e.sourceId&&t.url===e.url&&t.title===e.title&&t.filename===e.filename&&t.mediaType===e.mediaType;default:return e}}function Bm(e,t,n){return Hm(e,n)||!Um(e,t)?!0:n.type!=="finish"&&n.type!=="error"&&n.type!=="abort"?!1:Hn(t)||e.awaitingContinuation===!0&&n.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(r=>r.kind==="step-start")}function Hm(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId);return n!==void 0&&Va[n.stateSig.value]<4}function Um(e,t){let n=t.partsSig.value;if(n.length===0)return!0;let r=e.partsSig.value;return r.some((o,i)=>n.every((s,l)=>zm(r[i+l],s)))}function zm(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"||Br(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 qm(e,t){if(tn(e)||!jt(e))return!1;let n=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&n.has(o.toolCallId))}function $t(e,t,n,r){let o=e.partsSig.value.find(s=>s.kind==="tool"&&s.toolCallId===t);if(o)return r&&(o.dynamic=!0),o;let i={kind:"tool",toolCallId:t,toolName:n??"tool",dynamic:r?!0:void 0,inputPartialSig:Y(""),inputSig:Y(void 0),outputSig:Y(void 0),errorSig:Y(void 0),stateSig:Y("input-streaming"),approvalSig:Y(void 0)};return Zn(e,i),i}function Zn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function bd(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||Zn(e,t)}function Vm(e,t){switch(t.type){case"tool-input-start":$t(e,t.toolCallId,t.toolName,t.dynamic);return;case"tool-input-delta":{let n=$t(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=$t(e,t.toolCallId,t.toolName,t.dynamic);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-input-error":{let n=$t(e,t.toolCallId,t.toolName,t.dynamic);n.inputSig.value=t.input,n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-approval-request":{let n=$t(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=$t(e,t.toolCallId,void 0,t.dynamic);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=$t(e,t.toolCallId,void 0,t.dynamic);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=$t(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function Pd(e){let t=1e3,n=!1,r=!1,o=!1,i=()=>{o||e.signal.aborted||(o=!0,e.onInitialBoundaryReady())};for(;!e.signal.aborted;){let s,l="held";try{l=await e.connect(()=>{if(e.signal.aborted)return;s=e.now();let c=n||r;n=!0,r=!1,o?c&&e.backfill():i()})}catch{}if(e.signal.aborted||(!n&&s===void 0&&(r=!0,i()),l==="unavailable"))return;s!==void 0&&e.now()-s>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var xd=ee.scope("resume-stream");function Sd(e){let{activated:t,conversationReady:n,conversationIdSig:r,messagesSig:o,optionsRef:i,isChatActiveRef:s,transport:l,visitorId:c,adoptControlStateChunk:u,settleSuggestions:_,markActiveConversationRead:p,onReplyLanded:d,runCancellation:f,setCanSend:m,feedback:v,bus:h,homeNav:x,loadInitialThread:P,shouldReconcileOnConnect:b}=e;E(()=>{if(!t||!n||!r.value)return;let y=r.value,k=new AbortController,w=F=>{},B=new ho(o,F=>w(F));l.primeIdentity(c,y),xd.debug("resume stream opened",{conversationId:y});let z=!1,q=!1,I,U,V=0,N=(F,ve)=>{(F||!f.localSendRef.current)&&f.settle(ve),F&&(p(),d())},Z=(F,ve=[],ie=!1,Re)=>{let Oe=i.current;if(F.canceled){N(ie,Re);return}let Se=F.status==="error";switch(tl(F,Se)){case"drop":o.value=o.value.filter(xe=>xe!==F);break;case"complete-operator-routed":F.status="complete",ie&&(v.play("messageReceived"),xn(h,Oe,"assistant",He(F)));break;case"error":{if(F.status="error",F.errorText=Oe.strings.errorGeneric,ie){v.play("error");let xe=new Error(Se?"stream error chunk":"empty reply");h.emit("error",xe),Oe.onError?.(xe)}break}case"complete":F.status="complete",ie&&(v.play("messageReceived"),xn(h,Oe,"assistant",He(F))),_(F,ve);break}N(ie,Re)},le=F=>{if(k.signal.aborted||r.value!==y)return;if(u(F),F.type==="start"){let xe=U?.senderRole==="visitor"?U.messageId:void 0;if(U={messageId:F.messageId,senderRole:F.messageMetadata?.senderRole},V+=1,z=F.messageMetadata?.senderRole===void 0,q=!1,I=z?F.messageMetadata?.runId:void 0,z){let Ue=F.messageId!==void 0&&o.value.some(ze=>ze.serverMessageId===F.messageId||ze.id===F.messageId),Pe=o.value.at(-1),ke=F.messageId!==void 0&&(Pe?.serverMessageId===F.messageId||Pe?.id===F.messageId),Ie=f.localSendRef.current&&(!Ue||ke)&&Pe?.role==="assistant"&&Pe.status==="streaming"&&(ke||Pe.serverMessageId===void 0&&Pe.partsSig.value.length===0);q=f.captureStart(y,F,Ie,xe)}}let ve=z&&(F.type==="finish"||F.type==="error"||F.type==="abort"),ie=ve?I:void 0,Re=ve&&(q||f.ownsLocalRun(ie));ve&&(z=!1,q=!1,I=void 0);let Oe=o.value.length,Se=B.applyResume(F);if(F.type==="finish"&&F.canContinue===!1&&m(!1),o.value.length>Oe){let xe=i.current.modules.list.find(Ue=>Ue.layout==="chat")?.id;xe&&x?.switchTab(xe)}if(!Se){ve&&(Re||!f.localSendRef.current)&&f.settle(ie);return}if(Se.role==="operator"){v.play("messageReceived"),xn(h,i.current,"operator",He(Se)),!document.hidden&&s.current()&&l.markRead(y).catch(()=>{}),ve&&(Re||!f.localSendRef.current)&&f.settle(ie);return}Se.role==="assistant"&&Z(Se,[],Re,ie)},oe=async F=>{let ve=V,ie=await l.loadConversation(y,F?{ids:[F]}:void 0).catch(()=>null);if(k.signal.aborted||r.value!==y||!ie)return!1;ie.controlState&&u({type:"data-control-state",data:ie.controlState});let Re=o.value.at(-1),Oe=ve===V&&(F===void 0||Re!==void 0&&(Re.serverMessageId===F||Re.id===F));if(!ie.messages?.length)return!1;Oe&&m(ie.canContinue??!0);let Se=o.value,xe=F===void 0?Se.at(-1):Se.find(ze=>ze.serverMessageId===F||ze.id===F),{messages:Ue,changed:Pe}=Un(Se,At(ie.messages));if(!Pe)return!1;o.value=Ue;let ke=F===void 0?Ue.at(-1):Ue.find(ze=>ze.serverMessageId===F||ze.id===F),Ie=xe?.role==="assistant"&&xe.status==="streaming"&&ke?.role==="assistant"&&ke.status!=="streaming"&&ke.id===xe.id;return Oe&&Ie?Z(ke,ie.suggestions??[],f.localSendRef.current):Oe&&ke?.role==="assistant"&&ke.status!=="streaming"&&_(ke,ie.suggestions??[]),!0},Le=new Set;w=({messageId:F})=>{if(Le.has(F)||!o.value.some(ie=>ie.serverMessageId===F||ie.id===F))return;Le.add(F);let ve=()=>Le.delete(F);oe(F).then(ve,ve)};let pe,_e=!1,ye=(F=!1)=>{if(k.signal.aborted||r.value!==y){_e=!1;return}if(pe){_e=!0;return}let ve=F?P(y)??(b()?oe():void 0):oe();if(!ve)return;pe=ve;let ie=()=>{pe===ve&&(pe=void 0,_e&&(_e=!1,ye()))};ve.then(ie,ie)};return Pd({signal:k.signal,now:()=>performance.now(),sleep:F=>Bn(F,k.signal),connect:F=>l.connectResumeStream({signal:k.signal,onChunk:le,onConnected:F}),onInitialBoundaryReady:()=>ye(!0),backfill:()=>ye()}),()=>{k.abort(),B.detach(),xd.debug("resume stream closed",{conversationId:y})}},[t,n,r,r.value,c,l,u,_,p,d,f,m,o,h,v,x,P,b])}var Wm=32;function kd(e){let{transport:t,setStreaming:n}=e,r=M(),o=M(),i=M(!1),s=M(),l=M(!1),c=M(new Map),u=M(new Set),_=L((k,w)=>{let B=`${k}:${w}`;s.current!==B&&(s.current=B,t.cancelTurn(k,w))},[t]),p=L(k=>{r.current=void 0,o.current=k,i.current=!1,s.current=void 0,l.current=!0,n(!0)},[n]),d=L((k,w)=>{c.current.set(k,{messageId:w})},[]),f=L(k=>{k!==void 0&&(u.current.add(k),u.current.size>Wm&&u.current.delete(u.current.values().next().value)),!(k!==void 0&&r.current?.runId!==k)&&(r.current=void 0,o.current=void 0,i.current=!1,l.current=!1,n(!1))},[n]),m=L((k,w)=>o.current!==k?w.runId&&r.current?.runId===w.runId?(r.current={conversationId:w.conversationId,runId:w.runId},i.current&&_(w.conversationId,w.runId),!0):!1:(o.current=void 0,w.runId?(r.current={conversationId:w.conversationId,runId:w.runId},n(!0),i.current&&_(w.conversationId,w.runId),!0):(f(),!0)),[_,n,f]),v=L((k,w)=>{let B=c.current.get(k);return B?(c.current.delete(k),!w.runId||u.current.has(w.runId)?!0:B.runId!==void 0?(B.runId!==w.runId||r.current?.runId===w.runId&&(r.current={conversationId:w.conversationId,runId:w.runId},i.current&&_(w.conversationId,w.runId)),!0):(l.current||o.current||(r.current={conversationId:w.conversationId,runId:w.runId},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0)),!0)):!1},[_,n]),h=L(k=>o.current!==k?!1:(f(),!0),[f]),x=L(k=>{let w=c.current.get(k);return w?(c.current.delete(k),w.runId===void 0):!1},[]),P=L((k,w,B,z)=>{let q=w.messageMetadata?.runId;if(w.messageMetadata?.senderRole!==void 0||typeof q!="string"||!q||u.current.has(q))return!1;if(r.current?.runId===q)return l.current;if(l.current)return r.current||!B?!1:(o.current=void 0,r.current={conversationId:k,runId:q},n(!0),i.current&&_(k,q),!0);let U=[...c.current.values()].filter(V=>V.runId===void 0).find(V=>V.messageId===z);return U?(U.runId=q,r.current={conversationId:k,runId:q},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0),!0):(o.current=void 0,r.current={conversationId:k,runId:q},n(!0),i.current&&_(k,q),l.current)},[_,n]),b=L(k=>typeof k=="string"&&r.current?.runId===k&&l.current,[]),y=L(()=>{let k=r.current;if(k)return i.current=!0,_(k.conversationId,k.runId),!0;let w=o.current;return w?(i.current=!0,w.then(B=>{B.runId&&_(B.conversationId,B.runId)}).catch(()=>{}),!0):!1},[_]);return Q(()=>({localSendRef:l,begin:p,beginRouted:d,acceptAck:m,acceptRoutedAck:v,reject:h,rejectRouted:x,captureStart:P,ownsLocalRun:b,settle:f,stop:y}),[m,v,p,d,P,b,h,x,f,y])}var Gm=ee.scope("send");function wd(e){return!(e instanceof We)||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 Cd(e){let{transport:t,messagesSig:n,conversationIdSig:r,options:o,bus:i,feedback:s,persistence:l,visitorId:c,adoptConversationId:u,applyControlState:_,setCanSend:p,settleSuggestions:d,runCancellation:f}=e,m=L(()=>{let x=r.value??ot();return r.value||(r.value=x,l.saveConversationId(x)),x},[r,l]),v=L(async({continueExisting:x,turn:P})=>{let b=m(),y=n.value.at(-1),k=P?[P]:Ks(n.value,x),w=ia({messages:k.map(_a),conversationId:b,visitorId:c,userPrefs:l.loadUserPrefs()}),B=t.sendTurn(w);f.begin(B);try{let z=await B;if(r.value!==b||!f.acceptAck(B,z))return;if(u(z.conversationId),!z.runId){let q=await t.loadConversation(z.conversationId).catch(()=>null);if(r.value!==z.conversationId)return;if(q){q.controlState&&_(q.controlState),p(q.canContinue??!0);let{messages:I,changed:U}=Un(n.value,At(q.messages??[]));U&&(n.value=I);let V=y?n.value.find(N=>N.id===y.id&&N.role==="assistant"&&N.status!=="streaming"):void 0;V&&d(V,q.suggestions??[]),!x&&y?.role==="assistant"&&n.value.includes(y)&&y.serverMessageId===void 0&&!Mt(y)&&(n.value=n.value.filter(N=>N!==y))}else if(y?.role==="assistant"&&n.value.includes(y)){y.status="error",y.errorText=o.strings.errorGeneric;let I=k[0];x?y.retryAction={kind:"continue-assistant",messageId:y.serverMessageId??y.id}:y.retryAction=I?.role==="user"?{kind:"resend-user",messageId:I.id}:null,n.value=[...n.value]}}}catch(z){if(r.value!==b||!f.reject(B))return;let q=Zt(z,o.strings),I=wd(z),U=P?.role==="assistant"?P:n.value.at(-1);if(x&&U?.role==="assistant"&&z instanceof We&&z.status===409){let V=U.serverMessageId??U.id,N=await t.loadConversation(b,{ids:[V]}).catch(()=>null);if(r.value!==b)return;if(N){N.controlState&&_(N.controlState),p(N.canContinue??!0);let Z=At(N.messages??[]),le=Z.find(oe=>(oe.serverMessageId??oe.id)===V);if(le&&Zs(U,le)){let{messages:oe,changed:Le}=Un(n.value,Z),pe=oe.find(_e=>(_e.serverMessageId??_e.id)===V);if(Le&&pe&&pe!==U){pe.awaitingContinuation=!1,pe.continuationStreaming=void 0,pe.retryAction=null,n.value=oe,pe.status!=="streaming"&&d(pe,N.suggestions??[]);return}}}if(!n.value.includes(U)||U.status!=="streaming")return;U.continuationStreaming=!0}if(x&&U?.role==="assistant")U.status="error",U.errorText=q,U.retryAction=I?{kind:"continue-assistant",messageId:U.serverMessageId??U.id}:null,n.value=[...n.value];else if(y?.role==="assistant"&&n.value.includes(y)){y.status="error",y.errorText=q;let V=k[0];y.retryAction=I&&V?.role==="user"?{kind:"resend-user",messageId:V.id}:null,n.value=[...n.value]}else{let V=Ct();V.status="error",V.errorText=q;let N=k[0];V.retryAction=I&&N?.role==="user"?{kind:"resend-user",messageId:N.id}:null,n.value=[...n.value,V]}s.play("error"),i.emit("error",z),o.onError?.(z)}},[t,n,o,i,s,l,c,u,_,p,d,m,f]),h=L(async x=>{let P=m();x.status="pending",x.errorText=void 0,x.retryAction=void 0,n.value.includes(x)&&(n.value=[...n.value]);let b=ia({messages:[_a(x)],conversationId:P,visitorId:c,userPrefs:l.loadUserPrefs()}),y=t.sendTurn(b);f.beginRouted(y,x.id);try{let k=await y;if(r.value!==P){f.rejectRouted(y);return}if(!f.acceptRoutedAck(y,k))return;u(k.conversationId),x.status==="pending"&&(x.status="complete",n.value.includes(x)&&(n.value=[...n.value]))}catch(k){let w=f.rejectRouted(y);if(r.value!==P)return;if(!w){x.status==="pending"&&(x.status="complete",n.value.includes(x)&&(n.value=[...n.value]));return}if(x.status!=="pending")return;Gm.debug("operator-routed send failed",{error:k});let B=k instanceof Error?k:new Error(String(k));x.status="error",x.errorText=Zt(k,o.strings),x.retryAction=wd(k)?{kind:"resend-user",messageId:x.id}:null,n.value.includes(x)&&(n.value=[...n.value]),s.play("error"),i.emit("error",B),o.onError?.(B)}},[t,n,o,i,s,l,c,u,m,f]);return{sendAiTurn:v,sendRoutedTurn:h}}var Km=ee.scope("unread"),jm=300;function Rd(e){let{transport:t,options:n,conversationIdSig:r,isChatActiveRef:o,activated:i,conversationReady:s}=e,l=dt(!1),c=M(new Set),u=M();E(()=>()=>clearTimeout(u.current),[]);let _=L(()=>{let v=o.current()?r.value:void 0;l.value=[...c.current].some(h=>h!==v)},[l,r,o]),p=L(()=>{n.modules.list.some(v=>v.layout==="chat")&&t.listConversations({limit:50}).then(v=>{c.current=new Set(v.conversations.filter(h=>h.hasUnread).map(h=>h.conversationId)),_()}).catch(v=>Km.debug("refreshUnread failed (non-fatal)",{err:v}))},[t,n.modules,_]),d=L(v=>{c.current.delete(v),_()},[_]),f=L(()=>{if(!o.current())return;let v=r.value;v&&(clearTimeout(u.current),u.current=setTimeout(()=>{d(v),t.markRead(v)},jm))},[t,r,d,o]),m=M(!1);return E(()=>{!i||!s||m.current||(m.current=!0,p())},[i,s,p]),E(()=>{if(!i)return;let v=()=>{document.visibilityState==="visible"&&p()};return document.addEventListener("visibilitychange",v),()=>document.removeEventListener("visibilitychange",v)},[i,p]),{hasUnreadSig:l,refreshUnread:p,clearUnread:d,markActiveConversationRead:f}}var er=ee.scope("settings");function Td(e){let{options:t,persistence:n,transport:r,feedback:o,hostElement:i,bus:s}=e,l=n.loadUserPrefs(),[c,u]=O(()=>l.locale??t.locale),[_,p]=O(()=>l.themeMode??t.themeMode),[d,f]=O(()=>l.textSize??t.textSize),m=L(y=>{n.patchUserPrefs(y),r.saveUserPrefs(n.loadUserPrefs()).catch(k=>er.warn("saveUserPrefs failed",{err:k}))},[n,r]);E(()=>{l.soundMuted!==void 0&&o.setMuted(l.soundMuted)},[]),E(()=>{i.dataset.theme=_},[i,_,t]),E(()=>{i.dataset.textSize=d},[i,d,t]),E(()=>{let y=!0;return o.mutedSig.subscribe(k=>{if(y){y=!1;return}m({soundMuted:k})})},[o,m]);let v=dn(c,t.availableLocales,t.defaultLocale);E(()=>{r.setLocale(v)},[r,v]),E(()=>{i.dir=Ci(v)?"rtl":"ltr"},[i,v]),E(()=>{v!==c&&u(v)},[v,c]);let h=L(y=>{er.info("localeChange",{locale:y}),u(y),m({locale:y}),s.emit("localeChange",y)},[m,s]),x=L(y=>{er.info("themeChange",{mode:y}),p(y),i.dataset.theme=y,m({themeMode:y}),s.emit("themeChange",y)},[i,m,s]),P=L(y=>{er.info("textSizeChange",{size:y}),f(y),i.dataset.textSize=y,m({textSize:y}),s.emit("textSizeChange",y)},[i,m,s]),b=L(()=>{o.toggleMuted();let y=o.mutedSig.value;er.info("soundToggle",{muted:y}),s.emit("soundToggle",{muted:y})},[o,s]);return{activeLocale:c,activeThemeMode:_,activeTextSize:d,effectiveLocale:v,setActiveLocale:u,setActiveThemeMode:p,setActiveTextSize:f,patchAndSync:m,handleLocaleChange:h,handleThemeChange:x,handleTextSizeChange:P,handleSoundToggle:b}}var be=ee.scope("app"),bo=C.cssPrefix;function Id(e,t){return Ws({...e,text:Je(t,e.text)})}function Ed({options:e,hostElement:t,bus:n}){let[r]=O(()=>un(e.widgetId,e.storage,e.aiAgentDeploymentId)),[o,i]=O(()=>r.getVisitorId()),s=r.loadUserPrefs(),l=dt(r.loadConversationId()),c=M(l.value!==void 0),u=dt(l.value??""),_=dt([]),[p,d]=O(!1),f=M(),[m,v]=O([]);function h(){let g=e.modules.list,T=new Set(g.map($=>$.id)),G=r.loadActiveModule();return G&&T.has(G)?G:g[0]?.id??""}function x(){return e.modules.list.find(g=>g.layout==="chat")?.id}function P(){let g=x();return g?e.modules.list.length===1?!0:k.sig.value.activeTab===g:!1}let b=M(P);b.current=P;let y=M();if(!y.current){let g=e.modules.list.map(T=>T.id);y.current=Kc(h(),g,T=>r.saveActiveModule(T))}let k=y.current,[w,B]=O(!1),[z,q]=O(null),[I,U]=O(!1),V=e.mode==="standalone"||e.mode==="inline",N=M(Fn(e,mn(),r.loadPanelOpen(),r.loadPanelSize())),[Z,le]=O(N.current.panelOpen),[oe,Le]=O(N.current.panelOpen),pe=M(),_e=M(),ye=M(!1),F=M(void 0);E(()=>{Z&&Le(!0)},[Z]);let ve=M(!1),[ie,Re]=O(!1),{dismissed:Oe,dismissCallout:Se}=md({callout:e.launcher.callout,persistence:r}),xe=e.launcher.callout?.persistent??!0,Ue=L(()=>{be.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Se()},[n,Se]),[Pe,ke]=O(N.current.panelSize),Ie=M(!1),[ze,nt]=O("chat"),[H,K]=O(!0),te=M(H);te.current=H;let[re,rt]=O(!1),S=M(re);S.current=re;let W=M(null),[ce,fe]=O(!1),[Ne,gt]=O(null),[ct,qe]=O([]),Ft=M(e.strings),vt=M(e);vt.current=e;let[Ga,Nd]=O(void 0),[Dd,$d]=O(void 0),[Fd,Bd]=O(()=>r.loadSidebarCollapsed()??!1),[xo,Hd]=O({}),[se]=O(()=>new Nr({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Os({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[et]=O(()=>new qr(e.sound,e.haptics)),Tt=kd({transport:se,setStreaming:rt}),{activeLocale:tr,activeThemeMode:Ka,activeTextSize:ja,effectiveLocale:nn,setActiveLocale:Ud,setActiveThemeMode:zd,setActiveTextSize:qd,patchAndSync:Xa,handleLocaleChange:Vd,handleThemeChange:Wd,handleTextSizeChange:Gd,handleSoundToggle:Kd}=Td({options:e,persistence:r,transport:se,feedback:et,hostElement:t,bus:n}),{controlModeSig:ht,assignedOperatorInitialsSig:jd,operatorAvailableSig:Xd,applyControlState:rn,adoptControlStateChunk:Yd,requestOperator:Jd,cancelOperatorRequest:Qd}=gd({transport:se,conversationIdSig:l}),{hasUnreadSig:Zd,refreshUnread:Ya,clearUnread:Ja,markActiveConversationRead:eu}=Rd({transport:se,options:e,conversationIdSig:l,isChatActiveRef:b,activated:oe,conversationReady:w});E(()=>{et.update(e.sound,e.haptics)},[et,e.sound,e.haptics]),E(()=>()=>et.destroy(),[et]),E(()=>{Ie.current||!e.size.initialSize||(Ie.current=!0,!r.loadPanelSize()&&ke(aa(e.mode,e.size,mn())))},[e.mode,e.size,r]),E(()=>{if(!w||ve.current)return;ve.current=!0;let g=Fn(e,mn(),r.loadPanelOpen(),r.loadPanelSize());le(g.panelOpen),ke(g.panelSize)},[w,e,r]);let Qa=M(null);E(()=>{w&&k.reconcile(e.modules.list.map(g=>g.id),h())},[w,e.modules.list,k]);let nr=L(g=>{!g||g.length===0||(_.value=g.map(T=>Id(T,Ft.current)))},[_]),So=M(null),rr=L(async g=>{try{let{formSubmissions:T}=await(g?se.bootstrap(g):So.current??se.bootstrap()),G=new Map;return T.forEach(($,J)=>G.set($.formId,J)),T.filter(($,J)=>!$.skipped||G.get($.formId)===J).map(($,J)=>({key:`wire:${$.formId}:${$.createdAt??J}`,formId:$.formId,outcome:$.skipped?"skipped":"submitted",createdAt:Mr($.createdAt),values:$.values}))}catch(T){return be.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:T}),[]}},[se]),Sn=M(0),bt=M(0),ko=L((g,T)=>{if(g===l.value)return;let G=l.value;bt.current++,d(!1),G&&(r.saveDraft(g,r.loadDraft(G)),r.saveDraft(G,"")),l.value=g,r.saveConversationId(g),se.primeIdentity(void 0,g),be.info("conversation rebound",{previous:G,current:g,reason:T}),G&&n.emit("conversationRebound",{previous:G,current:g,...T?{reason:T}:{}})},[n,l,r,se]),or=L((g,T)=>{let G=[...g.map(A=>A.createdAt),...T.map(A=>A.createdAt)].filter(A=>A!==void 0),$=(G.length?Math.min(...G):Date.now())-1;return[...(F.current?.messages??[]).map(A=>{let Be=Id(A,Ft.current);return Be.createdAt=$,Be}),...g]},[]),Za=L(async g=>{let T=bt.current,G=()=>T!==bt.current||l.value!==g;_e.current===g&&(_e.current=void 0),d(!0);try{let[$,J]=await Promise.all([se.loadConversation(g),rr()]);if(G())return;let A=At($.messages??[]);v(J);let Be=or(Qs(A,_.value),J);if(_.value=Be,_e.current=Be.some(De=>De.role==="user")?void 0:g,A.length>0||$.controlState!==void 0){K($.canContinue??!0),rn(Et($.controlState));let De=A.findLast(ut=>ut.role==="assistant"&&!ut.ephemeral);qe(De?.suggestions??$.suggestions??[])}}catch($){if(G())return;be.warn("loadThread failed; keeping conversation active",{err:$,conversationId:g}),n.emit("error",$),vt.current.onError?.($)}finally{G()||d(!1)}},[se,rr,_,l,or,n]),tu=L(g=>{if(pe.current===g)return pe.current=void 0,Za(g)},[Za]),nu=L(()=>{if(f.current)return Promise.resolve(void 0);let g=l.value,T=_.value.find(A=>!A.ephemeral),G=T?.serverMessageId??T?.id;if(!g||!G)return Promise.resolve(void 0);let $=bt.current,J={};return f.current=J,(async()=>{try{let A=await se.loadConversation(g,{beforeId:G});if(f.current!==J||bt.current!==$||l.value!==g)return;if(A.messages.length===0)return!1;let Be=A.messages.map(ua),ue=_.value,De=Ys(ue,Be);if(De!==ue){let ut=Math.min(...Be.map(Ht=>Ht.createdAt??1/0),...m.map(Ht=>Ht.createdAt??1/0));if(Number.isFinite(ut))for(let Ht of ue){if(!Ht.ephemeral)break;(Ht.createdAt??1/0)>=ut&&(Ht.createdAt=ut-1)}_.value=De}return!0}catch(A){if(f.current!==J||bt.current!==$||l.value!==g)return;be.warn("load previous messages failed",{err:A,conversationId:g,beforeId:G}),n.emit("error",A),e.onError?.(A);return}finally{f.current===J&&(f.current=void 0)}})()},[n,l,m,_,e,se]),kn=L(async({newConversation:g})=>{let T=++Sn.current,G=()=>T!==Sn.current,$=l.value,J=g||!$?ot():$;J!==$&&(bt.current++,d(!1),it(()=>{l.value=J,u.value=J}),r.saveConversationId(J)),se.primeIdentity(o,J);let A;try{A=await se.handshake({visitorId:o,conversationId:J,userPrefs:r.loadUserPrefs(),locale:tr})}catch(ue){if(G())return;n.emit("error",ue),e.onError?.(ue),g||B(!0);return}if(G())return;if(A.visitorId&&A.visitorId!==o&&(be.info("visitor rebound",{previous:o,current:A.visitorId,reason:A.rebind?.visitorId}),r.setVisitorId(A.visitorId),i(A.visitorId),n.emit("visitorRebound",{previous:o,current:A.visitorId,reason:A.rebind?.visitorId})),A.conversationId!==J&&ko(A.conversationId,A.rebind?.conversationId),A.agent&>(A.agent),rn(Et(A.controlState)),e.mode==="page"&&(A.site&&As(A.site)?Nd(A.site):A.site&&be.warn("invalid site config, using fallback",{site:A.site}),A.blocks&&Ms(A.blocks)?$d(A.blocks):A.blocks&&be.warn("invalid blocks config, using fallback",{blocks:A.blocks})),A.userPrefs&&!g&&(r.saveUserPrefs(A.userPrefs),A.userPrefs.locale&&Ud(A.userPrefs.locale),A.userPrefs.soundMuted!==void 0&&et.setMuted(A.userPrefs.soundMuted),A.userPrefs.themeMode&&zd(A.userPrefs.themeMode),A.userPrefs.textSize&&qd(A.userPrefs.textSize)),F.current=A.welcome,g||n.emit("handshake",A),A.welcome?.suggestions){let ue=Ft.current;qe(A.welcome.suggestions.map(De=>({...De,label:Je(ue,De.label),...De.text===void 0?{}:{text:Je(ue,De.text)}})))}let Be=!g&&$&&A.conversationId===$;c.current=!!Be,Be?ye.current||(pe.current=A.conversationId):(_e.current=A.conversationId,nr(A.welcome?.messages)),g||B(!0)},[se,o,r,e,n,l,u,et,nr,tr,ko]),wn=JSON.stringify(e.userContext??null),ru=JSON.stringify(e.pageContext??null),ou=JSON.stringify(xo);E(()=>{let g=Object.keys(xo).length?{...xo,...e.userContext}:e.userContext;se.setContext(g,Xm(e.pageContext))},[se,wn,ru,ou]);let ei=L((g,T=[])=>qe(g.suggestions??T),[]);E(()=>(se.primeIdentity(o,l.value),kn({newConversation:!1}),()=>{Sn.current++,bt.current++}),[]),E(()=>{!oe||!w||ye.current||(ye.current=!0,So.current=se.bootstrap(),(async()=>{try{let g=await So.current;q(Ln((g??{forms:[]}).forms,nn))}catch(g){be.debug("bootstrap failed \u2014 treating as no forms",{err:g})}finally{U(!0)}})(),pe.current===l.value&&d(!0))},[oe,w]);let ar=M(null);E(()=>{if(!oe||!w)return;if(ar.current===null){ar.current=nn;return}if(ar.current===nn)return;ar.current=nn;let g=!1;return se.bootstrap().then(T=>{g||q(Ln((T??{forms:[]}).forms,nn))}).catch(T=>be.debug("forms re-localize failed \u2014 keeping current copy",{err:T})),()=>{g=!0}},[oe,w,nn,se]);let ti=M(wn);E(()=>{!w||ti.current===wn||(ti.current=wn,kn({newConversation:!1}))},[wn,w,kn]),vd({hostElement:t,mode:e.mode,panelSize:Pe,isOpen:Z,setIsOpen:le});let{sendAiTurn:Bt,sendRoutedTurn:Cn}=Cd({transport:se,messagesSig:_,conversationIdSig:l,options:e,bus:n,feedback:et,persistence:r,visitorId:o,adoptConversationId:ko,applyControlState:rn,setCanSend:K,settleSuggestions:ei,runCancellation:Tt}),{toolInteraction:au}=fd({streaming:re,controlModeSig:ht,messagesSig:_,sendAiTurn:Bt,bus:n,humanInLoop:e.features.humanInLoop}),iu=L((g,T)=>{let G=_.value.find($=>$.serverMessageId===g);G&&(G.feedback=T),be.info("messageFeedback",{messageId:g,value:T}),n.emit("messageFeedback",{messageId:g,value:T}),se.submitFeedback({messageId:g,value:T})},[n,_,se]),su=()=>_.value.reduce((g,T)=>g+(T.role==="user"?1:0),0),on=e.forms.list.length>0?e.forms:z??e.forms,Ee=zc({forms:on,persistence:r,userContext:()=>e.userContext,messageCount:su,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>l.value,onComplete:(g,T,G,$)=>{be.info("formSubmit",{formId:g.id,trigger:T,skipped:$}),n.emit("formSubmit",{formId:g.id,values:G,skipped:$}),v(A=>{let ue=A.find(De=>De.formId===g.id&&De.outcome==="skipped")?.createdAt??Date.now();return[...A.filter(De=>!(De.formId===g.id&&De.outcome==="skipped")),{key:`local:${g.id}:${ue}`,formId:g.id,outcome:$?"skipped":"submitted",createdAt:ue,...$?{}:{values:G}}]});let J=l.value??ot();l.value||(l.value=J,r.saveConversationId(J),se.primeIdentity(void 0,J)),!$&&g.mirrorToContext&&Hd(A=>({...A,...G})),se.submitForm({formId:g.id,conversationId:J,trigger:T,values:G,skipped:$})}}),wo=wt(()=>Ee.activeForm.value),lu=L(()=>Ee.fire("after-messages"),[Ee]),cu=L(()=>c.current||_.value.some(g=>!g.ephemeral&&g.role==="user"),[_]);Sd({activated:oe,conversationReady:w,conversationIdSig:l,messagesSig:_,optionsRef:vt,isChatActiveRef:b,transport:se,visitorId:o,adoptControlStateChunk:Yd,settleSuggestions:ei,markActiveConversationRead:eu,onReplyLanded:lu,runCancellation:Tt,setCanSend:K,feedback:et,bus:n,homeNav:k,loadInitialThread:tu,shouldReconcileOnConnect:cu}),E(()=>{Ee.refresh()},[on,Ee]);let ni=e.pageContext?.area?String(e.pageContext.area):void 0,du=wt(()=>_.value.length);E(()=>{w&&I&&Ee.fire("pre-chat")},[w,I,Ee]),E(()=>{I&&!H&&Ee.fire("conversation-closed")},[I,H,Ee]),E(()=>{w&&I&&ni&&Ee.fire("page-area")},[w,I,ni,Ee]);let Co=Q(()=>{let g=on.list.flatMap(T=>T.triggers).filter(T=>T.kind==="idle").map(T=>Number(T.param));return g.length?Math.min(...g)*1e3:0},[on]);E(()=>{if(!Co||!Z)return;let g=setTimeout(()=>Ee.fire("idle"),Co);return()=>clearTimeout(g)},[Co,Z,Ee,du.value]);let ri=L(async(g,T)=>{if(W.current)return!1;let G=l.value,$=ht.value!=="ai-agent";if(be.info("send",{textLen:g.length,attachments:T.length,streaming:S.current,routedToOperator:$}),S.current&&!$)return!1;let J=new AbortController,A={conversationId:G,controller:J};W.current=A,fe(!0);try{et.unlock();let Be=await Jm(se,T,J.signal,ut=>{J.signal.aborted||(be.warn("upload failed",{err:ut}),n.emit("error",ut),e.onError?.(ut))});if(J.signal.aborted||l.value!==G||!te.current||Ee.activeForm.value)return!1;let ue=ht.value!=="ai-agent";if(S.current&&!ue||!g&&Be.length===0)return!1;n.emit("send",{text:g,attachmentCount:T.length}),ct.length>0&&qe([]),et.play("messageSent");let De=da(g,Be);return xn(n,e,"user",g),ue?(_.value=[..._.value,De],Cn(De),!0):(_.value=[..._.value,De,Ct()],Bt({continueExisting:!1}),!0)}finally{W.current===A&&(W.current=null,fe(!1))}},[se,n,e,ct.length,_,l,Bt,Cn,ht]);E(()=>{let g=l.value;return()=>{let T=W.current;!T||T.conversationId!==g||(W.current=null,fe(!1),T.controller.abort())}},[l.value]),E(()=>{H&&!wo.value||W.current?.controller.abort()},[wo.value,H]);let uu=L(()=>{if(!Tt.stop())return;be.info("stop"),n.emit("stop",void 0);let g=_.value.at(-1);g&&g.role!=="user"&&g.status==="streaming"&&(g.canceled=!0,_.value=[..._.value])},[Tt,n,_]),_u=L(g=>{if(re)return;let T=_.value,G=Hr(T,g);if(G)switch(be.info("retry",{kind:G.kind,messageId:G.messageId}),G.kind){case"continue-assistant":{if(ht.value!=="ai-agent"||g.role!=="assistant"||(g.serverMessageId??g.id)!==G.messageId)return;g.status="streaming",g.errorText=void 0,g.retryAction=void 0,g.awaitingContinuation=!0,_.value=[...T],Bt({continueExisting:!0,turn:g});return}case"resend-user":{let $=T.find(A=>A.role==="user"&&A.id===G.messageId);if(!$)return;if($.status="complete",$.errorText=void 0,$.retryAction=void 0,ht.value!=="ai-agent"){_.value=g.role==="assistant"?T.filter(A=>A!==g):[...T],Cn($);return}let J=Ct();_.value=g.role==="assistant"?T.map(A=>A===g?J:A):[...T,J],Bt({continueExisting:!1,turn:$});return}case"repeat-user":{let $=T.find(ue=>ue.role==="user"&&ue.id===G.messageId);if(!$)return;let J=da(He($),$.attachments?.map(ue=>({...ue}))??[]),A=new Set(J.attachments?.flatMap(ue=>ue.url?[ue.url]:[])??[]),Be=$.partsSig.value.flatMap(ue=>ue.kind==="file"&&!A.has(ue.url)?[{...ue}]:[]);if(Be.length>0&&(J.partsSig.value=[...J.partsSig.value,...Be]),ht.value!=="ai-agent"){_.value=[...T,J],Cn(J);return}_.value=[...T,J,Ct()],Bt({continueExisting:!1,turn:J});return}default:return G}},[re,_,ht,Bt,Cn]),Rn=L(()=>{if(ql(e.mode,Pe)==="exit-fullscreen"){be.info("close \u2192 exit-fullscreen",{mode:e.mode}),ke("normal"),n.emit("fullscreen",!1);return}be.info("close \u2192 panel closed",{mode:e.mode}),Ee.fire("panel-close"),le(!1),r.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,r,Pe,Ee]),Ro=L(()=>{be.info("open",{mode:e.mode}),et.unlock(),Re(!0),le(!0),r.savePanelOpen(!0),!Oe&&!xe&&Ue(),setTimeout(()=>Re(!1),Ym),oe&&Ya(),n.emit("open",void 0),e.onOpen?.()},[n,e,et,r,Oe,xe,Ue,oe,Ya]),To=L(()=>{let g=_.value.some(T=>T.role==="user");if(_e.current===l.value&&!g&&H&&l.value){be.info("clear \u2192 reusing empty conversation",{conversationId:l.value}),_.value.length===0&&nr(F.current?.messages);return}be.info("clear \u2192 new conversation",{wasStreaming:re}),n.emit("clear",void 0),Tt.settle(),c.current=!1,pe.current=void 0,_e.current=void 0,it(()=>{_.value=[],l.value=void 0,rn({controlMode:"ai-agent",controlRevision:0})}),r.clearConversation(),K(!0),v([]),qe([]),kn({newConversation:!0})},[re,_,l,r,kn,n,H,nr,Tt,rn]),Io=L(()=>{To(),nt("chat");let g=e.modules.list.find(T=>T.layout==="chat")?.id;g&&k.switchTab(g)},[To,k,e]),Eo=L(()=>{let g=Pe==="expanded"?"normal":"expanded";be.info("expand",{from:Pe,expanded:g==="expanded"}),ke(g),r.savePanelSize(g),n.emit("expand",g==="expanded")},[n,Pe,r]),Ao=L(()=>{let g=Pe==="fullscreen"?"normal":"fullscreen";be.info("fullscreen",{from:Pe,fullscreen:g==="fullscreen"}),ke(g),r.savePanelSize(g),n.emit("fullscreen",g==="fullscreen")},[n,Pe,r]),pu=L(()=>{nt(g=>{let T=g==="history"?"chat":"history";return be.info("toggleHistory",{view:T}),n.emit("toggleHistory",{view:T}),T})},[n]),fu=L(()=>{Bd(g=>{let T=!g;return be.info("sidebarToggle",{collapsed:T}),r.saveSidebarCollapsed(T),n.emit("sidebarToggle",{collapsed:T}),T})},[r,n]),mu=L(g=>{be.info("resize",g),Xa({widgetSize:g}),n.emit("resize",g)},[Xa,n]),Mo=L(async g=>{let T=++Sn.current;bt.current++,d(!1);let G=()=>T!==Sn.current;be.info("selectConversation",{conversationId:g,wasStreaming:re}),n.emit("selectConversation",{conversationId:g});try{let[$,J]=await Promise.all([se.loadConversation(g),rr(g)]);if(G())return;Tt.settle(),c.current=!0,pe.current=void 0;let A=At($.messages);_e.current=A.some(ue=>ue.role==="user")?void 0:$.conversationId,it(()=>{_.value=or(A,J),$.conversationId!==l.value&&(u.value=$.conversationId),l.value=$.conversationId}),v(J),r.saveConversationId($.conversationId),se.primeIdentity(o,$.conversationId),$.agent&>($.agent),K($.canContinue),rn(Et($.controlState));let Be=A.findLast(ue=>ue.role==="assistant"&&!ue.ephemeral);if(qe(Be?.suggestions??$.suggestions??[]),nt("chat"),await se.markRead(g),G())return;Ja(g)}catch($){if(G())return;n.emit("error",$),e.onError?.($)}},[se,_,l,u,n,e,r,Ja,rr,or,re,o,Tt]),ir=M(null),oi=L(g=>{typeof g=="string"&&(I?Ee.fire("manual",g):ir.current=g)},[I,Ee]);E(()=>{!I||!ir.current||(Ee.fire("manual",ir.current),ir.current=null)},[I,Ee]);let an=M({handleOpen:Ro,handleClose:Rn,handleExpand:Eo,handleFullscreen:Ao,openForm:oi});an.current={handleOpen:Ro,handleClose:Rn,handleExpand:Eo,handleFullscreen:Ao,openForm:oi},_t(()=>Ls(t,{open:()=>an.current.handleOpen(),close:()=>an.current.handleClose(),expand:()=>an.current.handleExpand(),fullscreen:()=>an.current.handleFullscreen(),openForm:g=>an.current.openForm(g)}),[t]);let Ye=Q(()=>Xo(e,tr,Ka,ja),[e,tr,Ka,ja]);Ft.current=Ye.strings;let gu=Q(()=>m.map(g=>{let T=on.list.find(G=>G.id===g.formId);return{...g,title:T?.title,form:T}}),[m,on]),ai={options:Ye,transport:se,feedback:et,bus:n,persistence:r,conversationId:l.value??"",composerKey:u.value,composerApiRef:Qa,view:ze,canSend:H,isStreaming:re,sendPreparing:ce,composerActive:Ye.mode==="page"||Ye.mode==="inline"||Ye.mode==="standalone"||Z,controlMode:ht.value,assignedOperatorInitials:jd.value,operatorAvailable:Xd.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Jd,onCancelOperatorRequest:Qd,loadingMessages:p,onLoadPreviousMessages:nu,messagesSig:_,agent:Ne,suggestions:ct,initialWidgetSize:s.widgetSize??null,visitorId:o,onClose:Rn,onClear:To,onExpand:Eo,onFullscreen:Ao,onSoundToggle:Kd,onToggleHistory:pu,onSelectHistoryConversation:Mo,onNewConversation:Io,onLocaleChange:Vd,onThemeChange:Wd,onTextSizeChange:Gd,onWidgetSizeChange:mu,onSend:ri,onStop:uu,onSuggestion:g=>{if(W.current)return;let T=g.text??g.label;be.info("suggestion",{text:T,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:T}),e.autoSendSuggestions?ri(T,[]):Qa.current?.fill(T)},activeForm:wo.value?.form??null,formMarkers:gu,onFormSubmit:Ee.complete,onFormSkip:Ee.skip,onFormFill:g=>Ee.fire("manual",g),tool:au,onRetry:_u,onMessageFeedback:iu},vu=g=>{Mo(g);let T=x();T&&k.switchTab(T)};if(!w)return null;let Tn=Ye.modules.list,Lo=g=>{let T=Gn("close",Ye.mode,g);return Tn.length===0?a(pd,{strings:Ye.strings,onClose:T?Rn:void 0}):Tn.length===1&&Tn[0]?.layout==="chat"?a(Uc,{...ai,panelSize:g}):a(_d,{panelProps:{...ai,panelSize:g,onClose:T?Rn:void 0},enabledModules:Tn,nav:k,bus:n,hasUnread:Zd.value,onSelectConversation:vu,onStartNewConversation:Io,onSetPanelSize:ke})};if(e.mode==="page"){let g=G=>{Mo(G.conversationId)},T=Tn.some(G=>G.layout==="chat");return a("div",{class:`${bo}-anchor`,children:a(Wc,{site:Ga,blocks:Dd,transport:se,strings:Ye.strings,locale:Ye.locale,persistence:r,visitorId:o,showConversations:T,onSelectConversation:g,onNewConversation:Io,sidebarCollapsed:Fd,onToggleSidebarCollapsed:fu,children:Lo("fullscreen")})})}if(V){let g=e.mode==="standalone"?"fullscreen":Pe;return a("div",{class:`${bo}-anchor`,children:Lo(g)})}let ii=e.mode==="drawer",si=!(e.mode==="modal")&&!e.launcher.hidden&&(!Z||ie),li=si&&!ie&&!Oe&&!ii?Ye.launcher.callout:null;return a("div",{class:`${bo}-anchor`,"data-launcher-size":Ye.launcher.size,children:[Z||oe?a("div",{class:`${bo}-surface`,hidden:!Z,children:Lo(Pe)}):null,si?a(Hl,{onToggle:Ro,launcher:Ye.launcher,strings:Ye.strings,leaving:ie,edgeTab:ii}):null,li?a(Ul,{callout:li,launcherPosition:Ye.position,strings:Ye.strings,closeLabel:Ye.strings.close,onDismiss:Ue}):null]})}function Xm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Ym=120;async function Jm(e,t,n,r){return(await Promise.all(t.map(async i=>{try{let{id:s,url:l}=await e.uploadFile(i.file,n);return{id:s,name:i.name,mediaType:i.mediaType,size:i.size,url:l}}catch(s){r(s);return}}))).filter(i=>i!==void 0)}var Qm=ee.scope("error-boundary"),yo=class extends Qe{constructor(){super(...arguments);ne(this,"state",{crashed:!1})}componentDidCatch(n,r){Qm.error("widget render crashed",{error:n,componentStack:r?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,r?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Zm="1",eg=60,tg=2e3,Ad={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function ng(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function rg(){return location.origin+location.pathname}function og(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Md(e,t){let n=Math.random(),r=0,o=0,i=new Set,s=(c,u)=>{let{tracking:_,publicKey:p,aiAgentDeploymentId:d,mode:f,themeMode:m}=t.getOptions();if(!_.enabled||ng()||n>=_.sampleRate)return;let v=performance.now();if(v-r>6e4&&(r=v,o=0),++o>eg)return;let h=new URLSearchParams;h.set("v",Zm),h.set("_ev",Ar),h.set("e",c),_.token&&h.set("tk",_.token),p&&h.set("pk",p),d&&h.set("dep",d),h.set("vid",t.getVisitorId());let x=t.getConversationId();x&&h.set("cid",x),h.set("url",rg());let P=og();P&&h.set("ref",P),h.set("sw",String(screen.width)),h.set("sh",String(screen.height)),h.set("vw",String(innerWidth)),h.set("vh",String(innerHeight)),h.set("dpr",String(devicePixelRatio)),h.set("lang",navigator.language);try{h.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(h.set("m",f),h.set("th",m),u)for(let[w,B]of Object.entries(u))B!==void 0&&h.set(w,String(B));h.set("ts",String(Date.now()));let b=`${_.endpoint}?${h}`;if(b.length>tg)return;let y=new Image(1,1);i.add(y);let k=()=>i.delete(y);y.addEventListener("load",k,{once:!0}),y.addEventListener("error",k,{once:!0}),y.src=b},l=Object.keys(Ad).map(c=>e.on(c,u=>s(c,Ad[c]?.(u))));return()=>{for(let c of l)c();i.clear()}}function Ld(e){let{bus:t,host:n,appRoot:r,persistence:o,reportError:i}=e,s=e.initialRaw,l,c=cn(s),u=!0,_=()=>{c=cn(l?Yo(s,l):s)},p=()=>{ss(n,br(c.mode));let m=o.loadUserPrefs().themeMode;cs(n,m?{...c,themeMode:m}:c),u&&(yr(n,ag(c)),u=!1)},d=()=>{p(),Mn(Pt(yo,{onError:i},Pt(Ed,{bus:t,hostElement:n,options:c})),r)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&o.rememberStorageVersion(m.config.storageVersion),l=m.config,_(),d())});let f=Md(t,{getOptions:()=>c,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>s,render:d,setUserOptions:m=>{s=m,_(),d()},patchUserOptions:m=>{s={...s,...m},_(),d()},destroy:()=>f()}}function ag(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=un(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:r}=Fn(e,mn(),t.loadPanelOpen(),t.loadPanelSize());return Er(e.mode,r,n)}var Po=class{constructor(){ne(this,"handlers",new Map)}on(t,n){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let r=this.handlers.get(t);if(r)for(let o of r)try{o(n)}catch{}}clear(){this.handlers.clear()}};var Wa=class extends HTMLElement{constructor(){super(...arguments);ne(this,"bus",new Po);ne(this,"mountResult",null);ne(this,"runtime",null)}static get observedAttributes(){return Jo}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Mn(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=Qo(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let r=cn(n);this.mountResult||(this.mountResult=ls({existingHost:this,position:br(r.mode)}));let o=un(r.widgetId,r.storage,r.aiAgentDeploymentId);this.runtime=Ld({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},Od=!1;function ig(){if(Od||typeof customElements>"u")return;let e=C.tagName;customElements.get(e)||customElements.define(e,Wa),Od=!0}typeof customElements<"u"&&ig();export{ig as registerWebComponent};
|
|
41
|
+
`).trim(),L=!h&&t!=="error"&&!b.value&&q.length>0,ne=z||L;return a("div",{class:`${Ke}-bubble-row`,"data-role":e.role,"data-testid":Ge(R.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${Ke}-bubble-col`,children:[a("div",{class:`${Ke}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${Ke}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${Ke}-bubble-body`,children:[w?a(em,{label:n.loading}):m.map((oe,le)=>a(Xf,{part:oe,active:B,live:y,strings:n,showReasoning:o,showToolCalls:i,showSources:s,interactive:l&&t==="complete"&&(oe.kind!=="tool"||$r(e,le)),superseded:c,continuationStreaming:e.continuationStreaming===!0,tool:u},`${Qf(oe)}#${le}`)),W&&a(Zf,{}),t==="error"||b.value?a("div",{class:`${Ke}-error`,role:"alert",children:[a("span",{children:e.errorText??n.errorGeneric}),_?a("button",{type:"button",class:`${Ke}-error-retry`,onClick:()=>_(e),"data-testid":R.messageRetry,children:n.errorRetry}):null]}):null]})]}),U||ne?a("div",{class:`${Ke}-bubble-meta`,children:[U?a("time",{class:`${Ke}-bubble-time`,dateTime:U.iso,title:U.full,children:U.short}):null,ne?a("div",{class:`${Ke}-bubble-actions`,children:[z&&e.serverMessageId?a(Cc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:n,onFeedback:d}):null,L?a(Kf,{text:q,strings:n}):null]}):null]}):null]})})}function Kf({text:e,strings:t}){let[n,r]=D(!1),o=()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return a("button",{type:"button",class:`${Ke}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:o,"data-testid":R.messageCopy,children:n?a(Xt,{}):a(Ol,{})})}function jf(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function Xf({part:e,active:t,live:n,strings:r,showReasoning:o,showToolCalls:i,showSources:s,interactive:l,superseded:c,continuationStreaming:u,tool:_}){switch(e.kind){case"step-start":return null;case"text":return a(lo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?a(Jf,{part:e,active:t,strings:r}):null;case"tool":return a(Yf,{part:e,strings:r,showToolCalls:i,interactive:l,superseded:c,continuationStreaming:u,live:n,tool:_});case"file":return e.mediaType.startsWith("image/")?a("img",{src:e.url,alt:"",loading:"lazy"}):a("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return s?a(Rc,{part:e,strings:r}):null}}function Yf({part:e,strings:t,showToolCalls:n,interactive:r,superseded:o,continuationStreaming:i,live:s,tool:l}){let c=Z(()=>pe(()=>e.approvalSig.value!==void 0),[e]);return l?.humanInLoop&&c.value?ro(e.toolName)?a(Ac,{part:e,strings:t,active:r,superseded:o,continuationStreaming:i,onDecision:l.onDecision,onEdit:l.onEdit}):a(Tc,{part:e,strings:t,active:r,superseded:o,continuationStreaming:i,onDecision:l.onDecision,onEdit:l.onEdit}):n?a(Lc,{part:e,strings:t,live:s}):null}function Jf({part:e,active:t,strings:n}){return a("details",{class:`${Ke}-reasoning`,"data-testid":R.reasoning,open:t,"data-active":t?"true":void 0,children:[a("summary",{class:`${Ke}-reasoning-summary`,children:a("span",{class:`${Ke}-reasoning-label`,children:t?n.thinking:n.thoughts})}),a("div",{class:`${Ke}-reasoning-body`,children:a(lo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Qf(e){switch(e.kind){case"text":case"reasoning":case"step-start":return`${e.kind}:${e.id}`;case"tool":return`tool:${e.toolCallId}`;case"file":return`file:${e.url}`;case"source":return`source:${e.sourceId}`}}function Zf(){return a("span",{class:`${Ke}-typing`,"data-testid":R.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function em({label:e}){return a("span",{class:`${Ke}-loading`,role:"status",children:[a("span",{class:`${Ke}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${Ke}-loading-label`,children:e})]})}var Ot=C.cssPrefix,$a=120,tm=350;function Nc({messagesSig:e,strings:t,responseMode:n,showReasoning:r,showToolCalls:o,showSources:i,enableMessageFeedback:s,onFeedback:l,loading:c,onLoadPreviousMessages:u,idle:_,controlMode:p="ai-agent",tool:d,onRetry:f,form:m,formMarkers:b,onFillForm:v}){let P=M(null),x=ut(()=>e.value),[h,y]=D(!1),[k,w]=D(!1),B=M(!1),W=M(!1),[U,I]=D(),z=M(!1),q=M(!1),L=M(!1),ne=M(0),oe=()=>L.current||performance.now()-ne.current<tm,le=M(0),Ae=S=>{let V=S.scrollHeight-S.clientHeight>1;S.dataset.fadeTop=V&&S.scrollTop>1?"true":"false",S.dataset.fadeBottom=V&&S.scrollHeight-S.scrollTop-S.clientHeight>1?"true":"false"},de=S=>y(S.scrollHeight-S.scrollTop-S.clientHeight>$a*2),_e=S=>{le.current=performance.now(),S.scrollTop=S.scrollHeight,Ae(S)},Me=(S,V)=>{_e(S);let ye=V,ie=0,Pe=()=>{q.current||oe()||(_e(S),--ye>0&&(ie=requestAnimationFrame(Pe)))};return V>0&&(ie=requestAnimationFrame(Pe)),()=>cancelAnimationFrame(ie)},N=(S,V)=>{let ye,ie,Pe,vt=-1,ct=()=>{ye.disconnect(),ie.disconnect(),clearTimeout(Pe)},qe=()=>{if(q.current||oe()||vt>=0&&S.scrollTop<vt-4)return ct();_e(S),vt=S.scrollTop};return ye=new ResizeObserver(qe),ie=new MutationObserver(qe),qe(),ye.observe(S),ie.observe(S,{childList:!0,subtree:!0,characterData:!0}),Pe=setTimeout(ct,V),ct},ve=x.value[0]?.id;pt(()=>{let S=P.current;if(S&&x.value.length!==0&&!W.current&&(z.current=!0,!!x.value.some(V=>V.role==="user")))return N(S,300)},[ve]);let ae=M(0);E(()=>{let S=P.current,V=x.value,ye=ae.current;if(ae.current=V.length,!S||!z.current||W.current)return;if(V.slice(ye).some(Pe=>Pe.role==="user"))return q.current=!1,Me(S,3);if(!V.some(Pe=>Pe.role==="user")||q.current||oe())return;S.scrollHeight-S.scrollTop-S.clientHeight<$a&&_e(S)},[x.value.length]);let De=M(null);E(()=>{let S=P.current,V=x.value.at(-1),ye=De.current;if(De.current=V?{id:V.id,streaming:V.status==="streaming"}:null,!!S&&z.current&&!(!V||V.id!==ye?.id||ye.streaming||V.status!=="streaming"))return q.current=!1,Me(S,3)},[x.value]),E(()=>{let S=P.current;if(!S)return;let V=x.value.at(-1);if(!V||V.status!=="streaming"&&!x.value.some(Pe=>Pe.role==="user"))return;let ye=()=>{if(q.current||oe())return;S.scrollHeight-S.scrollTop-S.clientHeight<$a*2&&_e(S)};if(V.status!=="streaming")return N(S,300);ye();let ie=new MutationObserver(ye);return ie.observe(S,{childList:!0,subtree:!0,characterData:!0}),()=>ie.disconnect()},[x.value]);let xe=m?.form.id,Te=!!m&&(b??[]).some(S=>S.formId===m.form.id);pt(()=>{let S=P.current;!S||!xe||q.current||x.value.some(V=>V.role==="user")&&(Te?S.querySelector(`[data-testid="${R.formGate}"]`)?.scrollIntoView({block:"nearest"}):_e(S))},[xe,Te]),E(()=>{let S=P.current;if(!S)return;let V=()=>{de(S),Ae(S),performance.now()-le.current>150&&(q.current=S.scrollHeight-S.scrollTop-S.clientHeight>8)},ye=()=>{q.current=!0},ie=ht=>{ht.deltaY<0&&ye()},Pe=0,vt=ht=>{Pe=ht.touches[0]?.clientY??0,L.current=!0},ct=ht=>{(ht.touches[0]?.clientY??0)>Pe+4&&ye()},qe=()=>{L.current=!1,ne.current=performance.now()},Ft=()=>{L.current=!0};return S.addEventListener("scroll",V,{passive:!0}),S.addEventListener("wheel",ie,{passive:!0}),S.addEventListener("touchstart",vt,{passive:!0}),S.addEventListener("touchmove",ct,{passive:!0}),S.addEventListener("touchend",qe,{passive:!0}),S.addEventListener("touchcancel",qe,{passive:!0}),S.addEventListener("pointerdown",Ft,{passive:!0}),window.addEventListener("pointerup",qe,{passive:!0}),window.addEventListener("pointercancel",qe,{passive:!0}),de(S),()=>{S.removeEventListener("scroll",V),S.removeEventListener("wheel",ie),S.removeEventListener("touchstart",vt),S.removeEventListener("touchmove",ct),S.removeEventListener("touchend",qe),S.removeEventListener("touchcancel",qe),S.removeEventListener("pointerdown",Ft),window.removeEventListener("pointerup",qe),window.removeEventListener("pointercancel",qe)}},[]);let Ce=()=>{let S=P.current;S&&(q.current=!1,_e(S))},Le=x.value.filter(S=>!S.ephemeral),he=Le[0],Se=he?.serverMessageId??he?.id,Ie=!!(u&&Le.length>=la&&Se!==U),Je=async()=>{if(!u||B.current)return;let S=P.current,V=S?.scrollHeight??0,ye=S?.scrollTop??0;B.current=!0,W.current=!0,w(!0);try{let ie=await u();ie===!1&&Se&&I(Se),ie&&S&&(await new Promise(Pe=>requestAnimationFrame(()=>requestAnimationFrame(()=>Pe()))),S.scrollTop=ye+S.scrollHeight-V,Ae(S),de(S))}finally{W.current=!1,B.current=!1,w(!1)}},Qe=[],ze="",H=x.value.at(-1)?.id,j=[...b??[]].toSorted((S,V)=>(S.createdAt??1/0)-(V.createdAt??1/0)),X=S=>m&&S.formId===m.form.id?a(xa,{form:m.form,strings:t,onSubmit:m.onSubmit,onSkip:m.onSkip},`gate:${S.formId}`):a(ec,{marker:S,strings:t,onFill:!m&&v?()=>v(S.formId):void 0},S.key),me=S=>{for(let V=j[0];V?.createdAt!==void 0&&!(S!==void 0&&V.createdAt>S);V=j[0])j.shift(),Qe.push(X(V))};for(let S of x.value){if(S.role==="assistant"&&S.id!==H&&Gt(S))continue;me(S.createdAt);let V=nm(S.createdAt);V&&V!==ze&&(Qe.push(a("div",{class:`${Ot}-date-divider`,children:a("span",{class:`${Ot}-date-pill`,title:rm(S.createdAt),children:om(S.createdAt,t)})},`day:${V}`)),ze=V);let ie=S.retryAction!==void 0||S.role==="assistant"&&S.id===H?Hr(x.value,S):void 0,Pe=ie!==void 0&&(ie.kind!=="continue-assistant"||p==="ai-agent");Qe.push(a(Oc,{message:S,status:S.status,strings:t,responseMode:n,showReasoning:r,showToolCalls:o,showSources:i,interactive:!!_&&p==="ai-agent"&&S.id===H,superseded:S.id!==H,tool:d,onRetry:_&&Pe&&(S.role==="user"||S.id===H)?f:void 0,enableMessageFeedback:s,onFeedback:l},S.id))}for(let S of j)Qe.push(X(S));return a("div",{class:`${Ot}-list-wrap`,children:[a("div",{ref:P,class:`${Ot}-list ${Ot}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&x.value.length===0?a("div",{class:`${Ot}-list-loading`,role:"status",children:t.conversationLoading}):null,Ie?a("div",{class:`${Ot}-load-previous`,children:a("button",{type:"button",onClick:Je,disabled:k,"aria-busy":k,"data-testid":R.loadPreviousMessages,children:t.loadPreviousMessages})}):null,Qe,m&&!Te?a(xa,{form:m.form,strings:t,onSubmit:m.onSubmit,onSkip:m.onSkip}):null]}),h?a("button",{type:"button",class:`${Ot}-jump`,onClick:Ce,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":R.scrollToBottom,children:a(Yt,{})}):null]})}function nm(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function rm(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function om(e,t){let n=new Date(e),r=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),o=Math.round((r(new Date)-r(n))/864e5);return o<=0?t.dateToday:o===1?t.dateYesterday:o<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var am=["today","yesterday","lastWeek","older"];function im(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let r=Math.floor((Dc(e)-Dc(n))/(1440*60*1e3));return r<=0?"today":r===1?"yesterday":r<7?"lastWeek":"older"}function $c(e,t){let n=new Map;for(let r of t){let o=im(e,r.lastMessageAt),i=n.get(o);i?i.push(r):n.set(o,[r])}return am.filter(r=>n.has(r)).map(r=>({bucket:r,conversations:n.get(r)}))}function Dc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Fc=ee.scope("history"),sm=3,lm=6,cm={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function dm(e,t,n){let r=Date.parse(e);return Number.isFinite(r)?new Date(r).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(r):t-r<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(r):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(r):""}function _o({transport:e,strings:t,locale:n,persistence:r,visitorId:o,onSelect:i,onNewConversation:s}){let l=C.cssPrefix,c=e.peekConversations({visitorId:o}),[u,_]=D(c?"loaded":"loading"),[p,d]=D(c),[f,m]=D(!1),b=M(),v=p?.conversations??[],P=p?.pagination;E(()=>{let w=!1;b.current=void 0,m(!1);let B=e.peekConversations({visitorId:o});return d(B),_(B?"loaded":"loading"),e.listConversations({visitorId:o}).then(W=>{w||(d(W),_("loaded"),r.saveHistoryCount(W.conversations.length))}).catch(W=>{w||(Fc.warn("listConversations failed",{err:W}),_("error"))}),()=>{w=!0,b.current=void 0}},[e,o,r,n]);let x=async()=>{if(b.current||!P?.hasNext)return;let w={};b.current=w,m(!0);try{let B=await e.listConversations({visitorId:o,page:P.page+1,limit:P.limit});if(b.current!==w)return;let W=new Set(v.map(I=>I.conversationId)),U=[...v,...B.conversations.filter(I=>!W.has(I.conversationId))];d({conversations:U,pagination:B.pagination}),r.saveHistoryCount(U.length)}catch(B){if(b.current!==w)return;Fc.warn("listConversations page failed",{err:B,page:P.page+1})}finally{b.current===w&&(b.current=void 0,m(!1))}},h=s?a("div",{class:`${l}-history-footer`,children:a("button",{type:"button",class:`${l}-history-new`,onClick:s,"data-testid":R.sidebarNewConversation,children:[a(sl,{}),t.newConversation]})}):null;if(u==="loading"){let w=Math.min(r.loadHistoryCount()??sm,lm);return a(ce,{children:[a("div",{class:`${l}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:a("div",{class:`${l}-history-group`,"aria-hidden":"true",children:[a("div",{class:`${l}-history-heading`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-heading`})}),a("div",{class:`${l}-history-card`,children:Array.from({length:Math.max(1,w)},(B,W)=>a("div",{class:`${l}-history-item ${l}-history-item-skeleton`,children:[a("span",{class:`${l}-history-avatar ${l}-skeleton`}),a("span",{class:`${l}-history-body`,children:[a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-title`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-title`})}),a("span",{class:`${l}-history-time`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-time`})})]}),a("span",{class:`${l}-history-row`,children:a("span",{class:`${l}-history-preview`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-preview`})})})]})]},W))})]})}),h]})}if(u==="error"||v.length===0)return a(ce,{children:[a("div",{class:`${l}-history-empty`,children:t.historyEmpty}),h]});let y=Date.now(),k=$c(y,v);return a(ce,{children:[a("div",{class:`${l}-history`,role:"list",children:[k.map(w=>a("div",{class:`${l}-history-group`,children:[a("div",{class:`${l}-history-heading`,children:t[cm[w.bucket]]}),a("div",{class:`${l}-history-card`,children:w.conversations.map(B=>a("button",{type:"button",role:"listitem",class:`${l}-history-item`,onClick:()=>i(B),"data-closed":B.canContinue?void 0:"true","data-unread":B.hasUnread?"true":void 0,"data-testid":Ge(R.historyItem,B.conversationId),children:[a("span",{class:`${l}-history-avatar`,"aria-hidden":"true",children:a(ma,{})}),a("span",{class:`${l}-history-body`,children:[a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-title`,children:B.title}),a("span",{class:`${l}-history-time`,children:dm(B.lastMessageAt,y,n)})]}),a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-preview`,children:B.preview??(B.canContinue?t.historyContinue:t.conversationClosed)}),B.hasUnread?a("span",{class:`${l}-history-dot`}):null]})]})]},B.conversationId))})]},w.bucket)),P?.hasNext?a("div",{class:`${l}-history-more`,children:a("button",{type:"button",onClick:x,disabled:f,"aria-busy":f,"data-testid":R.historyLoadMore,children:t.loadMoreConversations})}):null]}),h]})}var Bc=C.cssPrefix;function Hc({suggestions:e,onPick:t,disabled:n=!1}){return e.length===0?null:a("div",{class:`${Bc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((r,o)=>a("button",{type:"button",class:`${Bc}-suggestion`,onClick:()=>t(r),disabled:n,"data-testid":Ge(R.suggestion,o),children:r.label},r.id))})}var je=C.cssPrefix;function Uc(e){let{options:t,onClose:n}=e,r=t.strings,o=M(null);E(()=>{let u=o.current;if(!u)return;let _=Yr(u),p=d=>{d.key==="Escape"&&n?.()};return u.addEventListener("keydown",p),()=>{_(),u.removeEventListener("keydown",p)}},[n]);let i=e.composerApiRef,s=e.composerActive&&e.view==="chat"&&e.canSend&&!e.activeForm&&!e.sendPreparing&&e.options.features.fileUpload,l=O(u=>{s&&i.current?.attachFromDrop(u)},[i,s]),{visible:c}=eo({containerRef:o,onDrop:l,disabled:!s});return jr(o.current,t.mode==="modal"),a("div",{ref:o,class:`${je}-panel`,role:"dialog","aria-modal":"false","aria-label":r.panelTitle,style:{position:"relative"},"data-testid":R.panel,children:[a(Fa,{...e,containerEl:o.current,dragOver:c,composerAttachApiRef:i}),a(Ba,{poweredBy:e.options.poweredBy})]})}function Fa(e){let{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,composerKey:l,panelSize:c,view:u,canSend:_,isStreaming:p,sendPreparing:d,controlMode:f,assignedOperatorInitials:m,operatorAvailable:b,operatorRequestEnabled:v,onRequestOperator:P,onCancelOperatorRequest:x,loadingMessages:h,onLoadPreviousMessages:y,messagesSig:k,agent:w,suggestions:B,initialWidgetSize:W,visitorId:U,onClose:I,onBack:z,onClear:q,onToggleHistory:L,onSelectHistoryConversation:ne,onNewConversation:oe,onWidgetSizeChange:le,onSend:Ae,onStop:de,onSuggestion:_e,activeForm:Me,formMarkers:N,onFormSubmit:ve,onFormSkip:ae,onFormFill:De,tool:xe,onRetry:Te,onMessageFeedback:Ce,containerEl:Le,dragOver:he,composerAttachApiRef:Se}=e,Ie=t.strings,Je=ut(()=>k.value.some(ze=>!ze.ephemeral&&ze.role!=="system")).value,Qe;return Me?Qe=null:_?Qe=a(ce,{children:[f&&f!=="ai-agent"?a(pm,{controlMode:f,operatorInitials:m,operatorAvailable:b,onCancelOperatorRequest:x,strings:Ie}):null,!p&&f==="ai-agent"&&a(Hc,{suggestions:B,onPick:_e,disabled:d}),a(jl,{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,isStreaming:p,active:e.composerActive&&u==="chat",isPreparing:d,operatorRequestEnabled:v,canRequestOperator:Je,controlMode:f,onRequestOperator:P,onSend:Ae,onStop:de,attachApiRef:Se},l)]}):Qe=a(_m,{label:Ie.conversationClosed,ctaLabel:Ie.startNewConversation,onNewConversation:q}),a(ce,{children:[u==="history"?a(um,{strings:Ie,onBack:L,onClose:I,showClose:Xr(t.mode,c,t.actions)}):a("header",{class:`${je}-header`,"data-testid":R.panelHeader,children:[z?a("button",{type:"button",class:`${je}-icon-btn`,onClick:z,"aria-label":Ie.moduleBack,title:Ie.moduleBack,children:a(qn,{})}):null,w?a(Vl,{agent:w,strings:Ie}):a("h1",{children:Ie.panelTitle}),a(mt,{panelProps:e,variant:"chat"})]}),u==="history"?a(_o,{transport:n,strings:Ie,locale:t.locale,persistence:i,visitorId:U,onSelect:ze=>ne(ze.conversationId),onNewConversation:oe}):a(ce,{children:[a(Xl,{visible:he,strings:Ie}),a(Nc,{messagesSig:k,strings:Ie,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Ce,loading:h,onLoadPreviousMessages:y,idle:!p&&!d&&_&&!Me,controlMode:f,tool:xe,onRetry:Te,form:Me?{form:Me,onSubmit:ve,onSkip:ae}:null,formMarkers:N,onFillForm:De}),Qe,a(mm,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?a(Kr,{panelEl:Le,resize:t.size.resize,position:t.position,initialSize:W,onSizeChange:le,strings:Ie}):null]})}function um({strings:e,onBack:t,onClose:n,showClose:r}){return a("header",{class:`${je}-header`,children:[a("button",{type:"button",class:`${je}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(qn,{})}),a("h1",{children:e.historyTitle}),r?a("button",{type:"button",class:`${je}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(ft,{})}):null]})}function _m({label:e,ctaLabel:t,onNewConversation:n}){return a("div",{class:`${je}-readonly-banner`,role:"note",children:[a("span",{class:`${je}-readonly-label`,children:e}),a("button",{type:"button",class:`${je}-readonly-cta`,onClick:n,children:t})]})}function pm({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelOperatorRequest:r,strings:o}){let i=fm(e,t,n,o);return a("div",{class:`${je}-operator-banner`,role:"status","data-mode":e,"data-testid":R.operatorBanner,children:[a("span",{class:`${je}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${je}-operator-label`,children:i}),e==="awaiting_operator"&&r?a("button",{type:"button",class:`${je}-cancel-operator-request`,"data-testid":R.cancelOperatorRequest,onClick:r,children:o.cancelOperatorRequest}):null]})}function fm(e,t,n,r){return e==="operator"?r.chattingWithOperator.replace("{operator}",t??""):n===!1?r.noOperatorAvailable:r.connectingOperator}function mm({disclaimer:e}){return e?a("div",{class:`${je}-composer-footer`,children:a("div",{class:`${je}-disclaimer`,children:e})}):null}function Ba({poweredBy:e}){return e?a("div",{class:`${je}-poweredby-bar`,children:a(gm,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function gm({logoUrl:e,text:t,href:n}){let r=a(ce,{children:[e?a("img",{class:`${je}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${je}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:r}):a("span",{class:`${je}-poweredby`,children:r})}function zc(e){let t=M(e);t.current=e;let n=M(null);return n.current??(n.current=vm(t)),n.current}function vm(e){let t=J(null),n=new Set,r=c=>`${e.current.conversationId()??""}:${c}`,o=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(r(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,u)=>{if(t.value)return;let _=e.current;if(c==="manual"){let p=_.forms.list.find(d=>d.id===u);p&&(t.value={form:p,trigger:"manual"});return}for(let p of _.forms.byTrigger[c]??[]){let d=p.triggers.find(f=>f.kind===c);if(!(!d||!hm(d,_)||o(p)||!bm(p,_))){t.value={form:p,trigger:c};return}}},s=(c,u)=>{let _=t.value;if(!_)return;t.value=null;let{form:p,trigger:d}=_;p.frequency==="conversation"?n.add(r(p.id)):p.frequency!=="always"&&e.current.persistence.saveFormDone(p.id),e.current.onComplete(p,d,c,u)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let u=e.current.forms.list.find(_=>_.id===c.form.id);u&&u!==c.form&&(t.value={form:u,trigger:c.trigger})},complete:c=>s(c,!1),skip:()=>s({},!0)}}function hm(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function bm(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let o=t.userContext()??{};if(n.missingContext.some(i=>o[i]!==void 0&&o[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let r=t.messageCount();return!(n.minMessages!=null&&r<n.minMessages||n.maxMessages!=null&&r>n.maxMessages)}function qc(e){let t=C.cssPrefix,{site:n,blocks:r,strings:o,collapsed:i}=e,s=r?.navigation??[],l=r?.linkCards??[],c=i?o.expandSidebar:o.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":R.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(ym,{site:n}),a("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":R.sidebarToggle,children:a(Pm,{collapsed:i})})]}),i?null:a(ce,{children:[s.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(xm,{items:s})}):null,l.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(Sm,{items:l})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(_o,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function ym({site:e}){let t=C.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return a("picture",{children:[e.logoDark?.url?a("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,a("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return a("div",{class:`${t}-sidebar-title`,children:e?.title??C.name})}function Pm({collapsed:e}){return a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?a("polyline",{points:"9 6 15 12 9 18"}):a("polyline",{points:"15 6 9 12 15 18"})})}function xm({items:e}){let t=C.cssPrefix;return a("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>a("li",{children:a("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?a("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,a("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function Sm({items:e}){let t=C.cssPrefix;return a("div",{class:`${t}-sidebar-cards`,children:e.map(n=>a("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[a("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?a("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var Vc=C.cssPrefix;function Wc(e){return a("main",{class:`${Vc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a(qc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),a("section",{class:`${Vc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Gc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Ha(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}function Kc(e,t,n){let r=[...new Set(t)],o=Ha(r,e,""),i=J({activeTab:o,stacks:Gc(r)});return{sig:i,reconcile(s,l){let c=[...new Set(s)],u=i.value,_=Ha(c,u.activeTab,l),p=Object.fromEntries(c.map(f=>[f,u.stacks[f]??[]])),d=_===u.activeTab&&c.length===Object.keys(u.stacks).length&&c.every(f=>u.stacks[f]===p[f]);r=c,!d&&(i.value={activeTab:_,stacks:p},_!==u.activeTab&&_&&n?.(_))},switchTab(s){!(s in i.value.stacks)||i.value.activeTab===s||(i.value={...i.value,activeTab:s},n?.(s))},push(s){let l=i.value,c=l.stacks[l.activeTab]??[];i.value={...l,stacks:{...l.stacks,[l.activeTab]:[...c,s]}}},pop(){let s=i.value,l=s.stacks[s.activeTab]??[];l.length!==0&&(i.value={...s,stacks:{...s.stacks,[s.activeTab]:l.slice(0,-1)}})},reset(s){i.value={activeTab:Ha(r,s,""),stacks:Gc(r)}}}}var jc=e=>e.stacks[e.activeTab]??[],Xc=e=>jc(e).at(-1),Yc=e=>jc(e).length===0;var Jc={Icon:Wn};var Nt=C.cssPrefix;function po({title:e,actions:t}){return a("header",{class:`${Nt}-back-header`,"data-variant":"title",children:[a("span",{class:`${Nt}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${Nt}-back-title`,children:e}),t??a("span",{class:`${Nt}-back-spacer`,"aria-hidden":"true"})]})}function fo({title:e,backLabel:t,onBack:n,actions:r,testid:o}){return a("header",{class:`${Nt}-back-header`,"data-testid":o,children:[a("button",{type:"button",class:`${Nt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(qn,{})}),a("h1",{class:`${Nt}-back-title`,children:e}),r??a("span",{class:`${Nt}-back-spacer`,"aria-hidden":"true"})]})}function Zt(e,t){return e instanceof We&&e.status===429?t.errorRateLimited:t.errorGeneric}var Pn=C.cssPrefix;function Qc({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${Pn}-home-search`,onClick:t,"data-testid":R.homeSearch,children:[a("span",{class:`${Pn}-home-search-text`,children:e}),a("span",{class:`${Pn}-home-search-icon`,"aria-hidden":"true",children:a(va,{})})]})}function Zc({placeholder:e,value:t,onInput:n}){return a("div",{class:`${Pn}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${Pn}-home-search-input`,placeholder:e,value:t,onInput:r=>n(r.currentTarget.value),"data-testid":R.helpSearch}),a("span",{class:`${Pn}-home-search-icon`,"aria-hidden":"true",children:a(va,{})})]})}var Xn=C.cssPrefix;function mo({title:e,subtitle:t,onClick:n,testid:r}){return a("button",{type:"button",class:`${Xn}-list-row`,onClick:n,"data-testid":r,children:[a("span",{class:`${Xn}-list-row-body`,children:[a("span",{class:`${Xn}-list-row-title`,children:e}),t?a("span",{class:`${Xn}-list-row-sub`,children:t}):null]}),a("span",{class:`${Xn}-list-row-chevron`,"aria-hidden":"true",children:a(gn,{})})]})}var ed=C.cssPrefix;function lt({tone:e="info",message:t,onRetry:n,strings:r}){return a("div",{class:`${ed}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${ed}-module-retry`,onClick:n,children:r.errorRetry}):null]})}var en=C.cssPrefix,km=ee.scope("help"),wm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Cm(e){let t=new Map;for(let n of e){let r=n.categories?.[0]??"";(t.get(r)??t.set(r,[]).get(r)).push(n)}return[...t.entries()]}function td(e,t){let n=t.toLowerCase(),r=n.indexOf(e);if(r!==-1)return 100-Math.min(r,99);let o=0;for(let i of e){if(o=n.indexOf(i,o),o===-1)return 0;o+=1}return 1}function Rm(e,t){let n=t.toLowerCase().trim();return n?e.map(r=>({item:r,score:Math.max(td(n,r.title)*2,td(n,r.description??""))})).filter(r=>r.score>0).toSorted((r,o)=>o.score-r.score).map(r=>r.item):[]}function nd({article:e,nav:t}){return a(mo,{title:e.title,subtitle:e.description,onClick:()=>wm(t,e),testid:Ge(R.helpArticle,e.id)})}function Tm({transport:e,strings:t,config:n,nav:r,bus:o,panelProps:i}){let s=n.contentTags,[l,c]=D("loading"),[u,_]=D(t.errorGeneric),[p,d]=D([]),[f,m]=D(""),[b,v]=D(0);E(()=>{let h=!1;return c("loading"),e.listContent({tags:s,sortBy:"order",limit:100}).then(y=>{if(h)return;let k=y.items??[];d(k),c("loaded"),o.emit("contentView",{section:"help",tags:s?.join(","),count:k.length})}).catch(y=>{h||(km.warn("listContent (help) failed",{err:y}),_(Zt(y,t)),c("error"))}),()=>{h=!0}},[e,s,b,o]);let P=Z(()=>Rm(p,f),[p,f]);E(()=>{let h=f.trim();if(!h)return;let y=setTimeout(()=>o.emit("contentSearch",{queryLength:h.length,hitCount:P.length}),600);return()=>clearTimeout(y)},[f,P,o]);function x(){return f.trim().length>0?P.length===0?a(lt,{message:t.helpSearchEmpty,strings:t}):a("div",{class:`${en}-help-card`,children:P.map(h=>a(nd,{article:h,nav:r},h.id))}):l==="loading"?a(lt,{message:t.helpLoading,strings:t}):l==="error"?a(lt,{tone:"error",message:u,onRetry:()=>v(h=>h+1),strings:t}):p.length===0?a(lt,{message:t.helpEmpty,strings:t}):Cm(p).map(([h,y])=>a("section",{class:`${en}-help-group`,children:[h?a("h2",{class:`${en}-help-section-title`,children:h}):null,a("div",{class:`${en}-help-card`,children:y.map(k=>a(nd,{article:k,nav:r},k.id))})]},h))}return a("div",{class:`${en}-module`,children:[a(po,{title:t.helpTitle,actions:a(mt,{panelProps:i,variant:"plain"})}),a("div",{class:`${en}-module-pad`,children:a(Zc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),a("div",{class:`${en}-help-list`,children:x()})]})}var rd={Icon:Vn,Root:e=>a(Tm,{...e})};var od=C.cssPrefix;function Ua({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${od}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${od}-home-card`,"data-testid":n,children:t})}var we=C.cssPrefix,ad=ee.scope("home");function Im(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ze(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var Em=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Am(e){let{transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s}=e,[l,c]=D(null),[u,_]=D([]),p=r.contentTags?.join(","),d=e.options.modules.list.some(x=>x.layout==="chat");E(()=>{if(r.showRecentConversations===!1)return;let x=!1;return t.listConversations({limit:d?50:1}).then(h=>!x&&c(h.conversations?.[0]??null)).catch(h=>!x&&ad.warn("listConversations (home) failed",{err:h})),()=>{x=!0}},[t,r.showRecentConversations,d]),E(()=>{if(!r.contentTags?.length)return;let x=!1;return t.listContent({tags:r.contentTags,limit:6}).then(h=>{if(x)return;let y=h.items??[];_(y),i.emit("contentView",{section:"home",tags:p,count:y.length})}).catch(h=>!x&&ad.warn("listContent (home) failed",{err:h})),()=>{x=!0}},[t,p,i]);let f=Im(e),m=r.userAvatars??[],b=r.status,v=b?.text?Ze(n,b.text):n.homeStatus,P=r.contentBlockTitle?Ze(n,r.contentBlockTitle):n.homeContentTitle;return a("div",{class:`${we}-module ${we}-home`,"data-testid":R.homeView,children:a("div",{class:`${we}-home-scroll`,children:[a("div",{class:`${we}-home-hero`,children:[a("div",{class:`${we}-home-hero-top`,children:[r.brandName?a("span",{class:`${we}-home-brand`,"data-testid":R.homeBrand,children:r.brandName}):a("span",{class:`${we}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${we}-home-hero-actions`,children:[m.length>0?a("div",{class:`${we}-home-avatars`,children:m.map(x=>a("span",{class:`${we}-home-avatar`,title:x.role?`${x.name} \xB7 ${x.role}`:x.name,children:x.avatar?a("img",{src:x.avatar,alt:"",loading:"lazy"}):a("span",{children:Jr(x.name)})},x.name))}):null,a(mt,{panelProps:s,variant:"plain"})]})]}),r.showGreeting!==!1?a(ce,{children:[a("h1",{class:`${we}-home-greeting`,"data-testid":R.homeGreeting,children:f.title}),f.subtitle?a("p",{class:`${we}-home-lead`,children:f.subtitle}):null]}):null]}),a("div",{class:`${we}-home-cards`,children:[r.showSearchBar!==!1?a(Qc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,l?a(Ua,{onClick:()=>o.selectConversation(l.conversationId),testid:R.homeRecent,children:a("div",{class:`${we}-home-recent-row`,"data-unread":l.hasUnread?"true":void 0,children:[a("span",{class:`${we}-home-recent-avatar`,"aria-hidden":"true",children:a(Wn,{})}),a("span",{class:`${we}-home-recent-body`,children:[a("span",{class:`${we}-home-recent-title`,children:l.title}),l.preview?a("span",{class:`${we}-home-recent-preview`,children:l.preview}):null]}),l.hasUnread?a("span",{class:`${we}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,b?a(Ua,{onClick:b.url?()=>o.push({kind:"iframe",url:b.url,title:v}):void 0,children:a("div",{class:`${we}-home-status`,"data-level":b.level??"operational",children:[a("span",{class:`${we}-home-status-icon`,"aria-hidden":"true",children:a(Tl,{})}),a("span",{class:`${we}-home-status-text`,children:v})]})}):null,u.length>0?a("section",{class:`${we}-home-content`,children:[a("div",{class:`${we}-home-content-title`,children:P}),a("div",{class:`${we}-home-content-list`,children:u.map(x=>a(mo,{title:x.title,subtitle:x.description,onClick:()=>Em(o,x),testid:Ge(R.homeContentRow,x.id)},x.id))})]}):null]})]})})}var id={Icon:Il,Root:e=>a(Am,{...e})};var Dt=C.cssPrefix,Mm=ee.scope("news");function Lm({transport:e,strings:t,config:n,nav:r,bus:o,panelProps:i}){let s=n.contentTags,[l,c]=D("loading"),[u,_]=D(t.errorGeneric),[p,d]=D([]),[f,m]=D(0);E(()=>{let v=!1;return c("loading"),e.listContent({tags:s,sortBy:"publishedAt",sortOrder:"desc"}).then(P=>{if(v)return;let x=P.items??[];d(x),c("loaded"),o.emit("contentView",{section:"news",tags:s?.join(","),count:x.length})}).catch(P=>{v||(Mm.warn("listContent (news) failed",{err:P}),_(Zt(P,t)),c("error"))}),()=>{v=!0}},[e,s,f,o]);function b(){return l==="loading"?a(lt,{message:t.newsLoading,strings:t}):l==="error"?a(lt,{tone:"error",message:u,onRetry:()=>m(v=>v+1),strings:t}):p.length===0?a(lt,{message:t.newsEmpty,strings:t}):a("div",{class:`${Dt}-news-list`,children:p.map(v=>a("button",{type:"button",class:`${Dt}-news-card`,onClick:()=>r.push({kind:"content",id:v.id,title:v.title}),"data-testid":Ge(R.newsItem,v.id),children:[v.image?a("img",{class:`${Dt}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,a("span",{class:`${Dt}-news-body`,children:[a("span",{class:`${Dt}-news-title`,children:v.title}),v.description?a("span",{class:`${Dt}-news-summary`,children:v.description}):null]})]},v.id))})}return a("div",{class:`${Dt}-module`,children:[a(po,{title:t.newsTitle,actions:a(mt,{panelProps:i,variant:"plain"})}),a("div",{class:`${Dt}-module-scroll`,children:b()})]})}var sd={Icon:El,Root:e=>a(Lm,{...e})};var go={chat:Jc,home:id,help:rd,news:sd};var Yn=C.cssPrefix;function ld({modules:e,activeTab:t,strings:n,hasUnread:r,onSelect:o}){return a("nav",{class:`${Yn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let s=go[i.layout].Icon,l=i.id===t,c=i.layout==="chat"&&r;return a("button",{type:"button",role:"tab","aria-selected":l,class:`${Yn}-tab`,onClick:()=>o(i.id),"data-testid":Ge(R.tab,i.id),children:[a("span",{class:`${Yn}-tab-icon`,"aria-hidden":"true",children:[a(s,{}),c?a("span",{class:`${Yn}-tab-badge`,"data-testid":R.tabBadge,"aria-label":"Unread"}):null]}),a("span",{class:`${Yn}-tab-label`,children:Ze(n,i.label)})]},i.id)})})}var cd=C.cssPrefix,Om="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function dd({url:e,title:t,strings:n,onBack:r,actions:o}){return a("div",{class:`${cd}-module`,children:[a(fo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:r,actions:o}),a("iframe",{class:`${cd}-content-frame`,src:e,title:t||"content",sandbox:Om,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Jn=C.cssPrefix,Nm=ee.scope("content"),Dm=5e3;function ud({id:e,title:t,transport:n,strings:r,bus:o,onBack:i,actions:s}){let[l,c]=D(null),[u,_]=D(!1),[p,d]=D(0),f=O(()=>{_(!1),c(null),d(v=>v+1)},[]);E(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(P=>{if(v)return;let x=P.items[0];x?(c(x),o.emit("contentOpen",{contentId:e,tags:x.tags?.length?x.tags.join(","):void 0})):_(!0)}).catch(P=>{v||(Nm.warn("listContent (reader) failed",{err:P}),_(!0))}),()=>{v=!0}},[n,e,p,o]),E(()=>{if(!l)return;let v=setTimeout(()=>o.emit("contentRead",{contentId:e}),Dm);return()=>clearTimeout(v)},[l,e,o]);let m=O(v=>{let x=v.target?.closest?.("a")?.getAttribute("href")??"";x&&!x.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function b(){return u?a(lt,{tone:"error",message:r.errorGeneric,onRetry:f,strings:r}):l===null?a(lt,{message:r.contentLoading,strings:r}):a("article",{class:`${Jn}-content`,"data-testid":R.contentView,onClick:m,children:[l.image?a("img",{class:`${Jn}-content-hero`,src:l.image,alt:"",loading:"lazy"}):null,l.description?a("p",{class:`${Jn}-content-subtitle`,children:l.description}):null,a(wc,{text:l.content??""})]})}return a("div",{class:`${Jn}-module`,children:[a(fo,{title:l?.title||t||r.moduleBack,backLabel:r.moduleBack,onBack:i,actions:s,testid:R.backHeader}),a("div",{class:`${Jn}-module-scroll`,"data-testid":R.contentScroll,children:b()})]})}var vo=C.cssPrefix;function _d({panelProps:e,enabledModules:t,nav:n,bus:r,hasUnread:o,onSelectConversation:i,onStartNewConversation:s,onSetPanelSize:l}){let c=e.options,u=c.strings,_=M(null),p=M(new Set);E(()=>{let L=_.current;if(!L)return;let ne=Yr(L),oe=le=>{le.key==="Escape"&&e.onClose?.()};return L.addEventListener("keydown",oe),()=>{ne(),L.removeEventListener("keydown",oe)}},[e.onClose]);let d=ut(()=>n.sig.value).value,f=Xc(d),m=c.modules.byId[d.activeTab],b=e.composerActive&&m?.layout==="chat"&&f===void 0,v=e.composerApiRef,P=b&&e.view==="chat"&&e.canSend&&!e.activeForm&&!e.sendPreparing&&e.options.features.fileUpload,x=O(L=>{P&&v.current?.attachFromDrop(L)},[v,P]),{visible:h}=eo({containerRef:_,onDrop:x,disabled:!P});jr(_.current,c.mode==="modal");let y=f?.kind==="iframe"||f?.kind==="content",k=t.length>1&&(Yc(d)||!y),w=M(null);E(()=>{if(y&&w.current===null)w.current=e.panelSize,e.panelSize==="normal"&&l("expanded");else if(!y&&w.current!==null){let L=w.current;w.current=null,l(L)}},[y]);let B={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:L=>{let ne=t.find(oe=>oe.layout===L);ne&&n.switchTab(ne.id)},selectConversation:i,startNewConversation:s},W=L=>({options:c,transport:e.transport,strings:u,config:L,visitorId:e.visitorId,nav:B,bus:r,panelProps:e}),U=a(mt,{panelProps:e,variant:"plain"});m&&p.current.add(m.id);let I=t.filter(L=>p.current.has(L.id)),z=L=>{if(L.layout==="chat")return a(Fa,{...e,composerActive:b,containerEl:_.current,dragOver:h,composerAttachApiRef:v});let ne=go[L.layout].Root;return ne?a(ne,{...W(L)}):null},q=()=>f?.kind==="iframe"?a(dd,{url:f.url,title:f.title,strings:u,onBack:n.pop,actions:U}):f?.kind==="content"?a(ud,{id:f.id,title:f.title,transport:e.transport,strings:u,bus:r,onBack:n.pop,actions:U}):null;return a("div",{ref:_,class:`${vo}-panel ${vo}-messenger`,role:"dialog","aria-modal":"false","aria-label":u.panelTitle,style:{position:"relative"},"data-testid":R.messengerHome,children:[a("div",{class:`${vo}-messenger-body`,children:[I.map(L=>a("div",{class:`${vo}-messenger-pane`,hidden:y||L.id!==m?.id,children:z(L)},L.id)),q()]}),k?a(ld,{modules:t,activeTab:d.activeTab,strings:u,hasUnread:o,onSelect:n.switchTab}):null,a(Ba,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(m?.layout==="chat"&&!f)?a(Kr,{panelEl:_.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:u}):null]})}var Qn=C.cssPrefix;function pd({strings:e,onClose:t}){return a("div",{class:`${Qn}-panel ${Qn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":R.modulesEmpty,children:[t?a("button",{type:"button",class:`${Qn}-icon-btn ${Qn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:a(ft,{})}):null,a("p",{class:`${Qn}-modules-empty-text`,children:e.modulesEmpty})]})}function xn(e,t,n,r){let o={role:n,text:r};e.emit("message",o),t.onMessage?.(o)}var za=ee.scope("hitl");function fd(e){let{streaming:t,controlModeSig:n,messagesSig:r,sendAiTurn:o,bus:i,humanInLoop:s}=e,l=M(t);l.current=t;let c=O((d,f,m)=>{if(l.current||n.value!=="ai-agent")return!1;let b=r.value.at(-1),v=b?.partsSig.value.findIndex(x=>x.kind==="tool"&&x.toolCallId===d)??-1,P=b?.partsSig.value[v];return!b||P?.kind!=="tool"?(za.warn("decideTool: tool part not found",{toolCallId:d}),!1):b.status!=="complete"||!$r(b,v)||!f(P)?!1:(m(P),b.partsSig.value=[...b.partsSig.value],Kt(b)&&(b.status="streaming",b.retryAction={kind:"continue-assistant",messageId:b.serverMessageId??b.id},b.awaitingContinuation=!0,r.value=[...r.value],o({continueExisting:!0})),!0)},[n,r,o]),u=O((d,f,m)=>{let b=!1;if(c(d,P=>P.stateSig.value==="approval-requested",P=>{b=ro(P.toolName);let x=P.approvalSig.value?.id??d;P.approvalSig.value={id:x,approved:f,reason:m},P.stateSig.value="approval-responded"})){if(b){za.info("toolResult",{toolCallId:d}),i.emit("toolResult",{toolCallId:d});return}za.info("toolDecision",{toolCallId:d,approved:f}),i.emit("toolDecision",{toolCallId:d,approved:f})}},[i,c]),_=O(d=>{c(d,f=>f.stateSig.value==="approval-responded"&&f.approvalSig.value?.approved!==void 0,f=>{let m=f.approvalSig.value?.id??d;f.approvalSig.value={id:m},f.stateSig.value="approval-requested"})},[c]);return{toolInteraction:Z(()=>({humanInLoop:s,onDecision:u,onEdit:_}),[s,u,_])}}function md({callout:e,persistence:t}){let n=e?.text??"",r=e?.persistent??!0,[o,i]=D(()=>r?!1:t.loadCalloutDismissed(n));E(()=>{i(r?!1:t.loadCalloutDismissed(n))},[n,r,t]);let s=O(()=>{i(!0),r||t.saveCalloutDismissed(n)},[t,n,r]);return{dismissed:o,dismissCallout:s}}function gd(e){let{transport:t,conversationIdSig:n}=e,r=dt("ai-agent"),o=dt(void 0),i=dt(void 0),s=M(),l=O(p=>{let d=p.controlRevision??0,f=s.current;f&&f.conversationId===n.value&&d<f.revision||(s.current={conversationId:n.value,revision:d},r.value=p.controlMode,o.value=p.assignedOperatorInitials,p.controlMode!=="awaiting_operator"?i.value=void 0:p.operatorAvailable!==void 0&&(i.value=p.operatorAvailable))},[n,r,o,i]),c=O(p=>{p.type==="data-control-state"&&l(Et(p.data))},[l]),u=O(async()=>{let p=n.value,d=await t.requestOperator();d&&n.value===p&&l(Et(d))},[t,n,l]),_=O(async()=>{let p=n.value,d=await t.cancelOperatorRequest();d&&n.value===p&&l(Et(d))},[t,n,l]);return{controlModeSig:r,assignedOperatorInitialsSig:o,operatorAvailableSig:i,applyControlState:l,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:_}}function vd(e){let{hostElement:t,mode:n,panelSize:r,isOpen:o,setIsOpen:i}=e;pt(()=>{yr(t,Er(n,r,o))},[t,o,r,n]),E(()=>{if(n!=="modal"||!o)return;let s=l=>{l.composedPath().some(u=>u instanceof HTMLElement&&u.classList.contains(`${C.cssPrefix}-panel`))||i(!1)};return t.addEventListener("click",s),()=>t.removeEventListener("click",s)},[t,o,n,i]),E(()=>{if(n!=="drawer"||!o)return;let s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[o,n,i])}var qa=ee.scope("reducer"),ho=class{constructor(t,n){te(this,"messagesSig",t);te(this,"onReconcileNeeded",n);te(this,"active",null);te(this,"openTextParts",new Map);te(this,"partSeq",0);te(this,"replay",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,n){let r=Ct();r.id=t.id;let o=tn(t)||jt(t)&&(t.status!=="streaming"||Kt(t)),i=t.status==="streaming"&&Kt(t)&&Hn(t);this.replay={baseline:t,shadow:r,chunks:[n],probeContinuation:o,continuationTailReplay:i,liveCatchUp:t.status==="streaming"&&!o},this.attach(r),this.apply(n)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let n=t.shadow.serverMessageId??t.baseline.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t.baseline||o?.id===t.baseline.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t.baseline)??r.find(l=>l.id===t.baseline.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t.baseline)return t;let s=t.baseline;return t.baseline=i,hd(s,i),t.liveCatchUp&&tn(t.shadow)&&(i.status==="streaming"||jt(i))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=tn(i)||jt(i)&&(i.status!=="streaming"||Kt(i)),t.continuationTailReplay=i.status==="streaming"&&Kt(i)&&Hn(i),t.liveCatchUp=i.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let n=t.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t||o?.id===t.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t)??r.find(l=>l.id===t.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t)return t;hd(t,i);let s=tn(t)&&jt(i);return i.status!=="streaming"&&!s?(this.detach(),null):(this.replay={baseline:i,shadow:t,chunks:[],probeContinuation:!1,continuationTailReplay:!1,liveCatchUp:!0},t)}promoteReplay(){let{baseline:t,shadow:n}=this.replay;return it(()=>{t.role=n.role,t.serverMessageId=n.serverMessageId,t.operatorInitials=n.operatorInitials,t.status=n.status,n.canceled&&(t.canceled=!0),t.finishReason=n.finishReason,t.errorText=n.errorText,t.suggestions=n.suggestions??t.suggestions,t.partsSig.value=n.partsSig.value,this.messagesSig.value=[...this.messagesSig.value]}),this.replay=null,this.active=t,t}promoteContinuation(t=!1){let{baseline:n,chunks:r}=this.replay,o=Fr(n);return this.replay=null,it(()=>{if(t){let i=n.partsSig.value.findLastIndex(s=>s.kind==="tool");n.partsSig.value=n.partsSig.value.slice(0,i+1)}n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n);for(let i of r)this.apply(i);n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}settleOwnedContinuation(t){let{baseline:n}=this.replay,r=Fr(n);return this.replay=null,it(()=>{n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n),this.apply(t),n.continuationStreaming=r||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}applyResume(t){if(t.type==="start"){let o=(this.replay?.baseline??this.active)?.serverMessageId;o!==void 0&&t.messageId!==void 0&&o!==t.messageId&&this.onReconcileNeeded?.({messageId:o}),this.detach();let i=t.messageId,s=i!==void 0?this.messagesSig.value.find(_=>_.serverMessageId===i||_.id===i):void 0;if(s!==void 0)return t.messageMetadata?.senderRole==="visitor"&&s.role==="user"&&(s.status==="pending"||s.status==="error")&&(s.serverMessageId=i,s.status="complete",s.errorText=void 0,s.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(s,t),null;let l=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(l===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!Mt(c))return this.attach(c),this.apply(t),null;let u=Ct();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let r=this.refreshReplayBaseline();if(!r)return null;r.chunks.push(t),t.type==="data-control-state"&&(r.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:i,probeContinuation:s,continuationTailReplay:l,liveCatchUp:c}=r,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(s){if(!Bm(o,i,t))return u&&(qm(o,i)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id})),this.detach()),null;let p=tn(o)&&u?this.settleOwnedContinuation(t):this.promoteContinuation();return u?(p.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:p.serverMessageId??p.id}):p.continuationStreaming=!1),this.detach(),p):null}if(l&&Fm(o,i)){let p=this.promoteContinuation(!0);return u?(this.detach(),p):null}if(!c)return u&&this.detach(),null;if(u&&!Mt(o)&&Mt(i)){let p=this.promoteReplay();return this.detach(),p}if(!$m(o,i))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}),this.detach()),null;let _=this.promoteReplay();return u?(this.detach(),_):null}let n=this.refreshActive();if(!n)return null;if(this.replay)return this.applyResume(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let r=n;return r.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:r.serverMessageId??r.id}):r.continuationStreaming=!1),this.detach(),r}return null}ensureTextPart(t,n,r){let o=`${n}:${r}`,i=this.openTextParts.get(o);if(i)return i;let s={kind:n,id:`${r}#${this.partSeq++}`,textSig:J(""),doneSig:J(!1)};return this.openTextParts.set(o,s),Zn(t,s),s}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let r=t.messageMetadata;r?.senderRole==="operator"?(n.role="operator",r.operatorInitials&&(n.operatorInitials=r.operatorInitials)):r?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":Zn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":qa.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",n.retryAction=void 0,t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":qa.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"abort":qa.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,n.retryAction=void 0,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let r=this.ensureTextPart(n,"text",t.id);r.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let r=this.ensureTextPart(n,"reasoning",t.id);r.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-input-error":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":Vm(n,t);return;case"file":Zn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":bd(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":bd(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":n.suggestions=Lr(t.data);return;case"data-control-state":n.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;default:{let r=t}}}bumpDone(t){it(()=>{t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])})}},Va={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function tn(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function hd(e,t){e.canceled&&(t.canceled=!0),!(!tn(e)||t.status!=="streaming"&&!jt(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function $m(e,t){let n=e.partsSig.value,r=t.partsSig.value;return e.role!==t.role||r.length<n.length?!1:n.every((o,i)=>yd(o,r[i]))}function Fm(e,t){let n=e.partsSig.value,r=n.findLastIndex(l=>l.kind==="tool"),o=new Set(n.slice(0,r+1).flatMap(l=>l.kind==="tool"?[l.toolCallId]:[])),i=t.partsSig.value.filter(l=>l.kind!=="tool"||!o.has(l.toolCallId)),s=n.slice(r+1);return i.length<s.length?!1:s.every((l,c)=>yd(l,i[c]))}function yd(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||!Br(t.toolName,e.toolName)||Va[t.stateSig.value]<Va[e.stateSig.value])return!1;let n=e.approvalSig.value?.approved;return n===void 0||t.approvalSig.value?.approved===n}case"file":return t?.kind==="file"&&t.url===e.url&&t.mediaType===e.mediaType;case"source":return t?.kind==="source"&&t.sourceId===e.sourceId&&t.url===e.url&&t.title===e.title&&t.filename===e.filename&&t.mediaType===e.mediaType;default:return e}}function Bm(e,t,n){return Hm(e,n)||!Um(e,t)?!0:n.type!=="finish"&&n.type!=="error"&&n.type!=="abort"?!1:Hn(t)||e.awaitingContinuation===!0&&n.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(r=>r.kind==="step-start")}function Hm(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId);return n!==void 0&&Va[n.stateSig.value]<4}function Um(e,t){let n=t.partsSig.value;if(n.length===0)return!0;let r=e.partsSig.value;return r.some((o,i)=>n.every((s,l)=>zm(r[i+l],s)))}function zm(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"||Br(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 qm(e,t){if(tn(e)||!jt(e))return!1;let n=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&n.has(o.toolCallId))}function $t(e,t,n,r){let o=e.partsSig.value.find(s=>s.kind==="tool"&&s.toolCallId===t);if(o)return r&&(o.dynamic=!0),o;let i={kind:"tool",toolCallId:t,toolName:n??"tool",dynamic:r?!0:void 0,inputPartialSig:J(""),inputSig:J(void 0),outputSig:J(void 0),errorSig:J(void 0),stateSig:J("input-streaming"),approvalSig:J(void 0)};return Zn(e,i),i}function Zn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function bd(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||Zn(e,t)}function Vm(e,t){switch(t.type){case"tool-input-start":$t(e,t.toolCallId,t.toolName,t.dynamic);return;case"tool-input-delta":{let n=$t(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=$t(e,t.toolCallId,t.toolName,t.dynamic);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-input-error":{let n=$t(e,t.toolCallId,t.toolName,t.dynamic);n.inputSig.value=t.input,n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-approval-request":{let n=$t(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=$t(e,t.toolCallId,void 0,t.dynamic);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=$t(e,t.toolCallId,void 0,t.dynamic);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=$t(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function Pd(e){let t=1e3,n=!1,r=!1,o=!1,i=()=>{o||e.signal.aborted||(o=!0,e.onInitialBoundaryReady())};for(;!e.signal.aborted;){let s,l="held";try{l=await e.connect(()=>{if(e.signal.aborted)return;s=e.now();let c=n||r;n=!0,r=!1,o?c&&e.backfill():i()})}catch{}if(e.signal.aborted||(!n&&s===void 0&&(r=!0,i()),l==="unavailable"))return;s!==void 0&&e.now()-s>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var xd=ee.scope("resume-stream");function Sd(e){let{activated:t,conversationReady:n,conversationIdSig:r,messagesSig:o,optionsRef:i,isChatActiveRef:s,transport:l,visitorId:c,adoptControlStateChunk:u,settleSuggestions:_,markActiveConversationRead:p,onReplyLanded:d,runCancellation:f,setCanSend:m,feedback:b,bus:v,homeNav:P,loadInitialThread:x,shouldReconcileOnConnect:h}=e;E(()=>{if(!t||!n||!r.value)return;let y=r.value,k=new AbortController,w=N=>{},B=new ho(o,N=>w(N));l.primeIdentity(c,y),xd.debug("resume stream opened",{conversationId:y});let W=!1,U=!1,I,z,q=0,L=(N,ve)=>{(N||!f.localSendRef.current)&&f.settle(ve),N&&(p(),d())},ne=(N,ve=[],ae=!1,De)=>{let xe=i.current;if(N.canceled){L(ae,De);return}let Te=N.status==="error";switch(tl(N,Te)){case"drop":o.value=o.value.filter(Ce=>Ce!==N);break;case"complete-operator-routed":N.status="complete",ae&&(b.play("messageReceived"),xn(v,xe,"assistant",Ue(N)));break;case"error":{if(N.status="error",N.errorText=xe.strings.errorGeneric,ae){b.play("error");let Ce=new Error(Te?"stream error chunk":"empty reply");v.emit("error",Ce),xe.onError?.(Ce)}break}case"complete":N.status="complete",ae&&(b.play("messageReceived"),xn(v,xe,"assistant",Ue(N))),_(N,ve);break}L(ae,De)},oe=N=>{if(k.signal.aborted||r.value!==y)return;if(u(N),N.type==="start"){let Ce=z?.senderRole==="visitor"?z.messageId:void 0;if(z={messageId:N.messageId,senderRole:N.messageMetadata?.senderRole},q+=1,W=N.messageMetadata?.senderRole===void 0,U=!1,I=W?N.messageMetadata?.runId:void 0,W){let Le=N.messageId!==void 0&&o.value.some(Je=>Je.serverMessageId===N.messageId||Je.id===N.messageId),he=o.value.at(-1),Se=N.messageId!==void 0&&(he?.serverMessageId===N.messageId||he?.id===N.messageId),Ie=f.localSendRef.current&&(!Le||Se)&&he?.role==="assistant"&&he.status==="streaming"&&(Se||he.serverMessageId===void 0&&he.partsSig.value.length===0);U=f.captureStart(y,N,Ie,Ce)}}let ve=W&&(N.type==="finish"||N.type==="error"||N.type==="abort"),ae=ve?I:void 0,De=ve&&(U||f.ownsLocalRun(ae));ve&&(W=!1,U=!1,I=void 0);let xe=o.value.length,Te=B.applyResume(N);if(N.type==="finish"&&N.canContinue===!1&&m(!1),o.value.length>xe){let Ce=i.current.modules.list.find(Le=>Le.layout==="chat")?.id;Ce&&P?.switchTab(Ce)}if(!Te){ve&&(De||!f.localSendRef.current)&&f.settle(ae);return}if(Te.role==="operator"){b.play("messageReceived"),xn(v,i.current,"operator",Ue(Te)),!document.hidden&&s.current()&&l.markRead(y).catch(()=>{}),ve&&(De||!f.localSendRef.current)&&f.settle(ae);return}Te.role==="assistant"&&ne(Te,[],De,ae)},le=async N=>{let ve=q,ae=await l.loadConversation(y,N?{ids:[N]}:void 0).catch(()=>null);if(k.signal.aborted||r.value!==y||!ae)return!1;ae.controlState&&u({type:"data-control-state",data:ae.controlState});let De=o.value.at(-1),xe=ve===q&&(N===void 0||De!==void 0&&(De.serverMessageId===N||De.id===N));if(!ae.messages?.length)return!1;xe&&m(ae.canContinue??!0);let Te=o.value,Ce=N===void 0?Te.at(-1):Te.find(Je=>Je.serverMessageId===N||Je.id===N),{messages:Le,changed:he}=Un(Te,At(ae.messages));if(!he)return!1;o.value=Le;let Se=N===void 0?Le.at(-1):Le.find(Je=>Je.serverMessageId===N||Je.id===N),Ie=Ce?.role==="assistant"&&Ce.status==="streaming"&&Se?.role==="assistant"&&Se.status!=="streaming"&&Se.id===Ce.id;return xe&&Ie?ne(Se,ae.suggestions??[],f.localSendRef.current):xe&&Se?.role==="assistant"&&Se.status!=="streaming"&&_(Se,ae.suggestions??[]),!0},Ae=new Set;w=({messageId:N})=>{if(Ae.has(N)||!o.value.some(ae=>ae.serverMessageId===N||ae.id===N))return;Ae.add(N);let ve=()=>Ae.delete(N);le(N).then(ve,ve)};let de,_e=!1,Me=(N=!1)=>{if(k.signal.aborted||r.value!==y){_e=!1;return}if(de){_e=!0;return}let ve=N?x(y)??(h()?le():void 0):le();if(!ve)return;de=ve;let ae=()=>{de===ve&&(de=void 0,_e&&(_e=!1,Me()))};ve.then(ae,ae)};return Pd({signal:k.signal,now:()=>performance.now(),sleep:N=>Bn(N,k.signal),connect:N=>l.connectResumeStream({signal:k.signal,onChunk:oe,onConnected:N}),onInitialBoundaryReady:()=>Me(!0),backfill:()=>Me()}),()=>{k.abort(),B.detach(),xd.debug("resume stream closed",{conversationId:y})}},[t,n,r,r.value,c,l,u,_,p,d,f,m,o,v,b,P,x,h])}var Wm=32;function kd(e){let{transport:t,setStreaming:n}=e,r=M(),o=M(),i=M(!1),s=M(),l=M(!1),c=M(new Map),u=M(new Set),_=O((k,w)=>{let B=`${k}:${w}`;s.current!==B&&(s.current=B,t.cancelTurn(k,w))},[t]),p=O(k=>{r.current=void 0,o.current=k,i.current=!1,s.current=void 0,l.current=!0,n(!0)},[n]),d=O((k,w)=>{c.current.set(k,{messageId:w})},[]),f=O(k=>{k!==void 0&&(u.current.add(k),u.current.size>Wm&&u.current.delete(u.current.values().next().value)),!(k!==void 0&&r.current?.runId!==k)&&(r.current=void 0,o.current=void 0,i.current=!1,l.current=!1,n(!1))},[n]),m=O((k,w)=>o.current!==k?w.runId&&r.current?.runId===w.runId?(r.current={conversationId:w.conversationId,runId:w.runId},i.current&&_(w.conversationId,w.runId),!0):!1:(o.current=void 0,w.runId?(r.current={conversationId:w.conversationId,runId:w.runId},n(!0),i.current&&_(w.conversationId,w.runId),!0):(f(),!0)),[_,n,f]),b=O((k,w)=>{let B=c.current.get(k);return B?(c.current.delete(k),!w.runId||u.current.has(w.runId)?!0:B.runId!==void 0?(B.runId!==w.runId||r.current?.runId===w.runId&&(r.current={conversationId:w.conversationId,runId:w.runId},i.current&&_(w.conversationId,w.runId)),!0):(l.current||o.current||(r.current={conversationId:w.conversationId,runId:w.runId},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0)),!0)):!1},[_,n]),v=O(k=>o.current!==k?!1:(f(),!0),[f]),P=O(k=>{let w=c.current.get(k);return w?(c.current.delete(k),w.runId===void 0):!1},[]),x=O((k,w,B,W)=>{let U=w.messageMetadata?.runId;if(w.messageMetadata?.senderRole!==void 0||typeof U!="string"||!U||u.current.has(U))return!1;if(r.current?.runId===U)return l.current;if(l.current)return r.current||!B?!1:(o.current=void 0,r.current={conversationId:k,runId:U},n(!0),i.current&&_(k,U),!0);let z=[...c.current.values()].filter(q=>q.runId===void 0).find(q=>q.messageId===W);return z?(z.runId=U,r.current={conversationId:k,runId:U},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0),!0):(o.current=void 0,r.current={conversationId:k,runId:U},n(!0),i.current&&_(k,U),l.current)},[_,n]),h=O(k=>typeof k=="string"&&r.current?.runId===k&&l.current,[]),y=O(()=>{let k=r.current;if(k)return i.current=!0,_(k.conversationId,k.runId),!0;let w=o.current;return w?(i.current=!0,w.then(B=>{B.runId&&_(B.conversationId,B.runId)}).catch(()=>{}),!0):!1},[_]);return Z(()=>({localSendRef:l,begin:p,beginRouted:d,acceptAck:m,acceptRoutedAck:b,reject:v,rejectRouted:P,captureStart:x,ownsLocalRun:h,settle:f,stop:y}),[m,b,p,d,x,h,v,P,f,y])}var Gm=ee.scope("send");function wd(e){return!(e instanceof We)||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 Cd(e){let{transport:t,messagesSig:n,conversationIdSig:r,options:o,bus:i,feedback:s,persistence:l,visitorId:c,adoptConversationId:u,applyControlState:_,setCanSend:p,settleSuggestions:d,runCancellation:f}=e,m=O(()=>{let P=r.value??ot();return r.value||(r.value=P,l.saveConversationId(P)),P},[r,l]),b=O(async({continueExisting:P,turn:x})=>{let h=m(),y=n.value.at(-1),k=x?[x]:Ks(n.value,P),w=ia({messages:k.map(_a),conversationId:h,visitorId:c,userPrefs:l.loadUserPrefs()}),B=t.sendTurn(w);f.begin(B);try{let W=await B;if(r.value!==h||!f.acceptAck(B,W))return;if(u(W.conversationId),!W.runId){let U=await t.loadConversation(W.conversationId).catch(()=>null);if(r.value!==W.conversationId)return;if(U){U.controlState&&_(U.controlState),p(U.canContinue??!0);let{messages:I,changed:z}=Un(n.value,At(U.messages??[]));z&&(n.value=I);let q=y?n.value.find(L=>L.id===y.id&&L.role==="assistant"&&L.status!=="streaming"):void 0;q&&d(q,U.suggestions??[]),!P&&y?.role==="assistant"&&n.value.includes(y)&&y.serverMessageId===void 0&&!Mt(y)&&(n.value=n.value.filter(L=>L!==y))}else if(y?.role==="assistant"&&n.value.includes(y)){y.status="error",y.errorText=o.strings.errorGeneric;let I=k[0];P?y.retryAction={kind:"continue-assistant",messageId:y.serverMessageId??y.id}:y.retryAction=I?.role==="user"?{kind:"resend-user",messageId:I.id}:null,n.value=[...n.value]}}}catch(W){if(r.value!==h||!f.reject(B))return;let U=Zt(W,o.strings),I=wd(W),z=x?.role==="assistant"?x:n.value.at(-1);if(P&&z?.role==="assistant"&&W instanceof We&&W.status===409){let q=z.serverMessageId??z.id,L=await t.loadConversation(h,{ids:[q]}).catch(()=>null);if(r.value!==h)return;if(L){L.controlState&&_(L.controlState),p(L.canContinue??!0);let ne=At(L.messages??[]),oe=ne.find(le=>(le.serverMessageId??le.id)===q);if(oe&&Zs(z,oe)){let{messages:le,changed:Ae}=Un(n.value,ne),de=le.find(_e=>(_e.serverMessageId??_e.id)===q);if(Ae&&de&&de!==z){de.awaitingContinuation=!1,de.continuationStreaming=void 0,de.retryAction=null,n.value=le,de.status!=="streaming"&&d(de,L.suggestions??[]);return}}}if(!n.value.includes(z)||z.status!=="streaming")return;z.continuationStreaming=!0}if(P&&z?.role==="assistant")z.status="error",z.errorText=U,z.retryAction=I?{kind:"continue-assistant",messageId:z.serverMessageId??z.id}:null,n.value=[...n.value];else if(y?.role==="assistant"&&n.value.includes(y)){y.status="error",y.errorText=U;let q=k[0];y.retryAction=I&&q?.role==="user"?{kind:"resend-user",messageId:q.id}:null,n.value=[...n.value]}else{let q=Ct();q.status="error",q.errorText=U;let L=k[0];q.retryAction=I&&L?.role==="user"?{kind:"resend-user",messageId:L.id}:null,n.value=[...n.value,q]}s.play("error"),i.emit("error",W),o.onError?.(W)}},[t,n,o,i,s,l,c,u,_,p,d,m,f]),v=O(async P=>{let x=m();P.status="pending",P.errorText=void 0,P.retryAction=void 0,n.value.includes(P)&&(n.value=[...n.value]);let h=ia({messages:[_a(P)],conversationId:x,visitorId:c,userPrefs:l.loadUserPrefs()}),y=t.sendTurn(h);f.beginRouted(y,P.id);try{let k=await y;if(r.value!==x){f.rejectRouted(y);return}if(!f.acceptRoutedAck(y,k))return;u(k.conversationId),P.status==="pending"&&(P.status="complete",n.value.includes(P)&&(n.value=[...n.value]))}catch(k){let w=f.rejectRouted(y);if(r.value!==x)return;if(!w){P.status==="pending"&&(P.status="complete",n.value.includes(P)&&(n.value=[...n.value]));return}if(P.status!=="pending")return;Gm.debug("operator-routed send failed",{error:k});let B=k instanceof Error?k:new Error(String(k));P.status="error",P.errorText=Zt(k,o.strings),P.retryAction=wd(k)?{kind:"resend-user",messageId:P.id}:null,n.value.includes(P)&&(n.value=[...n.value]),s.play("error"),i.emit("error",B),o.onError?.(B)}},[t,n,o,i,s,l,c,u,m,f]);return{sendAiTurn:b,sendRoutedTurn:v}}var Km=ee.scope("unread"),jm=300;function Rd(e){let{transport:t,options:n,conversationIdSig:r,isChatActiveRef:o,activated:i,conversationReady:s}=e,l=dt(!1),c=M(new Set),u=M();E(()=>()=>clearTimeout(u.current),[]);let _=O(()=>{let b=o.current()?r.value:void 0;l.value=[...c.current].some(v=>v!==b)},[l,r,o]),p=O(()=>{n.modules.list.some(b=>b.layout==="chat")&&t.listConversations({limit:50}).then(b=>{c.current=new Set(b.conversations.filter(v=>v.hasUnread).map(v=>v.conversationId)),_()}).catch(b=>Km.debug("refreshUnread failed (non-fatal)",{err:b}))},[t,n.modules,_]),d=O(b=>{c.current.delete(b),_()},[_]),f=O(()=>{if(!o.current())return;let b=r.value;b&&(clearTimeout(u.current),u.current=setTimeout(()=>{d(b),t.markRead(b)},jm))},[t,r,d,o]),m=M(!1);return E(()=>{!i||!s||m.current||(m.current=!0,p())},[i,s,p]),E(()=>{if(!i)return;let b=()=>{document.visibilityState==="visible"&&p()};return document.addEventListener("visibilitychange",b),()=>document.removeEventListener("visibilitychange",b)},[i,p]),{hasUnreadSig:l,refreshUnread:p,clearUnread:d,markActiveConversationRead:f}}var er=ee.scope("settings");function Td(e){let{options:t,persistence:n,transport:r,feedback:o,hostElement:i,bus:s}=e,l=n.loadUserPrefs(),[c,u]=D(()=>l.locale??t.locale),[_,p]=D(()=>l.themeMode??t.themeMode),[d,f]=D(()=>l.textSize??t.textSize),m=O(y=>{n.patchUserPrefs(y),r.saveUserPrefs(n.loadUserPrefs()).catch(k=>er.warn("saveUserPrefs failed",{err:k}))},[n,r]);E(()=>{l.soundMuted!==void 0&&o.setMuted(l.soundMuted)},[]),E(()=>{i.dataset.theme=_},[i,_,t]),E(()=>{i.dataset.textSize=d},[i,d,t]),E(()=>{let y=!0;return o.mutedSig.subscribe(k=>{if(y){y=!1;return}m({soundMuted:k})})},[o,m]);let b=dn(c,t.availableLocales,t.defaultLocale);E(()=>{r.setLocale(b)},[r,b]),E(()=>{i.dir=Ci(b)?"rtl":"ltr"},[i,b]),E(()=>{b!==c&&u(b)},[b,c]);let v=O(y=>{er.info("localeChange",{locale:y}),u(y),m({locale:y}),s.emit("localeChange",y)},[m,s]),P=O(y=>{er.info("themeChange",{mode:y}),p(y),i.dataset.theme=y,m({themeMode:y}),s.emit("themeChange",y)},[i,m,s]),x=O(y=>{er.info("textSizeChange",{size:y}),f(y),i.dataset.textSize=y,m({textSize:y}),s.emit("textSizeChange",y)},[i,m,s]),h=O(()=>{o.toggleMuted();let y=o.mutedSig.value;er.info("soundToggle",{muted:y}),s.emit("soundToggle",{muted:y})},[o,s]);return{activeLocale:c,activeThemeMode:_,activeTextSize:d,effectiveLocale:b,setActiveLocale:u,setActiveThemeMode:p,setActiveTextSize:f,patchAndSync:m,handleLocaleChange:v,handleThemeChange:P,handleTextSizeChange:x,handleSoundToggle:h}}var be=ee.scope("app"),bo=C.cssPrefix;function Id(e,t){return Ws({...e,text:Ze(t,e.text)})}function Ed({options:e,hostElement:t,bus:n}){let[r]=D(()=>un(e.widgetId,e.storage,e.aiAgentDeploymentId)),[o,i]=D(()=>r.getVisitorId()),s=r.loadUserPrefs(),l=dt(r.loadConversationId()),c=M(l.value!==void 0),u=dt(l.value??""),_=dt([]),[p,d]=D(!1),f=M(),[m,b]=D([]);function v(){let g=e.modules.list,T=new Set(g.map(F=>F.id)),G=r.loadActiveModule();return G&&T.has(G)?G:g[0]?.id??""}function P(){return e.modules.list.find(g=>g.layout==="chat")?.id}function x(){let g=P();return g?e.modules.list.length===1?!0:k.sig.value.activeTab===g:!1}let h=M(x);h.current=x;let y=M();if(!y.current){let g=e.modules.list.map(T=>T.id);y.current=Kc(v(),g,T=>r.saveActiveModule(T))}let k=y.current,[w,B]=D(!1),[W,U]=D(null),[I,z]=D(!1),q=e.mode==="standalone"||e.mode==="inline",L=M(Fn(e,mn(),r.loadPanelOpen(),r.loadPanelSize())),[ne,oe]=D(L.current.panelOpen),[le,Ae]=D(L.current.panelOpen),de=M(),_e=M(),Me=M(!1),N=M(void 0);E(()=>{ne&&Ae(!0)},[ne]);let ve=M(!1),[ae,De]=D(!1),{dismissed:xe,dismissCallout:Te}=md({callout:e.launcher.callout,persistence:r}),Ce=e.launcher.callout?.persistent??!0,Le=O(()=>{be.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Te()},[n,Te]),[he,Se]=D(L.current.panelSize),Ie=M(!1),[Je,Qe]=D("chat"),[ze,H]=D(!0),j=M(ze);j.current=ze;let[X,me]=D(!1),S=M(X);S.current=X;let V=M(null),[ye,ie]=D(!1),[Pe,vt]=D(null),[ct,qe]=D([]),Ft=M(e.strings),ht=M(e);ht.current=e;let[Ga,Nd]=D(void 0),[Dd,$d]=D(void 0),[Fd,Bd]=D(()=>r.loadSidebarCollapsed()??!1),[xo,Hd]=D({}),[se]=D(()=>new Nr({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Os({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[nt]=D(()=>new qr(e.sound,e.haptics)),Tt=kd({transport:se,setStreaming:me}),{activeLocale:tr,activeThemeMode:Ka,activeTextSize:ja,effectiveLocale:nn,setActiveLocale:Ud,setActiveThemeMode:zd,setActiveTextSize:qd,patchAndSync:Xa,handleLocaleChange:Vd,handleThemeChange:Wd,handleTextSizeChange:Gd,handleSoundToggle:Kd}=Td({options:e,persistence:r,transport:se,feedback:nt,hostElement:t,bus:n}),{controlModeSig:bt,assignedOperatorInitialsSig:jd,operatorAvailableSig:Xd,applyControlState:rn,adoptControlStateChunk:Yd,requestOperator:Jd,cancelOperatorRequest:Qd}=gd({transport:se,conversationIdSig:l}),{hasUnreadSig:Zd,refreshUnread:Ya,clearUnread:Ja,markActiveConversationRead:eu}=Rd({transport:se,options:e,conversationIdSig:l,isChatActiveRef:h,activated:le,conversationReady:w});E(()=>{nt.update(e.sound,e.haptics)},[nt,e.sound,e.haptics]),E(()=>()=>nt.destroy(),[nt]),E(()=>{Ie.current||!e.size.initialSize||(Ie.current=!0,!r.loadPanelSize()&&Se(aa(e.mode,e.size,mn())))},[e.mode,e.size,r]),E(()=>{if(!w||ve.current)return;ve.current=!0;let g=Fn(e,mn(),r.loadPanelOpen(),r.loadPanelSize());oe(g.panelOpen),Se(g.panelSize)},[w,e,r]);let Qa=M(null);E(()=>{w&&k.reconcile(e.modules.list.map(g=>g.id),v())},[w,e.modules.list,k]);let nr=O(g=>{!g||g.length===0||(_.value=g.map(T=>Id(T,Ft.current)))},[_]),So=M(null),rr=O(async g=>{try{let{formSubmissions:T}=await(g?se.bootstrap(g):So.current??se.bootstrap()),G=new Map;return T.forEach((F,Q)=>G.set(F.formId,Q)),T.filter((F,Q)=>!F.skipped||G.get(F.formId)===Q).map((F,Q)=>({key:`wire:${F.formId}:${F.createdAt??Q}`,formId:F.formId,outcome:F.skipped?"skipped":"submitted",createdAt:Mr(F.createdAt),values:F.values}))}catch(T){return be.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:T}),[]}},[se]),Sn=M(0),yt=M(0),ko=O((g,T)=>{if(g===l.value)return;let G=l.value;yt.current++,d(!1),G&&(r.saveDraft(g,r.loadDraft(G)),r.saveDraft(G,"")),l.value=g,r.saveConversationId(g),se.primeIdentity(void 0,g),be.info("conversation rebound",{previous:G,current:g,reason:T}),G&&n.emit("conversationRebound",{previous:G,current:g,...T?{reason:T}:{}})},[n,l,r,se]),or=O((g,T)=>{let G=[...g.map(A=>A.createdAt),...T.map(A=>A.createdAt)].filter(A=>A!==void 0),F=(G.length?Math.min(...G):Date.now())-1;return[...(N.current?.messages??[]).map(A=>{let He=Id(A,Ft.current);return He.createdAt=F,He}),...g]},[]),Za=O(async g=>{let T=yt.current,G=()=>T!==yt.current||l.value!==g;_e.current===g&&(_e.current=void 0),d(!0);try{let[F,Q]=await Promise.all([se.loadConversation(g),rr()]);if(G())return;let A=At(F.messages??[]);b(Q);let He=or(Qs(A,_.value),Q);if(_.value=He,_e.current=He.some($e=>$e.role==="user")?void 0:g,A.length>0||F.controlState!==void 0){H(F.canContinue??!0),rn(Et(F.controlState));let $e=A.findLast(_t=>_t.role==="assistant"&&!_t.ephemeral);qe($e?.suggestions??F.suggestions??[])}}catch(F){if(G())return;be.warn("loadThread failed; keeping conversation active",{err:F,conversationId:g}),n.emit("error",F),ht.current.onError?.(F)}finally{G()||d(!1)}},[se,rr,_,l,or,n]),tu=O(g=>{if(de.current===g)return de.current=void 0,Za(g)},[Za]),nu=O(()=>{if(f.current)return Promise.resolve(void 0);let g=l.value,T=_.value.find(A=>!A.ephemeral),G=T?.serverMessageId??T?.id;if(!g||!G)return Promise.resolve(void 0);let F=yt.current,Q={};return f.current=Q,(async()=>{try{let A=await se.loadConversation(g,{beforeId:G});if(f.current!==Q||yt.current!==F||l.value!==g)return;if(A.messages.length===0)return!1;let He=A.messages.map(ua),ue=_.value,$e=Ys(ue,He);if($e!==ue){let _t=Math.min(...He.map(Ht=>Ht.createdAt??1/0),...m.map(Ht=>Ht.createdAt??1/0));if(Number.isFinite(_t))for(let Ht of ue){if(!Ht.ephemeral)break;(Ht.createdAt??1/0)>=_t&&(Ht.createdAt=_t-1)}_.value=$e}return!0}catch(A){if(f.current!==Q||yt.current!==F||l.value!==g)return;be.warn("load previous messages failed",{err:A,conversationId:g,beforeId:G}),n.emit("error",A),e.onError?.(A);return}finally{f.current===Q&&(f.current=void 0)}})()},[n,l,m,_,e,se]),kn=O(async({newConversation:g})=>{let T=++Sn.current,G=()=>T!==Sn.current,F=l.value,Q=g||!F?ot():F;Q!==F&&(yt.current++,d(!1),it(()=>{l.value=Q,u.value=Q}),r.saveConversationId(Q)),se.primeIdentity(o,Q);let A;try{A=await se.handshake({visitorId:o,conversationId:Q,userPrefs:r.loadUserPrefs(),locale:tr})}catch(ue){if(G())return;n.emit("error",ue),e.onError?.(ue),g||B(!0);return}if(G())return;if(A.visitorId&&A.visitorId!==o&&(be.info("visitor rebound",{previous:o,current:A.visitorId,reason:A.rebind?.visitorId}),r.setVisitorId(A.visitorId),i(A.visitorId),n.emit("visitorRebound",{previous:o,current:A.visitorId,reason:A.rebind?.visitorId})),A.conversationId!==Q&&ko(A.conversationId,A.rebind?.conversationId),A.agent&&vt(A.agent),rn(Et(A.controlState)),e.mode==="page"&&(A.site&&As(A.site)?Nd(A.site):A.site&&be.warn("invalid site config, using fallback",{site:A.site}),A.blocks&&Ms(A.blocks)?$d(A.blocks):A.blocks&&be.warn("invalid blocks config, using fallback",{blocks:A.blocks})),A.userPrefs&&!g&&(r.saveUserPrefs(A.userPrefs),A.userPrefs.locale&&Ud(A.userPrefs.locale),A.userPrefs.soundMuted!==void 0&&nt.setMuted(A.userPrefs.soundMuted),A.userPrefs.themeMode&&zd(A.userPrefs.themeMode),A.userPrefs.textSize&&qd(A.userPrefs.textSize)),N.current=A.welcome,g||n.emit("handshake",A),A.welcome?.suggestions){let ue=Ft.current;qe(A.welcome.suggestions.map($e=>({...$e,label:Ze(ue,$e.label),...$e.text===void 0?{}:{text:Ze(ue,$e.text)}})))}let He=!g&&F&&A.conversationId===F;c.current=!!He,He?Me.current||(de.current=A.conversationId):(_e.current=A.conversationId,nr(A.welcome?.messages)),g||B(!0)},[se,o,r,e,n,l,u,nt,nr,tr,ko]),wn=JSON.stringify(e.userContext??null),ru=JSON.stringify(e.pageContext??null),ou=JSON.stringify(xo);E(()=>{let g=Object.keys(xo).length?{...xo,...e.userContext}:e.userContext;se.setContext(g,Xm(e.pageContext))},[se,wn,ru,ou]);let ei=O((g,T=[])=>qe(g.suggestions??T),[]);E(()=>(se.primeIdentity(o,l.value),kn({newConversation:!1}),()=>{Sn.current++,yt.current++}),[]),E(()=>{!le||!w||Me.current||(Me.current=!0,So.current=se.bootstrap(),(async()=>{try{let g=await So.current;U(Ln((g??{forms:[]}).forms,nn))}catch(g){be.debug("bootstrap failed \u2014 treating as no forms",{err:g})}finally{z(!0)}})(),de.current===l.value&&d(!0))},[le,w]);let ar=M(null);E(()=>{if(!le||!w)return;if(ar.current===null){ar.current=nn;return}if(ar.current===nn)return;ar.current=nn;let g=!1;return se.bootstrap().then(T=>{g||U(Ln((T??{forms:[]}).forms,nn))}).catch(T=>be.debug("forms re-localize failed \u2014 keeping current copy",{err:T})),()=>{g=!0}},[le,w,nn,se]);let ti=M(wn);E(()=>{!w||ti.current===wn||(ti.current=wn,kn({newConversation:!1}))},[wn,w,kn]),vd({hostElement:t,mode:e.mode,panelSize:he,isOpen:ne,setIsOpen:oe});let{sendAiTurn:Bt,sendRoutedTurn:Cn}=Cd({transport:se,messagesSig:_,conversationIdSig:l,options:e,bus:n,feedback:nt,persistence:r,visitorId:o,adoptConversationId:ko,applyControlState:rn,setCanSend:H,settleSuggestions:ei,runCancellation:Tt}),{toolInteraction:au}=fd({streaming:X,controlModeSig:bt,messagesSig:_,sendAiTurn:Bt,bus:n,humanInLoop:e.features.humanInLoop}),iu=O((g,T)=>{let G=_.value.find(F=>F.serverMessageId===g);G&&(G.feedback=T),be.info("messageFeedback",{messageId:g,value:T}),n.emit("messageFeedback",{messageId:g,value:T}),se.submitFeedback({messageId:g,value:T})},[n,_,se]),su=()=>_.value.reduce((g,T)=>g+(T.role==="user"?1:0),0),on=e.forms.list.length>0?e.forms:W??e.forms,Ee=zc({forms:on,persistence:r,userContext:()=>e.userContext,messageCount:su,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>l.value,onComplete:(g,T,G,F)=>{be.info("formSubmit",{formId:g.id,trigger:T,skipped:F}),n.emit("formSubmit",{formId:g.id,values:G,skipped:F}),b(A=>{let ue=A.find($e=>$e.formId===g.id&&$e.outcome==="skipped")?.createdAt??Date.now();return[...A.filter($e=>!($e.formId===g.id&&$e.outcome==="skipped")),{key:`local:${g.id}:${ue}`,formId:g.id,outcome:F?"skipped":"submitted",createdAt:ue,...F?{}:{values:G}}]});let Q=l.value??ot();l.value||(l.value=Q,r.saveConversationId(Q),se.primeIdentity(void 0,Q)),!F&&g.mirrorToContext&&Hd(A=>({...A,...G})),se.submitForm({formId:g.id,conversationId:Q,trigger:T,values:G,skipped:F})}}),wo=ut(()=>Ee.activeForm.value),lu=O(()=>Ee.fire("after-messages"),[Ee]),cu=O(()=>c.current||_.value.some(g=>!g.ephemeral&&g.role==="user"),[_]);Sd({activated:le,conversationReady:w,conversationIdSig:l,messagesSig:_,optionsRef:ht,isChatActiveRef:h,transport:se,visitorId:o,adoptControlStateChunk:Yd,settleSuggestions:ei,markActiveConversationRead:eu,onReplyLanded:lu,runCancellation:Tt,setCanSend:H,feedback:nt,bus:n,homeNav:k,loadInitialThread:tu,shouldReconcileOnConnect:cu}),E(()=>{Ee.refresh()},[on,Ee]);let ni=e.pageContext?.area?String(e.pageContext.area):void 0,du=ut(()=>_.value.length);E(()=>{w&&I&&Ee.fire("pre-chat")},[w,I,Ee]),E(()=>{I&&!ze&&Ee.fire("conversation-closed")},[I,ze,Ee]),E(()=>{w&&I&&ni&&Ee.fire("page-area")},[w,I,ni,Ee]);let Co=Z(()=>{let g=on.list.flatMap(T=>T.triggers).filter(T=>T.kind==="idle").map(T=>Number(T.param));return g.length?Math.min(...g)*1e3:0},[on]);E(()=>{if(!Co||!ne)return;let g=setTimeout(()=>Ee.fire("idle"),Co);return()=>clearTimeout(g)},[Co,ne,Ee,du.value]);let ri=O(async(g,T)=>{if(V.current)return!1;let G=l.value,F=bt.value!=="ai-agent";if(be.info("send",{textLen:g.length,attachments:T.length,streaming:S.current,routedToOperator:F}),S.current&&!F)return!1;let Q=new AbortController,A={conversationId:G,controller:Q};V.current=A,ie(!0);try{nt.unlock();let He=await Jm(se,T,Q.signal,_t=>{Q.signal.aborted||(be.warn("upload failed",{err:_t}),n.emit("error",_t),e.onError?.(_t))});if(Q.signal.aborted||l.value!==G||!j.current||Ee.activeForm.value)return!1;let ue=bt.value!=="ai-agent";if(S.current&&!ue||!g&&He.length===0)return!1;n.emit("send",{text:g,attachmentCount:T.length}),ct.length>0&&qe([]),nt.play("messageSent");let $e=da(g,He);return xn(n,e,"user",g),ue?(_.value=[..._.value,$e],Cn($e),!0):(_.value=[..._.value,$e,Ct()],Bt({continueExisting:!1}),!0)}finally{V.current===A&&(V.current=null,ie(!1))}},[se,n,e,ct.length,_,l,Bt,Cn,bt]);E(()=>{let g=l.value;return()=>{let T=V.current;!T||T.conversationId!==g||(V.current=null,ie(!1),T.controller.abort())}},[l.value]),E(()=>{ze&&!wo.value||V.current?.controller.abort()},[wo.value,ze]);let uu=O(()=>{if(!Tt.stop())return;be.info("stop"),n.emit("stop",void 0);let g=_.value.at(-1);g&&g.role!=="user"&&g.status==="streaming"&&(g.canceled=!0,_.value=[..._.value])},[Tt,n,_]),_u=O(g=>{if(X)return;let T=_.value,G=Hr(T,g);if(G)switch(be.info("retry",{kind:G.kind,messageId:G.messageId}),G.kind){case"continue-assistant":{if(bt.value!=="ai-agent"||g.role!=="assistant"||(g.serverMessageId??g.id)!==G.messageId)return;g.status="streaming",g.errorText=void 0,g.retryAction=void 0,g.awaitingContinuation=!0,_.value=[...T],Bt({continueExisting:!0,turn:g});return}case"resend-user":{let F=T.find(A=>A.role==="user"&&A.id===G.messageId);if(!F)return;if(F.status="complete",F.errorText=void 0,F.retryAction=void 0,bt.value!=="ai-agent"){_.value=g.role==="assistant"?T.filter(A=>A!==g):[...T],Cn(F);return}let Q=Ct();_.value=g.role==="assistant"?T.map(A=>A===g?Q:A):[...T,Q],Bt({continueExisting:!1,turn:F});return}case"repeat-user":{let F=T.find(ue=>ue.role==="user"&&ue.id===G.messageId);if(!F)return;let Q=da(Ue(F),F.attachments?.map(ue=>({...ue}))??[]),A=new Set(Q.attachments?.flatMap(ue=>ue.url?[ue.url]:[])??[]),He=F.partsSig.value.flatMap(ue=>ue.kind==="file"&&!A.has(ue.url)?[{...ue}]:[]);if(He.length>0&&(Q.partsSig.value=[...Q.partsSig.value,...He]),bt.value!=="ai-agent"){_.value=[...T,Q],Cn(Q);return}_.value=[...T,Q,Ct()],Bt({continueExisting:!1,turn:Q});return}default:return G}},[X,_,bt,Bt,Cn]),Rn=O(()=>{if(ql(e.mode,he)==="exit-fullscreen"){be.info("close \u2192 exit-fullscreen",{mode:e.mode}),Se("normal"),n.emit("fullscreen",!1);return}be.info("close \u2192 panel closed",{mode:e.mode}),Ee.fire("panel-close"),oe(!1),r.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,r,he,Ee]),Ro=O(()=>{be.info("open",{mode:e.mode}),nt.unlock(),De(!0),oe(!0),r.savePanelOpen(!0),!xe&&!Ce&&Le(),setTimeout(()=>De(!1),Ym),le&&Ya(),n.emit("open",void 0),e.onOpen?.()},[n,e,nt,r,xe,Ce,Le,le,Ya]),To=O(()=>{let g=_.value.some(T=>T.role==="user");if(_e.current===l.value&&!g&&ze&&l.value){be.info("clear \u2192 reusing empty conversation",{conversationId:l.value}),_.value.length===0&&nr(N.current?.messages);return}be.info("clear \u2192 new conversation",{wasStreaming:X}),n.emit("clear",void 0),Tt.settle(),c.current=!1,de.current=void 0,_e.current=void 0,it(()=>{_.value=[],l.value=void 0,rn({controlMode:"ai-agent",controlRevision:0})}),r.clearConversation(),H(!0),b([]),qe([]),kn({newConversation:!0})},[X,_,l,r,kn,n,ze,nr,Tt,rn]),Io=O(()=>{To(),Qe("chat");let g=e.modules.list.find(T=>T.layout==="chat")?.id;g&&k.switchTab(g)},[To,k,e]),Eo=O(()=>{let g=he==="expanded"?"normal":"expanded";be.info("expand",{from:he,expanded:g==="expanded"}),Se(g),r.savePanelSize(g),n.emit("expand",g==="expanded")},[n,he,r]),Ao=O(()=>{let g=he==="fullscreen"?"normal":"fullscreen";be.info("fullscreen",{from:he,fullscreen:g==="fullscreen"}),Se(g),r.savePanelSize(g),n.emit("fullscreen",g==="fullscreen")},[n,he,r]),pu=O(()=>{Qe(g=>{let T=g==="history"?"chat":"history";return be.info("toggleHistory",{view:T}),n.emit("toggleHistory",{view:T}),T})},[n]),fu=O(()=>{Bd(g=>{let T=!g;return be.info("sidebarToggle",{collapsed:T}),r.saveSidebarCollapsed(T),n.emit("sidebarToggle",{collapsed:T}),T})},[r,n]),mu=O(g=>{be.info("resize",g),Xa({widgetSize:g}),n.emit("resize",g)},[Xa,n]),Mo=O(async g=>{let T=++Sn.current;yt.current++,d(!1);let G=()=>T!==Sn.current;be.info("selectConversation",{conversationId:g,wasStreaming:X}),n.emit("selectConversation",{conversationId:g});try{let[F,Q]=await Promise.all([se.loadConversation(g),rr(g)]);if(G())return;Tt.settle(),c.current=!0,de.current=void 0;let A=At(F.messages);_e.current=A.some(ue=>ue.role==="user")?void 0:F.conversationId,it(()=>{_.value=or(A,Q),F.conversationId!==l.value&&(u.value=F.conversationId),l.value=F.conversationId}),b(Q),r.saveConversationId(F.conversationId),se.primeIdentity(o,F.conversationId),F.agent&&vt(F.agent),H(F.canContinue),rn(Et(F.controlState));let He=A.findLast(ue=>ue.role==="assistant"&&!ue.ephemeral);if(qe(He?.suggestions??F.suggestions??[]),Qe("chat"),await se.markRead(g),G())return;Ja(g)}catch(F){if(G())return;n.emit("error",F),e.onError?.(F)}},[se,_,l,u,n,e,r,Ja,rr,or,X,o,Tt]),ir=M(null),oi=O(g=>{typeof g=="string"&&(I?Ee.fire("manual",g):ir.current=g)},[I,Ee]);E(()=>{!I||!ir.current||(Ee.fire("manual",ir.current),ir.current=null)},[I,Ee]);let an=M({handleOpen:Ro,handleClose:Rn,handleExpand:Eo,handleFullscreen:Ao,openForm:oi});an.current={handleOpen:Ro,handleClose:Rn,handleExpand:Eo,handleFullscreen:Ao,openForm:oi},pt(()=>Ls(t,{open:()=>an.current.handleOpen(),close:()=>an.current.handleClose(),expand:()=>an.current.handleExpand(),fullscreen:()=>an.current.handleFullscreen(),openForm:g=>an.current.openForm(g)}),[t]);let Ye=Z(()=>Xo(e,tr,Ka,ja),[e,tr,Ka,ja]);Ft.current=Ye.strings;let gu=Z(()=>m.map(g=>{let T=on.list.find(G=>G.id===g.formId);return{...g,title:T?.title,form:T}}),[m,on]),ai={options:Ye,transport:se,feedback:nt,bus:n,persistence:r,conversationId:l.value??"",composerKey:u.value,composerApiRef:Qa,view:Je,canSend:ze,isStreaming:X,sendPreparing:ye,composerActive:Ye.mode==="page"||Ye.mode==="inline"||Ye.mode==="standalone"||ne,controlMode:bt.value,assignedOperatorInitials:jd.value,operatorAvailable:Xd.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Jd,onCancelOperatorRequest:Qd,loadingMessages:p,onLoadPreviousMessages:nu,messagesSig:_,agent:Pe,suggestions:ct,initialWidgetSize:s.widgetSize??null,visitorId:o,onClose:Rn,onClear:To,onExpand:Eo,onFullscreen:Ao,onSoundToggle:Kd,onToggleHistory:pu,onSelectHistoryConversation:Mo,onNewConversation:Io,onLocaleChange:Vd,onThemeChange:Wd,onTextSizeChange:Gd,onWidgetSizeChange:mu,onSend:ri,onStop:uu,onSuggestion:g=>{if(V.current)return;let T=g.text??g.label;be.info("suggestion",{text:T,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:T}),e.autoSendSuggestions?ri(T,[]):Qa.current?.fill(T)},activeForm:wo.value?.form??null,formMarkers:gu,onFormSubmit:Ee.complete,onFormSkip:Ee.skip,onFormFill:g=>Ee.fire("manual",g),tool:au,onRetry:_u,onMessageFeedback:iu},vu=g=>{Mo(g);let T=P();T&&k.switchTab(T)};if(!w)return null;let Tn=Ye.modules.list,Lo=g=>{let T=Gn("close",Ye.mode,g);return Tn.length===0?a(pd,{strings:Ye.strings,onClose:T?Rn:void 0}):Tn.length===1&&Tn[0]?.layout==="chat"?a(Uc,{...ai,panelSize:g}):a(_d,{panelProps:{...ai,panelSize:g,onClose:T?Rn:void 0},enabledModules:Tn,nav:k,bus:n,hasUnread:Zd.value,onSelectConversation:vu,onStartNewConversation:Io,onSetPanelSize:Se})};if(e.mode==="page"){let g=G=>{Mo(G.conversationId)},T=Tn.some(G=>G.layout==="chat");return a("div",{class:`${bo}-anchor`,children:a(Wc,{site:Ga,blocks:Dd,transport:se,strings:Ye.strings,locale:Ye.locale,persistence:r,visitorId:o,showConversations:T,onSelectConversation:g,onNewConversation:Io,sidebarCollapsed:Fd,onToggleSidebarCollapsed:fu,children:Lo("fullscreen")})})}if(q){let g=e.mode==="standalone"?"fullscreen":he;return a("div",{class:`${bo}-anchor`,children:Lo(g)})}let ii=e.mode==="drawer",si=!(e.mode==="modal")&&!e.launcher.hidden&&(!ne||ae),li=si&&!ae&&!xe&&!ii?Ye.launcher.callout:null;return a("div",{class:`${bo}-anchor`,"data-launcher-size":Ye.launcher.size,children:[ne||le?a("div",{class:`${bo}-surface`,hidden:!ne,children:Lo(he)}):null,si?a(Hl,{onToggle:Ro,launcher:Ye.launcher,strings:Ye.strings,leaving:ae,edgeTab:ii}):null,li?a(Ul,{callout:li,launcherPosition:Ye.position,strings:Ye.strings,closeLabel:Ye.strings.close,onDismiss:Le}):null]})}function Xm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Ym=120;async function Jm(e,t,n,r){return(await Promise.all(t.map(async i=>{try{let{id:s,url:l}=await e.uploadFile(i.file,n);return{id:s,name:i.name,mediaType:i.mediaType,size:i.size,url:l}}catch(s){r(s);return}}))).filter(i=>i!==void 0)}var Qm=ee.scope("error-boundary"),yo=class extends et{constructor(){super(...arguments);te(this,"state",{crashed:!1})}componentDidCatch(n,r){Qm.error("widget render crashed",{error:n,componentStack:r?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,r?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Zm="1",eg=60,tg=2e3,Ad={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function ng(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function rg(){return location.origin+location.pathname}function og(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Md(e,t){let n=Math.random(),r=0,o=0,i=new Set,s=(c,u)=>{let{tracking:_,publicKey:p,aiAgentDeploymentId:d,mode:f,themeMode:m}=t.getOptions();if(!_.enabled||ng()||n>=_.sampleRate)return;let b=performance.now();if(b-r>6e4&&(r=b,o=0),++o>eg)return;let v=new URLSearchParams;v.set("v",Zm),v.set("_ev",Ar),v.set("e",c),_.token&&v.set("tk",_.token),p&&v.set("pk",p),d&&v.set("dep",d),v.set("vid",t.getVisitorId());let P=t.getConversationId();P&&v.set("cid",P),v.set("url",rg());let x=og();x&&v.set("ref",x),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),u)for(let[w,B]of Object.entries(u))B!==void 0&&v.set(w,String(B));v.set("ts",String(Date.now()));let h=`${_.endpoint}?${v}`;if(h.length>tg)return;let y=new Image(1,1);i.add(y);let k=()=>i.delete(y);y.addEventListener("load",k,{once:!0}),y.addEventListener("error",k,{once:!0}),y.src=h},l=Object.keys(Ad).map(c=>e.on(c,u=>s(c,Ad[c]?.(u))));return()=>{for(let c of l)c();i.clear()}}function Ld(e){let{bus:t,host:n,appRoot:r,persistence:o,reportError:i}=e,s=e.initialRaw,l,c=cn(s),u=!0,_=()=>{c=cn(l?Yo(s,l):s)},p=()=>{ss(n,br(c.mode));let m=o.loadUserPrefs().themeMode;cs(n,m?{...c,themeMode:m}:c),u&&(yr(n,ag(c)),u=!1)},d=()=>{p(),Mn(xt(yo,{onError:i},xt(Ed,{bus:t,hostElement:n,options:c})),r)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&o.rememberStorageVersion(m.config.storageVersion),l=m.config,_(),d())});let f=Md(t,{getOptions:()=>c,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>s,render:d,setUserOptions:m=>{s=m,_(),d()},patchUserOptions:m=>{s={...s,...m},_(),d()},destroy:()=>f()}}function ag(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=un(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:r}=Fn(e,mn(),t.loadPanelOpen(),t.loadPanelSize());return Er(e.mode,r,n)}var Po=class{constructor(){te(this,"handlers",new Map)}on(t,n){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let r=this.handlers.get(t);if(r)for(let o of r)try{o(n)}catch{}}clear(){this.handlers.clear()}};var Wa=class extends HTMLElement{constructor(){super(...arguments);te(this,"bus",new Po);te(this,"mountResult",null);te(this,"runtime",null)}static get observedAttributes(){return Jo}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Mn(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=Qo(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let r=cn(n);this.mountResult||(this.mountResult=ls({existingHost:this,position:br(r.mode)}));let o=un(r.widgetId,r.storage,r.aiAgentDeploymentId);this.runtime=Ld({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},Od=!1;function ig(){if(Od||typeof customElements>"u")return;let e=C.tagName;customElements.get(e)||customElements.define(e,Wa),Od=!0}typeof customElements<"u"&&ig();export{ig as registerWebComponent};
|
|
42
42
|
//# sourceMappingURL=elements-web-component.esm.js.map
|