Liferay.Loader.define("journal-web@5.0.124/js/article/AssetDisplayPageSelector",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=function AssetDisplayPageSelector({assetDisplayPageSelected:e,disabled:a=!0,namespace:t,selectAssetDisplayPageEventName:c,selectAssetDisplayPageURL:s,selectedSite:o,setAssetDisplayPageSelected:d}){var f;const g="".concat(t,"assetDisplayPageId"),openAssetDisplayPageSelector=()=>{const e=new URL(s);o&&e.searchParams.set("".concat((0,i.getPortletNamespace)(Liferay.PortletKeys.ITEM_SELECTOR),"groupId"),o.groupId),(0,i.openSelectionModal)({containerProps:{className:"cadmin"},onSelect(e){let a=e;"com.liferay.item.selector.criteria.AssetEntryItemSelectorReturnType"===e.returnType?(a=JSON.parse(e.value),d({assetDisplayPageId:a.id,name:a.name,plid:a.plid})):d({layoutUuid:a.id,name:a.name})},selectEventName:c,title:(0,i.sub)(Liferay.Language.get("select-x"),Liferay.Language.get("display-page")),url:e})};return u.default.createElement("div",{className:"mb-2 mt-2"},u.default.createElement(r.default.Group,{className:"mb-2"},u.default.createElement("label",{className:"sr-only",htmlFor:g},Liferay.Language.get("display-page")),u.default.createElement(r.ClayInput.Group,{small:!0},u.default.createElement(r.ClayInput.GroupItem,null,u.default.createElement(r.ClayInput,{disabled:a,onClick:()=>openAssetDisplayPageSelector(),placeholder:(0,i.sub)(Liferay.Language.get("select-x"),Liferay.Language.get("display-page")),readOnly:!0,sizing:"sm",value:null!==(f=null==e?void 0:e.name)&&void 0!==f?f:""})),u.default.createElement(r.ClayInput.GroupItem,{shrink:!0},u.default.createElement(l.default,{"aria-label":(0,i.sub)(e?Liferay.Language.get("change-x"):Liferay.Language.get("select-x"),Liferay.Language.get("display-page")),disabled:a,displayType:"secondary",monospaced:!0,onClick:()=>openAssetDisplayPageSelector(),size:"sm",title:(0,i.sub)(e?Liferay.Language.get("change-x"):Liferay.Language.get("select-x"),Liferay.Language.get("display-page"))},u.default.createElement(n.default,{className:"mt-0",symbol:e?"change":"plus"}))))))};var l=_interopRequireDefault(t("@frontend-taglib-clay$clayui/button")),r=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={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(t,r,n):t[r]=e[r]}t.default=e,a&&a.set(e,t);return t}(t("@frontend-taglib-clay$clayui/form")),n=_interopRequireDefault(t("@frontend-taglib-clay$clayui/icon")),i=t("frontend-js-web"),u=_interopRequireDefault(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 _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=AssetDisplayPageSelector.js.map