Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.170/page_editor/app/components/fragment_configuration_fields/CheckboxField",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../common/hooks/useControlledState","../../../common/hooks/useId","../../../prop_types/index","../../config/constants/viewportSizes","../../contexts/StoreContext"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxField=function CheckboxField({className:e,disabled:t,field:a,onValueSelect:u,title:f,value:p}){var y,b;const m=(0,c.useId)(),[g,_]=(0,i.default)(p||!1),h=(0,s.useSelector)((e=>e.selectedViewportSize)),k=null===(y=a.typeOptions)||void 0===y?void 0:y.customValues,w=k?g===k.checked:g,handleChange=e=>{let t=e;k&&(t=t?k.checked:k.unchecked),_(t),u(a.name,t)},v=l.default.createElement("span",{className:"font-weight-normal text-3"},a.label);return l.default.createElement(o.default.Group,{className:(0,n.default)(e,"h-100")},l.default.createElement("div",{className:"align-items-center d-flex justify-content-between page-editor__sidebar__fieldset__field-checkbox","data-tooltip-align":"bottom",title:f},"toggle"===(null===(b=a.typeOptions)||void 0===b?void 0:b.displayType)?l.default.createElement(o.ClayToggle,{"aria-describedby":a.description?m:null,containerProps:{className:"mb-0"},disabled:t,label:v,onToggle:e=>handleChange(e),toggled:w}):l.default.createElement(o.ClayCheckbox,{"aria-describedby":a.description?m:null,checked:w,containerProps:{className:"mb-0"},disabled:t,label:v,onChange:e=>handleChange(e.target.checked)}),a.responsive&&h!==d.VIEWPORT_SIZES.desktop&&l.default.createElement(r.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("restore-default"),"data-tooltip-align":"bottom",displayType:"secondary",onClick:()=>{u(a.name,null)},size:"sm",symbol:"restore",title:Liferay.Language.get("restore-default")})),a.description?l.default.createElement("p",{className:"m-0 mt-1 small text-secondary",id:m},a.description):null)};var r=a("@frontend-taglib-clay$clayui/button"),o=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=r?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(a,o,n):a[o]=e[o]}a.default=e,t&&t.set(e,a);return a}(a("@frontend-taglib-clay$clayui/form")),n=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),l=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),_interopRequireDefault(a("liferay!frontend-js-react-web$react"))),i=_interopRequireDefault(a("../../../common/hooks/useControlledState")),c=a("../../../common/hooks/useId"),d=(a("../../../prop_types/index"),a("../../config/constants/viewportSizes")),s=a("../../contexts/StoreContext");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}}}));
//# sourceMappingURL=CheckboxField.js.map