import{S as q,i as C,s as T,e as B,o as c,k as z,a as w,b as v,q as d,f as N,a1 as S,l as D,aa as H,u as h,v as g,h as y,w as k,r as j,z as A,d as F,g as G,U as I,B as J,H as K,E as L,D as E}from"./index.9fc31042.js";import{B as M}from"./Block.ddaaf792.js";import{B as O}from"./BlockTitle.1244283a.js";import{S as P}from"./StatusTracker.14e5b2a2.js";function Q(n){let e;return{c(){e=F(n[2])},m(l,a){v(l,e,a)},p(l,a){a&4&&G(e,l[2])},d(l){l&&y(e)}}}function R(n){let e,l,a,s,i,_,r;return l=new O({props:{show_label:n[3],$$slots:{default:[Q]},$$scope:{ctx:n}}}),{c(){e=B("label"),c(l.$$.fragment),a=z(),s=B("input"),w(s,"type","number"),w(s,"class","gr-box gr-input w-full gr-text-input"),s.disabled=n[1],w(e,"class","block")},m(t,u){v(t,e,u),d(l,e,null),N(e,a),N(e,s),S(s,n[0]),i=!0,_||(r=[D(s,"input",n[6]),D(s,"keypress",n[4])],_=!0)},p(t,[u]){const b={};u&8&&(b.show_label=t[3]),u&516&&(b.$$scope={dirty:u,ctx:t}),l.$set(b),(!i||u&2)&&(s.disabled=t[1]),u&1&&H(s.value)!==t[0]&&S(s,t[0])},i(t){i||(h(l.$$.fragment,t),i=!0)},o(t){g(l.$$.fragment,t),i=!1},d(t){t&&y(e),k(l),_=!1,j(r)}}}function V(n,e,l){let{value:a=0}=e,{disabled:s=!1}=e,{label:i}=e,{style:_=""}=e,{show_label:r}=e;const t=A();function u(o){t("change",o)}async function b(o){await I(),o.key==="Enter"&&(o.preventDefault(),t("submit"))}function m(){a=H(this.value),l(0,a)}return n.$$set=o=>{"value"in o&&l(0,a=o.value),"disabled"in o&&l(1,s=o.disabled),"label"in o&&l(2,i=o.label),"style"in o&&l(5,_=o.style),"show_label"in o&&l(3,r=o.show_label)},n.$$.update=()=>{n.$$.dirty&1&&u(a)},[a,s,i,r,b,_,m]}class W extends q{constructor(e){super(),C(this,e,V,R,T,{value:0,disabled:1,label:2,style:5,show_label:3})}}function X(n){let e,l,a,s,i;e=new P({props:{tracked_status:n[4]}});function _(t){n[8](t)}let r={label:n[1],show_label:n[3],style:n[5],disabled:n[6]==="static"};return n[0]!==void 0&&(r.value=n[0]),a=new W({props:r}),J.push(()=>K(a,"value",_)),a.$on("change",n[9]),a.$on("submit",n[10]),{c(){c(e.$$.fragment),l=z(),c(a.$$.fragment)},m(t,u){d(e,t,u),v(t,l,u),d(a,t,u),i=!0},p(t,u){const b={};u&16&&(b.tracked_status=t[4]),e.$set(b);const m={};u&2&&(m.label=t[1]),u&8&&(m.show_label=t[3]),u&32&&(m.style=t[5]),u&64&&(m.disabled=t[6]==="static"),!s&&u&1&&(s=!0,m.value=t[0],L(()=>s=!1)),a.$set(m)},i(t){i||(h(e.$$.fragment,t),h(a.$$.fragment,t),i=!0)},o(t){g(e.$$.fragment,t),g(a.$$.fragment,t),i=!1},d(t){k(e,t),t&&y(l),k(a,t)}}}function Y(n){let e,l;return e=new M({props:{form_position:n[2],$$slots:{default:[X]},$$scope:{ctx:n}}}),{c(){c(e.$$.fragment)},m(a,s){d(e,a,s),l=!0},p(a,[s]){const i={};s&4&&(i.form_position=a[2]),s&2171&&(i.$$scope={dirty:s,ctx:a}),e.$set(i)},i(a){l||(h(e.$$.fragment,a),l=!0)},o(a){g(e.$$.fragment,a),l=!1},d(a){k(e,a)}}}function Z(n,e,l){let{label:a="Number"}=e,{value:s=0}=e,{default_value:i}=e,{form_position:_="single"}=e,{show_label:r}=e,{loading_status:t}=e,{style:u=""}=e,{mode:b}=e;i&&(s=i);function m(f){s=f,l(0,s)}function o(f){E.call(this,n,f)}function U(f){E.call(this,n,f)}return n.$$set=f=>{"label"in f&&l(1,a=f.label),"value"in f&&l(0,s=f.value),"default_value"in f&&l(7,i=f.default_value),"form_position"in f&&l(2,_=f.form_position),"show_label"in f&&l(3,r=f.show_label),"loading_status"in f&&l(4,t=f.loading_status),"style"in f&&l(5,u=f.style),"mode"in f&&l(6,b=f.mode)},[s,a,_,r,t,u,b,i,m,o,U]}class p extends q{constructor(e){super(),C(this,e,Z,Y,T,{label:1,value:0,default_value:7,form_position:2,show_label:3,loading_status:4,style:5,mode:6})}}var le=p;const ae=["static","dynamic"];export{le as Component,ae as modes};
