Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.173/page_editor/app/components/HTMLEditorModal",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","./CodeMirrorEditor"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/button")),r=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/modal")),n=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),i=_interopRequireWildcard(a("liferay!frontend-js-react-web$react")),o=_interopRequireDefault(a("./CodeMirrorEditor"));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}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={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}const e={columns:1,fullscreen:2,rows:3};var _default=({initialContent:t="",onClose:a,onSave:d})=>{const[u,c]=(0,i.useState)(t),[s,f]=(0,i.useState)(e.columns),[y,m]=(0,i.useState)(!0),{observer:p,onClose:g}=(0,r.useModal)({onClose:()=>{m(!1),a()}});return y&&i.default.createElement(r.default,{observer:p,size:"full-screen"},i.default.createElement(r.default.Header,{className:"cadmin"},Liferay.Language.get("edit-content")),i.default.createElement(r.default.Body,{className:"pb-0"},i.default.createElement("div",{className:"cadmin d-flex justify-content-end pr-2 w-100"},i.default.createElement(l.default.Group,null,i.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("display-vertically"),displayType:"secondary",onClick:()=>f(e.columns),size:"sm",symbol:"columns",title:Liferay.Language.get("display-vertically")}),i.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("display-horizontally"),displayType:"secondary",onClick:()=>f(e.rows),size:"sm",symbol:"cards",title:Liferay.Language.get("display-horizontally")}),i.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("full-screen"),displayType:"secondary",onClick:()=>f(e.fullscreen),size:"sm",symbol:"expand",title:Liferay.Language.get("full-screen")}))),i.default.createElement("div",{className:(0,n.default)("d-flex page-editor__html-editor-modal__editor-container",{"flex-column":s===e.rows})},i.default.createElement("div",{className:(0,n.default)({"h-50 w-100":s===e.rows,"h-100 w-50":s===e.columns,"h-100 w-100":s===e.fullscreen})},i.default.createElement(o.default,{initialContent:t,onChange:e=>c(e)})),s!==e.fullscreen&&i.default.createElement("div",{className:(0,n.default)({"page-editor__html-editor-modal__preview-columns h-100 px-3 w-50":s===e.columns,"page-editor__html-editor-modal__preview-rows h-50 py-2 w-100":s===e.rows})},i.default.createElement("div",{dangerouslySetInnerHTML:{__html:u},onClick:e=>e.preventDefault()})))),i.default.createElement(r.default.Footer,{className:"cadmin",last:i.default.createElement(l.default.Group,{spaced:!0},i.default.createElement(l.default,{displayType:"secondary",onClick:()=>{g()}},Liferay.Language.get("cancel")),i.default.createElement(l.default,{onClick:()=>{d(u),g()}},Liferay.Language.get("save")))}))};t.default=_default}}));
//# sourceMappingURL=HTMLEditorModal.js.map