Liferay.Loader.define("@liferay/object-web@1.0.181/js/components/ViewObjectDefinitions/ModalDeleteObjectDefinition",["module","exports","require","@frontend-taglib-clay$clayui/modal","frontend-js-web","liferay!frontend-js-react-web$react","../DangerModal","../WarningModal","./objectDefinitionUtil"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.ModalDeleteObjectDefinition=function ModalDeleteObjectDefinition({handleOnClose:e,objectDefinition:t,setDeletedObjectDefinition:n}){const{observer:u,onClose:c}=(0,a.useModal)({onClose:()=>{n(null),e()}});return l.default.createElement(a.ClayModalProvider,null,(null==t?void 0:t.hasObjectRelationship)?l.default.createElement(r.default,{observer:u,onClose:c,title:Liferay.Language.get("deletion-not-allowed")},l.default.createElement("div",null,(0,o.sub)(Liferay.Language.get("x-has-active-relationships-and-cannot-be-deleted"),"".concat(null==t?void 0:t.name))),l.default.createElement("div",null,(0,o.sub)(Liferay.Language.get("to-delete-x,-you-must-first-delete-its-relationships"),"".concat(null==t?void 0:t.name))),l.default.createElement("div",null,Liferay.Language.get("go-to-object-details-relationships"))):l.default.createElement(i.default,{errorMessage:(0,o.sub)(Liferay.Language.get("input-does-not-match-x"),"".concat(null==t?void 0:t.name)),observer:u,onClose:c,onDelete:async()=>{await(0,d.deleteObjectDefinition)(null==t?void 0:t.id,null==t?void 0:t.name),setTimeout((()=>window.location.reload()),1500),c()},placeholder:Liferay.Language.get("confirm-object-definition-name"),title:Liferay.Language.get("delete-object-definition"),token:null==t?void 0:t.name},l.default.createElement("p",null,Liferay.Language.get("deleting-an-object-definition-also-removes-its-data-records")),l.default.createElement("p",{dangerouslySetInnerHTML:{__html:(0,o.sub)(Liferay.Language.get("x-has-x-object-entries"),"<strong>".concat(null==t?void 0:t.name,"</strong>"),"".concat(null==t?void 0:t.objectEntriesCount))}}),l.default.createElement("p",null,Liferay.Language.get("before-deleting-this-object-definition-you-may-want-to-back-up-its-entries-to-prevent-data-loss")),l.default.createElement("p",{dangerouslySetInnerHTML:{__html:(0,o.sub)(Liferay.Language.get("please-enter-x-to-confirm"),"<strong>".concat(null==t?void 0:t.name,"</strong>"))}})))};var a=n("@frontend-taglib-clay$clayui/modal"),o=n("frontend-js-web"),l=_interopRequireDefault(n("liferay!frontend-js-react-web$react")),i=_interopRequireDefault(n("../DangerModal")),r=_interopRequireDefault(n("../WarningModal")),d=n("./objectDefinitionUtil");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=ModalDeleteObjectDefinition.js.map