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