From e64c0ed65e773f93c3fd4d4ad0e9bd8802726161 Mon Sep 17 00:00:00 2001 From: Tom Usborne Date: Wed, 26 Oct 2022 07:49:31 -0700 Subject: [PATCH 1/8] Update readme.txt --- readme.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.txt b/readme.txt index 76d33df2..87066802 100644 --- a/readme.txt +++ b/readme.txt @@ -99,6 +99,10 @@ MIT License: https://github.com/JedWatson/react-select/blob/master/LICENSE == Changelog == += 3.2.1 = + +Release date: TBD + = 3.2.0 = Release date: October 25, 2022 From fc6b6a23de90ba5d82f9613994fb2614ac5610a3 Mon Sep 17 00:00:00 2001 From: Tom Usborne Date: Wed, 26 Oct 2022 07:50:59 -0700 Subject: [PATCH 2/8] Fix: WooCommerce product itemtype --- inc/class-html-attributes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-html-attributes.php b/inc/class-html-attributes.php index 79138815..a5e08c01 100644 --- a/inc/class-html-attributes.php +++ b/inc/class-html-attributes.php @@ -479,7 +479,7 @@ public function woocommerce_content( $attributes ) { $type = apply_filters( 'generate_article_itemtype', 'CreativeWork' ); $attributes['itemtype'] = sprintf( - 'itemtype="https://schema.org/%s"', + 'https://schema.org/%s', $type ); From b6e5b45f80aea4e65708421d6c0e3ddbbf626989 Mon Sep 17 00:00:00 2001 From: Tom Usborne Date: Wed, 26 Oct 2022 07:52:01 -0700 Subject: [PATCH 3/8] Update readme.txt --- readme.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.txt b/readme.txt index 87066802..6d5ba9fa 100644 --- a/readme.txt +++ b/readme.txt @@ -103,6 +103,8 @@ MIT License: https://github.com/JedWatson/react-select/blob/master/LICENSE Release date: TBD +* Fix: WooCommerce single product schema itemtype + = 3.2.0 = Release date: October 25, 2022 From a1296d14c915c370c59c76a4675ee610f5519d55 Mon Sep 17 00:00:00 2001 From: Tom Usborne Date: Wed, 26 Oct 2022 11:01:48 -0700 Subject: [PATCH 4/8] 3.2.1 --- functions.php | 2 +- package.json | 2 +- readme.txt | 2 +- style.css | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index 7773d520..fa676293 100644 --- a/functions.php +++ b/functions.php @@ -12,7 +12,7 @@ } // Set our theme version. -define( 'GENERATE_VERSION', '3.2.0' ); +define( 'GENERATE_VERSION', '3.2.1' ); if ( ! function_exists( 'generate_setup' ) ) { add_action( 'after_setup_theme', 'generate_setup' ); diff --git a/package.json b/package.json index a7c7d37f..bb4138fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generatepress", - "version": "3.2.0", + "version": "3.2.1", "description": "A super lightweight WordPress theme.", "main": "Gruntfile.js", "scripts": { diff --git a/readme.txt b/readme.txt index 6d5ba9fa..fee10257 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: two-columns, three-columns, one-column, right-sidebar, left-sidebar, footer-widgets, blog, e-commerce, flexible-header, full-width-template, buddypress, custom-header, custom-background, custom-menu, custom-colors, sticky-post, threaded-comments, translation-ready, rtl-language-support, featured-images, theme-options Requires at least: 5.2 Tested up to: 6.1 -Stable tag: 3.2.0 +Stable tag: 3.2.1 GeneratePress is a lightweight WordPress theme built with a focus on speed and usability. diff --git a/style.css b/style.css index 44ed33ef..62c8c121 100644 --- a/style.css +++ b/style.css @@ -4,7 +4,7 @@ Theme URI: https://generatepress.com Author: Tom Usborne Author URI: https://tomusborne.com Description: GeneratePress is a lightweight WordPress theme built with a focus on speed and usability. Performance is important to us, which is why a fresh GeneratePress install adds less than 10kb (gzipped) to your page size. We take full advantage of the block editor (Gutenberg), which gives you more control over creating your content. If you use page builders, GeneratePress is the right theme for you. It is completely compatible with all major page builders, including Beaver Builder and Elementor. Thanks to our emphasis on WordPress coding standards, we can boast full compatibility with all well-coded plugins, including WooCommerce. GeneratePress is fully responsive, uses valid HTML/CSS, and is translated into over 25 languages by our amazing community of users. A few of our many features include 60+ color controls, powerful dynamic typography, 5 navigation locations, 5 sidebar layouts, dropdown menus (click or hover), and 9 widget areas. Learn more and check out our powerful premium version at https://generatepress.com -Version: 3.2.0 +Version: 3.2.1 Requires at least: 5.2 Tested up to: 6.1 Requires PHP: 5.6 From 23d0e84fa54a53dc061854223153afed7e7446aa Mon Sep 17 00:00:00 2001 From: Tom Usborne Date: Wed, 26 Oct 2022 14:58:25 -0700 Subject: [PATCH 5/8] Fix: Post title font properties in the editor --- assets/css/admin/editor-typography.css | 3 +-- readme.txt | 1 + sass/editor-typography.scss | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/assets/css/admin/editor-typography.css b/assets/css/admin/editor-typography.css index 3594ba27..bb6f2ec8 100644 --- a/assets/css/admin/editor-typography.css +++ b/assets/css/admin/editor-typography.css @@ -20,8 +20,7 @@ h1, h2, h3, h4, h5, h6 { font-weight: inherit; } -h1, -.editor-post-title__input { +h1 { font-family: inherit; font-size: 42px; margin-bottom: 20px; diff --git a/readme.txt b/readme.txt index fee10257..2a5427b3 100644 --- a/readme.txt +++ b/readme.txt @@ -104,6 +104,7 @@ MIT License: https://github.com/JedWatson/react-select/blob/master/LICENSE Release date: TBD * Fix: WooCommerce single product schema itemtype +* Fix: Post title font properties in the editor = 3.2.0 = diff --git a/sass/editor-typography.scss b/sass/editor-typography.scss index 3594ba27..bb6f2ec8 100644 --- a/sass/editor-typography.scss +++ b/sass/editor-typography.scss @@ -20,8 +20,7 @@ h1, h2, h3, h4, h5, h6 { font-weight: inherit; } -h1, -.editor-post-title__input { +h1 { font-family: inherit; font-size: 42px; margin-bottom: 20px; From 5ef35db7de53ac515b846c41d24b411a80eff899 Mon Sep 17 00:00:00 2001 From: Tom Usborne Date: Thu, 27 Oct 2022 09:26:03 -0700 Subject: [PATCH 6/8] Update readme.txt --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 2a5427b3..b0fb2003 100644 --- a/readme.txt +++ b/readme.txt @@ -101,7 +101,7 @@ MIT License: https://github.com/JedWatson/react-select/blob/master/LICENSE = 3.2.1 = -Release date: TBD +Release date: October 27, 2022 * Fix: WooCommerce single product schema itemtype * Fix: Post title font properties in the editor From 3a664ae0900a9dd792fbb46e0008ad1b36a2544d Mon Sep 17 00:00:00 2001 From: Tom Usborne Date: Thu, 27 Oct 2022 10:12:30 -0700 Subject: [PATCH 7/8] Fix: Error in Customizer when Google Fonts disabled --- assets/dist/customizer.asset.php | 2 +- assets/dist/customizer.js | 2 +- readme.txt | 1 + .../font-manager/GeneratePressFontManagerControlForm.js | 6 +++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/assets/dist/customizer.asset.php b/assets/dist/customizer.asset.php index 3423ebad..1ea2bcf1 100644 --- a/assets/dist/customizer.asset.php +++ b/assets/dist/customizer.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '799faa7f09d874497fa43aed7476064a'); \ No newline at end of file + array('lodash', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '89a3305075b3f93799d6a1ca78b75a14'); \ No newline at end of file diff --git a/assets/dist/customizer.js b/assets/dist/customizer.js index 3965ef37..576aebf3 100644 --- a/assets/dist/customizer.js +++ b/assets/dist/customizer.js @@ -2,4 +2,4 @@ /* translators: Unit type (px, em, %) */,{text:Object(c.sprintf)(Object(c.__)("%s Preview","generatepress"),t),key:e},Object(o.createElement)(s.Button,{key:e,className:"components-generate-control-button__units--"+e,isSmall:!0 /* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":t,onClick:function(){wp.customize.previewedDevice.set(e),a(e)}},we(e)))})))))}),Mn=r(31),In=r.n(Mn),kn=r(32),Pn=r.n(kn),Rn=r(33),Ln=r.n(Rn),An=r(34),Fn=r.n(An),Bn=r(25),Hn=r.n(Bn);r(60);var Vn=function(e){Ln()(n,e);var t,r,a=(t=n,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=Hn()(t);if(r){var n=Hn()(this).constructor;e=Reflect.construct(a,arguments,n)}else e=a.apply(this,arguments);return Fn()(this,e)});function n(){return In()(this,n),a.apply(this,arguments)}return Pn()(n,[{key:"render",value:function(){var e=this.props,t=e.label,r=e.value,a=e.onChange,n=e.rangeMin,i=void 0===n?0:n,l=e.rangeMax,c=void 0===l?100:l,u=e.inputMin,g=void 0===u?"":u,d=e.inputMax,f=void 0===d?"":d,p=e.step,v=void 0===p?1:p,h=e.help,y=void 0===h?"":h,m=e.beforeIcon,b=void 0===m?"":m,O=e.initialPosition,S=void 0===O?"":O,w=e.placeholder,C=void 0===w?"":w;return Object(o.createElement)("div",{className:"components-generate-range-control"},t&&Object(o.createElement)("div",{className:"components-generate-range-control--label"},t),Object(o.createElement)("div",{className:"components-generate-range-control--wrapper"},Object(o.createElement)("div",{className:"components-generate-range-control--range"},Object(o.createElement)(s.RangeControl,{className:"generate-range-control-range",beforeIcon:b,value:dn(r)?parseFloat(r):"",onChange:function(e){return a(e)},min:i,max:c,step:v,withInputField:!1,initialPosition:S})),Object(o.createElement)("div",{className:"components-generate-range-control-input"},Object(o.createElement)(s.TextControl,{type:"number",placeholder:""!==C?C:"",min:g,max:f,step:v,value:dn(r)?r:"",onChange:function(e){return a(e)}}))),y&&Object(o.createElement)("p",{className:"components-base-control__help"},y))}}]),n}(o.Component),zn=(r(61),function(e){var t=e.value,r=e.onClick,a=e.units;return Object(o.createElement)("div",{className:"components-generate--control__units"},Object(o.createElement)(s.Dropdown,{className:"generate-component-control--unit-picker",contentClassName:"generate-component-control--unit-picker-area",position:"middle center",focusOnMount:"container",renderToggle:function(e){var r=e.isOpen,a=e.onToggle;return Object(o.createElement)(s.Button,{onClick:a,"aria-expanded":r},t||we("dash"))},renderContent:function(e){var n=e.onClose;return Object(o.createElement)(s.ButtonGroup,{className:"components-generate--control-buttons__units","aria-label":Object(c.__)("Select Units","generatepress")},a.map((function(e){var a=e,i=e||we("dash");return""===e&&(a=Object(c.__)("No Unit","generatepress")),"px"===e&&(a=Object(c._x)("Pixel","A size unit for CSS markup","generatepress")),"em"===e&&(a=Object(c._x)("Em","A size unit for CSS markup","generatepress")),"%"===e&&(a=Object(c._x)("Percentage","A size unit for CSS markup","generatepress")),"deg"===e&&(a=Object(c._x)("Degree","A size unit for CSS markup","generatepress")),Object(o.createElement)(s.Tooltip /* translators: Unit type (px, em, %) */,{text:e?Object(c.sprintf)(Object(c.__)("%s Units","generatepress"),a):a,key:e},Object(o.createElement)(s.Button,{key:e,className:"components-generate--control-button__units--"+e,isSmall:!0,isPrimary:t===e,"aria-pressed":t===e -/* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":e?Object(c.sprintf)(Object(c.__)("%s Units","generatepress"),a):a,onClick:function(){r(e),n()}},i))})))}}))}),Un=function(e){var t=e.label,r=e.unitValue,a=e.units,n=e.onChangeUnit,i=e.step,l=e.rangeMin,c=e.rangeMax,u=e.inputMin,g=void 0===u?null:u,d=e.inputMax,f=void 0===d?null:d,p=e.desktopValue,v=e.desktopInitial,h=e.desktopOnChange,y=e.tabletValue,m=e.tabletInitial,b=e.tabletOnChange,O=e.mobileInitial,S=e.mobileValue,w=e.mobileOnChange;return Object(o.createElement)(s.BaseControl,null,Object(o.createElement)(Dn,{label:t,value:r,devices:["desktop","tablet","mobile"]}),Object(o.createElement)("div",{className:"generate-component-input-with-unit"},Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"desktop"},Object(o.createElement)(Vn,{className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(p)?parseFloat(p):v,initialPosition:v,onChange:h,withInputField:!1})),Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"tablet"},Object(o.createElement)(Vn,{"data-generate-control-device":"tablet",className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(y)?parseFloat(y):m,initialPosition:m,onChange:b,withInputField:!1})),Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"mobile"},Object(o.createElement)(Vn,{"data-generate-control-device":"mobile",className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(S)?parseFloat(S):O,initialPosition:O,onChange:w,withInputField:!1})),Object(o.createElement)(zn,{value:r,units:a,onClick:n})))},Gn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Font size","generatepress"),unitValue:t.fontSizeUnit,units:["px","em","rem","%"],onChangeUnit:function(e){r("fontSizeUnit",e,t.index)},step:vn(t,"fontSize","step",1),rangeMin:vn(t,"fontSize","min",1),rangeMax:vn(t,"fontSize","max",100),inputMin:0,desktopValue:t.fontSize,desktopInitial:pn(t,"fontSize"),desktopOnChange:function(e){r("fontSize",e,t.index)},tabletValue:t.fontSizeTablet,tabletInitial:pn(t,"fontSizeTablet"),tabletOnChange:function(e){r("fontSizeTablet",e,t.index)},mobileValue:t.fontSizeMobile,mobileInitial:pn(t,"fontSizeMobile"),mobileOnChange:function(e){r("fontSizeMobile",e,t.index)}})},Wn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Line Height","generatepress"),unitValue:t.lineHeightUnit,units:["","px","em","rem"],onChangeUnit:function(e){r("lineHeightUnit",e,t.index)},step:vn(t,"lineHeight","step",.1),rangeMin:vn(t,"lineHeight","min",1),rangeMax:vn(t,"lineHeight","max",5),inputMin:0,desktopValue:t.lineHeight,desktopInitial:pn(t,"lineHeight"),desktopOnChange:function(e){r("lineHeight",e,t.index)},tabletValue:t.lineHeightTablet,tabletInitial:pn(t,"lineHeightTablet"),tabletOnChange:function(e){r("lineHeightTablet",e,t.index)},mobileValue:t.lineHeightMobile,mobileInitial:pn(t,"lineHeightMobile"),mobileOnChange:function(e){r("lineHeightMobile",e,t.index)}})},Kn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Letter Spacing","generatepress"),unitValue:t.letterSpacingUnit,units:["px","em","rem"],onChangeUnit:function(e){r("letterSpacingUnit",e,t.index)},step:vn(t,"letterSpacing","step",.01),rangeMin:vn(t,"letterSpacing","min",-1),rangeMax:vn(t,"letterSpacing","max",10),desktopValue:t.letterSpacing,desktopInitial:pn(t,"letterSpacing"),desktopOnChange:function(e){r("letterSpacing",e,t.index)},tabletValue:t.letterSpacingTablet,tabletInitial:pn(t,"letterSpacingTablet"),tabletOnChange:function(e){r("letterSpacingTablet",e,t.index)},mobileValue:t.letterSpacingMobile,mobileInitial:pn(t,"letterSpacingMobile"),mobileOnChange:function(e){r("letterSpacingMobile",e,t.index)}})},$n=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:"body"===t.selector?Object(c.__)("Paragraph Bottom Margin","generatepress"):Object(c.__)("Bottom Margin","generatepress"),unitValue:t.marginBottomUnit,units:["px","em","rem"],onChangeUnit:function(e){r("marginBottomUnit",e,t.index)},step:vn(t,"marginBottom","step",.1),rangeMin:vn(t,"marginBottom","min",0),rangeMax:vn(t,"marginBottom","max",5),inputMin:0,desktopValue:t.marginBottom,desktopInitial:pn(t,"marginBottom"),desktopOnChange:function(e){0>e&&(e=0),r("marginBottom",e,t.index)},tabletValue:t.marginBottomTablet,tabletInitial:pn(t,"marginBottomTablet"),tabletOnChange:function(e){0>e&&(e=0),r("marginBottomTablet",e,t.index)},mobileValue:t.marginBottomMobile,mobileInitial:pn(t,"marginBottomMobile"),mobileOnChange:function(e){0>e&&(e=0),r("marginBottomMobile",e,t.index)}})},Yn=function(e){var t=e.index,r=e.value,a=e.onChange;return Object(o.createElement)(s.SelectControl,{label:Object(c.__)("Text Decoration","generatepress"),value:r,options:[{value:"",label:Object(c.__)("Default","generatepress")},{value:"none",label:Object(c.__)("None","generatepress")},{value:"underline",label:Object(c.__)("Underline","generatepress")}],onChange:function(e){a("textDecoration",e,t)}})},qn=function(e){var t=e.font,r=e.toggleClose,a=e.onChangeFontValue,n=e.onChangeElement;return Object(o.createElement)("div",{className:"generate-customize-control--font-dropdown"},Object(o.createElement)(wn,{index:t.index,value:t.selector,onChange:n}),!!t.selector&&Object(o.createElement)(o.Fragment,null,"custom"===t.selector&&Object(o.createElement)(Cn,{index:t.index,value:t.customSelector,onChange:a}),Object(o.createElement)(xn,{index:t.index,value:t.fontFamily,onChange:a}),Object(o.createElement)("div",{className:"components-base-control generate-font-manager--select-options"},Object(o.createElement)(En,{index:t.index,value:t.fontWeight,fontFamily:t.fontFamily,onChange:a}),Object(o.createElement)(Nn,{index:t.index,value:t.textTransform,onChange:a}),Object(o.createElement)(Tn,{index:t.index,value:t.fontStyle,onChange:a}),Object(o.createElement)(Yn,{index:t.index,value:t.textDecoration,onChange:a})),Object(o.createElement)(Gn,{font:t,onChange:a}),Object(o.createElement)(Wn,{font:t,onChange:a}),Object(o.createElement)(Kn,{font:t,onChange:a}),hn(t.selector)&&Object(o.createElement)($n,{font:t,onChange:a})),Object(o.createElement)("div",{className:"generate-font-manager--footer"},Object(o.createElement)(s.Button,{isSecondary:!0,isSmall:!0,onClick:r},Object(c.__)("Close","generatepress"))))},Jn=function(e){var t=e.font,r=e.label,a=e.itemId,n=e.setOpen,i=e.isOpen,s=e.deleteFont,l=e.toggleClose,c=e.onChangeFontValue,u=e.onChangeElement;return Object(o.createElement)("div",{className:"generate-font-manager--item"},Object(o.createElement)("div",{className:"generate-font-manager--header"},Object(o.createElement)(bn,{font:t,itemId:a,setOpen:n,isOpen:i,label:r}),Object(o.createElement)(On,{itemId:a,setOpen:n,isOpen:i}),Object(o.createElement)(Sn,{onClick:s.bind(null,t.index),isOpen:i,itemId:a})),a===i&&Object(o.createElement)(qn,{font:t,toggleClose:l,onChangeFontValue:c,onChangeElement:u}))},Xn=function(e){var t,r,a=e.fontList,n=("group","other",a.reduce((function(e,t,r){var a=t.group||"other";return t.index=r,e[a]=e[a]||[],e[a].push(t),e}),{}));return t=yn(),r=function(t,r){var a,s=null!==(a=n[r])&&void 0!==a?a:[];if(0!==s.length)return Object(o.createElement)("div",{className:"generate-font-manager-group",key:r},Object(o.createElement)("h4",{className:"generate-font-manager-group__label"},t),s.map((function(t){return Object(o.createElement)(Jn,i()({key:t.index,itemId:t.index+1,font:t},e))})))},Object.values(Object.fromEntries(Object.entries(t).map((function(e){var t=g()(e,2),a=t[0],n=t[1];return[a,r(n,a)]}))))};function Zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Qn(e){for(var t=1;t0&&v.push({label:Object(c.__)("Google Fonts","generatepress"),options:Object.keys(_e).map((function(e){return{value:e,label:e}}))}),d.forEach((function(e){var t=e.googleFont?1:0;v[t].options=v[t].options.filter((function(t){return t.value!==e.fontFamily}))})),Object(o.createElement)("div",null,Object(o.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),!!d.length>0&&d.map((function(t,r){var g=r+1,f=function(e){var t=Pe()(d),a=t[r];t[r]=un(un({},t[r]),{},{fontFamily:e}),i(t),void 0!==_e[e]?(t[r]=un(un({},t[r]),{},{googleFont:!0,googleFontCategory:_e[e].category,googleFontVariants:_e[e].variants.join(", ")}),i(t)):(t[r]=un(un({},t[r]),{},{googleFont:!1,googleFontCategory:"",googleFontVariants:""}),i(t)),l(t[r].fontFamily,a.fontFamily)},p=d[r].fontFamily||"";return Object(o.createElement)("div",{className:"generate-font-manager--item",key:r},Object(o.createElement)("div",{className:"generate-font-manager--header"},Object(o.createElement)(s.Button,{className:"generate-font-manager--label",onClick:function(){n(g!==a&&g)}},d[r].fontFamily?d[r].fontFamily:e.label),Object(o.createElement)(s.Tooltip,{text:Object(c.__)("Open Font Family Settings","generatepress")},Object(o.createElement)(s.Button,{className:"generate-font-manager--open",onClick:function(){n(g!==a&&g)}},we(g===a?"chevron-up":"chevron-down"))),Object(o.createElement)(s.Tooltip,{text:Object(c.__)("Delete Font Family","generatepress")},Object(o.createElement)(s.Button,{className:"generate-font-manager--delete-font",onClick:function(){if(window.confirm(Object(c.__)("This will permanently delete this font family. Doing so will stop elements from displaying it as their font.","generatepress"))){var e=Pe()(d),t=e[r];l("",t.fontFamily),e.splice(r,1),i(e)}}},we("trash")))),g===a&&Object(o.createElement)("div",{className:"generate-customize-control--font-dropdown"},Object(o.createElement)(s.BaseControl,{className:"generate-component-font-family-picker-wrapper",id:"generate-font-manager-family-name--input"},Object(o.createElement)(sn,{options:v,placeholder:Object(c.__)("Search fonts…","generatepress"),onChange:function(e){return f(e.value)}}),Object(o.createElement)(s.TextControl,{id:"generate-font-manager-family-name--input",className:"generate-font-manager-family-name--input",label:Object(c.__)("Font family name","generatepress"),value:p,onChange:function(e){var t;t=e,d.filter((function(e){return e.fontFamily===t})).length>0&&(alert(Object(c.__)("Font already selected","generatepress")),e=""),f(e)}}),!!d[r].fontFamily&&Object(o.createElement)("div",{className:"generate-font-manager--options"},Object(o.createElement)(s.ToggleControl,{className:"generate-font-manager-google-font--field",label:Object(c.__)("Use Google Fonts API","generatepress"),checked:!!d[r].googleFont,onChange:function(e){var t=Pe()(d);t[r]=un(un({},t[r]),{},{googleFont:e}),i(t)}}),!!d[r].googleFont&&Object(o.createElement)("div",{className:"generate-font-manager--google-font-options"},Object(o.createElement)(s.TextControl,{label:Object(c.__)("Category","generatepress"),value:d[r].googleFontCategory||"",onChange:function(e){var t=Pe()(d);t[r]=un(un({},t[r]),{},{googleFontCategory:e}),i(t)}}),Object(o.createElement)(s.TextControl,{label:Object(c.__)("Variants","generatepress"),value:d[r].googleFontVariants||"",onChange:function(e){var t=Pe()(d);t[r]=un(un({},t[r]),{},{googleFontVariants:e}),i(t)}}))),Object(o.createElement)("div",{className:"generate-font-manager--footer"},Object(o.createElement)(s.Button,{isSecondary:!0,isSmall:!0,onClick:u},Object(c.__)("Close","generatepress"))))))})),Object(o.createElement)(s.Button,{isPrimary:!0,onClick:function(){var t=Pe()(e.value);t.push({fontFamily:"",googleFont:!1,googleFontApi:1,googleFontCategory:"",googleFontVariants:""}),i(t);var r=wp.customize.control(e.customizerSetting.id).setting.get().length;n(r)}},Object(c.__)("Add Font","generatepress")))})),ti=l((function(e){var t=e.value,r=Object(o.useState)([]),a=g()(r,2),n=a[0],i=a[1],l=Object(o.useState)(0),u=g()(l,2),d=u[0],f=u[1],p=Object(o.useState)(!1),v=g()(p,2),h=v[0],y=v[1];Object(o.useEffect)((function(){Array.isArray(t)?i(t):"object"===De()(t)&&i(Object.values(t))}),[t]),Object(o.useEffect)((function(){var t=h?"refresh":"postMessage";wp.customize.control(e.customizerSetting.id).setting.transport=t,wp.customize.control(e.customizerSetting.id).setting.set(n)}),[n]);var m=fn(),b=function(e){y(!0),i(e)};return Object(o.createElement)("div",null,Object(o.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),Object(o.createElement)(Xn,{fontList:n,setOpen:f,isOpen:d,label:e.label,deleteFont:function(e){var t=Pe()(n);t.splice(e,1),b(t)},toggleClose:function(){return f(0)},onChangeFontValue:function(e,t,r){var a=Pe()(n);a[r]=Qn({},a[r]),a[r][e]=t,b(a)},onChangeElement:function(e,t){var r=e.value,a=e.group,i=e.module,o=Pe()(n);o[t]=Qn(Qn({},o[t]),{},{selector:r,module:i,group:a});var s=m[r].placeholders;s&&Object.keys(s).forEach((function(e){var a=m[r].placeholders[e].unit;if(a){var n=e+"Unit";o[t]=Qn(Qn({},o[t]),{},Ie()({},n,a))}})),hn(r)||(o[t]=Qn(Qn({},o[t]),{},{marginBottom:"",marginBottomTablet:"",marginBottomMobile:"",marginBottomUnit:""})),b(o)}}),Object(o.createElement)(s.Button,{isPrimary:!0,onClick:function(){var t=Pe()(e.value);t.push({selector:"",customSelector:"",fontFamily:"",fontWeight:"",textTransform:"",textDecoration:"",fontStyle:"",fontSize:"",fontSizeTablet:"",fontSizeMobile:"",fontSizeUnit:"px",lineHeight:"",lineHeightTablet:"",lineHeightMobile:"",lineHeightUnit:"",letterSpacing:"",letterSpacingTablet:"",letterSpacingMobile:"",letterSpacingUnit:"px"}),b(t),f(t.length)}},Object(c.__)("Add Typography","generatepress")))}));wp.customize.controlConstructor["generate-font-manager-control"]=ei,wp.customize.controlConstructor["generate-typography-control"]=ti,r(62);var ri=r(10);function ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function ni(e){for(var t=1;t(null==t&&(t=e()),t)}class vi{enter(e){const t=this.entered.length;return this.entered=function(e,t){const r=new Set,a=e=>r.add(e);e.forEach(a),t.forEach(a);const n=[];return r.forEach(e=>n.push(e)),n}(this.entered.filter(t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var r,a;return this.entered=(r=this.entered.filter(this.isNodeInDocument),a=e,r.filter(e=>e!==a)),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class hi{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get:()=>(console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null)})})}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach(r=>{const a=this.config.exposeProperties[r];null!=a&&(t[r]={value:a(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const yi="__NATIVE_FILE__",mi="__NATIVE_URL__",bi="__NATIVE_TEXT__",Oi="__NATIVE_HTML__";function Si(e,t,r){const a=t.reduce((t,r)=>t||e.getData(r),"");return null!=a?a:r}const wi={[yi]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Oi]:{exposeProperties:{html:(e,t)=>Si(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[mi]:{exposeProperties:{urls:(e,t)=>Si(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[bi]:{exposeProperties:{text:(e,t)=>Si(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Ci(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(wi).filter(e=>{const r=wi[e];return!!(null==r?void 0:r.matchesTypes)&&r.matchesTypes.some(e=>t.indexOf(e)>-1)})[0]||null}const xi=pi(()=>/firefox/i.test(navigator.userAgent)),ji=pi(()=>Boolean(window.safari));class Ei{interpolate(e){const{xs:t,ys:r,c1s:a,c2s:n,c3s:i}=this;let o=t.length-1;if(e===t[o])return r[o];let s,l=0,c=i.length-1;for(;l<=c;){s=Math.floor(.5*(l+c));const a=t[s];if(ae))return r[s];c=s-1}}o=Math.max(0,c);const u=e-t[o],g=u*u;return r[o]+a[o]*u+n[o]*g+i[o]*u*g}constructor(e,t){const{length:r}=e,a=[];for(let e=0;ee[t]{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,r){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);const a=t=>this.handleDragStart(t,e),n=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",a),t.addEventListener("selectstart",n),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",a),t.removeEventListener("selectstart",n),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const r=t=>this.handleDragEnter(t,e),a=t=>this.handleDragOver(t,e),n=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",r),t.addEventListener("dragover",a),t.addEventListener("drop",n),()=>{t.removeEventListener("dragenter",r),t.removeEventListener("dragover",a),t.removeEventListener("drop",n)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Ii({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return Ii({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(a).some(t=>a[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const r=wi[e];if(!r)throw new Error(`native type ${e} has no configuration`);const a=new hi(r);return a.loadDataTransfer(t),a}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&Ni(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{null===this.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{null!==this.hoverRafId&&"undefined"!=typeof cancelAnimationFrame&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const r=Ti(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=e,n=Ci(a);if(this.monitor.isDragging()){if(a&&"function"==typeof a.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),n=this.sourcePreviewNodes.get(e)||t;if(n){const{anchorX:e,anchorY:i,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),l=function(e,t,r,a,n){const i="IMG"===(o=t).nodeName&&(xi()||!(null===(s=document.documentElement)||void 0===s?void 0:s.contains(o)));var o,s;const l=Ni(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:g}=e,{anchorX:d,anchorY:f}=a,{dragPreviewWidth:p,dragPreviewHeight:v}=function(e,t,r,a){let n=e?t.width:r,i=e?t.height:a;return ji()&&e&&(i/=window.devicePixelRatio,n/=window.devicePixelRatio),{dragPreviewWidth:n,dragPreviewHeight:i}}(i,t,u,g),{offsetX:h,offsetY:y}=n,m=0===y||y;return{x:0===h||h?h:new Ei([0,.5,1],[c.x,c.x/u*p,c.x+p-u]).interpolate(d),y:m?y:(()=>{let e=new Ei([0,.5,1],[c.y,c.y/g*v,c.y+v-g]).interpolate(f);return ji()&&i&&(e+=(window.devicePixelRatio-1)*v),e})()}}(t,n,r,{anchorX:e,anchorY:i},{offsetX:o,offsetY:s});a.setDragImage(n,l.x,l.y)}}try{null==a||a.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(n)this.beginDragNativeItem(n);else{if(a&&!a.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{var t;if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)),!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:r}=e,a=Ci(r);a&&this.beginDragNativeItem(a,r)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:Ti(e)}),t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{var t;this.dragOverTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=Ti(e),this.scheduleHover(t),(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{var t;this.dropTargetIds=[],this.isDraggingNativeItem()?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Ci(e.dataTransfer)&&e.preventDefault(),this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:Ti(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{const t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new Di(t,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new vi(this.isNodeInDocument)}}const Pi=function(e,t,r){return new ki(e,t,r)};var _i=r(36),Ri=r.n(_i);const Li="undefined"!=typeof window?f.useLayoutEffect:f.useEffect;function Ai(e,t,r){return function(e,t,r){const[a,n]=function(e,t,r){const[a,n]=Object(f.useState)(()=>t(e)),i=Object(f.useCallback)(()=>{const i=t(e);Ri()(a,i)||(n(i),r&&r())},[a,e,r]);return Li(i),[a,i]}(e,t,r);return Li((function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(n,{handlerIds:[t]})}),[e,n]),a}(t,e||(()=>({})),()=>r.reconnect())}function Fi(e,t){const r=[...t||[]];return null==t&&"function"!=typeof e&&r.push(e),Object(f.useMemo)(()=>"function"==typeof e?e():e,r)}function Bi(e){return Object(f.useMemo)(()=>e.hooks.dropTarget(),[e])}function Hi(e,t,r,a){let n=r?r.call(a,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o{const a=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const e=function(e){return(t=null,r=null)=>{if(!Object(f.isValidElement)(t)){const a=t;return e(a,r),a}const a=t;return function(e){if("string"==typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a
, or turn it into a drag source or a drop target itself.`)}(a),function(e,t){const r=e.ref;return Object(zi.a)("string"!=typeof r,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?Object(f.cloneElement)(e,{ref:e=>{Gi(r,e),Gi(t,e)}}):Object(f.cloneElement)(e,{ref:t})}(a,r?t=>e(t,r):e)}}(a);t[r]=()=>e}}),t}function Gi(e,t){"function"==typeof e?e(t):e.current=t}class Wi{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Hi(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Ui({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,Vi(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}var Ki=r(35);function $i(){const{dragDropManager:e}=Object(f.useContext)(Ki.a);return Object(zi.a)(null!=e,"Expected drag drop context"),e}let Yi=!1;class qi{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;Object(zi.a)(!Yi,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Yi=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Yi=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}class Ji{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function Xi(e,t){const r=Fi(e,t),a=function(){const e=$i();return Object(f.useMemo)(()=>new qi(e),[e])}(),n=function(e){const t=$i(),r=Object(f.useMemo)(()=>new Wi(t.getBackend()),[t]);return Li(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}(r.options);return function(e,t,r){const a=$i(),n=function(e,t){const r=Object(f.useMemo)(()=>new Ji(e,t),[t]);return Object(f.useEffect)(()=>{r.spec=e},[e]),r}(e,t),i=function(e){const{accept:t}=e;return Object(f.useMemo)(()=>(Object(zi.a)(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}(e);Li((function(){const[e,o]=function(e,t,r){const a=r.getRegistry(),n=a.addTarget(e,t);return[n,()=>a.removeTarget(n)]}(i,n,a);return t.receiveHandlerId(e),r.receiveHandlerId(e),o}),[a,t,n,r,i.map(e=>e.toString()).join("|")])}(r,a,n),[Ai(r.collect,a,n),Bi(n)]}function Zi(e){return Object(f.useMemo)(()=>e.hooks.dragSource(),[e])}function Qi(e){return Object(f.useMemo)(()=>e.hooks.dragPreview(),[e])}class eo{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();r&&this.disconnectDragPreview(),this.handlerId&&(t?r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Hi(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Hi(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Ui({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,Vi(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,Vi(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}let to=!1,ro=!1;class ao{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){Object(zi.a)(!to,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return to=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{to=!1}}isDragging(){if(!this.sourceId)return!1;Object(zi.a)(!ro,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return ro=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{ro=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}class no{beginDrag(){const e=this.spec,t=this.monitor;let r=null;return r="object"==typeof e.item?e.item:"function"==typeof e.item?e.item(t):{},null!=r?r:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const r=this.spec,a=this.monitor,{isDragging:n}=r;return n?n(a):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,r=this.connector,{end:a}=e;a&&a(t.getItem(),t),r.reconnect()}constructor(e,t,r){this.spec=e,this.monitor=t,this.connector=r}}function io(e,t){const r=Fi(e,t);Object(zi.a)(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const a=function(){const e=$i();return Object(f.useMemo)(()=>new ao(e),[e])}(),n=function(e,t){const r=$i(),a=Object(f.useMemo)(()=>new eo(r.getBackend()),[r]);return Li(()=>(a.dragSourceOptions=e||null,a.reconnect(),()=>a.disconnectDragSource()),[a,e]),Li(()=>(a.dragPreviewOptions=t||null,a.reconnect(),()=>a.disconnectDragPreview()),[a,t]),a}(r.options,r.previewOptions);return function(e,t,r){const a=$i(),n=function(e,t,r){const a=Object(f.useMemo)(()=>new no(e,t,r),[t,r]);return Object(f.useEffect)(()=>{a.spec=e},[e]),a}(e,t,r),i=function(e){return Object(f.useMemo)(()=>{const t=e.type;return Object(zi.a)(null!=t,"spec.type must be defined"),t},[e])}(e);Li((function(){if(null!=i){const[e,o]=function(e,t,r){const a=r.getRegistry(),n=a.addSource(e,t);return[n,()=>a.removeSource(n)]}(i,n,a);return t.receiveHandlerId(e),r.receiveHandlerId(e),o}}),[a,t,r,n,i])}(r,a,n),[Ai(r.collect,a,n),Zi(n),Qi(n)]}function oo(e){var t=e.id,r=e.itemType,a=e.onDrop,n=e.getIndex,i=e.className,s=e.innerComponentProps,l=e.InnerComponent,c=io((function(){return{type:r,item:{id:t},collect:function(e){return{isDragging:e.isDragging()}}}}),[t]),u=g()(c,2),d=u[0].isDragging,f=u[1],p=Xi((function(){return{accept:r,hover:function(e){var r=e.id;if(r!==t){var i=n(t);a(r,i)}}}}),[n,a]),v=g()(p,2)[1],h=d?"0.2":1;return Object(o.createElement)("div",{ref:function(e){return f(v(e))},className:i,style:{opacity:h}},l&&Object(o.createElement)(l,s))}function so(e){var t=e.data,r=e.itemIdKey,a=e.onDrop,n=e.getIndex,i=e.itemType,s=e.listClassName,l=e.itemClassName,c=e.InnerComponent,u=Xi((function(){return{accept:i}})),d=g()(u,2)[1];return Object(o.createElement)("div",{ref:d,className:s},t&&t.map((function(e){return Object(o.createElement)(oo,{key:e[r],id:e[r],itemType:i,className:l,onDrop:a,getIndex:n,InnerComponent:c,innerComponentProps:{item:e}})})))}function lo(e){var t=e.idKey,r=void 0===t?"id":t,a=e.acceptedType,n=void 0===a?"simple-list-item":a,i=e.listData,s=void 0===i?[]:i,l=e.onChangeData,c=e.listClassName,u=void 0===c?"":c,d=e.itemClassName,f=void 0===d?"":d,p=e.InnerComponent,v=Object(o.useState)([]),h=g()(v,2),y=h[0],m=h[1];Object(o.useEffect)((function(){m(s)}),[JSON.stringify(s)]),Object(o.useEffect)((function(){l(y)}),[JSON.stringify(y)]);var b=Object(o.useCallback)((function(e){var t=y.find((function(t){return e===t[r]}));return y.indexOf(t)}),[JSON.stringify(y)]),O=Object(o.useCallback)((function(e,t){var r=b(e);m(function(e,t,r){var a=Array.from(e),n=a.splice(t,1),i=g()(n,1)[0];return a.splice(r,0,i),a}(y,r,t))}),[JSON.stringify(y)]);return Object(o.createElement)(fi.a,{backend:Pi},Object(o.createElement)(so,{data:y,itemIdKey:r,onDrop:O,getIndex:b,itemType:n,listClassName:u,itemClassName:f,InnerComponent:p}))}function co(e){var t=e.item;return Object(o.createElement)(s.Tooltip,{text:t.slug,position:"top center"},Object(o.createElement)("span",{style:{backgroundColor:t.color}}))}var uo=l((function(e){var t=function(){var e=Object(o.useReducer)(si,oi),t=g()(e,2),r=t[0],a=t[1];return{colors:r,setColors:function(e){return a({type:"SET_COLORS",payload:e})},addColor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return a({type:"ADD_COLOR",payload:Object.assign({},ii,{slug:e,color:t})})},deleteColor:function(e){return a({type:"DELETE_COLOR",payload:e})},updateColorValue:function(e,t){return a({type:"UPDATE_COLOR_VALUE",payload:{slug:e,value:t}})},updateColorSlug:function(e,t){return a({type:"UPDATE_COLOR_SLUG",payload:{slug:e,value:t}})}}}(),r=t.colors,a=t.setColors,n=t.addColor,i=t.deleteColor,s=t.updateColorValue,l=t.updateColorSlug,u=Object(o.useState)(!1),d=g()(u,2),f=d[0],p=d[1],v=Object(o.useState)(!1),h=g()(v,2),y=h[0],m=h[1],b=Object(o.useState)([]),O=g()(b,2),S=O[0],w=O[1];Object(o.useEffect)((function(){var t=Object(ri.isObject)(e.value)?Object.values(e.value):e.value;a(t),p(!0)}),[]),Object(o.useEffect)((function(){var t,a;f&&(a=[],(t=r).length>0&&t.forEach((function(e){a.push({name:e.slug,slug:e.slug,color:"var(--"+e.slug+")"})})),window.sessionStorage.setItem("generateGlobalColors",JSON.stringify(a)),function(t){wp.customize.control(e.customizerSetting.id).setting.set(t);var r=":root {";t.length>0&&t.forEach((function(e){var t=e.slug.replace(" ","-").toLowerCase();r+="--"+t+": "+e.color+";"})),r+="}";var a=document.getElementById("generate-global-color-styles");a?a.innerHTML=r:document.body.insertAdjacentHTML("beforeend",'")}(r))}),[JSON.stringify(r),f]);var C=Object(o.useCallback)((function(){n(function e(t){var a="global-color-".concat(t+1);return-1===Object(ri.findIndex)(r,{slug:a})?a:e(t+1)}(r.length))}),[r.length]);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),Object(o.createElement)("div",{className:"generate-color-manager-wrapper"},Object(o.createElement)("div",{className:"generate-color-manager--item"},Object(o.createElement)(ui,{onClick:C,disabled:y})),Object(o.createElement)("div",{className:"generate-color-manager--item"},Object(o.createElement)(li,{id:"add-color",icon:y?"check":"reorder",text:y?Object(c.__)("Finish re-ordering","generateblocks"):Object(c.__)("Re-order colors","generateblocks"),onClick:function(e){e.preventDefault(),y&&(a(S),window.sessionStorage.setItem("generateGlobalColors",JSON.stringify(S))),m(!y)}}))),y?Object(o.createElement)(lo,{listData:r,idKey:"slug",listClassName:"generate-color-manager-dnd-list",itemClassName:"generate-color-manager-dnd-list-item",InnerComponent:co,onChangeData:w}):Object(o.createElement)(di,{colors:r,onChangeColor:s,onChangeSlug:l,onClickDeleteColor:i}))}));wp.customize.controlConstructor["generate-color-manager-control"]=uo,r(65);var go=function(e){var t=Object(o.useState)(!1),r=g()(t,2),a=r[0],n=r[1],i=function(){e.choices.sectionRedirect?wp.customize.section(e.choices.toggleId).focus():document.querySelectorAll('[data-toggleId="'+e.choices.toggleId+'"]').forEach((function(e){a?(e.style.display="",n(!1)):(e.style.display="block",n(!0))}))},l=e.choices.tooltipText?e.choices.tooltipText:Object(c.sprintf)(Object(c.__)("Open %s Settings","generatepress"),e.choices.title),u=e.choices.sectionRedirect?"chevron-right":"chevron-down";return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"generate-customize-control-title"},!!e.choices.toggleId&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.Tooltip,{text:l},Object(o.createElement)(s.Button,{className:"generate-customize-control-title--label",onClick:i},e.choices.title)),Object(o.createElement)(s.Tooltip,{text:l},Object(o.createElement)(s.Button,{className:"generate-customize-control-title--toggle",onClick:i},we(a?"chevron-up":u)))),!e.choices.toggleId&&Object(o.createElement)("h3",null,e.choices.title)))},fo=wp.customize.Control.extend({ready:function(){this.renderContent()},embed:function(){var e=this,t=e.section();t&&wp.customize.section(t,(function(t){t.expanded.bind((function(t){t&&e.actuallyEmbed()}))}))},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve())},initialize:function(e,t){var r=this;r.setNotificationContainer=r.setNotificationContainer.bind(r),wp.customize.Control.prototype.initialize.call(r,e,t),wp.customize.control.bind("removed",(function e(t){r===t&&(r.destroy(),r.container.remove(),wp.customize.control.unbind("removed",e))}))},setNotificationContainer:function(e){this.notifications.container=jQuery(e),this.notifications.render()},renderContent:function(){var e=Object(o.createElement)(s.SlotFillProvider,null,Object(o.createElement)(go,i()({},this.params,{control:this,choices:this.params.choices,title:this.params.title})),Object(o.createElement)(s.Popover.Slot,null)),t=this.container[0];if(this.params.choices.wrapper){var r=document.getElementById(this.params.choices.wrapper+"--wrapper");r&&(t=r,this.container.hide())}Object(o.render)(e,t)},destroy:function(){Object(o.unmountComponentAtNode)(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["generate-title-control"]=fo;var po=r(38),vo=r.n(po),ho=wp.customize.Control.extend({ready:function(){this.renderContent()},embed:function(){var e=this,t=e.section();t&&wp.customize.section(t,(function(t){t.expanded.bind((function(t){t&&e.actuallyEmbed()}))}))},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve())},initialize:function(e,t){var r=this;r.setNotificationContainer=r.setNotificationContainer.bind(r),wp.customize.Control.prototype.initialize.call(r,e,t),wp.customize.control.bind("removed",(function e(t){r===t&&(r.destroy(),r.container.remove(),wp.customize.control.unbind("removed",e))}))},setNotificationContainer:function(e){this.notifications.container=jQuery(e),this.notifications.render()},renderContent:function(){var e=this.params.choices;this.params.choices.toggleId&&this.container[0].setAttribute("data-toggleId",this.params.choices.toggleId),Object(o.render)(Object(o.createElement)("div",{className:vo()(Ie()({"generate-customize-control-wrapper":!0},e.class,!!e.class)),id:e.id,"data-wrapper-type":e.type},e.items.map((function(e){return Object(o.createElement)("div",{key:e,id:e+"--wrapper"})}))),this.container[0])},destroy:function(){Object(o.unmountComponentAtNode)(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["generate-wrapper-control"]=ho,document.addEventListener("DOMContentLoaded",(function(){window.sessionStorage.removeItem("generateGlobalColors")}))},,,function(e,t,r){"use strict";function a(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}r.d(t,"a",(function(){return te})),r(8);var n="function"==typeof Symbol&&Symbol.observable||"@@observable",i=function(){return Math.random().toString(36).substring(7).split("").join(".")},o={INIT:"@@redux/INIT"+i(),REPLACE:"@@redux/REPLACE"+i(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+i()}};function s(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function l(e,t,r){var i;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(a(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(a(1));return r(l)(e,t)}if("function"!=typeof e)throw new Error(a(2));var c=e,u=t,g=[],d=g,f=!1;function p(){d===g&&(d=g.slice())}function v(){if(f)throw new Error(a(3));return u}function h(e){if("function"!=typeof e)throw new Error(a(4));if(f)throw new Error(a(5));var t=!0;return p(),d.push(e),function(){if(t){if(f)throw new Error(a(6));t=!1,p();var r=d.indexOf(e);d.splice(r,1),g=null}}}function y(e){if(!s(e))throw new Error(a(7));if(void 0===e.type)throw new Error(a(8));if(f)throw new Error(a(9));try{f=!0,u=c(u,e)}finally{f=!1}for(var t=g=d,r=0;r=0;a--)if(t.canDragSource(e[a])){r=e[a];break}return r}(t,o);if(null==l)return void e.dispatch(h);let d=null;if(n){if(!i)throw new Error("getSourceClientOffset must be defined");!function(e){Object(c.a)("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(i),d=i(l)}e.dispatch(v(n,d));const f=s.getSource(l).beginDrag(o,l);if(null==f)return;!function(e){Object(c.a)(u(e),"Item must be an object.")}(f),s.pinSource(l);const p=s.getSourceType(l);return{type:g,payload:{itemType:p,item:f,sourceId:l,clientOffset:n||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){for(var t=1;t{const o=function(e,t,r,a){const n=r.getTarget(e);let i=n?n.drop(a,e):void 0;return function(e){Object(c.a)(void 0===e||u(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:a.getDropResult()),i}(n,i,a,r),s={type:f,payload:{dropResult:b({},t,o)}};e.dispatch(s)})}}function S(e){return function(){const t=e.getMonitor(),r=e.getRegistry();!function(e){Object(c.a)(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const a=t.getSourceId();return null!=a&&(r.getSource(a,!0).endDrag(t,a),r.unpinSource()),{type:p}}}function w(e,t){return null===t?null===e:Array.isArray(e)?e.some(e=>e===t):e===t}function C(e){return function(t,{clientOffset:r}={}){!function(e){Object(c.a)(Array.isArray(e),"Expected targetIds to be an array.")}(t);const a=t.slice(0),n=e.getMonitor(),i=e.getRegistry();return function(e,t,r){for(let a=e.length-1;a>=0;a--){const n=e[a];w(t.getTargetType(n),r)||e.splice(a,1)}}(a,i,n.getItemType()),function(e,t,r){Object(c.a)(t.isDragging(),"Cannot call hover while not dragging."),Object(c.a)(!t.didDrop(),"Cannot call hover after drop.");for(let t=0;t{const i=r[n];var o;return a[n]=(o=i,(...r)=>{const a=o.apply(e,r);void 0!==a&&t(a)}),a},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function E(e,t){return{x:e.x-t.x,y:e.y-t.y}}const N=[],T=[];N.__IS_NONE__=!0,T.__IS_ALL__=!0;class D{subscribeToStateChange(e,t={}){const{handlerIds:r}=t;Object(c.a)("function"==typeof e,"listener must be a function."),Object(c.a)(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;return this.store.subscribe(()=>{const t=this.store.getState(),n=t.stateId;try{n===a||n===a+1&&!function(e,t){return e!==N&&(e===T||void 0===t||(r=e,t.filter(e=>r.indexOf(e)>-1)).length>0);var r}(t.dirtyHandlerIds,r)||e()}finally{a=n}})}subscribeToOffsetChange(e){Object(c.a)("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{const r=this.store.getState().dragOffset;r!==t&&(t=r,e())})}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return Object(c.a)(t,"Expected to find a valid source. sourceId="+e),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);return Object(c.a)(t,"Expected to find a valid target. targetId="+e),!(!this.isDragging()||this.didDrop())&&(w(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);return Object(c.a)(t,"Expected to find a valid source. sourceId="+e),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:r}=t;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),n=this.getItemType();if(n&&!w(a,n))return!1;const i=this.getTargetIds();if(!i.length)return!1;const o=i.indexOf(e);return r?o===i.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:a}=e;return t&&r&&a?E((i=a,{x:(n=t).x+i.x,y:n.y+i.y}),r):null;var n,i}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:r}=e;return t&&r?E(t,r):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}var M=r(26);class I{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const k=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.indexthis.capacity){for(let t=0,r=e.length-this.index;t{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Object(M.a)(this.flush),this.requestErrorThrow=Object(M.b)(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},P=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new I(this.onError,e=>t[t.length]=e);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}(k.registerPendingError),_="dnd-core/REMOVE_TARGET";function R(e,t){t&&Array.isArray(e)?e.forEach(e=>R(e,!1)):Object(c.a)("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var L;!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(L||(L={}));let A=0;function F(e){switch(e[0]){case"S":return L.SOURCE;case"T":return L.TARGET;default:throw new Error("Cannot parse handler ID: "+e)}}function B(e,t){const r=e.entries();let a=!1;do{const{done:e,value:[,n]}=r.next();if(n===t)return!0;a=!!e}while(!a);return!1}class H{addSource(e,t){R(e),function(e){Object(c.a)("function"==typeof e.canDrag,"Expected canDrag to be a function."),Object(c.a)("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),Object(c.a)("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const r=this.addHandler(L.SOURCE,e,t);return this.store.dispatch(function(e){return{type:"dnd-core/ADD_SOURCE",payload:{sourceId:e}}}(r)),r}addTarget(e,t){R(e,!0),function(e){Object(c.a)("function"==typeof e.canDrop,"Expected canDrop to be a function."),Object(c.a)("function"==typeof e.hover,"Expected hover to be a function."),Object(c.a)("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const r=this.addHandler(L.TARGET,e,t);return this.store.dispatch(function(e){return{type:"dnd-core/ADD_TARGET",payload:{targetId:e}}}(r)),r}containsHandler(e){return B(this.dragSources,e)||B(this.dropTargets,e)}getSource(e,t=!1){return Object(c.a)(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return Object(c.a)(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return Object(c.a)(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return Object(c.a)(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return F(e)===L.SOURCE}isTargetId(e){return F(e)===L.TARGET}removeSource(e){var t;Object(c.a)(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:"dnd-core/REMOVE_SOURCE",payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},k.enqueueTask(P.create(t))}removeTarget(e){Object(c.a)(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:_,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);Object(c.a)(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){Object(c.a)(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,r){const a=function(e){const t=(A++).toString();switch(e){case L.SOURCE:return"S"+t;case L.TARGET:return"T"+t;default:throw new Error("Unknown Handler Role: "+e)}}(e);return this.types.set(a,t),e===L.SOURCE?this.dragSources.set(a,r):e===L.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const V=(e,t)=>e===t;function z(e=N,t){switch(t.type){case d:break;case"dnd-core/ADD_SOURCE":case"dnd-core/ADD_TARGET":case _:case"dnd-core/REMOVE_SOURCE":return N;case g:case"dnd-core/PUBLISH_DRAG_SOURCE":case p:case f:default:return T}const{targetIds:r=[],prevTargetIds:a=[]}=t.payload,n=function(e,t){const r=new Map,a=e=>{r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(a),t.forEach(a);const n=[];return r.forEach((e,t)=>{1===e&&n.push(t)}),n}(r,a);if(!(n.length>0)&&function(e,t,r=V){if(e.length!==t.length)return!1;for(let a=0;ae!==n))});case f:return $({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case p:return $({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var a,n}function J(e=0,t){switch(t.type){case"dnd-core/ADD_SOURCE":case"dnd-core/ADD_TARGET":return e+1;case"dnd-core/REMOVE_SOURCE":case _:return e-1;default:return e}}function X(e=0){return e+1}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q(e){for(var t=1;te&&e[t]?e[t]:a||null,r))})}),dragOffset:W(e.dragOffset,t),refCount:J(e.refCount,t),dragOperation:q(e.dragOperation,t),stateId:X(e.stateId)};var r,a}function te(e,t,r={},a=!1){const n=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return l(ee,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(a),i=new D(n,new H(n)),o=new j(n,i),s=e(o,t,r);return o.receiveBackend(s),o}},,,function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return c}));var a=r(37),n=r(73),i=r(1),o=r(35);let s=0;const l=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var c=Object(i.memo)((function(e){var{children:t}=e,r=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,["children"]);const[c,g]=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];return[function(e,t=u(),r,a){const i=t;return i[l]||(i[l]={dragDropManager:Object(n.a)(e,t,r,a)}),i[l]}(e.backend,e.context,e.options,e.debugMode),!e.context]}(r);return Object(i.useEffect)(()=>{if(g){const e=u();return++s,()=>{0==--s&&(e[l]=null)}}},[]),Object(a.jsx)(o.a.Provider,{value:c,children:t})}));function u(){return void 0!==e?e:window}}).call(this,r(30))}]); \ No newline at end of file +/* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":e?Object(c.sprintf)(Object(c.__)("%s Units","generatepress"),a):a,onClick:function(){r(e),n()}},i))})))}}))}),Un=function(e){var t=e.label,r=e.unitValue,a=e.units,n=e.onChangeUnit,i=e.step,l=e.rangeMin,c=e.rangeMax,u=e.inputMin,g=void 0===u?null:u,d=e.inputMax,f=void 0===d?null:d,p=e.desktopValue,v=e.desktopInitial,h=e.desktopOnChange,y=e.tabletValue,m=e.tabletInitial,b=e.tabletOnChange,O=e.mobileInitial,S=e.mobileValue,w=e.mobileOnChange;return Object(o.createElement)(s.BaseControl,null,Object(o.createElement)(Dn,{label:t,value:r,devices:["desktop","tablet","mobile"]}),Object(o.createElement)("div",{className:"generate-component-input-with-unit"},Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"desktop"},Object(o.createElement)(Vn,{className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(p)?parseFloat(p):v,initialPosition:v,onChange:h,withInputField:!1})),Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"tablet"},Object(o.createElement)(Vn,{"data-generate-control-device":"tablet",className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(y)?parseFloat(y):m,initialPosition:m,onChange:b,withInputField:!1})),Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"mobile"},Object(o.createElement)(Vn,{"data-generate-control-device":"mobile",className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(S)?parseFloat(S):O,initialPosition:O,onChange:w,withInputField:!1})),Object(o.createElement)(zn,{value:r,units:a,onClick:n})))},Gn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Font size","generatepress"),unitValue:t.fontSizeUnit,units:["px","em","rem","%"],onChangeUnit:function(e){r("fontSizeUnit",e,t.index)},step:vn(t,"fontSize","step",1),rangeMin:vn(t,"fontSize","min",1),rangeMax:vn(t,"fontSize","max",100),inputMin:0,desktopValue:t.fontSize,desktopInitial:pn(t,"fontSize"),desktopOnChange:function(e){r("fontSize",e,t.index)},tabletValue:t.fontSizeTablet,tabletInitial:pn(t,"fontSizeTablet"),tabletOnChange:function(e){r("fontSizeTablet",e,t.index)},mobileValue:t.fontSizeMobile,mobileInitial:pn(t,"fontSizeMobile"),mobileOnChange:function(e){r("fontSizeMobile",e,t.index)}})},Wn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Line Height","generatepress"),unitValue:t.lineHeightUnit,units:["","px","em","rem"],onChangeUnit:function(e){r("lineHeightUnit",e,t.index)},step:vn(t,"lineHeight","step",.1),rangeMin:vn(t,"lineHeight","min",1),rangeMax:vn(t,"lineHeight","max",5),inputMin:0,desktopValue:t.lineHeight,desktopInitial:pn(t,"lineHeight"),desktopOnChange:function(e){r("lineHeight",e,t.index)},tabletValue:t.lineHeightTablet,tabletInitial:pn(t,"lineHeightTablet"),tabletOnChange:function(e){r("lineHeightTablet",e,t.index)},mobileValue:t.lineHeightMobile,mobileInitial:pn(t,"lineHeightMobile"),mobileOnChange:function(e){r("lineHeightMobile",e,t.index)}})},Kn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Letter Spacing","generatepress"),unitValue:t.letterSpacingUnit,units:["px","em","rem"],onChangeUnit:function(e){r("letterSpacingUnit",e,t.index)},step:vn(t,"letterSpacing","step",.01),rangeMin:vn(t,"letterSpacing","min",-1),rangeMax:vn(t,"letterSpacing","max",10),desktopValue:t.letterSpacing,desktopInitial:pn(t,"letterSpacing"),desktopOnChange:function(e){r("letterSpacing",e,t.index)},tabletValue:t.letterSpacingTablet,tabletInitial:pn(t,"letterSpacingTablet"),tabletOnChange:function(e){r("letterSpacingTablet",e,t.index)},mobileValue:t.letterSpacingMobile,mobileInitial:pn(t,"letterSpacingMobile"),mobileOnChange:function(e){r("letterSpacingMobile",e,t.index)}})},$n=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:"body"===t.selector?Object(c.__)("Paragraph Bottom Margin","generatepress"):Object(c.__)("Bottom Margin","generatepress"),unitValue:t.marginBottomUnit,units:["px","em","rem"],onChangeUnit:function(e){r("marginBottomUnit",e,t.index)},step:vn(t,"marginBottom","step",.1),rangeMin:vn(t,"marginBottom","min",0),rangeMax:vn(t,"marginBottom","max",5),inputMin:0,desktopValue:t.marginBottom,desktopInitial:pn(t,"marginBottom"),desktopOnChange:function(e){0>e&&(e=0),r("marginBottom",e,t.index)},tabletValue:t.marginBottomTablet,tabletInitial:pn(t,"marginBottomTablet"),tabletOnChange:function(e){0>e&&(e=0),r("marginBottomTablet",e,t.index)},mobileValue:t.marginBottomMobile,mobileInitial:pn(t,"marginBottomMobile"),mobileOnChange:function(e){0>e&&(e=0),r("marginBottomMobile",e,t.index)}})},Yn=function(e){var t=e.index,r=e.value,a=e.onChange;return Object(o.createElement)(s.SelectControl,{label:Object(c.__)("Text Decoration","generatepress"),value:r,options:[{value:"",label:Object(c.__)("Default","generatepress")},{value:"none",label:Object(c.__)("None","generatepress")},{value:"underline",label:Object(c.__)("Underline","generatepress")}],onChange:function(e){a("textDecoration",e,t)}})},qn=function(e){var t=e.font,r=e.toggleClose,a=e.onChangeFontValue,n=e.onChangeElement;return Object(o.createElement)("div",{className:"generate-customize-control--font-dropdown"},Object(o.createElement)(wn,{index:t.index,value:t.selector,onChange:n}),!!t.selector&&Object(o.createElement)(o.Fragment,null,"custom"===t.selector&&Object(o.createElement)(Cn,{index:t.index,value:t.customSelector,onChange:a}),Object(o.createElement)(xn,{index:t.index,value:t.fontFamily,onChange:a}),Object(o.createElement)("div",{className:"components-base-control generate-font-manager--select-options"},Object(o.createElement)(En,{index:t.index,value:t.fontWeight,fontFamily:t.fontFamily,onChange:a}),Object(o.createElement)(Nn,{index:t.index,value:t.textTransform,onChange:a}),Object(o.createElement)(Tn,{index:t.index,value:t.fontStyle,onChange:a}),Object(o.createElement)(Yn,{index:t.index,value:t.textDecoration,onChange:a})),Object(o.createElement)(Gn,{font:t,onChange:a}),Object(o.createElement)(Wn,{font:t,onChange:a}),Object(o.createElement)(Kn,{font:t,onChange:a}),hn(t.selector)&&Object(o.createElement)($n,{font:t,onChange:a})),Object(o.createElement)("div",{className:"generate-font-manager--footer"},Object(o.createElement)(s.Button,{isSecondary:!0,isSmall:!0,onClick:r},Object(c.__)("Close","generatepress"))))},Jn=function(e){var t=e.font,r=e.label,a=e.itemId,n=e.setOpen,i=e.isOpen,s=e.deleteFont,l=e.toggleClose,c=e.onChangeFontValue,u=e.onChangeElement;return Object(o.createElement)("div",{className:"generate-font-manager--item"},Object(o.createElement)("div",{className:"generate-font-manager--header"},Object(o.createElement)(bn,{font:t,itemId:a,setOpen:n,isOpen:i,label:r}),Object(o.createElement)(On,{itemId:a,setOpen:n,isOpen:i}),Object(o.createElement)(Sn,{onClick:s.bind(null,t.index),isOpen:i,itemId:a})),a===i&&Object(o.createElement)(qn,{font:t,toggleClose:l,onChangeFontValue:c,onChangeElement:u}))},Xn=function(e){var t,r,a=e.fontList,n=("group","other",a.reduce((function(e,t,r){var a=t.group||"other";return t.index=r,e[a]=e[a]||[],e[a].push(t),e}),{}));return t=yn(),r=function(t,r){var a,s=null!==(a=n[r])&&void 0!==a?a:[];if(0!==s.length)return Object(o.createElement)("div",{className:"generate-font-manager-group",key:r},Object(o.createElement)("h4",{className:"generate-font-manager-group__label"},t),s.map((function(t){return Object(o.createElement)(Jn,i()({key:t.index,itemId:t.index+1,font:t},e))})))},Object.values(Object.fromEntries(Object.entries(t).map((function(e){var t=g()(e,2),a=t[0],n=t[1];return[a,r(n,a)]}))))};function Zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Qn(e){for(var t=1;t0&&v.push({label:Object(c.__)("Google Fonts","generatepress"),options:Object.keys(_e).map((function(e){return{value:e,label:e}}))}),d.forEach((function(e){var t=e.googleFont&&generateCustomizerControls.showGoogleFonts&&p.length>0?1:0;v[t].options=v[t].options.filter((function(t){return t.value!==e.fontFamily}))})),Object(o.createElement)("div",null,Object(o.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),!!d.length>0&&d.map((function(t,r){var g=r+1,f=function(e){var t=Pe()(d),a=t[r];t[r]=un(un({},t[r]),{},{fontFamily:e}),i(t),void 0!==_e[e]&&generateCustomizerControls.showGoogleFonts?(t[r]=un(un({},t[r]),{},{googleFont:!0,googleFontCategory:_e[e].category,googleFontVariants:_e[e].variants.join(", ")}),i(t)):(t[r]=un(un({},t[r]),{},{googleFont:!1,googleFontCategory:"",googleFontVariants:""}),i(t)),l(t[r].fontFamily,a.fontFamily)},p=d[r].fontFamily||"";return Object(o.createElement)("div",{className:"generate-font-manager--item",key:r},Object(o.createElement)("div",{className:"generate-font-manager--header"},Object(o.createElement)(s.Button,{className:"generate-font-manager--label",onClick:function(){n(g!==a&&g)}},d[r].fontFamily?d[r].fontFamily:e.label),Object(o.createElement)(s.Tooltip,{text:Object(c.__)("Open Font Family Settings","generatepress")},Object(o.createElement)(s.Button,{className:"generate-font-manager--open",onClick:function(){n(g!==a&&g)}},we(g===a?"chevron-up":"chevron-down"))),Object(o.createElement)(s.Tooltip,{text:Object(c.__)("Delete Font Family","generatepress")},Object(o.createElement)(s.Button,{className:"generate-font-manager--delete-font",onClick:function(){if(window.confirm(Object(c.__)("This will permanently delete this font family. Doing so will stop elements from displaying it as their font.","generatepress"))){var e=Pe()(d),t=e[r];l("",t.fontFamily),e.splice(r,1),i(e)}}},we("trash")))),g===a&&Object(o.createElement)("div",{className:"generate-customize-control--font-dropdown"},Object(o.createElement)(s.BaseControl,{className:"generate-component-font-family-picker-wrapper",id:"generate-font-manager-family-name--input"},Object(o.createElement)(sn,{options:v,placeholder:Object(c.__)("Search fonts…","generatepress"),onChange:function(e){return f(e.value)}}),Object(o.createElement)(s.TextControl,{id:"generate-font-manager-family-name--input",className:"generate-font-manager-family-name--input",label:Object(c.__)("Font family name","generatepress"),value:p,onChange:function(e){var t;t=e,d.filter((function(e){return e.fontFamily===t})).length>0&&(alert(Object(c.__)("Font already selected","generatepress")),e=""),f(e)}}),!!d[r].fontFamily&&!!generateCustomizerControls.showGoogleFonts&&Object(o.createElement)("div",{className:"generate-font-manager--options"},Object(o.createElement)(s.ToggleControl,{className:"generate-font-manager-google-font--field",label:Object(c.__)("Use Google Fonts API","generatepress"),checked:!!d[r].googleFont,onChange:function(e){var t=Pe()(d);t[r]=un(un({},t[r]),{},{googleFont:e}),i(t)}}),!!d[r].googleFont&&Object(o.createElement)("div",{className:"generate-font-manager--google-font-options"},Object(o.createElement)(s.TextControl,{label:Object(c.__)("Category","generatepress"),value:d[r].googleFontCategory||"",onChange:function(e){var t=Pe()(d);t[r]=un(un({},t[r]),{},{googleFontCategory:e}),i(t)}}),Object(o.createElement)(s.TextControl,{label:Object(c.__)("Variants","generatepress"),value:d[r].googleFontVariants||"",onChange:function(e){var t=Pe()(d);t[r]=un(un({},t[r]),{},{googleFontVariants:e}),i(t)}}))),Object(o.createElement)("div",{className:"generate-font-manager--footer"},Object(o.createElement)(s.Button,{isSecondary:!0,isSmall:!0,onClick:u},Object(c.__)("Close","generatepress"))))))})),Object(o.createElement)(s.Button,{isPrimary:!0,onClick:function(){var t=Pe()(e.value);t.push({fontFamily:"",googleFont:!1,googleFontApi:1,googleFontCategory:"",googleFontVariants:""}),i(t);var r=wp.customize.control(e.customizerSetting.id).setting.get().length;n(r)}},Object(c.__)("Add Font","generatepress")))})),ti=l((function(e){var t=e.value,r=Object(o.useState)([]),a=g()(r,2),n=a[0],i=a[1],l=Object(o.useState)(0),u=g()(l,2),d=u[0],f=u[1],p=Object(o.useState)(!1),v=g()(p,2),h=v[0],y=v[1];Object(o.useEffect)((function(){Array.isArray(t)?i(t):"object"===De()(t)&&i(Object.values(t))}),[t]),Object(o.useEffect)((function(){var t=h?"refresh":"postMessage";wp.customize.control(e.customizerSetting.id).setting.transport=t,wp.customize.control(e.customizerSetting.id).setting.set(n)}),[n]);var m=fn(),b=function(e){y(!0),i(e)};return Object(o.createElement)("div",null,Object(o.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),Object(o.createElement)(Xn,{fontList:n,setOpen:f,isOpen:d,label:e.label,deleteFont:function(e){var t=Pe()(n);t.splice(e,1),b(t)},toggleClose:function(){return f(0)},onChangeFontValue:function(e,t,r){var a=Pe()(n);a[r]=Qn({},a[r]),a[r][e]=t,b(a)},onChangeElement:function(e,t){var r=e.value,a=e.group,i=e.module,o=Pe()(n);o[t]=Qn(Qn({},o[t]),{},{selector:r,module:i,group:a});var s=m[r].placeholders;s&&Object.keys(s).forEach((function(e){var a=m[r].placeholders[e].unit;if(a){var n=e+"Unit";o[t]=Qn(Qn({},o[t]),{},Ie()({},n,a))}})),hn(r)||(o[t]=Qn(Qn({},o[t]),{},{marginBottom:"",marginBottomTablet:"",marginBottomMobile:"",marginBottomUnit:""})),b(o)}}),Object(o.createElement)(s.Button,{isPrimary:!0,onClick:function(){var t=Pe()(e.value);t.push({selector:"",customSelector:"",fontFamily:"",fontWeight:"",textTransform:"",textDecoration:"",fontStyle:"",fontSize:"",fontSizeTablet:"",fontSizeMobile:"",fontSizeUnit:"px",lineHeight:"",lineHeightTablet:"",lineHeightMobile:"",lineHeightUnit:"",letterSpacing:"",letterSpacingTablet:"",letterSpacingMobile:"",letterSpacingUnit:"px"}),b(t),f(t.length)}},Object(c.__)("Add Typography","generatepress")))}));wp.customize.controlConstructor["generate-font-manager-control"]=ei,wp.customize.controlConstructor["generate-typography-control"]=ti,r(62);var ri=r(10);function ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function ni(e){for(var t=1;t(null==t&&(t=e()),t)}class vi{enter(e){const t=this.entered.length;return this.entered=function(e,t){const r=new Set,a=e=>r.add(e);e.forEach(a),t.forEach(a);const n=[];return r.forEach(e=>n.push(e)),n}(this.entered.filter(t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var r,a;return this.entered=(r=this.entered.filter(this.isNodeInDocument),a=e,r.filter(e=>e!==a)),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class hi{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get:()=>(console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null)})})}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach(r=>{const a=this.config.exposeProperties[r];null!=a&&(t[r]={value:a(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const yi="__NATIVE_FILE__",mi="__NATIVE_URL__",bi="__NATIVE_TEXT__",Oi="__NATIVE_HTML__";function Si(e,t,r){const a=t.reduce((t,r)=>t||e.getData(r),"");return null!=a?a:r}const wi={[yi]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Oi]:{exposeProperties:{html:(e,t)=>Si(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[mi]:{exposeProperties:{urls:(e,t)=>Si(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[bi]:{exposeProperties:{text:(e,t)=>Si(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Ci(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(wi).filter(e=>{const r=wi[e];return!!(null==r?void 0:r.matchesTypes)&&r.matchesTypes.some(e=>t.indexOf(e)>-1)})[0]||null}const xi=pi(()=>/firefox/i.test(navigator.userAgent)),ji=pi(()=>Boolean(window.safari));class Ei{interpolate(e){const{xs:t,ys:r,c1s:a,c2s:n,c3s:i}=this;let o=t.length-1;if(e===t[o])return r[o];let s,l=0,c=i.length-1;for(;l<=c;){s=Math.floor(.5*(l+c));const a=t[s];if(ae))return r[s];c=s-1}}o=Math.max(0,c);const u=e-t[o],g=u*u;return r[o]+a[o]*u+n[o]*g+i[o]*u*g}constructor(e,t){const{length:r}=e,a=[];for(let e=0;ee[t]{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,r){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);const a=t=>this.handleDragStart(t,e),n=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",a),t.addEventListener("selectstart",n),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",a),t.removeEventListener("selectstart",n),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const r=t=>this.handleDragEnter(t,e),a=t=>this.handleDragOver(t,e),n=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",r),t.addEventListener("dragover",a),t.addEventListener("drop",n),()=>{t.removeEventListener("dragenter",r),t.removeEventListener("dragover",a),t.removeEventListener("drop",n)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Ii({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return Ii({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(a).some(t=>a[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const r=wi[e];if(!r)throw new Error(`native type ${e} has no configuration`);const a=new hi(r);return a.loadDataTransfer(t),a}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&Ni(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{null===this.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{null!==this.hoverRafId&&"undefined"!=typeof cancelAnimationFrame&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const r=Ti(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=e,n=Ci(a);if(this.monitor.isDragging()){if(a&&"function"==typeof a.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),n=this.sourcePreviewNodes.get(e)||t;if(n){const{anchorX:e,anchorY:i,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),l=function(e,t,r,a,n){const i="IMG"===(o=t).nodeName&&(xi()||!(null===(s=document.documentElement)||void 0===s?void 0:s.contains(o)));var o,s;const l=Ni(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:g}=e,{anchorX:d,anchorY:f}=a,{dragPreviewWidth:p,dragPreviewHeight:v}=function(e,t,r,a){let n=e?t.width:r,i=e?t.height:a;return ji()&&e&&(i/=window.devicePixelRatio,n/=window.devicePixelRatio),{dragPreviewWidth:n,dragPreviewHeight:i}}(i,t,u,g),{offsetX:h,offsetY:y}=n,m=0===y||y;return{x:0===h||h?h:new Ei([0,.5,1],[c.x,c.x/u*p,c.x+p-u]).interpolate(d),y:m?y:(()=>{let e=new Ei([0,.5,1],[c.y,c.y/g*v,c.y+v-g]).interpolate(f);return ji()&&i&&(e+=(window.devicePixelRatio-1)*v),e})()}}(t,n,r,{anchorX:e,anchorY:i},{offsetX:o,offsetY:s});a.setDragImage(n,l.x,l.y)}}try{null==a||a.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(n)this.beginDragNativeItem(n);else{if(a&&!a.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{var t;if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)),!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:r}=e,a=Ci(r);a&&this.beginDragNativeItem(a,r)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:Ti(e)}),t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{var t;this.dragOverTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=Ti(e),this.scheduleHover(t),(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{var t;this.dropTargetIds=[],this.isDraggingNativeItem()?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Ci(e.dataTransfer)&&e.preventDefault(),this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:Ti(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{const t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new Di(t,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new vi(this.isNodeInDocument)}}const Pi=function(e,t,r){return new ki(e,t,r)};var _i=r(36),Ri=r.n(_i);const Li="undefined"!=typeof window?f.useLayoutEffect:f.useEffect;function Ai(e,t,r){return function(e,t,r){const[a,n]=function(e,t,r){const[a,n]=Object(f.useState)(()=>t(e)),i=Object(f.useCallback)(()=>{const i=t(e);Ri()(a,i)||(n(i),r&&r())},[a,e,r]);return Li(i),[a,i]}(e,t,r);return Li((function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(n,{handlerIds:[t]})}),[e,n]),a}(t,e||(()=>({})),()=>r.reconnect())}function Fi(e,t){const r=[...t||[]];return null==t&&"function"!=typeof e&&r.push(e),Object(f.useMemo)(()=>"function"==typeof e?e():e,r)}function Bi(e){return Object(f.useMemo)(()=>e.hooks.dropTarget(),[e])}function Hi(e,t,r,a){let n=r?r.call(a,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o{const a=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const e=function(e){return(t=null,r=null)=>{if(!Object(f.isValidElement)(t)){const a=t;return e(a,r),a}const a=t;return function(e){if("string"==typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a
, or turn it into a drag source or a drop target itself.`)}(a),function(e,t){const r=e.ref;return Object(zi.a)("string"!=typeof r,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?Object(f.cloneElement)(e,{ref:e=>{Gi(r,e),Gi(t,e)}}):Object(f.cloneElement)(e,{ref:t})}(a,r?t=>e(t,r):e)}}(a);t[r]=()=>e}}),t}function Gi(e,t){"function"==typeof e?e(t):e.current=t}class Wi{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Hi(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Ui({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,Vi(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}var Ki=r(35);function $i(){const{dragDropManager:e}=Object(f.useContext)(Ki.a);return Object(zi.a)(null!=e,"Expected drag drop context"),e}let Yi=!1;class qi{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;Object(zi.a)(!Yi,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Yi=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Yi=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}class Ji{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function Xi(e,t){const r=Fi(e,t),a=function(){const e=$i();return Object(f.useMemo)(()=>new qi(e),[e])}(),n=function(e){const t=$i(),r=Object(f.useMemo)(()=>new Wi(t.getBackend()),[t]);return Li(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}(r.options);return function(e,t,r){const a=$i(),n=function(e,t){const r=Object(f.useMemo)(()=>new Ji(e,t),[t]);return Object(f.useEffect)(()=>{r.spec=e},[e]),r}(e,t),i=function(e){const{accept:t}=e;return Object(f.useMemo)(()=>(Object(zi.a)(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}(e);Li((function(){const[e,o]=function(e,t,r){const a=r.getRegistry(),n=a.addTarget(e,t);return[n,()=>a.removeTarget(n)]}(i,n,a);return t.receiveHandlerId(e),r.receiveHandlerId(e),o}),[a,t,n,r,i.map(e=>e.toString()).join("|")])}(r,a,n),[Ai(r.collect,a,n),Bi(n)]}function Zi(e){return Object(f.useMemo)(()=>e.hooks.dragSource(),[e])}function Qi(e){return Object(f.useMemo)(()=>e.hooks.dragPreview(),[e])}class eo{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();r&&this.disconnectDragPreview(),this.handlerId&&(t?r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Hi(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Hi(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Ui({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,Vi(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,Vi(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}let to=!1,ro=!1;class ao{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){Object(zi.a)(!to,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return to=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{to=!1}}isDragging(){if(!this.sourceId)return!1;Object(zi.a)(!ro,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return ro=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{ro=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}class no{beginDrag(){const e=this.spec,t=this.monitor;let r=null;return r="object"==typeof e.item?e.item:"function"==typeof e.item?e.item(t):{},null!=r?r:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const r=this.spec,a=this.monitor,{isDragging:n}=r;return n?n(a):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,r=this.connector,{end:a}=e;a&&a(t.getItem(),t),r.reconnect()}constructor(e,t,r){this.spec=e,this.monitor=t,this.connector=r}}function io(e,t){const r=Fi(e,t);Object(zi.a)(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const a=function(){const e=$i();return Object(f.useMemo)(()=>new ao(e),[e])}(),n=function(e,t){const r=$i(),a=Object(f.useMemo)(()=>new eo(r.getBackend()),[r]);return Li(()=>(a.dragSourceOptions=e||null,a.reconnect(),()=>a.disconnectDragSource()),[a,e]),Li(()=>(a.dragPreviewOptions=t||null,a.reconnect(),()=>a.disconnectDragPreview()),[a,t]),a}(r.options,r.previewOptions);return function(e,t,r){const a=$i(),n=function(e,t,r){const a=Object(f.useMemo)(()=>new no(e,t,r),[t,r]);return Object(f.useEffect)(()=>{a.spec=e},[e]),a}(e,t,r),i=function(e){return Object(f.useMemo)(()=>{const t=e.type;return Object(zi.a)(null!=t,"spec.type must be defined"),t},[e])}(e);Li((function(){if(null!=i){const[e,o]=function(e,t,r){const a=r.getRegistry(),n=a.addSource(e,t);return[n,()=>a.removeSource(n)]}(i,n,a);return t.receiveHandlerId(e),r.receiveHandlerId(e),o}}),[a,t,r,n,i])}(r,a,n),[Ai(r.collect,a,n),Zi(n),Qi(n)]}function oo(e){var t=e.id,r=e.itemType,a=e.onDrop,n=e.getIndex,i=e.className,s=e.innerComponentProps,l=e.InnerComponent,c=io((function(){return{type:r,item:{id:t},collect:function(e){return{isDragging:e.isDragging()}}}}),[t]),u=g()(c,2),d=u[0].isDragging,f=u[1],p=Xi((function(){return{accept:r,hover:function(e){var r=e.id;if(r!==t){var i=n(t);a(r,i)}}}}),[n,a]),v=g()(p,2)[1],h=d?"0.2":1;return Object(o.createElement)("div",{ref:function(e){return f(v(e))},className:i,style:{opacity:h}},l&&Object(o.createElement)(l,s))}function so(e){var t=e.data,r=e.itemIdKey,a=e.onDrop,n=e.getIndex,i=e.itemType,s=e.listClassName,l=e.itemClassName,c=e.InnerComponent,u=Xi((function(){return{accept:i}})),d=g()(u,2)[1];return Object(o.createElement)("div",{ref:d,className:s},t&&t.map((function(e){return Object(o.createElement)(oo,{key:e[r],id:e[r],itemType:i,className:l,onDrop:a,getIndex:n,InnerComponent:c,innerComponentProps:{item:e}})})))}function lo(e){var t=e.idKey,r=void 0===t?"id":t,a=e.acceptedType,n=void 0===a?"simple-list-item":a,i=e.listData,s=void 0===i?[]:i,l=e.onChangeData,c=e.listClassName,u=void 0===c?"":c,d=e.itemClassName,f=void 0===d?"":d,p=e.InnerComponent,v=Object(o.useState)([]),h=g()(v,2),y=h[0],m=h[1];Object(o.useEffect)((function(){m(s)}),[JSON.stringify(s)]),Object(o.useEffect)((function(){l(y)}),[JSON.stringify(y)]);var b=Object(o.useCallback)((function(e){var t=y.find((function(t){return e===t[r]}));return y.indexOf(t)}),[JSON.stringify(y)]),O=Object(o.useCallback)((function(e,t){var r=b(e);m(function(e,t,r){var a=Array.from(e),n=a.splice(t,1),i=g()(n,1)[0];return a.splice(r,0,i),a}(y,r,t))}),[JSON.stringify(y)]);return Object(o.createElement)(fi.a,{backend:Pi},Object(o.createElement)(so,{data:y,itemIdKey:r,onDrop:O,getIndex:b,itemType:n,listClassName:u,itemClassName:f,InnerComponent:p}))}function co(e){var t=e.item;return Object(o.createElement)(s.Tooltip,{text:t.slug,position:"top center"},Object(o.createElement)("span",{style:{backgroundColor:t.color}}))}var uo=l((function(e){var t=function(){var e=Object(o.useReducer)(si,oi),t=g()(e,2),r=t[0],a=t[1];return{colors:r,setColors:function(e){return a({type:"SET_COLORS",payload:e})},addColor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return a({type:"ADD_COLOR",payload:Object.assign({},ii,{slug:e,color:t})})},deleteColor:function(e){return a({type:"DELETE_COLOR",payload:e})},updateColorValue:function(e,t){return a({type:"UPDATE_COLOR_VALUE",payload:{slug:e,value:t}})},updateColorSlug:function(e,t){return a({type:"UPDATE_COLOR_SLUG",payload:{slug:e,value:t}})}}}(),r=t.colors,a=t.setColors,n=t.addColor,i=t.deleteColor,s=t.updateColorValue,l=t.updateColorSlug,u=Object(o.useState)(!1),d=g()(u,2),f=d[0],p=d[1],v=Object(o.useState)(!1),h=g()(v,2),y=h[0],m=h[1],b=Object(o.useState)([]),O=g()(b,2),S=O[0],w=O[1];Object(o.useEffect)((function(){var t=Object(ri.isObject)(e.value)?Object.values(e.value):e.value;a(t),p(!0)}),[]),Object(o.useEffect)((function(){var t,a;f&&(a=[],(t=r).length>0&&t.forEach((function(e){a.push({name:e.slug,slug:e.slug,color:"var(--"+e.slug+")"})})),window.sessionStorage.setItem("generateGlobalColors",JSON.stringify(a)),function(t){wp.customize.control(e.customizerSetting.id).setting.set(t);var r=":root {";t.length>0&&t.forEach((function(e){var t=e.slug.replace(" ","-").toLowerCase();r+="--"+t+": "+e.color+";"})),r+="}";var a=document.getElementById("generate-global-color-styles");a?a.innerHTML=r:document.body.insertAdjacentHTML("beforeend",'")}(r))}),[JSON.stringify(r),f]);var C=Object(o.useCallback)((function(){n(function e(t){var a="global-color-".concat(t+1);return-1===Object(ri.findIndex)(r,{slug:a})?a:e(t+1)}(r.length))}),[r.length]);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),Object(o.createElement)("div",{className:"generate-color-manager-wrapper"},Object(o.createElement)("div",{className:"generate-color-manager--item"},Object(o.createElement)(ui,{onClick:C,disabled:y})),Object(o.createElement)("div",{className:"generate-color-manager--item"},Object(o.createElement)(li,{id:"add-color",icon:y?"check":"reorder",text:y?Object(c.__)("Finish re-ordering","generateblocks"):Object(c.__)("Re-order colors","generateblocks"),onClick:function(e){e.preventDefault(),y&&(a(S),window.sessionStorage.setItem("generateGlobalColors",JSON.stringify(S))),m(!y)}}))),y?Object(o.createElement)(lo,{listData:r,idKey:"slug",listClassName:"generate-color-manager-dnd-list",itemClassName:"generate-color-manager-dnd-list-item",InnerComponent:co,onChangeData:w}):Object(o.createElement)(di,{colors:r,onChangeColor:s,onChangeSlug:l,onClickDeleteColor:i}))}));wp.customize.controlConstructor["generate-color-manager-control"]=uo,r(65);var go=function(e){var t=Object(o.useState)(!1),r=g()(t,2),a=r[0],n=r[1],i=function(){e.choices.sectionRedirect?wp.customize.section(e.choices.toggleId).focus():document.querySelectorAll('[data-toggleId="'+e.choices.toggleId+'"]').forEach((function(e){a?(e.style.display="",n(!1)):(e.style.display="block",n(!0))}))},l=e.choices.tooltipText?e.choices.tooltipText:Object(c.sprintf)(Object(c.__)("Open %s Settings","generatepress"),e.choices.title),u=e.choices.sectionRedirect?"chevron-right":"chevron-down";return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"generate-customize-control-title"},!!e.choices.toggleId&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.Tooltip,{text:l},Object(o.createElement)(s.Button,{className:"generate-customize-control-title--label",onClick:i},e.choices.title)),Object(o.createElement)(s.Tooltip,{text:l},Object(o.createElement)(s.Button,{className:"generate-customize-control-title--toggle",onClick:i},we(a?"chevron-up":u)))),!e.choices.toggleId&&Object(o.createElement)("h3",null,e.choices.title)))},fo=wp.customize.Control.extend({ready:function(){this.renderContent()},embed:function(){var e=this,t=e.section();t&&wp.customize.section(t,(function(t){t.expanded.bind((function(t){t&&e.actuallyEmbed()}))}))},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve())},initialize:function(e,t){var r=this;r.setNotificationContainer=r.setNotificationContainer.bind(r),wp.customize.Control.prototype.initialize.call(r,e,t),wp.customize.control.bind("removed",(function e(t){r===t&&(r.destroy(),r.container.remove(),wp.customize.control.unbind("removed",e))}))},setNotificationContainer:function(e){this.notifications.container=jQuery(e),this.notifications.render()},renderContent:function(){var e=Object(o.createElement)(s.SlotFillProvider,null,Object(o.createElement)(go,i()({},this.params,{control:this,choices:this.params.choices,title:this.params.title})),Object(o.createElement)(s.Popover.Slot,null)),t=this.container[0];if(this.params.choices.wrapper){var r=document.getElementById(this.params.choices.wrapper+"--wrapper");r&&(t=r,this.container.hide())}Object(o.render)(e,t)},destroy:function(){Object(o.unmountComponentAtNode)(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["generate-title-control"]=fo;var po=r(38),vo=r.n(po),ho=wp.customize.Control.extend({ready:function(){this.renderContent()},embed:function(){var e=this,t=e.section();t&&wp.customize.section(t,(function(t){t.expanded.bind((function(t){t&&e.actuallyEmbed()}))}))},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve())},initialize:function(e,t){var r=this;r.setNotificationContainer=r.setNotificationContainer.bind(r),wp.customize.Control.prototype.initialize.call(r,e,t),wp.customize.control.bind("removed",(function e(t){r===t&&(r.destroy(),r.container.remove(),wp.customize.control.unbind("removed",e))}))},setNotificationContainer:function(e){this.notifications.container=jQuery(e),this.notifications.render()},renderContent:function(){var e=this.params.choices;this.params.choices.toggleId&&this.container[0].setAttribute("data-toggleId",this.params.choices.toggleId),Object(o.render)(Object(o.createElement)("div",{className:vo()(Ie()({"generate-customize-control-wrapper":!0},e.class,!!e.class)),id:e.id,"data-wrapper-type":e.type},e.items.map((function(e){return Object(o.createElement)("div",{key:e,id:e+"--wrapper"})}))),this.container[0])},destroy:function(){Object(o.unmountComponentAtNode)(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["generate-wrapper-control"]=ho,document.addEventListener("DOMContentLoaded",(function(){window.sessionStorage.removeItem("generateGlobalColors")}))},,,function(e,t,r){"use strict";function a(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}r.d(t,"a",(function(){return te})),r(8);var n="function"==typeof Symbol&&Symbol.observable||"@@observable",i=function(){return Math.random().toString(36).substring(7).split("").join(".")},o={INIT:"@@redux/INIT"+i(),REPLACE:"@@redux/REPLACE"+i(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+i()}};function s(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function l(e,t,r){var i;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(a(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(a(1));return r(l)(e,t)}if("function"!=typeof e)throw new Error(a(2));var c=e,u=t,g=[],d=g,f=!1;function p(){d===g&&(d=g.slice())}function v(){if(f)throw new Error(a(3));return u}function h(e){if("function"!=typeof e)throw new Error(a(4));if(f)throw new Error(a(5));var t=!0;return p(),d.push(e),function(){if(t){if(f)throw new Error(a(6));t=!1,p();var r=d.indexOf(e);d.splice(r,1),g=null}}}function y(e){if(!s(e))throw new Error(a(7));if(void 0===e.type)throw new Error(a(8));if(f)throw new Error(a(9));try{f=!0,u=c(u,e)}finally{f=!1}for(var t=g=d,r=0;r=0;a--)if(t.canDragSource(e[a])){r=e[a];break}return r}(t,o);if(null==l)return void e.dispatch(h);let d=null;if(n){if(!i)throw new Error("getSourceClientOffset must be defined");!function(e){Object(c.a)("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(i),d=i(l)}e.dispatch(v(n,d));const f=s.getSource(l).beginDrag(o,l);if(null==f)return;!function(e){Object(c.a)(u(e),"Item must be an object.")}(f),s.pinSource(l);const p=s.getSourceType(l);return{type:g,payload:{itemType:p,item:f,sourceId:l,clientOffset:n||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){for(var t=1;t{const o=function(e,t,r,a){const n=r.getTarget(e);let i=n?n.drop(a,e):void 0;return function(e){Object(c.a)(void 0===e||u(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:a.getDropResult()),i}(n,i,a,r),s={type:f,payload:{dropResult:b({},t,o)}};e.dispatch(s)})}}function S(e){return function(){const t=e.getMonitor(),r=e.getRegistry();!function(e){Object(c.a)(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const a=t.getSourceId();return null!=a&&(r.getSource(a,!0).endDrag(t,a),r.unpinSource()),{type:p}}}function w(e,t){return null===t?null===e:Array.isArray(e)?e.some(e=>e===t):e===t}function C(e){return function(t,{clientOffset:r}={}){!function(e){Object(c.a)(Array.isArray(e),"Expected targetIds to be an array.")}(t);const a=t.slice(0),n=e.getMonitor(),i=e.getRegistry();return function(e,t,r){for(let a=e.length-1;a>=0;a--){const n=e[a];w(t.getTargetType(n),r)||e.splice(a,1)}}(a,i,n.getItemType()),function(e,t,r){Object(c.a)(t.isDragging(),"Cannot call hover while not dragging."),Object(c.a)(!t.didDrop(),"Cannot call hover after drop.");for(let t=0;t{const i=r[n];var o;return a[n]=(o=i,(...r)=>{const a=o.apply(e,r);void 0!==a&&t(a)}),a},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function E(e,t){return{x:e.x-t.x,y:e.y-t.y}}const N=[],T=[];N.__IS_NONE__=!0,T.__IS_ALL__=!0;class D{subscribeToStateChange(e,t={}){const{handlerIds:r}=t;Object(c.a)("function"==typeof e,"listener must be a function."),Object(c.a)(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;return this.store.subscribe(()=>{const t=this.store.getState(),n=t.stateId;try{n===a||n===a+1&&!function(e,t){return e!==N&&(e===T||void 0===t||(r=e,t.filter(e=>r.indexOf(e)>-1)).length>0);var r}(t.dirtyHandlerIds,r)||e()}finally{a=n}})}subscribeToOffsetChange(e){Object(c.a)("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{const r=this.store.getState().dragOffset;r!==t&&(t=r,e())})}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return Object(c.a)(t,"Expected to find a valid source. sourceId="+e),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);return Object(c.a)(t,"Expected to find a valid target. targetId="+e),!(!this.isDragging()||this.didDrop())&&(w(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);return Object(c.a)(t,"Expected to find a valid source. sourceId="+e),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:r}=t;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),n=this.getItemType();if(n&&!w(a,n))return!1;const i=this.getTargetIds();if(!i.length)return!1;const o=i.indexOf(e);return r?o===i.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:a}=e;return t&&r&&a?E((i=a,{x:(n=t).x+i.x,y:n.y+i.y}),r):null;var n,i}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:r}=e;return t&&r?E(t,r):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}var M=r(26);class I{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const k=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.indexthis.capacity){for(let t=0,r=e.length-this.index;t{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Object(M.a)(this.flush),this.requestErrorThrow=Object(M.b)(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},P=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new I(this.onError,e=>t[t.length]=e);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}(k.registerPendingError),_="dnd-core/REMOVE_TARGET";function R(e,t){t&&Array.isArray(e)?e.forEach(e=>R(e,!1)):Object(c.a)("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var L;!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(L||(L={}));let A=0;function F(e){switch(e[0]){case"S":return L.SOURCE;case"T":return L.TARGET;default:throw new Error("Cannot parse handler ID: "+e)}}function B(e,t){const r=e.entries();let a=!1;do{const{done:e,value:[,n]}=r.next();if(n===t)return!0;a=!!e}while(!a);return!1}class H{addSource(e,t){R(e),function(e){Object(c.a)("function"==typeof e.canDrag,"Expected canDrag to be a function."),Object(c.a)("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),Object(c.a)("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const r=this.addHandler(L.SOURCE,e,t);return this.store.dispatch(function(e){return{type:"dnd-core/ADD_SOURCE",payload:{sourceId:e}}}(r)),r}addTarget(e,t){R(e,!0),function(e){Object(c.a)("function"==typeof e.canDrop,"Expected canDrop to be a function."),Object(c.a)("function"==typeof e.hover,"Expected hover to be a function."),Object(c.a)("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const r=this.addHandler(L.TARGET,e,t);return this.store.dispatch(function(e){return{type:"dnd-core/ADD_TARGET",payload:{targetId:e}}}(r)),r}containsHandler(e){return B(this.dragSources,e)||B(this.dropTargets,e)}getSource(e,t=!1){return Object(c.a)(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return Object(c.a)(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return Object(c.a)(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return Object(c.a)(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return F(e)===L.SOURCE}isTargetId(e){return F(e)===L.TARGET}removeSource(e){var t;Object(c.a)(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:"dnd-core/REMOVE_SOURCE",payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},k.enqueueTask(P.create(t))}removeTarget(e){Object(c.a)(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:_,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);Object(c.a)(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){Object(c.a)(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,r){const a=function(e){const t=(A++).toString();switch(e){case L.SOURCE:return"S"+t;case L.TARGET:return"T"+t;default:throw new Error("Unknown Handler Role: "+e)}}(e);return this.types.set(a,t),e===L.SOURCE?this.dragSources.set(a,r):e===L.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const V=(e,t)=>e===t;function z(e=N,t){switch(t.type){case d:break;case"dnd-core/ADD_SOURCE":case"dnd-core/ADD_TARGET":case _:case"dnd-core/REMOVE_SOURCE":return N;case g:case"dnd-core/PUBLISH_DRAG_SOURCE":case p:case f:default:return T}const{targetIds:r=[],prevTargetIds:a=[]}=t.payload,n=function(e,t){const r=new Map,a=e=>{r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(a),t.forEach(a);const n=[];return r.forEach((e,t)=>{1===e&&n.push(t)}),n}(r,a);if(!(n.length>0)&&function(e,t,r=V){if(e.length!==t.length)return!1;for(let a=0;ae!==n))});case f:return $({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case p:return $({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var a,n}function J(e=0,t){switch(t.type){case"dnd-core/ADD_SOURCE":case"dnd-core/ADD_TARGET":return e+1;case"dnd-core/REMOVE_SOURCE":case _:return e-1;default:return e}}function X(e=0){return e+1}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q(e){for(var t=1;te&&e[t]?e[t]:a||null,r))})}),dragOffset:W(e.dragOffset,t),refCount:J(e.refCount,t),dragOperation:q(e.dragOperation,t),stateId:X(e.stateId)};var r,a}function te(e,t,r={},a=!1){const n=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return l(ee,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(a),i=new D(n,new H(n)),o=new j(n,i),s=e(o,t,r);return o.receiveBackend(s),o}},,,function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return c}));var a=r(37),n=r(73),i=r(1),o=r(35);let s=0;const l=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var c=Object(i.memo)((function(e){var{children:t}=e,r=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,["children"]);const[c,g]=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];return[function(e,t=u(),r,a){const i=t;return i[l]||(i[l]={dragDropManager:Object(n.a)(e,t,r,a)}),i[l]}(e.backend,e.context,e.options,e.debugMode),!e.context]}(r);return Object(i.useEffect)(()=>{if(g){const e=u();return++s,()=>{0==--s&&(e[l]=null)}}},[]),Object(a.jsx)(o.a.Provider,{value:c,children:t})}));function u(){return void 0!==e?e:window}}).call(this,r(30))}]); \ No newline at end of file diff --git a/readme.txt b/readme.txt index b0fb2003..6849683f 100644 --- a/readme.txt +++ b/readme.txt @@ -105,6 +105,7 @@ Release date: October 27, 2022 * Fix: WooCommerce single product schema itemtype * Fix: Post title font properties in the editor +* Fix: generate_font_manager_show_google_fonts filter = 3.2.0 = diff --git a/src/customizer-controls/font-manager/GeneratePressFontManagerControlForm.js b/src/customizer-controls/font-manager/GeneratePressFontManagerControlForm.js index 5251dc39..74fe9495 100644 --- a/src/customizer-controls/font-manager/GeneratePressFontManagerControlForm.js +++ b/src/customizer-controls/font-manager/GeneratePressFontManagerControlForm.js @@ -90,7 +90,7 @@ const GeneratePressFontManagerControlForm = ( props ) => { } fonts.forEach( ( font ) => { - const index = font.googleFont ? 1 : 0; + const index = font.googleFont && generateCustomizerControls.showGoogleFonts && googleFontOptions.length > 0 ? 1 : 0; fontFamilies[ index ].options = fontFamilies[ index ].options.filter( ( obj ) => obj.value !== font.fontFamily ); } ); @@ -116,7 +116,7 @@ const GeneratePressFontManagerControlForm = ( props ) => { handleChangeComplete( fontValues ); - if ( typeof googleFonts[ value ] !== 'undefined' ) { + if ( typeof googleFonts[ value ] !== 'undefined' && generateCustomizerControls.showGoogleFonts ) { fontValues[ index ] = { ...fontValues[ index ], googleFont: true, @@ -226,7 +226,7 @@ const GeneratePressFontManagerControlForm = ( props ) => { onChange={ onFontShortcut } /> - { !! fonts[ index ].fontFamily && + { !! fonts[ index ].fontFamily && !! generateCustomizerControls.showGoogleFonts &&
Date: Thu, 27 Oct 2022 10:13:55 -0700 Subject: [PATCH 8/8] Update readme.txt --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 6849683f..f1592887 100644 --- a/readme.txt +++ b/readme.txt @@ -105,7 +105,7 @@ Release date: October 27, 2022 * Fix: WooCommerce single product schema itemtype * Fix: Post title font properties in the editor -* Fix: generate_font_manager_show_google_fonts filter +* Fix: Error in Customizer when Google Fonts disabled = 3.2.0 =