import{S,i as B,s as q,e as m,k as D,d as T,a as r,t as y,b as E,f as d,l as j,g as A,n as C,h as z,z as F,o as h,q as g,u as k,v as w,w as v,B as G,H as I,E as J,D as K}from"./index.9fc31042.js";import{B as L}from"./Block.ddaaf792.js";import{S as M}from"./StatusTracker.14e5b2a2.js";function N(n){let e,t,a,o,u,f,c;return{c(){e=m("label"),t=m("input"),a=D(),o=m("span"),u=T(n[2]),t.disabled=n[1],r(t,"type","checkbox"),r(t,"name","test"),r(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"),r(o,"class","ml-2"),r(e,"class","flex items-center text-gray-700 text-sm space-x-2 rounded-lg cursor-pointer bg-white"),y(e,"!cursor-not-allowed",n[1])},m(l,s){E(l,e,s),d(e,t),t.checked=n[0],d(e,a),d(e,o),d(o,u),f||(c=j(t,"change",n[5]),f=!0)},p(l,[s]){s&2&&(t.disabled=l[1]),s&1&&(t.checked=l[0]),s&4&&A(u,l[2]),s&2&&y(e,"!cursor-not-allowed",l[1])},i:C,o:C,d(l){l&&z(e),f=!1,c()}}}function O(n,e,t){let{value:a}=e,{disabled:o=!1}=e,{label:u}=e,{style:f=""}=e,{show_label:c}=e;F();function l(){a=this.checked,t(0,a)}return n.$$set=s=>{"value"in s&&t(0,a=s.value),"disabled"in s&&t(1,o=s.disabled),"label"in s&&t(2,u=s.label),"style"in s&&t(3,f=s.style),"show_label"in s&&t(4,c=s.show_label)},[a,o,u,f,c,l]}class P extends S{constructor(e){super(),B(this,e,O,N,q,{value:0,disabled:1,label:2,style:3,show_label:4})}}function Q(n){let e,t,a,o,u;e=new M({props:{tracked_status:n[6]}});function f(l){n[8](l)}let c={style:n[1],label:n[2],show_label:n[5],disabled:n[3]==="static"};return n[0]!==void 0&&(c.value=n[0]),a=new P({props:c}),G.push(()=>I(a,"value",f)),a.$on("change",n[9]),{c(){h(e.$$.fragment),t=D(),h(a.$$.fragment)},m(l,s){g(e,l,s),E(l,t,s),g(a,l,s),u=!0},p(l,s){const _={};s&64&&(_.tracked_status=l[6]),e.$set(_);const b={};s&2&&(b.style=l[1]),s&4&&(b.label=l[2]),s&32&&(b.show_label=l[5]),s&8&&(b.disabled=l[3]==="static"),!o&&s&1&&(o=!0,b.value=l[0],J(()=>o=!1)),a.$set(b)},i(l){u||(k(e.$$.fragment,l),k(a.$$.fragment,l),u=!0)},o(l){w(e.$$.fragment,l),w(a.$$.fragment,l),u=!1},d(l){v(e,l),l&&z(t),v(a,l)}}}function R(n){let e,t;return e=new L({props:{form_position:n[4],$$slots:{default:[Q]},$$scope:{ctx:n}}}),{c(){h(e.$$.fragment)},m(a,o){g(e,a,o),t=!0},p(a,[o]){const u={};o&16&&(u.form_position=a[4]),o&1135&&(u.$$scope={dirty:o,ctx:a}),e.$set(u)},i(a){t||(k(e.$$.fragment,a),t=!0)},o(a){w(e.$$.fragment,a),t=!1},d(a){v(e,a)}}}function U(n,e,t){let{value:a=!1}=e,{default_value:o=!1}=e,{style:u=""}=e,{label:f="Checkbox"}=e,{mode:c}=e,{form_position:l="single"}=e,{show_label:s}=e,{loading_status:_}=e;o&&(a=o);function b(i){a=i,t(0,a)}function H(i){K.call(this,n,i)}return n.$$set=i=>{"value"in i&&t(0,a=i.value),"default_value"in i&&t(7,o=i.default_value),"style"in i&&t(1,u=i.style),"label"in i&&t(2,f=i.label),"mode"in i&&t(3,c=i.mode),"form_position"in i&&t(4,l=i.form_position),"show_label"in i&&t(5,s=i.show_label),"loading_status"in i&&t(6,_=i.loading_status)},[a,u,f,c,l,s,_,o,b,H]}class V extends S{constructor(e){super(),B(this,e,U,R,q,{value:0,default_value:7,style:1,label:2,mode:3,form_position:4,show_label:5,loading_status:6})}}var Z=V;const x=["static","dynamic"];export{Z as Component,x as modes};
