Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.141/page_editor/plugins/browser/components/page-structure/components/item-configuration-panels/EditableLinkPanel",["module","exports","require","liferay!frontend-js-react-web$react","../../../../../../app/components/fragment-configuration-fields/LinkField","../../../../../../app/config/constants/editableFragmentEntryProcessor","../../../../../../app/config/constants/editableTypes","../../../../../../app/contexts/StoreContext","../../../../../../app/selectors/selectEditableValue","../../../../../../app/selectors/selectEditableValues","../../../../../../app/thunks/updateEditableValues","../../../../../../app/utils/checkDeepEqual","../../../../../../app/utils/editable-value/isMapped","../../../../../../app/utils/getEditableLinkValue","../../../../../../prop-types/index"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function EditableLinkPanel({item:e}){const t=(0,l.useDispatch)(),r=(0,l.useSelector)((e=>e.languageId)),b=(0,l.useSelectorCallback)((t=>(0,c.default)(t,e.fragmentEntryLinkId)),[e.fragmentEntryLinkId]),g=(0,l.useSelectorCallback)((t=>(0,p.default)(t,e.fragmentEntryLinkId,e.editableId,i.EDITABLE_FRAGMENT_ENTRY_PROCESSOR)||{}),[e.fragmentEntryLinkId,e.editableId],d.deepEqual),[y,_]=(0,a.useState)({}),[E,j]=(0,a.useState)({href:"",target:""}),[O,S]=(0,a.useState)({});return(0,a.useEffect)((()=>{const e=_objectSpread({},g.config||{});Object.keys(e).length?(S({alt:e.alt||"",imageConfiguration:e.imageConfiguration||{}}),delete e.alt,delete e.imageConfiguration,_(e),j((0,f.getEditableLinkValue)(e,r))):(S({}),_({}),j({href:"",target:""}))}),[g.config,r]),a.default.createElement(n.default,{field:{name:"link"},onValueSelect:(a,n)=>{let l;(0,s.default)(n)||(0,s.default)(y)?l=_objectSpread(_objectSpread({},O),n):(l=_objectSpread(_objectSpread({},O),y||{}),Object.keys(n).length&&(l=_objectSpread(_objectSpread({},l),{},{href:_objectSpread(_objectSpread({},y.href||{}),{},{[r]:n.href}),target:n.target||""}))),e.type!==o.EDITABLE_TYPES.link&&(l.mapperType="link"),t((0,u.default)({editableValues:_objectSpread(_objectSpread({},b),{},{[i.EDITABLE_FRAGMENT_ENTRY_PROCESSOR]:_objectSpread(_objectSpread({},b[i.EDITABLE_FRAGMENT_ENTRY_PROCESSOR]),{},{[e.editableId]:_objectSpread(_objectSpread({},g),{},{config:l})})}),fragmentEntryLinkId:e.fragmentEntryLinkId}))},value:E})};var a=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),n=_interopRequireDefault(r("../../../../../../app/components/fragment-configuration-fields/LinkField")),i=r("../../../../../../app/config/constants/editableFragmentEntryProcessor"),o=r("../../../../../../app/config/constants/editableTypes"),l=r("../../../../../../app/contexts/StoreContext"),p=_interopRequireDefault(r("../../../../../../app/selectors/selectEditableValue")),c=_interopRequireDefault(r("../../../../../../app/selectors/selectEditableValues")),u=_interopRequireDefault(r("../../../../../../app/thunks/updateEditableValues")),d=r("../../../../../../app/utils/checkDeepEqual"),s=_interopRequireDefault(r("../../../../../../app/utils/editable-value/isMapped")),f=r("../../../../../../app/utils/getEditableLinkValue");r("../../../../../../prop-types/index");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}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=EditableLinkPanel.js.map