import{__rest as e,__assign as n}from"../../node_modules/tslib/tslib.es6.js";import o,{Suspense as t}from"react";import r from"../common/Accordion/Collapse.js";import c,{DEFAULT_CTA_PANEL as a,ctaPanelPropsGenerator as l,ctaPanelPropsParser as i}from"../Panel/CtaPanel.js";import p,{DEFAULT_ANNOUNCEMENT as m,announcementPropsGenerator as s,announcementPropsParser as u}from"../Announcement/Announcement.js";import{EmptyBloc as d}from"./EmptyBloc.js";import{BlocComponentIdentifiers as f,NonEditableBlockIdentifier as g}from"./BlocComponentIdentifiers.js";var C,h,E=o.lazy((function(){return import("../Editor/Modal/BlocModalSettingProperties/CtaPanelSetting.js")})),v=o.lazy((function(){return import("../Editor/Modal/BlocModalSettingProperties/AnnouncementSetting.js")})),P=((C={})[f.Announcement]={component:function(t){var r=t.onBlocChange,c=e(t,["onBlocChange"]);return o.createElement(p,n({onAnnouncementChange:r},c))},defaultProperties:m,icon:o.createElement("img",{src:"/static/icons/coms/media-backdrop.svg",height:30}),settingsComponent:function(e){return o.createElement(t,{fallback:o.createElement("div",null," ")},o.createElement(v,n({},e)))},propsGenerator:s,propsParser:u,type:f.Announcement},C[f.CTAPanel]={component:function(t){var r=t.onBlocChange,a=e(t,["onBlocChange"]);return o.createElement(c,n({onCtaPanelChange:r},a))},defaultProperties:a,icon:o.createElement("img",{src:"/static/icons/coms/cta-panel.svg",height:30}),settingsComponent:function(e){return o.createElement(t,{fallback:o.createElement("div",null," ")},o.createElement(E,n({},e)))},type:f.CTAPanel,propsGenerator:l,propsParser:i},C),b=((h={})[g.Collapse]={component:function(t){var c=t.onBlocChange,a=e(t,["onBlocChange"]);return o.createElement(r,n({onCollapseChange:c},a))}},h),B=function(){return Object.keys(P).map((function(e){return P[e]}))},x=function(e){var n=(P[e]||{}).settingsComponent;return n||(console.log("Unknown bloc modal properties adapter with component type: "+e),function(){return o.createElement(o.Fragment,null)})},I=function(t,r){var c=(g.Collapse===t?b[t]:P[t]||{}).component;return c||function(t){var c=t.onBlocChange,a=t.id,l=t.bloc,i=t.sectionIndex,p=t.rowIndex,m=t.blocIndex,s=t.page,u=t.account,f=e(t,["onBlocChange","id","bloc","sectionIndex","rowIndex","blocIndex","page","account"]);return o.createElement(d,n({onTypeChange:c,bloc:l,sectionIndex:i,rowIndex:p,blocIndex:m,id:a,editorMode:r,page:s,account:u},f))}},j=function(e){return P[e]&&P[e].propsGenerator?P[e].propsGenerator:function(e,o,t){return void 0===e&&(e={}),n(n({},o),e)}},A=function(e){return P[e]&&void 0!==P[e].propsParser?P[e].propsParser:function(e,o,t){return void 0===e&&(e={}),void 0===o&&(o={}),n(n(n({},o),e),{info:"default parser"})}};export{B as getAllBlockComponents,I as getComponent,j as getPropsGenerator,A as getPropsParser,x as getSettingComponentForBlocType};
//# sourceMappingURL=BlocComponentsFactory.js.map
