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