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