import{s as F,e as E,a as D,t as U,c as I,b as A,g as L,d as V,f as S,o as h,i as j,h as g,B,n as M,C as G,D as q,G as H,H as J,I as R,E as O,j as w,J as z}from"./scheduler.Bw2O2KLD.js";import{e as N}from"./each.D6YF6ztN.js";import{S as K,i as Q}from"./index.Cyrvb228.js";function P(i,t,e){const a=i.slice();return a[11]=t[e],a[13]=e,a}function T(i){let t,e,a,o=!1,r,k,u,_,f=i[11]+"",d,m,p,b,n,c;return b=R(i[9][0]),{c(){t=E("div"),e=E("input"),u=D(),_=E("label"),d=U(f),p=D(),this.h()},l(s){t=I(s,"DIV",{class:!0});var l=A(t);e=I(l,"INPUT",{class:!0,type:!0,id:!0}),u=L(l),_=I(l,"LABEL",{class:!0,for:!0});var v=A(_);d=V(v,f),v.forEach(S),p=L(l),l.forEach(S),this.h()},h(){h(e,"class","form-check-input"),h(e,"type","checkbox"),e.__value=a=i[11],O(e,e.__value),h(e,"id",r=i[11]+"_checkbox_"+i[3]),e.disabled=k=!i[2],h(_,"class","form-check-label"),h(_,"for",m=i[11]+"_checkbox"),h(t,"class","form-check form-check-inline"),b.p(e)},m(s,l){j(s,t,l),g(t,e),e.checked=~(i[0]||[]).indexOf(e.__value),g(t,u),g(t,_),g(_,d),g(t,p),n||(c=[B(e,"change",i[8]),B(e,"change",i[6])],n=!0)},p(s,l){l&2&&a!==(a=s[11])&&(e.__value=a,O(e,e.__value),o=!0),l&10&&r!==(r=s[11]+"_checkbox_"+s[3])&&h(e,"id",r),l&4&&k!==(k=!s[2])&&(e.disabled=k),(o||l&3)&&(e.checked=~(s[0]||[]).indexOf(e.__value)),l&2&&f!==(f=s[11]+"")&&w(d,f),l&2&&m!==(m=s[11]+"_checkbox")&&h(_,"for",m)},d(s){s&&S(t),b.r(),n=!1,q(c)}}}function W(i){let t,e,a,o,r,k,u,_,f,d,m,p,b=N(i[1]),n=[];for(let c=0;c<b.length;c+=1)n[c]=T(P(i,b,c));return{c(){t=E("form"),e=E("div"),a=E("input"),k=D(),u=E("label"),_=U("Select all"),d=D();for(let c=0;c<n.length;c+=1)n[c].c();this.h()},l(c){t=I(c,"FORM",{});var s=A(t);e=I(s,"DIV",{class:!0});var l=A(e);a=I(l,"INPUT",{class:!0,type:!0,id:!0}),k=L(l),u=I(l,"LABEL",{class:!0,for:!0});var v=A(u);_=V(v,"Select all"),v.forEach(S),l.forEach(S),d=L(s);for(let C=0;C<n.length;C+=1)n[C].l(s);s.forEach(S),this.h()},h(){h(a,"class","form-check-input"),h(a,"type","checkbox"),h(a,"id",o="all_checkbox_"+i[3]),a.disabled=r=!i[2],h(u,"class","form-check-label"),h(u,"for",f="all_checkbox_"+i[3]),h(e,"class","form-check form-check-inline")},m(c,s){j(c,t,s),g(t,e),g(e,a),a.checked=i[4],g(e,k),g(e,u),g(u,_),g(t,d);for(let l=0;l<n.length;l+=1)n[l]&&n[l].m(t,null);m||(p=[B(a,"change",i[7]),B(a,"change",i[5])],m=!0)},p(c,[s]){if(s&8&&o!==(o="all_checkbox_"+c[3])&&h(a,"id",o),s&4&&r!==(r=!c[2])&&(a.disabled=r),s&16&&(a.checked=c[4]),s&8&&f!==(f="all_checkbox_"+c[3])&&h(u,"for",f),s&79){b=N(c[1]);let l;for(l=0;l<b.length;l+=1){const v=P(c,b,l);n[l]?n[l].p(v,s):(n[l]=T(v),n[l].c(),n[l].m(t,null))}for(;l<n.length;l+=1)n[l].d(1);n.length=b.length}},i:M,o:M,d(c){c&&S(t),G(n,c),m=!1,q(p)}}}function X(i,t,e){let{elements:a}=t,{selected_elements:o}=t,{enabled:r=!0}=t;const k=H();let u="",_=!1;function f(){_?e(0,o=a):e(0,o=[]),d()}function d(){e(4,_=o.length==a.length),k("selection-changed",o)}J(()=>{e(0,o=a),e(3,u=Math.random().toString(16).slice(2)),d()});const m=[[]];function p(){_=this.checked,e(4,_)}function b(){o=z(m[0],this.__value,this.checked),e(0,o)}return i.$$set=n=>{"elements"in n&&e(1,a=n.elements),"selected_elements"in n&&e(0,o=n.selected_elements),"enabled"in n&&e(2,r=n.enabled)},[o,a,r,u,_,f,d,p,b,m]}class x extends K{constructor(t){super(),Q(this,t,X,W,F,{elements:1,selected_elements:0,enabled:2})}}export{x as A};
