var K=Object.defineProperty;var y=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var S=(s,l,t)=>l in s?K(s,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[l]=t,C=(s,l)=>{for(var t in l||(l={}))A.call(l,t)&&S(s,t,l[t]);if(y)for(var t of y(l))V.call(l,t)&&S(s,t,l[t]);return s};import{w as $,a as w,h as E,q as L,r as k,j as e,bV as T,_ as u,b as N,g as f,aU as b,be as F,ab as B,E as I,x as _}from"./main-40.js";import{a as U}from"./bf-807-328.js";import{F as n}from"./bf-350-158.js";import{C as z}from"./bf-547-83.js";import{a as H}from"./bf-142-111.js";import{F as R,A as q,b as P,c as G}from"./bf-543-94.js";import{T as J}from"./bf-884-118.js";import{F as O}from"./bf-517-325.js";import{a as r}from"./bf-541-191.js";import{R as Q}from"./bf-247-327.js";import{S as D}from"./bf-95-84.js";import"./bf-988-194.js";import"./bf-141-80.js";import"./bf-376-112.js";import"./bf-683-113.js";/* empty css          */import"./bf-955-157.js";import"./bf-586-70.js";import"./bf-200-122.js";import"./bf-497-146.js";import"./bf-613-108.js";import"./bf-755-109.js";import"./bf-175-110.js";import"./bf-928-114.js";import"./bf-232-115.js";import"./bf-236-125.js";import"./bf-642-124.js";import"./bf-829-79.js";import"./bf-285-116.js";import"./bf-695-117.js";import"./bf-866-72.js";function W({labelModal:s,setLabelModal:l}){var c;const{fieldKey:t}=$(),{css:a}=w(),[j,m]=E(B),i=L(j[t]),x=i.lbl||((c=i==null?void 0:i.info)==null?void 0:c.lbl),[h,o]=k.useState(x);k.useEffect(()=>{s&&o(x)},[s]);const d=v=>{m(g=>f(g,M=>{M[t].lbl=v})),b({event:"Modify Decision Box Label",type:"change_decision_label",state:{fields:F("fields"),fldKey:t}})},p=()=>{i.lbl=h,m(v=>f(v,g=>{g[t]=i})),b({event:"Cancel Decision Box Label Editing",type:"cancel_decision_label_edit",state:{fields:F("fields"),fldKey:t}}),l(!1)};return e.jsxs(T,{md:!0,show:s,setModal:p,title:u("Edit Decision Box Label"),children:[e.jsx(J,{id:t,value:x,onChangeHandler:d}),e.jsxs("div",{className:"mt-2 f-right",children:[e.jsx("button",{type:"button",className:`${a(N.btn)} mr-2`,onClick:p,children:"Cancel"}),e.jsx("button",{type:"button",className:`${a(N.btn)} blue`,onClick:()=>l(!1),children:"Save"})]})]})}function $e(){const{fieldKey:s}=$(),[l,t]=E(B),a=L(l[s]),[j,m]=k.useState(!1),{css:i}=w();function x(o){const{checked:d}=o.target;if(d){const c=C({},a.valid);c.checked=!0,a.valid=c}else delete a.valid.checked;const p=f(l,c=>{c[s]=a});t(p),b({event:`Check by default ${d?"on":"off"} : ${a.adminLbl||s}`,type:"set_check_by_default",state:{fields:p,fldKey:s}})}const h=(o,d)=>{a.msg[d]=o;const p=f(l,c=>{c[s]=a});t(p),b({event:`${d[0].toUpperCase()+d.slice(1)} Value Modified to "${o}"`,type:`${d}_value_modify`,state:{fields:p,fldKey:s}})};return window.selectedFieldData=a,e.jsxs("div",{children:[e.jsx(R,{title:"Field Settings",subtitle:a.typ,fieldKey:s}),e.jsxs("div",{className:i(n.fieldSection),children:[e.jsxs("div",{className:`flx flx-between ${n.hover_tip}`,children:[e.jsxs("div",{className:"flx",children:[e.jsx("b",{children:"Label "}),e.jsx(z,{width:250,icnSize:17,className:"hover-tip",children:e.jsx("div",{className:"txt-body",children:u("Edit your decision box label by clicking on edit icon")})})]}),e.jsx("span",{"data-testid":"lbl-edt-btn",role:"button",tabIndex:"-1",className:"mr-2 cp",onClick:()=>m(!0),onKeyDown:()=>m(!0),children:e.jsx(I,{size:19})})]}),e.jsx("div",{className:`${i(U.errMsgBox)} ${i(_.mt2)}`,tabIndex:"0",role:"button",onClick:()=>m(!0),onKeyDown:()=>m(!0),children:e.jsx("p",{className:i(_.m0),children:"Click to edit decision box label"})})]}),e.jsx(r,{}),e.jsx(W,{labelModal:j,setLabelModal:m}),e.jsx(q,{}),e.jsx(r,{}),e.jsx(P,{}),e.jsx(r,{}),e.jsx(Q,{asteriskIsAllow:!1}),e.jsx(r,{}),e.jsx(O,{}),e.jsx(r,{}),e.jsx(G,{}),e.jsx(r,{}),e.jsx(D,{id:"chek-val-stng",title:u("Checked Value"),className:i(n.fieldSection),open:!0,children:e.jsx("div",{className:i(n.placeholder),children:e.jsx("input",{"data-testid":"chek-val-inp","aria-label":"Checked value",className:i(n.input),type:"text",value:a.msg.checked||"",onChange:o=>h(o.target.value,"checked")})})}),e.jsx(r,{}),e.jsx(D,{id:"unchek-val-stng",title:u("Unchecked Value"),className:i(n.fieldSection),open:!0,children:e.jsx("div",{className:i(n.placeholder),children:e.jsx("input",{"data-testid":"unchek-val-inp","aria-label":"Uncheked value",className:i(n.input),type:"text",value:a.msg.unchecked||"",onChange:o=>h(o.target.value,"unchecked")})})}),e.jsx(r,{}),e.jsx("div",{className:i(n.fieldSection,n.hover_tip,{pr:"36px !important"}),children:e.jsx(H,{id:"chek-by-dflt",tip:"By disabling this option, the field checked by default will be hidden",title:u("Checked by Default"),action:x,isChecked:a.valid.checked})}),e.jsx(r,{})]})}export{$e as default};
