import"./DsnmJJEf.js";import{w as O,p as P,b as Q,e as w,m as i,r,h as x,l as R,g as o,v as D,a as d,i as T,x as E,c as V,f as W}from"./BZ0BXH4m.js";import{s as N}from"./B98B7x2v.js";import{p as g,i as q}from"./CUAkeMiK.js";import{e as X,i as Y}from"./B9BLuPDP.js";import{s as k,r as Z}from"./C5ruyaoV.js";import{d as $}from"./fIP5WTNy.js";import{b as ee}from"./kHklRsBK.js";function ae(m,e,t,_,v){o(e)?t([]):t(_.elements),v()(t())}function te(m,e,t){e()(t())}var le=w('<div class="text-muted">No elements available to select.</div>'),se=w('<div class="form-check form-check-inline"><input class="form-check-input" type="checkbox"/> <label class="form-check-label"> </label></div>'),ie=w('<div class="row mb-2"><div class="col-sm-3 d-flex justify-content-between"><label class="form-label fw-medium fs-4"> </label> <div><button class="btn btn-outline-primary btn-sm align-self-baseline px-3"><!></button></div></div> <div class="col-sm-9 form-group"><!></div></div>');function _e(m,e){const t=O();P(e,!0);const _=[];let v=g(e,"value",31,()=>Q(e.elements)),y=g(e,"disabled",3,!1),A=g(e,"onUpdate",3,()=>{}),C=R(()=>v().length==e.elements.length);var b=ie(),u=i(b),n=i(u),z=i(n,!0);r(n);var S=x(n,2),f=i(S);f.__click=[ae,C,v,e,A];var B=i(f);{var F=a=>{var l=E("Deselect all");d(a,l)},G=a=>{var l=E("Select all");d(a,l)};q(B,a=>{o(C)?a(F):a(G,!1)})}r(f),r(S),r(u);var U=x(u,2),H=i(U);{var I=a=>{var l=le();d(a,l)},J=a=>{var l=V(),K=W(l);X(K,17,()=>e.elements,Y,(L,c)=>{var h=se(),s=i(h);Z(s),s.__change=[te,A,v];var j,p=x(s,2),M=i(p,!0);r(p),r(h),D(()=>{k(s,"id",`${o(c)}Checkbox${t}`),s.disabled=y(),j!==(j=o(c))&&(s.value=(s.__value=o(c))??""),k(p,"for",`${o(c)}Checkbox${t}`),N(M,o(c))}),ee(_,[],s,()=>(o(c),v()),v),d(L,h)}),d(a,l)};q(H,a=>{e.elements.length==0?a(I):a(J,!1)})}r(U),r(b),D(()=>{k(n,"for","checkbox"+t),N(z,e.label),f.disabled=y()}),d(m,b),T()}$(["click","change"]);export{_e as A};
