Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/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","../../../core/hooks/useControlledState","../../../core/hooks/useId","../../../prop-types/index","../../config/constants/viewportSizes","../../contexts/StoreContext"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxField=function({className:e,disabled:t,field:a,onValueSelect:f,title:u,value:p}){var y,b;const m=(0,c.useId)(),[g,h]=(0,i.default)(p||!1),w=(0,d.useSelector)((e=>e.selectedViewportSize)),k=null===(y=a.typeOptions)||void 0===y?void 0:y.customValues,v=k?g===k.checked:g,j=e=>{let t=e;k&&(t=t?k.checked:k.unchecked),h(t),f(a.name,t)},x=l.default.createElement("span",{className:"font-weight-normal text-3"},a.label);return l.default.createElement(n.default.Group,{className:(0,r.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:u},"toggle"===(null===(b=a.typeOptions)||void 0===b?void 0:b.displayType)?l.default.createElement(n.ClayToggle,{"aria-describedby":m,containerProps:{className:"mb-0"},disabled:t,label:x,onToggle:e=>j(e),toggled:v}):l.default.createElement(n.ClayCheckbox,{"aria-describedby":m,checked:v,containerProps:{className:"mb-0"},disabled:t,label:x,onChange:e=>j(e.target.checked)}),a.responsive&&w!==s.VIEWPORT_SIZES.desktop&&l.default.createElement(o.ClayButtonWithIcon,{"data-tooltip-align":"bottom",displayType:"secondary",onClick:()=>{f(a.name,null)},small:!0,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 o=a("@frontend-taglib-clay$clayui/button"),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=o?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("@frontend-taglib-clay$clayui/form")),r=f(a("liferay!frontend-js-react-web$classnames")),l=(f(a("liferay!frontend-js-react-web$prop-types")),f(a("liferay!frontend-js-react-web$react"))),i=f(a("../../../core/hooks/useControlledState")),c=a("../../../core/hooks/useId"),s=(a("../../../prop-types/index"),a("../../config/constants/viewportSizes")),d=a("../../contexts/StoreContext");function f(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}}}));
//# sourceMappingURL=CheckboxField.js.map