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