Blocksy Companion - Version 1.8.23

Version Description

Download this release

Release Info

Developer creativethemeshq
Plugin Icon wp plugin Blocksy Companion
Version 1.8.23
Comparing to
See all releases

Code changes from version 1.8.22 to 1.8.23

Files changed (32) hide show
  1. blocksy-companion.php +1 -1
  2. framework/cli.php +2 -0
  3. framework/extensions/cookies-consent/extension.php +9 -1
  4. framework/extensions/cookies-consent/static/bundle/main.js +2 -2
  5. framework/extensions/cookies-consent/static/bundle/main.min.css +1 -1
  6. framework/extensions/cookies-consent/static/js/main.js +21 -0
  7. framework/extensions/cookies-consent/static/js/sync/helpers.js +14 -10
  8. framework/extensions/newsletter-subscribe/static/bundle/main.min.css +1 -1
  9. framework/extensions/product-reviews/static/bundle/main-admin.min.css +1 -1
  10. framework/extensions/product-reviews/static/bundle/main.min.css +1 -1
  11. framework/extensions/trending/static/bundle/main.min.css +1 -1
  12. framework/extensions/widgets/static/bundle/main.min.css +1 -1
  13. framework/features/account-auth.php +15 -0
  14. framework/features/customizer-options-manager.php +5 -23
  15. framework/features/google-analytics.php +1 -1
  16. framework/features/header.php +35 -14
  17. framework/features/header/header-options.php +15 -1
  18. framework/features/header/modal/login.php +1 -3
  19. framework/features/header/modal/lostpassword.php +1 -1
  20. framework/features/header/modal/register.php +1 -3
  21. framework/theme-integration.php +2 -2
  22. readme.txt +6 -1
  23. static/bundle/account-lazy.min.css +1 -1
  24. static/bundle/account.js +1 -1
  25. static/bundle/dashboard.min.css +1 -1
  26. static/bundle/main.min.css +1 -1
  27. static/bundle/options.js +10 -2
  28. static/bundle/options.min.css +1 -1
  29. static/bundle/sticky.js +1 -1
  30. static/js/frontend/account.js +3 -1
  31. static/js/frontend/sticky.js +26 -9
  32. static/js/options/CustomizerOptionsManager.js +18 -24
blocksy-companion.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Blocksy Companion
5
  Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
- Version: 1.8.22
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blocksy-companion
3
  /*
4
  Plugin Name: Blocksy Companion
5
  Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
+ Version: 1.8.23
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blocksy-companion
framework/cli.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace Blocksy;
4
 
 
5
  add_action('blocksy:customizer:load:before', function () {
6
  $_REQUEST['wp_customize'] = 'on';
7
  _wp_customize_include();
@@ -10,6 +11,7 @@ add_action('blocksy:customizer:load:before', function () {
10
 
11
  $wp_customize->wp_loaded();
12
  });
 
13
 
14
  class Cli {
15
  public function __construct() {
2
 
3
  namespace Blocksy;
4
 
5
+ /*
6
  add_action('blocksy:customizer:load:before', function () {
7
  $_REQUEST['wp_customize'] = 'on';
8
  _wp_customize_include();
11
 
12
  $wp_customize->wp_loaded();
13
  });
14
+ */
15
 
16
  class Cli {
17
  public function __construct() {
framework/extensions/cookies-consent/extension.php CHANGED
@@ -4,7 +4,15 @@ require_once dirname(__FILE__) . '/helpers.php';
4
 
5
  class BlocksyExtensionCookiesConsent {
6
  public static function should_display_notification() {
7
- return !isset($_COOKIE['blocksy_cookies_consent_accepted']);
 
 
 
 
 
 
 
 
8
  }
9
 
10
  public function __construct() {
4
 
5
  class BlocksyExtensionCookiesConsent {
6
  public static function should_display_notification() {
7
+ return ! isset($_COOKIE['blocksy_cookies_consent_accepted']);
8
+ }
9
+
10
+ public static function has_consent() {
11
+ return (
12
+ isset($_COOKIE['blocksy_cookies_consent_accepted'])
13
+ &&
14
+ $_COOKIE['blocksy_cookies_consent_accepted'] === 'true'
15
+ );
16
  }
17
 
18
  public function __construct() {
framework/extensions/cookies-consent/static/bundle/main.js CHANGED
@@ -1,8 +1,8 @@
1
- !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=window.ctEvents},function(e,t,n){var o,r;
2
  /*!
3
  * JavaScript Cookie v2.2.1
4
  * https://github.com/js-cookie/js-cookie
5
  *
6
  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
7
  * Released under the MIT license
8
- */!function(i){if(void 0===(r="function"==typeof(o=i)?o.call(t,n,t,e):o)||(e.exports=r),!0,e.exports=i(),!!0){var c=window.Cookies,a=window.Cookies=i();a.noConflict=function(){return window.Cookies=c,a}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var o in n)t[o]=n[o]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(o){function r(){}function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},r.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var c=JSON.stringify(n);/^[\{\[]/.test(c)&&(n=c)}catch(e){}n=o.write?o.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var u in i)i[u]&&(a+="; "+u,!0!==i[u]&&(a+="="+i[u].split(";")[0]));return document.cookie=t+"="+n+a}}function c(e,n){if("undefined"!=typeof document){for(var r={},i=document.cookie?document.cookie.split("; "):[],c=0;c<i.length;c++){var a=i[c].split("="),u=a.slice(1).join("=");n||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var f=t(a[0]);if(u=(o.read||o)(u,f)||t(u),n)try{u=JSON.parse(u)}catch(e){}if(r[f]=u,e===f)break}catch(e){}}return e?r[e]:r}}return r.set=i,r.get=function(e){return c(e,!1)},r.getJSON=function(e){return c(e,!0)},r.remove=function(t,n){i(t,"",e(n,{expires:-1}))},r.defaults={},r.withConverter=n,r}((function(){}))}))},function(e,t,n){"use strict";n.r(t),n.d(t,"onDocumentLoaded",(function(){return d}));var o=n(0),r=n.n(o),i=n(1),c=n.n(i);function a(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var f=function(e){27===e.keyCode&&s(document.querySelector(".cookie-notification"))},s=function(e){document.removeEventListener("keyup",f),e.classList.add("ct-fade-start"),requestAnimationFrame((function(){e.classList.remove("ct-fade-start"),e.classList.add("ct-fade-end"),p(e,(function(){e.parentNode.removeChild(e)}))}))},d=function(e){/comp|inter|loaded/.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",e,!1)},l=function(){var e,t=document.querySelector(".cookie-notification");t&&(c.a.get("blocksy_cookies_consent_accepted")?t.remove():(e=t,document.addEventListener("keyup",f),requestAnimationFrame((function(){e.classList.remove("ct-fade-in-start"),e.classList.add("ct-fade-in-end"),p(e,(function(){e.classList.remove("ct-fade-in-end")}))})),a(t.querySelectorAll("button")).map((function(e){e.addEventListener("click",(function(n){if(n.preventDefault(),e.classList.contains("ct-cookies-accept-button")){c.a.set("blocksy_cookies_consent_accepted","true",{expires:new Date(1*new Date+{onehour:36e5,oneday:864e5,oneweek:6048e5,onemonth:26784e5,threemonths:80352e5,sixmonths:160704e5,oneyear:31536e6,forever:864e9}[e.closest("[data-period]").dataset.period]),sameSite:"lax"})}s(t)}))}))))};function p(e,t){setTimeout((function(){t()}),300)}d((function(){l(),r.a&&r.a.on("blocksy:cookies:init",(function(){l()}))}))}]);
1
+ !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){var o,r;
2
  /*!
3
  * JavaScript Cookie v2.2.1
4
  * https://github.com/js-cookie/js-cookie
5
  *
6
  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
7
  * Released under the MIT license
8
+ */!function(i){if(void 0===(r="function"==typeof(o=i)?o.call(t,n,t,e):o)||(e.exports=r),!0,e.exports=i(),!!0){var c=window.Cookies,a=window.Cookies=i();a.noConflict=function(){return window.Cookies=c,a}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var o in n)t[o]=n[o]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(o){function r(){}function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},r.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var c=JSON.stringify(n);/^[\{\[]/.test(c)&&(n=c)}catch(e){}n=o.write?o.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var u in i)i[u]&&(a+="; "+u,!0!==i[u]&&(a+="="+i[u].split(";")[0]));return document.cookie=t+"="+n+a}}function c(e,n){if("undefined"!=typeof document){for(var r={},i=document.cookie?document.cookie.split("; "):[],c=0;c<i.length;c++){var a=i[c].split("="),u=a.slice(1).join("=");n||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var s=t(a[0]);if(u=(o.read||o)(u,s)||t(u),n)try{u=JSON.parse(u)}catch(e){}if(r[s]=u,e===s)break}catch(e){}}return e?r[e]:r}}return r.set=i,r.get=function(e){return c(e,!1)},r.getJSON=function(e){return c(e,!0)},r.remove=function(t,n){i(t,"",e(n,{expires:-1}))},r.defaults={},r.withConverter=n,r}((function(){}))}))},function(e,t){e.exports=window.ctEvents},function(e,t,n){"use strict";n.r(t),n.d(t,"onDocumentLoaded",(function(){return d}));var o=n(1),r=n.n(o),i=n(0),c=n.n(i);function a(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var s=function(e){27===e.keyCode&&f(document.querySelector(".cookie-notification"))},f=function(e){document.removeEventListener("keyup",s),e.classList.add("ct-fade-start"),requestAnimationFrame((function(){e.classList.remove("ct-fade-start"),e.classList.add("ct-fade-end"),p(e,(function(){e.parentNode.removeChild(e)}))}))},d=function(e){/comp|inter|loaded/.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",e,!1)},l=function(){var e,t=document.querySelector(".cookie-notification");t&&(c.a.get("blocksy_cookies_consent_accepted")?t.remove():(e=t,document.addEventListener("keyup",s),requestAnimationFrame((function(){e.classList.remove("ct-fade-in-start"),e.classList.add("ct-fade-in-end"),p(e,(function(){e.classList.remove("ct-fade-in-end")}))})),a(t.querySelectorAll("button")).map((function(e){e.addEventListener("click",(function(n){if(n.preventDefault(),e.classList.contains("ct-cookies-accept-button")){c.a.set("blocksy_cookies_consent_accepted","true",{expires:new Date(1*new Date+{onehour:36e5,oneday:864e5,oneweek:6048e5,onemonth:26784e5,threemonths:80352e5,sixmonths:160704e5,oneyear:31536e6,forever:864e9}[e.closest("[data-period]").dataset.period]),sameSite:"lax"})}if(e.classList.contains("ct-cookies-decline-button")){c.a.set("blocksy_cookies_consent_accepted","no",{expires:new Date(1*new Date+{onehour:36e5,oneday:864e5,oneweek:6048e5,onemonth:26784e5,threemonths:80352e5,sixmonths:160704e5,oneyear:31536e6,forever:864e9}[e.closest("[data-period]").dataset.period]),sameSite:"lax"})}f(t)}))}))))};function p(e,t){setTimeout((function(){t()}),300)}d((function(){l(),r.a&&r.a.on("blocksy:cookies:init",(function(){l()}))}))}]);
framework/extensions/cookies-consent/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/cookies-consent/static/js/main.js CHANGED
@@ -78,6 +78,27 @@ const initCookies = () => {
78
  })
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  hideCookieConsent(notification)
82
  })
83
  })
78
  })
79
  }
80
 
81
+ if (el.classList.contains('ct-cookies-decline-button')) {
82
+ const periods = {
83
+ onehour: 36e5,
84
+ oneday: 864e5,
85
+ oneweek: 7 * 864e5,
86
+ onemonth: 31 * 864e5,
87
+ threemonths: 3 * 31 * 864e5,
88
+ sixmonths: 6 * 31 * 864e5,
89
+ oneyear: 365 * 864e5,
90
+ forever: 10000 * 864e5,
91
+ }
92
+
93
+ cookie.set('blocksy_cookies_consent_accepted', 'no', {
94
+ expires: new Date(
95
+ new Date() * 1 +
96
+ periods[el.closest('[data-period]').dataset.period]
97
+ ),
98
+ sameSite: 'lax',
99
+ })
100
+ }
101
+
102
  hideCookieConsent(notification)
103
  })
104
  })
framework/extensions/cookies-consent/static/js/sync/helpers.js CHANGED
@@ -41,17 +41,19 @@ export const renderWithStrategy = (args = {}) => {
41
  // append | firstChild | maybeBefore:selector
42
  strategy: 'append',
43
  whenInserted: () => {},
44
- beforeInsert: el => {},
45
 
46
  should_insert: true,
47
 
48
- ...args
49
  }
50
 
51
  const parent = document.querySelector(args.parent_selector)
52
  ;[
53
- ...document.querySelectorAll(`${args.parent_selector} ${args.selector}`)
54
- ].map(el => el.parentNode.removeChild(el))
 
 
55
 
56
  if (!args.should_insert) return
57
 
@@ -101,10 +103,10 @@ export const checkAndReplace = (args = {}) => {
101
  // append | firstChild | maybeBefore:selector
102
  strategy: 'append',
103
  whenInserted: () => {},
104
- beforeInsert: el => {},
105
  watch: [],
106
 
107
- ...args
108
  }
109
 
110
  const render = () => {
@@ -112,12 +114,14 @@ export const checkAndReplace = (args = {}) => {
112
 
113
  renderWithStrategy({
114
  ...args,
115
- should_insert: to === 'yes'
116
  })
117
  }
118
 
119
- wp.customize(args.id, val => val.bind(to => render()))
120
- args.watch.map(opt => wp.customize(opt, val => val.bind(() => render())))
 
 
121
  }
122
 
123
  export const responsiveClassesFor = (id, el) => {
@@ -128,7 +132,7 @@ export const responsiveClassesFor = (id, el) => {
128
  const data = wp.customize(id)() || {
129
  mobile: false,
130
  tablet: true,
131
- desktop: true
132
  }
133
 
134
  if (!data.mobile) {
41
  // append | firstChild | maybeBefore:selector
42
  strategy: 'append',
43
  whenInserted: () => {},
44
+ beforeInsert: (el) => {},
45
 
46
  should_insert: true,
47
 
48
+ ...args,
49
  }
50
 
51
  const parent = document.querySelector(args.parent_selector)
52
  ;[
53
+ ...document.querySelectorAll(
54
+ `${args.parent_selector} ${args.selector}`
55
+ ),
56
+ ].map((el) => el.parentNode.removeChild(el))
57
 
58
  if (!args.should_insert) return
59
 
103
  // append | firstChild | maybeBefore:selector
104
  strategy: 'append',
105
  whenInserted: () => {},
106
+ beforeInsert: (el) => {},
107
  watch: [],
108
 
109
+ ...args,
110
  }
111
 
112
  const render = () => {
114
 
115
  renderWithStrategy({
116
  ...args,
117
+ should_insert: to === 'yes',
118
  })
119
  }
120
 
121
+ wp.customize(args.id, (val) => val.bind((to) => render()))
122
+ args.watch.map((opt) =>
123
+ wp.customize(opt, (val) => val.bind(() => render()))
124
+ )
125
  }
126
 
