Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/plugins/comments/components/AddCommentForm",["module","exports","require","frontend-js-components-web","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../app/contexts/StoreContext","../../../app/thunks/addFragmentComment","./CommentForm"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function AddCommentForm({fragmentEntryLinkId:e}){const[t,n]=(0,a.useState)(!1),c=(0,u.useDispatch)(),f=(0,r.useId)(),[p,l]=(0,a.useState)(!1),[s,m]=(0,a.useState)("");return a.default.createElement("div",{className:"page-editor__fragment-comment__form pt-2 px-3"},a.default.createElement(d.default,{id:f,loading:t,onCancelButtonClick:()=>{l(!1),m("")},onFormFocus:()=>{l(!0)},onSubmitButtonClick:()=>{n(!0),c((0,i.default)({body:s,fragmentEntryLinkId:e})).then((()=>{n(!1),l(!1),m("")})).catch((()=>{(0,o.openToast)({message:Liferay.Language.get("the-comment-could-not-be-saved"),type:"danger"}),n(!1)}))},onTextareaChange:e=>{e&&m(e)},showButtons:p,submitButtonLabel:Liferay.Language.get("comment"),textareaContent:s}))};var r=n("frontend-js-components-web"),o=n("frontend-js-web"),a=(_interopRequireDefault(n("liferay!frontend-js-react-web$prop-types")),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 n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react"))),u=n("../../../app/contexts/StoreContext"),i=_interopRequireDefault(n("../../../app/thunks/addFragmentComment")),d=_interopRequireDefault(n("./CommentForm"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=AddCommentForm.js.map