Liferay.Loader.define("layout-admin-web@5.0.145/js/LayoutUtilityPageEntryDropdownPropsTransformer",["module","exports","require","frontend-js-web","./openDeleteLayoutModal"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function LayoutUtilityPageEntryDropdownPropsTransformer(t){let{actions:a,portletNamespace:r}=t;return _objectSpread(_objectSpread({},function _objectWithoutProperties(e,t){if(null==e)return{};var a,r,n=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var a,r,n={},o=Object.keys(e);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}(t,["actions","portletNamespace"])),{},{actions:null==a?void 0:a.map((t=>{var a;return _objectSpread(_objectSpread({},t),{},{items:null===(a=t.items)||void 0===a?void 0:a.map((t=>_objectSpread(_objectSpread({},t),{},{onClick(a){var n;const o=null===(n=t.data)||void 0===n?void 0:n.action;o&&(a.preventDefault(),e[o](t.data,r))}})))})})),portletNamespace:r})};var r=a("frontend-js-web"),n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(a("./openDeleteLayoutModal"));function ownKeys(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach((function(t){_defineProperty(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const e={copyLayoutUtilityPageEntry({copyLayoutUtilityPageEntryURL:e}){send(e)},deleteLayoutUtilityPageEntry({deleteLayoutUtilityPageEntryMessage:e,deleteLayoutUtilityPageEntryURL:t}){(0,n.default)({message:e,onDelete:()=>{send(t)},title:Liferay.Language.get("utility-pages")})},deleteLayoutUtilityPageEntryPreview({deleteLayoutUtilityPageEntryPreviewURL:e}){send(e)},markAsDefaultLayoutUtilityPageEntry({markAsDefaultLayoutUtilityPageEntryURL:e,message:t}){""!==t?(0,r.openConfirmModal)({message:Liferay.Language.get(t),onConfirm:t=>{t&&send(e)}}):send(e)},permissionsLayoutUtilityPageEntry({permissionsLayoutUtilityPageEntryURL:e}){(0,r.openModal)({title:Liferay.Language.get("permissions"),url:e})},renameLayoutUtilityPageEntry({layoutUtilityPageEntryId:e,layoutUtilityPageEntryName:t,updateLayoutUtilityPageEntryURL:a},n){(0,r.openSimpleInputModal)({dialogTitle:Liferay.Language.get("rename-utility-page"),formSubmitURL:a,idFieldName:"layoutUtilityPageEntryId",idFieldValue:e,mainFieldLabel:Liferay.Language.get("name"),mainFieldName:"name",mainFieldPlaceholder:Liferay.Language.get("name"),mainFieldValue:t,namespace:n})},unmarkAsDefaultLayoutUtilityPageEntry({unmarkAsDefaultLayoutUtilityPageEntryURL:e}){(0,r.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-unmark-this"),onConfirm:t=>{t&&send(e)}})},updateLayoutUtilityPageEntryPreview({itemSelectorURL:e,layoutUtilityPageEntryId:t},a){(0,r.openSelectionModal)({onSelect:e=>{if(e){const r=JSON.parse(e.value);document.getElementById("".concat(a,"layoutUtilityPageEntryId")).value=t,document.getElementById("".concat(a,"fileEntryId")).value=r.fileEntryId,submitForm(document.getElementById("".concat(a,"layoutUtilityPageEntryPreviewFm")))}},selectEventName:Liferay.Util.ns(a,"changePreview"),title:Liferay.Language.get("utility-page-thumbnail"),url:e})}};function send(e){submitForm(document.hrefFm,e)}}}));
//# sourceMappingURL=LayoutUtilityPageEntryDropdownPropsTransformer.js.map