Liferay.Loader.define("@liferay/analytics-settings-web@5.0.47/js/components/properties/CreatePropertyModal",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$react","../../utils/api","../Loading"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),l=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/modal")),u=_interopRequireWildcard(a("liferay!frontend-js-react-web$react")),i=a("../../utils/api"),o=_interopRequireDefault(a("../Loading"));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={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=r?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(a,l,n):a[l]=e[l]}return a.default=e,t&&t.set(e,a),a}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=({observer:e,onCancel:t,onSubmit:a})=>{const[c,d]=(0,u.useState)(""),[f,p]=(0,u.useState)(!1);return u.default.createElement(n.default,{center:!0,observer:e},u.default.createElement(l.default,null,u.default.createElement(n.default.Header,null,Liferay.Language.get("new-property")),u.default.createElement(n.default.Body,{className:"pb-0 pt-3"},u.default.createElement(l.default.Group,{className:"mb-3"},u.default.createElement("label",{htmlFor:"basicInputText"},Liferay.Language.get("property-name")),u.default.createElement(l.ClayInput,{id:"inputPropertyName",onChange:({target:{value:e}})=>d(e),type:"text",value:c}))),u.default.createElement(n.default.Footer,{last:u.default.createElement(r.default.Group,{spaced:!0},u.default.createElement(r.default,{displayType:"secondary",onClick:t},Liferay.Language.get("cancel")),u.default.createElement(r.default,{disabled:!c||f,onClick:async()=>{p(!0);const{ok:e}=await(0,i.createProperty)(c);p(!1),e&&a()}},f&&u.default.createElement(o.default,{inline:!0}),Liferay.Language.get("create")))})))};t.default=_default}}));
//# sourceMappingURL=CreatePropertyModal.js.map