Liferay.Loader.define("journal-web@5.0.144/js/article/SelectAssetDisplayPage",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$react","./AssetDisplayPageSelector","./PreviewButton"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=function SelectAssetDisplayPage({assetDisplayPageId:a,assetDisplayPageType:t,defaultDisplayPageName:s,layoutUuid:d,newArticle:o,portletNamespace:f,saveAsDraftURL:p,selectAssetDisplayPageEventName:y,selectAssetDisplayPageURL:g,specificAssetDisplayPageName:m}){var b,v;const[D,P]=(0,r.useState)(t),[L,w]=(0,r.useState)((()=>t===e.specific?{assetDisplayPageId:a,layoutUuid:d,name:m}:null)),R=[{label:getLabel(e.default),onClick:()=>P(e.default),value:e.default},{label:getLabel(e.specific),onClick:()=>P(e.specific),value:e.specific},{label:getLabel(e.none),onClick:()=>P(e.none),value:e.none}];return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.default.Group,null,r.default.createElement(n.ClayDropDownWithItems,{items:R,trigger:r.default.createElement(l.default,{"aria-label":Liferay.Language.get("select-display-page-type"),className:"bg-light form-control-select text-left w-100",displayType:"secondary",type:"button"},r.default.createElement("span",null,getLabel(D)))})),r.default.createElement(i.ClayInput,{hidden:!0,name:"".concat(f,"layoutUuid"),value:null!==(b=null==L?void 0:L.layoutUuid)&&void 0!==b?b:""}),r.default.createElement(i.ClayInput,{hidden:!0,name:"".concat(f,"assetDisplayPageId"),value:null!==(v=null==L?void 0:L.assetDisplayPageId)&&void 0!==v?v:""}),r.default.createElement(i.ClayInput,{hidden:!0,name:"".concat(f,"displayPageType"),value:null!=D?D:""}),D===e.default&&r.default.createElement(i.default.Group,{className:"mb-2"},r.default.createElement(i.ClayInput,{"aria-label":Liferay.Language.get("display-page-name"),readOnly:!0,value:s||Liferay.Language.get("no-default-display-page-template")})),D===e.specific&&r.default.createElement(u.default,{assetDisplayPageSelected:L,disabled:!1,namespace:f,selectAssetDisplayPageEventName:y,selectAssetDisplayPageURL:g,setAssetDisplayPageSelected:w}),D!==e.none&&r.default.createElement(c.default,{disabled:D===e.specific&&!L||D===e.default&&!s,getPreviewURL:({previewURL:e})=>e,namespace:f,newArticle:o,saveAsDraftURL:p}))};var l=_interopRequireDefault(t("@frontend-taglib-clay$clayui/button")),n=t("@frontend-taglib-clay$clayui/drop-down"),i=_interopRequireWildcard(t("@frontend-taglib-clay$clayui/form")),r=_interopRequireWildcard(t("liferay!frontend-js-react-web$react")),u=_interopRequireDefault(t("./AssetDisplayPageSelector")),c=_interopRequireDefault(t("./PreviewButton"));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={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=l?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,a&&a.set(e,t),t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getLabel(a){return a===e.default?Liferay.Language.get("default"):a===e.specific?Liferay.Language.get("specific"):Liferay.Language.get("none")}const e={default:1,none:0,specific:2}}}));
//# sourceMappingURL=SelectAssetDisplayPage.js.map