@helpai/elements 1.3.8 → 1.3.9
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 +1 -1
- package/elements.cjs.js +1 -1
- package/elements.esm.js +1 -1
- package/elements.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/web-component.mjs +1 -1
|
@@ -4,7 +4,7 @@ var Qu=Object.defineProperty;var Xu=(e,t,n)=>t in e?Qu(e,t,{enumerable:!0,config
|
|
|
4
4
|
`;var Ts=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
5
|
`;var Is=`: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 G_="helpai",K_="#5B5BD6",j_="#FFFFFF",Q_="12px",X_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",Pa=[ws,Cs,Rs,Ts,Is].join(`
|
|
7
|
-
`).replace(/__P__/g,G_).replaceAll("__BRAND_ACCENT_TEXT__",j_).replaceAll("__BRAND_ACCENT__",K_).replaceAll("__BRAND_RADIUS__",Q_).replaceAll("__BRAND_FONT__",X_);var Y_=se.scope("mount"),Es=new WeakMap,As={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 Ms(e,t){e.style.cssText=As[t]}function Ur(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Ls(e={}){let t=e.position??"flow";Y_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${T.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",T.id),r.style.cssText=As[t];let o=r.shadowRoot??r.attachShadow({mode:"open"}),a=r.ownerDocument;if(!J_(o,a)){let l=a.createElement("style");l.textContent=Pa,o.appendChild(l)}let s=document.createElement("div");return s.className=`${T.cssPrefix}-app`,o.appendChild(s),{appRoot:s,destroy:()=>r.remove(),hostElement:r,shadowRoot:o}}function J_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=Es.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(Pa),Es.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function Z_(e,t){let n=T.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 ep(e,t){e.dataset.theme=t}function tp(e,t){let n=T.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 np(e,t){e.dataset.position=t}function zr(e,t){e.dataset.mode=t}function Os(e,t){ep(e,t.themeMode),Z_(e,t.themeOverrides),np(e,t.position),tp(e,t.size)}var Cn,Ne,xa,Ns,Jn=0,qs=[],Be=J,Ds=Be.__b,$s=Be.__r,Fs=Be.diffed,Bs=Be.__c,Us=Be.unmount,zs=Be.__;function qr(e,t){Be.__h&&Be.__h(Ne,e,Jn||t),Jn=0;var n=Ne.__H||(Ne.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function $(e){return Jn=1,Vs(Ws,e)}function Vs(e,t,n){var r=qr(Cn++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ws(void 0,t),function(l){var c=r.__N?r.__N[0]:r.__[0],d=r.t(c,l);c!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=Ne,!Ne.__f)){var o=function(l,c,d){if(!r.__c.__H)return!0;var _=!1,p=r.__c.props!==l;if(r.__c.__H.__.some(function(g){if(g.__N){_=!0;var m=g.__[0];g.__=g.__N,g.__N=void 0,m!==g.__[0]&&(p=!0)}}),a){var u=a.call(this,l,c,d);return _?u||p:u}return!_||p};Ne.__f=!0;var a=Ne.shouldComponentUpdate,s=Ne.componentWillUpdate;Ne.componentWillUpdate=function(l,c,d){if(this.__e){var _=a;a=void 0,o(l,c,d),a=_}s&&s.call(this,l,c,d)},Ne.shouldComponentUpdate=o}return r.__N||r.__}function M(e,t){var n=qr(Cn++,3);!Be.__s&&ka(n.__H,t)&&(n.__=e,n.u=t,Ne.__H.__h.push(n))}function Ct(e,t){var n=qr(Cn++,4);!Be.__s&&ka(n.__H,t)&&(n.__=e,n.u=t,Ne.__h.push(n))}function O(e){return Jn=5,ne(function(){return{current:e}},[])}function ne(e,t){var n=qr(Cn++,7);return ka(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function L(e,t){return Jn=8,ne(function(){return e},t)}function rp(){for(var e;e=qs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Hr),t.__h.some(Sa),t.__h=[]}catch(n){t.__h=[],Be.__e(n,e.__v)}}}Be.__b=function(e){Ne=null,Ds&&Ds(e)},Be.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),zs&&zs(e,t)},Be.__r=function(e){$s&&$s(e),Cn=0;var t=(Ne=e.__c).__H;t&&(xa===Ne?(t.__h=[],Ne.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Hr),t.__h.some(Sa),t.__h=[],Cn=0)),xa=Ne},Be.diffed=function(e){Fs&&Fs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(qs.push(t)!==1&&Ns===Be.requestAnimationFrame||((Ns=Be.requestAnimationFrame)||op)(rp)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),xa=Ne=null},Be.__c=function(e,t){t.some(function(n){try{n.__h.some(Hr),n.__h=n.__h.filter(function(r){return!r.__||Sa(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Be.__e(r,n.__v)}}),Bs&&Bs(e,t)},Be.unmount=function(e){Us&&Us(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Hr(r)}catch(o){t=o}}),n.__H=void 0,t&&Be.__e(t,n.__v))};var Hs=typeof requestAnimationFrame=="function";function op(e){var t,n=function(){clearTimeout(r),Hs&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Hs&&(t=requestAnimationFrame(n))}function Hr(e){var t=Ne,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Ne=t}function Sa(e){var t=Ne;e.__c=e.__(),Ne=t}function ka(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ws(e,t){return typeof t=="function"?t(e):t}var ap=Symbol.for("preact-signals");function Kr(){if($t>1)$t--;else{var e,t=!1;for((function(){var o=Wr;for(Wr=void 0;o!==void 0;){var a=o.S;if(a.v===o.v)for(var s=a.t;s!==void 0;s=s.x)s.i===o.i&&(s.i=a.i);o=o.o}})();er!==void 0;){var n=er;for(er=void 0,Vr++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ks(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Vr=0,$t--,t)throw e}}function xt(e){if($t>0)return e();wa=++ip,$t++;try{return e()}finally{Kr()}}var Zn,Ae=void 0;function tr(e){var t=Ae,n=Zn;Ae=void 0,Zn=void 0;try{return e()}finally{Ae=t,Zn=n}}var er=void 0,$t=0,Vr=0,ip=0,wa=0,Wr=void 0,Gr=0;function Gs(e){if(Ae!==void 0){var t=e.n;if(t===void 0||t.t!==Ae)return t={i:0,S:e,p:Ae.s,n:void 0,t:Ae,e:void 0,x:void 0,r:t},Ae.s!==void 0&&(Ae.s.n=t),Ae.s=t,e.n=t,32&Ae.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=Ae.s,t.n=void 0,Ae.s.n=t,Ae.s=t),t}}function Qe(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}Qe.prototype.brand=ap;Qe.prototype.h=function(){return!0};Qe.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:tr(function(){var r;(r=t.W)==null||r.call(t)}))};Qe.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&&tr(function(){var o;(o=t.Z)==null||o.call(t)}))}};Qe.prototype.subscribe=function(e){var t=this;return Ft(function(){var n=t.value;tr(function(){return e(n)})},{name:"sub"})};Qe.prototype.valueOf=function(){return this.value};Qe.prototype.toString=function(){return this.value+""};Qe.prototype.toJSON=function(){return this.value};Qe.prototype.peek=function(){var e=this;return tr(function(){return e.value})};Object.defineProperty(Qe.prototype,"value",{get:function(){var e=Gs(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Vr>100)throw new Error("Cycle detected");(function(n){$t!==0&&Vr===0&&n.l!==wa&&(n.l=wa,Wr={S:n,v:n.v,i:n.i,o:Wr})})(this),this.v=e,this.i++,Gr++,$t++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Kr()}}}});function ee(e,t){return new Qe(e,t)}function Ks(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function js(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 Qs(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 on(e,t){Qe.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Gr-1,this.f=4}on.prototype=new Qe;on.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Gr))return!0;if(this.g=Gr,this.f|=1,this.i>0&&!Ks(this))return this.f&=-2,!0;var e=Ae;try{js(this),Ae=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 Ae=e,Qs(this),this.f&=-2,!0};on.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)}Qe.prototype.S.call(this,e)};on.prototype.U=function(e){if(this.t!==void 0&&(Qe.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)}};on.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(on.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Gs(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ge(e,t){return new on(e,t)}function Xs(e){var t=e.m;if(e.m=void 0,typeof t=="function"){$t++;var n=Ae;Ae=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Ca(e),r}finally{Ae=n,Kr()}}}function Ca(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Xs(e)}function sp(e){if(Ae!==this)throw new Error("Out-of-order effect");Qs(this),Ae=e,this.f&=-2,8&this.f&&Ca(this),Kr()}function Rn(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Zn&&Zn.push(this)}Rn.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()}};Rn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Xs(this),js(this),$t++;var e=Ae;return Ae=this,sp.bind(this,e)};Rn.prototype.N=function(){2&this.f||(this.f|=2,this.u=er,er=this)};Rn.prototype.d=function(){this.f|=8,1&this.f||Ca(this)};Rn.prototype.dispose=function(){this.d()};function Ft(e,t){var n=new Rn(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Ys,Xr,jr,lp=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Js=[];Ft(function(){Ys=this.N})();function Tn(e,t){J[e]=t.bind(null,J[e]||function(){})}function Qr(e){if(jr){var t=jr;jr=void 0,t()}jr=e&&e.S()}function Zs(e){var t=this,n=e.data,r=Pt(n);r.name="ReactiveDom",r.value=n;var o=ne(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=ge(function(){var g=r.value.value;return g===0?0:g===!0?"":g||""}),_=ge(function(){return!Array.isArray(d.value)&&!oa(d.value)}),p=Ft(function(){if(this.N=el,_.value){var g=d.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=g)}}),u=t.__$u.d;return t.__$u.d=function(){p(),u.call(this)},[_,d]},[]),a=o[0],s=o[1];return a.value?s.peek():s.value}Zs.displayName="ReactiveTextNode";Object.defineProperties(Qe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Zs},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Tn("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var a=r[o];a instanceof Qe&&(n||(t.__np=n={}),n[o]=a,r[o]=a.peek())}}e(t)});Tn("__r",function(e,t){if(e(t),t.type!==fe){Qr();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o,a){var s;return Ft(function(){s=this},{name:a}),s.c=o,s})(function(){var o;lp&&((o=n.y)==null||o.call(n)),r.__$f|=1,r.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Xr=r,Qr(n)}});Tn("__e",function(e,t,n,r){Qr(),Xr=void 0,e(t,n,r)});Tn("diffed",function(e,t){Qr(),Xr=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props,a=n.U;if(a)for(var s in a){var l=a[s];l===void 0||r&&s in r||(l.d(),a[s]=void 0)}if(r){a||(a={},n.U=a);for(var c in r){var d=a[c],_=r[c];d===void 0?(d=cp(n,c,_,o),a[c]=d):d.o(_,o)}}}e(t)});function cp(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,a=ee(n);return{o:function(s,l){a.value=s,r=l},d:Ft(function(){this.N=el;var s=a.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))})}}Tn("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 a=r[o];a&&a.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 d=t.__c;if(d){var _=d.__$u;_&&(d.__$u=void 0,_.d())}}e(t)});Tn("__h",function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)});_t.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 a=2&this.__$f;if(!(r||a||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 Pt(e,t){return ne(function(){return ee(e,t)},[])}function ft(e,t){var n=O(e);return n.current=e,Xr.__$f|=4,ne(function(){return ge(function(){return n.current()},t)},[])}var dp=function(e){queueMicrotask(function(){queueMicrotask(e)})};function up(){xt(function(){for(var e;e=Js.shift();)Ys.call(e)})}function el(){Js.push(this)===1&&(J.requestAnimationFrame||dp)(up)}function tl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function nl(e){return tl(e)}function rl(e){return!(!tl(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function _p(e){return`${T.cssPrefix}:${e}`}function ol(e,t){let r=Object.entries(t).map(([o,a])=>{let s=_p(o),l=c=>a(c.detail);return e.addEventListener(s,l),[s,l]});return()=>{for(let[o,a]of r)e.removeEventListener(o,a)}}function Yr(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 pp=900,fp=640;function Ra(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<fp?"fullscreen":n>=(t.autoSizeBreakpoint??pp)?"expanded":"normal"}function nr(e,t,n,r=null){let a=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:Ra(e.mode,e.size,t);return{panelOpen:a,panelSize:l}}function In(){return typeof window>"u"?0:window.innerWidth}var mp="x-public-key",gp="x-ai-agent-deployment-id";function al(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");return{headers(){let t={[gp]:e.aiAgentDeploymentId};return e.publicKey&&(t[e.publicKeyHeader??mp]=e.publicKey),t}}}function rr(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(a,e),o=()=>a();t?.addEventListener("abort",o,{once:!0});function a(){clearTimeout(r),t?.removeEventListener("abort",o),n()}})}var Jr="1.3.8";var Xe=class extends Error{constructor(n,r,o,a){super(n);ae(this,"code",r);ae(this,"status",o);ae(this,"cause",a);this.name="StreamError"}};var il=se.scope("parser");async function*sl(e,t,n){if(!e.ok){let r=await e.text().catch(()=>"");throw new Xe(`server responded ${e.status}: ${r.slice(0,200)}`,"server",e.status)}for await(let r of vp(e,t)){let o=hp(r,n);if(o==="done")return;o&&(yield o)}}async function*vp(e,t){if(!e.body)throw new Xe("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:a}=await n.read();if(o){let l=r.trim();l&&(yield l);return}r+=a;let s;for(;(s=r.indexOf(`
|
|
7
|
+
`).replace(/__P__/g,G_).replaceAll("__BRAND_ACCENT_TEXT__",j_).replaceAll("__BRAND_ACCENT__",K_).replaceAll("__BRAND_RADIUS__",Q_).replaceAll("__BRAND_FONT__",X_);var Y_=se.scope("mount"),Es=new WeakMap,As={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 Ms(e,t){e.style.cssText=As[t]}function Ur(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Ls(e={}){let t=e.position??"flow";Y_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${T.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",T.id),r.style.cssText=As[t];let o=r.shadowRoot??r.attachShadow({mode:"open"}),a=r.ownerDocument;if(!J_(o,a)){let l=a.createElement("style");l.textContent=Pa,o.appendChild(l)}let s=document.createElement("div");return s.className=`${T.cssPrefix}-app`,o.appendChild(s),{appRoot:s,destroy:()=>r.remove(),hostElement:r,shadowRoot:o}}function J_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=Es.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(Pa),Es.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function Z_(e,t){let n=T.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 ep(e,t){e.dataset.theme=t}function tp(e,t){let n=T.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 np(e,t){e.dataset.position=t}function zr(e,t){e.dataset.mode=t}function Os(e,t){ep(e,t.themeMode),Z_(e,t.themeOverrides),np(e,t.position),tp(e,t.size)}var Cn,Ne,xa,Ns,Jn=0,qs=[],Be=J,Ds=Be.__b,$s=Be.__r,Fs=Be.diffed,Bs=Be.__c,Us=Be.unmount,zs=Be.__;function qr(e,t){Be.__h&&Be.__h(Ne,e,Jn||t),Jn=0;var n=Ne.__H||(Ne.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function $(e){return Jn=1,Vs(Ws,e)}function Vs(e,t,n){var r=qr(Cn++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ws(void 0,t),function(l){var c=r.__N?r.__N[0]:r.__[0],d=r.t(c,l);c!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=Ne,!Ne.__f)){var o=function(l,c,d){if(!r.__c.__H)return!0;var _=!1,p=r.__c.props!==l;if(r.__c.__H.__.some(function(g){if(g.__N){_=!0;var m=g.__[0];g.__=g.__N,g.__N=void 0,m!==g.__[0]&&(p=!0)}}),a){var u=a.call(this,l,c,d);return _?u||p:u}return!_||p};Ne.__f=!0;var a=Ne.shouldComponentUpdate,s=Ne.componentWillUpdate;Ne.componentWillUpdate=function(l,c,d){if(this.__e){var _=a;a=void 0,o(l,c,d),a=_}s&&s.call(this,l,c,d)},Ne.shouldComponentUpdate=o}return r.__N||r.__}function M(e,t){var n=qr(Cn++,3);!Be.__s&&ka(n.__H,t)&&(n.__=e,n.u=t,Ne.__H.__h.push(n))}function Ct(e,t){var n=qr(Cn++,4);!Be.__s&&ka(n.__H,t)&&(n.__=e,n.u=t,Ne.__h.push(n))}function O(e){return Jn=5,ne(function(){return{current:e}},[])}function ne(e,t){var n=qr(Cn++,7);return ka(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function L(e,t){return Jn=8,ne(function(){return e},t)}function rp(){for(var e;e=qs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Hr),t.__h.some(Sa),t.__h=[]}catch(n){t.__h=[],Be.__e(n,e.__v)}}}Be.__b=function(e){Ne=null,Ds&&Ds(e)},Be.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),zs&&zs(e,t)},Be.__r=function(e){$s&&$s(e),Cn=0;var t=(Ne=e.__c).__H;t&&(xa===Ne?(t.__h=[],Ne.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Hr),t.__h.some(Sa),t.__h=[],Cn=0)),xa=Ne},Be.diffed=function(e){Fs&&Fs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(qs.push(t)!==1&&Ns===Be.requestAnimationFrame||((Ns=Be.requestAnimationFrame)||op)(rp)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),xa=Ne=null},Be.__c=function(e,t){t.some(function(n){try{n.__h.some(Hr),n.__h=n.__h.filter(function(r){return!r.__||Sa(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Be.__e(r,n.__v)}}),Bs&&Bs(e,t)},Be.unmount=function(e){Us&&Us(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Hr(r)}catch(o){t=o}}),n.__H=void 0,t&&Be.__e(t,n.__v))};var Hs=typeof requestAnimationFrame=="function";function op(e){var t,n=function(){clearTimeout(r),Hs&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Hs&&(t=requestAnimationFrame(n))}function Hr(e){var t=Ne,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Ne=t}function Sa(e){var t=Ne;e.__c=e.__(),Ne=t}function ka(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ws(e,t){return typeof t=="function"?t(e):t}var ap=Symbol.for("preact-signals");function Kr(){if($t>1)$t--;else{var e,t=!1;for((function(){var o=Wr;for(Wr=void 0;o!==void 0;){var a=o.S;if(a.v===o.v)for(var s=a.t;s!==void 0;s=s.x)s.i===o.i&&(s.i=a.i);o=o.o}})();er!==void 0;){var n=er;for(er=void 0,Vr++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ks(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Vr=0,$t--,t)throw e}}function xt(e){if($t>0)return e();wa=++ip,$t++;try{return e()}finally{Kr()}}var Zn,Ae=void 0;function tr(e){var t=Ae,n=Zn;Ae=void 0,Zn=void 0;try{return e()}finally{Ae=t,Zn=n}}var er=void 0,$t=0,Vr=0,ip=0,wa=0,Wr=void 0,Gr=0;function Gs(e){if(Ae!==void 0){var t=e.n;if(t===void 0||t.t!==Ae)return t={i:0,S:e,p:Ae.s,n:void 0,t:Ae,e:void 0,x:void 0,r:t},Ae.s!==void 0&&(Ae.s.n=t),Ae.s=t,e.n=t,32&Ae.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=Ae.s,t.n=void 0,Ae.s.n=t,Ae.s=t),t}}function Qe(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}Qe.prototype.brand=ap;Qe.prototype.h=function(){return!0};Qe.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:tr(function(){var r;(r=t.W)==null||r.call(t)}))};Qe.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&&tr(function(){var o;(o=t.Z)==null||o.call(t)}))}};Qe.prototype.subscribe=function(e){var t=this;return Ft(function(){var n=t.value;tr(function(){return e(n)})},{name:"sub"})};Qe.prototype.valueOf=function(){return this.value};Qe.prototype.toString=function(){return this.value+""};Qe.prototype.toJSON=function(){return this.value};Qe.prototype.peek=function(){var e=this;return tr(function(){return e.value})};Object.defineProperty(Qe.prototype,"value",{get:function(){var e=Gs(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Vr>100)throw new Error("Cycle detected");(function(n){$t!==0&&Vr===0&&n.l!==wa&&(n.l=wa,Wr={S:n,v:n.v,i:n.i,o:Wr})})(this),this.v=e,this.i++,Gr++,$t++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Kr()}}}});function ee(e,t){return new Qe(e,t)}function Ks(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function js(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 Qs(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 on(e,t){Qe.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Gr-1,this.f=4}on.prototype=new Qe;on.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Gr))return!0;if(this.g=Gr,this.f|=1,this.i>0&&!Ks(this))return this.f&=-2,!0;var e=Ae;try{js(this),Ae=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 Ae=e,Qs(this),this.f&=-2,!0};on.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)}Qe.prototype.S.call(this,e)};on.prototype.U=function(e){if(this.t!==void 0&&(Qe.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)}};on.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(on.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Gs(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ge(e,t){return new on(e,t)}function Xs(e){var t=e.m;if(e.m=void 0,typeof t=="function"){$t++;var n=Ae;Ae=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Ca(e),r}finally{Ae=n,Kr()}}}function Ca(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Xs(e)}function sp(e){if(Ae!==this)throw new Error("Out-of-order effect");Qs(this),Ae=e,this.f&=-2,8&this.f&&Ca(this),Kr()}function Rn(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Zn&&Zn.push(this)}Rn.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()}};Rn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Xs(this),js(this),$t++;var e=Ae;return Ae=this,sp.bind(this,e)};Rn.prototype.N=function(){2&this.f||(this.f|=2,this.u=er,er=this)};Rn.prototype.d=function(){this.f|=8,1&this.f||Ca(this)};Rn.prototype.dispose=function(){this.d()};function Ft(e,t){var n=new Rn(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Ys,Xr,jr,lp=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Js=[];Ft(function(){Ys=this.N})();function Tn(e,t){J[e]=t.bind(null,J[e]||function(){})}function Qr(e){if(jr){var t=jr;jr=void 0,t()}jr=e&&e.S()}function Zs(e){var t=this,n=e.data,r=Pt(n);r.name="ReactiveDom",r.value=n;var o=ne(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=ge(function(){var g=r.value.value;return g===0?0:g===!0?"":g||""}),_=ge(function(){return!Array.isArray(d.value)&&!oa(d.value)}),p=Ft(function(){if(this.N=el,_.value){var g=d.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=g)}}),u=t.__$u.d;return t.__$u.d=function(){p(),u.call(this)},[_,d]},[]),a=o[0],s=o[1];return a.value?s.peek():s.value}Zs.displayName="ReactiveTextNode";Object.defineProperties(Qe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Zs},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Tn("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var a=r[o];a instanceof Qe&&(n||(t.__np=n={}),n[o]=a,r[o]=a.peek())}}e(t)});Tn("__r",function(e,t){if(e(t),t.type!==fe){Qr();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o,a){var s;return Ft(function(){s=this},{name:a}),s.c=o,s})(function(){var o;lp&&((o=n.y)==null||o.call(n)),r.__$f|=1,r.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Xr=r,Qr(n)}});Tn("__e",function(e,t,n,r){Qr(),Xr=void 0,e(t,n,r)});Tn("diffed",function(e,t){Qr(),Xr=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props,a=n.U;if(a)for(var s in a){var l=a[s];l===void 0||r&&s in r||(l.d(),a[s]=void 0)}if(r){a||(a={},n.U=a);for(var c in r){var d=a[c],_=r[c];d===void 0?(d=cp(n,c,_,o),a[c]=d):d.o(_,o)}}}e(t)});function cp(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,a=ee(n);return{o:function(s,l){a.value=s,r=l},d:Ft(function(){this.N=el;var s=a.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))})}}Tn("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 a=r[o];a&&a.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 d=t.__c;if(d){var _=d.__$u;_&&(d.__$u=void 0,_.d())}}e(t)});Tn("__h",function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)});_t.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 a=2&this.__$f;if(!(r||a||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 Pt(e,t){return ne(function(){return ee(e,t)},[])}function ft(e,t){var n=O(e);return n.current=e,Xr.__$f|=4,ne(function(){return ge(function(){return n.current()},t)},[])}var dp=function(e){queueMicrotask(function(){queueMicrotask(e)})};function up(){xt(function(){for(var e;e=Js.shift();)Ys.call(e)})}function el(){Js.push(this)===1&&(J.requestAnimationFrame||dp)(up)}function tl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function nl(e){return tl(e)}function rl(e){return!(!tl(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function _p(e){return`${T.cssPrefix}:${e}`}function ol(e,t){let r=Object.entries(t).map(([o,a])=>{let s=_p(o),l=c=>a(c.detail);return e.addEventListener(s,l),[s,l]});return()=>{for(let[o,a]of r)e.removeEventListener(o,a)}}function Yr(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 pp=900,fp=640;function Ra(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<fp?"fullscreen":n>=(t.autoSizeBreakpoint??pp)?"expanded":"normal"}function nr(e,t,n,r=null){let a=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:Ra(e.mode,e.size,t);return{panelOpen:a,panelSize:l}}function In(){return typeof window>"u"?0:window.innerWidth}var mp="x-public-key",gp="x-ai-agent-deployment-id";function al(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");return{headers(){let t={[gp]:e.aiAgentDeploymentId};return e.publicKey&&(t[e.publicKeyHeader??mp]=e.publicKey),t}}}function rr(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(a,e),o=()=>a();t?.addEventListener("abort",o,{once:!0});function a(){clearTimeout(r),t?.removeEventListener("abort",o),n()}})}var Jr="1.3.9";var Xe=class extends Error{constructor(n,r,o,a){super(n);ae(this,"code",r);ae(this,"status",o);ae(this,"cause",a);this.name="StreamError"}};var il=se.scope("parser");async function*sl(e,t,n){if(!e.ok){let r=await e.text().catch(()=>"");throw new Xe(`server responded ${e.status}: ${r.slice(0,200)}`,"server",e.status)}for await(let r of vp(e,t)){let o=hp(r,n);if(o==="done")return;o&&(yield o)}}async function*vp(e,t){if(!e.body)throw new Xe("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:a}=await n.read();if(o){let l=r.trim();l&&(yield l);return}r+=a;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 hp(e,t){let n="",r;for(let o of e.split(`
|
|
10
10
|
`))if(o!==""){if(o.startsWith(":")){t?.(o.slice(1).trim());continue}if(o.startsWith("data:")){let a=o.slice(5).replace(/^ /,"");n=n?`${n}
|