import{k as S,m as T,s as j,U as G,q as d,z as h,F as g,G as v,J as k,Y as H,Z as I,a6 as J,ac as U,o as z,x as D,$ as W,a0 as Y,ad as Z,H as q,a3 as w,au as K,n as B,v as N,y as C,aw as E,A as y,aI as A,ab as L,W as M,t as O,D as P,ax as Q}from"./index.ec2afa6c.js";function R(l){let e;return{c(){e=O(l[2])},m(t,a){D(t,e,a)},p(t,a){a&4&&P(e,t[2])},d(t){t&&q(e)}}}function V(l){let e,t,a,s,u,_,f;return t=new K({props:{show_label:l[3],$$slots:{default:[R]},$$scope:{ctx:l}}}),{c(){e=B("label"),d(t.$$.fragment),a=z(),s=B("input"),N(s,"type","number"),N(s,"class","gr-box gr-input w-full gr-text-input"),s.disabled=l[1],N(e,"class","block")},m(r,o){D(r,e,o),h(t,e,null),C(e,a),C(e,s),E(s,l[0]),u=!0,_||(f=[y(s,"input",l[6]),y(s,"keypress",l[4]),y(s,"blur",l[5])],_=!0)},p(r,[o]){const n={};o&8&&(n.show_label=r[3]),o&516&&(n.$$scope={dirty:o,ctx:r}),t.$set(n),(!u||o&2)&&(s.disabled=r[1]),o&1&&A(s.value)!==r[0]&&E(s,r[0])},i(r){u||(g(t.$$.fragment,r),u=!0)},o(r){v(t.$$.fragment,r),u=!1},d(r){r&&q(e),k(t),_=!1,L(f)}}}function X(l,e,t){let{value:a=0}=e,{disabled:s=!1}=e,{label:u}=e,{show_label:_}=e;const f=M();function r(b){!isNaN(b)&&b!==null&&f("change",b)}async function o(b){await Q(),b.key==="Enter"&&(b.preventDefault(),f("submit"))}function n(b){f("blur")}function c(){a=A(this.value),t(0,a)}return l.$$set=b=>{"value"in b&&t(0,a=b.value),"disabled"in b&&t(1,s=b.disabled),"label"in b&&t(2,u=b.label),"show_label"in b&&t(3,_=b.show_label)},l.$$.update=()=>{l.$$.dirty&1&&r(a)},[a,s,u,_,o,n,c]}class p extends S{constructor(e){super(),T(this,e,X,V,j,{value:0,disabled:1,label:2,show_label:3})}}function x(l){let e,t,a,s,u;const _=[l[6]];let f={};for(let n=0;n<_.length;n+=1)f=H(f,_[n]);e=new I({props:f});function r(n){l[8](n)}let o={label:l[1],show_label:l[5],disabled:l[7]==="static"};return l[0]!==void 0&&(o.value=l[0]),a=new p({props:o}),J.push(()=>U(a,"value",r)),a.$on("change",l[9]),a.$on("submit",l[10]),a.$on("blur",l[11]),{c(){d(e.$$.fragment),t=z(),d(a.$$.fragment)},m(n,c){h(e,n,c),D(n,t,c),h(a,n,c),u=!0},p(n,c){const b=c&64?W(_,[Y(n[6])]):{};e.$set(b);const m={};c&2&&(m.label=n[1]),c&32&&(m.show_label=n[5]),c&128&&(m.disabled=n[7]==="static"),!s&&c&1&&(s=!0,m.value=n[0],Z(()=>s=!1)),a.$set(m)},i(n){u||(g(e.$$.fragment,n),g(a.$$.fragment,n),u=!0)},o(n){v(e.$$.fragment,n),v(a.$$.fragment,n),u=!1},d(n){k(e,n),n&&q(t),k(a,n)}}}function $(l){let e,t;return e=new G({props:{visible:l[3],elem_id:l[2],disable:typeof l[4].container=="boolean"&&!l[4].container,$$slots:{default:[x]},$$scope:{ctx:l}}}),{c(){d(e.$$.fragment)},m(a,s){h(e,a,s),t=!0},p(a,[s]){const u={};s&8&&(u.visible=a[3]),s&4&&(u.elem_id=a[2]),s&16&&(u.disable=typeof a[4].container=="boolean"&&!a[4].container),s&4323&&(u.$$scope={dirty:s,ctx:a}),e.$set(u)},i(a){t||(g(e.$$.fragment,a),t=!0)},o(a){v(e.$$.fragment,a),t=!1},d(a){k(e,a)}}}function ee(l,e,t){let{label:a="Number"}=e,{elem_id:s=""}=e,{visible:u=!0}=e,{style:_={}}=e,{value:f=0}=e,{show_label:r}=e,{loading_status:o}=e,{mode:n}=e;function c(i){f=i,t(0,f)}function b(i){w.call(this,l,i)}function m(i){w.call(this,l,i)}function F(i){w.call(this,l,i)}return l.$$set=i=>{"label"in i&&t(1,a=i.label),"elem_id"in i&&t(2,s=i.elem_id),"visible"in i&&t(3,u=i.visible),"style"in i&&t(4,_=i.style),"value"in i&&t(0,f=i.value),"show_label"in i&&t(5,r=i.show_label),"loading_status"in i&&t(6,o=i.loading_status),"mode"in i&&t(7,n=i.mode)},[f,a,s,u,_,r,o,n,c,b,m,F]}class ae extends S{constructor(e){super(),T(this,e,ee,$,j,{label:1,elem_id:2,visible:3,style:4,value:0,show_label:5,loading_status:6,mode:7})}}var te=ae;const ne=["static","dynamic"],se=l=>{var e;return{type:"number",description:"numeric value",example_data:(e=l.value)!=null?e:1}};export{te as Component,se as document,ne as modes};
