Plugin Directory

Changeset 3336084


Ignore:
Timestamp:
07/29/2025 03:31:56 PM (8 months ago)
Author:
darnado
Message:

Updated to version 2.1.1. This update makes some minor changes to the plugin. It reorders the controls of the Additional tab in the Button Block. It also changes the default values of 2 settings used in the plugin Admin menu.

Location:
caledros-basic-blocks
Files:
769 added
9 edited

Legend:

Unmodified
Added
Removed
  • caledros-basic-blocks/trunk/README.txt

    r3335584 r3336084  
    55Requires at least: 6.7
    66Tested up to: 6.8
    7 Stable tag: 2.1.0
     7Stable tag: 2.1.1
    88Requires PHP: 8.0
    99License: GPLv2 or later
     
    240240* Updated title of the hover background color control for the Button Block.
    241241
     242= 2.1.1 =
     243* Changed the order of controls in the Additional tab of the Button Block.
     244* Changed the default value to zero for the "caledros_basic_blocks_add_column_layout_to_wp_site_blocks" and "caledros_basic_blocks_set_custom_height_to_wp_site_blocks" settings. These settings are used in the plugin Admin menu.
     245
    242246== Upgrade Notice ==
    243247
     
    272276This update adds several new features to the blocks included in the plugin.
    273277
     278= 2.1.1 =
     279This update changes the order of controls of the Button block and modifies the default values of 2 plugin settings.
     280
    274281== Installation ==
    275282
  • caledros-basic-blocks/trunk/build/blocks/button/index.asset.php

    r3335584 r3336084  
    1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'd8a94074a4e9f1bc33d5');
     1<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'e2e8ff3322d51e976059');
  • caledros-basic-blocks/trunk/build/blocks/button/index.js

    r3335584 r3336084  
    1 (()=>{"use strict";var e,t={708:()=>{const e=window.wp.blocks,t=window.wp.i18n,o=JSON.parse('{"UU":"caledros-basic-blocks/button"}'),l=window.ReactJSXRuntime,a={icon:(0,l.jsx)("svg",{width:"24",height:"24",version:"1.1",viewBox:"0 0 6.35 6.35",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("g",{transform:"translate(-96.573 -101.07)",children:(0,l.jsxs)("g",{transform:"matrix(.087396 0 0 .087396 90.571 91.268)",children:[(0,l.jsx)("path",{d:"m141.33 148.5a36.329 36.329 0 0 1-36.329 36.329 36.329 36.329 0 0 1-36.329-36.329 36.329 36.329 0 0 1 36.329-36.329 36.329 36.329 0 0 1 36.329 36.329z",fill:"#e0ebe0","stroke-width":"0"}),(0,l.jsx)("path",{d:"m138.18 148.5a33.177 33.177 0 0 1-33.177 33.177 33.177 33.177 0 0 1-33.177-33.177 33.177 33.177 0 0 1 33.177-33.177 33.177 33.177 0 0 1 33.177 33.177z",fill:"#252533","stroke-width":"0"}),(0,l.jsx)("path",{d:"m135.4 148.5a30.397 30.397 0 0 1-30.397 30.397 30.397 30.397 0 0 1-30.397-30.397 30.397 30.397 0 0 1 30.397-30.397 30.397 30.397 0 0 1 30.397 30.397z",fill:"#e0ebe0","stroke-width":"0"}),(0,l.jsxs)("g",{transform:"matrix(.90041 0 0 .90041 31.823 90.353)",fill:"#252533","stroke-width":"1.1106",children:[(0,l.jsx)("path",{d:"m93.777 55.9v9.3361c7.8313 1.1492 16.709-9.4028 15.094-9.3963z"}),(0,l.jsx)("path",{d:"m97.104 59.499c2.0783-0.03527 3.9177 0.15195 8.6289-2.233-5.125 1.0559-5.7944 0.56153-8.6392 0.57438-0.78106 0.0035-0.68526 1.6378 0.01037 1.6586z","stroke-width":"0"}),(0,l.jsx)("path",{d:"m53.478 56.801h38.884v9.3252s-3.9882 1.7008-3.4603 4.8679c0.52784 3.1671 3.1084 6.862 10.088 6.9206v7.1928h-7.2969s-4.3545-4.1057-10.865-3.8568-10.078 3.691-10.078 3.691h-7.4648v-7.3819s10.451 0.62207 9.9531-7.1331c-0.49766-7.7551-19.699-9.2481-19.699-9.2481z"})]}),(0,l.jsx)("path",{d:"m106.41 126.27a0.78523 0.78523 0 0 0-0.94136 0.59044l-2.4602 10.727a0.78523 0.78523 0 0 0 0.58951 0.94136 0.78523 0.78523 0 0 0 0.94044-0.59044l2.4611-10.727a0.78523 0.78523 0 0 0-0.58951-0.94136z",color:"#000000",fill:"#fc571b","stroke-width":"0"}),(0,l.jsx)("path",{d:"m100.45 127.77-5.9517 3.9678a0.78531 0.78531 0 0 0 0 1.3062l5.9517 3.9678a0.78523 0.78523 0 0 0 1.089-0.21724 0.78523 0.78523 0 0 0-0.21816-1.089l-4.9723-3.3152 4.9723-3.3143a0.78523 0.78523 0 0 0 0.21816-1.089 0.78523 0.78523 0 0 0-1.089-0.21724z",color:"#000000",fill:"#fc571b","stroke-width":"0"}),(0,l.jsx)("path",{d:"m109.55 127.77a0.78523 0.78523 0 0 0-1.089 0.21724 0.78523 0.78523 0 0 0 0.21816 1.089l4.9714 3.3143-4.9714 3.3152a0.78523 0.78523 0 0 0-0.21816 1.089 0.78523 0.78523 0 0 0 1.089 0.21724l5.9517-3.9678a0.78531 0.78531 0 0 0 0-1.3062z",color:"#000000",fill:"#fc571b","stroke-width":"0"})]})})})},r=window.wp.blockEditor,n=window.wp.components,s=window.wp.element,i=window.wp.data;function b({attributes:e,setAttributes:o}){const{buttonLightColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Background color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent background",checked:b,onChange:()=>{c((e=>!e)),o({buttonLightColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonLightColor:e}),enableAlpha:!0,clearable:!1})]})}function c({attributes:e,setAttributes:o}){const{buttonDarkColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Background color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent background",checked:b,onChange:()=>{c((e=>!e)),o({buttonDarkColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonDarkColor:e}),enableAlpha:!0,clearable:!1})]})}function u({attributes:e,setAttributes:o}){const{buttonHoverLightColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover bg color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent background",checked:b,onChange:()=>{c((e=>!e)),o({buttonHoverLightColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonHoverLightColor:e}),enableAlpha:!0,clearable:!1})]})}function d({attributes:e,setAttributes:o}){const{buttonHoverDarkColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover bg color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent background",checked:b,onChange:()=>{c((e=>!e)),o({buttonHoverDarkColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonHoverDarkColor:e}),enableAlpha:!0,clearable:!1})]})}function g({attributes:e,setAttributes:o}){const{buttonTextLightColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Text color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent color",checked:b,onChange:()=>{c((e=>!e)),o({buttonTextLightColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonTextLightColor:e}),enableAlpha:!0,clearable:!1})]})}function h({attributes:e,setAttributes:o}){const{buttonTextDarkColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Text color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent color",checked:b,onChange:()=>{c((e=>!e)),o({buttonTextDarkColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonTextDarkColor:e}),enableAlpha:!0,clearable:!1})]})}function p({attributes:e,setAttributes:o,registeredFonts:a,getAvailableFontStyles:r,getAvailableFontWeights:s,doesFontExist:i}){const{buttonFontFamily:b,buttonFontWeight:c,buttonFontStyle:u}=e,d=a?.theme?.map((e=>({label:e.name,value:e.slug})))||[],g=a?.custom?.map((e=>({label:e?.name,value:e?.slug})))||[],h=[{label:"Default",value:""},...0!==d.length?d:[],...g&&0!==g?.length?g:[]];return(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Select the font family.","caledros-basic-blocks"),value:b,options:h,onChange:e=>{const t=i(e)?r(e):[],l=t.includes(u)?u:t[0],a=i(e)?s(e,l):[],n=a.includes(c)?c:a[0];o({buttonFontFamily:e,...i(e)&&l!==u&&{buttonFontStyle:l},...i(e)&&n!==c&&{buttonFontWeight:n}})}})}function x({attributes:e,setAttributes:o,getAvailableFontWeights:a}){const{buttonFontFamily:r,buttonFontWeight:s,buttonFontStyle:i}=e,b=a(r,i)?.map((e=>({label:`${e}`,value:e})));return(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Select the font weight.","caledros-basic-blocks"),value:s,options:b||[{label:"100",value:100},{label:"200",value:200},{label:"300",value:300},{label:"400",value:400},{label:"500",value:500},{label:"600",value:600},{label:"700",value:700},{label:"800",value:800},{label:"900",value:900}],onChange:e=>{o({buttonFontWeight:parseInt(e)})}})}function v({attributes:e,setAttributes:o,getAvailableFontStyles:a,getAvailableFontWeights:r,doesFontExist:s}){const{buttonFontFamily:i,buttonFontStyle:b,buttonFontWeight:c}=e,u=a(i)?.map((e=>({label:`${e[0].toUpperCase()}${e.slice(1)}`,value:`${e}`})));return(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Select the font style.","caledros-basic-blocks"),value:b,options:0===u.length?[{label:"Normal",value:"normal"},{label:"Italic",value:"italic"}]:u,onChange:e=>{const t=s(i)?r(i,e):[],l=t.includes(c)?c:t[0];o({buttonFontStyle:e,...s(i)&&c!==l&&{buttonFontWeight:l}})}})}function m({attributes:e,setAttributes:o}){const[a]=(0,r.useSettings)("typography.fontFamilies"),{theme:s=[],custom:i=[]}=a||{},b=[...s,...i],c=e=>b.some((t=>t?.slug===e)),u=e=>{const t=b.find((t=>t?.slug===e)),o=t?.fontFace?.map((e=>e?.fontStyle))||[];return[...new Set(o)]},d=(e,t)=>{const o=b.find((t=>t?.slug===e)),l=o?.fontFace?.filter((e=>e?.fontStyle===t)),a=l?.map((e=>{if(e?.fontWeight?.includes(" ")){const[t,o]=e?.fontWeight.split(" ").map((e=>parseInt(e))),l=[];for(let e=t;e<=o;e+=100)l.push(e);return l}return parseInt(e?.fontWeight)})).flat().sort(((e,t)=>e-t));return a};return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Typography","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(p,{attributes:e,setAttributes:o,registeredFonts:a,getAvailableFontStyles:u,getAvailableFontWeights:d,doesFontExist:c}),(0,l.jsx)(v,{attributes:e,setAttributes:o,getAvailableFontStyles:u,getAvailableFontWeights:d,doesFontExist:c}),(0,l.jsx)(x,{attributes:e,setAttributes:o,getAvailableFontWeights:d})]})}function _({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,b=a.darkColor.split(" "),c=b[0]||"#000",u=b[1]||"#000",d=b[2]||"#000",g=b[3]||"#000",[h,p]=(0,s.useState)(!!a.darkColor.includes(" ")),[x,v]=(0,r.useSettings)("color.palette","color.defaultPalette"),m=x.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),_=(0,i.select)("core/editor")?.getEditorSettings(),C=_?.__experimentalFeatures?.color?.palette,f=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),$=f(C,"default"),j=f(C,"theme"),k=f(C,"custom"),S=[...v?[$]:[],j,...k.colors?[k]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border colors for each side",checked:h,onChange:()=>{const e=!h;p(e),o(e?{buttonBorder:{...a,darkColor:"#000 #000 #000 #000"}}:{buttonBorder:{...a,darkColor:"#000"}})}}),!h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose the border color","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:a.darkColor,onChange:e=>o({buttonBorder:{...a,darkColor:e||"#00000000"}}),enableAlpha:!0,clearable:!0})]}),h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the top border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:c,onChange:e=>{o({buttonBorder:{...a,darkColor:`${e||"#00000000"} ${u} ${d} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the right border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:u,onChange:e=>{o({buttonBorder:{...a,darkColor:`${c} ${e||"#00000000"} ${d} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the bottom border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:d,onChange:e=>{o({buttonBorder:{...a,darkColor:`${c} ${u} ${e||"#00000000"} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the left border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:g,onChange:e=>{o({buttonBorder:{...a,darkColor:`${c} ${u} ${d} ${e||"#00000000"}`}})},enableAlpha:!0,clearable:!0})]})]})}function C({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,b=a.lightColor.split(" "),c=b[0]||"#000",u=b[1]||"#000",d=b[2]||"#000",g=b[3]||"#000",[h,p]=(0,s.useState)(!!a.lightColor.includes(" ")),[x,v]=(0,r.useSettings)("color.palette","color.defaultPalette"),m=x.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),_=(0,i.select)("core/editor")?.getEditorSettings(),C=_?.__experimentalFeatures?.color?.palette,f=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),$=f(C,"default"),j=f(C,"theme"),k=f(C,"custom"),S=[...v?[$]:[],j,...k.colors?[k]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border colors for each side",checked:h,onChange:()=>{const e=!h;p(e),o(e?{buttonBorder:{...a,lightColor:"#000 #000 #000 #000"}}:{buttonBorder:{...a,lightColor:"#000"}})}}),!h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose the border color","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:a.lightColor,onChange:e=>o({buttonBorder:{...a,lightColor:e||"#00000000"}}),enableAlpha:!0,clearable:!0})]}),h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the top border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:c,onChange:e=>{o({buttonBorder:{...a,lightColor:`${e||"#00000000"} ${u} ${d} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the right border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:u,onChange:e=>{o({buttonBorder:{...a,lightColor:`${c} ${e||"#00000000"} ${d} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the bottom border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:d,onChange:e=>{o({buttonBorder:{...a,lightColor:`${c} ${u} ${e||"#00000000"} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the left border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:g,onChange:e=>{o({buttonBorder:{...a,lightColor:`${c} ${u} ${d} ${e||"#00000000"}`}})},enableAlpha:!0,clearable:!0})]})]})}function f({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,r=a.radius.split(" "),i=parseInt(r[0])||0,b=parseInt(r[1])||0,c=parseInt(r[2])||0,u=parseInt(r[3])||0,d=a.radius.split(" "),g=d[0]?d[0].replace(/\d+/g,""):"px",h=d[1]?d[1].replace(/\d+/g,""):"px",p=d[2]?d[2].replace(/\d+/g,""):"px",x=d[3]?d[3].replace(/\d+/g,""):"px",[v,m]=(0,s.useState)(!!a.radius.includes(" ")),_=(e,t)=>"%"===e&&t>100?100:t;return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border radius","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border radiuses for each corner",checked:v,onChange:()=>{const e=!v;m(e),o(e?{buttonBorder:{...a,radius:"10px 10px 10px 10px"}}:{buttonBorder:{...a,radius:"10px"}})}}),!v&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the border radius (${g}) for the button.`,"caledros-basic-blocks"),value:parseInt(a.radius),max:"%"===g?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${e}${g}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:g,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${_(e,parseInt(a.radius))}${e}`}})}})]}),v&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the top-left border radius (${g}).`,"caledros-basic-blocks"),value:i,max:"%"===g?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${e}${g} ${b}${h} ${c}${p} ${u}${x}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:g,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${_(e,i)}${e} ${b}${h} ${c}${p} ${u}${x}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the top-right border radius (${h}).`,"caledros-basic-blocks"),value:b,max:"%"===h?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${e}${h} ${c}${p} ${u}${x}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:h,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${_(e,b)}${e} ${c}${p} ${u}${x}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the bottom-right border radius (${p}).`,"caledros-basic-blocks"),value:c,max:"%"===p?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${b}${h} ${e}${p} ${u}${x}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:p,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${b}${h} ${_(e,c)}${e} ${u}${x}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the bottom-left border radius (${x}).`,"caledros-basic-blocks"),value:u,max:"%"===x?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${b}${h} ${c}${p} ${e}${x}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:x,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${b}${h} ${c}${p} ${_(e,u)}${e}`}})}})]})]})]})}function $({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,r=a.style.split(" "),i=r[0]||"solid",b=r[1]||"none",c=r[2]||"none",u=r[3]||"none",[d,g]=(0,s.useState)(!!a.style.includes(" "));return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border style","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border styles for each side",checked:d,onChange:()=>{const e=!d;g(e),o(e?{buttonBorder:{...a,style:"solid none none none"}}:{buttonBorder:{...a,style:"solid"}})}}),!d&&(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the border style.","caledros-basic-blocks"),value:a.style,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:e}})}}),d&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the style for the top border.","caledros-basic-blocks"),value:i,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:`${e} ${b} ${c} ${u}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the style for the right border.","caledros-basic-blocks"),value:b,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:`${i} ${e} ${c} ${u}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the style for the bottom border.","caledros-basic-blocks"),value:c,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:`${i} ${b} ${e} ${u}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the style for the left border.","caledros-basic-blocks"),value:u,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:`${i} ${b} ${c} ${e}`}})}})]})]})}function j({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,r=a.width.split(" "),i=parseInt(r[0])||0,b=parseInt(r[1])||0,c=parseInt(r[2])||0,u=parseInt(r[3])||0,[d,g]=(0,s.useState)(!!a.width.includes(" "));return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border width","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border widths for each side",checked:d,onChange:()=>{const e=!d;g(e),o(e?{buttonBorder:{...a,width:"1px 1px 1px 1px"}}:{buttonBorder:{...a,width:"1px"}})}}),!d&&(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the border width (px) for the button.","caledros-basic-blocks"),value:parseInt(a.width),max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${e}px`}})}}),d&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the top border width (px) for the button.","caledros-basic-blocks"),value:i,max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${e}px ${b}px ${c}px ${u}px`}})}}),(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the right border width (px) for the button.","caledros-basic-blocks"),value:b,max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${i}px ${e}px ${c}px ${u}px`}})}}),(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the bottom border width (px) for the button.","caledros-basic-blocks"),value:c,max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${i}px ${b}px ${e}px ${u}px`}})}}),(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the left border width (px) for the button.","caledros-basic-blocks"),value:u,max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${i}px ${b}px ${c}px ${e}px`}})}})]})]})}function k({attributes:e,setAttributes:o}){const{buttonText:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button text","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Type the text for the button.","caledros-basic-blocks"),value:a,onChange:e=>{o({buttonText:e})}})})}function S({attributes:e,setAttributes:o}){const{buttonLink:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button link","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Paste the link for the button.","caledros-basic-blocks"),value:a,onChange:e=>{o({buttonLink:e})}})})}function w({attributes:e,setAttributes:o}){const{buttonMargin:a}=e,r=parseInt(a.top)||0,s=parseInt(a.left)||0,i=parseInt(a.bottom)||0,b=parseInt(a.right)||0,c=a.top.replace(/\d+/g,""),u=a.left.replace(/\d+/g,""),d=a.bottom.replace(/\d+/g,""),g=a.right.replace(/\d+/g,""),h=(e,t)=>"auto"===e?"":["%","vw"].includes(e)&&t>100?100:t;return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Margin","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Enable different margins","caledros-basic-blocks"),checked:a.differentMarginsEnabled,onChange:e=>{o({buttonMargin:{...a,differentMarginsEnabled:e}})}}),!a.differentMarginsEnabled&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the margin (${c}) for the button.`,"caledros-basic-blocks"),value:r,max:["%","vw"].includes(c)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,top:`${"auto"===c?"":e}${c}`}})},disabled:"auto"===c}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,top:`${h(e,r)}${e}`}})}})]}),a.differentMarginsEnabled&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the top margin (${c}) for the button.`,"caledros-basic-blocks"),value:r,max:["%","vw"].includes(c)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,top:`${"auto"===c?"":e}${c}`}})},disabled:"auto"===c}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,top:`${h(e,r)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the right margin (${g}) for the button.`,"caledros-basic-blocks"),value:b,max:["%","vw"].includes(g)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,right:`${"auto"===g?"":e}${g}`}})},disabled:"auto"===g}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:g,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,right:`${h(e,b)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the bottom margin (${d}) for the button.`,"caledros-basic-blocks"),value:i,max:["%","vw"].includes(d)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,bottom:`${"auto"===d?"":e}${d}`}})},disabled:"auto"===d}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:d,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,bottom:`${h(e,i)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the left margin (${u}) for the button.`,"caledros-basic-blocks"),value:s,max:["%","vw"].includes(u)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,left:`${"auto"===u?"":e}${u}`}})},disabled:"auto"===u}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:u,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,left:`${h(e,s)}${e}`}})}})]})]})]})}function B({attributes:e,setAttributes:o}){const{buttonPadding:a}=e,r=parseInt(a.top)||0,s=parseInt(a.left)||0,i=parseInt(a.bottom)||0,b=parseInt(a.right)||0,c=a.top.replace(/\d+/g,""),u=a.left.replace(/\d+/g,""),d=a.bottom.replace(/\d+/g,""),g=a.right.replace(/\d+/g,""),h=(e,t)=>["%","vw"].includes(e)&&t>100?100:t;return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Padding","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Use global padding","caledros-basic-blocks"),help:(0,t.__)("This option applies predefined padding to the right and left sides of the block, ensuring consistency across the entire site. To adjust this padding, navigate to the Layout section in the Full Site Editor.","caledros-basic-blocks"),checked:a.useGlobalPadding,onChange:e=>{o({buttonPadding:{...a,useGlobalPadding:e}})}}),!a.useGlobalPadding&&(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Enable different paddings","caledros-basic-blocks"),checked:a.differentPaddingsEnabled,onChange:e=>{o({buttonPadding:{...a,differentPaddingsEnabled:e}})}}),!a.differentPaddingsEnabled&&!a.useGlobalPadding&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the padding (${c}) for the button`,"caledros-basic-blocks"),value:r,max:["%","vw"].includes(c)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,top:`${e}${c}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,top:`${h(e,r)}${e}`}})}})]}),a.differentPaddingsEnabled&&!a.useGlobalPadding&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the top padding (${c}) for the button`,"caledros-basic-blocks"),value:r,max:["%","vw"].includes(c)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,top:`${e}${c}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,top:`${h(e,r)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the right padding (${g}) for the button`,"caledros-basic-blocks"),value:b,max:["%","vw"].includes(g)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,right:`${e}${g}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:g,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,right:`${h(e,b)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the bottom padding (${d}) for the button`,"caledros-basic-blocks"),value:i,max:["%","vw"].includes(d)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,bottom:`${e}${d}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:d,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,bottom:`${h(e,i)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the left padding (${u}) for the button`,"caledros-basic-blocks"),value:s,max:["%","vw"].includes(u)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,left:`${e}${u}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:u,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,left:`${h(e,s)}${e}`}})}})]})]})]})}function A({attributes:e,setAttributes:o}){const{buttonLetterSpacing:a}=e,[r,i]=(0,s.useState)("normal"===a),b=a.replace(/[\d.]+/g,"")||"px",c=["px","em","rem"].includes(b)?b:"px",u=e=>"px"===e?parseInt(a)||0:parseFloat(a)||0,d=(e,t)=>"px"!==e&&t>10?10:t;return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Letter spacing","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Use normal letter spacing","caledros-basic-blocks"),checked:r,onChange:()=>{const e=r?"0":"normal";i((e=>!e)),o({buttonLetterSpacing:`${e}${"normal"===e?"":c}`})}}),!r&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the custom letter spacing (${c}).`,"caledros-basic-blocks"),value:parseFloat(a)||0,max:"px"===c?50:10,min:0,step:"px"===c?1:.01,onChange:e=>{o({buttonLetterSpacing:`${d(c,e)}${c}`})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"em",value:"em"},{label:"rem",value:"rem"}],onChange:e=>{o({buttonLetterSpacing:`${d(e,u(e))}${e}`})}})]})]})}function H({attributes:e,setAttributes:o}){const{buttonFontSize:a}=e,[b,c]=(0,r.useSettings)("typography.fontSizes","typography.defaultFontSizes"),u=b?.map((e=>({label:`${e.name} (${e.size})`,value:`var(--wp--preset--font-size--${e.slug})`}))),d=(0,i.select)("core/editor")?.getEditorSettings()?.__experimentalFeatures?.typography?.fontSizes,g=(e,t)=>e?.[t]?.map((e=>({label:`${e.name} (${e.size})`,value:`var(--wp--preset--font-size--${e.slug})`}))),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...c?[h]:[],p,...x&&0!==x?.length?[x]:[]].flat(),m=()=>d?[...h?.map((e=>e.value))||[],...p?.map((e=>e.value))||[],...x?.map((e=>e.value))||[]]:b?.map((e=>e.value)),_=a.replace(/[\d.]+/g,"")||"px",C=["px","em","rem","vw","vh"].includes(_)?_:"px",f=e=>"px"===e?parseInt(a)||0:parseFloat(a)||0,$=(e,t)=>["vw","vh"].includes(e)&&t>100?100:t,[j,k]=(0,s.useState)(!m().includes(a));return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Font size","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use custom font size",checked:j,onChange:()=>k((e=>!e))}),!j&&(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Select the font size.","caledros-basic-blocks"),value:m().includes(a)?a:"",options:[{disabled:!0,label:"Select an option",value:""},...d?v:u],onChange:e=>{o({buttonFontSize:e})}}),j&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the custom font size (${C}).`,"caledros-basic-blocks"),value:m().includes(a)?0:parseFloat(a),max:"vw"===C||"vh"===C?100:200,min:0,step:"px"===C?1:.01,onChange:e=>{o({buttonFontSize:`${$(C,e)}${C}`})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:C,options:[{label:"px",value:"px"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"vh",value:"vh"}],onChange:e=>{o({buttonFontSize:`${$(e,f(e))}${e}`})}})]})]})}function P({attributes:e,setAttributes:o}){const{buttonIcon:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button Icon","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Choose the icon","caledros-basic-blocks"),value:a,options:[{label:"Alarm Fill",value:"alarm-fill"},{label:"Arrow Left Circle Fill",value:"arrow-left-circle-fill"},{label:"Arrow Left Circle",value:"arrow-left-circle"},{label:"Arrow Right Circle Fill",value:"arrow-right-circle-fill"},{label:"Arrow Right Circle",value:"arrow-right-circle"},{label:"Arrow Up Left Square",value:"arrow-up-left-square"},{label:"Arrow Up Right Circle Fill",value:"arrow-up-right-circle-fill"},{label:"Arrow Up Right Circle",value:"arrow-up-right-circle"},{label:"Arrow Up Right Square Fill",value:"arrow-up-right-square-fill"},{label:"Arrow Up Right Square",value:"arrow-up-right-square"},{label:"Award",value:"award"},{label:"Battery Charging",value:"battery-charging"},{label:"Box",value:"box-seam"},{label:"Boxes",value:"boxes"},{label:"Bricks",value:"bricks"},{label:"Brightness High",value:"brightness-high"},{label:"Bug",value:"bug"},{label:"Building",value:"building"},{label:"Buildings",value:"buildings"},{label:"Chat Text",value:"chat-text"},{label:"Cloud Check",value:"cloud-check"},{label:"Cloud Sun",value:"cloud-sun"},{label:"Code",value:"code-square"},{label:"Coin",value:"coin"},{label:"Columns",value:"columns"},{label:"Columns Gap",value:"columns-gap"},{label:"Database Down",value:"database-down"},{label:"Database Up",value:"database-up"},{label:"File Bar Graph",value:"file-bar-graph"},{label:"Fire",value:"fire"},{label:"Gear",value:"gear"},{label:"Globe",value:"globe2"},{label:"Graph Down Arrow",value:"graph-down-arrow"},{label:"Graph Up Arrow",value:"graph-up-arrow"},{label:"Hourglass",value:"hourglass"},{label:"Hourglass Bottom",value:"hourglass-bottom"},{label:"Hourglass Split",value:"hourglass-split"},{label:"Hourglass Top",value:"hourglass-top"},{label:"Lightbulb",value:"lightbulb"},{label:"Magic",value:"magic"},{label:"Moon Stars",value:"moon-stars"},{label:"People Fill",value:"people-fill"},{label:"Person Circle",value:"person-circle"},{label:"Quote",value:"quote"},{label:"Robot",value:"robot"},{label:"Rocket Takeoff",value:"rocket-takeoff"},{label:"Star",value:"star"},{label:"Stars",value:"stars"},{label:"Stickies",value:"stickies"},{label:"Tools",value:"tools"},{label:"UI Checks Grid",value:"ui-checks-grid"},{label:"UI Checks",value:"ui-checks"},{label:"Umbrella Fill",value:"umbrella-fill"},{label:"Watch",value:"watch"},{label:"Wind",value:"wind"},{label:"Wrench",value:"wrench"},{label:"Wrench Adjustable",value:"wrench-adjustable"},{label:"Wrench Adjustable Circle",value:"wrench-adjustable-circle"}],onChange:e=>o({buttonIcon:e})})})}function N({attributes:e,setAttributes:o}){const{buttonIconColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Icon color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a,onChange:e=>o({buttonIconColor:e}),enableAlpha:!0,clearable:!1})})}function y({attributes:e,setAttributes:o}){const{buttonIconDarkColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Icon color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a,onChange:e=>o({buttonIconDarkColor:e}),enableAlpha:!0,clearable:!1})})}function D({attributes:e,setAttributes:o}){const{buttonIconSize:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button Icon size","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Adjust the size (px) of the icon","caledros-basic-blocks"),initialPosition:a,value:a,max:300,min:0,step:1,onChange:e=>o({buttonIconSize:e})})})}function F({attributes:e,setAttributes:o}){const{buttonIconFlexDirection:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button flex direction","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the flex direction for the button's items.","caledros-basic-blocks"),value:a,options:[{label:"Row (default)",value:"row"},{label:"Row reverse",value:"row-reverse"}],onChange:e=>{o({buttonIconFlexDirection:e})}})})}function M({attributes:e,setAttributes:o}){const{buttonHoverTextLightColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover text color (Light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({buttonHoverTextLightColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({buttonHoverTextLightColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function z({attributes:e,setAttributes:o}){const{buttonHoverTextDarkColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover text color (Dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({buttonHoverTextDarkColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({buttonHoverTextDarkColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function T({attributes:e,setAttributes:o}){const{iconHoverLightColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover icon color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({iconHoverLightColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({iconHoverLightColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function I({attributes:e,setAttributes:o}){const{iconHoverDarkColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover icon color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({iconHoverDarkColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({iconHoverDarkColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function L({attributes:e,setAttributes:o}){const{borderHoverLightColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover border color (Light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({borderHoverLightColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({borderHoverLightColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function O({attributes:e,setAttributes:o}){const{borderHoverDarkColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover border color (Dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({borderHoverDarkColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({borderHoverDarkColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}(0,e.registerBlockType)(o.UU,{icon:a.icon,edit:function({attributes:e,setAttributes:t}){const{buttonText:o,buttonLightColor:a,buttonDarkColor:s,buttonHoverLightColor:i,buttonHoverDarkColor:p,buttonTextLightColor:x,buttonTextDarkColor:v,buttonFontFamily:R,buttonFontWeight:E,buttonFontStyle:U,buttonFontSize:W,buttonLetterSpacing:G,buttonBorder:q,buttonMargin:J,buttonPadding:Q,buttonType:X,buttonIcon:K,buttonIconSize:V,buttonIconColor:Y,buttonIconDarkColor:Z,buttonIconFlexDirection:ee,buttonHoverTextLightColor:te,buttonHoverTextDarkColor:oe,iconHoverLightColor:le,iconHoverDarkColor:ae,borderHoverLightColor:re,borderHoverDarkColor:ne}=e,se=["cbb-button","button-with-icon"===X?"cbb-button-with-icon":"",te.enabled?"cbb-button--hover-text-light-color":"",oe.enabled?"cbb-button--hover-text-dark-color":"",le.enabled?"cbb-button--icon-text-light-color":"",ae.enabled?"cbb-button--icon-text-dark-color":"",re.enabled?"cbb-button--hover-border-light-color":"",ne.enabled?"cbb-button--hover-border-dark-color":""].filter((e=>e)).join(" "),ie=(0,r.useBlockProps)({className:se,style:{"--cbb-button-light-color":a,"--cbb-button-dark-color":s,"--cbb-button-hover-light-color":i,"--cbb-button-hover-dark-color":p,"--cbb-button-text-light-color":x,...te.enabled&&{"--cbb-button-hover-text-light-color":te.value},"--cbb-button-text-dark-color":v,...oe.enabled&&{"--cbb-button-hover-text-dark-color":oe.value},..."button-with-icon"===X&&{"--cbb-button-flex-direction":ee},...""!==R&&{fontFamily:`var(--wp--preset--font-family--${R})`},fontWeight:E,fontStyle:U,fontSize:W,..."normal"!==G&&{letterSpacing:G},..."0px"!==q.width&&"none"!==q.style&&("#00000000"!==q.lightColor||"#00000000"!==q.darkColor)&&{borderStyle:q.style},..."0px"!==q.width&&"none"!==q.style&&("#00000000"!==q.lightColor||"#00000000"!==q.darkColor)&&{borderWidth:q.width},..."0px"!==q.width&&"none"!==q.style&&"#00000000"!==q.lightColor&&{"--cbb-button-light-border-color":q.lightColor},..."0px"!==q.width&&"none"!==q.style&&"#00000000"!==q.darkColor&&{"--cbb-button-dark-border-color":q.darkColor},...re.enabled&&{"--cbb-button-border-hover-light-color":re.value},...ne.enabled&&{"--cbb-button-border-hover-dark-color":ne.value},..."0px"!==q.radius&&"0%"!==q.radius&&{borderRadius:q.radius},margin:J.differentMarginsEnabled?`${J.top} ${J.right} ${J.bottom} ${J.left}`:`${J.top}`,padding:Q.differentPaddingsEnabled?`${Q.top} ${Q.right} ${Q.bottom} ${Q.left}`:`${Q.top}`}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.InspectorControls,{children:(0,l.jsx)(n.TabPanel,{activeClass:"cbb-active-tab",tabs:[{name:"content",title:"Content"},{name:"style",title:"Style"},{name:"additional",title:"Additional"}],children:o=>"content"===o.name?"simple-button"===X?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{attributes:e,setAttributes:t}),(0,l.jsx)(S,{attributes:e,setAttributes:t}),(0,l.jsx)(m,{attributes:e,setAttributes:t}),(0,l.jsx)(H,{attributes:e,setAttributes:t}),(0,l.jsx)(A,{attributes:e,setAttributes:t})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{attributes:e,setAttributes:t}),(0,l.jsx)(S,{attributes:e,setAttributes:t}),(0,l.jsx)(m,{attributes:e,setAttributes:t}),(0,l.jsx)(H,{attributes:e,setAttributes:t}),(0,l.jsx)(A,{attributes:e,setAttributes:t}),(0,l.jsx)(P,{attributes:e,setAttributes:t}),(0,l.jsx)(D,{attributes:e,setAttributes:t})]}):"style"===o.name?"simple-button"===X?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b,{attributes:e,setAttributes:t}),(0,l.jsx)(c,{attributes:e,setAttributes:t}),(0,l.jsx)(u,{attributes:e,setAttributes:t}),(0,l.jsx)(d,{attributes:e,setAttributes:t}),(0,l.jsx)(g,{attributes:e,setAttributes:t}),(0,l.jsx)(h,{attributes:e,setAttributes:t}),(0,l.jsx)(M,{attributes:e,setAttributes:t}),(0,l.jsx)(z,{attributes:e,setAttributes:t})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b,{attributes:e,setAttributes:t}),(0,l.jsx)(c,{attributes:e,setAttributes:t}),(0,l.jsx)(u,{attributes:e,setAttributes:t}),(0,l.jsx)(d,{attributes:e,setAttributes:t}),(0,l.jsx)(g,{attributes:e,setAttributes:t}),(0,l.jsx)(h,{attributes:e,setAttributes:t}),(0,l.jsx)(M,{attributes:e,setAttributes:t}),(0,l.jsx)(z,{attributes:e,setAttributes:t}),(0,l.jsx)(N,{attributes:e,setAttributes:t}),(0,l.jsx)(y,{attributes:e,setAttributes:t}),(0,l.jsx)(T,{attributes:e,setAttributes:t}),(0,l.jsx)(I,{attributes:e,setAttributes:t}),(0,l.jsx)(F,{attributes:e,setAttributes:t})]}):"additional"===o.name?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($,{attributes:e,setAttributes:t}),(0,l.jsx)(j,{attributes:e,setAttributes:t}),(0,l.jsx)(C,{attributes:e,setAttributes:t}),(0,l.jsx)(L,{attributes:e,setAttributes:t}),(0,l.jsx)(O,{attributes:e,setAttributes:t}),(0,l.jsx)(_,{attributes:e,setAttributes:t}),(0,l.jsx)(f,{attributes:e,setAttributes:t}),(0,l.jsx)(w,{attributes:e,setAttributes:t}),(0,l.jsx)(B,{attributes:e,setAttributes:t})]}):null})}),"simple-button"===X&&(0,l.jsx)("a",{...ie,children:o}),"simple-button"!==X&&(0,l.jsxs)("a",{...ie,children:[o,(0,l.jsxs)("span",{className:`cbb-button__icon cbb-button__icon--${K}`,style:{"--cbb-icon-size":`${V}px`,"--cbb-icon-color":Y,"--cbb-icon-dark-color":Z,...le.enabled&&{"--cbb-hover-icon-light-color":le.value},...ae.enabled&&{"--cbb-hover-icon-dark-color":ae.value}},children:[(0,l.jsx)("span",{className:"cbb-button__icon-container"}),(0,l.jsx)("span",{className:"cbb-button__icon-content"})]})]})]})},save:function({attributes:e}){const{buttonText:t,buttonLink:o,buttonLightColor:a,buttonDarkColor:n,buttonHoverLightColor:s,buttonHoverDarkColor:i,buttonTextLightColor:b,buttonTextDarkColor:c,buttonFontFamily:u,buttonFontWeight:d,buttonFontStyle:g,buttonFontSize:h,buttonLetterSpacing:p,buttonBorder:x,buttonMargin:v,buttonPadding:m,buttonType:_,buttonIcon:C,buttonIconSize:f,buttonIconColor:$,buttonIconDarkColor:j,buttonIconFlexDirection:k,buttonHoverTextLightColor:S,buttonHoverTextDarkColor:w,iconHoverLightColor:B,iconHoverDarkColor:A,borderHoverLightColor:H,borderHoverDarkColor:P}=e,N=["cbb-button","button-with-icon"===_?"cbb-button-with-icon":"",S.enabled?"cbb-button--hover-text-light-color":"",w.enabled?"cbb-button--hover-text-dark-color":"",B.enabled?"cbb-button--icon-text-light-color":"",A.enabled?"cbb-button--icon-text-dark-color":"",H.enabled?"cbb-button--hover-border-light-color":"",P.enabled?"cbb-button--hover-border-dark-color":""].filter((e=>e)).join(" "),y=r.useBlockProps.save({className:N,style:{"--cbb-button-light-color":a,"--cbb-button-dark-color":n,"--cbb-button-hover-light-color":s,"--cbb-button-hover-dark-color":i,"--cbb-button-text-light-color":b,...S.enabled&&{"--cbb-button-hover-text-light-color":S.value},"--cbb-button-text-dark-color":c,...w.enabled&&{"--cbb-button-hover-text-dark-color":w.value},..."button-with-icon"===_&&{"--cbb-button-flex-direction":k},...""!==u&&{fontFamily:`var(--wp--preset--font-family--${u})`},fontWeight:d,fontStyle:g,fontSize:h,..."0px"!==x.width&&"none"!==x.style&&("#00000000"!==x.lightColor||"#00000000"!==x.darkColor)&&{borderStyle:x.style},..."0px"!==x.width&&"none"!==x.style&&("#00000000"!==x.lightColor||"#00000000"!==x.darkColor)&&{borderWidth:x.width},..."0px"!==x.width&&"none"!==x.style&&"#00000000"!==x.lightColor&&{"--cbb-button-light-border-color":x.lightColor},..."0px"!==x.width&&"none"!==x.style&&"#00000000"!==x.darkColor&&{"--cbb-button-dark-border-color":x.darkColor},...H.enabled&&{"--cbb-button-border-hover-light-color":H.value},...P.enabled&&{"--cbb-button-border-hover-dark-color":P.value},..."0px"!==x.radius&&"0%"!==x.radius&&{borderRadius:x.radius},..."normal"!==p&&{letterSpacing:p},margin:v.differentMarginsEnabled?`${v.top} ${v.right} ${v.bottom} ${v.left}`:`${v.top}`,padding:m.differentPaddingsEnabled?`${m.top} ${m.right} ${m.bottom} ${m.left}`:`${m.top}`}});return(0,l.jsxs)(l.Fragment,{children:["simple-button"===_&&(0,l.jsx)("a",{...y,href:o,children:t}),"simple-button"!==_&&(0,l.jsxs)("a",{...y,href:o,children:[t,(0,l.jsxs)("span",{className:`cbb-button__icon cbb-button__icon--${C}`,style:{"--cbb-icon-size":`${f}px`,"--cbb-icon-color":$,"--cbb-icon-dark-color":j,...B.enabled&&{"--cbb-hover-icon-light-color":B.value},...A.enabled&&{"--cbb-hover-icon-dark-color":A.value}},children:[(0,l.jsx)("span",{className:"cbb-button__icon-container"}),(0,l.jsx)("span",{className:"cbb-button__icon-content"})]})]})]})}})}},o={};function l(e){var a=o[e];if(void 0!==a)return a.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,l),r.exports}l.m=t,e=[],l.O=(t,o,a,r)=>{if(!o){var n=1/0;for(c=0;c<e.length;c++){for(var[o,a,r]=e[c],s=!0,i=0;i<o.length;i++)(!1&r||n>=r)&&Object.keys(l.O).every((e=>l.O[e](o[i])))?o.splice(i--,1):(s=!1,r<n&&(n=r));if(s){e.splice(c--,1);var b=a();void 0!==b&&(t=b)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[o,a,r]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={985:0,941:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var a,r,[n,s,i]=o,b=0;if(n.some((t=>0!==e[t]))){for(a in s)l.o(s,a)&&(l.m[a]=s[a]);if(i)var c=i(l)}for(t&&t(o);b<n.length;b++)r=n[b],l.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return l.O(c)},o=globalThis.webpackChunkcaledros_basic_blocks=globalThis.webpackChunkcaledros_basic_blocks||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var a=l.O(void 0,[941],(()=>l(708)));a=l.O(a)})();
     1(()=>{"use strict";var e,t={708:()=>{const e=window.wp.blocks,t=window.wp.i18n,o=JSON.parse('{"UU":"caledros-basic-blocks/button"}'),l=window.ReactJSXRuntime,a={icon:(0,l.jsx)("svg",{width:"24",height:"24",version:"1.1",viewBox:"0 0 6.35 6.35",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("g",{transform:"translate(-96.573 -101.07)",children:(0,l.jsxs)("g",{transform:"matrix(.087396 0 0 .087396 90.571 91.268)",children:[(0,l.jsx)("path",{d:"m141.33 148.5a36.329 36.329 0 0 1-36.329 36.329 36.329 36.329 0 0 1-36.329-36.329 36.329 36.329 0 0 1 36.329-36.329 36.329 36.329 0 0 1 36.329 36.329z",fill:"#e0ebe0","stroke-width":"0"}),(0,l.jsx)("path",{d:"m138.18 148.5a33.177 33.177 0 0 1-33.177 33.177 33.177 33.177 0 0 1-33.177-33.177 33.177 33.177 0 0 1 33.177-33.177 33.177 33.177 0 0 1 33.177 33.177z",fill:"#252533","stroke-width":"0"}),(0,l.jsx)("path",{d:"m135.4 148.5a30.397 30.397 0 0 1-30.397 30.397 30.397 30.397 0 0 1-30.397-30.397 30.397 30.397 0 0 1 30.397-30.397 30.397 30.397 0 0 1 30.397 30.397z",fill:"#e0ebe0","stroke-width":"0"}),(0,l.jsxs)("g",{transform:"matrix(.90041 0 0 .90041 31.823 90.353)",fill:"#252533","stroke-width":"1.1106",children:[(0,l.jsx)("path",{d:"m93.777 55.9v9.3361c7.8313 1.1492 16.709-9.4028 15.094-9.3963z"}),(0,l.jsx)("path",{d:"m97.104 59.499c2.0783-0.03527 3.9177 0.15195 8.6289-2.233-5.125 1.0559-5.7944 0.56153-8.6392 0.57438-0.78106 0.0035-0.68526 1.6378 0.01037 1.6586z","stroke-width":"0"}),(0,l.jsx)("path",{d:"m53.478 56.801h38.884v9.3252s-3.9882 1.7008-3.4603 4.8679c0.52784 3.1671 3.1084 6.862 10.088 6.9206v7.1928h-7.2969s-4.3545-4.1057-10.865-3.8568-10.078 3.691-10.078 3.691h-7.4648v-7.3819s10.451 0.62207 9.9531-7.1331c-0.49766-7.7551-19.699-9.2481-19.699-9.2481z"})]}),(0,l.jsx)("path",{d:"m106.41 126.27a0.78523 0.78523 0 0 0-0.94136 0.59044l-2.4602 10.727a0.78523 0.78523 0 0 0 0.58951 0.94136 0.78523 0.78523 0 0 0 0.94044-0.59044l2.4611-10.727a0.78523 0.78523 0 0 0-0.58951-0.94136z",color:"#000000",fill:"#fc571b","stroke-width":"0"}),(0,l.jsx)("path",{d:"m100.45 127.77-5.9517 3.9678a0.78531 0.78531 0 0 0 0 1.3062l5.9517 3.9678a0.78523 0.78523 0 0 0 1.089-0.21724 0.78523 0.78523 0 0 0-0.21816-1.089l-4.9723-3.3152 4.9723-3.3143a0.78523 0.78523 0 0 0 0.21816-1.089 0.78523 0.78523 0 0 0-1.089-0.21724z",color:"#000000",fill:"#fc571b","stroke-width":"0"}),(0,l.jsx)("path",{d:"m109.55 127.77a0.78523 0.78523 0 0 0-1.089 0.21724 0.78523 0.78523 0 0 0 0.21816 1.089l4.9714 3.3143-4.9714 3.3152a0.78523 0.78523 0 0 0-0.21816 1.089 0.78523 0.78523 0 0 0 1.089 0.21724l5.9517-3.9678a0.78531 0.78531 0 0 0 0-1.3062z",color:"#000000",fill:"#fc571b","stroke-width":"0"})]})})})},r=window.wp.blockEditor,n=window.wp.components,s=window.wp.element,i=window.wp.data;function b({attributes:e,setAttributes:o}){const{buttonLightColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Background color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent background",checked:b,onChange:()=>{c((e=>!e)),o({buttonLightColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonLightColor:e}),enableAlpha:!0,clearable:!1})]})}function c({attributes:e,setAttributes:o}){const{buttonDarkColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Background color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent background",checked:b,onChange:()=>{c((e=>!e)),o({buttonDarkColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonDarkColor:e}),enableAlpha:!0,clearable:!1})]})}function u({attributes:e,setAttributes:o}){const{buttonHoverLightColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover bg color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent background",checked:b,onChange:()=>{c((e=>!e)),o({buttonHoverLightColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonHoverLightColor:e}),enableAlpha:!0,clearable:!1})]})}function d({attributes:e,setAttributes:o}){const{buttonHoverDarkColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover bg color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent background",checked:b,onChange:()=>{c((e=>!e)),o({buttonHoverDarkColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonHoverDarkColor:e}),enableAlpha:!0,clearable:!1})]})}function g({attributes:e,setAttributes:o}){const{buttonTextLightColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Text color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent color",checked:b,onChange:()=>{c((e=>!e)),o({buttonTextLightColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonTextLightColor:e}),enableAlpha:!0,clearable:!1})]})}function h({attributes:e,setAttributes:o}){const{buttonTextDarkColor:a}=e,[b,c]=(0,s.useState)("#00000000"===a),[u,d]=(0,r.useSettings)("color.palette","color.defaultPalette"),g=u.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),h=(0,i.select)("core/editor")?.getEditorSettings(),p=h?.__experimentalFeatures?.color?.palette,x=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),v=x(p,"default"),m=x(p,"theme"),_=x(p,"custom"),C=[...d?[v]:[],m,..._.colors?[_]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Text color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use transparent color",checked:b,onChange:()=>{c((e=>!e)),o({buttonTextDarkColor:"#00000000"})}}),!b&&(0,l.jsx)(n.ColorPalette,{colors:p?C:g,value:a,onChange:e=>o({buttonTextDarkColor:e}),enableAlpha:!0,clearable:!1})]})}function p({attributes:e,setAttributes:o,registeredFonts:a,getAvailableFontStyles:r,getAvailableFontWeights:s,doesFontExist:i}){const{buttonFontFamily:b,buttonFontWeight:c,buttonFontStyle:u}=e,d=a?.theme?.map((e=>({label:e.name,value:e.slug})))||[],g=a?.custom?.map((e=>({label:e?.name,value:e?.slug})))||[],h=[{label:"Default",value:""},...0!==d.length?d:[],...g&&0!==g?.length?g:[]];return(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Select the font family.","caledros-basic-blocks"),value:b,options:h,onChange:e=>{const t=i(e)?r(e):[],l=t.includes(u)?u:t[0],a=i(e)?s(e,l):[],n=a.includes(c)?c:a[0];o({buttonFontFamily:e,...i(e)&&l!==u&&{buttonFontStyle:l},...i(e)&&n!==c&&{buttonFontWeight:n}})}})}function x({attributes:e,setAttributes:o,getAvailableFontWeights:a}){const{buttonFontFamily:r,buttonFontWeight:s,buttonFontStyle:i}=e,b=a(r,i)?.map((e=>({label:`${e}`,value:e})));return(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Select the font weight.","caledros-basic-blocks"),value:s,options:b||[{label:"100",value:100},{label:"200",value:200},{label:"300",value:300},{label:"400",value:400},{label:"500",value:500},{label:"600",value:600},{label:"700",value:700},{label:"800",value:800},{label:"900",value:900}],onChange:e=>{o({buttonFontWeight:parseInt(e)})}})}function v({attributes:e,setAttributes:o,getAvailableFontStyles:a,getAvailableFontWeights:r,doesFontExist:s}){const{buttonFontFamily:i,buttonFontStyle:b,buttonFontWeight:c}=e,u=a(i)?.map((e=>({label:`${e[0].toUpperCase()}${e.slice(1)}`,value:`${e}`})));return(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Select the font style.","caledros-basic-blocks"),value:b,options:0===u.length?[{label:"Normal",value:"normal"},{label:"Italic",value:"italic"}]:u,onChange:e=>{const t=s(i)?r(i,e):[],l=t.includes(c)?c:t[0];o({buttonFontStyle:e,...s(i)&&c!==l&&{buttonFontWeight:l}})}})}function m({attributes:e,setAttributes:o}){const[a]=(0,r.useSettings)("typography.fontFamilies"),{theme:s=[],custom:i=[]}=a||{},b=[...s,...i],c=e=>b.some((t=>t?.slug===e)),u=e=>{const t=b.find((t=>t?.slug===e)),o=t?.fontFace?.map((e=>e?.fontStyle))||[];return[...new Set(o)]},d=(e,t)=>{const o=b.find((t=>t?.slug===e)),l=o?.fontFace?.filter((e=>e?.fontStyle===t)),a=l?.map((e=>{if(e?.fontWeight?.includes(" ")){const[t,o]=e?.fontWeight.split(" ").map((e=>parseInt(e))),l=[];for(let e=t;e<=o;e+=100)l.push(e);return l}return parseInt(e?.fontWeight)})).flat().sort(((e,t)=>e-t));return a};return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Typography","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(p,{attributes:e,setAttributes:o,registeredFonts:a,getAvailableFontStyles:u,getAvailableFontWeights:d,doesFontExist:c}),(0,l.jsx)(v,{attributes:e,setAttributes:o,getAvailableFontStyles:u,getAvailableFontWeights:d,doesFontExist:c}),(0,l.jsx)(x,{attributes:e,setAttributes:o,getAvailableFontWeights:d})]})}function _({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,b=a.darkColor.split(" "),c=b[0]||"#000",u=b[1]||"#000",d=b[2]||"#000",g=b[3]||"#000",[h,p]=(0,s.useState)(!!a.darkColor.includes(" ")),[x,v]=(0,r.useSettings)("color.palette","color.defaultPalette"),m=x.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),_=(0,i.select)("core/editor")?.getEditorSettings(),C=_?.__experimentalFeatures?.color?.palette,f=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),$=f(C,"default"),j=f(C,"theme"),k=f(C,"custom"),S=[...v?[$]:[],j,...k.colors?[k]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border colors for each side",checked:h,onChange:()=>{const e=!h;p(e),o(e?{buttonBorder:{...a,darkColor:"#000 #000 #000 #000"}}:{buttonBorder:{...a,darkColor:"#000"}})}}),!h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose the border color","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:a.darkColor,onChange:e=>o({buttonBorder:{...a,darkColor:e||"#00000000"}}),enableAlpha:!0,clearable:!0})]}),h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the top border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:c,onChange:e=>{o({buttonBorder:{...a,darkColor:`${e||"#00000000"} ${u} ${d} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the right border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:u,onChange:e=>{o({buttonBorder:{...a,darkColor:`${c} ${e||"#00000000"} ${d} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the bottom border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:d,onChange:e=>{o({buttonBorder:{...a,darkColor:`${c} ${u} ${e||"#00000000"} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the left border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:g,onChange:e=>{o({buttonBorder:{...a,darkColor:`${c} ${u} ${d} ${e||"#00000000"}`}})},enableAlpha:!0,clearable:!0})]})]})}function C({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,b=a.lightColor.split(" "),c=b[0]||"#000",u=b[1]||"#000",d=b[2]||"#000",g=b[3]||"#000",[h,p]=(0,s.useState)(!!a.lightColor.includes(" ")),[x,v]=(0,r.useSettings)("color.palette","color.defaultPalette"),m=x.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),_=(0,i.select)("core/editor")?.getEditorSettings(),C=_?.__experimentalFeatures?.color?.palette,f=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),$=f(C,"default"),j=f(C,"theme"),k=f(C,"custom"),S=[...v?[$]:[],j,...k.colors?[k]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border colors for each side",checked:h,onChange:()=>{const e=!h;p(e),o(e?{buttonBorder:{...a,lightColor:"#000 #000 #000 #000"}}:{buttonBorder:{...a,lightColor:"#000"}})}}),!h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose the border color","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:a.lightColor,onChange:e=>o({buttonBorder:{...a,lightColor:e||"#00000000"}}),enableAlpha:!0,clearable:!0})]}),h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the top border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:c,onChange:e=>{o({buttonBorder:{...a,lightColor:`${e||"#00000000"} ${u} ${d} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the right border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:u,onChange:e=>{o({buttonBorder:{...a,lightColor:`${c} ${e||"#00000000"} ${d} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the bottom border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:d,onChange:e=>{o({buttonBorder:{...a,lightColor:`${c} ${u} ${e||"#00000000"} ${g}`}})},enableAlpha:!0,clearable:!0}),(0,l.jsx)("label",{className:"cbb-editor-label",children:(0,t.__)("Choose a color for the left border","caledros-basic-blocks")}),(0,l.jsx)(n.ColorPalette,{colors:C?S:m,value:g,onChange:e=>{o({buttonBorder:{...a,lightColor:`${c} ${u} ${d} ${e||"#00000000"}`}})},enableAlpha:!0,clearable:!0})]})]})}function f({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,r=a.radius.split(" "),i=parseInt(r[0])||0,b=parseInt(r[1])||0,c=parseInt(r[2])||0,u=parseInt(r[3])||0,d=a.radius.split(" "),g=d[0]?d[0].replace(/\d+/g,""):"px",h=d[1]?d[1].replace(/\d+/g,""):"px",p=d[2]?d[2].replace(/\d+/g,""):"px",x=d[3]?d[3].replace(/\d+/g,""):"px",[v,m]=(0,s.useState)(!!a.radius.includes(" ")),_=(e,t)=>"%"===e&&t>100?100:t;return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border radius","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border radiuses for each corner",checked:v,onChange:()=>{const e=!v;m(e),o(e?{buttonBorder:{...a,radius:"10px 10px 10px 10px"}}:{buttonBorder:{...a,radius:"10px"}})}}),!v&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the border radius (${g}) for the button.`,"caledros-basic-blocks"),value:parseInt(a.radius),max:"%"===g?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${e}${g}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:g,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${_(e,parseInt(a.radius))}${e}`}})}})]}),v&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the top-left border radius (${g}).`,"caledros-basic-blocks"),value:i,max:"%"===g?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${e}${g} ${b}${h} ${c}${p} ${u}${x}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:g,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${_(e,i)}${e} ${b}${h} ${c}${p} ${u}${x}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the top-right border radius (${h}).`,"caledros-basic-blocks"),value:b,max:"%"===h?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${e}${h} ${c}${p} ${u}${x}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:h,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${_(e,b)}${e} ${c}${p} ${u}${x}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the bottom-right border radius (${p}).`,"caledros-basic-blocks"),value:c,max:"%"===p?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${b}${h} ${e}${p} ${u}${x}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:p,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${b}${h} ${_(e,c)}${e} ${u}${x}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)(`Please select the bottom-left border radius (${x}).`,"caledros-basic-blocks"),value:u,max:"%"===x?100:150,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${b}${h} ${c}${p} ${e}${x}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:x,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>{o({buttonBorder:{...a,radius:`${i}${g} ${b}${h} ${c}${p} ${_(e,u)}${e}`}})}})]})]})]})}function $({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,r=a.style.split(" "),i=r[0]||"solid",b=r[1]||"none",c=r[2]||"none",u=r[3]||"none",[d,g]=(0,s.useState)(!!a.style.includes(" "));return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border style","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border styles for each side",checked:d,onChange:()=>{const e=!d;g(e),o(e?{buttonBorder:{...a,style:"solid none none none"}}:{buttonBorder:{...a,style:"solid"}})}}),!d&&(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the border style.","caledros-basic-blocks"),value:a.style,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:e}})}}),d&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the style for the top border.","caledros-basic-blocks"),value:i,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:`${e} ${b} ${c} ${u}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the style for the right border.","caledros-basic-blocks"),value:b,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:`${i} ${e} ${c} ${u}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the style for the bottom border.","caledros-basic-blocks"),value:c,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:`${i} ${b} ${e} ${u}`}})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the style for the left border.","caledros-basic-blocks"),value:u,options:[{disabled:!0,label:"Select an option",value:""},{label:"None",value:"none"},{label:"Dotted",value:"dotted"},{label:"Dashed",value:"dashed"},{label:"Solid",value:"solid"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"}],onChange:e=>{o({buttonBorder:{...a,style:`${i} ${b} ${c} ${e}`}})}})]})]})}function j({attributes:e,setAttributes:o}){const{buttonBorder:a}=e,r=a.width.split(" "),i=parseInt(r[0])||0,b=parseInt(r[1])||0,c=parseInt(r[2])||0,u=parseInt(r[3])||0,[d,g]=(0,s.useState)(!!a.width.includes(" "));return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Border width","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use different border widths for each side",checked:d,onChange:()=>{const e=!d;g(e),o(e?{buttonBorder:{...a,width:"1px 1px 1px 1px"}}:{buttonBorder:{...a,width:"1px"}})}}),!d&&(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the border width (px) for the button.","caledros-basic-blocks"),value:parseInt(a.width),max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${e}px`}})}}),d&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the top border width (px) for the button.","caledros-basic-blocks"),value:i,max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${e}px ${b}px ${c}px ${u}px`}})}}),(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the right border width (px) for the button.","caledros-basic-blocks"),value:b,max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${i}px ${e}px ${c}px ${u}px`}})}}),(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the bottom border width (px) for the button.","caledros-basic-blocks"),value:c,max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${i}px ${b}px ${e}px ${u}px`}})}}),(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Please select the left border width (px) for the button.","caledros-basic-blocks"),value:u,max:50,min:0,step:1,onChange:e=>{o({buttonBorder:{...a,width:`${i}px ${b}px ${c}px ${e}px`}})}})]})]})}function k({attributes:e,setAttributes:o}){const{buttonText:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button text","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Type the text for the button.","caledros-basic-blocks"),value:a,onChange:e=>{o({buttonText:e})}})})}function S({attributes:e,setAttributes:o}){const{buttonLink:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button link","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Paste the link for the button.","caledros-basic-blocks"),value:a,onChange:e=>{o({buttonLink:e})}})})}function w({attributes:e,setAttributes:o}){const{buttonMargin:a}=e,r=parseInt(a.top)||0,s=parseInt(a.left)||0,i=parseInt(a.bottom)||0,b=parseInt(a.right)||0,c=a.top.replace(/\d+/g,""),u=a.left.replace(/\d+/g,""),d=a.bottom.replace(/\d+/g,""),g=a.right.replace(/\d+/g,""),h=(e,t)=>"auto"===e?"":["%","vw"].includes(e)&&t>100?100:t;return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Margin","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Enable different margins","caledros-basic-blocks"),checked:a.differentMarginsEnabled,onChange:e=>{o({buttonMargin:{...a,differentMarginsEnabled:e}})}}),!a.differentMarginsEnabled&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the margin (${c}) for the button.`,"caledros-basic-blocks"),value:r,max:["%","vw"].includes(c)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,top:`${"auto"===c?"":e}${c}`}})},disabled:"auto"===c}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,top:`${h(e,r)}${e}`}})}})]}),a.differentMarginsEnabled&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the top margin (${c}) for the button.`,"caledros-basic-blocks"),value:r,max:["%","vw"].includes(c)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,top:`${"auto"===c?"":e}${c}`}})},disabled:"auto"===c}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,top:`${h(e,r)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the right margin (${g}) for the button.`,"caledros-basic-blocks"),value:b,max:["%","vw"].includes(g)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,right:`${"auto"===g?"":e}${g}`}})},disabled:"auto"===g}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:g,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,right:`${h(e,b)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the bottom margin (${d}) for the button.`,"caledros-basic-blocks"),value:i,max:["%","vw"].includes(d)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,bottom:`${"auto"===d?"":e}${d}`}})},disabled:"auto"===d}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:d,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,bottom:`${h(e,i)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the left margin (${u}) for the button.`,"caledros-basic-blocks"),value:s,max:["%","vw"].includes(u)?100:500,min:0,step:1,onChange:e=>{o({buttonMargin:{...a,left:`${"auto"===u?"":e}${u}`}})},disabled:"auto"===u}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:u,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"auto",value:"auto"}],onChange:e=>{o({buttonMargin:{...a,left:`${h(e,s)}${e}`}})}})]})]})]})}function B({attributes:e,setAttributes:o}){const{buttonPadding:a}=e,r=parseInt(a.top)||0,s=parseInt(a.left)||0,i=parseInt(a.bottom)||0,b=parseInt(a.right)||0,c=a.top.replace(/\d+/g,""),u=a.left.replace(/\d+/g,""),d=a.bottom.replace(/\d+/g,""),g=a.right.replace(/\d+/g,""),h=(e,t)=>["%","vw"].includes(e)&&t>100?100:t;return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Padding","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Use global padding","caledros-basic-blocks"),help:(0,t.__)("This option applies predefined padding to the right and left sides of the block, ensuring consistency across the entire site. To adjust this padding, navigate to the Layout section in the Full Site Editor.","caledros-basic-blocks"),checked:a.useGlobalPadding,onChange:e=>{o({buttonPadding:{...a,useGlobalPadding:e}})}}),!a.useGlobalPadding&&(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Enable different paddings","caledros-basic-blocks"),checked:a.differentPaddingsEnabled,onChange:e=>{o({buttonPadding:{...a,differentPaddingsEnabled:e}})}}),!a.differentPaddingsEnabled&&!a.useGlobalPadding&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the padding (${c}) for the button`,"caledros-basic-blocks"),value:r,max:["%","vw"].includes(c)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,top:`${e}${c}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,top:`${h(e,r)}${e}`}})}})]}),a.differentPaddingsEnabled&&!a.useGlobalPadding&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the top padding (${c}) for the button`,"caledros-basic-blocks"),value:r,max:["%","vw"].includes(c)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,top:`${e}${c}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,top:`${h(e,r)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the right padding (${g}) for the button`,"caledros-basic-blocks"),value:b,max:["%","vw"].includes(g)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,right:`${e}${g}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:g,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,right:`${h(e,b)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the bottom padding (${d}) for the button`,"caledros-basic-blocks"),value:i,max:["%","vw"].includes(d)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,bottom:`${e}${d}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:d,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,bottom:`${h(e,i)}${e}`}})}})]}),(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the left padding (${u}) for the button`,"caledros-basic-blocks"),value:s,max:["%","vw"].includes(u)?100:500,min:0,step:1,onChange:e=>{o({buttonPadding:{...a,left:`${e}${u}`}})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:u,options:[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"}],onChange:e=>{o({buttonPadding:{...a,left:`${h(e,s)}${e}`}})}})]})]})]})}function A({attributes:e,setAttributes:o}){const{buttonLetterSpacing:a}=e,[r,i]=(0,s.useState)("normal"===a),b=a.replace(/[\d.]+/g,"")||"px",c=["px","em","rem"].includes(b)?b:"px",u=e=>"px"===e?parseInt(a)||0:parseFloat(a)||0,d=(e,t)=>"px"!==e&&t>10?10:t;return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Letter spacing","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Use normal letter spacing","caledros-basic-blocks"),checked:r,onChange:()=>{const e=r?"0":"normal";i((e=>!e)),o({buttonLetterSpacing:`${e}${"normal"===e?"":c}`})}}),!r&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the custom letter spacing (${c}).`,"caledros-basic-blocks"),value:parseFloat(a)||0,max:"px"===c?50:10,min:0,step:"px"===c?1:.01,onChange:e=>{o({buttonLetterSpacing:`${d(c,e)}${c}`})}}),(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,value:c,options:[{label:"px",value:"px"},{label:"em",value:"em"},{label:"rem",value:"rem"}],onChange:e=>{o({buttonLetterSpacing:`${d(e,u(e))}${e}`})}})]})]})}function H({attributes:e,setAttributes:o}){const{buttonFontSize:a}=e,[b,c]=(0,r.useSettings)("typography.fontSizes","typography.defaultFontSizes"),u=b?.map((e=>({label:`${e.name} (${e.size})`,value:`var(--wp--preset--font-size--${e.slug})`}))),d=(0,i.select)("core/editor")?.getEditorSettings()?.__experimentalFeatures?.typography?.fontSizes,g=(e,t)=>e?.[t]?.map((e=>({label:`${e.name} (${e.size})`,value:`var(--wp--preset--font-size--${e.slug})`}))),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...c?[h]:[],p,...x&&0!==x?.length?[x]:[]].flat(),m=()=>d?[...h?.map((e=>e.value))||[],...p?.map((e=>e.value))||[],...x?.map((e=>e.value))||[]]:b?.map((e=>e.value)),_=a.replace(/[\d.]+/g,"")||"px",C=["px","em","rem","vw","vh"].includes(_)?_:"px",f=e=>"px"===e?parseInt(a)||0:parseFloat(a)||0,$=(e,t)=>["vw","vh"].includes(e)&&t>100?100:t,[j,k]=(0,s.useState)(!m().includes(a));return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Font size","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Use custom font size",checked:j,onChange:()=>k((e=>!e))}),!j&&(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Select the font size.","caledros-basic-blocks"),value:m().includes(a)?a:"",options:[{disabled:!0,label:"Select an option",value:""},...d?v:u],onChange:e=>{o({buttonFontSize:e})}}),j&&(0,l.jsxs)("div",{className:"cbb-editor__grid",children:[(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)(`Please select the custom font size (${C}).`,"caledros-basic-blocks"),value:m().includes(a)?0:parseFloat(a),max:"vw"===C||"vh"===C?100:200,min:0,step:"px"===C?1:.01,onChange:e=>{o({buttonFontSize:`${$(C,e)}${C}`})}}),(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:C,options:[{label:"px",value:"px"},{label:"em",value:"em"},{label:"rem",value:"rem"},{label:"vw",value:"vw"},{label:"vh",value:"vh"}],onChange:e=>{o({buttonFontSize:`${$(e,f(e))}${e}`})}})]})]})}function P({attributes:e,setAttributes:o}){const{buttonIcon:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button Icon","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Choose the icon","caledros-basic-blocks"),value:a,options:[{label:"Alarm Fill",value:"alarm-fill"},{label:"Arrow Left Circle Fill",value:"arrow-left-circle-fill"},{label:"Arrow Left Circle",value:"arrow-left-circle"},{label:"Arrow Right Circle Fill",value:"arrow-right-circle-fill"},{label:"Arrow Right Circle",value:"arrow-right-circle"},{label:"Arrow Up Left Square",value:"arrow-up-left-square"},{label:"Arrow Up Right Circle Fill",value:"arrow-up-right-circle-fill"},{label:"Arrow Up Right Circle",value:"arrow-up-right-circle"},{label:"Arrow Up Right Square Fill",value:"arrow-up-right-square-fill"},{label:"Arrow Up Right Square",value:"arrow-up-right-square"},{label:"Award",value:"award"},{label:"Battery Charging",value:"battery-charging"},{label:"Box",value:"box-seam"},{label:"Boxes",value:"boxes"},{label:"Bricks",value:"bricks"},{label:"Brightness High",value:"brightness-high"},{label:"Bug",value:"bug"},{label:"Building",value:"building"},{label:"Buildings",value:"buildings"},{label:"Chat Text",value:"chat-text"},{label:"Cloud Check",value:"cloud-check"},{label:"Cloud Sun",value:"cloud-sun"},{label:"Code",value:"code-square"},{label:"Coin",value:"coin"},{label:"Columns",value:"columns"},{label:"Columns Gap",value:"columns-gap"},{label:"Database Down",value:"database-down"},{label:"Database Up",value:"database-up"},{label:"File Bar Graph",value:"file-bar-graph"},{label:"Fire",value:"fire"},{label:"Gear",value:"gear"},{label:"Globe",value:"globe2"},{label:"Graph Down Arrow",value:"graph-down-arrow"},{label:"Graph Up Arrow",value:"graph-up-arrow"},{label:"Hourglass",value:"hourglass"},{label:"Hourglass Bottom",value:"hourglass-bottom"},{label:"Hourglass Split",value:"hourglass-split"},{label:"Hourglass Top",value:"hourglass-top"},{label:"Lightbulb",value:"lightbulb"},{label:"Magic",value:"magic"},{label:"Moon Stars",value:"moon-stars"},{label:"People Fill",value:"people-fill"},{label:"Person Circle",value:"person-circle"},{label:"Quote",value:"quote"},{label:"Robot",value:"robot"},{label:"Rocket Takeoff",value:"rocket-takeoff"},{label:"Star",value:"star"},{label:"Stars",value:"stars"},{label:"Stickies",value:"stickies"},{label:"Tools",value:"tools"},{label:"UI Checks Grid",value:"ui-checks-grid"},{label:"UI Checks",value:"ui-checks"},{label:"Umbrella Fill",value:"umbrella-fill"},{label:"Watch",value:"watch"},{label:"Wind",value:"wind"},{label:"Wrench",value:"wrench"},{label:"Wrench Adjustable",value:"wrench-adjustable"},{label:"Wrench Adjustable Circle",value:"wrench-adjustable-circle"}],onChange:e=>o({buttonIcon:e})})})}function N({attributes:e,setAttributes:o}){const{buttonIconColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Icon color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a,onChange:e=>o({buttonIconColor:e}),enableAlpha:!0,clearable:!1})})}function y({attributes:e,setAttributes:o}){const{buttonIconDarkColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Icon color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a,onChange:e=>o({buttonIconDarkColor:e}),enableAlpha:!0,clearable:!1})})}function D({attributes:e,setAttributes:o}){const{buttonIconSize:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button Icon size","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,t.__)("Adjust the size (px) of the icon","caledros-basic-blocks"),initialPosition:a,value:a,max:300,min:0,step:1,onChange:e=>o({buttonIconSize:e})})})}function F({attributes:e,setAttributes:o}){const{buttonIconFlexDirection:a}=e;return(0,l.jsx)(n.PanelBody,{title:(0,t.__)("Button flex direction","caledros-basic-blocks"),initialOpen:!1,children:(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:(0,t.__)("Choose the flex direction for the button's items.","caledros-basic-blocks"),value:a,options:[{label:"Row (default)",value:"row"},{label:"Row reverse",value:"row-reverse"}],onChange:e=>{o({buttonIconFlexDirection:e})}})})}function M({attributes:e,setAttributes:o}){const{buttonHoverTextLightColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover text color (Light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({buttonHoverTextLightColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({buttonHoverTextLightColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function z({attributes:e,setAttributes:o}){const{buttonHoverTextDarkColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover text color (Dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({buttonHoverTextDarkColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({buttonHoverTextDarkColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function T({attributes:e,setAttributes:o}){const{iconHoverLightColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover icon color (light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({iconHoverLightColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({iconHoverLightColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function I({attributes:e,setAttributes:o}){const{iconHoverDarkColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover icon color (dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({iconHoverDarkColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({iconHoverDarkColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function L({attributes:e,setAttributes:o}){const{borderHoverLightColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover border color (Light mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({borderHoverLightColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({borderHoverLightColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}function O({attributes:e,setAttributes:o}){const{borderHoverDarkColor:a}=e,[s,b]=(0,r.useSettings)("color.palette","color.defaultPalette"),c=s.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),u=(0,i.select)("core/editor")?.getEditorSettings(),d=u?.__experimentalFeatures?.color?.palette,g=(e,t)=>({colors:e?.[t]?.map((e=>({color:`var(--wp--preset--color--${e.slug})`,name:e.name}))),name:`${t}`}),h=g(d,"default"),p=g(d,"theme"),x=g(d,"custom"),v=[...b?[h]:[],p,...x.colors?[x]:[]];return(0,l.jsxs)(n.PanelBody,{title:(0,t.__)("Hover border color (Dark mode)","caledros-basic-blocks"),initialOpen:!1,children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:"Set a custom hover color",checked:a.enabled,onChange:e=>{o({borderHoverDarkColor:{...a,enabled:e}})}}),a.enabled&&(0,l.jsx)(n.ColorPalette,{colors:d?v:c,value:a.value,onChange:e=>o({borderHoverDarkColor:{...a,value:e}}),enableAlpha:!0,clearable:!1})]})}(0,e.registerBlockType)(o.UU,{icon:a.icon,edit:function({attributes:e,setAttributes:t}){const{buttonText:o,buttonLightColor:a,buttonDarkColor:s,buttonHoverLightColor:i,buttonHoverDarkColor:p,buttonTextLightColor:x,buttonTextDarkColor:v,buttonFontFamily:R,buttonFontWeight:E,buttonFontStyle:U,buttonFontSize:W,buttonLetterSpacing:G,buttonBorder:q,buttonMargin:J,buttonPadding:Q,buttonType:X,buttonIcon:K,buttonIconSize:V,buttonIconColor:Y,buttonIconDarkColor:Z,buttonIconFlexDirection:ee,buttonHoverTextLightColor:te,buttonHoverTextDarkColor:oe,iconHoverLightColor:le,iconHoverDarkColor:ae,borderHoverLightColor:re,borderHoverDarkColor:ne}=e,se=["cbb-button","button-with-icon"===X?"cbb-button-with-icon":"",te.enabled?"cbb-button--hover-text-light-color":"",oe.enabled?"cbb-button--hover-text-dark-color":"",le.enabled?"cbb-button--icon-text-light-color":"",ae.enabled?"cbb-button--icon-text-dark-color":"",re.enabled?"cbb-button--hover-border-light-color":"",ne.enabled?"cbb-button--hover-border-dark-color":""].filter((e=>e)).join(" "),ie=(0,r.useBlockProps)({className:se,style:{"--cbb-button-light-color":a,"--cbb-button-dark-color":s,"--cbb-button-hover-light-color":i,"--cbb-button-hover-dark-color":p,"--cbb-button-text-light-color":x,...te.enabled&&{"--cbb-button-hover-text-light-color":te.value},"--cbb-button-text-dark-color":v,...oe.enabled&&{"--cbb-button-hover-text-dark-color":oe.value},..."button-with-icon"===X&&{"--cbb-button-flex-direction":ee},...""!==R&&{fontFamily:`var(--wp--preset--font-family--${R})`},fontWeight:E,fontStyle:U,fontSize:W,..."normal"!==G&&{letterSpacing:G},..."0px"!==q.width&&"none"!==q.style&&("#00000000"!==q.lightColor||"#00000000"!==q.darkColor)&&{borderStyle:q.style},..."0px"!==q.width&&"none"!==q.style&&("#00000000"!==q.lightColor||"#00000000"!==q.darkColor)&&{borderWidth:q.width},..."0px"!==q.width&&"none"!==q.style&&"#00000000"!==q.lightColor&&{"--cbb-button-light-border-color":q.lightColor},..."0px"!==q.width&&"none"!==q.style&&"#00000000"!==q.darkColor&&{"--cbb-button-dark-border-color":q.darkColor},...re.enabled&&{"--cbb-button-border-hover-light-color":re.value},...ne.enabled&&{"--cbb-button-border-hover-dark-color":ne.value},..."0px"!==q.radius&&"0%"!==q.radius&&{borderRadius:q.radius},margin:J.differentMarginsEnabled?`${J.top} ${J.right} ${J.bottom} ${J.left}`:`${J.top}`,padding:Q.differentPaddingsEnabled?`${Q.top} ${Q.right} ${Q.bottom} ${Q.left}`:`${Q.top}`}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.InspectorControls,{children:(0,l.jsx)(n.TabPanel,{activeClass:"cbb-active-tab",tabs:[{name:"content",title:"Content"},{name:"style",title:"Style"},{name:"additional",title:"Additional"}],children:o=>"content"===o.name?"simple-button"===X?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{attributes:e,setAttributes:t}),(0,l.jsx)(S,{attributes:e,setAttributes:t}),(0,l.jsx)(m,{attributes:e,setAttributes:t}),(0,l.jsx)(H,{attributes:e,setAttributes:t}),(0,l.jsx)(A,{attributes:e,setAttributes:t})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{attributes:e,setAttributes:t}),(0,l.jsx)(S,{attributes:e,setAttributes:t}),(0,l.jsx)(m,{attributes:e,setAttributes:t}),(0,l.jsx)(H,{attributes:e,setAttributes:t}),(0,l.jsx)(A,{attributes:e,setAttributes:t}),(0,l.jsx)(P,{attributes:e,setAttributes:t}),(0,l.jsx)(D,{attributes:e,setAttributes:t})]}):"style"===o.name?"simple-button"===X?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b,{attributes:e,setAttributes:t}),(0,l.jsx)(c,{attributes:e,setAttributes:t}),(0,l.jsx)(u,{attributes:e,setAttributes:t}),(0,l.jsx)(d,{attributes:e,setAttributes:t}),(0,l.jsx)(g,{attributes:e,setAttributes:t}),(0,l.jsx)(h,{attributes:e,setAttributes:t}),(0,l.jsx)(M,{attributes:e,setAttributes:t}),(0,l.jsx)(z,{attributes:e,setAttributes:t})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b,{attributes:e,setAttributes:t}),(0,l.jsx)(c,{attributes:e,setAttributes:t}),(0,l.jsx)(u,{attributes:e,setAttributes:t}),(0,l.jsx)(d,{attributes:e,setAttributes:t}),(0,l.jsx)(g,{attributes:e,setAttributes:t}),(0,l.jsx)(h,{attributes:e,setAttributes:t}),(0,l.jsx)(M,{attributes:e,setAttributes:t}),(0,l.jsx)(z,{attributes:e,setAttributes:t}),(0,l.jsx)(N,{attributes:e,setAttributes:t}),(0,l.jsx)(y,{attributes:e,setAttributes:t}),(0,l.jsx)(T,{attributes:e,setAttributes:t}),(0,l.jsx)(I,{attributes:e,setAttributes:t}),(0,l.jsx)(F,{attributes:e,setAttributes:t})]}):"additional"===o.name?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($,{attributes:e,setAttributes:t}),(0,l.jsx)(j,{attributes:e,setAttributes:t}),(0,l.jsx)(C,{attributes:e,setAttributes:t}),(0,l.jsx)(L,{attributes:e,setAttributes:t}),(0,l.jsx)(_,{attributes:e,setAttributes:t}),(0,l.jsx)(O,{attributes:e,setAttributes:t}),(0,l.jsx)(f,{attributes:e,setAttributes:t}),(0,l.jsx)(w,{attributes:e,setAttributes:t}),(0,l.jsx)(B,{attributes:e,setAttributes:t})]}):null})}),"simple-button"===X&&(0,l.jsx)("a",{...ie,children:o}),"simple-button"!==X&&(0,l.jsxs)("a",{...ie,children:[o,(0,l.jsxs)("span",{className:`cbb-button__icon cbb-button__icon--${K}`,style:{"--cbb-icon-size":`${V}px`,"--cbb-icon-color":Y,"--cbb-icon-dark-color":Z,...le.enabled&&{"--cbb-hover-icon-light-color":le.value},...ae.enabled&&{"--cbb-hover-icon-dark-color":ae.value}},children:[(0,l.jsx)("span",{className:"cbb-button__icon-container"}),(0,l.jsx)("span",{className:"cbb-button__icon-content"})]})]})]})},save:function({attributes:e}){const{buttonText:t,buttonLink:o,buttonLightColor:a,buttonDarkColor:n,buttonHoverLightColor:s,buttonHoverDarkColor:i,buttonTextLightColor:b,buttonTextDarkColor:c,buttonFontFamily:u,buttonFontWeight:d,buttonFontStyle:g,buttonFontSize:h,buttonLetterSpacing:p,buttonBorder:x,buttonMargin:v,buttonPadding:m,buttonType:_,buttonIcon:C,buttonIconSize:f,buttonIconColor:$,buttonIconDarkColor:j,buttonIconFlexDirection:k,buttonHoverTextLightColor:S,buttonHoverTextDarkColor:w,iconHoverLightColor:B,iconHoverDarkColor:A,borderHoverLightColor:H,borderHoverDarkColor:P}=e,N=["cbb-button","button-with-icon"===_?"cbb-button-with-icon":"",S.enabled?"cbb-button--hover-text-light-color":"",w.enabled?"cbb-button--hover-text-dark-color":"",B.enabled?"cbb-button--icon-text-light-color":"",A.enabled?"cbb-button--icon-text-dark-color":"",H.enabled?"cbb-button--hover-border-light-color":"",P.enabled?"cbb-button--hover-border-dark-color":""].filter((e=>e)).join(" "),y=r.useBlockProps.save({className:N,style:{"--cbb-button-light-color":a,"--cbb-button-dark-color":n,"--cbb-button-hover-light-color":s,"--cbb-button-hover-dark-color":i,"--cbb-button-text-light-color":b,...S.enabled&&{"--cbb-button-hover-text-light-color":S.value},"--cbb-button-text-dark-color":c,...w.enabled&&{"--cbb-button-hover-text-dark-color":w.value},..."button-with-icon"===_&&{"--cbb-button-flex-direction":k},...""!==u&&{fontFamily:`var(--wp--preset--font-family--${u})`},fontWeight:d,fontStyle:g,fontSize:h,..."0px"!==x.width&&"none"!==x.style&&("#00000000"!==x.lightColor||"#00000000"!==x.darkColor)&&{borderStyle:x.style},..."0px"!==x.width&&"none"!==x.style&&("#00000000"!==x.lightColor||"#00000000"!==x.darkColor)&&{borderWidth:x.width},..."0px"!==x.width&&"none"!==x.style&&"#00000000"!==x.lightColor&&{"--cbb-button-light-border-color":x.lightColor},..."0px"!==x.width&&"none"!==x.style&&"#00000000"!==x.darkColor&&{"--cbb-button-dark-border-color":x.darkColor},...H.enabled&&{"--cbb-button-border-hover-light-color":H.value},...P.enabled&&{"--cbb-button-border-hover-dark-color":P.value},..."0px"!==x.radius&&"0%"!==x.radius&&{borderRadius:x.radius},..."normal"!==p&&{letterSpacing:p},margin:v.differentMarginsEnabled?`${v.top} ${v.right} ${v.bottom} ${v.left}`:`${v.top}`,padding:m.differentPaddingsEnabled?`${m.top} ${m.right} ${m.bottom} ${m.left}`:`${m.top}`}});return(0,l.jsxs)(l.Fragment,{children:["simple-button"===_&&(0,l.jsx)("a",{...y,href:o,children:t}),"simple-button"!==_&&(0,l.jsxs)("a",{...y,href:o,children:[t,(0,l.jsxs)("span",{className:`cbb-button__icon cbb-button__icon--${C}`,style:{"--cbb-icon-size":`${f}px`,"--cbb-icon-color":$,"--cbb-icon-dark-color":j,...B.enabled&&{"--cbb-hover-icon-light-color":B.value},...A.enabled&&{"--cbb-hover-icon-dark-color":A.value}},children:[(0,l.jsx)("span",{className:"cbb-button__icon-container"}),(0,l.jsx)("span",{className:"cbb-button__icon-content"})]})]})]})}})}},o={};function l(e){var a=o[e];if(void 0!==a)return a.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,l),r.exports}l.m=t,e=[],l.O=(t,o,a,r)=>{if(!o){var n=1/0;for(c=0;c<e.length;c++){for(var[o,a,r]=e[c],s=!0,i=0;i<o.length;i++)(!1&r||n>=r)&&Object.keys(l.O).every((e=>l.O[e](o[i])))?o.splice(i--,1):(s=!1,r<n&&(n=r));if(s){e.splice(c--,1);var b=a();void 0!==b&&(t=b)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[o,a,r]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={985:0,941:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var a,r,[n,s,i]=o,b=0;if(n.some((t=>0!==e[t]))){for(a in s)l.o(s,a)&&(l.m[a]=s[a]);if(i)var c=i(l)}for(t&&t(o);b<n.length;b++)r=n[b],l.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return l.O(c)},o=globalThis.webpackChunkcaledros_basic_blocks=globalThis.webpackChunkcaledros_basic_blocks||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var a=l.O(void 0,[941],(()=>l(708)));a=l.O(a)})();
  • caledros-basic-blocks/trunk/caledros-basic.php

    r3335584 r3336084  
    44 * Plugin URI: https://caledrosforge.com/
    55 * Description: Add easy-to-use Gutenberg blocks to your WordPress site.
    6  * Version: 2.1.0
     6 * Version: 2.1.1
    77 * Requires at least: 6.7
    88 * Requires PHP: 8.0
  • caledros-basic-blocks/trunk/core/admin-page/admin-page.php

    r3335584 r3336084  
    4444        'sanitize_callback' => 'caledros_basic_blocks_sanitize_add_column_layout_to_wp_site_blocks',
    4545        'show_in_rest' => false,
    46         'default' => 1,
     46        'default' => 0,
    4747    );
    4848    register_setting(
     
    5757        'sanitize_callback' => 'caledros_basic_blocks_sanitize_set_custom_height_to_wp_site_blocks',
    5858        'show_in_rest' => false,
    59         'default' => 1,
     59        'default' => 0,
    6060    );
    6161    register_setting(
  • caledros-basic-blocks/trunk/languages/caledros-basic-blocks.pot

    r3335584 r3336084  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Caledros Basic Blocks 2.1.0\n"
     5"Project-Id-Version: Caledros Basic Blocks 2.1.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/caledros-basic-blocks\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-07-28T21:51:34+00:00\n"
     12"POT-Creation-Date: 2025-07-29T15:00:53+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
  • caledros-basic-blocks/trunk/package-lock.json

    r3335584 r3336084  
    11{
    22  "name": "caledros-basic-blocks",
    3   "version": "2.1.0",
     3  "version": "2.1.1",
    44  "lockfileVersion": 3,
    55  "requires": true,
     
    77    "": {
    88      "name": "caledros-basic-blocks",
    9       "version": "2.1.0",
     9      "version": "2.1.1",
    1010      "license": "GPL-2.0-or-later",
    1111      "dependencies": {
  • caledros-basic-blocks/trunk/package.json

    r3335584 r3336084  
    11{
    22  "name": "caledros-basic-blocks",
    3   "version": "2.1.0",
     3  "version": "2.1.1",
    44  "main": "index.js",
    55  "scripts": {
  • caledros-basic-blocks/trunk/src/blocks/button/edit-block.js

    r3335584 r3336084  
    378378                    setAttributes={setAttributes}
    379379                  ></BorderHoverLightColorSettings>
     380                  <BorderDarkColorSettings
     381                    attributes={attributes}
     382                    setAttributes={setAttributes}
     383                  ></BorderDarkColorSettings>
    380384                  <BorderHoverDarkColorSettings
    381385                    attributes={attributes}
    382386                    setAttributes={setAttributes}
    383387                  ></BorderHoverDarkColorSettings>
    384                   <BorderDarkColorSettings
    385                     attributes={attributes}
    386                     setAttributes={setAttributes}
    387                   ></BorderDarkColorSettings>
    388388                  <BorderRadiusSettings
    389389                    attributes={attributes}
Note: See TracChangeset for help on using the changeset viewer.