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