import{S as y,i as C,s as G,e as g,m as x,f as B,a as h,t as k,b as _,g as b,c as H,h as E,j as m,u as S,v as j,x as q,y as z,z as D,o as K,C as O,E as T,K as A,H as F,G as I}from"./index.bbdd6a1e.js";import{B as J}from"./BlockTitle.5d44bbf1.js";function v(a,l,t){const s=a.slice();return s[8]=l[t],s[10]=t,s}function L(a){let l;return{c(){l=B(a[3])},m(t,s){_(t,l,s)},p(t,s){s&8&&E(l,t[3])},d(t){t&&m(l)}}}function w(a){let l,t,s,i,u,c=a[8]+"",o,n,f;function r(){return a[6](a[8])}return{c(){l=g("label"),t=g("input"),i=x(),u=g("span"),o=B(c),t.disabled=a[2],t.checked=s=a[0].includes(a[8]),h(t,"type","checkbox"),h(t,"name","test"),h(t,"class","rounded border-gray-300 text-blue-600 disabled:text-gray-400 disabled:cursor-not-allowed shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 focus:ring-opacity-50"),h(u,"class","ml-2"),h(l,"class","flex items-center text-gray-700 text-sm space-x-2 border py-1.5 px-3 rounded-lg cursor-pointer bg-white shadow-sm checked:shadow-inner"),k(l,"!cursor-not-allowed",a[2])},m(e,d){_(e,l,d),b(l,t),b(l,i),b(l,u),b(u,o),n||(f=H(t,"change",r),n=!0)},p(e,d){a=e,d&4&&(t.disabled=a[2]),d&3&&s!==(s=a[0].includes(a[8]))&&(t.checked=s),d&2&&c!==(c=a[8]+"")&&E(o,c),d&4&&k(l,"!cursor-not-allowed",a[2])},d(e){e&&m(l),n=!1,f()}}}function M(a){let l,t,s,i,u;t=new J({props:{$$slots:{default:[L]},$$scope:{ctx:a}}});let c=a[1],o=[];for(let n=0;n<c.length;n+=1)o[n]=w(v(a,c,n));return{c(){l=g("fieldset"),S(t.$$.fragment),s=x(),i=g("div");for(let n=0;n<o.length;n+=1)o[n].c();h(i,"class","flex flex-wrap gap-2"),h(i,"data-testid","checkbox-group"),h(l,"class","gr-box overflow-hidden border-solid border border-gray-200 gr-panel")},m(n,f){_(n,l,f),j(t,l,null),b(l,s),b(l,i);for(let r=0;r<o.length;r+=1)o[r].m(i,null);u=!0},p(n,[f]){const r={};if(f&2056&&(r.$$scope={dirty:f,ctx:n}),t.$set(r),f&23){c=n[1];let e;for(e=0;e<c.length;e+=1){const d=v(n,c,e);o[e]?o[e].p(d,f):(o[e]=w(d),o[e].c(),o[e].m(i,null))}for(;e<o.length;e+=1)o[e].d(1);o.length=c.length}},i(n){u||(q(t.$$.fragment,n),u=!0)},o(n){z(t.$$.fragment,n),u=!1},d(n){n&&m(l),D(t),K(o,n)}}}function N(a,l,t){let{value:s=[]}=l,{choices:i}=l,{disabled:u=!1}=l,{label:c}=l,{style:o=""}=l;const n=O(),f=e=>{s.includes(e)?s.splice(s.indexOf(e),1):s.push(e),n("change",s),t(0,s)},r=e=>f(e);return a.$$set=e=>{"value"in e&&t(0,s=e.value),"choices"in e&&t(1,i=e.choices),"disabled"in e&&t(2,u=e.disabled),"label"in e&&t(3,c=e.label),"style"in e&&t(5,o=e.style)},[s,i,u,c,f,o,r]}class P extends y{constructor(l){super(),C(this,l,N,M,G,{value:0,choices:1,disabled:2,label:3,style:5})}}function Q(a){let l,t,s;function i(c){a[6](c)}let u={choices:a[1],style:a[3],label:a[4],disabled:a[2]==="static"};return a[0]!==void 0&&(u.value=a[0]),l=new P({props:u}),T.push(()=>A(l,"value",i)),l.$on("change",a[7]),{c(){S(l.$$.fragment)},m(c,o){j(l,c,o),s=!0},p(c,[o]){const n={};o&2&&(n.choices=c[1]),o&8&&(n.style=c[3]),o&16&&(n.label=c[4]),o&4&&(n.disabled=c[2]==="static"),!t&&o&1&&(t=!0,n.value=c[0],F(()=>t=!1)),l.$set(n)},i(c){s||(q(l.$$.fragment,c),s=!0)},o(c){z(l.$$.fragment,c),s=!1},d(c){D(l,c)}}}function R(a,l,t){let{value:s=[]}=l,{default_value:i=[]}=l,{choices:u}=l,{mode:c}=l,{style:o=""}=l,{label:n="Checkbox Group"}=l;i&&(s=i);function f(e){s=e,t(0,s)}function r(e){I.call(this,a,e)}return a.$$set=e=>{"value"in e&&t(0,s=e.value),"default_value"in e&&t(5,i=e.default_value),"choices"in e&&t(1,u=e.choices),"mode"in e&&t(2,c=e.mode),"style"in e&&t(3,o=e.style),"label"in e&&t(4,n=e.label)},[s,u,c,o,n,i,f,r]}class U extends y{constructor(l){super(),C(this,l,R,Q,G,{value:0,default_value:5,choices:1,mode:2,style:3,label:4})}}var X=U;const Y=["static","dynamic"];export{X as Component,Y as modes};
