Liferay.Loader.define("users-admin-web@6.0.108/js/ParentOrganization",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=function ParentOrganization({label:e,parentOrganizationId:a,portletNamespace:t,selectOrganizationRenderURL:o}){const[{label:c,parentOrganizationId:u},g]=(0,l.useState)({label:e,parentOrganizationId:a});return l.default.createElement(l.default.Fragment,null,l.default.createElement("input",{name:"".concat(t,"parentOrganizationId"),type:"hidden",value:u}),l.default.createElement(r.default.Group,null,l.default.createElement("label",{htmlFor:"".concat(t,"parentOrganization")},Liferay.Language.get("parent-organization")),l.default.createElement("div",{className:"d-flex"},l.default.createElement(r.ClayInput,{className:"mr-2",id:"".concat(t,"parentOrganization"),readOnly:!0,value:c}),l.default.createElement(n.ClayButtonWithIcon,{"aria-label":(0,i.sub)(Liferay.Language.get("change-x"),Liferay.Language.get("parent-organization")),className:"flex-shrink-0 mr-2",displayType:"secondary",onClick:()=>{(0,i.openSelectionModal)({onSelect(e){const a=JSON.parse(e.value);g({label:a.name,parentOrganizationId:a.organizationId})},selectEventName:"".concat(t,"selectOrganization"),title:(0,i.sub)(Liferay.Language.get("select-x"),Liferay.Language.get("parent-organization")),url:o})},symbol:"change",title:(0,i.sub)(Liferay.Language.get("change-x"),Liferay.Language.get("parent-organization"))}),l.default.createElement(n.ClayButtonWithIcon,{"aria-label":(0,i.sub)(Liferay.Language.get("clear-x"),Liferay.Language.get("parent-organization")),className:"flex-shrink-0",disabled:""===c,displayType:"secondary",onClick:()=>{g({label:"",parentOrganizationId:""})},symbol:"times-circle",title:(0,i.sub)(Liferay.Language.get("clear-x"),Liferay.Language.get("parent-organization"))}))))};var n=t("@frontend-taglib-clay$clayui/button"),r=_interopRequireWildcard(t("@frontend-taglib-clay$clayui/form")),i=t("frontend-js-web"),l=_interopRequireWildcard(t("liferay!frontend-js-react-web$react"));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 a=_getRequireWildcardCache();if(a&&a.has(e))return a.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=n?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(t,r,i):t[r]=e[r]}return t.default=e,a&&a.set(e,t),t}}}));
//# sourceMappingURL=ParentOrganization.js.map