(()=>{function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var s in o)({}).hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t},t.apply(null,arguments)}!function(e,o,s,l,a,c){l=wp.blockEditor||wp.editor;var n=o.addFilter,r=e.__,i=s.hasBlockSupport,u=l.InspectorControls,d=a.SelectControl,m=c.createHigherOrderComponent;n("blocks.registerBlockType","advgb/registerCustomStyleClass",(function(e){return e.attributes=t(e.attributes,{customStyle:{type:"string"},identifyColor:{type:"string"}}),e})),void 0!==advgbBlocksCustomStyles.customStyles&&advgbBlocksCustomStyles.customStyles&&advgbBlocksCustomStyles.customStyles.unshift({id:0,label:r("Select a block style","advanced-gutenberg"),value:"",identifyColor:""}),n("editor.BlockEdit","advgb/customStyles",(function(e){return function(o){return[o.isSelected&&React.createElement(u,{key:"advgb-custom-controls"},React.createElement("div",{className:"advgb-custom-styles-wrapper"},React.createElement(d,{label:[r("Block styles","advanced-gutenberg"),React.createElement("span",{className:"components-panel__color-area",key:"customstyle-identify",style:{background:o.attributes.identifyColor,verticalAlign:"text-bottom",borderRadius:"50%",border:"none",width:"16px",height:"16px",display:"inline-block",marginLeft:"10px"}})],help:r("This option let you add custom styles for the current block.","advanced-gutenberg"),value:o.attributes.customStyle,options:advgbBlocksCustomStyles.customStyles.map((function(t,e){return t.title&&(advgbBlocksCustomStyles.customStyles[e].label=t.title),t.name&&(advgbBlocksCustomStyles.customStyles[e].value=t.name),t})),onChange:function(t){var e=advgbBlocksCustomStyles.customStyles.filter((function(e){return e.value===t}))[0].identifyColor;o.setAttributes({customStyle:t,identifyColor:e,backgroundColor:void 0,textColor:void 0,fontSize:void 0})}}))),React.createElement(e,t({key:"block-edit-custom-class-name"},o))]}})),n("blocks.getSaveContent.extraProps","advgb/loadFrontendCustomStyles",(function(t,e,o){return i(e,"customStyle",!0)&&o.customStyle&&void 0!==o.customStyle&&(void 0===t.className?t.className=o.customStyle:(t.className+=" "+o.customStyle,t.className=t.className.trim())),t}));var y=m((function(e){return function(o){if(!i(o.name,"customStyle",!0))return React.createElement(e,o);var s=o.attributes.customStyle;return s&&void 0!==s?React.createElement(e,t({},o,{className:"".concat(s)})):React.createElement(e,o)}}),"withStyleClasses");wp.hooks.addFilter("editor.BlockListBlock","advgb/loadBackendCustomStyles",y)}(wp.i18n,wp.hooks,wp.blocks,wp.blockEditor,wp.components,wp.compose)})();
//# sourceMappingURL=custom-styles.js.map