import{S as T,i as A,s as F,j as G,b as h,e as m,k as v,d as p,a as d,R as C,f as r,g as S,h as b,m as H,t as y,n as M,o as j,q as L,u as g,v as w,w as q,z as I,x as J,y as K}from"./index.9fc31042.js";import{B as O}from"./Block.ddaaf792.js";import{S as P}from"./StatusTracker.14e5b2a2.js";function N(f,e,n){const t=f.slice();return t[4]=e[n],t}function z(f){let e,n=f[0].confidences,t=[];for(let s=0;s<n.length;s+=1)t[s]=E(N(f,n,s));return{c(){for(let s=0;s<t.length;s+=1)t[s].c();e=G()},m(s,a){for(let l=0;l<t.length;l+=1)t[l].m(s,a);h(s,e,a)},p(s,a){if(a&1){n=s[0].confidences;let l;for(l=0;l<n.length;l+=1){const i=N(s,n,l);t[l]?t[l].p(i,a):(t[l]=E(i),t[l].c(),t[l].m(e.parentNode,e))}for(;l<t.length;l+=1)t[l].d(1);t.length=n.length}},d(s){H(t,s),s&&b(e)}}}function D(f){let e,n,t,s=Math.round(f[4].confidence*100)+"",a,l;return{c(){e=m("div"),n=v(),t=m("div"),a=p(s),l=p("%"),d(e,"class","flex-1 border border-dashed border-gray-100 px-4"),d(t,"class","text-right ml-auto")},m(i,o){h(i,e,o),h(i,n,o),h(i,t,o),r(t,a),r(t,l)},p(i,o){o&1&&s!==(s=Math.round(i[4].confidence*100)+"")&&S(a,s)},d(i){i&&b(e),i&&b(n),i&&b(t)}}}function E(f){let e,n,t,s,a,l,i=f[4].label+"",o,c,B,u=f[0].confidences&&D(f);return{c(){e=m("div"),n=m("div"),t=m("div"),s=v(),a=m("div"),l=m("div"),o=p(i),c=v(),u&&u.c(),B=v(),d(t,"class","h-1 mb-1 rounded bg-gradient-to-r group-hover:from-orange-500 from-orange-400 to-orange-200 dark:from-orange-400 dark:to-orange-600"),C(t,"width",f[4].confidence*100+"%"),d(l,"class","leading-snug"),d(a,"class","flex items-baseline space-x-2 group-hover:text-orange-500"),d(n,"class","flex-1"),d(e,"class","flex items-start justify-between font-mono text-sm leading-none group")},m(_,k){h(_,e,k),r(e,n),r(n,t),r(n,s),r(n,a),r(a,l),r(l,o),r(a,c),u&&u.m(a,null),r(e,B)},p(_,k){k&1&&C(t,"width",_[4].confidence*100+"%"),k&1&&i!==(i=_[4].label+"")&&S(o,i),_[0].confidences?u?u.p(_,k):(u=D(_),u.c(),u.m(a,null)):u&&(u.d(1),u=null)},d(_){_&&b(e),u&&u.d()}}}function Q(f){let e,n,t=f[0].label+"",s,a,l=f[0].confidences&&z(f);return{c(){e=m("div"),n=m("div"),s=p(t),a=v(),l&&l.c(),d(n,"class","output-class font-bold text-2xl py-6 px-4 flex-grow flex items-center justify-center"),y(n,"sr-only",!f[2]),y(n,"no-confidence",!("confidences"in f[0])),d(e,"class","output-label"),d(e,"space-y-4",""),d(e,"theme",f[1])},m(i,o){h(i,e,o),r(e,n),r(n,s),r(e,a),l&&l.m(e,null)},p(i,[o]){o&1&&t!==(t=i[0].label+"")&&S(s,t),o&4&&y(n,"sr-only",!i[2]),o&1&&y(n,"no-confidence",!("confidences"in i[0])),i[0].confidences?l?l.p(i,o):(l=z(i),l.c(),l.m(e,null)):l&&(l.d(1),l=null),o&2&&d(e,"theme",i[1])},i:M,o:M,d(i){i&&b(e),l&&l.d()}}}function U(f,e,n){let{value:t}=e,{style:s=""}=e,{theme:a="default"}=e,{show_label:l}=e;return f.$$set=i=>{"value"in i&&n(0,t=i.value),"style"in i&&n(3,s=i.style),"theme"in i&&n(1,a=i.theme),"show_label"in i&&n(2,l=i.show_label)},[t,a,l,s]}class V extends T{constructor(e){super(),A(this,e,U,Q,F,{value:0,style:3,theme:1,show_label:2})}}function R(f){let e,n;return e=new V({props:{style:f[1],value:f[0],show_label:f[3]}}),{c(){j(e.$$.fragment)},m(t,s){L(e,t,s),n=!0},p(t,s){const a={};s&2&&(a.style=t[1]),s&1&&(a.value=t[0]),s&8&&(a.show_label=t[3]),e.$set(a)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){w(e.$$.fragment,t),n=!1},d(t){q(e,t)}}}function W(f){let e,n,t,s;e=new P({props:{tracked_status:f[2]}});let a=f[0]!==void 0&&f[0]!==null&&R(f);return{c(){j(e.$$.fragment),n=v(),a&&a.c(),t=G()},m(l,i){L(e,l,i),h(l,n,i),a&&a.m(l,i),h(l,t,i),s=!0},p(l,i){const o={};i&4&&(o.tracked_status=l[2]),e.$set(o),l[0]!==void 0&&l[0]!==null?a?(a.p(l,i),i&1&&g(a,1)):(a=R(l),a.c(),g(a,1),a.m(t.parentNode,t)):a&&(J(),w(a,1,1,()=>{a=null}),K())},i(l){s||(g(e.$$.fragment,l),g(a),s=!0)},o(l){w(e.$$.fragment,l),w(a),s=!1},d(l){q(e,l),l&&b(n),a&&a.d(l),l&&b(t)}}}function X(f){let e,n;return e=new O({props:{$$slots:{default:[W]},$$scope:{ctx:f}}}),{c(){j(e.$$.fragment)},m(t,s){L(e,t,s),n=!0},p(t,[s]){const a={};s&79&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){w(e.$$.fragment,t),n=!1},d(t){q(e,t)}}}function Y(f,e,n){let{value:t}=e,{default_value:s}=e,{style:a=""}=e,{loading_status:l}=e,{show_label:i}=e;const o=I();return s&&(t=s),f.$$set=c=>{"value"in c&&n(0,t=c.value),"default_value"in c&&n(4,s=c.default_value),"style"in c&&n(1,a=c.style),"loading_status"in c&&n(2,l=c.loading_status),"show_label"in c&&n(3,i=c.show_label)},f.$$.update=()=>{f.$$.dirty&1&&o("change")},[t,a,l,i,s]}class Z extends T{constructor(e){super(),A(this,e,Y,X,F,{value:0,default_value:4,style:1,loading_status:2,show_label:3})}}var te=Z;const le=["static"];export{te as Component,le as modes};
