Liferay.Loader.define("@liferay/object-js-components-web@1.0.58/components/ManagementToolbar/index",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/management-toolbar","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$classnames","frontend-js-web","liferay!frontend-js-react-web$react","./index.scss","./ModalEditExternalReferenceCode"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.ManagementToolbar=function ManagementToolbar({backURL:e,badgeClassName:a,badgeLabel:t,className:u,enableBoxShadow:f=!0,entityId:m,externalReferenceCode:y,externalReferenceCodeSaveURL:g,hasPublishPermission:b,hasUpdatePermission:p,helpMessage:E,isApproved:v,label:C,onExternalReferenceCodeChange:x,onGetEntity:L,onSubmit:R,portletNamespace:h,screenNavigationCategoryKey:_,showEntityDetails:w=!0}){const[j,N]=(0,i.useState)(y),[M,q]=(0,i.useState)(!1),{observer:$,onClose:O}=(0,c.useModal)({onClose:()=>q(!1)}),[P,k]=(0,i.useState)(!b);return i.default.createElement(i.default.Fragment,null,i.default.createElement(r.default,{className:(0,o.default)("lfr__management-toolbar ".concat(u),f&&"lfr__management-toolbar--box-shadow")},i.default.createElement(r.default.ItemList,null,i.default.createElement("div",{className:"border-right ml-sm-2 mr-3 pr-3"},i.default.createElement("h3",{className:"mb-0 text-truncate"},C),t&&i.default.createElement("strong",{className:"".concat(a," label")},t)),w&&i.default.createElement("div",null,i.default.createElement("div",null,i.default.createElement("span",{className:"text-secondary"},"".concat(Liferay.Language.get("id"),":")),i.default.createElement("strong",{className:"ml-2"},m)),i.default.createElement("div",{className:"mt-1"},i.default.createElement("span",{className:"text-secondary"},"".concat(Liferay.Language.get("erc"),":")),i.default.createElement("strong",{className:"ml-2"},j),i.default.createElement("span",{className:"ml-3 text-secondary",title:E},i.default.createElement(l.default,{symbol:"question-circle"})),i.default.createElement(n.default,{"aria-label":(0,d.sub)(Liferay.Language.get("edit-x"),Liferay.Language.get("external-reference-code")),className:"ml-3 p-0 text-secondary",displayType:"unstyled",onClick:()=>q(!0)},i.default.createElement(l.default,{symbol:"pencil"}))))),(!_||"details"===_)&&i.default.createElement(r.default.ItemList,null,i.default.createElement(n.default.Group,{key:1,spaced:!0},i.default.createElement(n.default,{displayType:"secondary",id:"".concat(h,"cancel"),name:"cancel",onClick:()=>(0,d.navigate)(e)},Liferay.Language.get("cancel")),i.default.createElement(n.default,{disabled:!p,displayType:v||void 0===v?"primary":"secondary",id:"".concat(h,"save"),name:"save",onClick:()=>R(!0)},Liferay.Language.get("save")),void 0!==v&&!v&&i.default.createElement(n.default,{disabled:!p||P,id:"".concat(h,"publish"),name:"publish",onClick:()=>(R(!1),k(!0),void setTimeout((()=>{k(!1)}),1e3))},Liferay.Language.get("publish"))))),M&&i.default.createElement(s.ModalEditExternalReferenceCode,{externalReferenceCode:j,helpMessage:E,observer:$,onClose:O,onExternalReferenceCodeChange:x,onGetEntity:L,saveURL:g,setExternalReferenceCode:N}))};var n=_interopRequireDefault(t("@frontend-taglib-clay$clayui/button")),l=_interopRequireDefault(t("@frontend-taglib-clay$clayui/icon")),r=_interopRequireDefault(t("@frontend-taglib-clay$clayui/management-toolbar")),c=t("@frontend-taglib-clay$clayui/modal"),o=_interopRequireDefault(t("liferay!frontend-js-react-web$classnames")),d=t("frontend-js-web"),i=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=_getRequireWildcardCache();if(a&&a.has(e))return a.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var r=n?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(t,l,r):t[l]=e[l]}t.default=e,a&&a.set(e,t);return t}(t("liferay!frontend-js-react-web$react"));t("./index.scss");var s=t("./ModalEditExternalReferenceCode");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=index.js.map