import{S as T,i as y,s as A,f as w,m as C,h as D,b as m,t as j,c as d,d as g,l as I,j as F,e as b,q as v,u as k,v as B,w as R,x as S,o as K,A as L,K as M,C as O,I as z,L as G,M as H,F as J,E as N}from"./index.43a672aa.js";import{B as P}from"./Block.dd660513.js";import{B as Q}from"./BlockTitle.0dbc5573.js";import{S as U}from"./StatusTracker.a32689a5.js";function q(n,e,l){const a=n.slice();return a[10]=e[l],a[12]=l,a}function V(n){let e;return{c(){e=D(n[3])},m(l,a){d(l,e,a)},p(l,a){a&8&&F(e,l[3])},d(l){l&&b(e)}}}function E(n){let e,l,a,_,u,o=n[10]+"",i,c,r;return{c(){e=w("label"),l=w("input"),_=C(),u=w("span"),i=D(o),l.disabled=n[2],m(l,"type","radio"),m(l,"name","test"),m(l,"class","gr-check-radio gr-radio"),l.__value=a=n[10],l.value=l.__value,n[8][0].push(l),m(u,"class","ml-2"),m(e,"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"),j(e,"!cursor-not-allowed",n[2])},m(t,f){d(t,e,f),g(e,l),l.checked=l.__value===n[0],g(e,_),g(e,u),g(u,i),c||(r=I(l,"change",n[7]),c=!0)},p(t,f){f&4&&(l.disabled=t[2]),f&2&&a!==(a=t[10])&&(l.__value=a,l.value=l.__value),f&1&&(l.checked=l.__value===t[0]),f&2&&o!==(o=t[10]+"")&&F(i,o),f&4&&j(e,"!cursor-not-allowed",t[2])},d(t){t&&b(e),n[8][0].splice(n[8][0].indexOf(l),1),c=!1,r()}}}function W(n){let e,l,a,_;e=new Q({props:{show_label:n[4],$$slots:{default:[V]},$$scope:{ctx:n}}});let u=n[1],o=[];for(let i=0;i<u.length;i+=1)o[i]=E(q(n,u,i));return{c(){v(e.$$.fragment),l=C(),a=w("div");for(let i=0;i<o.length;i+=1)o[i].c();m(a,"class","flex flex-wrap gap-2")},m(i,c){k(e,i,c),d(i,l,c),d(i,a,c);for(let r=0;r<o.length;r+=1)o[r].m(a,null);_=!0},p(i,[c]){const r={};if(c&16&&(r.show_label=i[4]),c&8200&&(r.$$scope={dirty:c,ctx:i}),e.$set(r),c&7){u=i[1];let t;for(t=0;t<u.length;t+=1){const f=q(i,u,t);o[t]?o[t].p(f,c):(o[t]=E(f),o[t].c(),o[t].m(a,null))}for(;t<o.length;t+=1)o[t].d(1);o.length=u.length}},i(i){_||(B(e.$$.fragment,i),_=!0)},o(i){R(e.$$.fragment,i),_=!1},d(i){S(e,i),i&&b(l),i&&b(a),K(o,i)}}}function X(n,e,l){let{value:a}=e,{choices:_}=e,{disabled:u=!1}=e,{label:o}=e,{style:i=""}=e,{form_position:c="single"}=e,{show_label:r}=e;const t=L(),f=[[]];function h(){a=this.__value,l(0,a)}return n.$$set=s=>{"value"in s&&l(0,a=s.value),"choices"in s&&l(1,_=s.choices),"disabled"in s&&l(2,u=s.disabled),"label"in s&&l(3,o=s.label),"style"in s&&l(5,i=s.style),"form_position"in s&&l(6,c=s.form_position),"show_label"in s&&l(4,r=s.show_label)},n.$$.update=()=>{n.$$.dirty&1&&t("change",a)},[a,_,u,o,r,i,c,h,f]}class Y extends T{constructor(e){super(),y(this,e,X,W,A,{value:0,choices:1,disabled:2,label:3,style:5,form_position:6,show_label:4})}}function Z(n){let e,l,a,_,u;const o=[n[7]];let i={};for(let t=0;t<o.length;t+=1)i=M(i,o[t]);e=new U({props:i});function c(t){n[8](t)}let r={form_position:n[5],label:n[1],show_label:n[6],style:n[2],choices:n[3],disabled:n[4]==="static"};return n[0]!==void 0&&(r.value=n[0]),a=new Y({props:r}),O.push(()=>z(a,"value",c)),a.$on("change",n[9]),{c(){v(e.$$.fragment),l=C(),v(a.$$.fragment)},m(t,f){k(e,t,f),d(t,l,f),k(a,t,f),u=!0},p(t,f){const h=f&128?G(o,[H(t[7])]):{};e.$set(h);const s={};f&32&&(s.form_position=t[5]),f&2&&(s.label=t[1]),f&64&&(s.show_label=t[6]),f&4&&(s.style=t[2]),f&8&&(s.choices=t[3]),f&16&&(s.disabled=t[4]==="static"),!_&&f&1&&(_=!0,s.value=t[0],J(()=>_=!1)),a.$set(s)},i(t){u||(B(e.$$.fragment,t),B(a.$$.fragment,t),u=!0)},o(t){R(e.$$.fragment,t),R(a.$$.fragment,t),u=!1},d(t){S(e,t),t&&b(l),S(a,t)}}}function p(n){let e,l;return e=new P({props:{form_position:n[5],type:"fieldset",$$slots:{default:[Z]},$$scope:{ctx:n}}}),{c(){v(e.$$.fragment)},m(a,_){k(e,a,_),l=!0},p(a,[_]){const u={};_&32&&(u.form_position=a[5]),_&1279&&(u.$$scope={dirty:_,ctx:a}),e.$set(u)},i(a){l||(B(e.$$.fragment,a),l=!0)},o(a){R(e.$$.fragment,a),l=!1},d(a){S(e,a)}}}function x(n,e,l){let{label:a="Radio"}=e,{value:_=""}=e,{style:u=""}=e,{choices:o=[]}=e,{mode:i}=e,{form_position:c="single"}=e,{show_label:r}=e,{loading_status:t}=e;function f(s){_=s,l(0,_)}function h(s){N.call(this,n,s)}return n.$$set=s=>{"label"in s&&l(1,a=s.label),"value"in s&&l(0,_=s.value),"style"in s&&l(2,u=s.style),"choices"in s&&l(3,o=s.choices),"mode"in s&&l(4,i=s.mode),"form_position"in s&&l(5,c=s.form_position),"show_label"in s&&l(6,r=s.show_label),"loading_status"in s&&l(7,t=s.loading_status)},[_,a,u,o,i,c,r,t,f,h]}class $ extends T{constructor(e){super(),y(this,e,x,p,A,{label:1,value:0,style:2,choices:3,mode:4,form_position:5,show_label:6,loading_status:7})}}var se=$;const ne=["static","dynamic"];export{se as Component,ne as modes};
