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