Liferay.Loader.define("layout-admin-web@5.0.145/js/layout/look_and_feel/Favicon",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function Favicon({clearButtonEnabled:e,defaultImgURL:t,defaultTitle:a,faviconFileEntryId:c,imgURL:o,portletNamespace:d,themeFaviconCETExternalReferenceCode:u,title:f,url:y}){const onChangeFaviconButtonClick=()=>{(0,r.openSelectionModal)({iframeBodyCssClass:"",onSelect(e){if(e&&e&&e.value){const t=JSON.parse(e.value),a={};"com.liferay.client.extension.type.item.selector.CETItemSelectorReturnType"===e.returnType?(a.faviconFileEntryId=0,a.themeFaviconCETExternalReferenceCode=t.cetExternalReferenceCode):(a.faviconFileEntryId=t.fileEntryId,a.themeFaviconCETExternalReferenceCode=""),t.url&&(a.imgURL=t.url),a.title=t.title||t.name,a.clearButtonEnabled=!0,m(a)}},selectEventName:"".concat(d,"selectImage"),title:Liferay.Language.get("select-favicon"),url:y.toString()})},[s,m]=(0,i.useState)({clearButtonEnabled:e,faviconFileEntryId:c,imgURL:o,themeFaviconCETExternalReferenceCode:u,title:f});return i.default.createElement(i.default.Fragment,null,i.default.createElement(l.ClayInput,{name:"".concat(d,"themeFaviconCETExternalReferenceCode"),type:"hidden",value:s.themeFaviconCETExternalReferenceCode}),i.default.createElement(l.ClayInput,{name:"".concat(d,"faviconFileEntryId"),type:"hidden",value:s.faviconFileEntryId}),s.imgURL&&i.default.createElement("img",{alt:s.title,className:"c-mb-2",height:"16",src:s.imgURL,width:"16"}),i.default.createElement(l.default.Group,null,i.default.createElement("label",{htmlFor:"".concat(d,"basicInputText")},Liferay.Language.get("favicon")),i.default.createElement("div",{className:"d-flex"},i.default.createElement(l.ClayInput,{className:"c-mr-2",id:"".concat(d,"basicInputText"),onClick:onChangeFaviconButtonClick,readOnly:!0,value:s.title}),i.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("select-favicon"),className:"c-mr-2 flex-shrink-0",displayType:"secondary",onClick:onChangeFaviconButtonClick,symbol:"change",title:Liferay.Language.get("select-favicon")}),i.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("clear-favicon"),className:"flex-shrink-0",disabled:!s.clearButtonEnabled,displayType:"secondary",onClick:()=>{m({clearButtonEnabled:!1,faviconFileEntryId:0,imgURL:t,themeFaviconCETExternalReferenceCode:"",title:a})},symbol:"times-circle",title:Liferay.Language.get("clear-favicon")}))))};var n=a("@frontend-taglib-clay$clayui/button"),l=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),r=a("frontend-js-web"),i=_interopRequireWildcard(a("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 t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},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(a,l,r):a[l]=e[l]}return a.default=e,t&&t.set(e,a),a}}}));
//# sourceMappingURL=Favicon.js.map