Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.84/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","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dom","../../util/submitEmailContent.es","./ShareFormModalBody.es"],(function(e,t,r){var a;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.Modal=p,t.openShareFormModal=function(t){let{spritemap:r}=t,a=function(e,t){if(null==e)return{};var r,a,n=function(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&&b();e=document.createElement("div"),document.body.appendChild(e),(0,u.render)(c.default.createElement(o.ClayIconSpriteContext.Provider,{value:r},c.default.createElement(p,m({onClose:b},a))),a,e),Liferay.once("destroyPortlet",b)};var n=(a=r("@frontend-taglib-clay$clayui/button"))&&a.__esModule?a:{default:a},o=r("@frontend-taglib-clay$clayui/icon"),l=y(r("@frontend-taglib-clay$clayui/modal")),u=r("@liferay/frontend-js-react-web"),c=y(r("liferay!frontend-js-react-web$react")),i=r("liferay!frontend-js-react-web$react-dom"),d=r("../../util/submitEmailContent.es"),f=r("./ShareFormModalBody.es");function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function y(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();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 m(){return(m=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 p({autocompleteUserURL:e,localizedName:t,onClose:r,portletNamespace:a,shareFormInstanceURL:o,url:u}){const{observer:i}=(0,l.useModal)({onClose:r}),s=(0,c.useRef)({addresses:[],message:Liferay.Util.sub(Liferay.Language.get("please-fill-out-this-form-x"),u),subject:t[themeDisplay.getLanguageId()]});return i.mutation?c.default.createElement(l.default,{observer:i},c.default.createElement(l.default.Header,null,Liferay.Language.get("share")),c.default.createElement(l.default.Body,null,c.default.createElement(f.ShareFormModalBody,{autocompleteUserURL:e,emailContent:s,localizedName:t,url:u})),c.default.createElement(l.default.Footer,{last:c.default.createElement(n.default.Group,{spaced:!0},c.default.createElement(n.default,{displayType:"secondary",onClick:()=>r()},Liferay.Language.get("cancel")),c.default.createElement(n.default,{displayType:"primary",onClick:()=>{(0,d.submitEmailContent)({addresses:s.current.addresses,message:s.current.message,portletNamespace:a,shareFormInstanceURL:o,subject:s.current.subject}),r()}},Liferay.Language.get("done")))})):null}let e;function b(){e&&((0,i.unmountComponentAtNode)(e),document.body.removeChild(e),e=null)}}}));
//# sourceMappingURL=openShareFormModal.es.js.map