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