127
  export const responsiveClassesFor = (id, el) => {
132
  const data = wp.customize(id)() || {
133
  mobile: false,
134
  tablet: true,
135
+ desktop: true,
136
  }
137
 
138
  if (!data.mobile) {
framework/extensions/newsletter-subscribe/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/main-admin.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/trending/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/widgets/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/features/account-auth.php CHANGED
@@ -14,6 +14,16 @@ class AccountAuth {
14
  [$this, 'blc_implement_user_registration']
15
  );
16
 
 
 
 
 
 
 
 
 
 
 
17
  add_action(
18
  'wp_ajax_blc_implement_user_lostpassword',
19
  [$this, 'blc_implement_user_lostpassword']
@@ -232,6 +242,11 @@ class AccountAuth {
232
  wp_die();
233
  }
234
 
 
 
 
 
 
235
  public function has_woo_register_flow() {
236
  return apply_filters(
237
  'blocksy:account:register:has_woo_register',
14
  [$this, 'blc_implement_user_registration']
15
  );
16
 
17
+ add_action(
18
+ 'wp_ajax_blc_implement_user_login',
19
+ [$this, 'blc_implement_user_login']
20
+ );
21
+
22
+ add_action(
23
+ 'wp_ajax_nopriv_blc_implement_user_login',
24
+ [$this, 'blc_implement_user_login']
25
+ );
26
+
27
  add_action(
28
  'wp_ajax_blc_implement_user_lostpassword',
29
  [$this, 'blc_implement_user_lostpassword']
242
  wp_die();
243
  }
244
 
245
+ public function blc_implement_user_login() {
246
+ require_once ABSPATH . 'wp-login.php';
247
+ wp_die();
248
+ }
249
+
250
  public function has_woo_register_flow() {
251
  return apply_filters(
252
  'blocksy:account:register:has_woo_register',
framework/features/customizer-options-manager.php CHANGED
@@ -33,37 +33,19 @@ class CustomizerOptionsManager {
33
  wp_send_json_error();
34
  }
35
 
36
- if (! isset($_POST['data'])) {
37
  wp_send_json_error();
38
  }
39
 
40
- if (! isset($_POST['nonce'])) {
41
  wp_send_json_error();
42
  }
43
 
44
- if (! wp_verify_nonce($_POST['nonce'], 'ct-customizer-reset')) {
45
- wp_send_json_error();
46
- }
47
-
48
- // Ensure only stdClass is allowed
49
- // We need it for properly decoding widget data. Custom classes
50
- // besides stdClass are not allowed.
51
- $data = unserialize(
52
- wp_unslash($_POST['data']),
53
- [
54
- 'allowed_classes' => ['stdClass']
55
- ]
56
  );
57
 
58
- if (! $data) {
59
- $data = unserialize(
60
- str_replace("\r\n", "\n", wp_unslash($_POST['data'])),
61
- [
62
- 'allowed_classes' => ['stdClass']
63
- ]
64
- );
65
- }
66
-
67
  // The above code will only import stuff from $data['mods']
68
  // that is actually a customizer control. Everything else will be ignored
69
  if (isset($data['mods'])) {
33
  wp_send_json_error();
34
  }
35
 
36
+ if (! isset($_REQUEST['nonce'])) {
37
  wp_send_json_error();
38
  }
39
 
40
+ if (! wp_verify_nonce($_REQUEST['nonce'], 'ct-customizer-reset')) {
41
  wp_send_json_error();
42
  }
43
 
44
+ $data = json_decode(
45
+ file_get_contents('php://input'),
46
+ true
 
 
 
 
 
 
 
 
 
47
  );
48
 
 
 
 
 
 
 
 
 
 
49
  // The above code will only import stuff from $data['mods']
50
  // that is actually a customizer control. Everything else will be ignored
51
  if (isset($data['mods'])) {
framework/features/google-analytics.php CHANGED
@@ -15,7 +15,7 @@ class GoogleAnalytics {
15
  if (is_admin()) return;
16
 
17
  if (class_exists('BlocksyExtensionCookiesConsent')) {
18
- if (\BlocksyExtensionCookiesConsent::should_display_notification()) {
19
  return;
20
  }
21
  }
15
  if (is_admin()) return;
16
 
17
  if (class_exists('BlocksyExtensionCookiesConsent')) {
18
+ if (! \BlocksyExtensionCookiesConsent::has_consent()) {
19
  return;
20
  }
21
  }
framework/features/header.php CHANGED
@@ -5,6 +5,7 @@ namespace Blocksy;
5
  class HeaderAdditions {
6
  private $has_transparent_header = '__DEFAULT__';
7
  private $has_sticky_header = '__DEFAULT__';
 
8
 
9
  public function __construct() {
10
  add_action(
@@ -235,22 +236,10 @@ class HeaderAdditions {
235
  });
236
 
237
  add_filter('blocksy:footer:offcanvas-drawer', function ($els) {
238
- if (get_current_user_id()) {
239
- if (! is_customize_preview()) {
240
- return $els;
241
- }
242
- }
243
-
244
- $render = new \Blocksy_Header_Builder_Render();
245
-
246
- if (! $render->contains_item('account')) {
247
- if (! is_customize_preview()) {
248
- return $els;
249
- }
250
  }
251
 
252
- $els[] = $this->retrieve_account_modal();
253
-
254
  return $els;
255
  });
256
  }
@@ -585,5 +574,37 @@ class HeaderAdditions {
585
 
586
  return $html;
587
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
588
  }
589
 
5
  class HeaderAdditions {
6
  private $has_transparent_header = '__DEFAULT__';
7
  private $has_sticky_header = '__DEFAULT__';
8
+ private $has_account_modal = '__empty__';
9
 
10
  public function __construct() {
11
  add_action(
236
  });
237
 
238
  add_filter('blocksy:footer:offcanvas-drawer', function ($els) {
239
+ if ($this->has_account_modal()) {
240
+ $els[] = $this->retrieve_account_modal();
 
 
 
 
 
 
 
 
 
 
241
  }
242
 
 
 
243
  return $els;
244
  });
245
  }
574
 
575
  return $html;
576
  }
577
+
578
+ public function has_account_modal() {
579
+ if (is_customize_preview()) {
580
+ return true;
581
+ }
582
+
583
+ if ($this->has_account_modal !== '__empty__') {
584
+ return $this->has_account_modal;
585
+ }
586
+
587
+ if (get_current_user_id()) {
588
+ $this->has_account_modal = false;
589
+ return false;
590
+ }
591
+
592
+ $render = new \Blocksy_Header_Builder_Render();
593
+
594
+ if (! $render->contains_item('account')) {
595
+ $this->has_account_modal = false;
596
+ return false;
597
+ }
598
+
599
+ $atts = $render->get_item_data_for('account');
600
+
601
+ if (blocksy_akg('login_account_action', $atts, 'modal') !== 'modal') {
602
+ $this->has_account_modal = false;
603
+ return false;
604
+ }
605
+
606
+ $this->has_account_modal = true;
607
+ return true;
608
+ }
609
  }
610
 
framework/features/header/header-options.php CHANGED
@@ -60,7 +60,7 @@ $options = [
60
  ],
61
 
62
  'sticky_effect' => [
63
- 'label' => __('Sticky Effect', 'blocksy-companion' ),
64
  'type' => 'ct-select',
65
  'value' => 'shrink',
66
  'design' => 'block',
@@ -75,10 +75,24 @@ $options = [
75
  ]),
76
  ],
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  'sticky_behaviour' => [
79
  'label' => __( 'Enable on', 'blocksy-companion' ),
80
  'type' => 'ct-visibility',
81
  'design' => 'block',
 
82
  'value' => [
83
  'desktop' => true,
84
  // 'tablet' => true,
60
  ],
61
 
62
  'sticky_effect' => [
63
+ 'label' => __('Effect', 'blocksy-companion' ),
64
  'type' => 'ct-select',
65
  'value' => 'shrink',
66
  'design' => 'block',
75
  ]),
76
  ],
77
 
78
+ 'sticky_offset' => [
79
+ 'label' => __( 'Offset', 'blocksy-companion' ),
80
+ 'type' => 'ct-slider',
81
+ 'min' => 0,
82
+ 'max' => 300,
83
+ 'value' => 0,
84
+ 'responsive' => true,
85
+ 'divider' => 'top',
86
+ 'sync' => [
87
+ 'id' => 'header_placements_1'
88
+ ],
89
+ ],
90
+
91
  'sticky_behaviour' => [
92
  'label' => __( 'Enable on', 'blocksy-companion' ),
93
  'type' => 'ct-visibility',
94
  'design' => 'block',
95
+ 'divider' => 'top',
96
  'value' => [
97
  'desktop' => true,
98
  // 'tablet' => true,
framework/features/header/modal/login.php CHANGED
@@ -9,9 +9,7 @@ if ( !$forgot_password_inline ) {
9
  }
10
  ?>
11
 
12
- <form name="loginform" id="loginform" action="<?php
13
- echo wp_login_url() ;
14
- ?>" method="post">
15
  <?php
16
  do_action( 'woocommerce_login_form_start' );
17
  ?>
9
  }
10
  ?>
11
 
12
+ <form name="loginform" id="loginform" action="#" method="post">
 
 
13
  <?php
14
  do_action( 'woocommerce_login_form_start' );
15
  ?>
framework/features/header/modal/lostpassword.php CHANGED
@@ -1,4 +1,4 @@
1
- <form name="lostpasswordform" id="lostpasswordform" action="<?php echo wp_lostpassword_url() ?>" method="post">
2
  <?php do_action('blocksy:account:modal:lostpassword:start'); ?>
3
 
4
  <p>
1
+ <form name="lostpasswordform" id="lostpasswordform" action="#" method="post">
2
  <?php do_action('blocksy:account:modal:lostpassword:start'); ?>
3
 
4
  <p>
framework/features/header/modal/register.php CHANGED
@@ -10,9 +10,7 @@ if ( \Blocksy\Plugin::instance()->account_auth->has_woo_register_flow() && 'no'
10
  }
11
  ?>
12
 
13
- <form name="registerform" id="registerform" action="<?php
14
- echo wp_registration_url() ;
15
- ?>" method="post" novalidate="novalidate">
16
  <?php
17
  do_action( 'woocommerce_register_form_start' );
18
  ?>
10
  }
11
  ?>
12
 
13
+ <form name="registerform" id="registerform" action="#" method="post" novalidate="novalidate">
 
 
14
  <?php
15
  do_action( 'woocommerce_register_form_start' );
16
  ?>
framework/theme-integration.php CHANGED
@@ -467,11 +467,11 @@ class ThemeIntegration {
467
  }
468
  }
469
 
470
- return array(
471
  'width' => $width,
472
  'height' => $height,
473
  'orientation' => ($width > $height) ? 'landscape' : 'portrait'
474
- );
475
  }
476
  }
477
 
467
  }
468
  }
469
 
470
+ return [
471
  'width' => $width,
472
  'height' => $height,
473
  'orientation' => ($width > $height) ? 'landscape' : 'portrait'
474
+ ];
475
  }
476
  }
477
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires PHP: 7.0
5
  Tested up to: 5.9
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
- Stable tag: 1.8.22
9
 
10
  == Description ==
11
 
@@ -23,6 +23,11 @@ It runs and adds its enhancements only if the Blocksy theme is installed and act
23
  2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
24
 
25
  == Changelog ==
 
 
 
 
 
26
  1.8.22: 2022-03-25
27
  - Fix: Blocksy posts shortcode respect pagination
28
 
5
  Tested up to: 5.9
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ Stable tag: 1.8.23
9
 
10
  == Description ==
11
 
23
  2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
24
 
25
  == Changelog ==
26
+ 1.8.23: 2022-04-07
27
+ - Improvement: Smarter loading of the account modal
28
+ - Improvement: More robust data parsing in options import/export module
29
+ - Improvement: Simpler customizer load in CLI commands
30
+
31
  1.8.22: 2022-03-25
32
  - Fix: Blocksy posts shortcode respect pagination
33
 
