Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/thunks/addFragment",["module","exports","require","../actions/addFragmentEntryLinks","../config/constants/fragmentEntryTypes","../services/FragmentService"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function addFragment({fragmentEntryKey:e,groupId:t,parentItemId:n,position:i,selectItem:o=(()=>{}),type:s}){return(u,m)=>{const f={fragmentEntryKey:e,groupId:t,onNetworkStatus:u,parentItemId:n,position:i,segmentsExperienceId:m().segmentsExperienceId,type:s},updateState=(e,t,n)=>{u((0,a.default)({addedItemId:n,fragmentEntryLinks:e,layoutData:t})),o(n)};s===r.FRAGMENT_ENTRY_TYPES.composition?d.default.addFragmentEntryLinks(f).then((({addedItemId:e,fragmentEntryLinks:t,layoutData:n})=>{updateState(Object.values(t),n,e)})):d.default.addFragmentEntryLink(f).then((({addedItemId:e,fragmentEntryLink:t,layoutData:n})=>{updateState([t],n,e)}))}};var a=_interopRequireDefault(n("../actions/addFragmentEntryLinks")),r=n("../config/constants/fragmentEntryTypes"),d=_interopRequireDefault(n("../services/FragmentService"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=addFragment.js.map