import{l as T,m as j,s as z,V as H,q as h,z as m,G as g,H as w,K as v,Z as J,$ as K,a8 as V,ae as Y,o as A,x as k,a1 as Z,a2 as I,af as L,J as D,a5 as M,aw as N,n as q,v as O,aD as P,y as B,aE as C,A as Q,ah as R,Y as U,t as F,D as G,aF as W}from"./index.881b9b68.js";function E(a,l,t){const n=a.slice();return n[7]=l[t],n}function X(a){let l;return{c(){l=F(a[1])},m(t,n){k(t,l,n)},p(t,n){n&2&&G(l,t[1])},d(t){t&&D(l)}}}function S(a){let l,t=a[7]+"",n,s;return{c(){l=q("option"),n=F(t),l.__value=s=a[7],l.value=l.__value},m(i,_){k(i,l,_),B(l,n)},p(i,_){_&4&&t!==(t=i[7]+"")&&G(n,t),_&4&&s!==(s=i[7])&&(l.__value=s,l.value=l.__value)},d(i){i&&D(l)}}}function y(a){let l,t,n,s,i,_,d;t=new N({props:{show_label:a[4],$$slots:{default:[X]},$$scope:{ctx:a}}});let r=a[2],u=[];for(let e=0;e<r.length;e+=1)u[e]=S(E(a,r,e));return{c(){l=q("label"),h(t.$$.fragment),n=A(),s=q("select");for(let e=0;e<u.length;e+=1)u[e].c();O(s,"class","gr-box gr-input w-full disabled:cursor-not-allowed"),s.disabled=a[3],a[0]===void 0&&P(()=>a[5].call(s))},m(e,c){k(e,l,c),m(t,l,null),B(l,n),B(l,s);for(let b=0;b<u.length;b+=1)u[b].m(s,null);C(s,a[0]),i=!0,_||(d=Q(s,"change",a[5]),_=!0)},p(e,[c]){const b={};if(c&16&&(b.show_label=e[4]),c&1026&&(b.$$scope={dirty:c,ctx:e}),t.$set(b),c&4){r=e[2];let f;for(f=0;f<r.length;f+=1){const o=E(e,r,f);u[f]?u[f].p(o,c):(u[f]=S(o),u[f].c(),u[f].m(s,null))}for(;f<u.length;f+=1)u[f].d(1);u.length=r.length}(!i||c&8)&&(s.disabled=e[3]),c&5&&C(s,e[0])},i(e){i||(g(t.$$.fragment,e),i=!0)},o(e){w(t.$$.fragment,e),i=!1},d(e){e&&D(l),v(t),R(u,e),_=!1,d()}}}function p(a,l,t){let{label:n}=l,{value:s=void 0}=l,{choices:i}=l,{disabled:_=!1}=l,{show_label:d}=l;const r=U();function u(){s=W(this),t(0,s),t(2,i)}return a.$$set=e=>{"label"in e&&t(1,n=e.label),"value"in e&&t(0,s=e.value),"choices"in e&&t(2,i=e.choices),"disabled"in e&&t(3,_=e.disabled),"show_label"in e&&t(4,d=e.show_label)},a.$$.update=()=>{a.$$.dirty&1&&r("change",s)},[s,n,i,_,d,u]}class x extends T{constructor(l){super(),j(this,l,p,y,z,{label:1,value:0,choices:2,disabled:3,show_label:4})}}function $(a){let l,t,n,s,i;const _=[a[7]];let d={};for(let e=0;e<_.length;e+=1)d=J(d,_[e]);l=new K({props:d});function r(e){a[9](e)}let u={choices:a[4],label:a[1],show_label:a[5],disabled:a[8]==="static"};return a[0]!==void 0&&(u.value=a[0]),n=new x({props:u}),V.push(()=>Y(n,"value",r)),n.$on("change",a[10]),{c(){h(l.$$.fragment),t=A(),h(n.$$.fragment)},m(e,c){m(l,e,c),k(e,t,c),m(n,e,c),i=!0},p(e,c){const b=c&128?Z(_,[I(e[7])]):{};l.$set(b);const f={};c&16&&(f.choices=e[4]),c&2&&(f.label=e[1]),c&32&&(f.show_label=e[5]),c&256&&(f.disabled=e[8]==="static"),!s&&c&1&&(s=!0,f.value=e[0],L(()=>s=!1)),n.$set(f)},i(e){i||(g(l.$$.fragment,e),g(n.$$.fragment,e),i=!0)},o(e){w(l.$$.fragment,e),w(n.$$.fragment,e),i=!1},d(e){v(l,e),e&&D(t),v(n,e)}}}function ee(a){let l,t;return l=new H({props:{visible:a[3],elem_id:a[2],disable:typeof a[6].container=="boolean"&&!a[6].container,$$slots:{default:[$]},$$scope:{ctx:a}}}),{c(){h(l.$$.fragment)},m(n,s){m(l,n,s),t=!0},p(n,[s]){const i={};s&8&&(i.visible=n[3]),s&4&&(i.elem_id=n[2]),s&64&&(i.disable=typeof n[6].container=="boolean"&&!n[6].container),s&2483&&(i.$$scope={dirty:s,ctx:n}),l.$set(i)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){w(l.$$.fragment,n),t=!1},d(n){v(l,n)}}}function le(a,l,t){let{label:n="Dropdown"}=l,{elem_id:s=""}=l,{visible:i=!0}=l,{value:_=""}=l,{choices:d}=l,{show_label:r}=l,{style:u={}}=l,{loading_status:e}=l,{mode:c}=l;function b(o){_=o,t(0,_)}function f(o){M.call(this,a,o)}return a.$$set=o=>{"label"in o&&t(1,n=o.label),"elem_id"in o&&t(2,s=o.elem_id),"visible"in o&&t(3,i=o.visible),"value"in o&&t(0,_=o.value),"choices"in o&&t(4,d=o.choices),"show_label"in o&&t(5,r=o.show_label),"style"in o&&t(6,u=o.style),"loading_status"in o&&t(7,e=o.loading_status),"mode"in o&&t(8,c=o.mode)},[_,n,s,i,d,r,u,e,c,b,f]}class te extends T{constructor(l){super(),j(this,l,le,ee,z,{label:1,elem_id:2,visible:3,value:0,choices:4,show_label:5,style:6,loading_status:7,mode:8})}}var ne=te;const se=["static","dynamic"],ie=a=>({type:"string",description:"selected choice",example_data:a.choices.length?a.choices[0]:""});export{ne as Component,ie as document,se as modes};
