Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.150/admin/js/components/share-form/openShareFormModal.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/modal","@liferay/frontend-js-react-web","frontend-js-web","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dom","../../util/submitEmailContent.es","./ShareFormModalBody.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.Modal=Modal,t.openShareFormModal=function openShareFormModal(t){let{spritemap:r}=t,a=function _objectWithoutProperties(e,t){if(null==e)return{};var r,a,n=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(t,["spritemap"]);e&&cleanUp();e=document.createElement("div"),document.body.appendChild(e),(0,l.render)(i.default.createElement(n.ClayIconSpriteContext.Provider,{value:r},i.default.createElement(Modal,_extends({onClose:cleanUp},a))),a,e),Liferay.once("destroyPortlet",cleanUp)};var a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("@frontend-taglib-clay$clayui/button")),n=r("@frontend-taglib-clay$clayui/icon"),o=_interopRequireWildcard(r("@frontend-taglib-clay$clayui/modal")),l=r("@liferay/frontend-js-react-web"),u=r("frontend-js-web"),i=_interopRequireWildcard(r("liferay!frontend-js-react-web$react")),d=r("liferay!frontend-js-react-web$react-dom"),c=r("../../util/submitEmailContent.es"),s=r("./ShareFormModalBody.es");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 r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function Modal({autocompleteUserURL:e,localizedName:t,onClose:r,portletNamespace:n,shareFormInstanceURL:l,url:d}){const{observer:f}=(0,o.useModal)({onClose:r}),p=(0,i.useRef)({addresses:[],message:(0,u.sub)(Liferay.Language.get("please-fill-out-this-form-x"),d),subject:t[themeDisplay.getLanguageId()]});return f.mutation?i.default.createElement(o.default,{observer:f},i.default.createElement(o.default.Header,null,Liferay.Language.get("share")),i.default.createElement(o.default.Body,null,i.default.createElement(s.ShareFormModalBody,{autocompleteUserURL:e,emailContent:p,localizedName:t,url:d})),i.default.createElement(o.default.Footer,{last:i.default.createElement(a.default.Group,{spaced:!0},i.default.createElement(a.default,{displayType:"secondary",onClick:()=>r()},Liferay.Language.get("cancel")),i.default.createElement(a.default,{displayType:"primary",onClick:()=>{(0,c.submitEmailContent)({addresses:p.current.addresses,message:p.current.message,portletNamespace:n,shareFormInstanceURL:l,subject:p.current.subject}),r()}},Liferay.Language.get("done")))})):null}let e;function cleanUp(){e&&((0,d.unmountComponentAtNode)(e),document.body.removeChild(e),e=null)}}}));
//# sourceMappingURL=openShareFormModal.es.js.map