1import{r as m,o as x,p as C,j as n,h as T,k as L,P as S,q as B,t as W,C as w,v as R}from"./index.RuhrnD1v.js";import{W as v}from"./WidgetLabelHelpIconInline.p-GgbwF5.js";import{u as P}from"./useBasicWidgetState.CI9LlGGe.js";import{S as E,L as M,a as b}from"./checkbox.DjX9W7TF.js";import"./styled-components.CXqQ-NdV.js";import"./FormClearHelper.DFo50Lfo.js";function V({element:e,disabled:a,widgetMgr:s,fragmentId:d}){const f=e.queryParamKey?{paramKey:e.queryParamKey,valueType:"bool_value",clearable:!1}:void 0,[p,g]=P({getStateFromWidgetMgr:X,getDefaultStateFromProto:$,getCurrStateFromProto:H,updateWidgetMgrState:_,element:e,widgetMgr:s,fragmentId:d,formClearBehavior:"resetValueOnly",queryParamBinding:f}),k=m.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),o=x(),{colors:r,spacing:h,sizes:t}=o,u=C(o),y=a?r.fadedText40:r.bodyText;return n(R,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(E,{checked:p,disabled:a,onChange:k,"aria-label":e.label,checkmarkType:e.type===w.StyleType.TOGGLE?b.toggle:b.default,labelPlacement:M.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?r.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=u?r.bgColor:r.bodyText;return a&&(c=u?r.gray70:r.gray90),{width:`calc(${t.checkbox} - ${o.spacing.twoXS})`,height:`calc(${t.checkbox} - ${o.spacing.twoXS})`,transform:i?`translateX(${t.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=r.borderColor;return c&&!a&&(l=r.darkenedBgMix15),i&&!a&&(l=r.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:o.spacing.twoXS,paddingLeft:o.spacing.threeXS,paddingRight:o.spacing.threeXS,width:`calc(2 * ${t.checkbox})`,minWidth:`calc(2 * ${t.checkbox})`,height:t.checkbox,minHeight:t.checkbox,borderBottomLeftRadius:o.radii.full,borderTopLeftRadius:o.radii.full,borderBottomRightRadius:o.radii.full,borderTopRightRadius:o.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?r.primary:r.borderColor;return{outline:0,width:t.checkbox,height:t.checkbox,marginTop:o.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?o.shadows.focusRing:"",borderLeftWidth:t.borderWidth,borderRightWidth:t.borderWidth,borderTopWidth:t.borderWidth,borderBottomWidth:t.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:o.lineHeights.small,paddingLeft:o.spacing.sm,position:"relative",color:y}}},children:T(W,{visibility:B(e.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n(L,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&n(v,{content:e.help,placement:S.TOP_RIGHT,label:e.label})]})})})}function X(e,a){return e.getBoolValue(a)}function $(e){return e.default??!1}function H(e){return e.value??!1}function _(e,a,s,d){a.setBoolValue(e,s.value,{fromUi:s.fromUi},d)}const O=m.memo(V);export{O as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.