import{S as E,i as U,s as x,f as v,h as S,m as b,b as d,c as m,d as h,j as B,e as g,n as H,o as A,A as D,a2 as K,a3 as L,a4 as T,C as M,q as p,u as y,v as k,w,x as C,K as z,L as F,M as G,E as I}from"./index.f808f2eb.js";import{B as J}from"./Block.58108406.js";import{S as N}from"./StatusTracker.9996b515.js";function j(o,t,s){const l=o.slice();return l[9]=t[s],l}function q(o){let t,s=o[9][0]+"",l,a,n,r,e=o[9][1]+"",c,i,_;return{c(){t=v("div"),l=S(s),n=b(),r=v("div"),c=S(e),i=b(),d(t,"data-testid","user"),d(t,"class","px-3 py-2 rounded-[22px] rounded-br-none text-white ml-7 text-sm"),d(t,"style",a="background-color:"+o[2][0]),d(r,"data-testid","bot"),d(r,"class","px-3 py-2 rounded-[22px] rounded-bl-none place-self-start text-white ml-7 text-sm"),d(r,"style",_="background-color:"+o[2][1])},m(f,u){m(f,t,u),h(t,l),m(f,n,u),m(f,r,u),h(r,c),h(r,i)},p(f,u){u&1&&s!==(s=f[9][0]+"")&&B(l,s),u&4&&a!==(a="background-color:"+f[2][0])&&d(t,"style",a),u&1&&e!==(e=f[9][1]+"")&&B(c,e),u&4&&_!==(_="background-color:"+f[2][1])&&d(r,"style",_)},d(f){f&&g(t),f&&g(n),f&&g(r)}}}function O(o){let t,s,l=o[0],a=[];for(let n=0;n<l.length;n+=1)a[n]=q(j(o,l,n));return{c(){t=v("div"),s=v("div");for(let n=0;n<a.length;n+=1)a[n].c();d(s,"class","flex flex-col items-end space-y-4 p-3"),d(t,"class","overflow-y-auto h-[40vh]")},m(n,r){m(n,t,r),h(t,s);for(let e=0;e<a.length;e+=1)a[e].m(s,null);o[5](t)},p(n,[r]){if(r&5){l=n[0];let e;for(e=0;e<l.length;e+=1){const c=j(n,l,e);a[e]?a[e].p(c,r):(a[e]=q(c),a[e].c(),a[e].m(s,null))}for(;e<a.length;e+=1)a[e].d(1);a.length=l.length}},i:H,o:H,d(n){n&&g(t),A(a,n),o[5](null)}}}function P(o,t,s){let l,{value:a}=t,{style:n=""}=t,{color_map:r=void 0}=t,e,c;const i=D();K(()=>{c=e&&e.offsetHeight+e.scrollTop>e.scrollHeight-20}),L(()=>{c&&e.scrollTo(0,e.scrollHeight)});function _(){return r?r.map(u=>u in T?T[u].primary:u):["#fb923c","#9ca3af"]}function f(u){M[u?"unshift":"push"](()=>{e=u,s(1,e)})}return o.$$set=u=>{"value"in u&&s(0,a=u.value),"style"in u&&s(3,n=u.style),"color_map"in u&&s(4,r=u.color_map)},o.$$.update=()=>{o.$$.dirty&1&&a&&i("change")},s(2,l=_()),[a,e,l,n,r,f]}class Q extends E{constructor(t){super(),U(this,t,P,O,x,{value:0,style:3,color_map:4})}}function R(o){let t,s,l,a;const n=[o[3]];let r={};for(let e=0;e<n.length;e+=1)r=z(r,n[e]);return t=new N({props:r}),l=new Q({props:{value:o[0],style:o[1],color_map:o[2]}}),l.$on("change",o[5]),{c(){p(t.$$.fragment),s=b(),p(l.$$.fragment)},m(e,c){y(t,e,c),m(e,s,c),y(l,e,c),a=!0},p(e,c){const i=c&8?F(n,[G(e[3])]):{};t.$set(i);const _={};c&1&&(_.value=e[0]),c&2&&(_.style=e[1]),c&4&&(_.color_map=e[2]),l.$set(_)},i(e){a||(k(t.$$.fragment,e),k(l.$$.fragment,e),a=!0)},o(e){w(t.$$.fragment,e),w(l.$$.fragment,e),a=!1},d(e){C(t,e),e&&g(s),C(l,e)}}}function V(o){let t,s;return t=new J({props:{padding:!1,$$slots:{default:[R]},$$scope:{ctx:o}}}),{c(){p(t.$$.fragment)},m(l,a){y(t,l,a),s=!0},p(l,[a]){const n={};a&79&&(n.$$scope={dirty:a,ctx:l}),t.$set(n)},i(l){s||(k(t.$$.fragment,l),s=!0)},o(l){w(t.$$.fragment,l),s=!1},d(l){C(t,l)}}}function W(o,t,s){let{value:l=[]}=t,{default_value:a}=t,{style:n=""}=t,{color_map:r}=t,{loading_status:e}=t;a&&(l=a);function c(i){I.call(this,o,i)}return o.$$set=i=>{"value"in i&&s(0,l=i.value),"default_value"in i&&s(4,a=i.default_value),"style"in i&&s(1,n=i.style),"color_map"in i&&s(2,r=i.color_map),"loading_status"in i&&s(3,e=i.loading_status)},[l,n,r,e,a,c]}class X extends E{constructor(t){super(),U(this,t,W,V,x,{value:0,default_value:4,style:1,color_map:2,loading_status:3})}}var ee=X;const te=["static"];export{ee as Component,te as modes};