static/bundle/account-lazy.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
static/bundle/account.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t){e.exports=window.ctEvents},function(e,t){e.exports=window.ctFrontend},function(e,t,r){"use strict";r.r(t);var o=r(0),n=r.n(o),c=r(1);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var l=function(e,t){var r=function(e){var t=jQuery();return i(e.querySelectorAll("input")).map((function(e){t=t.add(e)})),t}(t);if("object"===("undefined"==typeof grecaptcha?"undefined":a(grecaptcha)))grecaptcha.ready((function(){grecaptcha.execute(WFLSVars.recaptchasitekey,{action:"login"}).then((function(t){var o=jQuery("#wfls-captcha-token");o.length?o.val(t):r.length&&((o=jQuery('<input type="hidden" name="wfls-captcha-token" id="wfls-captcha-token" />')).val(t),r.parent().append(o)),"function"==typeof e&&e(!0)}))}));else{var o=jQuery("#wfls-captcha-token");o.length?o.val("grecaptcha-missing"):r.length&&((o=jQuery('<input type="hidden" name="wfls-captcha-token" id="wfls-captcha-token" />')).val("grecaptcha-missing"),r.parent().append(o)),"function"==typeof e&&e(!0)}},f=function(e){i(e.querySelectorAll(".g-recaptcha, .anr_captcha_field")).map((function(e){e.classList.contains("anr_captcha_field")?grecaptcha.reset(parseFloat(e.firstElementChild.id.replace("anr_captcha_field_",""))-1):grecaptcha.reset(e.gID)}))},u=function(e){return new Promise((function(t){(function(e,t){return!(!window.WFLSVars||!parseInt(WFLSVars.useCAPTCHA))&&(l((function(){return e()}),t),!0)})(t,e)||t()}))},d=function(e,t){var r=t.screen,o=void 0===r?"login":r;e.querySelector(".ct-".concat(o,"-form"))||(o="login"),e.querySelector("ul")&&e.querySelector("ul .ct-".concat(o))&&(e.querySelector("ul .active").classList.remove("active"),e.querySelector("ul .ct-".concat(o)).classList.add("active")),e.querySelector('[class*="-form"].active').classList.remove("active"),e.querySelector(".ct-".concat(o,"-form")).classList.add("active"),e.querySelector(".ct-".concat(o,"-form form"))&&e.querySelector(".ct-".concat(o,"-form form")).reset(),e.querySelector(".ct-account-form").classList.remove("ct-error");var n=e.querySelector(".ct-".concat(o,"-form")).querySelector(".ct-form-notification");n&&n.remove();var c=e.querySelector(".ct-".concat(o,"-form")).querySelector(".ct-form-notification-error");c&&c.remove()},m=function(e,t){var r=e.querySelector(".ct-form-notification-error");r&&r.remove(),e.closest(".ct-account-form").classList.remove("ct-error"),t&&(e.insertAdjacentHTML("afterbegin",'<div class="ct-form-notification-error">'.concat(t,"</div>")),requestAnimationFrame((function(){e.closest(".ct-account-form").classList.add("ct-error")})))},p=function(e,t){var r=(new DOMParser).parseFromString(t,"text/html"),o=r.querySelector("#login_error"),n="";return o&&(n=o.innerHTML),m(e,n),{hasError:!!o,doc:r}},y=function(e,t){var r=e.querySelector(".ct-form-notification");r&&r.remove(),e.closest(".ct-account-form").classList.remove("ct-error"),t&&e.insertAdjacentHTML("afterbegin",'<div class="ct-form-notification">'.concat(t,"</div>"))},v=function(e,t){var r=(new DOMParser).parseFromString(t,"text/html"),o=r.querySelector(".message"),n="";return o&&(n=o.innerHTML),y(e,n),{doc:r}},h="";Object(c.registerDynamicChunk)("blocksy_account",{mount:function(e,t){var r=t.event;if(r.preventDefault(),!h){var o=document.querySelector("#account-modal");h=o.innerHTML,o.remove()}var a=document.querySelector(".ct-drawer-canvas").lastElementChild;a.id="account-modal";var i=ct_localizations.dynamic_styles_selectors.find((function(e){return a.matches(e.selector)})),s=function(){a.innerHTML=h,function(e){if(e&&!e.hasListeners){e.hasListeners=!0;var t=e.querySelector('[name="loginform"]'),r=e.querySelector('[name="registerform"]'),o=e.querySelector('[name="lostpasswordform"]');e.addEventListener("click",(function(r){r.target.href&&r.target.href.indexOf("lostpassword")>-1&&(d(e,{screen:"forgot-password"}),r.preventDefault()),r.target.href&&r.target.classList.contains("showlogin")&&(d(e,{screen:"login"}),r.preventDefault()),r.target.href&&(r.target.href.indexOf("wp-login")>-1||t&&r.target.href===t.action)&&-1===r.target.href.indexOf("lostpassword")&&(d(e,{screen:"login"}),r.preventDefault())}),!0),t&&t.addEventListener("submit",(function(e){if(e.preventDefault(),!window.ct_customizer_localizations){var r=new FormData(t),o=t.action;if(window.WFLSVars&&!t.loginProceed)return r.append("action","wordfence_ls_authenticate"),o=WFLSVars.ajaxurl,void u(t).then((function(){fetch(o,{method:t.method,body:r}).then((function(e){return e.json()})).then((function(e){var r=!!e.error,o=t.closest(".ct-login-form"),n=t.closest(".ct-login-form").querySelector("form");if(r&&m(o,e.error),e.message&&y(n,e.message),e.login&&e.jwt){if(!jQuery("#wfls-token").length){var c=jQuery('<div id="wfls-prompt-overlay-blocksy"></div>'),a=jQuery('<div id="wfls-prompt-wrapper"></div>'),i=jQuery('<label for="wfls-token">2FA Code <a href="javascript:void(0)" class="wfls-2fa-code-help wfls-tooltip-trigger" title="The 2FA Code can be found within the authenticator app you used when first activating two-factor authentication. You may also use one of your recovery codes."><i class="dashicons dashicons-editor-help"></i></a></label>'),s=jQuery('<input type="text" name="wfls-token" id="wfls-token" aria-describedby="wfls-token-error" class="input" value="" size="6" autocomplete="off"/>'),l=jQuery('<label for="wfls-remember-device"><input name="wfls-remember-device" type="checkbox" id="wfls-remember-device" class="ct-checkbox" value="1" /> Remember for 30 days</label>');a.append(i),a.append(s),parseInt(WFLSVars.allowremember)&&a.append(l),c.append(a),jQuery(n).prepend(c),new jQuery.Zebra_Tooltips(jQuery(".wfls-tooltip-trigger"))}var u=jQuery("#wfls-token-jwt");u.length||(u=jQuery('<input type="hidden" name="wfls-token-jwt" id="wfls-token-jwt" value=""/>'),jQuery("#wfls-prompt-overlay-blocksy").append(u)),jQuery("#wfls-token-jwt").val(e.jwt)}e.combined&&(t.loginProceed=!0,n.submit()),(!r||r&&-1===t.closest(".ct-login-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&f(t.closest(".ct-login-form"))}))}));u(t).then((function(){fetch(o,{method:t.method,body:r}).then((function(e){return e.text()})).then((function(e){var r=p(t.closest(".ct-login-form"),e),o=(r.doc,r.hasError);o||(location=t.querySelector('[name="redirect_to"]').value),(!o||o&&-1===t.closest(".ct-login-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&f(t.closest(".ct-login-form"))}))}))}})),r&&r.addEventListener("submit",(function(e){e.preventDefault(),window.ct_customizer_localizations||u(r).then((function(){return fetch("".concat(ct_localizations.ajax_url,"?action=blc_implement_user_registration"),{method:r.method,body:new FormData(r)}).then((function(e){return e.text()})).then((function(e){var t=p(r.closest(".ct-register-form"),e),o=(t.doc,t.hasError);o||v(r.closest(".ct-register-form"),e),n.a.trigger("blocksy:account:register:".concat(o?"error":"success")),(!o||o&&-1===r.closest(".ct-register-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&f(r.closest(".ct-register-form"))}))}))})),o&&o.addEventListener("submit",(function(e){e.preventDefault(),window.ct_customizer_localizations||fetch("".concat(ct_localizations.ajax_url,"?action=blc_implement_user_lostpassword"),{method:o.method,body:new FormData(o)}).then((function(e){return e.text()})).then((function(e){var t=p(o.closest(".ct-forgot-password-form"),e),r=(t.doc,t.hasError);r||v(o.closest(".ct-forgot-password-form"),e),(!r||r&&-1===o.closest(".ct-forgot-password-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&f(o.closest(".ct-forgot-password-form"))}))})),["login","register","forgot-password"].map((function(t){Array.from(e.querySelectorAll(".ct-".concat(t))).map((function(r){r.addEventListener("click",(function(r){r.preventDefault(),d(e,{screen:t})})),r.addEventListener("keyup",(function(r){13===r.keyCode&&(r.preventDefault(),d(e,{screen:t}))}))}))}))}}(a),d(a,{screen:e.dataset.view||"login"}),window.anr_onloadCallback&&window.anr_onloadCallback(),n.a.trigger("ct:overlay:handle-click",{e:r,href:"#account-modal",options:{openStrategy:"skip",isModal:!0}})};i?Object(c.loadStyle)(i.url).then((function(){s()})):s()}}),n.a.on("ct:modal:closed",(function(e){e.closest("#account-modal")&&e.remove()}))}]);
1
+ !function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t){e.exports=window.ctEvents},function(e,t){e.exports=window.ctFrontend},function(e,t,r){"use strict";r.r(t);var o=r(0),n=r.n(o),c=r(1);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var s=function(e,t){var r=function(e){var t=jQuery();return i(e.querySelectorAll("input")).map((function(e){t=t.add(e)})),t}(t);if("object"===("undefined"==typeof grecaptcha?"undefined":a(grecaptcha)))grecaptcha.ready((function(){grecaptcha.execute(WFLSVars.recaptchasitekey,{action:"login"}).then((function(t){var o=jQuery("#wfls-captcha-token");o.length?o.val(t):r.length&&((o=jQuery('<input type="hidden" name="wfls-captcha-token" id="wfls-captcha-token" />')).val(t),r.parent().append(o)),"function"==typeof e&&e(!0)}))}));else{var o=jQuery("#wfls-captcha-token");o.length?o.val("grecaptcha-missing"):r.length&&((o=jQuery('<input type="hidden" name="wfls-captcha-token" id="wfls-captcha-token" />')).val("grecaptcha-missing"),r.parent().append(o)),"function"==typeof e&&e(!0)}},u=function(e){i(e.querySelectorAll(".g-recaptcha, .anr_captcha_field")).map((function(e){e.classList.contains("anr_captcha_field")?grecaptcha.reset(parseFloat(e.firstElementChild.id.replace("anr_captcha_field_",""))-1):grecaptcha.reset(e.gID)}))},f=function(e){return new Promise((function(t){(function(e,t){return!(!window.WFLSVars||!parseInt(WFLSVars.useCAPTCHA))&&(s((function(){return e()}),t),!0)})(t,e)||t()}))},d=function(e,t){var r=t.screen,o=void 0===r?"login":r;e.querySelector(".ct-".concat(o,"-form"))||(o="login"),e.querySelector("ul")&&e.querySelector("ul .ct-".concat(o))&&(e.querySelector("ul .active").classList.remove("active"),e.querySelector("ul .ct-".concat(o)).classList.add("active")),e.querySelector('[class*="-form"].active').classList.remove("active"),e.querySelector(".ct-".concat(o,"-form")).classList.add("active"),e.querySelector(".ct-".concat(o,"-form form"))&&e.querySelector(".ct-".concat(o,"-form form")).reset(),e.querySelector(".ct-account-form").classList.remove("ct-error");var n=e.querySelector(".ct-".concat(o,"-form")).querySelector(".ct-form-notification");n&&n.remove();var c=e.querySelector(".ct-".concat(o,"-form")).querySelector(".ct-form-notification-error");c&&c.remove()},m=function(e,t){var r=e.querySelector(".ct-form-notification-error");r&&r.remove(),e.closest(".ct-account-form").classList.remove("ct-error"),t&&(e.insertAdjacentHTML("afterbegin",'<div class="ct-form-notification-error">'.concat(t,"</div>")),requestAnimationFrame((function(){e.closest(".ct-account-form").classList.add("ct-error")})))},p=function(e,t){var r=(new DOMParser).parseFromString(t,"text/html"),o=r.querySelector("#login_error"),n="";return o&&(n=o.innerHTML),m(e,n),{hasError:!!o,doc:r}},y=function(e,t){var r=e.querySelector(".ct-form-notification");r&&r.remove(),e.closest(".ct-account-form").classList.remove("ct-error"),t&&e.insertAdjacentHTML("afterbegin",'<div class="ct-form-notification">'.concat(t,"</div>"))},v=function(e,t){var r=(new DOMParser).parseFromString(t,"text/html"),o=r.querySelector(".message"),n="";return o&&(n=o.innerHTML),y(e,n),{doc:r}},h="";Object(c.registerDynamicChunk)("blocksy_account",{mount:function(e,t){var r=t.event;if(r.preventDefault(),!h){var o=document.querySelector("#account-modal");h=o.innerHTML,o.remove()}var a=document.querySelector(".ct-drawer-canvas").lastElementChild;a.id="account-modal";var i=ct_localizations.dynamic_styles_selectors.find((function(e){return a.matches(e.selector)})),l=function(){a.innerHTML=h,function(e){if(e&&!e.hasListeners){e.hasListeners=!0;var t=e.querySelector('[name="loginform"]'),r=e.querySelector('[name="registerform"]'),o=e.querySelector('[name="lostpasswordform"]');e.addEventListener("click",(function(r){r.target.href&&r.target.href.indexOf("lostpassword")>-1&&(d(e,{screen:"forgot-password"}),r.preventDefault()),r.target.href&&r.target.classList.contains("showlogin")&&(d(e,{screen:"login"}),r.preventDefault()),r.target.href&&(r.target.href.indexOf("wp-login")>-1||t&&r.target.href===t.action)&&-1===r.target.href.indexOf("lostpassword")&&(d(e,{screen:"login"}),r.preventDefault())}),!0),t&&t.addEventListener("submit",(function(e){if(e.preventDefault(),!window.ct_customizer_localizations){var r=new FormData(t),o="".concat(ct_localizations.ajax_url,"?action=blc_implement_user_login");if(window.WFLSVars&&!t.loginProceed)return r.append("action","wordfence_ls_authenticate"),o=WFLSVars.ajaxurl,void f(t).then((function(){fetch(o,{method:t.method,body:r}).then((function(e){return e.json()})).then((function(e){var r=!!e.error,o=t.closest(".ct-login-form"),n=t.closest(".ct-login-form").querySelector("form");if(r&&m(o,e.error),e.message&&y(n,e.message),e.login&&e.jwt){if(!jQuery("#wfls-token").length){var c=jQuery('<div id="wfls-prompt-overlay-blocksy"></div>'),a=jQuery('<div id="wfls-prompt-wrapper"></div>'),i=jQuery('<label for="wfls-token">2FA Code <a href="javascript:void(0)" class="wfls-2fa-code-help wfls-tooltip-trigger" title="The 2FA Code can be found within the authenticator app you used when first activating two-factor authentication. You may also use one of your recovery codes."><i class="dashicons dashicons-editor-help"></i></a></label>'),l=jQuery('<input type="text" name="wfls-token" id="wfls-token" aria-describedby="wfls-token-error" class="input" value="" size="6" autocomplete="off"/>'),s=jQuery('<label for="wfls-remember-device"><input name="wfls-remember-device" type="checkbox" id="wfls-remember-device" class="ct-checkbox" value="1" /> Remember for 30 days</label>');a.append(i),a.append(l),parseInt(WFLSVars.allowremember)&&a.append(s),c.append(a),jQuery(n).prepend(c),new jQuery.Zebra_Tooltips(jQuery(".wfls-tooltip-trigger"))}var f=jQuery("#wfls-token-jwt");f.length||(f=jQuery('<input type="hidden" name="wfls-token-jwt" id="wfls-token-jwt" value=""/>'),jQuery("#wfls-prompt-overlay-blocksy").append(f)),jQuery("#wfls-token-jwt").val(e.jwt)}e.combined&&(t.loginProceed=!0,n.submit()),(!r||r&&-1===t.closest(".ct-login-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&u(t.closest(".ct-login-form"))}))}));f(t).then((function(){fetch(o,{method:t.method,body:r}).then((function(e){return e.text()})).then((function(e){var r=p(t.closest(".ct-login-form"),e),o=(r.doc,r.hasError);o||(location=t.querySelector('[name="redirect_to"]').value),(!o||o&&-1===t.closest(".ct-login-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&u(t.closest(".ct-login-form"))}))}))}})),r&&r.addEventListener("submit",(function(e){e.preventDefault(),window.ct_customizer_localizations||f(r).then((function(){return fetch("".concat(ct_localizations.ajax_url,"?action=blc_implement_user_registration"),{method:r.method,body:new FormData(r)}).then((function(e){return e.text()})).then((function(e){var t=p(r.closest(".ct-register-form"),e),o=(t.doc,t.hasError);o||v(r.closest(".ct-register-form"),e),n.a.trigger("blocksy:account:register:".concat(o?"error":"success")),(!o||o&&-1===r.closest(".ct-register-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&u(r.closest(".ct-register-form"))}))}))})),o&&o.addEventListener("submit",(function(e){e.preventDefault(),window.ct_customizer_localizations||fetch("".concat(ct_localizations.ajax_url,"?action=blc_implement_user_lostpassword"),{method:o.method,body:new FormData(o)}).then((function(e){return e.text()})).then((function(e){var t=p(o.closest(".ct-forgot-password-form"),e),r=(t.doc,t.hasError);r||v(o.closest(".ct-forgot-password-form"),e),(!r||r&&-1===o.closest(".ct-forgot-password-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&u(o.closest(".ct-forgot-password-form"))}))})),["login","register","forgot-password"].map((function(t){Array.from(e.querySelectorAll(".ct-".concat(t))).map((function(r){r.addEventListener("click",(function(r){r.preventDefault(),d(e,{screen:t})})),r.addEventListener("keyup",(function(r){13===r.keyCode&&(r.preventDefault(),d(e,{screen:t}))}))}))}))}}(a),d(a,{screen:e.dataset.view||"login"}),window.anr_onloadCallback&&window.anr_onloadCallback(),n.a.trigger("ct:overlay:handle-click",{e:r,href:"#account-modal",options:{openStrategy:"skip",isModal:!0}})};i?Object(c.loadStyle)(i.url).then((function(){l()})):l()}}),n.a.on("ct:modal:closed",(function(e){e.closest("#account-modal")&&e.remove()}))}]);
static/bundle/dashboard.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.21
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
static/bundle/options.js CHANGED
@@ -1,6 +1,14 @@
1
- !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.blocksyOptions},function(e,t,n){var o;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
- */!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var c=typeof o;if("string"===c||"number"===c)e.push(o);else if(Array.isArray(o)&&o.length){var a=r.apply(null,o);a&&e.push(a)}else if("object"===c)for(var i in o)n.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.ctEvents},function(e,t){e.exports=window.React},function(e,t,n){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o="object"===("undefined"==typeof window?"undefined":n(window))&&window.window===window?window:"object"===("undefined"==typeof self?"undefined":n(self))&&self.self===self?self:"object"===(void 0===t?"undefined":n(t))&&t.global===t?t:this;function r(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){i(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function c(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"!==("undefined"==typeof window?"undefined":n(window))||window!==o?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var i=o.URL||o.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin!==location.origin?c(l.href)?r(e,t,n):a(l,l.target="_blank"):a(l)):(l.href=i.createObjectURL(e),setTimeout((function(){i.revokeObjectURL(l.href)}),4e4),setTimeout((function(){a(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,o){if(t=t||e.name||"download","string"==typeof e)if(c(e))r(e,t,o);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){a(i)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!==n(t)&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,o),t)}:function(e,t,c,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,c);var i="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||i&&l)&&"object"===("undefined"==typeof FileReader?"undefined":n(FileReader))){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},s.readAsDataURL(e)}else{var p=o.URL||o.webkitURL,d=p.createObjectURL(e);a?a.location=d:location.href=d,a=null,setTimeout((function(){p.revokeObjectURL(d)}),4e4)}};e.exports=i}).call(this,n(12))},function(e,t){e.exports=window.wp.hooks},function(e,t,n){var o=n(13);function r(e,t,n,o,c){var a=new Error(n,o,c);return a.name="UseFetchError",a.status=e,a.statusText=t,Object.setPrototypeOf(a,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(a,r),a}r.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(r,Error),e.exports=function(e,t,n){var c=(n&&n.depends||t&&t.depends||[]).reduce((function(e,t){return e||!t}),!1);return o(!c&&function(e,t,n){return fetch(e,t).then(n&&n.formatter||t&&t.formatter||function(e){if(!e.ok)throw new r(e.status,e.statusText,"Fetch error");return e.json()})},e,t||{},n||{})}},function(e,t,n){var o=n(15);e.exports=function(){var e=function(){e.id=o(),e.subscribers.forEach((function(e){e()}))};return e.id=o(),e.subscribers=[],e.subscribe=function(t){e.subscribers.push(t)},e.unsubscribe=function(t){e.subscribers.indexOf(t)>=0&&e.subscribers.splice(e.subscribers.indexOf(t),1)},e}},function(e,t,n){var o=n(6);e.exports=function(e){var t=o.useState(e.id),n=function(){return t[1](e.id)};return o.useEffect((function(){return e.subscribe(n),function(){return e.unsubscribe(n)}}),[]),t[0]}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var o=n(6),r=n(14);e.exports=function(e){var t=Array.prototype.slice.call(arguments,[1]),n=o.useState({isLoading:!!e});return o.useEffect((function(){e&&(!n[0].isLoading&&n[1]({data:n[0].data,isLoading:!0}),e.apply(null,t).then((function(e){n[1]({data:e,isLoading:!1})})).catch((function(e){n[1]({error:e,isLoading:!1})})))}),r(t)),n[0]}},function(e,t){e.exports=function e(){for(var t=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o instanceof Array)for(var r=0;r<o.length;r++)t=t.concat(e(o[r]));else if("undefined"!=typeof URL&&o instanceof URL)t=t.concat(o.toJSON());else if(o instanceof Object)for(var c=Object.keys(o),a=0;a<c.length;a++){var i=c[a];t=t.concat([i]).concat(e(o[i]))}else t=t.concat(o)}return t}},function(e,t,n){for(var o=self.crypto||self.msCrypto,r="-_",c=36;c--;)r+=c.toString(36);for(c=36;c---10;)r+=c.toString(36).toUpperCase();e.exports=function(e){var t="",n=o.getRandomValues(new Uint8Array(e||21));for(c=e||21;c--;)t+=r[63&n[c]];return t}},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(4),c=n(1),a=n(2),i=n(3),l=n.n(i);function u(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],o=!0,r=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(o=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,c=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw c}}return n}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var y=function(e){return e.filter((function(e,t,n){return n.findIndex((function(t){return t.ID===e.ID}))===t}))},O=[],j=function(e){var t=e.condition,n=e.onChange,r=f(Object(o.useState)(O),2),i=r[0],l=r[1],s=Object(o.useMemo)((function(){return{post_ids:"post",page_ids:"page",custom_post_type_ids:"ct_cpt"}[t.rule]}),[t.rule]),d=Object(o.useMemo)((function(){return(t.payload||{}).post_id||""}),[t.payload&&t.payload.post_id]),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";fetch("".concat(wp.ajax.settings.url,"?action=blocksy_conditions_get_all_posts"),{headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(p(p({post_type:s},e?{search_query:e}:{}),d?{alsoInclude:d}:{})),method:"POST"}).then((function(e){return e.json()})).then((function(e){var t=e.data.posts;l((function(e){return y([].concat(u(e),u(t)))})),O=y([].concat(u(O),u(t)))}))};return Object(o.useEffect)((function(){m()}),[s]),Object(o.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,searchPlaceholder:Object(c.__)("Type to search by ID or title...","blocksy-companion"),placeholder:"post_ids"===t.rule?Object(c.__)("Select post","blocksy-companion"):"page_ids"===t.rule?Object(c.__)("Select page","blocksy-companion"):Object(c.__)("Custom Post Type ID","blocksy-companion"),choices:i.filter((function(e){var t=e.post_type;return"ct_cpt"===s?"post"!==t&&"page"!==t:s===t})).map((function(e){return{key:e.ID,value:e.post_title}})),search:!0},value:d,onChange:function(e){return n(e)},onInputValueChange:function(e){i.find((function(t){return t.post_title===e}))||m(e)}})};function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],o=!0,r=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(o=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,c=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw c}}return n}(e,t)||k(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){E(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||k(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var C=[],x=[],A=[],N=[],P=function(e){var t=e.value,n=e.onChange,r=blocksy_admin.all_condition_rules.reduce((function(e,t){var n=t.rules,o=t.title;return[].concat(w(e),w(n.map((function(e){return g(g({},e),{},{group:o})}))))}),[]).reduce((function(e,t){var n=t.title,o=t.id,r=v(t,["title","id"]);return[].concat(w(e),[g({key:o,value:n},r)])}),[]),i=h(Object(o.useState)(C),2),u=(i[0],i[1],h(Object(o.useState)(x),2)),s=u[0],p=u[1],d=h(Object(o.useState)(A),2),f=d[0],m=d[1],b=h(Object(o.useState)(N),2),y=b[0],O=b[1],_=function(e){return"post_ids"===e.rule||"page_ids"===e.rule||"custom_post_type_ids"===e.rule||"taxonomy_ids"===e.rule||"post_with_taxonomy_ids"===e.rule||"current_language"===e.rule||"user_post_author_id"===e.rule};return Object(o.useEffect)((function(){fetch("".concat(wp.ajax.settings.url,"?action=blocksy_conditions_get_all_taxonomies"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"}).then((function(e){return e.json()})).then((function(e){var t=e.data,n=t.taxonomies,o=t.languages,r=t.users;p(n),x=n,m(o),A=o,O(r),N=r}))}),[]),Object(o.createElement)("div",{className:"ct-display-conditions"},t.map((function(e,i){return Object(o.createElement)("div",{className:l()("ct-condition-group",{"ct-cols-3":_(e),"ct-cols-2":!_(e)}),key:i},Object(o.createElement)(a.Select,{key:"first",option:{inputClassName:"ct-condition-type",selectInputStart:function(){return Object(o.createElement)("span",{className:"ct-".concat(e.type)})},placeholder:Object(c.__)("Select variation","blocksy-companion"),choices:{include:Object(c.__)("Include","blocksy-companion"),exclude:Object(c.__)("Exclude","blocksy-companion")}},value:e.type,onChange:function(o){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{type:o}):t)})))}}),Object(o.createElement)(a.Select,{key:"second",option:{appendToBody:!0,placeholder:Object(c.__)("Select rule","blocksy-companion"),choices:"user"===e.category?r.filter((function(e){return 0===e.key.indexOf("user_")})):r.filter((function(e){return-1===e.key.indexOf("user_")})),search:!0},value:e.rule,onChange:function(o){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{rule:o}):t)})))}}),("post_ids"===e.rule||"custom_post_type_ids"===e.rule||"page_ids"===e.rule)&&Object(o.createElement)(j,{condition:e,onChange:function(o){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{payload:g(g({},e.payload),{},{post_id:o})}):t)})))}}),("taxonomy_ids"===e.rule||"post_with_taxonomy_ids"===e.rule)&&Object(o.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:Object(c.__)("Select taxonomy","blocksy-companion"),choices:s.map((function(e){return g({key:e.id,value:e.name},e.group?{group:e.group}:{})})),search:!0},value:(e.payload||{}).taxonomy_id||"",onChange:function(o){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{payload:g(g({},e.payload),{},{taxonomy_id:o})}):t)})))}}),"current_language"===e.rule&&Object(o.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:Object(c.__)("Select language","blocksy-companion"),choices:f.map((function(e){return{key:e.id,value:e.name}})),search:!0},value:(e.payload||{}).language||"",onChange:function(o){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{payload:g(g({},e.payload),{},{language:o})}):t)})))}}),"user_post_author_id"===e.rule&&Object(o.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:Object(c.__)("Select user","blocksy-companion"),choices:[{key:"current_user",value:Object(c.__)("Current user","blocksy-companion")}].concat(w(y.map((function(e){return{key:e.id,value:e.name}})))),search:!0},value:(e.payload||{}).user_id||"",onChange:function(o){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{payload:g(g({},e.payload),{},{user_id:o})}):t)})))}}),Object(o.createElement)("button",{type:"button",onClick:function(e){e.preventDefault();var o=w(t);o.splice(i,1),n(o)}},"×"))})),Object(o.createElement)("div",{className:"ct-conditions-actions"},Object(o.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),n([].concat(w(t),[{type:"include",rule:"everywhere",payload:{}}]))}},Object(c.__)("Add Display Condition","blocksy-companion")),Object(o.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),n([].concat(w(t),[{type:"include",rule:"user_logged_in",payload:{},category:"user"}]))}},Object(c.__)("Add User Condition","blocksy-companion"))))};function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],o=!0,r=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(o=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,c=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var I=function(e){var t=e.option,n=t.display,r=void 0===n?"inline":n,i=t.modalTitle,l=void 0===i?Object(c.__)("Transparent Header Display Conditions","blocksy-companion"):i,u=t.modalDescription,s=void 0===u?Object(c.__)("Add one or more conditions to display the transparent header.","blocksy-companion"):u,p=e.value,d=e.onChange,f=T(Object(o.useState)(!1),2),m=f[0],b=f[1],y=T(Object(o.useState)(null),2),O=y[0],j=y[1];return"inline"===r?Object(o.createElement)(P,{value:p,onChange:d}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){e.preventDefault(),b(!0),j(null)}},Object(c.__)("Add/Edit Conditions","blocksy-companion")),Object(o.createElement)(a.Overlay,{items:m,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){b(!1),j(null)},render:function(){return Object(o.createElement)("div",{className:"ct-modal-content"},Object(o.createElement)("h2",null,l),Object(o.createElement)("p",null,s),Object(o.createElement)("div",{className:"ct-modal-scroll"},Object(o.createElement)(P,{value:O||p,onChange:function(e){j(e)}})),Object(o.createElement)("div",{className:"ct-modal-actions has-divider"},Object(o.createElement)("button",{className:"button-primary",disabled:!O,onClick:function(){d(O),b(!1)}},Object(c.__)("Save Conditions","blocksy-companion"))))}}))},z=n(7),L=n.n(z);function R(e){return function(e){if(Array.isArray(e))return U(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||M(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],o=!0,r=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(o=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,c=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw c}}return n}(e,t)||M(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){if(e){if("string"==typeof e)return U(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(e,t):void 0}}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var B=function(){var e=F(Object(o.useState)(null),2),t=e[0],n=e[1],r=F(Object(o.useState)(null),2),i=r[0],u=r[1],s=F(Object(o.useState)(!1),2),p=s[0],d=s[1],f=F(Object(o.useState)(!1),2),m=f[0],b=f[1],y=F(Object(o.useState)(["options"]),2),O=y[0],j=y[1],h=Object(o.useRef)(),v=Object(o.useRef)();return Object(o.useEffect)((function(){var e=function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy",d(!0)},t=function(e){e.stopPropagation(),e.preventDefault(),d(!1)},o=function(e){e.stopPropagation(),e.preventDefault(),d(!1);var t=Array.from(e.dataTransfer.files||[]);if(Array.from(e.dataTransfer.items||[]).length>0){var o=e.dataTransfer.items[0].getAsFile();n(o)}else t.length>0&&n(t[0])};return v.current.addEventListener("dragover",e,!1),v.current.addEventListener("dragleave",t,!1),v.current.addEventListener("drop",o,!1),function(){v.current.removeEventListener("dragover",e,!1),v.current.removeEventListener("dragleave",t,!1),v.current.removeEventListener("drop",o,!1)}}),[]),Object(o.createElement)("div",{className:"ct-import-export"},Object(o.createElement)("div",{className:"ct-title","data-type":"simple"},Object(o.createElement)("h3",null,Object(c.__)("Export Options","blocksy-companion")),Object(o.createElement)("div",{className:"ct-option-description"},Object(c.__)("Easily export the theme customizer settings.","blocksy-companion"))),Object(o.createElement)("div",{className:"ct-control","data-design":"block"},Object(o.createElement)("header",null),Object(o.createElement)("section",null,Object(o.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),b(!0)}},Object(c.__)("Export Customizations","blocksy-companion")))),Object(o.createElement)("div",{className:"ct-title","data-type":"simple"},Object(o.createElement)("h3",null,Object(c.__)("Import Options","blocksy-companion")),Object(o.createElement)("div",{className:"ct-option-description"},Object(c.__)("Easily import the theme customizer settings.","blocksy-companion"))),Object(o.createElement)("div",{className:"ct-control","data-design":"block"},Object(o.createElement)("header",null),Object(o.createElement)("section",null,Object(o.createElement)("div",{className:"ct-file-upload"},Object(o.createElement)("button",{type:"button",className:l()("button ct-upload-button",{active:p}),ref:v,onClick:function(){h.current.click()}},t?t.name:Object(c.__)("Click or drop to upload a file...","blocksy-companion")),Object(o.createElement)("input",{ref:h,type:"file",onChange:function(e){var t=F(e.target.files,1)[0];n(t)}}),Object(o.createElement)("button",{className:"button",onClick:function(e){if(e.preventDefault(),t){var n=new FileReader;n.readAsText(t,"UTF-8"),n.onload=function(e){var t=new FormData;t.append("action","blocksy_customizer_import"),t.append("nonce",ct_customizer_localizations.customizer_reset_none),t.append("wp_customize","on"),t.append("data",e.target.result);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}}}},Object(c.__)("Import Customizations","blocksy-companion"))))),ct_customizer_localizations.has_child_theme&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"ct-title","data-type":"simple"},Object(o.createElement)("h3",null,Object(c.__)("Copy Options","blocksy-companion")),Object(o.createElement)("div",{className:"ct-option-description"},Object(c.__)("Copy and import your customizations from parent or child theme.","blocksy-companion"))),ct_customizer_localizations.is_parent_theme&&Object(o.createElement)("div",{className:"ct-control","data-design":"block"},Object(o.createElement)("header",null),Object(o.createElement)("section",null,Object(o.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),u("child")}},Object(c.__)("Copy From Child Theme","blocksy-companion")))),!ct_customizer_localizations.is_parent_theme&&Object(o.createElement)("div",{className:"ct-control","data-design":"block"},Object(o.createElement)("header",null),Object(o.createElement)("section",null,Object(o.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),u("parent")}},Object(c.__)("Copy From Parent Theme","blocksy-companion"))))),Object(o.createElement)(a.Overlay,{items:i,className:"ct-admin-modal ct-import-export-modal",onDismiss:function(){return u(!1)},render:function(){return Object(o.createElement)("div",{className:"ct-modal-content"},Object(o.createElement)("svg",{width:"35",height:"35",viewBox:"0 0 66 66"},Object(o.createElement)("path",{d:"M66 33.1c0 2.8-.4 5.5-1.1 8.2 0 0-1.7-.6-1.9-.6 3.4-13.1-2.2-27.4-14.5-34.5C41.3 2 33 .9 25 3.1c-3.5.9-6.7 2.4-9.5 4.4L20 12 6 15 9 1l5 5c3.1-2.2 6.6-3.9 10.5-4.9 2.7-.7 5.4-1.1 8-1.1 5.9-.1 11.7 1.4 17 4.4C60.1 10.5 66 21.7 66 33.1zm-49 6.3l2.4-3c-.3-1.2-.4-2.3-.4-3.4s.1-2.2.4-3.3l-2.4-3 2.5-4.3 3.8.5c1.6-1.6 3.6-2.7 5.8-3.3l1.4-3.6h5l1.4 3.6c2.2.6 4.2 1.8 5.8 3.3l3.8-.5 2.5 4.3-2.4 3c.3 1.1.4 2.2.4 3.3s-.1 2.2-.4 3.3l2.4 3-2.5 4.3-3.8-.5c-1.6 1.6-3.6 2.7-5.8 3.3L35.4 50h-5L29 46.4c-2.2-.6-4.2-1.8-5.8-3.3l-3.8.5-2.4-4.2zm8-6.4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8-8 3.6-8 8zm25.9 25.3c-3 2.1-6.3 3.7-9.9 4.7-8 2.1-16.4 1-23.5-3.1C5.2 52.8-.4 38.5 3 25.4c-.7-.1-1.3-.3-2-.5-.7 2.7-1 5.3-1 8 0 11.4 5.9 22.5 16.5 28.6 7.6 4.4 16.5 5.6 25 3.3 4-1.1 7.6-2.8 10.8-5.2l4.6 4.6 3-14-14 3 5 5.1z"})),Object(o.createElement)("h2",{className:"ct-modal-title"},!ct_customizer_localizations.is_parent_theme&&Object(c.__)("Copy From Parent Theme","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&Object(c.__)("Copy From Child Theme","blocksy-companion")),Object(o.createElement)("p",null,!ct_customizer_localizations.is_parent_theme&&Object(c.__)("You are about to copy all the settings from your parent theme into the child theme. Are you sure you want to continue?","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&Object(c.__)("You are about to copy all the settings from your child theme into the parent theme. Are you sure you want to continue?","blocksy-companion")),Object(o.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},Object(o.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),u(!1)},className:"button"},Object(c.__)("Cancel","blocksy-companion")),Object(o.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_copy_options"),t.append("wp_customize","on"),t.append("strategy",i);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}},Object(c.__)("Yes, I am sure","blocksy-companion"))))}}),Object(o.createElement)(a.Overlay,{items:m,className:"ct-admin-modal ct-export-modal",onDismiss:function(){return b(!1)},render:function(){return Object(o.createElement)("div",{className:"ct-modal-content"},Object(o.createElement)("h2",{className:"ct-modal-title"},Object(c.__)("Export Settings","blocksy-companion")),Object(o.createElement)("p",null,Object(c.__)("Choose what set of settings you want to export.","blocksy-companion")),Object(o.createElement)("div",{className:"ct-export-options"},["options","widgets"].map((function(e){return Object(o.createElement)("div",{className:"ct-checkbox-container",onClick:function(){1===O.length&&O[0]===e||j((function(t){return t.includes(e)?t.filter((function(t){return t!==e})):[].concat(R(t),[e])}))}},{options:Object(c.__)("Customizer settings","blocksy-companion"),widgets:Object(c.__)("Widgets settings","blocksy-companion")}[e],Object(o.createElement)("span",{className:l()("ct-checkbox",{active:O.includes(e)})},Object(o.createElement)("svg",{width:"10",height:"8",viewBox:"0 0 11.2 9.1"},Object(o.createElement)("polyline",{className:"check",points:"1.2,4.8 4.4,7.9 9.9,1.2 "}))))}))),Object(o.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},Object(o.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),b(!1)},className:"button"},Object(c.__)("Cancel","blocksy-companion")),Object(o.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_export"),t.append("strategy",O.join(":")),t.append("wp_customize","on");try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){var t=e.success,n=e.data;if(t){console.log("here",n.site_url);var o=new Blob([n.data],{type:"application/octet-stream;charset=utf-8"});L()(o,"".concat(n.site_url.replace("http://","").replace("https://","").replace(".","-").replace("/","-"),"-export.dat")),b(!1)}}))}))}catch(e){}}},Object(c.__)("Export","blocksy-companion"))))}}))},H=n(5),V=n.n(H),$=n(8),G=n(9),Y=n.n(G),q=n(10),J=n.n(q),W=n(11),X=n.n(W);function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q(e){return function(e){if(Array.isArray(e))return ne(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||te(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t,n,o,r,c,a){try{var i=e[c](a),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(o,r)}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],o=!0,r=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(o=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,c=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw c}}return n}(e,t)||te(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){if(e){if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ne(e,t):void 0}}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var oe=J()(),re=function(e){e.forcedEdit;var t,n,r=e.headerId,i=ee(Object(o.useState)(!1),2),l=i[0],u=i[1],s=ee(Object(o.useState)(null),2),p=s[0],d=s[1],f=Object(o.useContext)(a.PlacementsDragDropContext),m=(f.builderValueCollection,f.builderValueDispatch,Object(o.useRef)()),b=X()(oe),y=Y()("".concat(blocksy_admin.ajax_url,"?action=blocksy_header_get_all_conditions"),{method:"POST",formatter:(t=regeneratorRuntime.mark((function e(t){var n,o,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(n=e.sent,o=n.success,r=n.data,o&&r.conditions){e.next=7;break}throw new Error;case 7:return e.abrupt("return",r.conditions);case 8:case"end":return e.stop()}}),e)})),n=function(){var e=this,n=arguments;return new Promise((function(o,r){var c=t.apply(e,n);function a(e){Z(c,o,r,a,i,"next",e)}function i(e){Z(c,o,r,a,i,"throw",e)}a(void 0)}))},function(e){return n.apply(this,arguments)}),depends:[b]}),O=y.data,j=y.isLoading;y.error;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){j||(e.preventDefault(),e.stopPropagation(),u(!0))}},Object(c.__)("Add/Edit Conditions","blocksy-companion")),Object(o.createElement)(a.Overlay,{items:l,initialFocusRef:m,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){u(!1),d(null)},render:function(){var e;return Object(o.createElement)("div",{className:"ct-modal-content",ref:m},Object(o.createElement)("h2",null,sprintf(Object(c.__)("Display Conditions","blocksy-companion"))),Object(o.createElement)("p",null,Object(c.__)("Add one or more conditions in order to display your header.","blocksy-companion")),Object(o.createElement)("div",{className:"ct-modal-scroll"},Object(o.createElement)(a.OptionsPanel,{onChange:function(e,t){d((function(e){return[].concat(Q((e||O).filter((function(e){return e.id!==r}))),[{id:r,conditions:t}])}))},options:{conditions:(e={type:"blocksy-display-condition",design:"none",value:[]},K(e,"design","none"),K(e,"label",!1),e)},value:{conditions:((p||O).find((function(e){return e.id===r}))||{conditions:[]}).conditions},hasRevertButton:!1})),Object(o.createElement)("div",{className:"ct-modal-actions has-divider"},Object(o.createElement)("button",{className:"button-primary",disabled:!p,onClick:function(){fetch("".concat(wp.ajax.settings.url,"?action=blocksy_header_update_all_conditions"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(p)}).then((function(e){return e.json()})).then((function(){oe(),u(!1)}))}},Object(c.__)("Save Conditions","blocksy-companion"))))}}))};function ce(){return(ce=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],o=!0,r=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(o=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,c=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return se(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var pe=function(){var e=ue(Object(o.useState)(!1),2),t=e[0],n=e[1],i=(ct_customizer_localizations.header_builder_data.secondary_items.header,ct_customizer_localizations.header_builder_data.header,Object(o.useContext)(a.PlacementsDragDropContext)),u=i.builderValueDispatch,s=i.builderValue,p=(i.option,i.builderValueCollection),d=i.panelsActions,f=Object($.applyFilters)("blocksy.header.available-sections",null,p.sections)||p.sections.filter((function(e){var t=e.id;return"type-2"!==t&&"type-3"!==t&&-1===t.indexOf("ct-custom")}));return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("ul",{className:l()("ct-panels-manager")},f.map((function(e){var t=e.name,r=e.id,i=t||{"type-1":Object(c.__)("Global Header","blocksy")}[r]||r,p="builder_header_panel_".concat(r),f=ct_customizer_localizations.header_builder_data.header_data.header_options,m={label:i,"inner-options":ie(ie({},r.indexOf("ct-custom")>-1?{conditions_button:{label:Object(c.__)("Edit Conditions","blocksy-companion"),type:"jsx",design:"block",render:function(){return Object(o.createElement)(re,{headerId:r})}},divider:{type:"ct-divider"}}:{}),f)};return Object(o.createElement)(a.PanelMetaWrapper,ce({id:p,key:r,option:m},d,{getActualOption:function(e){var t=e.open;return Object(o.createElement)(o.Fragment,null,r===s.id&&Object(o.createElement)(a.Panel,{id:p,getValues:function(){return ie({id:r},s.settings||{})},option:m,onChangeFor:function(e,t){u({type:"BUILDER_GLOBAL_SETTING_ON_CHANGE",payload:{optionId:e,optionValue:t,values:Object(a.getValueFromInput)(f,Array.isArray(s.settings)?{}:s.settings||{})}})},view:"simple"}),Object(o.createElement)("li",{className:l()({active:r===s.id,"ct-global":"type-1"===r}),onClick:function(){r===s.id?t():u({type:"PICK_BUILDER_SECTION",payload:{id:r}})}},Object(o.createElement)("span",{className:"ct-panel-name"},i),r.indexOf("ct-custom")>-1&&r!==s.id&&Object(o.createElement)("span",{className:"ct-remove-instance",onClick:function(e){e.preventDefault(),e.stopPropagation(),n(r)}},Object(o.createElement)("i",{className:"ct-tooltip-top"},Object(c.__)("Remove header","blocksy-companion")),Object(o.createElement)("svg",{width:"11px",height:"11px",viewBox:"0 0 24 24"},Object(o.createElement)("path",{d:"M9.6,0l0,1.2H1.2v2.4h21.6V1.2h-8.4l0-1.2H9.6z M2.8,6l1.8,15.9C4.8,23.1,5.9,24,7.1,24h9.9c1.2,0,2.2-0.9,2.4-2.1L21.2,6H2.8z"})))))}}))}))),Object(o.createElement)(r.Slot,{name:"PlacementsBuilderPanelsManagerAfter"},(function(e){return 0===e.length?null:e})),Object(o.createElement)(a.Overlay,{items:t,className:"ct-admin-modal ct-reset-options",onDismiss:function(){return n(!1)},render:function(){return Object(o.createElement)("div",{className:"ct-modal-content"},Object(o.createElement)("h2",{className:"ct-modal-title"},Object(c.__)("Remove Header","blocksy-companion")),Object(o.createElement)("p",null,Object(c.__)("You are about to remove a custom header, are you sure you want to continue?","blocksy-companion")),Object(o.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},Object(o.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),n(!1)},className:"button"},Object(c.__)("Cancel","blocksy-companion")),Object(o.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault(),u({type:"REMOVE_BUILDER_SECTION",payload:{id:t}}),n(!1)}},Object(c.__)("Confirm","blocksy-companion"))))}}))};V.a.on("blocksy:options:before-option",(function(e){if(e.option&&"ct-header-builder"===e.option.type){var t=e.content;e.content=Object(o.createElement)(o.Fragment,null,t,Object(o.createElement)(r.Fill,{name:"PlacementsBuilderPanelsManager"},Object(o.createElement)(pe,null)))}})),V.a.on("blocksy:options:register",(function(e){e["blocksy-display-condition"]=I,e["blocksy-customizer-options-manager"]=B}))}]);
 
 
 
 
 
 
 
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=17)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.blocksyOptions},function(e,t,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===c)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.ctEvents},function(e,t){e.exports=window.React},function(e,t,n){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r="object"===("undefined"==typeof window?"undefined":n(window))&&window.window===window?window:"object"===("undefined"==typeof self?"undefined":n(self))&&self.self===self?self:"object"===(void 0===t?"undefined":n(t))&&t.global===t?t:this;function o(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){i(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function c(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"!==("undefined"==typeof window?"undefined":n(window))||window!==r?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var i=r.URL||r.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin!==location.origin?c(l.href)?o(e,t,n):a(l,l.target="_blank"):a(l)):(l.href=i.createObjectURL(e),setTimeout((function(){i.revokeObjectURL(l.href)}),4e4),setTimeout((function(){a(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download","string"==typeof e)if(c(e))o(e,t,r);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){a(i)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!==n(t)&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,r),t)}:function(e,t,c,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return o(e,t,c);var i="application/octet-stream"===e.type,l=/constructor/i.test(r.HTMLElement)||r.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||i&&l)&&"object"===("undefined"==typeof FileReader?"undefined":n(FileReader))){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},s.readAsDataURL(e)}else{var p=r.URL||r.webkitURL,d=p.createObjectURL(e);a?a.location=d:location.href=d,a=null,setTimeout((function(){p.revokeObjectURL(d)}),4e4)}};e.exports=i}).call(this,n(13))},function(e,t,n){var r,o,c;
7
+ /*!
8
+ * php-unserialize-js JavaScript Library
9
+ * https://github.com/bd808/php-unserialize-js
10
+ *
11
+ * Copyright 2013 Bryan Davis and contributors
12
+ * Released under the MIT license
13
+ * http://www.opensource.org/licenses/MIT
14
+ */!function(n,a){"use strict";o=[],void 0===(c="function"==typeof(r=function(){return function(e){var t,n=0,r=[],o=0,c=function(){var t=e.indexOf(":",n),r=e.substring(n,t);return n=t+2,parseInt(r,10)},a=function(){var t=e.indexOf(";",n),r=e.substring(n,t);return n=t+1,parseInt(r,10)},i=function(t='"'){for(var r,o,a=c(),i=0,l=0;l<a;)(r=e.charCodeAt(n+i++))<=127?l++:l+=r>2047?3:2;return e.charAt(n+i)!==t&&(i+=e.indexOf('"',n+i)-n-i),o=e.substring(n,n+i),n+=i+2,o},l=function(){var t=e.charAt(n);return n+=2,t},u=function(){var e=l();switch(e){case"i":return a();case"s":return i();default:throw new Error("Unknown key type '"+e+"' at position "+(n-2))}},s=function(e,t){var r,o,c;if("\0"===e.charAt(0)){if((c=e.indexOf("\0",1))>0)return r=e.substring(1,c),o=e.substr(c+1),"*"===r||t===r?o:r+"::"+o;var a="Expected two <NUL> characters in non-public property name '"+e+"' at position "+(n-e.length-2);throw new Error(a)}return e};return(t=function(){var p,d,f=l();switch(f){case"i":return d=a(),r[o++]=d,d;case"d":return function(){var t=e.indexOf(";",n),c=e.substring(n,t);return n=t+1,c=parseFloat(c),r[o++]=c,c}();case"b":return function(){var t=e.indexOf(";",n),c=e.substring(n,t);return n=t+1,c="1"===c,r[o++]=c,c}();case"s":return function(){var e=i();return r[o++]=e,e}();case"a":return function(){var e,a,i,l,s,p=c(),d=[],f={},b=d,m=o++;r[m]=b;try{for(i=0;i<p;i++)if(e=u(),a=t(),b===d&&e+""==i+"")d.push(a);else{if(b!==f){for(l=0,s=d.length;l<s;l++)f[l]=d[l];b=f,r[m]=b}f[e]=a}}catch(e){throw e.state=b,e}return n++,b}();case"O":return function(){var e,a,l,p,d={},f=o++,b=i();r[f]=d,e=c();try{for(p=0;p<e;p++)a=s(u(),b),l=t(),d[a]=l}catch(e){throw e.state=d,e}return n++,d}();case"C":return{__PHP_Incomplete_Class_Name:i(),serialized:i("}")};case"r":return function(){var e=a(),t=r[e-1];return r[o++]=t,t}();case"R":return p=a(),r[p-1];case"N":return r[o++]=null,null;default:throw new Error("Unknown type '"+f+"' at position "+(n-2))}})()}})?r.apply(t,o):r)||(e.exports=c)}()},function(e,t){e.exports=window.wp.hooks},function(e,t,n){var r=n(14);function o(e,t,n,r,c){var a=new Error(n,r,c);return a.name="UseFetchError",a.status=e,a.statusText=t,Object.setPrototypeOf(a,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(a,o),a}o.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(o,Error),e.exports=function(e,t,n){var c=(n&&n.depends||t&&t.depends||[]).reduce((function(e,t){return e||!t}),!1);return r(!c&&function(e,t,n){return fetch(e,t).then(n&&n.formatter||t&&t.formatter||function(e){if(!e.ok)throw new o(e.status,e.statusText,"Fetch error");return e.json()})},e,t||{},n||{})}},function(e,t,n){var r=n(16);e.exports=function(){var e=function(){e.id=r(),e.subscribers.forEach((function(e){e()}))};return e.id=r(),e.subscribers=[],e.subscribe=function(t){e.subscribers.push(t)},e.unsubscribe=function(t){e.subscribers.indexOf(t)>=0&&e.subscribers.splice(e.subscribers.indexOf(t),1)},e}},function(e,t,n){var r=n(6);e.exports=function(e){var t=r.useState(e.id),n=function(){return t[1](e.id)};return r.useEffect((function(){return e.subscribe(n),function(){return e.unsubscribe(n)}}),[]),t[0]}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(6),o=n(15);e.exports=function(e){var t=Array.prototype.slice.call(arguments,[1]),n=r.useState({isLoading:!!e});return r.useEffect((function(){e&&(!n[0].isLoading&&n[1]({data:n[0].data,isLoading:!0}),e.apply(null,t).then((function(e){n[1]({data:e,isLoading:!1})})).catch((function(e){n[1]({error:e,isLoading:!1})})))}),o(t)),n[0]}},function(e,t){e.exports=function e(){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(r instanceof Array)for(var o=0;o<r.length;o++)t=t.concat(e(r[o]));else if("undefined"!=typeof URL&&r instanceof URL)t=t.concat(r.toJSON());else if(r instanceof Object)for(var c=Object.keys(r),a=0;a<c.length;a++){var i=c[a];t=t.concat([i]).concat(e(r[i]))}else t=t.concat(r)}return t}},function(e,t,n){for(var r=self.crypto||self.msCrypto,o="-_",c=36;c--;)o+=c.toString(36);for(c=36;c---10;)o+=c.toString(36).toUpperCase();e.exports=function(e){var t="",n=r.getRandomValues(new Uint8Array(e||21));for(c=e||21;c--;)t+=o[63&n[c]];return t}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(4),c=n(1),a=n(2),i=n(3),l=n.n(i);function u(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var y=function(e){return e.filter((function(e,t,n){return n.findIndex((function(t){return t.ID===e.ID}))===t}))},O=[],h=function(e){var t=e.condition,n=e.onChange,o=f(Object(r.useState)(O),2),i=o[0],l=o[1],s=Object(r.useMemo)((function(){return{post_ids:"post",page_ids:"page",custom_post_type_ids:"ct_cpt"}[t.rule]}),[t.rule]),d=Object(r.useMemo)((function(){return(t.payload||{}).post_id||""}),[t.payload&&t.payload.post_id]),b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";fetch("".concat(wp.ajax.settings.url,"?action=blocksy_conditions_get_all_posts"),{headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(p(p({post_type:s},e?{search_query:e}:{}),d?{alsoInclude:d}:{})),method:"POST"}).then((function(e){return e.json()})).then((function(e){var t=e.data.posts;l((function(e){return y([].concat(u(e),u(t)))})),O=y([].concat(u(O),u(t)))}))};return Object(r.useEffect)((function(){b()}),[s]),Object(r.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,searchPlaceholder:Object(c.__)("Type to search by ID or title...","blocksy-companion"),placeholder:"post_ids"===t.rule?Object(c.__)("Select post","blocksy-companion"):"page_ids"===t.rule?Object(c.__)("Select page","blocksy-companion"):Object(c.__)("Custom Post Type ID","blocksy-companion"),choices:i.filter((function(e){var t=e.post_type;return"ct_cpt"===s?"post"!==t&&"page"!==t:s===t})).map((function(e){return{key:e.ID,value:e.post_title}})),search:!0},value:d,onChange:function(e){return n(e)},onInputValueChange:function(e){i.find((function(t){return t.post_title===e}))||b(e)}})};function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||k(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){E(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||k(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var x=[],C=[],A=[],N=[],P=function(e){var t=e.value,n=e.onChange,o=blocksy_admin.all_condition_rules.reduce((function(e,t){var n=t.rules,r=t.title;return[].concat(w(e),w(n.map((function(e){return g(g({},e),{},{group:r})}))))}),[]).reduce((function(e,t){var n=t.title,r=t.id,o=j(t,["title","id"]);return[].concat(w(e),[g({key:r,value:n},o)])}),[]),i=v(Object(r.useState)(x),2),u=(i[0],i[1],v(Object(r.useState)(C),2)),s=u[0],p=u[1],d=v(Object(r.useState)(A),2),f=d[0],b=d[1],m=v(Object(r.useState)(N),2),y=m[0],O=m[1],_=function(e){return"post_ids"===e.rule||"page_ids"===e.rule||"custom_post_type_ids"===e.rule||"taxonomy_ids"===e.rule||"post_with_taxonomy_ids"===e.rule||"current_language"===e.rule||"user_post_author_id"===e.rule};return Object(r.useEffect)((function(){fetch("".concat(wp.ajax.settings.url,"?action=blocksy_conditions_get_all_taxonomies"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"}).then((function(e){return e.json()})).then((function(e){var t=e.data,n=t.taxonomies,r=t.languages,o=t.users;p(n),C=n,b(r),A=r,O(o),N=o}))}),[]),Object(r.createElement)("div",{className:"ct-display-conditions"},t.map((function(e,i){return Object(r.createElement)("div",{className:l()("ct-condition-group",{"ct-cols-3":_(e),"ct-cols-2":!_(e)}),key:i},Object(r.createElement)(a.Select,{key:"first",option:{inputClassName:"ct-condition-type",selectInputStart:function(){return Object(r.createElement)("span",{className:"ct-".concat(e.type)})},placeholder:Object(c.__)("Select variation","blocksy-companion"),choices:{include:Object(c.__)("Include","blocksy-companion"),exclude:Object(c.__)("Exclude","blocksy-companion")}},value:e.type,onChange:function(r){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{type:r}):t)})))}}),Object(r.createElement)(a.Select,{key:"second",option:{appendToBody:!0,placeholder:Object(c.__)("Select rule","blocksy-companion"),choices:"user"===e.category?o.filter((function(e){return 0===e.key.indexOf("user_")})):o.filter((function(e){return-1===e.key.indexOf("user_")})),search:!0},value:e.rule,onChange:function(r){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{rule:r}):t)})))}}),("post_ids"===e.rule||"custom_post_type_ids"===e.rule||"page_ids"===e.rule)&&Object(r.createElement)(h,{condition:e,onChange:function(r){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{payload:g(g({},e.payload),{},{post_id:r})}):t)})))}}),("taxonomy_ids"===e.rule||"post_with_taxonomy_ids"===e.rule)&&Object(r.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:Object(c.__)("Select taxonomy","blocksy-companion"),choices:s.map((function(e){return g({key:e.id,value:e.name},e.group?{group:e.group}:{})})),search:!0},value:(e.payload||{}).taxonomy_id||"",onChange:function(r){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{payload:g(g({},e.payload),{},{taxonomy_id:r})}):t)})))}}),"current_language"===e.rule&&Object(r.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:Object(c.__)("Select language","blocksy-companion"),choices:f.map((function(e){return{key:e.id,value:e.name}})),search:!0},value:(e.payload||{}).language||"",onChange:function(r){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{payload:g(g({},e.payload),{},{language:r})}):t)})))}}),"user_post_author_id"===e.rule&&Object(r.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:Object(c.__)("Select user","blocksy-companion"),choices:[{key:"current_user",value:Object(c.__)("Current user","blocksy-companion")}].concat(w(y.map((function(e){return{key:e.id,value:e.name}})))),search:!0},value:(e.payload||{}).user_id||"",onChange:function(r){n(t.map((function(t,n){return g({},n===i?g(g({},e),{},{payload:g(g({},e.payload),{},{user_id:r})}):t)})))}}),Object(r.createElement)("button",{type:"button",onClick:function(e){e.preventDefault();var r=w(t);r.splice(i,1),n(r)}},"×"))})),Object(r.createElement)("div",{className:"ct-conditions-actions"},Object(r.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),n([].concat(w(t),[{type:"include",rule:"everywhere",payload:{}}]))}},Object(c.__)("Add Display Condition","blocksy-companion")),Object(r.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),n([].concat(w(t),[{type:"include",rule:"user_logged_in",payload:{},category:"user"}]))}},Object(c.__)("Add User Condition","blocksy-companion"))))};function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var I=function(e){var t=e.option,n=t.display,o=void 0===n?"inline":n,i=t.modalTitle,l=void 0===i?Object(c.__)("Transparent Header Display Conditions","blocksy-companion"):i,u=t.modalDescription,s=void 0===u?Object(c.__)("Add one or more conditions to display the transparent header.","blocksy-companion"):u,p=e.value,d=e.onChange,f=T(Object(r.useState)(!1),2),b=f[0],m=f[1],y=T(Object(r.useState)(null),2),O=y[0],h=y[1];return"inline"===o?Object(r.createElement)(P,{value:p,onChange:d}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){e.preventDefault(),m(!0),h(null)}},Object(c.__)("Add/Edit Conditions","blocksy-companion")),Object(r.createElement)(a.Overlay,{items:b,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){m(!1),h(null)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("h2",null,l),Object(r.createElement)("p",null,s),Object(r.createElement)("div",{className:"ct-modal-scroll"},Object(r.createElement)(P,{value:O||p,onChange:function(e){h(e)}})),Object(r.createElement)("div",{className:"ct-modal-actions has-divider"},Object(r.createElement)("button",{className:"button-primary",disabled:!O,onClick:function(){d(O),m(!1)}},Object(c.__)("Save Conditions","blocksy-companion"))))}}))},z=n(7),L=n.n(z),R=n(8),F=n.n(R);function U(e){return function(e){if(Array.isArray(e))return H(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||B(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||B(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){if(e){if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(e,t):void 0}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var V=function(){var e=M(Object(r.useState)(null),2),t=e[0],n=e[1],o=M(Object(r.useState)(null),2),i=o[0],u=o[1],s=M(Object(r.useState)(!1),2),p=s[0],d=s[1],f=M(Object(r.useState)(!1),2),b=f[0],m=f[1],y=M(Object(r.useState)(["options"]),2),O=y[0],h=y[1],v=Object(r.useRef)(),j=Object(r.useRef)();return Object(r.useEffect)((function(){var e=function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy",d(!0)},t=function(e){e.stopPropagation(),e.preventDefault(),d(!1)},r=function(e){e.stopPropagation(),e.preventDefault(),d(!1);var t=Array.from(e.dataTransfer.files||[]);if(Array.from(e.dataTransfer.items||[]).length>0){var r=e.dataTransfer.items[0].getAsFile();n(r)}else t.length>0&&n(t[0])};return j.current.addEventListener("dragover",e,!1),j.current.addEventListener("dragleave",t,!1),j.current.addEventListener("drop",r,!1),function(){j.current.removeEventListener("dragover",e,!1),j.current.removeEventListener("dragleave",t,!1),j.current.removeEventListener("drop",r,!1)}}),[]),Object(r.createElement)("div",{className:"ct-import-export"},Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Export Options","blocksy-companion")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Easily export the theme customizer settings.","blocksy-companion"))),Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),m(!0)}},Object(c.__)("Export Customizations","blocksy-companion")))),Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Import Options","blocksy-companion")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Easily import the theme customizer settings.","blocksy-companion"))),Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("div",{className:"ct-file-upload"},Object(r.createElement)("button",{type:"button",className:l()("button ct-upload-button",{active:p}),ref:j,onClick:function(){v.current.click()}},t?t.name:Object(c.__)("Click or drop to upload a file...","blocksy-companion")),Object(r.createElement)("input",{ref:v,type:"file",onChange:function(e){var t=M(e.target.files,1)[0];n(t)}}),Object(r.createElement)("button",{className:"button",onClick:function(e){if(e.preventDefault(),t){var n=new FileReader;n.readAsText(t,"UTF-8"),n.onload=function(e){try{fetch("".concat(window.ajaxurl,"?action=blocksy_customizer_import&wp_customize=on&nonce=").concat(ct_customizer_localizations.customizer_reset_none),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(F()(e.target.result))}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}}}},Object(c.__)("Import Customizations","blocksy-companion"))))),ct_customizer_localizations.has_child_theme&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Copy Options","blocksy-companion")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Copy and import your customizations from parent or child theme.","blocksy-companion"))),ct_customizer_localizations.is_parent_theme&&Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),u("child")}},Object(c.__)("Copy From Child Theme","blocksy-companion")))),!ct_customizer_localizations.is_parent_theme&&Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),u("parent")}},Object(c.__)("Copy From Parent Theme","blocksy-companion"))))),Object(r.createElement)(a.Overlay,{items:i,className:"ct-admin-modal ct-import-export-modal",onDismiss:function(){return u(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("svg",{width:"35",height:"35",viewBox:"0 0 66 66"},Object(r.createElement)("path",{d:"M66 33.1c0 2.8-.4 5.5-1.1 8.2 0 0-1.7-.6-1.9-.6 3.4-13.1-2.2-27.4-14.5-34.5C41.3 2 33 .9 25 3.1c-3.5.9-6.7 2.4-9.5 4.4L20 12 6 15 9 1l5 5c3.1-2.2 6.6-3.9 10.5-4.9 2.7-.7 5.4-1.1 8-1.1 5.9-.1 11.7 1.4 17 4.4C60.1 10.5 66 21.7 66 33.1zm-49 6.3l2.4-3c-.3-1.2-.4-2.3-.4-3.4s.1-2.2.4-3.3l-2.4-3 2.5-4.3 3.8.5c1.6-1.6 3.6-2.7 5.8-3.3l1.4-3.6h5l1.4 3.6c2.2.6 4.2 1.8 5.8 3.3l3.8-.5 2.5 4.3-2.4 3c.3 1.1.4 2.2.4 3.3s-.1 2.2-.4 3.3l2.4 3-2.5 4.3-3.8-.5c-1.6 1.6-3.6 2.7-5.8 3.3L35.4 50h-5L29 46.4c-2.2-.6-4.2-1.8-5.8-3.3l-3.8.5-2.4-4.2zm8-6.4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8-8 3.6-8 8zm25.9 25.3c-3 2.1-6.3 3.7-9.9 4.7-8 2.1-16.4 1-23.5-3.1C5.2 52.8-.4 38.5 3 25.4c-.7-.1-1.3-.3-2-.5-.7 2.7-1 5.3-1 8 0 11.4 5.9 22.5 16.5 28.6 7.6 4.4 16.5 5.6 25 3.3 4-1.1 7.6-2.8 10.8-5.2l4.6 4.6 3-14-14 3 5 5.1z"})),Object(r.createElement)("h2",{className:"ct-modal-title"},!ct_customizer_localizations.is_parent_theme&&Object(c.__)("Copy From Parent Theme","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&Object(c.__)("Copy From Child Theme","blocksy-companion")),Object(r.createElement)("p",null,!ct_customizer_localizations.is_parent_theme&&Object(c.__)("You are about to copy all the settings from your parent theme into the child theme. Are you sure you want to continue?","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&Object(c.__)("You are about to copy all the settings from your child theme into the parent theme. Are you sure you want to continue?","blocksy-companion")),Object(r.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},Object(r.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),u(!1)},className:"button"},Object(c.__)("Cancel","blocksy-companion")),Object(r.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_copy_options"),t.append("wp_customize","on"),t.append("strategy",i);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}},Object(c.__)("Yes, I am sure","blocksy-companion"))))}}),Object(r.createElement)(a.Overlay,{items:b,className:"ct-admin-modal ct-export-modal",onDismiss:function(){return m(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("h2",{className:"ct-modal-title"},Object(c.__)("Export Settings","blocksy-companion")),Object(r.createElement)("p",null,Object(c.__)("Choose what set of settings you want to export.","blocksy-companion")),Object(r.createElement)("div",{className:"ct-export-options"},["options","widgets"].map((function(e){return Object(r.createElement)("div",{className:"ct-checkbox-container",onClick:function(){1===O.length&&O[0]===e||h((function(t){return t.includes(e)?t.filter((function(t){return t!==e})):[].concat(U(t),[e])}))}},{options:Object(c.__)("Customizer settings","blocksy-companion"),widgets:Object(c.__)("Widgets settings","blocksy-companion")}[e],Object(r.createElement)("span",{className:l()("ct-checkbox",{active:O.includes(e)})},Object(r.createElement)("svg",{width:"10",height:"8",viewBox:"0 0 11.2 9.1"},Object(r.createElement)("polyline",{className:"check",points:"1.2,4.8 4.4,7.9 9.9,1.2 "}))))}))),Object(r.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},Object(r.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),m(!1)},className:"button"},Object(c.__)("Cancel","blocksy-companion")),Object(r.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_export"),t.append("strategy",O.join(":")),t.append("wp_customize","on");try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){var t=e.success,n=e.data;if(t){var r=new Blob([n.data],{type:"application/octet-stream;charset=utf-8"});L()(r,"".concat(n.site_url.replace("http://","").replace("https://","").replace(".","-").replace("/","-"),"-export.dat")),m(!1)}}))}))}catch(e){}}},Object(c.__)("Export","blocksy-companion"))))}}))},$=n(5),G=n.n($),J=n(9),Y=n(10),q=n.n(Y),W=n(11),X=n.n(W),K=n(12),Q=n.n(K);function Z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(e){return function(e){if(Array.isArray(e))return oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||re(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t,n,r,o,c,a){try{var i=e[c](a),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,o)}function ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||re(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(e,t){if(e){if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oe(e,t):void 0}}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ce=X()(),ae=function(e){e.forcedEdit;var t,n,o=e.headerId,i=ne(Object(r.useState)(!1),2),l=i[0],u=i[1],s=ne(Object(r.useState)(null),2),p=s[0],d=s[1],f=Object(r.useContext)(a.PlacementsDragDropContext),b=(f.builderValueCollection,f.builderValueDispatch,Object(r.useRef)()),m=Q()(ce),y=q()("".concat(blocksy_admin.ajax_url,"?action=blocksy_header_get_all_conditions"),{method:"POST",formatter:(t=regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(n=e.sent,r=n.success,o=n.data,r&&o.conditions){e.next=7;break}throw new Error;case 7:return e.abrupt("return",o.conditions);case 8:case"end":return e.stop()}}),e)})),n=function(){var e=this,n=arguments;return new Promise((function(r,o){var c=t.apply(e,n);function a(e){te(c,r,o,a,i,"next",e)}function i(e){te(c,r,o,a,i,"throw",e)}a(void 0)}))},function(e){return n.apply(this,arguments)}),depends:[m]}),O=y.data,h=y.isLoading;y.error;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){h||(e.preventDefault(),e.stopPropagation(),u(!0))}},Object(c.__)("Add/Edit Conditions","blocksy-companion")),Object(r.createElement)(a.Overlay,{items:l,initialFocusRef:b,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){u(!1),d(null)},render:function(){var e;return Object(r.createElement)("div",{className:"ct-modal-content",ref:b},Object(r.createElement)("h2",null,sprintf(Object(c.__)("Display Conditions","blocksy-companion"))),Object(r.createElement)("p",null,Object(c.__)("Add one or more conditions in order to display your header.","blocksy-companion")),Object(r.createElement)("div",{className:"ct-modal-scroll"},Object(r.createElement)(a.OptionsPanel,{onChange:function(e,t){d((function(e){return[].concat(ee((e||O).filter((function(e){return e.id!==o}))),[{id:o,conditions:t}])}))},options:{conditions:(e={type:"blocksy-display-condition",design:"none",value:[]},Z(e,"design","none"),Z(e,"label",!1),e)},value:{conditions:((p||O).find((function(e){return e.id===o}))||{conditions:[]}).conditions},hasRevertButton:!1})),Object(r.createElement)("div",{className:"ct-modal-actions has-divider"},Object(r.createElement)("button",{className:"button-primary",disabled:!p,onClick:function(){fetch("".concat(wp.ajax.settings.url,"?action=blocksy_header_update_all_conditions"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(p)}).then((function(e){return e.json()})).then((function(){ce(),u(!1)}))}},Object(c.__)("Save Conditions","blocksy-companion"))))}}))};function ie(){return(ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return de(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return de(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fe=function(){var e=pe(Object(r.useState)(!1),2),t=e[0],n=e[1],i=(ct_customizer_localizations.header_builder_data.secondary_items.header,ct_customizer_localizations.header_builder_data.header,Object(r.useContext)(a.PlacementsDragDropContext)),u=i.builderValueDispatch,s=i.builderValue,p=(i.option,i.builderValueCollection),d=i.panelsActions,f=Object(J.applyFilters)("blocksy.header.available-sections",null,p.sections)||p.sections.filter((function(e){var t=e.id;return"type-2"!==t&&"type-3"!==t&&-1===t.indexOf("ct-custom")}));return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("ul",{className:l()("ct-panels-manager")},f.map((function(e){var t=e.name,o=e.id,i=t||{"type-1":Object(c.__)("Global Header","blocksy")}[o]||o,p="builder_header_panel_".concat(o),f=ct_customizer_localizations.header_builder_data.header_data.header_options,b={label:i,"inner-options":ue(ue({},o.indexOf("ct-custom")>-1?{conditions_button:{label:Object(c.__)("Edit Conditions","blocksy-companion"),type:"jsx",design:"block",render:function(){return Object(r.createElement)(ae,{headerId:o})}},divider:{type:"ct-divider"}}:{}),f)};return Object(r.createElement)(a.PanelMetaWrapper,ie({id:p,key:o,option:b},d,{getActualOption:function(e){var t=e.open;return Object(r.createElement)(r.Fragment,null,o===s.id&&Object(r.createElement)(a.Panel,{id:p,getValues:function(){return ue({id:o},s.settings||{})},option:b,onChangeFor:function(e,t){u({type:"BUILDER_GLOBAL_SETTING_ON_CHANGE",payload:{optionId:e,optionValue:t,values:Object(a.getValueFromInput)(f,Array.isArray(s.settings)?{}:s.settings||{})}})},view:"simple"}),Object(r.createElement)("li",{className:l()({active:o===s.id,"ct-global":"type-1"===o}),onClick:function(){o===s.id?t():u({type:"PICK_BUILDER_SECTION",payload:{id:o}})}},Object(r.createElement)("span",{className:"ct-panel-name"},i),o.indexOf("ct-custom")>-1&&o!==s.id&&Object(r.createElement)("span",{className:"ct-remove-instance",onClick:function(e){e.preventDefault(),e.stopPropagation(),n(o)}},Object(r.createElement)("i",{className:"ct-tooltip-top"},Object(c.__)("Remove header","blocksy-companion")),Object(r.createElement)("svg",{width:"11px",height:"11px",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M9.6,0l0,1.2H1.2v2.4h21.6V1.2h-8.4l0-1.2H9.6z M2.8,6l1.8,15.9C4.8,23.1,5.9,24,7.1,24h9.9c1.2,0,2.2-0.9,2.4-2.1L21.2,6H2.8z"})))))}}))}))),Object(r.createElement)(o.Slot,{name:"PlacementsBuilderPanelsManagerAfter"},(function(e){return 0===e.length?null:e})),Object(r.createElement)(a.Overlay,{items:t,className:"ct-admin-modal ct-reset-options",onDismiss:function(){return n(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("h2",{className:"ct-modal-title"},Object(c.__)("Remove Header","blocksy-companion")),Object(r.createElement)("p",null,Object(c.__)("You are about to remove a custom header, are you sure you want to continue?","blocksy-companion")),Object(r.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},Object(r.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),n(!1)},className:"button"},Object(c.__)("Cancel","blocksy-companion")),Object(r.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault(),u({type:"REMOVE_BUILDER_SECTION",payload:{id:t}}),n(!1)}},Object(c.__)("Confirm","blocksy-companion"))))}}))};G.a.on("blocksy:options:before-option",(function(e){if(e.option&&"ct-header-builder"===e.option.type){var t=e.content;e.content=Object(r.createElement)(r.Fragment,null,t,Object(r.createElement)(o.Fill,{name:"PlacementsBuilderPanelsManager"},Object(r.createElement)(fe,null)))}})),G.a.on("blocksy:options:register",(function(e){e["blocksy-display-condition"]=I,e["blocksy-customizer-options-manager"]=V}))}]);
static/bundle/options.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.22
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.23
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
static/bundle/sticky.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e){t.exports=window.ctEvents},function(t,e){t.exports=window.ctFrontend},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=r(1),a=function(t,e,r){return Math.max(t,Math.min(e,r))},c=function(t,e,r){return e[0]+(e[1]-e[0])/(t[1]-t[0])*(r-t[0])},s=function(t){if(t.blcInitialHeight)return t.blcInitialHeight;var e=t.firstElementChild.firstElementChild.getBoundingClientRect().height;return t.blcInitialHeight=e,e},u=function(t){var e=getComputedStyle(t),r=100;t.dataset.row.includes("middle")&&(r=e.getPropertyValue("--sticky-shrink"));var n=s(t);return r&&(n*=parseFloat(r)/100),n};function l(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var y=null,f=function(t){var e=t.stickyContainer,r=t.startPosition;l(e.querySelectorAll('[data-row*="middle"]')).map((function(t){if(t.querySelector('[data-id="logo"] .site-logo-container')){var e=t.querySelector('[data-id="logo"] .site-logo-container'),n=function(t){var e=t.logo,r=t.row;if(y)return y;var n=parseFloat(getComputedStyle(e).getPropertyValue("--logo-max-height")||50),i=parseFloat(getComputedStyle(e).getPropertyValue("--logo-sticky-shrink").toString().replace(",",".")||1),o=s(r),a=u(r);return y={initialHeight:n,stickyShrink:i,rowInitialHeight:o,rowStickyHeight:a}}({logo:e,row:t}),i=n.initialHeight,o=n.stickyShrink,l=n.rowInitialHeight,d=n.rowStickyHeight,f=i*o;1!==o&&e.style.setProperty("--logo-shrink-height","".concat(c([r,r+Math.abs(l===d?i-f:l-d)],[1,o],a(r,r+Math.abs(l===d?i-f:l-d),scrollY))*i,"px"))}}))},m=null,h=function(t){var e=t.stickyContainer,r=(t.containerInitialHeight,t.startPosition);e.querySelector('[data-row*="middle"]')&&[e.querySelector('[data-row*="middle"]')].map((function(t){var e=function(t){var e=t.row;if(m)return m;var r=s(e),n=u(e);return m={rowInitialHeight:r,rowStickyHeight:n}}({row:t}),n=e.rowInitialHeight,i=e.rowStickyHeight;n!==i&&t.style.setProperty("--shrink-height","".concat(c([r,r+Math.abs(n-i)],[n,i],a(r,r+Math.abs(n-i),scrollY)),"px"))}))};function p(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return g(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function b(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var w=window.scrollY;function v(t){return function(t){if(Array.isArray(t))return A(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return A(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return A(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function S(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return O(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var j=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yes";Array.from(t.querySelectorAll("[data-row][data-transparent-row]")).map((function(t){t.dataset.transparentRow=e}))},x=null,C=null,I=null;i.a.on("ct:header:update",(function(){x=null,C=null,I=null,q()}));var P=function(t){if(-1===t.dataset.sticky.indexOf("shrink")&&-1===t.dataset.sticky.indexOf("auto-hide"))return t.parentNode.getBoundingClientRect().height+200;var e=t.closest("header").getBoundingClientRect().top+scrollY;if(e>0){var r=document.elementFromPoint(0,3);r&&function(t){for(var e=[];t&&t!==document;t=t.parentNode)e.push(t);return e}(r).map((function(t){return getComputedStyle(t).position})).indexOf("fixed")>-1&&(e-=r.getBoundingClientRect().height)}var n=t.parentNode;return 1===n.parentNode.children.length||n.parentNode.children[0].classList.contains("ct-sticky-container")?e:Array.from(n.parentNode.children).reduce((function(t,e,r){return t.indexOf(0)>-1||!e.dataset.row?[].concat(S(t),[0]):[].concat(S(t),[e.classList.contains("ct-sticky-container")?0:e.getBoundingClientRect().height])}),[]).reduce((function(t,e){return t+e}),e)},Y=null,q=function(){if(Y!==scrollY){Y=scrollY;var t=document.querySelector('[data-device="'.concat(Object(o.getCurrentScreen)(),'"] [data-sticky]'));if(t){var e=x;null===e&&(e=P(t),x=e);var r=I;r||(r=parseInt(t.getBoundingClientRect().height),I=parseInt(r),document.body.style.setProperty("--header-sticky-height-animated","".concat(S(t.querySelectorAll("[data-row]")).reduce((function(t,e){return t+u(e)}),0),"px")));var n=t.dataset.sticky.split(":").filter((function(t){return"yes"!==t&&"no"!==t&&"fixed"!==t})),i=e>0&&Math.abs(window.scrollY-e)<5||window.scrollY>e;n.indexOf("shrink")>-1&&(i=e>0?window.scrollY>=e:window.scrollY>0),setTimeout((function(){i&&-1===document.body.dataset.header.indexOf("shrink")&&(document.body.dataset.header="".concat(document.body.dataset.header,":shrink")),!i&&document.body.dataset.header.indexOf("shrink")>-1&&(document.body.dataset.header=document.body.dataset.header.replace(":shrink",""))}),300);var a=C;a||(a=C=Array.from(t.querySelectorAll("[data-row]")).reduce((function(t,e){return t+e.getBoundingClientRect().height}),0),t.parentNode.style.height="".concat(a,"px")),n.indexOf("shrink")>-1&&function(t){var e=t.containerInitialHeight,r=t.stickyContainer,n=(t.stickyContainerHeight,t.isSticky),i=t.startPosition,o=t.stickyComponents;if(0===i&&0===window.scrollY&&(r.dataset.sticky=["fixed"].concat(p(o)).join(":")),n){if(o.indexOf("yes")>-1)return;-1===r.dataset.sticky.indexOf("yes")&&(j(r,"no"),r.dataset.sticky=["yes"].concat(p(o)).join(":")),f({stickyContainer:r,startPosition:i}),h({stickyContainer:r,containerInitialHeight:e,startPosition:i})}else Array.from(r.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")})),Array.from(r.querySelectorAll('[data-row*="middle"] .site-logo-container')).map((function(t){return t.removeAttribute("style")})),j(r,"yes"),0===i&&0===window.scrollY?r.dataset.sticky=["fixed"].concat(p(o)).join(":"):r.dataset.sticky=o.join(":")}({stickyContainer:t,stickyContainerHeight:r,containerInitialHeight:a,isSticky:i,startPosition:e,stickyComponents:n}),n.indexOf("auto-hide")>-1&&function(t){var e=t.startPosition,r=t.stickyContainer,n=t.isSticky,i=t.stickyComponents;if(window.scrollY<e&&(w=window.scrollY),n&&window.scrollY-w==0&&document.body.style.setProperty("--header-sticky-height-animated","0px"),n&&window.scrollY-w<-5)-1===r.dataset.sticky.indexOf("yes")&&(r.dataset.sticky=["yes-start"].concat(b(i)).join(":"),requestAnimationFrame((function(){r.dataset.sticky=r.dataset.sticky.replace("yes-start","yes-end"),setTimeout((function(){r.dataset.sticky=r.dataset.sticky.replace("yes-end","yes")}),200)}))),j(r,"no"),document.body.removeAttribute("style");else{if(!n)return r.dataset.sticky=i.filter((function(t){return"yes-end"!==t})).join(":"),Array.from(r.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")})),j(r,"yes"),document.body.style.setProperty("--header-sticky-height-animated","0px"),void(w=window.scrollY);-1===r.dataset.sticky.indexOf("yes-hide")&&r.dataset.sticky.indexOf("yes:")>-1&&window.scrollY-w>5&&(r.dataset.sticky=["yes-hide-start"].concat(b(i)).join(":"),document.body.style.setProperty("--header-sticky-height-animated","0px"),requestAnimationFrame((function(){r.dataset.sticky=r.dataset.sticky.replace("yes-hide-start","yes-hide-end"),setTimeout((function(){r.dataset.sticky=i.join(":"),Array.from(r.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")})),j(r,"yes")}),200)})))}w=window.scrollY}({stickyContainer:t,isSticky:i,startPosition:e,stickyComponents:n}),(n.indexOf("slide")>-1||n.indexOf("fade")>-1)&&function(t){var e=t.stickyContainer,r=t.isSticky,n=t.startPosition,i=t.stickyComponents;r?(-1===e.dataset.sticky.indexOf("yes")&&(e.dataset.sticky=["yes-start"].concat(v(i)).join(":"),setTimeout((function(){e.dataset.sticky=e.dataset.sticky.replace("yes-start","yes-end"),setTimeout((function(){e.dataset.sticky=e.dataset.sticky.replace("yes-end","yes")}),200)}),1)),j(e,"no")):-1===e.dataset.sticky.indexOf("yes-hide")&&e.dataset.sticky.indexOf("yes:")>-1&&(Math.abs(window.scrollY-n)>10?(e.dataset.sticky=i.join(":"),setTimeout((function(){Array.from(e.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")}))}),300),j(e,"yes")):(e.dataset.sticky=["yes-hide-start"].concat(v(i)).join(":"),requestAnimationFrame((function(){e.dataset.sticky=e.dataset.sticky.replace("yes-hide-start","yes-hide-end"),setTimeout((function(){e.dataset.sticky=i.join(":"),setTimeout((function(){Array.from(e.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")}))}),300),j(e,"yes")}),200)}))))}({stickyContainer:t,isSticky:i,startPosition:e,stickyComponents:n})}}},H=function(){document.querySelector("header [data-sticky]")&&(window.addEventListener("resize",(function(t){q(t),i.a.trigger("ct:header:update")}),!1),window.addEventListener("orientationchange",(function(t){q(t),i.a.trigger("ct:header:update")})),window.addEventListener("scroll",q,!1),window.addEventListener("load",q,!1),q())};document.body.className.indexOf("e-preview")>-1?setTimeout((function(){H()}),500):H(),Object(o.registerDynamicChunk)("blocksy_sticky_header",{mount:function(t){}})}]);
1
+ !function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e){t.exports=window.ctEvents},function(t,e){t.exports=window.ctFrontend},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=r(1),a=function(t,e,r){return Math.max(t,Math.min(e,r))},c=function(t,e,r){return e[0]+(e[1]-e[0])/(t[1]-t[0])*(r-t[0])},s=function(t){if(t.blcInitialHeight)return t.blcInitialHeight;var e=t.firstElementChild.firstElementChild.getBoundingClientRect().height;return t.blcInitialHeight=e,e},u=function(t){var e=getComputedStyle(t),r=100;t.dataset.row.includes("middle")&&(r=e.getPropertyValue("--sticky-shrink"));var n=s(t);return r&&(n*=parseFloat(r)/100),n};function l(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var y=null,f=function(t){var e=t.stickyContainer,r=t.startPosition;l(e.querySelectorAll('[data-row*="middle"]')).map((function(t){if(t.querySelector('[data-id="logo"] .site-logo-container')){var e=t.querySelector('[data-id="logo"] .site-logo-container'),n=function(t){var e=t.logo,r=t.row;if(y)return y;var n=parseFloat(getComputedStyle(e).getPropertyValue("--logo-max-height")||50),i=parseFloat(getComputedStyle(e).getPropertyValue("--logo-sticky-shrink").toString().replace(",",".")||1),o=s(r),a=u(r);return y={initialHeight:n,stickyShrink:i,rowInitialHeight:o,rowStickyHeight:a}}({logo:e,row:t}),i=n.initialHeight,o=n.stickyShrink,l=n.rowInitialHeight,d=n.rowStickyHeight,f=i*o;1!==o&&e.style.setProperty("--logo-shrink-height","".concat(c([r,r+Math.abs(l===d?i-f:l-d)],[1,o],a(r,r+Math.abs(l===d?i-f:l-d),scrollY))*i,"px"))}}))},m=null,p=function(t){var e=t.stickyContainer,r=(t.containerInitialHeight,t.startPosition);e.querySelector('[data-row*="middle"]')&&[e.querySelector('[data-row*="middle"]')].map((function(t){var e=function(t){var e=t.row;if(m)return m;var r=s(e),n=u(e);return m={rowInitialHeight:r,rowStickyHeight:n}}({row:t}),n=e.rowInitialHeight,i=e.rowStickyHeight;n!==i&&t.style.setProperty("--shrink-height","".concat(c([r,r+Math.abs(n-i)],[n,i],a(r,r+Math.abs(n-i),scrollY)),"px"))}))};function h(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return g(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function b(t){return function(t){if(Array.isArray(t))return w(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var k=window.scrollY;function v(t){return function(t){if(Array.isArray(t))return S(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return S(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function A(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return O(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var j=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yes";Array.from(t.querySelectorAll("[data-row][data-transparent-row]")).map((function(t){t.dataset.transparentRow=e}))},x=null,C=null,I=null;window.wp&&wp.customize&&wp.customize.selectiveRefresh.bind("partial-content-rendered",(function(t){setTimeout((function(){x=null,C=null,I=null,Y=null,q()}),500)}));var P=function(t){if(-1===t.dataset.sticky.indexOf("shrink")&&-1===t.dataset.sticky.indexOf("auto-hide"))return t.parentNode.getBoundingClientRect().height+200;var e=t.closest("header").getBoundingClientRect().top+scrollY;if(e>0){var r=document.elementFromPoint(0,3);r&&function(t){for(var e=[];t&&t!==document;t=t.parentNode)e.push(t);return e}(r).map((function(t){return getComputedStyle(t).position})).indexOf("fixed")>-1&&(e-=r.getBoundingClientRect().height)}var n=t.parentNode,i=getComputedStyle(document.body),o=parseFloat(i.getPropertyValue("--header-sticky-offset")||0);if(1===n.parentNode.children.length||n.parentNode.children[0].classList.contains("ct-sticky-container"))return e>0?e-o:e;var a=Array.from(n.parentNode.children).reduce((function(t,e,r){return t.indexOf(0)>-1||!e.dataset.row?[].concat(A(t),[0]):[].concat(A(t),[e.classList.contains("ct-sticky-container")?0:e.getBoundingClientRect().height])}),[]).reduce((function(t,e){return t+e}),e);return a>0?a-o:a},Y=null,q=function(){if(Y!==scrollY){Y=scrollY;var t=document.querySelector('[data-device="'.concat(Object(o.getCurrentScreen)(),'"] [data-sticky]'));if(t){var e=x;null===e&&(e=P(t),x=e);var r=I;r||(r=parseInt(t.getBoundingClientRect().height),I=parseInt(r),document.body.style.setProperty("--header-sticky-height-animated","".concat(A(t.querySelectorAll("[data-row]")).reduce((function(t,e){return t+u(e)}),0),"px")));var n=t.dataset.sticky.split(":").filter((function(t){return"yes"!==t&&"no"!==t&&"fixed"!==t})),i=e>0&&Math.abs(window.scrollY-e)<5||window.scrollY>e;n.indexOf("shrink")>-1&&(i=e>0?window.scrollY>=e:window.scrollY>0),setTimeout((function(){i&&-1===document.body.dataset.header.indexOf("shrink")&&(document.body.dataset.header="".concat(document.body.dataset.header,":shrink")),!i&&document.body.dataset.header.indexOf("shrink")>-1&&(document.body.dataset.header=document.body.dataset.header.replace(":shrink",""))}),300);var a=C;a||(a=C=Array.from(t.querySelectorAll("[data-row]")).reduce((function(t,e){return t+e.getBoundingClientRect().height}),0),t.parentNode.style.height="".concat(a,"px")),n.indexOf("shrink")>-1&&function(t){var e=t.containerInitialHeight,r=t.stickyContainer,n=(t.stickyContainerHeight,t.isSticky),i=t.startPosition,o=t.stickyComponents;if(0===i&&0===window.scrollY&&(r.dataset.sticky=["fixed"].concat(h(o)).join(":")),n){if(o.indexOf("yes")>-1)return;-1===r.dataset.sticky.indexOf("yes")&&(j(r,"no"),r.dataset.sticky=["yes"].concat(h(o)).join(":")),f({stickyContainer:r,startPosition:i}),p({stickyContainer:r,containerInitialHeight:e,startPosition:i})}else Array.from(r.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")})),Array.from(r.querySelectorAll('[data-row*="middle"] .site-logo-container')).map((function(t){return t.removeAttribute("style")})),j(r,"yes"),0===i&&0===window.scrollY?r.dataset.sticky=["fixed"].concat(h(o)).join(":"):r.dataset.sticky=o.join(":")}({stickyContainer:t,stickyContainerHeight:r,containerInitialHeight:a,isSticky:i,startPosition:e,stickyComponents:n}),n.indexOf("auto-hide")>-1&&function(t){var e=t.startPosition,r=t.stickyContainer,n=t.isSticky,i=t.stickyComponents;if(window.scrollY<e&&(k=window.scrollY),n&&window.scrollY-k==0&&document.body.style.setProperty("--header-sticky-height-animated","0px"),n&&window.scrollY-k<-5)-1===r.dataset.sticky.indexOf("yes")&&(r.dataset.sticky=["yes-start"].concat(b(i)).join(":"),requestAnimationFrame((function(){r.dataset.sticky=r.dataset.sticky.replace("yes-start","yes-end"),setTimeout((function(){r.dataset.sticky=r.dataset.sticky.replace("yes-end","yes")}),200)}))),j(r,"no"),document.body.removeAttribute("style");else{if(!n)return r.dataset.sticky=i.filter((function(t){return"yes-end"!==t})).join(":"),Array.from(r.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")})),j(r,"yes"),document.body.style.setProperty("--header-sticky-height-animated","0px"),void(k=window.scrollY);-1===r.dataset.sticky.indexOf("yes-hide")&&r.dataset.sticky.indexOf("yes:")>-1&&window.scrollY-k>5&&(r.dataset.sticky=["yes-hide-start"].concat(b(i)).join(":"),document.body.style.setProperty("--header-sticky-height-animated","0px"),requestAnimationFrame((function(){r.dataset.sticky=r.dataset.sticky.replace("yes-hide-start","yes-hide-end"),setTimeout((function(){r.dataset.sticky=i.join(":"),Array.from(r.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")})),j(r,"yes")}),200)})))}k=window.scrollY}({stickyContainer:t,isSticky:i,startPosition:e,stickyComponents:n}),(n.indexOf("slide")>-1||n.indexOf("fade")>-1)&&function(t){var e=t.stickyContainer,r=t.isSticky,n=t.startPosition,i=t.stickyComponents;r?(-1===e.dataset.sticky.indexOf("yes")&&(e.dataset.sticky=["yes-start"].concat(v(i)).join(":"),setTimeout((function(){e.dataset.sticky=e.dataset.sticky.replace("yes-start","yes-end"),setTimeout((function(){e.dataset.sticky=e.dataset.sticky.replace("yes-end","yes")}),200)}),1)),j(e,"no")):-1===e.dataset.sticky.indexOf("yes-hide")&&e.dataset.sticky.indexOf("yes:")>-1&&(Math.abs(window.scrollY-n)>10?(e.dataset.sticky=i.join(":"),setTimeout((function(){Array.from(e.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")}))}),300),j(e,"yes")):(e.dataset.sticky=["yes-hide-start"].concat(v(i)).join(":"),requestAnimationFrame((function(){e.dataset.sticky=e.dataset.sticky.replace("yes-hide-start","yes-hide-end"),setTimeout((function(){e.dataset.sticky=i.join(":"),setTimeout((function(){Array.from(e.querySelectorAll("[data-row]")).map((function(t){return t.removeAttribute("style")}))}),300),j(e,"yes")}),200)}))))}({stickyContainer:t,isSticky:i,startPosition:e,stickyComponents:n})}}},H=function(){document.querySelector("header [data-sticky]")&&(window.addEventListener("resize",(function(t){q(t),i.a.trigger("ct:header:update")}),!1),window.addEventListener("orientationchange",(function(t){q(t),i.a.trigger("ct:header:update")})),window.addEventListener("scroll",q,!1),window.addEventListener("load",q,!1),q())};document.body.className.indexOf("e-preview")>-1?setTimeout((function(){H()}),500):H(),Object(o.registerDynamicChunk)("blocksy_sticky_header",{mount:function(t){}})}]);
static/js/frontend/account.js CHANGED
@@ -172,7 +172,9 @@ export const handleAccountModal = (el) => {
172
 
173
  let body = new FormData(maybeLogin)
174
 
175
- let url = maybeLogin.action
 
 
176
 
177
  if (window.WFLSVars && !maybeLogin.loginProceed) {
178
  body.append('action', 'wordfence_ls_authenticate')
172
 
173
  let body = new FormData(maybeLogin)
174
 
175
+ // let url = maybeLogin.action
176
+
177
+ let url = `${ct_localizations.ajax_url}?action=blc_implement_user_login`
178
 
179
  if (window.WFLSVars && !maybeLogin.loginProceed) {
180
  body.append('action', 'wordfence_ls_authenticate')
static/js/frontend/sticky.js CHANGED
@@ -29,13 +29,21 @@ let cachedStartPosition = null
29
  let cachedContainerInitialHeight = null
30
  let cachedStickyContainerHeight = null
31
 
32
- ctEvents.on('ct:header:update', () => {
33
- cachedStartPosition = null
34
- cachedContainerInitialHeight = null
35
- cachedStickyContainerHeight = null
36
-
37
- compute()
38
- })
 
 
 
 
 
 
 
 
39
 
40
  const getStartPositionFor = (stickyContainer) => {
41
  if (
@@ -68,14 +76,21 @@ const getStartPositionFor = (stickyContainer) => {
68
 
69
  const row = stickyContainer.parentNode
70
 
 
 
 
 
 
71
  if (
72
  row.parentNode.children.length === 1 ||
73
  row.parentNode.children[0].classList.contains('ct-sticky-container')
74
  ) {
75
- return stickyOffset
 
 
76
  }
77
 
78
- return Array.from(row.parentNode.children)
79
  .reduce((result, el, index) => {
80
  if (result.indexOf(0) > -1 || !el.dataset.row) {
81
  return [...result, 0]
@@ -90,6 +105,8 @@ const getStartPositionFor = (stickyContainer) => {
90
  }
91
  }, [])
92
  .reduce((sum, height) => sum + height, stickyOffset)
 
 
93
  }
94
 
95
  let prevScrollY = null
29
  let cachedContainerInitialHeight = null
30
  let cachedStickyContainerHeight = null
31
 
32
+ if (window.wp && wp.customize) {
33
+ wp.customize.selectiveRefresh.bind(
34
+ 'partial-content-rendered',
35
+ (placement) => {
36
+ setTimeout(() => {
37
+ cachedStartPosition = null
38
+ cachedContainerInitialHeight = null
39
+ cachedStickyContainerHeight = null
40
+ prevScrollY = null
41
+
42
+ compute()
43
+ }, 500)
44
+ }
45
+ )
46
+ }
47
 
48
  const getStartPositionFor = (stickyContainer) => {
49
  if (
76
 
77
  const row = stickyContainer.parentNode
78
 
79
+ const bodyComp = getComputedStyle(document.body)
80
+ let maybeDynamicOffset = parseFloat(
81
+ bodyComp.getPropertyValue('--header-sticky-offset') || 0
82
+ )
83
+
84
  if (
85
  row.parentNode.children.length === 1 ||
86
  row.parentNode.children[0].classList.contains('ct-sticky-container')
87
  ) {
88
+ return stickyOffset > 0
89
+ ? stickyOffset - maybeDynamicOffset
90
+ : stickyOffset
91
  }
92
 
93
+ let finalResult = Array.from(row.parentNode.children)
94
  .reduce((result, el, index) => {
95
  if (result.indexOf(0) > -1 || !el.dataset.row) {
96
  return [...result, 0]
105
  }
106
  }, [])
107
  .reduce((sum, height) => sum + height, stickyOffset)
108
+
109
+ return finalResult > 0 ? finalResult - maybeDynamicOffset : finalResult
110
  }
111
 
112
  let prevScrollY = null
static/js/options/CustomizerOptionsManager.js CHANGED
@@ -11,6 +11,8 @@ import { Overlay } from 'blocksy-options'
11
 
12
  import classnames from 'classnames'
13
 
 
 
14
  const CustomizerOptionsManager = () => {
15
  const [futureConfig, setFutureConfig] = useState(null)
16
  const [isCopyingOptions, setIsCopyingOptions] = useState(null)
@@ -162,26 +164,23 @@ const CustomizerOptionsManager = () => {
162
  reader.readAsText(futureConfig, 'UTF-8')
163
 
164
  reader.onload = function (evt) {
165
- const body = new FormData()
166
-
167
- body.append(
168
- 'action',
169
- 'blocksy_customizer_import'
170
- )
171
-
172
- body.append(
173
- 'nonce',
174
- ct_customizer_localizations.customizer_reset_none
175
- )
176
-
177
- body.append('wp_customize', 'on')
178
- body.append('data', evt.target.result)
179
-
180
  try {
181
- fetch(window.ajaxurl, {
182
- method: 'POST',
183
- body,
184
- }).then((response) => {
 
 
 
 
 
 
 
 
 
 
 
 
185
  if (response.status === 200) {
186
  response
187
  .json()
@@ -456,11 +455,6 @@ const CustomizerOptionsManager = () => {
456
  return
457
  }
458
 
459
- console.log(
460
- 'here',
461
- data.site_url
462
- )
463
-
464
  var blob = new Blob(
465
  [data.data],
466
  {
11
 
12
  import classnames from 'classnames'
13
 
14
+ import phpUnserialize from 'phpunserialize'
15
+
16
  const CustomizerOptionsManager = () => {
17
  const [futureConfig, setFutureConfig] = useState(null)
18
  const [isCopyingOptions, setIsCopyingOptions] = useState(null)
164
  reader.readAsText(futureConfig, 'UTF-8')
165
 
166
  reader.onload = function (evt) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  try {
168
+ fetch(
169
+ `${window.ajaxurl}?action=blocksy_customizer_import&wp_customize=on&nonce=${ct_customizer_localizations.customizer_reset_none}`,
170
+ {
171
+ method: 'POST',
172
+ headers: {
173
+ Accept: 'application/json',
174
+ 'Content-Type':
175
+ 'application/json',
176
+ },
177
+ body: JSON.stringify(
178
+ phpUnserialize(
179
+ evt.target.result
180
+ )
181
+ ),
182
+ }
183
+ ).then((response) => {
184
  if (response.status === 200) {
185
  response
186
  .json()
455
  return
456
  }
457
 
 
 
 
 
 
458
  var blob = new Blob(
459
  [data.data],
460
  {