Liferay.Loader.define("layout-template-admin-web@2.0.75/js/propsTransformers/DisplayPageDropdownPropsTransformer",["module","exports","require","frontend-js-web","../modal/openDeletePageTemplateModal"],(function(e,a,t){var r;window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(a){let{actions:t,portletNamespace:r}=a;return i(i({},function(e,a){if(null==e)return{};var t,r,n=function(e,a){if(null==e)return{};var t,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)t=l[r],a.indexOf(t)>=0||(n[t]=e[t]);return n}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)t=l[r],a.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(a,["actions","portletNamespace"])),{},{actions:null==t?void 0:t.map((a=>{var t;return i(i({},a),{},{items:null===(t=a.items)||void 0===t?void 0:t.map((a=>i(i({},a),{},{onClick(t){var n;const l=null===(n=a.data)||void 0===n?void 0:n.action;l&&(t.preventDefault(),e[l](a.data,r))}})))})})),portletNamespace:r})};var n=t("frontend-js-web"),l=(r=t("../modal/openDeletePageTemplateModal"))&&r.__esModule?r:{default:r};function o(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,r)}return t}function i(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?o(Object(t),!0).forEach((function(a){u(e,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}))}return e}function u(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}const e={deleteDisplayPage({deleteDisplayPageMessage:e,deleteDisplayPageURL:a}){(0,l.default)({message:e,onDelete:()=>{p(a)},title:Liferay.Language.get("display-page-template")})},deleteLayoutPageTemplateEntryPreview({deleteLayoutPageTemplateEntryPreviewURL:e}){p(e)},discardDraft({discardDraftURL:e}){(0,n.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-discard-current-draft-and-apply-latest-published-changes"),onConfirm:a=>{a&&p(e)}})},markAsDefaultDisplayPage({markAsDefaultDisplayPageURL:e,message:a}){""!==a?(0,n.openConfirmModal)({message:Liferay.Language.get(a),onConfirm:a=>{a&&p(e)}}):p(e)},permissionsDisplayPage({permissionsDisplayPageURL:e}){(0,n.openModal)({title:Liferay.Language.get("permissions"),url:e})},renameDisplayPage({layoutPageTemplateEntryId:e,layoutPageTemplateEntryName:a,updateDisplayPageURL:t},r){(0,n.openSimpleInputModal)({dialogTitle:Liferay.Language.get("rename-display-page-template"),formSubmitURL:t,idFieldName:"layoutPageTemplateEntryId",idFieldValue:e,mainFieldLabel:Liferay.Language.get("name"),mainFieldName:"name",mainFieldPlaceholder:Liferay.Language.get("name"),mainFieldValue:a,namespace:r})},unmarkAsDefaultDisplayPage({unmarkAsDefaultDisplayPageURL:e}){(0,n.openConfirmModal)({message:Liferay.Language.get("unmark-default-confirmation"),onConfirm:a=>{a&&p(e)}})},updateLayoutPageTemplateEntryPreview({itemSelectorURL:e,layoutPageTemplateEntryId:a},t){(0,n.openSelectionModal)({onSelect:e=>{if(e){const r=JSON.parse(e.value);document.getElementById("".concat(t,"layoutPageTemplateEntryId")).value=a,document.getElementById("".concat(t,"fileEntryId")).value=r.fileEntryId,submitForm(document.getElementById("".concat(t,"layoutPageTemplateEntryPreviewFm")))}},selectEventName:Liferay.Util.ns(t,"changePreview"),title:Liferay.Language.get("page-template-thumbnail"),url:e})}};function p(e){submitForm(document.hrefFm,e)}}}));
//# sourceMappingURL=DisplayPageDropdownPropsTransformer.js.map