Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.173/page_editor/plugins/browser/components/page_structure/components/VisibilityButton",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$classnames","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../app/config/constants/itemActivationOrigins","../../../../../app/contexts/ControlsContext","../../../../../app/contexts/KeyboardMovementContext","../../../../../app/utils/getFormErrorDescription","../../../../../app/utils/updateItemStyle","../../../../../app/utils/useHasRequiredChild"],(function(e,t,i){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function VisibilityButton({className:e,dispatch:t,node:i,selectedViewportSize:y,visible:g}){var b;const m=(0,f.default)(i.id),_=(0,l.useSelectItem)(),h=(0,u.useSetMovementText)();return s.default.createElement(n.default,{"aria-label":(0,o.sub)(i.hidden||i.hiddenAncestor?Liferay.Language.get("show-x"):Liferay.Language.get("hide-x"),[i.name]),className:(0,r.default)("page-editor__page-structure__tree-node__visibility-button "+e,{"page-editor__page-structure__tree-node__visibility-button--visible":g}),disabled:i.isMasterItem||i.hiddenAncestor,displayType:"unstyled",onClick:e=>{if(e.stopPropagation(),(0,c.default)({dispatch:t,itemId:i.id,selectedViewportSize:y,styleName:"display",styleValue:i.hidden?"block":"none"}),!i.hidden&&m()){const{message:e}=(0,p.getFormErrorDescription)({type:p.FORM_ERROR_TYPES.hiddenFragment});(0,o.openToast)({message:e,type:"warning"})}_(i.id,{origin:d.ITEM_ACTIVATION_ORIGINS.itemActions}),h(i.hidden?Liferay.Language.get("item-shown"):Liferay.Language.get("hidden-item"))},tabIndex:(null===(b=document.activeElement.dataset.id)||void 0===b?void 0:b.includes(i.id))?"0":"-1"},s.default.createElement(a.default,{symbol:i.hidden||i.hiddenAncestor?"hidden":"view"}))};var n=_interopRequireDefault(i("@frontend-taglib-clay$clayui/button")),a=_interopRequireDefault(i("@frontend-taglib-clay$clayui/icon")),r=_interopRequireDefault(i("liferay!frontend-js-react-web$classnames")),o=i("frontend-js-web"),s=(_interopRequireDefault(i("liferay!frontend-js-react-web$prop-types")),_interopRequireDefault(i("liferay!frontend-js-react-web$react"))),d=i("../../../../../app/config/constants/itemActivationOrigins"),l=i("../../../../../app/contexts/ControlsContext"),u=i("../../../../../app/contexts/KeyboardMovementContext"),p=i("../../../../../app/utils/getFormErrorDescription"),c=_interopRequireDefault(i("../../../../../app/utils/updateItemStyle")),f=_interopRequireDefault(i("../../../../../app/utils/useHasRequiredChild"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=VisibilityButton.js.map