Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.156/page_editor/common/openItemSelector",["module","exports","require","frontend-js-web"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.openItemSelector=function openItemSelector({callback:e,eventName:t,itemSelectorURL:r,destroyedCallback:n=null,modalProps:c={},transformValueCallback:l}){(0,o.openSelectionModal)(_objectSpread({onClose:n,onSelect:t=>{let r,o=_objectSpread({},t);if(t.value){if("string"==typeof t.value)try{r=JSON.parse(t.value)}catch(e){}else t.value&&"object"==typeof t.value&&(r=t.value);r&&(delete o.value,o=_objectSpread(_objectSpread({},o),r))}else"object"==typeof t&&(o=Object.values(t)[0]);o=l(o),o=e(o)},selectEventName:t,title:Liferay.Language.get("select"),url:r},c))};var o=r("frontend-js-web");function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}}}));
//# sourceMappingURL=openItemSelector.js.map