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